田源
2024-04-07 2ac55ce0edf4870a29691b56bfad59f4830a11a2
1
2
3
4
5
6
7
8
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"00ee":function(t,e,i){var n=i("b622"),o=n("toStringTag"),r={};r[o]="z",t.exports="[object z]"===String(r)},"0366":function(t,e,i){var n=i("e330"),o=i("59ed"),r=n(n.bind);t.exports=function(t,e){return o(t),void 0===e?t:r?r(t,e):function(){return t.apply(e,arguments)}}},"06cf":function(t,e,i){var n=i("83ab"),o=i("c65b"),r=i("d1e7"),s=i("5c6c"),a=i("fc6a"),h=i("a04b"),l=i("1a2d"),u=i("0cfb"),c=Object.getOwnPropertyDescriptor;e.f=n?c:function(t,e){if(t=a(t),e=h(e),u)try{return c(t,e)}catch(i){}if(l(t,e))return s(!o(r.f,t,e),t[e])}},"07fa":function(t,e,i){var n=i("50c4");t.exports=function(t){return n(t.length)}},"0cfb":function(t,e,i){var n=i("83ab"),o=i("d039"),r=i("cc12");t.exports=!n&&!o((function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a}))},"0d51":function(t,e,i){var n=i("da84"),o=n.String;t.exports=function(t){try{return o(t)}catch(e){return"Object"}}},"107c":function(t,e,i){var n=i("d039"),o=i("da84"),r=o.RegExp;t.exports=n((function(){var t=r("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},1626:function(t,e){t.exports=function(t){return"function"==typeof t}},"19aa":function(t,e,i){var n=i("da84"),o=i("3a9b"),r=n.TypeError;t.exports=function(t,e){if(o(e,t))return t;throw r("Incorrect invocation")}},"1a2d":function(t,e,i){var n=i("e330"),o=i("7b0b"),r=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return r(o(t),e)}},"1be4":function(t,e,i){var n=i("d066");t.exports=n("document","documentElement")},"1c7e":function(t,e,i){var n=i("b622"),o=n("iterator"),r=!1;try{var s=0,a={next:function(){return{done:!!s++}},return:function(){r=!0}};a[o]=function(){return this},Array.from(a,(function(){throw 2}))}catch(h){}t.exports=function(t,e){if(!e&&!r)return!1;var i=!1;try{var n={};n[o]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(h){}return i}},"1cdc":function(t,e,i){var n=i("342f");t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},"1d80":function(t,e,i){var n=i("da84"),o=n.TypeError;t.exports=function(t){if(void 0==t)throw o("Can't call method on "+t);return t}},2266:function(t,e,i){var n=i("da84"),o=i("0366"),r=i("c65b"),s=i("825a"),a=i("0d51"),h=i("e95a"),l=i("07fa"),u=i("3a9b"),c=i("9a1f"),f=i("35a1"),d=i("2a62"),p=n.TypeError,g=function(t,e){this.stopped=t,this.result=e},y=g.prototype;t.exports=function(t,e,i){var n,m,v,x,b,w,k,M=i&&i.that,S=!(!i||!i.AS_ENTRIES),P=!(!i||!i.IS_ITERATOR),N=!(!i||!i.INTERRUPTED),C=o(e,M),T=function(t){return n&&d(n,"normal",t),new g(!0,t)},A=function(t){return S?(s(t),N?C(t[0],t[1],T):C(t[0],t[1])):N?C(t,T):C(t)};if(P)n=t;else{if(m=f(t),!m)throw p(a(t)+" is not iterable");if(h(m)){for(v=0,x=l(t);x>v;v++)if(b=A(t[v]),b&&u(y,b))return b;return new g(!1)}n=c(t,m)}w=n.next;while(!(k=r(w,n)).done){try{b=A(k.value)}catch(L){d(n,"throw",L)}if("object"==typeof b&&b&&u(y,b))return b}return new g(!1)}},"23cb":function(t,e,i){var n=i("5926"),o=Math.max,r=Math.min;t.exports=function(t,e){var i=n(t);return i<0?o(i+e,0):r(i,e)}},"23e7":function(t,e,i){var n=i("da84"),o=i("06cf").f,r=i("9112"),s=i("6eeb"),a=i("ce4e"),h=i("e893"),l=i("94ca");t.exports=function(t,e){var i,u,c,f,d,p,g=t.target,y=t.global,m=t.stat;if(u=y?n:m?n[g]||a(g,{}):(n[g]||{}).prototype,u)for(c in e){if(d=e[c],t.noTargetGet?(p=o(u,c),f=p&&p.value):f=u[c],i=l(y?c:g+(m?".":"#")+c,t.forced),!i&&void 0!==f){if(typeof d==typeof f)continue;h(d,f)}(t.sham||f&&f.sham)&&r(d,"sham",!0),s(u,c,d,t)}}},"241c":function(t,e,i){var n=i("ca84"),o=i("7839"),r=o.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,r)}},"25f0":function(t,e,i){"use strict";var n=i("e330"),o=i("5e77").PROPER,r=i("6eeb"),s=i("825a"),a=i("3a9b"),h=i("577e"),l=i("d039"),u=i("ad6d"),c="toString",f=RegExp.prototype,d=f[c],p=n(u),g=l((function(){return"/a/b"!=d.call({source:"a",flags:"b"})})),y=o&&d.name!=c;(g||y)&&r(RegExp.prototype,c,(function(){var t=s(this),e=h(t.source),i=t.flags,n=h(void 0===i&&a(f,t)&&!("flags"in f)?p(t):i);return"/"+e+"/"+n}),{unsafe:!0})},2626:function(t,e,i){"use strict";var n=i("d066"),o=i("9bf2"),r=i("b622"),s=i("83ab"),a=r("species");t.exports=function(t){var e=n(t),i=o.f;s&&e&&!e[a]&&i(e,a,{configurable:!0,get:function(){return this}})}},2877:function(t,e,i){"use strict";function n(t,e,i,n,o,r,s,a){var h,l="function"===typeof t?t.options:t;if(e&&(l.render=e,l.staticRenderFns=i,l._compiled=!0),n&&(l.functional=!0),r&&(l._scopeId="data-v-"+r),s?(h=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=h):o&&(h=a?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),h)if(l.functional){l._injectStyles=h;var u=l.render;l.render=function(t,e){return h.call(e),u(t,e)}}else{var c=l.beforeCreate;l.beforeCreate=c?[].concat(c,h):[h]}return{exports:t,options:l}}i.d(e,"a",(function(){return n}))},"2a62":function(t,e,i){var n=i("c65b"),o=i("825a"),r=i("dc4a");t.exports=function(t,e,i){var s,a;o(t);try{if(s=r(t,"return"),!s){if("throw"===e)throw i;return i}s=n(s,t)}catch(h){a=!0,s=h}if("throw"===e)throw i;if(a)throw s;return o(s),i}},"2b0e":function(t,e,i){"use strict";(function(t){
/*!
 * Vue.js v2.6.14
 * (c) 2014-2021 Evan You
 * Released under the MIT License.
 */
var i=Object.freeze({});function n(t){return void 0===t||null===t}function o(t){return void 0!==t&&null!==t}function r(t){return!0===t}function s(t){return!1===t}function a(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function h(t){return null!==t&&"object"===typeof t}var l=Object.prototype.toString;function u(t){return"[object Object]"===l.call(t)}function c(t){return"[object RegExp]"===l.call(t)}function f(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return o(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function p(t){return null==t?"":Array.isArray(t)||u(t)&&t.toString===l?JSON.stringify(t,null,2):String(t)}function g(t){var e=parseFloat(t);return isNaN(e)?t:e}function y(t,e){for(var i=Object.create(null),n=t.split(","),o=0;o<n.length;o++)i[n[o]]=!0;return e?function(t){return i[t.toLowerCase()]}:function(t){return i[t]}}y("slot,component",!0);var m=y("key,ref,slot,slot-scope,is");function v(t,e){if(t.length){var i=t.indexOf(e);if(i>-1)return t.splice(i,1)}}var x=Object.prototype.hasOwnProperty;function b(t,e){return x.call(t,e)}function w(t){var e=Object.create(null);return function(i){var n=e[i];return n||(e[i]=t(i))}}var k=/-(\w)/g,M=w((function(t){return t.replace(k,(function(t,e){return e?e.toUpperCase():""}))})),S=w((function(t){return t.charAt(0).toUpperCase()+t.slice(1)})),P=/\B([A-Z])/g,N=w((function(t){return t.replace(P,"-$1").toLowerCase()}));function C(t,e){function i(i){var n=arguments.length;return n?n>1?t.apply(e,arguments):t.call(e,i):t.call(e)}return i._length=t.length,i}function T(t,e){return t.bind(e)}var A=Function.prototype.bind?T:C;function L(t,e){e=e||0;var i=t.length-e,n=new Array(i);while(i--)n[i]=t[i+e];return n}function j(t,e){for(var i in e)t[i]=e[i];return t}function O(t){for(var e={},i=0;i<t.length;i++)t[i]&&j(e,t[i]);return e}function D(t,e,i){}var F=function(t,e,i){return!1},B=function(t){return t};function I(t,e){if(t===e)return!0;var i=h(t),n=h(e);if(!i||!n)return!i&&!n&&String(t)===String(e);try{var o=Array.isArray(t),r=Array.isArray(e);if(o&&r)return t.length===e.length&&t.every((function(t,i){return I(t,e[i])}));if(t instanceof Date&&e instanceof Date)return t.getTime()===e.getTime();if(o||r)return!1;var s=Object.keys(t),a=Object.keys(e);return s.length===a.length&&s.every((function(i){return I(t[i],e[i])}))}catch(l){return!1}}function E(t,e){for(var i=0;i<t.length;i++)if(I(t[i],e))return i;return-1}function R(t){var e=!1;return function(){e||(e=!0,t.apply(this,arguments))}}var z="data-server-rendered",V=["component","directive","filter"],G=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],Y={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:F,isReservedAttr:F,isUnknownElement:F,getTagNamespace:D,parsePlatformTagName:B,mustUseProp:F,async:!0,_lifecycleHooks:G},X=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function q(t){var e=(t+"").charCodeAt(0);return 36===e||95===e}function U(t,e,i,n){Object.defineProperty(t,e,{value:i,enumerable:!!n,writable:!0,configurable:!0})}var K=new RegExp("[^"+X.source+".$_\\d]");function H(t){if(!K.test(t)){var e=t.split(".");return function(t){for(var i=0;i<e.length;i++){if(!t)return;t=t[e[i]]}return t}}}var _,W="__proto__"in{},$="undefined"!==typeof window,J="undefined"!==typeof WXEnvironment&&!!WXEnvironment.platform,Z=J&&WXEnvironment.platform.toLowerCase(),Q=$&&window.navigator.userAgent.toLowerCase(),tt=Q&&/msie|trident/.test(Q),et=Q&&Q.indexOf("msie 9.0")>0,it=Q&&Q.indexOf("edge/")>0,nt=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===Z),ot=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),rt={}.watch,st=!1;if($)try{var at={};Object.defineProperty(at,"passive",{get:function(){st=!0}}),window.addEventListener("test-passive",null,at)}catch(Ss){}var ht=function(){return void 0===_&&(_=!$&&!J&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),_},lt=$&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ut(t){return"function"===typeof t&&/native code/.test(t.toString())}var ct,ft="undefined"!==typeof Symbol&&ut(Symbol)&&"undefined"!==typeof Reflect&&ut(Reflect.ownKeys);ct="undefined"!==typeof Set&&ut(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var dt=D,pt=0,gt=function(){this.id=pt++,this.subs=[]};gt.prototype.addSub=function(t){this.subs.push(t)},gt.prototype.removeSub=function(t){v(this.subs,t)},gt.prototype.depend=function(){gt.target&&gt.target.addDep(this)},gt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,i=t.length;e<i;e++)t[e].update()},gt.target=null;var yt=[];function mt(t){yt.push(t),gt.target=t}function vt(){yt.pop(),gt.target=yt[yt.length-1]}var xt=function(t,e,i,n,o,r,s,a){this.tag=t,this.data=e,this.children=i,this.text=n,this.elm=o,this.ns=void 0,this.context=r,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=e&&e.key,this.componentOptions=s,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=a,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},bt={child:{configurable:!0}};bt.child.get=function(){return this.componentInstance},Object.defineProperties(xt.prototype,bt);var wt=function(t){void 0===t&&(t="");var e=new xt;return e.text=t,e.isComment=!0,e};function kt(t){return new xt(void 0,void 0,void 0,String(t))}function Mt(t){var e=new xt(t.tag,t.data,t.children&&t.children.slice(),t.text,t.elm,t.context,t.componentOptions,t.asyncFactory);return e.ns=t.ns,e.isStatic=t.isStatic,e.key=t.key,e.isComment=t.isComment,e.fnContext=t.fnContext,e.fnOptions=t.fnOptions,e.fnScopeId=t.fnScopeId,e.asyncMeta=t.asyncMeta,e.isCloned=!0,e}var St=Array.prototype,Pt=Object.create(St),Nt=["push","pop","shift","unshift","splice","sort","reverse"];Nt.forEach((function(t){var e=St[t];U(Pt,t,(function(){var i=[],n=arguments.length;while(n--)i[n]=arguments[n];var o,r=e.apply(this,i),s=this.__ob__;switch(t){case"push":case"unshift":o=i;break;case"splice":o=i.slice(2);break}return o&&s.observeArray(o),s.dep.notify(),r}))}));var Ct=Object.getOwnPropertyNames(Pt),Tt=!0;function At(t){Tt=t}var Lt=function(t){this.value=t,this.dep=new gt,this.vmCount=0,U(t,"__ob__",this),Array.isArray(t)?(W?jt(t,Pt):Ot(t,Pt,Ct),this.observeArray(t)):this.walk(t)};function jt(t,e){t.__proto__=e}function Ot(t,e,i){for(var n=0,o=i.length;n<o;n++){var r=i[n];U(t,r,e[r])}}function Dt(t,e){var i;if(h(t)&&!(t instanceof xt))return b(t,"__ob__")&&t.__ob__ instanceof Lt?i=t.__ob__:Tt&&!ht()&&(Array.isArray(t)||u(t))&&Object.isExtensible(t)&&!t._isVue&&(i=new Lt(t)),e&&i&&i.vmCount++,i}function Ft(t,e,i,n,o){var r=new gt,s=Object.getOwnPropertyDescriptor(t,e);if(!s||!1!==s.configurable){var a=s&&s.get,h=s&&s.set;a&&!h||2!==arguments.length||(i=t[e]);var l=!o&&Dt(i);Object.defineProperty(t,e,{enumerable:!0,configurable:!0,get:function(){var e=a?a.call(t):i;return gt.target&&(r.depend(),l&&(l.dep.depend(),Array.isArray(e)&&Et(e))),e},set:function(e){var n=a?a.call(t):i;e===n||e!==e&&n!==n||a&&!h||(h?h.call(t,e):i=e,l=!o&&Dt(e),r.notify())}})}}function Bt(t,e,i){if(Array.isArray(t)&&f(e))return t.length=Math.max(t.length,e),t.splice(e,1,i),i;if(e in t&&!(e in Object.prototype))return t[e]=i,i;var n=t.__ob__;return t._isVue||n&&n.vmCount?i:n?(Ft(n.value,e,i),n.dep.notify(),i):(t[e]=i,i)}function It(t,e){if(Array.isArray(t)&&f(e))t.splice(e,1);else{var i=t.__ob__;t._isVue||i&&i.vmCount||b(t,e)&&(delete t[e],i&&i.dep.notify())}}function Et(t){for(var e=void 0,i=0,n=t.length;i<n;i++)e=t[i],e&&e.__ob__&&e.__ob__.dep.depend(),Array.isArray(e)&&Et(e)}Lt.prototype.walk=function(t){for(var e=Object.keys(t),i=0;i<e.length;i++)Ft(t,e[i])},Lt.prototype.observeArray=function(t){for(var e=0,i=t.length;e<i;e++)Dt(t[e])};var Rt=Y.optionMergeStrategies;function zt(t,e){if(!e)return t;for(var i,n,o,r=ft?Reflect.ownKeys(e):Object.keys(e),s=0;s<r.length;s++)i=r[s],"__ob__"!==i&&(n=t[i],o=e[i],b(t,i)?n!==o&&u(n)&&u(o)&&zt(n,o):Bt(t,i,o));return t}function Vt(t,e,i){return i?function(){var n="function"===typeof e?e.call(i,i):e,o="function"===typeof t?t.call(i,i):t;return n?zt(n,o):o}:e?t?function(){return zt("function"===typeof e?e.call(this,this):e,"function"===typeof t?t.call(this,this):t)}:e:t}function Gt(t,e){var i=e?t?t.concat(e):Array.isArray(e)?e:[e]:t;return i?Yt(i):i}function Yt(t){for(var e=[],i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e}function Xt(t,e,i,n){var o=Object.create(t||null);return e?j(o,e):o}Rt.data=function(t,e,i){return i?Vt(t,e,i):e&&"function"!==typeof e?t:Vt(t,e)},G.forEach((function(t){Rt[t]=Gt})),V.forEach((function(t){Rt[t+"s"]=Xt})),Rt.watch=function(t,e,i,n){if(t===rt&&(t=void 0),e===rt&&(e=void 0),!e)return Object.create(t||null);if(!t)return e;var o={};for(var r in j(o,t),e){var s=o[r],a=e[r];s&&!Array.isArray(s)&&(s=[s]),o[r]=s?s.concat(a):Array.isArray(a)?a:[a]}return o},Rt.props=Rt.methods=Rt.inject=Rt.computed=function(t,e,i,n){if(!t)return e;var o=Object.create(null);return j(o,t),e&&j(o,e),o},Rt.provide=Vt;var qt=function(t,e){return void 0===e?t:e};function Ut(t,e){var i=t.props;if(i){var n,o,r,s={};if(Array.isArray(i)){n=i.length;while(n--)o=i[n],"string"===typeof o&&(r=M(o),s[r]={type:null})}else if(u(i))for(var a in i)o=i[a],r=M(a),s[r]=u(o)?o:{type:o};else 0;t.props=s}}function Kt(t,e){var i=t.inject;if(i){var n=t.inject={};if(Array.isArray(i))for(var o=0;o<i.length;o++)n[i[o]]={from:i[o]};else if(u(i))for(var r in i){var s=i[r];n[r]=u(s)?j({from:r},s):{from:s}}else 0}}function Ht(t){var e=t.directives;if(e)for(var i in e){var n=e[i];"function"===typeof n&&(e[i]={bind:n,update:n})}}function _t(t,e,i){if("function"===typeof e&&(e=e.options),Ut(e,i),Kt(e,i),Ht(e),!e._base&&(e.extends&&(t=_t(t,e.extends,i)),e.mixins))for(var n=0,o=e.mixins.length;n<o;n++)t=_t(t,e.mixins[n],i);var r,s={};for(r in t)a(r);for(r in e)b(t,r)||a(r);function a(n){var o=Rt[n]||qt;s[n]=o(t[n],e[n],i,n)}return s}function Wt(t,e,i,n){if("string"===typeof i){var o=t[e];if(b(o,i))return o[i];var r=M(i);if(b(o,r))return o[r];var s=S(r);if(b(o,s))return o[s];var a=o[i]||o[r]||o[s];return a}}function $t(t,e,i,n){var o=e[t],r=!b(i,t),s=i[t],a=ee(Boolean,o.type);if(a>-1)if(r&&!b(o,"default"))s=!1;else if(""===s||s===N(t)){var h=ee(String,o.type);(h<0||a<h)&&(s=!0)}if(void 0===s){s=Jt(n,o,t);var l=Tt;At(!0),Dt(s),At(l)}return s}function Jt(t,e,i){if(b(e,"default")){var n=e.default;return t&&t.$options.propsData&&void 0===t.$options.propsData[i]&&void 0!==t._props[i]?t._props[i]:"function"===typeof n&&"Function"!==Qt(e.type)?n.call(t):n}}var Zt=/^\s*function (\w+)/;function Qt(t){var e=t&&t.toString().match(Zt);return e?e[1]:""}function te(t,e){return Qt(t)===Qt(e)}function ee(t,e){if(!Array.isArray(e))return te(e,t)?0:-1;for(var i=0,n=e.length;i<n;i++)if(te(e[i],t))return i;return-1}function ie(t,e,i){mt();try{if(e){var n=e;while(n=n.$parent){var o=n.$options.errorCaptured;if(o)for(var r=0;r<o.length;r++)try{var s=!1===o[r].call(n,t,e,i);if(s)return}catch(Ss){oe(Ss,n,"errorCaptured hook")}}}oe(t,e,i)}finally{vt()}}function ne(t,e,i,n,o){var r;try{r=i?t.apply(e,i):t.call(e),r&&!r._isVue&&d(r)&&!r._handled&&(r.catch((function(t){return ie(t,n,o+" (Promise/async)")})),r._handled=!0)}catch(Ss){ie(Ss,n,o)}return r}function oe(t,e,i){if(Y.errorHandler)try{return Y.errorHandler.call(null,t,e,i)}catch(Ss){Ss!==t&&re(Ss,null,"config.errorHandler")}re(t,e,i)}function re(t,e,i){if(!$&&!J||"undefined"===typeof console)throw t;console.error(t)}var se,ae=!1,he=[],le=!1;function ue(){le=!1;var t=he.slice(0);he.length=0;for(var e=0;e<t.length;e++)t[e]()}if("undefined"!==typeof Promise&&ut(Promise)){var ce=Promise.resolve();se=function(){ce.then(ue),nt&&setTimeout(D)},ae=!0}else if(tt||"undefined"===typeof MutationObserver||!ut(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())se="undefined"!==typeof setImmediate&&ut(setImmediate)?function(){setImmediate(ue)}:function(){setTimeout(ue,0)};else{var fe=1,de=new MutationObserver(ue),pe=document.createTextNode(String(fe));de.observe(pe,{characterData:!0}),se=function(){fe=(fe+1)%2,pe.data=String(fe)},ae=!0}function ge(t,e){var i;if(he.push((function(){if(t)try{t.call(e)}catch(Ss){ie(Ss,e,"nextTick")}else i&&i(e)})),le||(le=!0,se()),!t&&"undefined"!==typeof Promise)return new Promise((function(t){i=t}))}var ye=new ct;function me(t){ve(t,ye),ye.clear()}function ve(t,e){var i,n,o=Array.isArray(t);if(!(!o&&!h(t)||Object.isFrozen(t)||t instanceof xt)){if(t.__ob__){var r=t.__ob__.dep.id;if(e.has(r))return;e.add(r)}if(o){i=t.length;while(i--)ve(t[i],e)}else{n=Object.keys(t),i=n.length;while(i--)ve(t[n[i]],e)}}}var xe=w((function(t){var e="&"===t.charAt(0);t=e?t.slice(1):t;var i="~"===t.charAt(0);t=i?t.slice(1):t;var n="!"===t.charAt(0);return t=n?t.slice(1):t,{name:t,once:i,capture:n,passive:e}}));function be(t,e){function i(){var t=arguments,n=i.fns;if(!Array.isArray(n))return ne(n,null,arguments,e,"v-on handler");for(var o=n.slice(),r=0;r<o.length;r++)ne(o[r],null,t,e,"v-on handler")}return i.fns=t,i}function we(t,e,i,o,s,a){var h,l,u,c;for(h in t)l=t[h],u=e[h],c=xe(h),n(l)||(n(u)?(n(l.fns)&&(l=t[h]=be(l,a)),r(c.once)&&(l=t[h]=s(c.name,l,c.capture)),i(c.name,l,c.capture,c.passive,c.params)):l!==u&&(u.fns=l,t[h]=u));for(h in e)n(t[h])&&(c=xe(h),o(c.name,e[h],c.capture))}function ke(t,e,i){var s;t instanceof xt&&(t=t.data.hook||(t.data.hook={}));var a=t[e];function h(){i.apply(this,arguments),v(s.fns,h)}n(a)?s=be([h]):o(a.fns)&&r(a.merged)?(s=a,s.fns.push(h)):s=be([a,h]),s.merged=!0,t[e]=s}function Me(t,e,i){var r=e.options.props;if(!n(r)){var s={},a=t.attrs,h=t.props;if(o(a)||o(h))for(var l in r){var u=N(l);Se(s,h,l,u,!0)||Se(s,a,l,u,!1)}return s}}function Se(t,e,i,n,r){if(o(e)){if(b(e,i))return t[i]=e[i],r||delete e[i],!0;if(b(e,n))return t[i]=e[n],r||delete e[n],!0}return!1}function Pe(t){for(var e=0;e<t.length;e++)if(Array.isArray(t[e]))return Array.prototype.concat.apply([],t);return t}function Ne(t){return a(t)?[kt(t)]:Array.isArray(t)?Te(t):void 0}function Ce(t){return o(t)&&o(t.text)&&s(t.isComment)}function Te(t,e){var i,s,h,l,u=[];for(i=0;i<t.length;i++)s=t[i],n(s)||"boolean"===typeof s||(h=u.length-1,l=u[h],Array.isArray(s)?s.length>0&&(s=Te(s,(e||"")+"_"+i),Ce(s[0])&&Ce(l)&&(u[h]=kt(l.text+s[0].text),s.shift()),u.push.apply(u,s)):a(s)?Ce(l)?u[h]=kt(l.text+s):""!==s&&u.push(kt(s)):Ce(s)&&Ce(l)?u[h]=kt(l.text+s.text):(r(t._isVList)&&o(s.tag)&&n(s.key)&&o(e)&&(s.key="__vlist"+e+"_"+i+"__"),u.push(s)));return u}function Ae(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function Le(t){var e=je(t.$options.inject,t);e&&(At(!1),Object.keys(e).forEach((function(i){Ft(t,i,e[i])})),At(!0))}function je(t,e){if(t){for(var i=Object.create(null),n=ft?Reflect.ownKeys(t):Object.keys(t),o=0;o<n.length;o++){var r=n[o];if("__ob__"!==r){var s=t[r].from,a=e;while(a){if(a._provided&&b(a._provided,s)){i[r]=a._provided[s];break}a=a.$parent}if(!a)if("default"in t[r]){var h=t[r].default;i[r]="function"===typeof h?h.call(e):h}else 0}}return i}}function Oe(t,e){if(!t||!t.length)return{};for(var i={},n=0,o=t.length;n<o;n++){var r=t[n],s=r.data;if(s&&s.attrs&&s.attrs.slot&&delete s.attrs.slot,r.context!==e&&r.fnContext!==e||!s||null==s.slot)(i.default||(i.default=[])).push(r);else{var a=s.slot,h=i[a]||(i[a]=[]);"template"===r.tag?h.push.apply(h,r.children||[]):h.push(r)}}for(var l in i)i[l].every(De)&&delete i[l];return i}function De(t){return t.isComment&&!t.asyncFactory||" "===t.text}function Fe(t){return t.isComment&&t.asyncFactory}function Be(t,e,n){var o,r=Object.keys(e).length>0,s=t?!!t.$stable:!r,a=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&n&&n!==i&&a===n.$key&&!r&&!n.$hasNormal)return n;for(var h in o={},t)t[h]&&"$"!==h[0]&&(o[h]=Ie(e,h,t[h]))}else o={};for(var l in e)l in o||(o[l]=Ee(e,l));return t&&Object.isExtensible(t)&&(t._normalized=o),U(o,"$stable",s),U(o,"$key",a),U(o,"$hasNormal",r),o}function Ie(t,e,i){var n=function(){var t=arguments.length?i.apply(null,arguments):i({});t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:Ne(t);var e=t&&t[0];return t&&(!e||1===t.length&&e.isComment&&!Fe(e))?void 0:t};return i.proxy&&Object.defineProperty(t,e,{get:n,enumerable:!0,configurable:!0}),n}function Ee(t,e){return function(){return t[e]}}function Re(t,e){var i,n,r,s,a;if(Array.isArray(t)||"string"===typeof t)for(i=new Array(t.length),n=0,r=t.length;n<r;n++)i[n]=e(t[n],n);else if("number"===typeof t)for(i=new Array(t),n=0;n<t;n++)i[n]=e(n+1,n);else if(h(t))if(ft&&t[Symbol.iterator]){i=[];var l=t[Symbol.iterator](),u=l.next();while(!u.done)i.push(e(u.value,i.length)),u=l.next()}else for(s=Object.keys(t),i=new Array(s.length),n=0,r=s.length;n<r;n++)a=s[n],i[n]=e(t[a],a,n);return o(i)||(i=[]),i._isVList=!0,i}function ze(t,e,i,n){var o,r=this.$scopedSlots[t];r?(i=i||{},n&&(i=j(j({},n),i)),o=r(i)||("function"===typeof e?e():e)):o=this.$slots[t]||("function"===typeof e?e():e);var s=i&&i.slot;return s?this.$createElement("template",{slot:s},o):o}function Ve(t){return Wt(this.$options,"filters",t,!0)||B}function Ge(t,e){return Array.isArray(t)?-1===t.indexOf(e):t!==e}function Ye(t,e,i,n,o){var r=Y.keyCodes[e]||i;return o&&n&&!Y.keyCodes[e]?Ge(o,n):r?Ge(r,t):n?N(n)!==e:void 0===t}function Xe(t,e,i,n,o){if(i)if(h(i)){var r;Array.isArray(i)&&(i=O(i));var s=function(s){if("class"===s||"style"===s||m(s))r=t;else{var a=t.attrs&&t.attrs.type;r=n||Y.mustUseProp(e,a,s)?t.domProps||(t.domProps={}):t.attrs||(t.attrs={})}var h=M(s),l=N(s);if(!(h in r)&&!(l in r)&&(r[s]=i[s],o)){var u=t.on||(t.on={});u["update:"+s]=function(t){i[s]=t}}};for(var a in i)s(a)}else;return t}function qe(t,e){var i=this._staticTrees||(this._staticTrees=[]),n=i[t];return n&&!e||(n=i[t]=this.$options.staticRenderFns[t].call(this._renderProxy,null,this),Ke(n,"__static__"+t,!1)),n}function Ue(t,e,i){return Ke(t,"__once__"+e+(i?"_"+i:""),!0),t}function Ke(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]&&"string"!==typeof t[n]&&He(t[n],e+"_"+n,i);else He(t,e,i)}function He(t,e,i){t.isStatic=!0,t.key=e,t.isOnce=i}function _e(t,e){if(e)if(u(e)){var i=t.on=t.on?j({},t.on):{};for(var n in e){var o=i[n],r=e[n];i[n]=o?[].concat(o,r):r}}else;return t}function We(t,e,i,n){e=e||{$stable:!i};for(var o=0;o<t.length;o++){var r=t[o];Array.isArray(r)?We(r,e,i):r&&(r.proxy&&(r.fn.proxy=!0),e[r.key]=r.fn)}return n&&(e.$key=n),e}function $e(t,e){for(var i=0;i<e.length;i+=2){var n=e[i];"string"===typeof n&&n&&(t[e[i]]=e[i+1])}return t}function Je(t,e){return"string"===typeof t?e+t:t}function Ze(t){t._o=Ue,t._n=g,t._s=p,t._l=Re,t._t=ze,t._q=I,t._i=E,t._m=qe,t._f=Ve,t._k=Ye,t._b=Xe,t._v=kt,t._e=wt,t._u=We,t._g=_e,t._d=$e,t._p=Je}function Qe(t,e,n,o,s){var a,h=this,l=s.options;b(o,"_uid")?(a=Object.create(o),a._original=o):(a=o,o=o._original);var u=r(l._compiled),c=!u;this.data=t,this.props=e,this.children=n,this.parent=o,this.listeners=t.on||i,this.injections=je(l.inject,o),this.slots=function(){return h.$slots||Be(t.scopedSlots,h.$slots=Oe(n,o)),h.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return Be(t.scopedSlots,this.slots())}}),u&&(this.$options=l,this.$slots=this.slots(),this.$scopedSlots=Be(t.scopedSlots,this.$slots)),l._scopeId?this._c=function(t,e,i,n){var r=fi(a,t,e,i,n,c);return r&&!Array.isArray(r)&&(r.fnScopeId=l._scopeId,r.fnContext=o),r}:this._c=function(t,e,i,n){return fi(a,t,e,i,n,c)}}function ti(t,e,n,r,s){var a=t.options,h={},l=a.props;if(o(l))for(var u in l)h[u]=$t(u,l,e||i);else o(n.attrs)&&ii(h,n.attrs),o(n.props)&&ii(h,n.props);var c=new Qe(n,h,s,r,t),f=a.render.call(null,c._c,c);if(f instanceof xt)return ei(f,n,c.parent,a,c);if(Array.isArray(f)){for(var d=Ne(f)||[],p=new Array(d.length),g=0;g<d.length;g++)p[g]=ei(d[g],n,c.parent,a,c);return p}}function ei(t,e,i,n,o){var r=Mt(t);return r.fnContext=i,r.fnOptions=n,e.slot&&((r.data||(r.data={})).slot=e.slot),r}function ii(t,e){for(var i in e)t[M(i)]=e[i]}Ze(Qe.prototype);var ni={init:function(t,e){if(t.componentInstance&&!t.componentInstance._isDestroyed&&t.data.keepAlive){var i=t;ni.prepatch(i,i)}else{var n=t.componentInstance=si(t,Li);n.$mount(e?t.elm:void 0,e)}},prepatch:function(t,e){var i=e.componentOptions,n=e.componentInstance=t.componentInstance;Bi(n,i.propsData,i.listeners,e,i.children)},insert:function(t){var e=t.context,i=t.componentInstance;i._isMounted||(i._isMounted=!0,zi(i,"mounted")),t.data.keepAlive&&(e._isMounted?Zi(i):Ei(i,!0))},destroy:function(t){var e=t.componentInstance;e._isDestroyed||(t.data.keepAlive?Ri(e,!0):e.$destroy())}},oi=Object.keys(ni);function ri(t,e,i,s,a){if(!n(t)){var l=i.$options._base;if(h(t)&&(t=l.extend(t)),"function"===typeof t){var u;if(n(t.cid)&&(u=t,t=ki(u,l),void 0===t))return wi(u,e,i,s,a);e=e||{},kn(t),o(e.model)&&li(t.options,e);var c=Me(e,t,a);if(r(t.options.functional))return ti(t,c,e,i,s);var f=e.on;if(e.on=e.nativeOn,r(t.options.abstract)){var d=e.slot;e={},d&&(e.slot=d)}ai(e);var p=t.options.name||a,g=new xt("vue-component-"+t.cid+(p?"-"+p:""),e,void 0,void 0,void 0,i,{Ctor:t,propsData:c,listeners:f,tag:a,children:s},u);return g}}}function si(t,e){var i={_isComponent:!0,_parentVnode:t,parent:e},n=t.data.inlineTemplate;return o(n)&&(i.render=n.render,i.staticRenderFns=n.staticRenderFns),new t.componentOptions.Ctor(i)}function ai(t){for(var e=t.hook||(t.hook={}),i=0;i<oi.length;i++){var n=oi[i],o=e[n],r=ni[n];o===r||o&&o._merged||(e[n]=o?hi(r,o):r)}}function hi(t,e){var i=function(i,n){t(i,n),e(i,n)};return i._merged=!0,i}function li(t,e){var i=t.model&&t.model.prop||"value",n=t.model&&t.model.event||"input";(e.attrs||(e.attrs={}))[i]=e.model.value;var r=e.on||(e.on={}),s=r[n],a=e.model.callback;o(s)?(Array.isArray(s)?-1===s.indexOf(a):s!==a)&&(r[n]=[a].concat(s)):r[n]=a}var ui=1,ci=2;function fi(t,e,i,n,o,s){return(Array.isArray(i)||a(i))&&(o=n,n=i,i=void 0),r(s)&&(o=ci),di(t,e,i,n,o)}function di(t,e,i,n,r){if(o(i)&&o(i.__ob__))return wt();if(o(i)&&o(i.is)&&(e=i.is),!e)return wt();var s,a,h;(Array.isArray(n)&&"function"===typeof n[0]&&(i=i||{},i.scopedSlots={default:n[0]},n.length=0),r===ci?n=Ne(n):r===ui&&(n=Pe(n)),"string"===typeof e)?(a=t.$vnode&&t.$vnode.ns||Y.getTagNamespace(e),s=Y.isReservedTag(e)?new xt(Y.parsePlatformTagName(e),i,n,void 0,void 0,t):i&&i.pre||!o(h=Wt(t.$options,"components",e))?new xt(e,i,n,void 0,void 0,t):ri(h,i,t,n,e)):s=ri(e,i,t,n);return Array.isArray(s)?s:o(s)?(o(a)&&pi(s,a),o(i)&&gi(i),s):wt()}function pi(t,e,i){if(t.ns=e,"foreignObject"===t.tag&&(e=void 0,i=!0),o(t.children))for(var s=0,a=t.children.length;s<a;s++){var h=t.children[s];o(h.tag)&&(n(h.ns)||r(i)&&"svg"!==h.tag)&&pi(h,e,i)}}function gi(t){h(t.style)&&me(t.style),h(t.class)&&me(t.class)}function yi(t){t._vnode=null,t._staticTrees=null;var e=t.$options,n=t.$vnode=e._parentVnode,o=n&&n.context;t.$slots=Oe(e._renderChildren,o),t.$scopedSlots=i,t._c=function(e,i,n,o){return fi(t,e,i,n,o,!1)},t.$createElement=function(e,i,n,o){return fi(t,e,i,n,o,!0)};var r=n&&n.data;Ft(t,"$attrs",r&&r.attrs||i,null,!0),Ft(t,"$listeners",e._parentListeners||i,null,!0)}var mi,vi=null;function xi(t){Ze(t.prototype),t.prototype.$nextTick=function(t){return ge(t,this)},t.prototype._render=function(){var t,e=this,i=e.$options,n=i.render,o=i._parentVnode;o&&(e.$scopedSlots=Be(o.data.scopedSlots,e.$slots,e.$scopedSlots)),e.$vnode=o;try{vi=e,t=n.call(e._renderProxy,e.$createElement)}catch(Ss){ie(Ss,e,"render"),t=e._vnode}finally{vi=null}return Array.isArray(t)&&1===t.length&&(t=t[0]),t instanceof xt||(t=wt()),t.parent=o,t}}function bi(t,e){return(t.__esModule||ft&&"Module"===t[Symbol.toStringTag])&&(t=t.default),h(t)?e.extend(t):t}function wi(t,e,i,n,o){var r=wt();return r.asyncFactory=t,r.asyncMeta={data:e,context:i,children:n,tag:o},r}function ki(t,e){if(r(t.error)&&o(t.errorComp))return t.errorComp;if(o(t.resolved))return t.resolved;var i=vi;if(i&&o(t.owners)&&-1===t.owners.indexOf(i)&&t.owners.push(i),r(t.loading)&&o(t.loadingComp))return t.loadingComp;if(i&&!o(t.owners)){var s=t.owners=[i],a=!0,l=null,u=null;i.$on("hook:destroyed",(function(){return v(s,i)}));var c=function(t){for(var e=0,i=s.length;e<i;e++)s[e].$forceUpdate();t&&(s.length=0,null!==l&&(clearTimeout(l),l=null),null!==u&&(clearTimeout(u),u=null))},f=R((function(i){t.resolved=bi(i,e),a?s.length=0:c(!0)})),p=R((function(e){o(t.errorComp)&&(t.error=!0,c(!0))})),g=t(f,p);return h(g)&&(d(g)?n(t.resolved)&&g.then(f,p):d(g.component)&&(g.component.then(f,p),o(g.error)&&(t.errorComp=bi(g.error,e)),o(g.loading)&&(t.loadingComp=bi(g.loading,e),0===g.delay?t.loading=!0:l=setTimeout((function(){l=null,n(t.resolved)&&n(t.error)&&(t.loading=!0,c(!1))}),g.delay||200)),o(g.timeout)&&(u=setTimeout((function(){u=null,n(t.resolved)&&p(null)}),g.timeout)))),a=!1,t.loading?t.loadingComp:t.resolved}}function Mi(t){if(Array.isArray(t))for(var e=0;e<t.length;e++){var i=t[e];if(o(i)&&(o(i.componentOptions)||Fe(i)))return i}}function Si(t){t._events=Object.create(null),t._hasHookEvent=!1;var e=t.$options._parentListeners;e&&Ti(t,e)}function Pi(t,e){mi.$on(t,e)}function Ni(t,e){mi.$off(t,e)}function Ci(t,e){var i=mi;return function n(){var o=e.apply(null,arguments);null!==o&&i.$off(t,n)}}function Ti(t,e,i){mi=t,we(e,i||{},Pi,Ni,Ci,t),mi=void 0}function Ai(t){var e=/^hook:/;t.prototype.$on=function(t,i){var n=this;if(Array.isArray(t))for(var o=0,r=t.length;o<r;o++)n.$on(t[o],i);else(n._events[t]||(n._events[t]=[])).push(i),e.test(t)&&(n._hasHookEvent=!0);return n},t.prototype.$once=function(t,e){var i=this;function n(){i.$off(t,n),e.apply(i,arguments)}return n.fn=e,i.$on(t,n),i},t.prototype.$off=function(t,e){var i=this;if(!arguments.length)return i._events=Object.create(null),i;if(Array.isArray(t)){for(var n=0,o=t.length;n<o;n++)i.$off(t[n],e);return i}var r,s=i._events[t];if(!s)return i;if(!e)return i._events[t]=null,i;var a=s.length;while(a--)if(r=s[a],r===e||r.fn===e){s.splice(a,1);break}return i},t.prototype.$emit=function(t){var e=this,i=e._events[t];if(i){i=i.length>1?L(i):i;for(var n=L(arguments,1),o='event handler for "'+t+'"',r=0,s=i.length;r<s;r++)ne(i[r],e,n,e,o)}return e}}var Li=null;function ji(t){var e=Li;return Li=t,function(){Li=e}}function Oi(t){var e=t.$options,i=e.parent;if(i&&!e.abstract){while(i.$options.abstract&&i.$parent)i=i.$parent;i.$children.push(t)}t.$parent=i,t.$root=i?i.$root:t,t.$children=[],t.$refs={},t._watcher=null,t._inactive=null,t._directInactive=!1,t._isMounted=!1,t._isDestroyed=!1,t._isBeingDestroyed=!1}function Di(t){t.prototype._update=function(t,e){var i=this,n=i.$el,o=i._vnode,r=ji(i);i._vnode=t,i.$el=o?i.__patch__(o,t):i.__patch__(i.$el,t,e,!1),r(),n&&(n.__vue__=null),i.$el&&(i.$el.__vue__=i),i.$vnode&&i.$parent&&i.$vnode===i.$parent._vnode&&(i.$parent.$el=i.$el)},t.prototype.$forceUpdate=function(){var t=this;t._watcher&&t._watcher.update()},t.prototype.$destroy=function(){var t=this;if(!t._isBeingDestroyed){zi(t,"beforeDestroy"),t._isBeingDestroyed=!0;var e=t.$parent;!e||e._isBeingDestroyed||t.$options.abstract||v(e.$children,t),t._watcher&&t._watcher.teardown();var i=t._watchers.length;while(i--)t._watchers[i].teardown();t._data.__ob__&&t._data.__ob__.vmCount--,t._isDestroyed=!0,t.__patch__(t._vnode,null),zi(t,"destroyed"),t.$off(),t.$el&&(t.$el.__vue__=null),t.$vnode&&(t.$vnode.parent=null)}}}function Fi(t,e,i){var n;return t.$el=e,t.$options.render||(t.$options.render=wt),zi(t,"beforeMount"),n=function(){t._update(t._render(),i)},new nn(t,n,D,{before:function(){t._isMounted&&!t._isDestroyed&&zi(t,"beforeUpdate")}},!0),i=!1,null==t.$vnode&&(t._isMounted=!0,zi(t,"mounted")),t}function Bi(t,e,n,o,r){var s=o.data.scopedSlots,a=t.$scopedSlots,h=!!(s&&!s.$stable||a!==i&&!a.$stable||s&&t.$scopedSlots.$key!==s.$key||!s&&t.$scopedSlots.$key),l=!!(r||t.$options._renderChildren||h);if(t.$options._parentVnode=o,t.$vnode=o,t._vnode&&(t._vnode.parent=o),t.$options._renderChildren=r,t.$attrs=o.data.attrs||i,t.$listeners=n||i,e&&t.$options.props){At(!1);for(var u=t._props,c=t.$options._propKeys||[],f=0;f<c.length;f++){var d=c[f],p=t.$options.props;u[d]=$t(d,p,e,t)}At(!0),t.$options.propsData=e}n=n||i;var g=t.$options._parentListeners;t.$options._parentListeners=n,Ti(t,n,g),l&&(t.$slots=Oe(r,o.context),t.$forceUpdate())}function Ii(t){while(t&&(t=t.$parent))if(t._inactive)return!0;return!1}function Ei(t,e){if(e){if(t._directInactive=!1,Ii(t))return}else if(t._directInactive)return;if(t._inactive||null===t._inactive){t._inactive=!1;for(var i=0;i<t.$children.length;i++)Ei(t.$children[i]);zi(t,"activated")}}function Ri(t,e){if((!e||(t._directInactive=!0,!Ii(t)))&&!t._inactive){t._inactive=!0;for(var i=0;i<t.$children.length;i++)Ri(t.$children[i]);zi(t,"deactivated")}}function zi(t,e){mt();var i=t.$options[e],n=e+" hook";if(i)for(var o=0,r=i.length;o<r;o++)ne(i[o],t,null,t,n);t._hasHookEvent&&t.$emit("hook:"+e),vt()}var Vi=[],Gi=[],Yi={},Xi=!1,qi=!1,Ui=0;function Ki(){Ui=Vi.length=Gi.length=0,Yi={},Xi=qi=!1}var Hi=0,_i=Date.now;if($&&!tt){var Wi=window.performance;Wi&&"function"===typeof Wi.now&&_i()>document.createEvent("Event").timeStamp&&(_i=function(){return Wi.now()})}function $i(){var t,e;for(Hi=_i(),qi=!0,Vi.sort((function(t,e){return t.id-e.id})),Ui=0;Ui<Vi.length;Ui++)t=Vi[Ui],t.before&&t.before(),e=t.id,Yi[e]=null,t.run();var i=Gi.slice(),n=Vi.slice();Ki(),Qi(i),Ji(n),lt&&Y.devtools&&lt.emit("flush")}function Ji(t){var e=t.length;while(e--){var i=t[e],n=i.vm;n._watcher===i&&n._isMounted&&!n._isDestroyed&&zi(n,"updated")}}function Zi(t){t._inactive=!1,Gi.push(t)}function Qi(t){for(var e=0;e<t.length;e++)t[e]._inactive=!0,Ei(t[e],!0)}function tn(t){var e=t.id;if(null==Yi[e]){if(Yi[e]=!0,qi){var i=Vi.length-1;while(i>Ui&&Vi[i].id>t.id)i--;Vi.splice(i+1,0,t)}else Vi.push(t);Xi||(Xi=!0,ge($i))}}var en=0,nn=function(t,e,i,n,o){this.vm=t,o&&(t._watcher=this),t._watchers.push(this),n?(this.deep=!!n.deep,this.user=!!n.user,this.lazy=!!n.lazy,this.sync=!!n.sync,this.before=n.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=i,this.id=++en,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ct,this.newDepIds=new ct,this.expression="","function"===typeof e?this.getter=e:(this.getter=H(e),this.getter||(this.getter=D)),this.value=this.lazy?void 0:this.get()};nn.prototype.get=function(){var t;mt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(Ss){if(!this.user)throw Ss;ie(Ss,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&me(t),vt(),this.cleanupDeps()}return t},nn.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},nn.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var i=this.depIds;this.depIds=this.newDepIds,this.newDepIds=i,this.newDepIds.clear(),i=this.deps,this.deps=this.newDeps,this.newDeps=i,this.newDeps.length=0},nn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():tn(this)},nn.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||h(t)||this.deep){var e=this.value;if(this.value=t,this.user){var i='callback for watcher "'+this.expression+'"';ne(this.cb,this.vm,[t,e],this.vm,i)}else this.cb.call(this.vm,t,e)}}},nn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},nn.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},nn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var on={enumerable:!0,configurable:!0,get:D,set:D};function rn(t,e,i){on.get=function(){return this[e][i]},on.set=function(t){this[e][i]=t},Object.defineProperty(t,i,on)}function sn(t){t._watchers=[];var e=t.$options;e.props&&an(t,e.props),e.methods&&gn(t,e.methods),e.data?hn(t):Dt(t._data={},!0),e.computed&&cn(t,e.computed),e.watch&&e.watch!==rt&&yn(t,e.watch)}function an(t,e){var i=t.$options.propsData||{},n=t._props={},o=t.$options._propKeys=[],r=!t.$parent;r||At(!1);var s=function(r){o.push(r);var s=$t(r,e,i,t);Ft(n,r,s),r in t||rn(t,"_props",r)};for(var a in e)s(a);At(!0)}function hn(t){var e=t.$options.data;e=t._data="function"===typeof e?ln(e,t):e||{},u(e)||(e={});var i=Object.keys(e),n=t.$options.props,o=(t.$options.methods,i.length);while(o--){var r=i[o];0,n&&b(n,r)||q(r)||rn(t,"_data",r)}Dt(e,!0)}function ln(t,e){mt();try{return t.call(e,e)}catch(Ss){return ie(Ss,e,"data()"),{}}finally{vt()}}var un={lazy:!0};function cn(t,e){var i=t._computedWatchers=Object.create(null),n=ht();for(var o in e){var r=e[o],s="function"===typeof r?r:r.get;0,n||(i[o]=new nn(t,s||D,D,un)),o in t||fn(t,o,r)}}function fn(t,e,i){var n=!ht();"function"===typeof i?(on.get=n?dn(e):pn(i),on.set=D):(on.get=i.get?n&&!1!==i.cache?dn(e):pn(i.get):D,on.set=i.set||D),Object.defineProperty(t,e,on)}function dn(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),gt.target&&e.depend(),e.value}}function pn(t){return function(){return t.call(this,this)}}function gn(t,e){t.$options.props;for(var i in e)t[i]="function"!==typeof e[i]?D:A(e[i],t)}function yn(t,e){for(var i in e){var n=e[i];if(Array.isArray(n))for(var o=0;o<n.length;o++)mn(t,i,n[o]);else mn(t,i,n)}}function mn(t,e,i,n){return u(i)&&(n=i,i=i.handler),"string"===typeof i&&(i=t[i]),t.$watch(e,i,n)}function vn(t){var e={get:function(){return this._data}},i={get:function(){return this._props}};Object.defineProperty(t.prototype,"$data",e),Object.defineProperty(t.prototype,"$props",i),t.prototype.$set=Bt,t.prototype.$delete=It,t.prototype.$watch=function(t,e,i){var n=this;if(u(e))return mn(n,t,e,i);i=i||{},i.user=!0;var o=new nn(n,t,e,i);if(i.immediate){var r='callback for immediate watcher "'+o.expression+'"';mt(),ne(e,n,[o.value],n,r),vt()}return function(){o.teardown()}}}var xn=0;function bn(t){t.prototype._init=function(t){var e=this;e._uid=xn++,e._isVue=!0,t&&t._isComponent?wn(e,t):e.$options=_t(kn(e.constructor),t||{},e),e._renderProxy=e,e._self=e,Oi(e),Si(e),yi(e),zi(e,"beforeCreate"),Le(e),sn(e),Ae(e),zi(e,"created"),e.$options.el&&e.$mount(e.$options.el)}}function wn(t,e){var i=t.$options=Object.create(t.constructor.options),n=e._parentVnode;i.parent=e.parent,i._parentVnode=n;var o=n.componentOptions;i.propsData=o.propsData,i._parentListeners=o.listeners,i._renderChildren=o.children,i._componentTag=o.tag,e.render&&(i.render=e.render,i.staticRenderFns=e.staticRenderFns)}function kn(t){var e=t.options;if(t.super){var i=kn(t.super),n=t.superOptions;if(i!==n){t.superOptions=i;var o=Mn(t);o&&j(t.extendOptions,o),e=t.options=_t(i,t.extendOptions),e.name&&(e.components[e.name]=t)}}return e}function Mn(t){var e,i=t.options,n=t.sealedOptions;for(var o in i)i[o]!==n[o]&&(e||(e={}),e[o]=i[o]);return e}function Sn(t){this._init(t)}function Pn(t){t.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(e.indexOf(t)>-1)return this;var i=L(arguments,1);return i.unshift(this),"function"===typeof t.install?t.install.apply(t,i):"function"===typeof t&&t.apply(null,i),e.push(t),this}}function Nn(t){t.mixin=function(t){return this.options=_t(this.options,t),this}}function Cn(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var i=this,n=i.cid,o=t._Ctor||(t._Ctor={});if(o[n])return o[n];var r=t.name||i.options.name;var s=function(t){this._init(t)};return s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.cid=e++,s.options=_t(i.options,t),s["super"]=i,s.options.props&&Tn(s),s.options.computed&&An(s),s.extend=i.extend,s.mixin=i.mixin,s.use=i.use,V.forEach((function(t){s[t]=i[t]})),r&&(s.options.components[r]=s),s.superOptions=i.options,s.extendOptions=t,s.sealedOptions=j({},s.options),o[n]=s,s}}function Tn(t){var e=t.options.props;for(var i in e)rn(t.prototype,"_props",i)}function An(t){var e=t.options.computed;for(var i in e)fn(t.prototype,i,e[i])}function Ln(t){V.forEach((function(e){t[e]=function(t,i){return i?("component"===e&&u(i)&&(i.name=i.name||t,i=this.options._base.extend(i)),"directive"===e&&"function"===typeof i&&(i={bind:i,update:i}),this.options[e+"s"][t]=i,i):this.options[e+"s"][t]}}))}function jn(t){return t&&(t.Ctor.options.name||t.tag)}function On(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!c(t)&&t.test(e)}function Dn(t,e){var i=t.cache,n=t.keys,o=t._vnode;for(var r in i){var s=i[r];if(s){var a=s.name;a&&!e(a)&&Fn(i,r,n,o)}}}function Fn(t,e,i,n){var o=t[e];!o||n&&o.tag===n.tag||o.componentInstance.$destroy(),t[e]=null,v(i,e)}bn(Sn),vn(Sn),Ai(Sn),Di(Sn),xi(Sn);var Bn=[String,RegExp,Array],In={name:"keep-alive",abstract:!0,props:{include:Bn,exclude:Bn,max:[String,Number]},methods:{cacheVNode:function(){var t=this,e=t.cache,i=t.keys,n=t.vnodeToCache,o=t.keyToCache;if(n){var r=n.tag,s=n.componentInstance,a=n.componentOptions;e[o]={name:jn(a),tag:r,componentInstance:s},i.push(o),this.max&&i.length>parseInt(this.max)&&Fn(e,i[0],i,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Fn(this.cache,t,this.keys)},mounted:function(){var t=this;this.cacheVNode(),this.$watch("include",(function(e){Dn(t,(function(t){return On(e,t)}))})),this.$watch("exclude",(function(e){Dn(t,(function(t){return!On(e,t)}))}))},updated:function(){this.cacheVNode()},render:function(){var t=this.$slots.default,e=Mi(t),i=e&&e.componentOptions;if(i){var n=jn(i),o=this,r=o.include,s=o.exclude;if(r&&(!n||!On(r,n))||s&&n&&On(s,n))return e;var a=this,h=a.cache,l=a.keys,u=null==e.key?i.Ctor.cid+(i.tag?"::"+i.tag:""):e.key;h[u]?(e.componentInstance=h[u].componentInstance,v(l,u),l.push(u)):(this.vnodeToCache=e,this.keyToCache=u),e.data.keepAlive=!0}return e||t&&t[0]}},En={KeepAlive:In};function Rn(t){var e={get:function(){return Y}};Object.defineProperty(t,"config",e),t.util={warn:dt,extend:j,mergeOptions:_t,defineReactive:Ft},t.set=Bt,t.delete=It,t.nextTick=ge,t.observable=function(t){return Dt(t),t},t.options=Object.create(null),V.forEach((function(e){t.options[e+"s"]=Object.create(null)})),t.options._base=t,j(t.options.components,En),Pn(t),Nn(t),Cn(t),Ln(t)}Rn(Sn),Object.defineProperty(Sn.prototype,"$isServer",{get:ht}),Object.defineProperty(Sn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Sn,"FunctionalRenderContext",{value:Qe}),Sn.version="2.6.14";var zn=y("style,class"),Vn=y("input,textarea,option,select,progress"),Gn=function(t,e,i){return"value"===i&&Vn(t)&&"button"!==e||"selected"===i&&"option"===t||"checked"===i&&"input"===t||"muted"===i&&"video"===t},Yn=y("contenteditable,draggable,spellcheck"),Xn=y("events,caret,typing,plaintext-only"),qn=function(t,e){return Wn(e)||"false"===e?"false":"contenteditable"===t&&Xn(e)?e:"true"},Un=y("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),Kn="http://www.w3.org/1999/xlink",Hn=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},_n=function(t){return Hn(t)?t.slice(6,t.length):""},Wn=function(t){return null==t||!1===t};function $n(t){var e=t.data,i=t,n=t;while(o(n.componentInstance))n=n.componentInstance._vnode,n&&n.data&&(e=Jn(n.data,e));while(o(i=i.parent))i&&i.data&&(e=Jn(e,i.data));return Zn(e.staticClass,e.class)}function Jn(t,e){return{staticClass:Qn(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function Zn(t,e){return o(t)||o(e)?Qn(t,to(e)):""}function Qn(t,e){return t?e?t+" "+e:t:e||""}function to(t){return Array.isArray(t)?eo(t):h(t)?io(t):"string"===typeof t?t:""}function eo(t){for(var e,i="",n=0,r=t.length;n<r;n++)o(e=to(t[n]))&&""!==e&&(i&&(i+=" "),i+=e);return i}function io(t){var e="";for(var i in t)t[i]&&(e&&(e+=" "),e+=i);return e}var no={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},oo=y("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),ro=y("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),so=function(t){return oo(t)||ro(t)};function ao(t){return ro(t)?"svg":"math"===t?"math":void 0}var ho=Object.create(null);function lo(t){if(!$)return!0;if(so(t))return!1;if(t=t.toLowerCase(),null!=ho[t])return ho[t];var e=document.createElement(t);return t.indexOf("-")>-1?ho[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:ho[t]=/HTMLUnknownElement/.test(e.toString())}var uo=y("text,number,password,search,email,tel,url");function co(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function fo(t,e){var i=document.createElement(t);return"select"!==t||e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&i.setAttribute("multiple","multiple"),i}function po(t,e){return document.createElementNS(no[t],e)}function go(t){return document.createTextNode(t)}function yo(t){return document.createComment(t)}function mo(t,e,i){t.insertBefore(e,i)}function vo(t,e){t.removeChild(e)}function xo(t,e){t.appendChild(e)}function bo(t){return t.parentNode}function wo(t){return t.nextSibling}function ko(t){return t.tagName}function Mo(t,e){t.textContent=e}function So(t,e){t.setAttribute(e,"")}var Po=Object.freeze({createElement:fo,createElementNS:po,createTextNode:go,createComment:yo,insertBefore:mo,removeChild:vo,appendChild:xo,parentNode:bo,nextSibling:wo,tagName:ko,setTextContent:Mo,setStyleScope:So}),No={create:function(t,e){Co(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Co(t,!0),Co(e))},destroy:function(t){Co(t,!0)}};function Co(t,e){var i=t.data.ref;if(o(i)){var n=t.context,r=t.componentInstance||t.elm,s=n.$refs;e?Array.isArray(s[i])?v(s[i],r):s[i]===r&&(s[i]=void 0):t.data.refInFor?Array.isArray(s[i])?s[i].indexOf(r)<0&&s[i].push(r):s[i]=[r]:s[i]=r}}var To=new xt("",{},[]),Ao=["create","activate","update","remove","destroy"];function Lo(t,e){return t.key===e.key&&t.asyncFactory===e.asyncFactory&&(t.tag===e.tag&&t.isComment===e.isComment&&o(t.data)===o(e.data)&&jo(t,e)||r(t.isAsyncPlaceholder)&&n(e.asyncFactory.error))}function jo(t,e){if("input"!==t.tag)return!0;var i,n=o(i=t.data)&&o(i=i.attrs)&&i.type,r=o(i=e.data)&&o(i=i.attrs)&&i.type;return n===r||uo(n)&&uo(r)}function Oo(t,e,i){var n,r,s={};for(n=e;n<=i;++n)r=t[n].key,o(r)&&(s[r]=n);return s}function Do(t){var e,i,s={},h=t.modules,l=t.nodeOps;for(e=0;e<Ao.length;++e)for(s[Ao[e]]=[],i=0;i<h.length;++i)o(h[i][Ao[e]])&&s[Ao[e]].push(h[i][Ao[e]]);function u(t){return new xt(l.tagName(t).toLowerCase(),{},[],void 0,t)}function c(t,e){function i(){0===--i.listeners&&f(t)}return i.listeners=e,i}function f(t){var e=l.parentNode(t);o(e)&&l.removeChild(e,t)}function d(t,e,i,n,s,a,h){if(o(t.elm)&&o(a)&&(t=a[h]=Mt(t)),t.isRootInsert=!s,!p(t,e,i,n)){var u=t.data,c=t.children,f=t.tag;o(f)?(t.elm=t.ns?l.createElementNS(t.ns,f):l.createElement(f,t),k(t),x(t,c,e),o(u)&&w(t,e),v(i,t.elm,n)):r(t.isComment)?(t.elm=l.createComment(t.text),v(i,t.elm,n)):(t.elm=l.createTextNode(t.text),v(i,t.elm,n))}}function p(t,e,i,n){var s=t.data;if(o(s)){var a=o(t.componentInstance)&&s.keepAlive;if(o(s=s.hook)&&o(s=s.init)&&s(t,!1),o(t.componentInstance))return g(t,e),v(i,t.elm,n),r(a)&&m(t,e,i,n),!0}}function g(t,e){o(t.data.pendingInsert)&&(e.push.apply(e,t.data.pendingInsert),t.data.pendingInsert=null),t.elm=t.componentInstance.$el,b(t)?(w(t,e),k(t)):(Co(t),e.push(t))}function m(t,e,i,n){var r,a=t;while(a.componentInstance)if(a=a.componentInstance._vnode,o(r=a.data)&&o(r=r.transition)){for(r=0;r<s.activate.length;++r)s.activate[r](To,a);e.push(a);break}v(i,t.elm,n)}function v(t,e,i){o(t)&&(o(i)?l.parentNode(i)===t&&l.insertBefore(t,e,i):l.appendChild(t,e))}function x(t,e,i){if(Array.isArray(e)){0;for(var n=0;n<e.length;++n)d(e[n],i,t.elm,null,!0,e,n)}else a(t.text)&&l.appendChild(t.elm,l.createTextNode(String(t.text)))}function b(t){while(t.componentInstance)t=t.componentInstance._vnode;return o(t.tag)}function w(t,i){for(var n=0;n<s.create.length;++n)s.create[n](To,t);e=t.data.hook,o(e)&&(o(e.create)&&e.create(To,t),o(e.insert)&&i.push(t))}function k(t){var e;if(o(e=t.fnScopeId))l.setStyleScope(t.elm,e);else{var i=t;while(i)o(e=i.context)&&o(e=e.$options._scopeId)&&l.setStyleScope(t.elm,e),i=i.parent}o(e=Li)&&e!==t.context&&e!==t.fnContext&&o(e=e.$options._scopeId)&&l.setStyleScope(t.elm,e)}function M(t,e,i,n,o,r){for(;n<=o;++n)d(i[n],r,t,e,!1,i,n)}function S(t){var e,i,n=t.data;if(o(n))for(o(e=n.hook)&&o(e=e.destroy)&&e(t),e=0;e<s.destroy.length;++e)s.destroy[e](t);if(o(e=t.children))for(i=0;i<t.children.length;++i)S(t.children[i])}function P(t,e,i){for(;e<=i;++e){var n=t[e];o(n)&&(o(n.tag)?(N(n),S(n)):f(n.elm))}}function N(t,e){if(o(e)||o(t.data)){var i,n=s.remove.length+1;for(o(e)?e.listeners+=n:e=c(t.elm,n),o(i=t.componentInstance)&&o(i=i._vnode)&&o(i.data)&&N(i,e),i=0;i<s.remove.length;++i)s.remove[i](t,e);o(i=t.data.hook)&&o(i=i.remove)?i(t,e):e()}else f(t.elm)}function C(t,e,i,r,s){var a,h,u,c,f=0,p=0,g=e.length-1,y=e[0],m=e[g],v=i.length-1,x=i[0],b=i[v],w=!s;while(f<=g&&p<=v)n(y)?y=e[++f]:n(m)?m=e[--g]:Lo(y,x)?(A(y,x,r,i,p),y=e[++f],x=i[++p]):Lo(m,b)?(A(m,b,r,i,v),m=e[--g],b=i[--v]):Lo(y,b)?(A(y,b,r,i,v),w&&l.insertBefore(t,y.elm,l.nextSibling(m.elm)),y=e[++f],b=i[--v]):Lo(m,x)?(A(m,x,r,i,p),w&&l.insertBefore(t,m.elm,y.elm),m=e[--g],x=i[++p]):(n(a)&&(a=Oo(e,f,g)),h=o(x.key)?a[x.key]:T(x,e,f,g),n(h)?d(x,r,t,y.elm,!1,i,p):(u=e[h],Lo(u,x)?(A(u,x,r,i,p),e[h]=void 0,w&&l.insertBefore(t,u.elm,y.elm)):d(x,r,t,y.elm,!1,i,p)),x=i[++p]);f>g?(c=n(i[v+1])?null:i[v+1].elm,M(t,c,i,p,v,r)):p>v&&P(e,f,g)}function T(t,e,i,n){for(var r=i;r<n;r++){var s=e[r];if(o(s)&&Lo(t,s))return r}}function A(t,e,i,a,h,u){if(t!==e){o(e.elm)&&o(a)&&(e=a[h]=Mt(e));var c=e.elm=t.elm;if(r(t.isAsyncPlaceholder))o(e.asyncFactory.resolved)?O(t.elm,e,i):e.isAsyncPlaceholder=!0;else if(r(e.isStatic)&&r(t.isStatic)&&e.key===t.key&&(r(e.isCloned)||r(e.isOnce)))e.componentInstance=t.componentInstance;else{var f,d=e.data;o(d)&&o(f=d.hook)&&o(f=f.prepatch)&&f(t,e);var p=t.children,g=e.children;if(o(d)&&b(e)){for(f=0;f<s.update.length;++f)s.update[f](t,e);o(f=d.hook)&&o(f=f.update)&&f(t,e)}n(e.text)?o(p)&&o(g)?p!==g&&C(c,p,g,i,u):o(g)?(o(t.text)&&l.setTextContent(c,""),M(c,null,g,0,g.length-1,i)):o(p)?P(p,0,p.length-1):o(t.text)&&l.setTextContent(c,""):t.text!==e.text&&l.setTextContent(c,e.text),o(d)&&o(f=d.hook)&&o(f=f.postpatch)&&f(t,e)}}}function L(t,e,i){if(r(i)&&o(t.parent))t.parent.data.pendingInsert=e;else for(var n=0;n<e.length;++n)e[n].data.hook.insert(e[n])}var j=y("attrs,class,staticClass,staticStyle,key");function O(t,e,i,n){var s,a=e.tag,h=e.data,l=e.children;if(n=n||h&&h.pre,e.elm=t,r(e.isComment)&&o(e.asyncFactory))return e.isAsyncPlaceholder=!0,!0;if(o(h)&&(o(s=h.hook)&&o(s=s.init)&&s(e,!0),o(s=e.componentInstance)))return g(e,i),!0;if(o(a)){if(o(l))if(t.hasChildNodes())if(o(s=h)&&o(s=s.domProps)&&o(s=s.innerHTML)){if(s!==t.innerHTML)return!1}else{for(var u=!0,c=t.firstChild,f=0;f<l.length;f++){if(!c||!O(c,l[f],i,n)){u=!1;break}c=c.nextSibling}if(!u||c)return!1}else x(e,l,i);if(o(h)){var d=!1;for(var p in h)if(!j(p)){d=!0,w(e,i);break}!d&&h["class"]&&me(h["class"])}}else t.data!==e.text&&(t.data=e.text);return!0}return function(t,e,i,a){if(!n(e)){var h=!1,c=[];if(n(t))h=!0,d(e,c);else{var f=o(t.nodeType);if(!f&&Lo(t,e))A(t,e,c,null,null,a);else{if(f){if(1===t.nodeType&&t.hasAttribute(z)&&(t.removeAttribute(z),i=!0),r(i)&&O(t,e,c))return L(e,c,!0),t;t=u(t)}var p=t.elm,g=l.parentNode(p);if(d(e,c,p._leaveCb?null:g,l.nextSibling(p)),o(e.parent)){var y=e.parent,m=b(e);while(y){for(var v=0;v<s.destroy.length;++v)s.destroy[v](y);if(y.elm=e.elm,m){for(var x=0;x<s.create.length;++x)s.create[x](To,y);var w=y.data.hook.insert;if(w.merged)for(var k=1;k<w.fns.length;k++)w.fns[k]()}else Co(y);y=y.parent}}o(g)?P([t],0,0):o(t.tag)&&S(t)}}return L(e,c,h),e.elm}o(t)&&S(t)}}var Fo={create:Bo,update:Bo,destroy:function(t){Bo(t,To)}};function Bo(t,e){(t.data.directives||e.data.directives)&&Io(t,e)}function Io(t,e){var i,n,o,r=t===To,s=e===To,a=Ro(t.data.directives,t.context),h=Ro(e.data.directives,e.context),l=[],u=[];for(i in h)n=a[i],o=h[i],n?(o.oldValue=n.value,o.oldArg=n.arg,Vo(o,"update",e,t),o.def&&o.def.componentUpdated&&u.push(o)):(Vo(o,"bind",e,t),o.def&&o.def.inserted&&l.push(o));if(l.length){var c=function(){for(var i=0;i<l.length;i++)Vo(l[i],"inserted",e,t)};r?ke(e,"insert",c):c()}if(u.length&&ke(e,"postpatch",(function(){for(var i=0;i<u.length;i++)Vo(u[i],"componentUpdated",e,t)})),!r)for(i in a)h[i]||Vo(a[i],"unbind",t,t,s)}var Eo=Object.create(null);function Ro(t,e){var i,n,o=Object.create(null);if(!t)return o;for(i=0;i<t.length;i++)n=t[i],n.modifiers||(n.modifiers=Eo),o[zo(n)]=n,n.def=Wt(e.$options,"directives",n.name,!0);return o}function zo(t){return t.rawName||t.name+"."+Object.keys(t.modifiers||{}).join(".")}function Vo(t,e,i,n,o){var r=t.def&&t.def[e];if(r)try{r(i.elm,t,i,n,o)}catch(Ss){ie(Ss,i.context,"directive "+t.name+" "+e+" hook")}}var Go=[No,Fo];function Yo(t,e){var i=e.componentOptions;if((!o(i)||!1!==i.Ctor.options.inheritAttrs)&&(!n(t.data.attrs)||!n(e.data.attrs))){var r,s,a,h=e.elm,l=t.data.attrs||{},u=e.data.attrs||{};for(r in o(u.__ob__)&&(u=e.data.attrs=j({},u)),u)s=u[r],a=l[r],a!==s&&Xo(h,r,s,e.data.pre);for(r in(tt||it)&&u.value!==l.value&&Xo(h,"value",u.value),l)n(u[r])&&(Hn(r)?h.removeAttributeNS(Kn,_n(r)):Yn(r)||h.removeAttribute(r))}}function Xo(t,e,i,n){n||t.tagName.indexOf("-")>-1?qo(t,e,i):Un(e)?Wn(i)?t.removeAttribute(e):(i="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,i)):Yn(e)?t.setAttribute(e,qn(e,i)):Hn(e)?Wn(i)?t.removeAttributeNS(Kn,_n(e)):t.setAttributeNS(Kn,e,i):qo(t,e,i)}function qo(t,e,i){if(Wn(i))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==i&&!t.__ieph){var n=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",n)};t.addEventListener("input",n),t.__ieph=!0}t.setAttribute(e,i)}}var Uo={create:Yo,update:Yo};function Ko(t,e){var i=e.elm,r=e.data,s=t.data;if(!(n(r.staticClass)&&n(r.class)&&(n(s)||n(s.staticClass)&&n(s.class)))){var a=$n(e),h=i._transitionClasses;o(h)&&(a=Qn(a,to(h))),a!==i._prevClass&&(i.setAttribute("class",a),i._prevClass=a)}}var Ho,_o={create:Ko,update:Ko},Wo="__r",$o="__c";function Jo(t){if(o(t[Wo])){var e=tt?"change":"input";t[e]=[].concat(t[Wo],t[e]||[]),delete t[Wo]}o(t[$o])&&(t.change=[].concat(t[$o],t.change||[]),delete t[$o])}function Zo(t,e,i){var n=Ho;return function o(){var r=e.apply(null,arguments);null!==r&&er(t,o,i,n)}}var Qo=ae&&!(ot&&Number(ot[1])<=53);function tr(t,e,i,n){if(Qo){var o=Hi,r=e;e=r._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return r.apply(this,arguments)}}Ho.addEventListener(t,e,st?{capture:i,passive:n}:i)}function er(t,e,i,n){(n||Ho).removeEventListener(t,e._wrapper||e,i)}function ir(t,e){if(!n(t.data.on)||!n(e.data.on)){var i=e.data.on||{},o=t.data.on||{};Ho=e.elm,Jo(i),we(i,o,tr,er,Zo,e.context),Ho=void 0}}var nr,or={create:ir,update:ir};function rr(t,e){if(!n(t.data.domProps)||!n(e.data.domProps)){var i,r,s=e.elm,a=t.data.domProps||{},h=e.data.domProps||{};for(i in o(h.__ob__)&&(h=e.data.domProps=j({},h)),a)i in h||(s[i]="");for(i in h){if(r=h[i],"textContent"===i||"innerHTML"===i){if(e.children&&(e.children.length=0),r===a[i])continue;1===s.childNodes.length&&s.removeChild(s.childNodes[0])}if("value"===i&&"PROGRESS"!==s.tagName){s._value=r;var l=n(r)?"":String(r);sr(s,l)&&(s.value=l)}else if("innerHTML"===i&&ro(s.tagName)&&n(s.innerHTML)){nr=nr||document.createElement("div"),nr.innerHTML="<svg>"+r+"</svg>";var u=nr.firstChild;while(s.firstChild)s.removeChild(s.firstChild);while(u.firstChild)s.appendChild(u.firstChild)}else if(r!==a[i])try{s[i]=r}catch(Ss){}}}}function sr(t,e){return!t.composing&&("OPTION"===t.tagName||ar(t,e)||hr(t,e))}function ar(t,e){var i=!0;try{i=document.activeElement!==t}catch(Ss){}return i&&t.value!==e}function hr(t,e){var i=t.value,n=t._vModifiers;if(o(n)){if(n.number)return g(i)!==g(e);if(n.trim)return i.trim()!==e.trim()}return i!==e}var lr={create:rr,update:rr},ur=w((function(t){var e={},i=/;(?![^(]*\))/g,n=/:(.+)/;return t.split(i).forEach((function(t){if(t){var i=t.split(n);i.length>1&&(e[i[0].trim()]=i[1].trim())}})),e}));function cr(t){var e=fr(t.style);return t.staticStyle?j(t.staticStyle,e):e}function fr(t){return Array.isArray(t)?O(t):"string"===typeof t?ur(t):t}function dr(t,e){var i,n={};if(e){var o=t;while(o.componentInstance)o=o.componentInstance._vnode,o&&o.data&&(i=cr(o.data))&&j(n,i)}(i=cr(t.data))&&j(n,i);var r=t;while(r=r.parent)r.data&&(i=cr(r.data))&&j(n,i);return n}var pr,gr=/^--/,yr=/\s*!important$/,mr=function(t,e,i){if(gr.test(e))t.style.setProperty(e,i);else if(yr.test(i))t.style.setProperty(N(e),i.replace(yr,""),"important");else{var n=xr(e);if(Array.isArray(i))for(var o=0,r=i.length;o<r;o++)t.style[n]=i[o];else t.style[n]=i}},vr=["Webkit","Moz","ms"],xr=w((function(t){if(pr=pr||document.createElement("div").style,t=M(t),"filter"!==t&&t in pr)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),i=0;i<vr.length;i++){var n=vr[i]+e;if(n in pr)return n}}));function br(t,e){var i=e.data,r=t.data;if(!(n(i.staticStyle)&&n(i.style)&&n(r.staticStyle)&&n(r.style))){var s,a,h=e.elm,l=r.staticStyle,u=r.normalizedStyle||r.style||{},c=l||u,f=fr(e.data.style)||{};e.data.normalizedStyle=o(f.__ob__)?j({},f):f;var d=dr(e,!0);for(a in c)n(d[a])&&mr(h,a,"");for(a in d)s=d[a],s!==c[a]&&mr(h,a,null==s?"":s)}}var wr={create:br,update:br},kr=/\s+/;function Mr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(kr).forEach((function(e){return t.classList.add(e)})):t.classList.add(e);else{var i=" "+(t.getAttribute("class")||"")+" ";i.indexOf(" "+e+" ")<0&&t.setAttribute("class",(i+e).trim())}}function Sr(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(kr).forEach((function(e){return t.classList.remove(e)})):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var i=" "+(t.getAttribute("class")||"")+" ",n=" "+e+" ";while(i.indexOf(n)>=0)i=i.replace(n," ");i=i.trim(),i?t.setAttribute("class",i):t.removeAttribute("class")}}function Pr(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&j(e,Nr(t.name||"v")),j(e,t),e}return"string"===typeof t?Nr(t):void 0}}var Nr=w((function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}})),Cr=$&&!et,Tr="transition",Ar="animation",Lr="transition",jr="transitionend",Or="animation",Dr="animationend";Cr&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Lr="WebkitTransition",jr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Or="WebkitAnimation",Dr="webkitAnimationEnd"));var Fr=$?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Br(t){Fr((function(){Fr(t)}))}function Ir(t,e){var i=t._transitionClasses||(t._transitionClasses=[]);i.indexOf(e)<0&&(i.push(e),Mr(t,e))}function Er(t,e){t._transitionClasses&&v(t._transitionClasses,e),Sr(t,e)}function Rr(t,e,i){var n=Vr(t,e),o=n.type,r=n.timeout,s=n.propCount;if(!o)return i();var a=o===Tr?jr:Dr,h=0,l=function(){t.removeEventListener(a,u),i()},u=function(e){e.target===t&&++h>=s&&l()};setTimeout((function(){h<s&&l()}),r+1),t.addEventListener(a,u)}var zr=/\b(transform|all)(,|$)/;function Vr(t,e){var i,n=window.getComputedStyle(t),o=(n[Lr+"Delay"]||"").split(", "),r=(n[Lr+"Duration"]||"").split(", "),s=Gr(o,r),a=(n[Or+"Delay"]||"").split(", "),h=(n[Or+"Duration"]||"").split(", "),l=Gr(a,h),u=0,c=0;e===Tr?s>0&&(i=Tr,u=s,c=r.length):e===Ar?l>0&&(i=Ar,u=l,c=h.length):(u=Math.max(s,l),i=u>0?s>l?Tr:Ar:null,c=i?i===Tr?r.length:h.length:0);var f=i===Tr&&zr.test(n[Lr+"Property"]);return{type:i,timeout:u,propCount:c,hasTransform:f}}function Gr(t,e){while(t.length<e.length)t=t.concat(t);return Math.max.apply(null,e.map((function(e,i){return Yr(e)+Yr(t[i])})))}function Yr(t){return 1e3*Number(t.slice(0,-1).replace(",","."))}function Xr(t,e){var i=t.elm;o(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var r=Pr(t.data.transition);if(!n(r)&&!o(i._enterCb)&&1===i.nodeType){var s=r.css,a=r.type,l=r.enterClass,u=r.enterToClass,c=r.enterActiveClass,f=r.appearClass,d=r.appearToClass,p=r.appearActiveClass,y=r.beforeEnter,m=r.enter,v=r.afterEnter,x=r.enterCancelled,b=r.beforeAppear,w=r.appear,k=r.afterAppear,M=r.appearCancelled,S=r.duration,P=Li,N=Li.$vnode;while(N&&N.parent)P=N.context,N=N.parent;var C=!P._isMounted||!t.isRootInsert;if(!C||w||""===w){var T=C&&f?f:l,A=C&&p?p:c,L=C&&d?d:u,j=C&&b||y,O=C&&"function"===typeof w?w:m,D=C&&k||v,F=C&&M||x,B=g(h(S)?S.enter:S);0;var I=!1!==s&&!et,E=Kr(O),z=i._enterCb=R((function(){I&&(Er(i,L),Er(i,A)),z.cancelled?(I&&Er(i,T),F&&F(i)):D&&D(i),i._enterCb=null}));t.data.show||ke(t,"insert",(function(){var e=i.parentNode,n=e&&e._pending&&e._pending[t.key];n&&n.tag===t.tag&&n.elm._leaveCb&&n.elm._leaveCb(),O&&O(i,z)})),j&&j(i),I&&(Ir(i,T),Ir(i,A),Br((function(){Er(i,T),z.cancelled||(Ir(i,L),E||(Ur(B)?setTimeout(z,B):Rr(i,a,z)))}))),t.data.show&&(e&&e(),O&&O(i,z)),I||E||z()}}}function qr(t,e){var i=t.elm;o(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var r=Pr(t.data.transition);if(n(r)||1!==i.nodeType)return e();if(!o(i._leaveCb)){var s=r.css,a=r.type,l=r.leaveClass,u=r.leaveToClass,c=r.leaveActiveClass,f=r.beforeLeave,d=r.leave,p=r.afterLeave,y=r.leaveCancelled,m=r.delayLeave,v=r.duration,x=!1!==s&&!et,b=Kr(d),w=g(h(v)?v.leave:v);0;var k=i._leaveCb=R((function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[t.key]=null),x&&(Er(i,u),Er(i,c)),k.cancelled?(x&&Er(i,l),y&&y(i)):(e(),p&&p(i)),i._leaveCb=null}));m?m(M):M()}function M(){k.cancelled||(!t.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[t.key]=t),f&&f(i),x&&(Ir(i,l),Ir(i,c),Br((function(){Er(i,l),k.cancelled||(Ir(i,u),b||(Ur(w)?setTimeout(k,w):Rr(i,a,k)))}))),d&&d(i,k),x||b||k())}}function Ur(t){return"number"===typeof t&&!isNaN(t)}function Kr(t){if(n(t))return!1;var e=t.fns;return o(e)?Kr(Array.isArray(e)?e[0]:e):(t._length||t.length)>1}function Hr(t,e){!0!==e.data.show&&Xr(e)}var _r=$?{create:Hr,activate:Hr,remove:function(t,e){!0!==t.data.show?qr(t,e):e()}}:{},Wr=[Uo,_o,or,lr,wr,_r],$r=Wr.concat(Go),Jr=Do({nodeOps:Po,modules:$r});et&&document.addEventListener("selectionchange",(function(){var t=document.activeElement;t&&t.vmodel&&rs(t,"input")}));var Zr={inserted:function(t,e,i,n){"select"===i.tag?(n.elm&&!n.elm._vOptions?ke(i,"postpatch",(function(){Zr.componentUpdated(t,e,i)})):Qr(t,e,i.context),t._vOptions=[].map.call(t.options,is)):("textarea"===i.tag||uo(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",ns),t.addEventListener("compositionend",os),t.addEventListener("change",os),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,i){if("select"===i.tag){Qr(t,e,i.context);var n=t._vOptions,o=t._vOptions=[].map.call(t.options,is);if(o.some((function(t,e){return!I(t,n[e])}))){var r=t.multiple?e.value.some((function(t){return es(t,o)})):e.value!==e.oldValue&&es(e.value,o);r&&rs(t,"change")}}}};function Qr(t,e,i){ts(t,e,i),(tt||it)&&setTimeout((function(){ts(t,e,i)}),0)}function ts(t,e,i){var n=e.value,o=t.multiple;if(!o||Array.isArray(n)){for(var r,s,a=0,h=t.options.length;a<h;a++)if(s=t.options[a],o)r=E(n,is(s))>-1,s.selected!==r&&(s.selected=r);else if(I(is(s),n))return void(t.selectedIndex!==a&&(t.selectedIndex=a));o||(t.selectedIndex=-1)}}function es(t,e){return e.every((function(e){return!I(e,t)}))}function is(t){return"_value"in t?t._value:t.value}function ns(t){t.target.composing=!0}function os(t){t.target.composing&&(t.target.composing=!1,rs(t.target,"input"))}function rs(t,e){var i=document.createEvent("HTMLEvents");i.initEvent(e,!0,!0),t.dispatchEvent(i)}function ss(t){return!t.componentInstance||t.data&&t.data.transition?t:ss(t.componentInstance._vnode)}var as={bind:function(t,e,i){var n=e.value;i=ss(i);var o=i.data&&i.data.transition,r=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;n&&o?(i.data.show=!0,Xr(i,(function(){t.style.display=r}))):t.style.display=n?r:"none"},update:function(t,e,i){var n=e.value,o=e.oldValue;if(!n!==!o){i=ss(i);var r=i.data&&i.data.transition;r?(i.data.show=!0,n?Xr(i,(function(){t.style.display=t.__vOriginalDisplay})):qr(i,(function(){t.style.display="none"}))):t.style.display=n?t.__vOriginalDisplay:"none"}},unbind:function(t,e,i,n,o){o||(t.style.display=t.__vOriginalDisplay)}},hs={model:Zr,show:as},ls={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function us(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?us(Mi(e.children)):t}function cs(t){var e={},i=t.$options;for(var n in i.propsData)e[n]=t[n];var o=i._parentListeners;for(var r in o)e[M(r)]=o[r];return e}function fs(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function ds(t){while(t=t.parent)if(t.data.transition)return!0}function ps(t,e){return e.key===t.key&&e.tag===t.tag}var gs=function(t){return t.tag||Fe(t)},ys=function(t){return"show"===t.name},ms={name:"transition",props:ls,abstract:!0,render:function(t){var e=this,i=this.$slots.default;if(i&&(i=i.filter(gs),i.length)){0;var n=this.mode;0;var o=i[0];if(ds(this.$vnode))return o;var r=us(o);if(!r)return o;if(this._leaving)return fs(t,o);var s="__transition-"+this._uid+"-";r.key=null==r.key?r.isComment?s+"comment":s+r.tag:a(r.key)?0===String(r.key).indexOf(s)?r.key:s+r.key:r.key;var h=(r.data||(r.data={})).transition=cs(this),l=this._vnode,u=us(l);if(r.data.directives&&r.data.directives.some(ys)&&(r.data.show=!0),u&&u.data&&!ps(r,u)&&!Fe(u)&&(!u.componentInstance||!u.componentInstance._vnode.isComment)){var c=u.data.transition=j({},h);if("out-in"===n)return this._leaving=!0,ke(c,"afterLeave",(function(){e._leaving=!1,e.$forceUpdate()})),fs(t,o);if("in-out"===n){if(Fe(r))return l;var f,d=function(){f()};ke(h,"afterEnter",d),ke(h,"enterCancelled",d),ke(c,"delayLeave",(function(t){f=t}))}}return o}}},vs=j({tag:String,moveClass:String},ls);delete vs.mode;var xs={props:vs,beforeMount:function(){var t=this,e=this._update;this._update=function(i,n){var o=ji(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,i,n)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",i=Object.create(null),n=this.prevChildren=this.children,o=this.$slots.default||[],r=this.children=[],s=cs(this),a=0;a<o.length;a++){var h=o[a];if(h.tag)if(null!=h.key&&0!==String(h.key).indexOf("__vlist"))r.push(h),i[h.key]=h,(h.data||(h.data={})).transition=s;else;}if(n){for(var l=[],u=[],c=0;c<n.length;c++){var f=n[c];f.data.transition=s,f.data.pos=f.elm.getBoundingClientRect(),i[f.key]?l.push(f):u.push(f)}this.kept=t(e,null,l),this.removed=u}return t(e,null,r)},updated:function(){var t=this.prevChildren,e=this.moveClass||(this.name||"v")+"-move";t.length&&this.hasMove(t[0].elm,e)&&(t.forEach(bs),t.forEach(ws),t.forEach(ks),this._reflow=document.body.offsetHeight,t.forEach((function(t){if(t.data.moved){var i=t.elm,n=i.style;Ir(i,e),n.transform=n.WebkitTransform=n.transitionDuration="",i.addEventListener(jr,i._moveCb=function t(n){n&&n.target!==i||n&&!/transform$/.test(n.propertyName)||(i.removeEventListener(jr,t),i._moveCb=null,Er(i,e))})}})))},methods:{hasMove:function(t,e){if(!Cr)return!1;if(this._hasMove)return this._hasMove;var i=t.cloneNode();t._transitionClasses&&t._transitionClasses.forEach((function(t){Sr(i,t)})),Mr(i,e),i.style.display="none",this.$el.appendChild(i);var n=Vr(i);return this.$el.removeChild(i),this._hasMove=n.hasTransform}}};function bs(t){t.elm._moveCb&&t.elm._moveCb(),t.elm._enterCb&&t.elm._enterCb()}function ws(t){t.data.newPos=t.elm.getBoundingClientRect()}function ks(t){var e=t.data.pos,i=t.data.newPos,n=e.left-i.left,o=e.top-i.top;if(n||o){t.data.moved=!0;var r=t.elm.style;r.transform=r.WebkitTransform="translate("+n+"px,"+o+"px)",r.transitionDuration="0s"}}var Ms={Transition:ms,TransitionGroup:xs};Sn.config.mustUseProp=Gn,Sn.config.isReservedTag=so,Sn.config.isReservedAttr=zn,Sn.config.getTagNamespace=ao,Sn.config.isUnknownElement=lo,j(Sn.options.directives,hs),j(Sn.options.components,Ms),Sn.prototype.__patch__=$?Jr:D,Sn.prototype.$mount=function(t,e){return t=t&&$?co(t):void 0,Fi(this,t,e)},$&&setTimeout((function(){Y.devtools&&lt&&lt.emit("init",Sn)}),0),e["a"]=Sn}).call(this,i("c8ba"))},"2ba4":function(t,e){var i=Function.prototype,n=i.apply,o=i.bind,r=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(o?r.bind(n):function(){return r.apply(n,arguments)})},"2c3e":function(t,e,i){var n=i("da84"),o=i("83ab"),r=i("9f7f").UNSUPPORTED_Y,s=i("c6b6"),a=i("9bf2").f,h=i("69f3").get,l=RegExp.prototype,u=n.TypeError;o&&r&&a(l,"sticky",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!h(this).sticky;throw u("Incompatible receiver, RegExp required")}}})},"2cf4":function(t,e,i){var n,o,r,s,a=i("da84"),h=i("2ba4"),l=i("0366"),u=i("1626"),c=i("1a2d"),f=i("d039"),d=i("1be4"),p=i("f36a"),g=i("cc12"),y=i("1cdc"),m=i("605d"),v=a.setImmediate,x=a.clearImmediate,b=a.process,w=a.Dispatch,k=a.Function,M=a.MessageChannel,S=a.String,P=0,N={},C="onreadystatechange";try{n=a.location}catch(O){}var T=function(t){if(c(N,t)){var e=N[t];delete N[t],e()}},A=function(t){return function(){T(t)}},L=function(t){T(t.data)},j=function(t){a.postMessage(S(t),n.protocol+"//"+n.host)};v&&x||(v=function(t){var e=p(arguments,1);return N[++P]=function(){h(u(t)?t:k(t),void 0,e)},o(P),P},x=function(t){delete N[t]},m?o=function(t){b.nextTick(A(t))}:w&&w.now?o=function(t){w.now(A(t))}:M&&!y?(r=new M,s=r.port2,r.port1.onmessage=L,o=l(s.postMessage,s)):a.addEventListener&&u(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!f(j)?(o=j,a.addEventListener("message",L,!1)):o=C in g("script")?function(t){d.appendChild(g("script"))[C]=function(){d.removeChild(this),T(t)}}:function(t){setTimeout(A(t),0)}),t.exports={set:v,clear:x}},"2d00":function(t,e,i){var n,o,r=i("da84"),s=i("342f"),a=r.process,h=r.Deno,l=a&&a.versions||h&&h.version,u=l&&l.v8;u&&(n=u.split("."),o=n[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&s&&(n=s.match(/Edge\/(\d+)/),(!n||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/),n&&(o=+n[1]))),t.exports=o},"342f":function(t,e,i){var n=i("d066");t.exports=n("navigator","userAgent")||""},"35a1":function(t,e,i){var n=i("f5df"),o=i("dc4a"),r=i("3f8c"),s=i("b622"),a=s("iterator");t.exports=function(t){if(void 0!=t)return o(t,a)||o(t,"@@iterator")||r[n(t)]}},"37e8":function(t,e,i){var n=i("83ab"),o=i("9bf2"),r=i("825a"),s=i("fc6a"),a=i("df75");t.exports=n?Object.defineProperties:function(t,e){r(t);var i,n=s(e),h=a(e),l=h.length,u=0;while(l>u)o.f(t,i=h[u++],n[i]);return t}},"3a9b":function(t,e,i){var n=i("e330");t.exports=n({}.isPrototypeOf)},"3bbe":function(t,e,i){var n=i("da84"),o=i("1626"),r=n.String,s=n.TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw s("Can't set "+r(t)+" as a prototype")}},"3f8c":function(t,e){t.exports={}},"44ad":function(t,e,i){var n=i("da84"),o=i("e330"),r=i("d039"),s=i("c6b6"),a=n.Object,h=o("".split);t.exports=r((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==s(t)?h(t,""):a(t)}:a},"44d2":function(t,e,i){var n=i("b622"),o=i("7c73"),r=i("9bf2"),s=n("unscopables"),a=Array.prototype;void 0==a[s]&&r.f(a,s,{configurable:!0,value:o(null)}),t.exports=function(t){a[s][t]=!0}},"44de":function(t,e,i){var n=i("da84");t.exports=function(t,e){var i=n.console;i&&i.error&&(1==arguments.length?i.error(t):i.error(t,e))}},"44e7":function(t,e,i){var n=i("861d"),o=i("c6b6"),r=i("b622"),s=r("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[s])?!!e:"RegExp"==o(t))}},4840:function(t,e,i){var n=i("825a"),o=i("5087"),r=i("b622"),s=r("species");t.exports=function(t,e){var i,r=n(t).constructor;return void 0===r||void 0==(i=n(r)[s])?e:o(i)}},"485a":function(t,e,i){var n=i("da84"),o=i("c65b"),r=i("1626"),s=i("861d"),a=n.TypeError;t.exports=function(t,e){var i,n;if("string"===e&&r(i=t.toString)&&!s(n=o(i,t)))return n;if(r(i=t.valueOf)&&!s(n=o(i,t)))return n;if("string"!==e&&r(i=t.toString)&&!s(n=o(i,t)))return n;throw a("Can't convert object to primitive value")}},4930:function(t,e,i){var n=i("2d00"),o=i("d039");t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},"4d63":function(t,e,i){var n=i("83ab"),o=i("da84"),r=i("e330"),s=i("94ca"),a=i("7156"),h=i("9112"),l=i("9bf2").f,u=i("241c").f,c=i("3a9b"),f=i("44e7"),d=i("577e"),p=i("ad6d"),g=i("9f7f"),y=i("6eeb"),m=i("d039"),v=i("1a2d"),x=i("69f3").enforce,b=i("2626"),w=i("b622"),k=i("fce3"),M=i("107c"),S=w("match"),P=o.RegExp,N=P.prototype,C=o.SyntaxError,T=r(p),A=r(N.exec),L=r("".charAt),j=r("".replace),O=r("".indexOf),D=r("".slice),F=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,B=/a/g,I=/a/g,E=new P(B)!==B,R=g.UNSUPPORTED_Y,z=n&&(!E||R||k||M||m((function(){return I[S]=!1,P(B)!=B||P(I)==I||"/a/i"!=P(B,"i")}))),V=function(t){for(var e,i=t.length,n=0,o="",r=!1;n<=i;n++)e=L(t,n),"\\"!==e?r||"."!==e?("["===e?r=!0:"]"===e&&(r=!1),o+=e):o+="[\\s\\S]":o+=e+L(t,++n);return o},G=function(t){for(var e,i=t.length,n=0,o="",r=[],s={},a=!1,h=!1,l=0,u="";n<=i;n++){if(e=L(t,n),"\\"===e)e+=L(t,++n);else if("]"===e)a=!1;else if(!a)switch(!0){case"["===e:a=!0;break;case"("===e:A(F,D(t,n+1))&&(n+=2,h=!0),o+=e,l++;continue;case">"===e&&h:if(""===u||v(s,u))throw new C("Invalid capture group name");s[u]=!0,r[r.length]=[u,l],h=!1,u="";continue}h?u+=e:o+=e}return[o,r]};if(s("RegExp",z)){for(var Y=function(t,e){var i,n,o,r,s,l,u=c(N,this),p=f(t),g=void 0===e,y=[],m=t;if(!u&&p&&g&&t.constructor===Y)return t;if((p||c(N,t))&&(t=t.source,g&&(e="flags"in m?m.flags:T(m))),t=void 0===t?"":d(t),e=void 0===e?"":d(e),m=t,k&&"dotAll"in B&&(n=!!e&&O(e,"s")>-1,n&&(e=j(e,/s/g,""))),i=e,R&&"sticky"in B&&(o=!!e&&O(e,"y")>-1,o&&(e=j(e,/y/g,""))),M&&(r=G(t),t=r[0],y=r[1]),s=a(P(t,e),u?this:N,Y),(n||o||y.length)&&(l=x(s),n&&(l.dotAll=!0,l.raw=Y(V(t),i)),o&&(l.sticky=!0),y.length&&(l.groups=y)),t!==m)try{h(s,"source",""===m?"(?:)":m)}catch(v){}return s},X=function(t){t in Y||l(Y,t,{configurable:!0,get:function(){return P[t]},set:function(e){P[t]=e}})},q=u(P),U=0;q.length>U;)X(q[U++]);N.constructor=Y,Y.prototype=N,y(o,"RegExp",Y)}b("RegExp")},"4d64":function(t,e,i){var n=i("fc6a"),o=i("23cb"),r=i("07fa"),s=function(t){return function(e,i,s){var a,h=n(e),l=r(h),u=o(s,l);if(t&&i!=i){while(l>u)if(a=h[u++],a!=a)return!0}else for(;l>u;u++)if((t||u in h)&&h[u]===i)return t||u||0;return!t&&-1}};t.exports={includes:s(!0),indexOf:s(!1)}},5087:function(t,e,i){var n=i("da84"),o=i("68ee"),r=i("0d51"),s=n.TypeError;t.exports=function(t){if(o(t))return t;throw s(r(t)+" is not a constructor")}},"50c4":function(t,e,i){var n=i("5926"),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},5692:function(t,e,i){var n=i("c430"),o=i("c6cd");(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.19.1",mode:n?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,i){var n=i("d066"),o=i("e330"),r=i("241c"),s=i("7418"),a=i("825a"),h=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=r.f(a(t)),i=s.f;return i?h(e,i(t)):e}},"577e":function(t,e,i){var n=i("da84"),o=i("f5df"),r=n.String;t.exports=function(t){if("Symbol"===o(t))throw TypeError("Cannot convert a Symbol value to a string");return r(t)}},5926:function(t,e){var i=Math.ceil,n=Math.floor;t.exports=function(t){var e=+t;return e!==e||0===e?0:(e>0?n:i)(e)}},"59ed":function(t,e,i){var n=i("da84"),o=i("1626"),r=i("0d51"),s=n.TypeError;t.exports=function(t){if(o(t))return t;throw s(r(t)+" is not a function")}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"5e77":function(t,e,i){var n=i("83ab"),o=i("1a2d"),r=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=o(r,"name"),h=a&&"something"===function(){}.name,l=a&&(!n||n&&s(r,"name").configurable);t.exports={EXISTS:a,PROPER:h,CONFIGURABLE:l}},"605d":function(t,e,i){var n=i("c6b6"),o=i("da84");t.exports="process"==n(o.process)},6069:function(t,e){t.exports="object"==typeof window},"60da":function(t,e,i){"use strict";var n=i("83ab"),o=i("e330"),r=i("c65b"),s=i("d039"),a=i("df75"),h=i("7418"),l=i("d1e7"),u=i("7b0b"),c=i("44ad"),f=Object.assign,d=Object.defineProperty,p=o([].concat);t.exports=!f||s((function(){if(n&&1!==f({b:1},f(d({},"a",{enumerable:!0,get:function(){d(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol(),o="abcdefghijklmnopqrst";return t[i]=7,o.split("").forEach((function(t){e[t]=t})),7!=f({},t)[i]||a(f({},e)).join("")!=o}))?function(t,e){var i=u(t),o=arguments.length,s=1,f=h.f,d=l.f;while(o>s){var g,y=c(arguments[s++]),m=f?p(a(y),f(y)):a(y),v=m.length,x=0;while(v>x)g=m[x++],n&&!r(d,y,g)||(i[g]=y[g])}return i}:f},"68ee":function(t,e,i){var n=i("e330"),o=i("d039"),r=i("1626"),s=i("f5df"),a=i("d066"),h=i("8925"),l=function(){},u=[],c=a("Reflect","construct"),f=/^\s*(?:class|function)\b/,d=n(f.exec),p=!f.exec(l),g=function(t){if(!r(t))return!1;try{return c(l,u,t),!0}catch(e){return!1}},y=function(t){if(!r(t))return!1;switch(s(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return p||!!d(f,h(t))};t.exports=!c||o((function(){var t;return g(g.call)||!g(Object)||!g((function(){t=!0}))||t}))?y:g},"69f3":function(t,e,i){var n,o,r,s=i("7f9a"),a=i("da84"),h=i("e330"),l=i("861d"),u=i("9112"),c=i("1a2d"),f=i("c6cd"),d=i("f772"),p=i("d012"),g="Object already initialized",y=a.TypeError,m=a.WeakMap,v=function(t){return r(t)?o(t):n(t,{})},x=function(t){return function(e){var i;if(!l(e)||(i=o(e)).type!==t)throw y("Incompatible receiver, "+t+" required");return i}};if(s||f.state){var b=f.state||(f.state=new m),w=h(b.get),k=h(b.has),M=h(b.set);n=function(t,e){if(k(b,t))throw new y(g);return e.facade=t,M(b,t,e),e},o=function(t){return w(b,t)||{}},r=function(t){return k(b,t)}}else{var S=d("state");p[S]=!0,n=function(t,e){if(c(t,S))throw new y(g);return e.facade=t,u(t,S,e),e},o=function(t){return c(t,S)?t[S]:{}},r=function(t){return c(t,S)}}t.exports={set:n,get:o,has:r,enforce:v,getterFor:x}},"6eeb":function(t,e,i){var n=i("da84"),o=i("1626"),r=i("1a2d"),s=i("9112"),a=i("ce4e"),h=i("8925"),l=i("69f3"),u=i("5e77").CONFIGURABLE,c=l.get,f=l.enforce,d=String(String).split("String");(t.exports=function(t,e,i,h){var l,c=!!h&&!!h.unsafe,p=!!h&&!!h.enumerable,g=!!h&&!!h.noTargetGet,y=h&&void 0!==h.name?h.name:e;o(i)&&("Symbol("===String(y).slice(0,7)&&(y="["+String(y).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!r(i,"name")||u&&i.name!==y)&&s(i,"name",y),l=f(i),l.source||(l.source=d.join("string"==typeof y?y:""))),t!==n?(c?!g&&t[e]&&(p=!0):delete t[e],p?t[e]=i:s(t,e,i)):p?t[e]=i:a(e,i)})(Function.prototype,"toString",(function(){return o(this)&&c(this).source||h(this)}))},"6f70":function(t,e,i){(function(e){(function(){var i;function n(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}function o(t){var e="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return e?e.call(t):{next:n(t)}}function r(t){for(var e,i=[];!(e=t.next()).done;)i.push(e.value);return i}var s,a="function"==typeof Object.create?Object.create:function(t){function e(){}return e.prototype=t,new e};if("function"==typeof Object.setPrototypeOf)s=Object.setPrototypeOf;else{var h;t:{var l={a:!0},u={};try{u.__proto__=l,h=u.a;break t}catch(Tm){}h=!1}s=h?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var c=s;function f(t,e){if(t.prototype=a(e.prototype),t.prototype.constructor=t,c)c(t,e);else for(var i in e)if("prototype"!=i)if(Object.defineProperties){var n=Object.getOwnPropertyDescriptor(e,i);n&&Object.defineProperty(t,i,n)}else t[i]=e[i];t.BB=e.prototype}var d="undefined"!=typeof window&&window===self?self:"undefined"!=typeof e&&null!=e?e:self,p="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,i){t!=Array.prototype&&t!=Object.prototype&&(t[e]=i.value)};function g(t){if(t){for(var e=d,i=["Array","prototype","fill"],n=0;n<i.length-1;n++){var o=i[n];o in e||(e[o]={}),e=e[o]}i=i[i.length-1],n=e[i],t=t(n),t!=n&&null!=t&&p(e,i,{writable:!0,value:t})}}g((function(t){return t||function(t,e,i){var n=this.length||0;for(0>e&&(e=Math.max(0,n+e)),(null==i||i>n)&&(i=n),i=Number(i),0>i&&(i=Math.max(0,n+i)),e=Number(e||0);e<i;e++)this[e]=t;return this}}));var y="object"===typeof self&&self.self===self&&self||"object"===typeof e&&e.global===e&&e||"object"===typeof window&&window.window===window&&window||{};function m(){}function v(t,e){var i=-1;return function(){var n=this,o=arguments;-1!==i&&y.clearTimeout(i),i=x((function(){i=-1,t.apply(n,o)}),e)}}function x(t,e){return y.setTimeout(t,e)}function b(t){return y.document.createElement(t)}function w(t){throw Error(t)}function k(t,e){t="The object is frozen, so its properties cannot be set: "+t.toString(),void 0!==e&&(t+="  to value: "+e),w(t)}function M(t,e,i,n){i=null===i?"*":"string"===typeof i?i:"function"===typeof i&&"string"===typeof i.className?i.className:"",void 0!==n&&(i+="."+n),w(i+" is not in the range "+e+": "+t)}function S(t){y.console&&y.console.log(t)}function P(){y.console&&y.console.log("Warning: List/Map/Set constructors no longer take an argument that enforces type.Instead they take an optional collection of Values to add to the collection. See 2.0 changelog for details.")}function N(t){return"object"===typeof t&&null!==t}function C(t){return Array.isArray(t)||y.NodeList&&t instanceof y.NodeList||y.HTMLCollection&&t instanceof y.HTMLCollection}function T(t){return Array.prototype.slice.call(t)}function A(t,e,i){Array.isArray(t)?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 j(){var t=q.pop();return void 0===t?[]:t}function O(t){t.length=0,q.push(t)}function D(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(),""!==e)return t._className=e}else if(N(t)&&t.constructor)return D(t.constructor);return typeof t}function F(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 B(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.nB;if(i&&i[e])return!0;t=Object.getPrototypeOf(t)}return!1}function I(t,e,i){Object.defineProperty(Di.prototype,t,{get:e,set:i})}function E(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;o<t.length;o+=2)i[n++]=e[t.substr(o,2)];for(t=i.join(""),t=""===t?"0":t,e=[],i=0;256>i;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<t.length;s++)i=(i+1)%256,n=(n+e[i])%256,o=e[i],e[i]=e[n],e[n]=o,r+=String.fromCharCode(t.charCodeAt(s)^e[(e[i]+e[n])%256]);return r}void 0===y.requestAnimationFrame&&(void 0===y.setImmediate?y.requestAnimationFrame=function(t){y.setTimeout(t,0)}:y.requestAnimationFrame=y.setImmediate);var R=void 0!==y.navigator&&0<y.navigator.userAgent.indexOf("MSIE 9.0"),z=void 0!==y.navigator&&0<y.navigator.userAgent.indexOf("MSIE 10.0"),V=void 0!==y.navigator&&0<y.navigator.userAgent.indexOf("Trident/7"),G=void 0!==y.navigator&&0<y.navigator.userAgent.indexOf("Edge/"),Y=void 0!==y.navigator&&void 0!==y.navigator.platform&&0<=y.navigator.platform.toUpperCase().indexOf("MAC"),X=void 0!==y.navigator&&void 0!==y.navigator.platform&&null!==y.navigator.platform.match(/(iPhone|iPod|iPad)/i),q=[];function U(t,e,i){ot(this),this.l=t,this.oa=e,this.u=i}function K(t,e){return void 0===e||null===e||""===e?null:t[e]}function H(){this.qx=[]}function _(){}Object.freeze([]),m.className="Util",m.Dx="32ab5ff3b26f42dc0ed90f21452913b5",m.adym="gojs.net",m.vfo="28e647fdb665",m.className="Util",U.prototype.toString=function(){return"EnumValue."+this.oa},d.Object.defineProperties(U.prototype,{classType:{get:function(){return this.l}},name:{get:function(){return this.oa}},value:{get:function(){return this.u}}}),U.className="EnumValue",H.prototype.toString=function(){return this.qx.join("")},H.prototype.add=function(t){""!==t&&this.qx.push(t)},H.className="StringBuilder",_.className="PropertyCollection";var W={pB:!1,uB:!1,rB:!1,tB:!1,zB:!1,xB:!1,my:!1,qB:null,trace:function(t){y.console&&y.console.log(t)},sB:function(t,e,i,n){t.strokeStyle="red",t.fillStyle="red",t.font="8px sans-serif",t.beginPath(),t.moveTo(-10,0),t.lineTo(10,0),t.moveTo(0,-10),t.lineTo(0,10),t.stroke(),t.setTransform(1,0,0,1,0,0),t.scale(i,i),t.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),t.lineWidth=2,t.beginPath(),t.moveTo(n.left,n.top+20),t.lineTo(n.left,n.top),t.lineTo(n.left+20,n.top),t.moveTo(n.right,n.bottom-20),t.lineTo(n.right,n.bottom),t.lineTo(n.right-20,n.bottom),t.stroke(),t.fillText("DB: "+Math.round(n.x)+", "+Math.round(n.y)+", "+Math.round(n.width)+", "+Math.round(n.height),n.left,n.top-5)},oB:function(t){var e,i={};for(e in t){if(i.x=e,"licenseKey"!==i.x){var n=t[i.x];if(void 0!==n.prototype){i.Jm=Object.getOwnPropertyNames(n.prototype);for(var o={Ak:0};o.Ak<i.Jm.length;o={Ak:o.Ak},o.Ak++){var r=Object.getOwnPropertyDescriptor(n.prototype,i.Jm[o.Ak]);void 0!==r.get&&void 0===r.set&&Object.defineProperty(n.prototype,i.Jm[o.Ak],{set:function(t,e){return function(){throw Error("Property "+t.Jm[e.Ak]+" of "+t.x+" is read-only.")}}(i,o)})}}}i={Jm:i.Jm,x:i.x}}}};function $(){}$.prototype.reset=function(){},$.prototype.next=function(){return!1},$.prototype.rd=function(){return!1},$.prototype.first=function(){return null},$.prototype.any=function(){return!1},$.prototype.all=function(){return!0},$.prototype.each=function(){return this},$.prototype.map=function(){return this},$.prototype.filter=function(){return this},$.prototype.Sd=function(){},$.prototype.toString=function(){return"EmptyIterator"},d.Object.defineProperties($.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),$.prototype.first=$.prototype.first,$.prototype.hasNext=$.prototype.rd,$.prototype.next=$.prototype.next,$.prototype.reset=$.prototype.reset;var J=null;function Z(t){this.key=-1,this.value=t}function Q(t){this.ub=t,this.ff=null,t.Ha=null,this.ia=t.Ba,this.Ra=-1}function tt(t){this.ub=t,t.gh=null,this.ia=t.Ba,this.Ra=t.j.length}function et(t){ot(this),this.v=!1,this.j=[],this.Ba=0,this.gh=this.Ha=null,void 0!==t&&("function"===typeof t||"string"===typeof t?P():this.addAll(t))}function it(t){this.tg=t,t.Ha=null,this.ia=t.Ba,this.ka=null}function nt(t){ot(this),this.v=!1,this.Hb={},this.Fb=0,this.Ha=null,this.Ba=0,this.$e=this.ba=null,void 0!==t&&("function"===typeof t||"string"===typeof t?P():this.addAll(t))}function ot(t){t.__gohashid=at++}function rt(t){var e=t.__gohashid;return void 0===e&&(e=at++,t.__gohashid=e),e}function st(t){return t.__gohashid}$.className="EmptyIterator",J=new $,Z.prototype.reset=function(){this.key=-1},Z.prototype.next=function(){return-1===this.key&&(this.key=0,!0)},Z.prototype.rd=function(){return this.next()},Z.prototype.first=function(){return this.key=0,this.value},Z.prototype.any=function(t){return this.key=-1,t(this.value)},Z.prototype.all=function(t){return this.key=-1,t(this.value)},Z.prototype.each=function(t){return this.key=-1,t(this.value),this},Z.prototype.map=function(t){return new Z(t(this.value))},Z.prototype.filter=function(t){return t(this.value)?new Z(this.value):J},Z.prototype.Sd=function(){this.value=null},Z.prototype.toString=function(){return"SingletonIterator("+this.value+")"},d.Object.defineProperties(Z.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),Z.prototype.first=Z.prototype.first,Z.prototype.hasNext=Z.prototype.rd,Z.prototype.next=Z.prototype.next,Z.prototype.reset=Z.prototype.reset,Z.className="SingletonIterator",Q.prototype.reset=function(){var t=this.ub;t.Ha=null,this.ia=t.Ba,this.Ra=-1},Q.prototype.next=function(){var t=this.ub;if(t.Ba!==this.ia&&0>this.key)return!1;t=t.j;var e=t.length,i=++this.Ra,n=this.ff;if(null!==n)for(;i<e;){var o=t[i];if(n(o))return this.key=this.Ra=i,this.value=o,!0;i++}else{if(i<e)return this.key=i,this.value=t[i],!0;this.Sd()}return!1},Q.prototype.rd=function(){return this.next()},Q.prototype.first=function(){var t=this.ub;this.ia=t.Ba,this.Ra=0,t=t.j;var e=t.length,i=this.ff;if(null!==i){for(var n=0;n<e;){var o=t[n];if(i(o))return this.key=this.Ra=n,this.value=o;n++}return null}return 0<e?(t=t[0],this.key=0,this.value=t):null},Q.prototype.any=function(t){var e=this.ub;e.Ha=null,this.Ra=-1,e=e.j;for(var i=e.length,n=this.ff,o=0;o<i;o++){var r=e[o];if((null===n||n(r))&&t(r))return!0}return!1},Q.prototype.all=function(t){var e=this.ub;e.Ha=null,this.Ra=-1,e=e.j;for(var i=e.length,n=this.ff,o=0;o<i;o++){var r=e[o];if((null===n||n(r))&&!t(r))return!1}return!0},Q.prototype.each=function(t){var e=this.ub;e.Ha=null,this.Ra=-1,e=e.j;for(var i=e.length,n=this.ff,o=0;o<i;o++){var r=e[o];(null===n||n(r))&&t(r)}return this},Q.prototype.map=function(t){var e=this.ub;e.Ha=null,this.Ra=-1;var i=[];e=e.j;for(var n=e.length,o=this.ff,r=0;r<n;r++){var s=e[r];(null===o||o(s))&&i.push(t(s))}return t=new et,t.j=i,t.pb(),t.iterator},Q.prototype.filter=function(t){var e=this.ub;e.Ha=null,this.Ra=-1;var i=[];e=e.j;for(var n=e.length,o=this.ff,r=0;r<n;r++){var s=e[r];(null===o||o(s))&&t(s)&&i.push(s)}return t=new et,t.j=i,t.pb(),t.iterator},Q.prototype.Sd=function(){this.key=-1,this.value=null,this.ia=-1,this.ff=null,this.ub.Ha=this},Q.prototype.toString=function(){return"ListIterator@"+this.Ra+"/"+this.ub.count},d.Object.defineProperties(Q.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.ff},set:function(t){this.ff=t}},count:{get:function(){var t=this.ff;if(null!==t){for(var e=0,i=this.ub.j,n=i.length,o=0;o<n;o++)t(i[o])&&e++;return e}return this.ub.j.length}}}),Q.prototype.first=Q.prototype.first,Q.prototype.hasNext=Q.prototype.rd,Q.prototype.next=Q.prototype.next,Q.prototype.reset=Q.prototype.reset,Q.className="ListIterator",tt.prototype.reset=function(){var t=this.ub;t.gh=null,this.ia=t.Ba,this.Ra=t.j.length},tt.prototype.next=function(){var t=this.ub;if(t.Ba!==this.ia&&0>this.key)return!1;var e=--this.Ra;return 0<=e?(this.key=e,this.value=t.j[e],!0):(this.Sd(),!1)},tt.prototype.rd=function(){return this.next()},tt.prototype.first=function(){var t=this.ub;this.ia=t.Ba;var e=t.j;return this.Ra=t=e.length-1,0<=t?(e=e[t],this.key=t,this.value=e):null},tt.prototype.any=function(t){var e=this.ub;e.gh=null,e=e.j;var i=e.length;for(this.Ra=i,--i;0<=i;i--)if(t(e[i]))return!0;return!1},tt.prototype.all=function(t){var e=this.ub;e.gh=null,e=e.j;var i=e.length;for(this.Ra=i,--i;0<=i;i--)if(!t(e[i]))return!1;return!0},tt.prototype.each=function(t){var e=this.ub;e.gh=null,e=e.j;var i=e.length;for(this.Ra=i,--i;0<=i;i--)t(e[i]);return this},tt.prototype.map=function(t){var e=this.ub;e.gh=null;var i=[];e=e.j;var n=e.length;for(this.Ra=n,--n;0<=n;n--)i.push(t(e[n]));return t=new et,t.j=i,t.pb(),t.iterator},tt.prototype.filter=function(t){var e=this.ub;e.gh=null;var i=[];e=e.j;var n=e.length;for(this.Ra=n,--n;0<=n;n--){var o=e[n];t(o)&&i.push(o)}return t=new et,t.j=i,t.pb(),t.iterator},tt.prototype.Sd=function(){this.key=-1,this.value=null,this.ia=-1,this.ub.gh=this},tt.prototype.toString=function(){return"ListIteratorBackwards("+this.Ra+"/"+this.ub.count+")"},d.Object.defineProperties(tt.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ub.j.length}}}),tt.prototype.first=tt.prototype.first,tt.prototype.hasNext=tt.prototype.rd,tt.prototype.next=tt.prototype.next,tt.prototype.reset=tt.prototype.reset,tt.className="ListIteratorBackwards",i=et.prototype,i.pb=function(){var t=this.Ba;t++,999999999<t&&(t=0),this.Ba=t},i.freeze=function(){return this.v=!0,this},i.ea=function(){return this.v=!1,this},i.toString=function(){return"List()#"+st(this)},i.add=function(t){return null===t||(this.v&&k(this,t),this.j.push(t),this.pb()),this},i.push=function(t){this.add(t)},i.addAll=function(t){if(null===t)return this;this.v&&k(this);var e=this.j;if(C(t))for(var i=t.length,n=0;n<i;n++)e.push(t[n]);else for(t=t.iterator;t.next();)e.push(t.value);return this.pb(),this},i.clear=function(){this.v&&k(this),this.j.length=0,this.pb()},i.contains=function(t){return null!==t&&-1!==this.j.indexOf(t)},i.has=function(t){return this.contains(t)},i.indexOf=function(t){return null===t?-1:this.j.indexOf(t)},i.J=function(t){var e=this.j;return(0>t||t>=e.length)&&M(t,"0 <= i < length",et,"elt:i"),e[t]},i.get=function(t){return this.J(t)},i.Pc=function(t,e){var i=this.j;(0>t||t>=i.length)&&M(t,"0 <= i < length",et,"setElt:i"),this.v&&k(this,t),i[t]=e},i.set=function(t,e){this.Pc(t,e)},i.first=function(){var t=this.j;return 0===t.length?null:t[0]},i.Xb=function(){var t=this.j,e=t.length;return 0<e?t[e-1]:null},i.pop=function(){this.v&&k(this);var t=this.j;return 0<t.length?t.pop():null},et.prototype.any=function(t){for(var e=this.j,i=e.length,n=0;n<i;n++)if(t(e[n]))return!0;return!1},et.prototype.all=function(t){for(var e=this.j,i=e.length,n=0;n<i;n++)if(!t(e[n]))return!1;return!0},et.prototype.each=function(t){for(var e=this.j,i=e.length,n=0;n<i;n++)t(e[n]);return this},et.prototype.map=function(t){for(var e=new et,i=[],n=this.j,o=n.length,r=0;r<o;r++)i.push(t(n[r]));return e.j=i,e.pb(),e},et.prototype.filter=function(t){for(var e=new et,i=[],n=this.j,o=n.length,r=0;r<o;r++){var s=n[r];t(s)&&i.push(s)}return e.j=i,e.pb(),e},i=et.prototype,i.wb=function(t,e){0>t&&M(t,">= 0",et,"insertAt:i"),this.v&&k(this,t);var i=this.j;t>=i.length?i.push(e):i.splice(t,0,e),this.pb()},i.remove=function(t){if(null===t)return!1;this.v&&k(this,t);var e=this.j;return t=e.indexOf(t),-1!==t&&(t===e.length-1?e.pop():e.splice(t,1),this.pb(),!0)},i.delete=function(t){return this.remove(t)},i.cb=function(t){var e=this.j;(0>t||t>=e.length)&&M(t,"0 <= i < length",et,"removeAt:i"),this.v&&k(this,t),t===e.length-1?e.pop():e.splice(t,1),this.pb()},i.removeRange=function(t,e){var i=this.j,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.v&&k(this);for(var o=t,r=e+1;r<n;)i[o++]=i[r++];return i.length=n-(e-t+1),this.pb(),this},et.prototype.copy=function(){var t=new et,e=this.j;return 0<e.length&&(t.j=Array.prototype.slice.call(e)),t},i=et.prototype,i.ma=function(){for(var t=this.j,e=this.count,i=Array(e),n=0;n<e;n++)i[n]=t[n];return i},i.Lw=function(){for(var t=new nt,e=this.j,i=this.count,n=0;n<i;n++)t.add(e[n]);return t},i.sort=function(t){return this.v&&k(this),this.j.sort(t),this.pb(),this},i.uj=function(t,e,i){var n=this.j,o=n.length;void 0===e&&(e=0),void 0===i&&(i=o),this.v&&k(this);var r=i-e;if(1>=r)return this;if((0>e||e>=o-1)&&M(e,"0 <= from < length",et,"sortRange:from"),2===r)return i=n[e],o=n[e+1],0<t(i,o)&&(n[e]=o,n[e+1]=i,this.pb()),this;if(0===e)if(i>=o)n.sort(t);else for(e=n.slice(0,i),e.sort(t),t=0;t<i;t++)n[t]=e[t];else if(i>=o)for(i=n.slice(e),i.sort(t),t=e;t<o;t++)n[t]=i[t-e];else for(o=n.slice(e,i),o.sort(t),t=e;t<i;t++)n[t]=o[t-e];return this.pb(),this},i.reverse=function(){return this.v&&k(this),this.j.reverse(),this.pb(),this},d.Object.defineProperties(et.prototype,{_dataArray:{get:function(){return this.j}},count:{get:function(){return this.j.length}},size:{get:function(){return this.j.length}},length:{get:function(){return this.j.length}},iterator:{get:function(){if(0>=this.j.length)return J;var t=this.Ha;return null!==t?(t.reset(),t):new Q(this)}},iteratorBackwards:{get:function(){if(0>=this.j.length)return J;var t=this.gh;return null!==t?(t.reset(),t):new tt(this)}}}),et.prototype.reverse=et.prototype.reverse,et.prototype.sortRange=et.prototype.uj,et.prototype.sort=et.prototype.sort,et.prototype.toSet=et.prototype.Lw,et.prototype.toArray=et.prototype.ma,et.prototype.removeRange=et.prototype.removeRange,et.prototype.removeAt=et.prototype.cb,et.prototype["delete"]=et.prototype.delete,et.prototype.remove=et.prototype.remove,et.prototype.insertAt=et.prototype.wb,et.prototype.pop=et.prototype.pop,et.prototype.last=et.prototype.Xb,et.prototype.first=et.prototype.first,et.prototype.set=et.prototype.set,et.prototype.setElt=et.prototype.Pc,et.prototype.get=et.prototype.get,et.prototype.elt=et.prototype.J,et.prototype.indexOf=et.prototype.indexOf,et.prototype.has=et.prototype.has,et.prototype.contains=et.prototype.contains,et.prototype.clear=et.prototype.clear,et.prototype.addAll=et.prototype.addAll,et.prototype.push=et.prototype.push,et.prototype.add=et.prototype.add,et.prototype.thaw=et.prototype.ea,et.prototype.freeze=et.prototype.freeze,et.className="List",it.prototype.reset=function(){var t=this.tg;t.Ha=null,this.ia=t.Ba,this.ka=null},it.prototype.next=function(){var t=this.tg;if(t.Ba!==this.ia&&null===this.key)return!1;var e=this.ka;return e=null===e?t.ba:e.pa,null!==e?(this.ka=e,this.value=e.value,this.key=e.key,!0):(this.Sd(),!1)},it.prototype.rd=function(){return this.next()},it.prototype.first=function(){var t=this.tg;if(this.ia=t.Ba,t=t.ba,null!==t){this.ka=t;var e=t.value;return this.key=t.key,this.value=e}return null},it.prototype.any=function(t){var e=this.tg;for(this.ka=e.Ha=null,e=e.ba;null!==e;){if(t(e.value))return!0;e=e.pa}return!1},it.prototype.all=function(t){var e=this.tg;for(this.ka=e.Ha=null,e=e.ba;null!==e;){if(!t(e.value))return!1;e=e.pa}return!0},it.prototype.each=function(t){var e=this.tg;for(this.ka=e.Ha=null,e=e.ba;null!==e;)t(e.value),e=e.pa;return this},it.prototype.map=function(t){var e=this.tg;e.Ha=null;var i=new et;for(e=e.ba;null!==e;)i.add(t(e.value)),e=e.pa;return i.iterator},it.prototype.filter=function(t){var e=this.tg;e.Ha=null;var i=new et;for(e=e.ba;null!==e;){var n=e.value;t(n)&&i.add(n),e=e.pa}return i.iterator},it.prototype.Sd=function(){this.value=this.key=null,this.ia=-1,this.tg.Ha=this},it.prototype.toString=function(){return null!==this.ka?"SetIterator@"+this.ka.value:"SetIterator"},d.Object.defineProperties(it.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.tg.Fb}}}),it.prototype.first=it.prototype.first,it.prototype.hasNext=it.prototype.rd,it.prototype.next=it.prototype.next,it.prototype.reset=it.prototype.reset,it.className="SetIterator",i=nt.prototype,i.pb=function(){var t=this.Ba;t++,999999999<t&&(t=0),this.Ba=t},i.freeze=function(){return this.v=!0,this},i.ea=function(){return this.v=!1,this},i.toString=function(){return"Set()#"+st(this)},i.add=function(t){if(null===t)return this;this.v&&k(this,t);var e=t;return N(t)&&(e=rt(t)),void 0===this.Hb[e]&&(this.Fb++,t=new ct(t,t),this.Hb[e]=t,e=this.$e,null===e?this.ba=t:(t.Xl=e,e.pa=t),this.$e=t,this.pb()),this},i.addAll=function(t){if(null===t)return this;if(this.v&&k(this),C(t))for(var e=t.length,i=0;i<e;i++)this.add(t[i]);else for(t=t.iterator;t.next();)this.add(t.value);return this},i.contains=function(t){if(null===t)return!1;var e=t;return(!N(t)||(e=st(t),void 0!==e))&&void 0!==this.Hb[e]},i.has=function(t){return this.contains(t)},i.Ez=function(t){if(null===t)return!0;for(t=t.iterator;t.next();)if(!this.contains(t.value))return!1;return!0},i.Fz=function(t){if(null===t)return!0;for(t=t.iterator;t.next();)if(this.contains(t.value))return!0;return!1},i.first=function(){var t=this.ba;return null===t?null:t.value},nt.prototype.any=function(t){for(var e=this.ba;null!==e;){if(t(e.value))return!0;e=e.pa}return!1},nt.prototype.all=function(t){for(var e=this.ba;null!==e;){if(!t(e.value))return!1;e=e.pa}return!0},nt.prototype.each=function(t){for(var e=this.ba;null!==e;)t(e.value),e=e.pa;return this},nt.prototype.map=function(t){for(var e=new nt,i=this.ba;null!==i;)e.add(t(i.value)),i=i.pa;return e},nt.prototype.filter=function(t){for(var e=new nt,i=this.ba;null!==i;){var n=i.value;t(n)&&e.add(n),i=i.pa}return e},i=nt.prototype,i.remove=function(t){if(null===t)return!1;this.v&&k(this,t);var e=t;if(N(t)&&(e=st(t),void 0===e))return!1;if(t=this.Hb[e],void 0===t)return!1;var i=t.pa,n=t.Xl;return null!==i&&(i.Xl=n),null!==n&&(n.pa=i),this.ba===t&&(this.ba=i),this.$e===t&&(this.$e=n),delete this.Hb[e],this.Fb--,this.pb(),!0},i.delete=function(t){return this.remove(t)},i.Zq=function(t){if(null===t)return this;if(this.v&&k(this),C(t))for(var e=t.length,i=0;i<e;i++)this.remove(t[i]);else for(t=t.iterator;t.next();)this.remove(t.value);return this},i.YA=function(t){if(null===t||0===this.count)return this;this.v&&k(this);var e=new nt;e.addAll(t),t=[];for(var i=this.iterator;i.next();){var n=i.value;e.contains(n)||t.push(n)}return this.Zq(t),this},i.clear=function(){this.v&&k(this),this.Hb={},this.Fb=0,null!==this.Ha&&this.Ha.reset(),this.$e=this.ba=null,this.pb()},nt.prototype.copy=function(){var t,e=new nt,i=this.Hb;for(t in i)e.add(i[t].value);return e},nt.prototype.ma=function(){var t,e=Array(this.Fb),i=this.Hb,n=0;for(t in i)e[n]=i[t].value,n++;return e},nt.prototype.Kw=function(){var t,e=new et,i=this.Hb;for(t in i)e.add(i[t].value);return e},d.Object.defineProperties(nt.prototype,{count:{get:function(){return this.Fb}},size:{get:function(){return this.Fb}},iterator:{get:function(){if(0>=this.Fb)return J;var t=this.Ha;return null!==t?(t.reset(),t):new it(this)}}}),nt.prototype.toList=nt.prototype.Kw,nt.prototype.toArray=nt.prototype.ma,nt.prototype.clear=nt.prototype.clear,nt.prototype.retainAll=nt.prototype.YA,nt.prototype.removeAll=nt.prototype.Zq,nt.prototype["delete"]=nt.prototype.delete,nt.prototype.remove=nt.prototype.remove,nt.prototype.first=nt.prototype.first,nt.prototype.containsAny=nt.prototype.Fz,nt.prototype.containsAll=nt.prototype.Ez,nt.prototype.has=nt.prototype.has,nt.prototype.contains=nt.prototype.contains,nt.prototype.addAll=nt.prototype.addAll,nt.prototype.add=nt.prototype.add,nt.prototype.thaw=nt.prototype.ea,nt.prototype.freeze=nt.prototype.freeze;var at=1;function ht(t){this.ga=t,this.ia=t.Ba,this.ka=null}function lt(t){nt.call(this),ot(this),this.v=!0,this.ga=t}function ut(t){this.ga=t,t.Ze=null,this.ia=t.Ba,this.ka=null}function ct(t,e){this.key=t,this.value=e,this.Xl=this.pa=null}function ft(t){this.ga=t,t.Ha=null,this.ia=t.Ba,this.ka=null}function dt(t){ot(this),this.v=!1,this.Hb={},this.Fb=0,this.Ze=this.Ha=null,this.Ba=0,this.$e=this.ba=null,void 0!==t&&("function"===typeof t||"string"===typeof t?P():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.v=!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 yt(t){return t.x.toString()+" "+t.y.toString()}function mt(t,e){if(0===t)return 0<e?90:0>e?270:0;if(0===e)return 0<t?0:180;if(isNaN(t)||isNaN(e))return 0;var i=180*Math.atan(Math.abs(e/t))/Math.PI;return 0>t?i=0>e?i+180:180-i:0>e&&(i=360-i),i}function vt(t,e){return e.Jd(t),t}function xt(t,e,i,n,o,r){var s=o-i,a=r-n,h=s*s+a*a;i-=t,n-=e;var l=-i*s-n*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*t/h)}function bt(t,e,i,n){return t=i-t,e=n-e,t*t+e*e}function wt(t,e,i,n){return t=i-t,e=n-e,0===t?0<e?90:0>e?270:0:0===e?0<t?0:180:isNaN(t)||isNaN(e)?0:(n=180*Math.atan(Math.abs(e/t))/Math.PI,0>t?n=0>e?n+180:180-n:0>e&&(n=360-n),n)}nt.className="Set",nt.uniqueHash=ot,nt.hashIdUnique=rt,nt.hashId=st,ht.prototype.reset=function(){this.ia=this.ga.Ba,this.ka=null},ht.prototype.next=function(){var t=this.ga;if(t.Ba!==this.ia&&null===this.key)return!1;var e=this.ka;return e=null===e?t.ba:e.pa,null!==e?(this.ka=e,this.value=this.key=t=e.key,!0):(this.Sd(),!1)},ht.prototype.rd=function(){return this.next()},ht.prototype.first=function(){var t=this.ga;return this.ia=t.Ba,t=t.ba,null!==t?(this.ka=t,this.value=this.key=t=t.key):null},ht.prototype.any=function(t){var e=this.ga;for(this.ka=null,e=e.ba;null!==e;){if(t(e.key))return!0;e=e.pa}return!1},ht.prototype.all=function(t){var e=this.ga;for(this.ka=null,e=e.ba;null!==e;){if(!t(e.key))return!1;e=e.pa}return!0},ht.prototype.each=function(t){var e=this.ga;for(this.ka=null,e=e.ba;null!==e;)t(e.key),e=e.pa;return this},ht.prototype.map=function(t){var e=this.ga;this.ka=null;var i=new et;for(e=e.ba;null!==e;)i.add(t(e.key)),e=e.pa;return i.iterator},ht.prototype.filter=function(t){var e=this.ga;this.ka=null;var i=new et;for(e=e.ba;null!==e;){var n=e.key;t(n)&&i.add(n),e=e.pa}return i.iterator},ht.prototype.Sd=function(){this.value=this.key=null,this.ia=-1},ht.prototype.toString=function(){return null!==this.ka?"MapKeySetIterator@"+this.ka.value:"MapKeySetIterator"},d.Object.defineProperties(ht.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Fb}}}),ht.prototype.first=ht.prototype.first,ht.prototype.hasNext=ht.prototype.rd,ht.prototype.next=ht.prototype.next,ht.prototype.reset=ht.prototype.reset,ht.className="MapKeySetIterator",f(lt,nt),i=lt.prototype,i.freeze=function(){return this},i.ea=function(){return this},i.toString=function(){return"MapKeySet("+this.ga.toString()+")"},i.add=function(){return w("This Set is read-only: "+this.toString()),this},i.contains=function(t){return this.ga.contains(t)},i.has=function(t){return this.contains(t)},i.remove=function(){return w("This Set is read-only: "+this.toString()),!1},i.delete=function(t){return this.remove(t)},i.clear=function(){w("This Set is read-only: "+this.toString())},i.first=function(){var t=this.ga.ba;return null!==t?t.key:null},lt.prototype.any=function(t){for(var e=this.ga.ba;null!==e;){if(t(e.key))return!0;e=e.pa}return!1},lt.prototype.all=function(t){for(var e=this.ga.ba;null!==e;){if(!t(e.key))return!1;e=e.pa}return!0},lt.prototype.each=function(t){for(var e=this.ga.ba;null!==e;)t(e.key),e=e.pa;return this},lt.prototype.map=function(t){for(var e=new nt,i=this.ga.ba;null!==i;)e.add(t(i.key)),i=i.pa;return e},lt.prototype.filter=function(t){for(var e=new nt,i=this.ga.ba;null!==i;){var n=i.key;t(n)&&e.add(n),i=i.pa}return e},lt.prototype.copy=function(){return new lt(this.ga)},lt.prototype.Lw=function(){var t,e=new nt,i=this.ga.Hb;for(t in i)e.add(i[t].key);return e},lt.prototype.ma=function(){var t,e=this.ga.Hb,i=Array(this.ga.Fb),n=0;for(t in e)i[n]=e[t].key,n++;return i},lt.prototype.Kw=function(){var t,e=new et,i=this.ga.Hb;for(t in i)e.add(i[t].key);return e},d.Object.defineProperties(lt.prototype,{count:{get:function(){return this.ga.Fb}},size:{get:function(){return this.ga.Fb}},iterator:{get:function(){return 0>=this.ga.Fb?J:new ht(this.ga)}}}),lt.prototype.toList=lt.prototype.Kw,lt.prototype.toArray=lt.prototype.ma,lt.prototype.toSet=lt.prototype.Lw,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.ea,lt.prototype.freeze=lt.prototype.freeze,lt.className="MapKeySet",ut.prototype.reset=function(){var t=this.ga;t.Ze=null,this.ia=t.Ba,this.ka=null},ut.prototype.next=function(){var t=this.ga;if(t.Ba!==this.ia&&null===this.key)return!1;var e=this.ka;return e=null===e?t.ba:e.pa,null!==e?(this.ka=e,this.value=e.value,this.key=e.key,!0):(this.Sd(),!1)},ut.prototype.rd=function(){return this.next()},ut.prototype.first=function(){var t=this.ga;if(this.ia=t.Ba,t=t.ba,null!==t){this.ka=t;var e=t.value;return this.key=t.key,this.value=e}return null},ut.prototype.any=function(t){var e=this.ga;for(this.ka=e.Ze=null,e=e.ba;null!==e;){if(t(e.value))return!0;e=e.pa}return!1},ut.prototype.all=function(t){var e=this.ga;for(this.ka=e.Ze=null,e=e.ba;null!==e;){if(!t(e.value))return!1;e=e.pa}return!0},ut.prototype.each=function(t){var e=this.ga;for(this.ka=e.Ze=null,e=e.ba;null!==e;)t(e.value),e=e.pa;return this},ut.prototype.map=function(t){var e=this.ga;this.ka=e.Ze=null;var i=new et;for(e=e.ba;null!==e;)i.add(t(e.value)),e=e.pa;return i.iterator},ut.prototype.filter=function(t){var e=this.ga;this.ka=e.Ze=null;var i=new et;for(e=e.ba;null!==e;){var n=e.value;t(n)&&i.add(n),e=e.pa}return i.iterator},ut.prototype.Sd=function(){this.value=this.key=null,this.ia=-1,this.ga.Ze=this},ut.prototype.toString=function(){return null!==this.ka?"MapValueSetIterator@"+this.ka.value:"MapValueSetIterator"},d.Object.defineProperties(ut.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Fb}}}),ut.prototype.first=ut.prototype.first,ut.prototype.hasNext=ut.prototype.rd,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.ga;t.Ha=null,this.ia=t.Ba,this.ka=null},ft.prototype.next=function(){var t=this.ga;if(t.Ba!==this.ia&&null===this.key)return!1;var e=this.ka;return e=null===e?t.ba:e.pa,null!==e?(this.ka=e,this.key=e.key,this.value=e.value,!0):(this.Sd(),!1)},ft.prototype.rd=function(){return this.next()},ft.prototype.first=function(){var t=this.ga;return this.ia=t.Ba,t=t.ba,null!==t?(this.ka=t,this.key=t.key,this.value=t.value,t):null},ft.prototype.any=function(t){var e=this.ga;for(this.ka=e.Ha=null,e=e.ba;null!==e;){if(t(e))return!0;e=e.pa}return!1},ft.prototype.all=function(t){var e=this.ga;for(this.ka=e.Ha=null,e=e.ba;null!==e;){if(!t(e))return!1;e=e.pa}return!0},ft.prototype.each=function(t){var e=this.ga;for(this.ka=e.Ha=null,e=e.ba;null!==e;)t(e),e=e.pa;return this},ft.prototype.map=function(t){var e=this.ga;this.ka=e.Ha=null;var i=new et;for(e=e.ba;null!==e;)i.add(t(e)),e=e.pa;return i.iterator},ft.prototype.filter=function(t){var e=this.ga;this.ka=e.Ha=null;var i=new et;for(e=e.ba;null!==e;)t(e)&&i.add(e),e=e.pa;return i.iterator},ft.prototype.Sd=function(){this.value=this.key=null,this.ia=-1,this.ga.Ha=this},ft.prototype.toString=function(){return null!==this.ka?"MapIterator@"+this.ka:"MapIterator"},d.Object.defineProperties(ft.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ga.Fb}}}),ft.prototype.first=ft.prototype.first,ft.prototype.hasNext=ft.prototype.rd,ft.prototype.next=ft.prototype.next,ft.prototype.reset=ft.prototype.reset,ft.className="MapIterator",i=dt.prototype,i.pb=function(){var t=this.Ba;t++,999999999<t&&(t=0),this.Ba=t},i.freeze=function(){return this.v=!0,this},i.ea=function(){return this.v=!1,this},i.toString=function(){return"Map()#"+st(this)},i.add=function(t,e){this.v&&k(this,t);var i=t;N(t)&&(i=rt(t));var n=this.Hb[i];return void 0===n?(this.Fb++,t=new ct(t,e),this.Hb[i]=t,i=this.$e,null===i?this.ba=t:(t.Xl=i,i.pa=t),this.$e=t,this.pb()):n.value=e,this},i.set=function(t,e){return this.add(t,e)},i.addAll=function(t){if(null===t)return this;if(C(t))for(var e=t.length,i=0;i<e;i++){var n=t[i];this.add(n.key,n.value)}else if(t instanceof dt)for(t=t.iterator;t.next();)this.add(t.key,t.value);else for(t=t.iterator;t.next();)e=t.value,this.add(e.key,e.value);return this},i.first=function(){return this.ba},dt.prototype.any=function(t){for(var e=this.ba;null!==e;){if(t(e))return!0;e=e.pa}return!1},dt.prototype.all=function(t){for(var e=this.ba;null!==e;){if(!t(e))return!1;e=e.pa}return!0},dt.prototype.each=function(t){for(var e=this.ba;null!==e;)t(e),e=e.pa;return this},dt.prototype.map=function(t){for(var e=new dt,i=this.ba;null!==i;)e.add(i.key,t(i)),i=i.pa;return e},dt.prototype.filter=function(t){for(var e=new dt,i=this.ba;null!==i;)t(i)&&e.add(i.key,i.value),i=i.pa;return e},i=dt.prototype,i.contains=function(t){var e=t;return(!N(t)||(e=st(t),void 0!==e))&&void 0!==this.Hb[e]},i.has=function(t){return this.contains(t)},i.G=function(t){var e=t;return N(t)&&(e=st(t),void 0===e)?null:(t=this.Hb[e],void 0===t?null:t.value)},i.get=function(t){return this.G(t)},i.remove=function(t){if(null===t)return!1;this.v&&k(this,t);var e=t;if(N(t)&&(e=st(t),void 0===e))return!1;if(t=this.Hb[e],void 0===t)return!1;var i=t.pa,n=t.Xl;return null!==i&&(i.Xl=n),null!==n&&(n.pa=i),this.ba===t&&(this.ba=i),this.$e===t&&(this.$e=n),delete this.Hb[e],this.Fb--,this.pb(),!0},i.delete=function(t){return this.remove(t)},i.clear=function(){this.v&&k(this),this.Hb={},this.Fb=0,null!==this.Ha&&this.Ha.reset(),null!==this.Ze&&this.Ze.reset(),this.$e=this.ba=null,this.pb()},dt.prototype.copy=function(){var t,e=new dt,i=this.Hb;for(t in i){var n=i[t];e.add(n.key,n.value)}return e},dt.prototype.ma=function(){var t,e=this.Hb,i=Array(this.Fb),n=0;for(t in e){var o=e[t];i[n]=new ct(o.key,o.value),n++}return i},dt.prototype.Kf=function(){return new lt(this)},d.Object.defineProperties(dt.prototype,{count:{get:function(){return this.Fb}},size:{get:function(){return this.Fb}},iterator:{get:function(){if(0>=this.count)return J;var t=this.Ha;return null!==t?(t.reset(),t):new ft(this)}},iteratorKeys:{get:function(){return 0>=this.count?J:new ht(this)}},iteratorValues:{get:function(){if(0>=this.count)return J;var t=this.Ze;return null!==t?(t.reset(),t):new ut(this)}}}),dt.prototype.toKeySet=dt.prototype.Kf,dt.prototype.toArray=dt.prototype.ma,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.G,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.ea,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.Ig=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},i=pt.prototype,i.ca=function(){return this.v=!0,Object.freeze(this),this},i.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()},i.freeze=function(){return this.v=!0,this},i.ea=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this.v=!1,this},i.toString=function(){return"Point("+this.x+","+this.y+")"},i.w=function(t){return t instanceof pt&&(this.x===t.x&&this.y===t.y)},i.fj=function(t,e){return this.x===t&&this.y===e},i.Qa=function(t){return _e.A(this.x,t.x)&&_e.A(this.y,t.y)},i.add=function(t){return this.x+=t.x,this.y+=t.y,this},i.ge=function(t){return this.x-=t.x,this.y-=t.y,this},i.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},i=pt.prototype,i.scale=function(t,e){return this.x*=t,this.y*=e,this},i.Ie=function(t){var e=t.x-this.x;return t=t.y-this.y,e*e+t*t},i.qd=function(t,e){return t-=this.x,e-=this.y,t*t+e*e},i.normalize=function(){var t=this.x,e=this.y,i=Math.sqrt(t*t+e*e);return 0<i&&(this.x=t/i,this.y=e/i),this},i.Pa=function(t){return mt(t.x-this.x,t.y-this.y)},i.direction=function(t,e){return mt(t-this.x,e-this.y)},i.OA=function(t,e,i,n){return _e.Qh(t,e,i,n,this.x,this.y,this),this},i.PA=function(t,e){return _e.Qh(t.x,t.y,e.x,e.y,this.x,this.y,this),this},i.cB=function(t,e,i,n){return _e.Gq(this.x,this.y,t,e,i,n,this),this},i.dB=function(t,e){return _e.Gq(this.x,this.y,t.x,t.y,e.width,e.height,this),this},i.tj=function(t,e){return this.x=t.x+e.x*t.width+e.offsetX,this.y=t.y+e.y*t.height+e.offsetY,this},i.Uk=function(t,e,i,n,o){return this.x=t+o.x*i+o.offsetX,this.y=e+o.y*n+o.offsetY,this},i.transform=function(t){return t.ta(this),this},i.s=function(){return isFinite(this.x)&&isFinite(this.y)},pt.alloc=function(){var t=Ft.pop();return void 0===t?new pt:t},pt.allocAt=function(t,e){var i=Ft.pop();return void 0===i?new pt(t,e):(i.x=t,i.y=e,i)},pt.free=function(t){Ft.push(t)},pt.prototype.isReal=pt.prototype.s,pt.prototype.setSpot=pt.prototype.Uk,pt.prototype.setRectSpot=pt.prototype.tj,pt.prototype.snapToGridPoint=pt.prototype.dB,pt.prototype.snapToGrid=pt.prototype.cB,pt.prototype.projectOntoLineSegmentPoint=pt.prototype.PA,pt.prototype.projectOntoLineSegment=pt.prototype.OA,pt.intersectingLineSegments=function(t,e,i,n,o,r,s,a){return _e.Cm(t,e,i,n,o,r,s,a)},pt.prototype.direction=pt.prototype.direction,pt.prototype.directionPoint=pt.prototype.Pa,pt.prototype.normalize=pt.prototype.normalize,pt.prototype.distanceSquared=pt.prototype.qd,pt.prototype.distanceSquaredPoint=pt.prototype.Ie,pt.prototype.scale=pt.prototype.scale,pt.prototype.rotate=pt.prototype.rotate,pt.prototype.offset=pt.prototype.offset,pt.prototype.subtract=pt.prototype.ge,pt.prototype.add=pt.prototype.add,pt.prototype.equalsApprox=pt.prototype.Qa,pt.prototype.equalTo=pt.prototype.fj,pt.prototype.equals=pt.prototype.w,pt.prototype.set=pt.prototype.set,pt.prototype.setTo=pt.prototype.Ig;var kt,Mt,St,Pt,Nt,Ct,Tt,At=null,Lt=null,jt=null,Ot=null,Dt=null,Ft=[];function Bt(t,e){void 0===t?this.height=this.width=0:"number"===typeof t&&(0<=t||isNaN(t))&&"number"===typeof e&&(0<=e||isNaN(e))?(this.width=t,this.height=e):w("Invalid arguments to Size constructor: "+t+", "+e),this.v=!1}function It(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 Bt(i,o)}return new Bt}function Et(t){return t.width.toString()+" "+t.height.toString()}pt.className="Point",pt.parse=gt,pt.stringify=yt,pt.distanceLineSegmentSquared=xt,pt.distanceSquared=bt,pt.direction=wt,pt.Origin=At=new pt(0,0).ca(),pt.InfiniteTopLeft=Lt=new pt(-1/0,-1/0).ca(),pt.InfiniteBottomRight=jt=new pt(1/0,1/0).ca(),pt.SixPoint=Ot=new pt(6,6).ca(),pt.NoPoint=Dt=new pt(NaN,NaN).ca(),pt.parse=gt,pt.stringify=yt,pt.distanceLineSegmentSquared=xt,pt.distanceSquared=bt,pt.direction=wt,Bt.prototype.assign=function(t){return this.width=t.width,this.height=t.height,this},Bt.prototype.h=function(t,e){return this.width=t,this.height=e,this},Bt.prototype.Ig=function(t,e){return this.width=t,this.height=e,this},Bt.prototype.set=function(t){return this.width=t.width,this.height=t.height,this},Bt.prototype.copy=function(){var t=new Bt;return t.width=this.width,t.height=this.height,t},i=Bt.prototype,i.ca=function(){return this.v=!0,Object.freeze(this),this},i.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()},i.freeze=function(){return this.v=!0,this},i.ea=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this.v=!1,this},i.toString=function(){return"Size("+this.width+","+this.height+")"},i.w=function(t){return t instanceof Bt&&(this.width===t.width&&this.height===t.height)},i.fj=function(t,e){return this.width===t&&this.height===e},i.Qa=function(t){return _e.A(this.width,t.width)&&_e.A(this.height,t.height)},i.s=function(){return isFinite(this.width)&&isFinite(this.height)},Bt.alloc=function(){var t=Rt.pop();return void 0===t?new Bt:t},Bt.free=function(t){Rt.push(t)},Bt.prototype.isReal=Bt.prototype.s,Bt.prototype.equalsApprox=Bt.prototype.Qa,Bt.prototype.equalTo=Bt.prototype.fj,Bt.prototype.equals=Bt.prototype.w,Bt.prototype.set=Bt.prototype.set,Bt.prototype.setTo=Bt.prototype.Ig;var Rt=[];function zt(t,e,i,n){void 0===t?this.height=this.width=this.y=this.x=0:t instanceof pt?(i=t.x,t=t.y,e instanceof pt?(n=e.x,e=e.y,this.x=Math.min(i,n),this.y=Math.min(t,e),this.width=Math.abs(i-n),this.height=Math.abs(t-e)):e instanceof Bt?(this.x=i,this.y=t,this.width=e.width,this.height=e.height):w("Incorrect arguments supplied to Rect constructor")):"number"===typeof t&&"number"===typeof e&&"number"===typeof i&&(0<=i||isNaN(i))&&"number"===typeof n&&(0<=n||isNaN(n))?(this.x=t,this.y=e,this.width=i,this.height=n):w("Invalid arguments to Rect constructor: "+t+", "+e+", "+i+", "+n),this.v=!1}function Vt(t,e,i){t.width=e,t.height=i}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++;(n=t[e++])&&(o=parseFloat(n));for(var r=0;""===t[e];)e++;(n=t[e++])&&(r=parseFloat(n));for(var s=0;""===t[e];)e++;return(n=t[e++])&&(s=parseFloat(n)),new zt(i,o,r,s)}return new zt}function Yt(t){return t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString()}function Xt(t,e){return _e.aa(t.x,e.x)&&_e.aa(t.y,e.y)&&_e.aa(t.width,e.width)&&_e.aa(t.height,e.height)}function qt(t,e,i,n,o){var r=t.width;return i+o<=-r?(t.x+=r/2,t.width=0):(t.x-=o,t.width+=i+o),i=t.height,e+n<=-i?(t.y+=i/2,t.height=0):(t.y-=e,t.height+=e+n),t}function Ut(t,e,i,n,o){var r=Math.max(t.x,e),s=Math.max(t.y,i);return e=Math.min(t.x+t.width,e+n),i=Math.min(t.y+t.height,i+o),t.x=r,t.y=s,t.width=Math.max(0,e-r),t.height=Math.max(0,i-s),t}function Kt(t,e){var i=t.width,n=t.x,o=e.x-10;return!(n>e.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 Ht(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 _t(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 Wt(t,e,i,n,o,r,s,a){return!(t>s+o||o>i+t)&&!(e>a+r||r>n+e)}Bt.className="Size",Bt.parse=It,Bt.stringify=Et,Bt.ZeroSize=kt=new Bt(0,0).ca(),Bt.OneSize=Mt=new Bt(1,1).ca(),Bt.SixSize=St=new Bt(6,6).ca(),Bt.EightSize=Pt=new Bt(8,8).ca(),Bt.TenSize=Nt=new Bt(10,10).ca(),Bt.InfiniteSize=Ct=new Bt(1/0,1/0).ca(),Bt.NoSize=Tt=new Bt(NaN,NaN).ca(),Bt.parse=It,Bt.stringify=Et,i=zt.prototype,i.assign=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.h=function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},i.Ig=function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},i.set=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.Qc=function(t){return this.x=t.x,this.y=t.y,this},i.bB=function(t){return this.width=t.width,this.height=t.height,this},zt.prototype.copy=function(){var t=new zt;return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t},i=zt.prototype,i.ca=function(){return this.v=!0,Object.freeze(this),this},i.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()},i.freeze=function(){return this.v=!0,this},i.ea=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this.v=!1,this},i.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},i.w=function(t){return t instanceof zt&&(this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height)},i.fj=function(t,e,i,n){return this.x===t&&this.y===e&&this.width===i&&this.height===n},i.Qa=function(t){return _e.A(this.x,t.x)&&_e.A(this.y,t.y)&&_e.A(this.width,t.width)&&_e.A(this.height,t.height)},i.$=function(t){return this.x<=t.x&&this.x+this.width>=t.x&&this.y<=t.y&&this.y+this.height>=t.y},i.Ge=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},i.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},i.offset=function(t,e){return this.x+=t,this.y+=e,this},i.Jc=function(t,e){return qt(this,e,t,e,t)},i.uq=function(t){return qt(this,t.top,t.right,t.bottom,t.left)},i.Jw=function(t){return qt(this,-t.top,-t.right,-t.bottom,-t.left)},i.sA=function(t,e,i,n){return qt(this,t,e,i,n)},i.Dy=function(t){return Ut(this,t.x,t.y,t.width,t.height)},i.bw=function(t,e,i,n){return Ut(this,t,e,i,n)},i.Mc=function(t){return this.cw(t.x,t.y,t.width,t.height)},i.cw=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)))},i.Oe=function(t){return Ht(this,t.x,t.y,0,0)},i.Rc=function(t){return Ht(this,t.x,t.y,t.width,t.height)},i.Rw=function(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=0),Ht(this,t,e,i,n)},i.Uk=function(t,e,i){return this.x=t-i.offsetX-i.x*this.width,this.y=e-i.offsetY-i.y*this.height,this},i.s=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},i.yA=function(){return 0===this.width&&0===this.height},zt.alloc=function(){var t=Zt.pop();return void 0===t?new zt:t},zt.allocAt=function(t,e,i,n){var o=Zt.pop();return void 0===o?new zt(t,e,i,n):o.h(t,e,i,n)},zt.free=function(t){Zt.push(t)},d.Object.defineProperties(zt.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 Bt(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}}}),zt.prototype.isEmpty=zt.prototype.yA,zt.prototype.isReal=zt.prototype.s,zt.intersectsLineSegment=function(t,e,i,n,o,r,s,a){return _e.Ey(t,e,i,n,o,r,s,a)},zt.prototype.setSpot=zt.prototype.Uk,zt.prototype.union=zt.prototype.Rw,zt.prototype.unionRect=zt.prototype.Rc,zt.prototype.unionPoint=zt.prototype.Oe,zt.prototype.intersects=zt.prototype.cw,zt.prototype.intersectsRect=zt.prototype.Mc,zt.prototype.intersect=zt.prototype.bw,zt.prototype.intersectRect=zt.prototype.Dy,zt.prototype.grow=zt.prototype.sA,zt.prototype.subtractMargin=zt.prototype.Jw,zt.prototype.addMargin=zt.prototype.uq,zt.prototype.inflate=zt.prototype.Jc,zt.prototype.offset=zt.prototype.offset,zt.prototype.contains=zt.prototype.contains,zt.prototype.containsRect=zt.prototype.Ge,zt.prototype.containsPoint=zt.prototype.$,zt.prototype.equalsApprox=zt.prototype.Qa,zt.prototype.equalTo=zt.prototype.fj,zt.prototype.equals=zt.prototype.w,zt.prototype.setSize=zt.prototype.bB,zt.prototype.setPoint=zt.prototype.Qc,zt.prototype.set=zt.prototype.set,zt.prototype.setTo=zt.prototype.Ig;var $t=null,Jt=null,Zt=[];function Qt(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.v=!1}function te(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 Qt;for(var o=NaN;""===t[e];)e++;if((n=t[e++])&&(o=parseFloat(n)),isNaN(o))return new Qt(i);for(var r=NaN;""===t[e];)e++;if((n=t[e++])&&(r=parseFloat(n)),isNaN(r))return new Qt(i,o);for(var s=NaN;""===t[e];)e++;return(n=t[e++])&&(s=parseFloat(n)),isNaN(s)?new Qt(i,o):new Qt(i,o,r,s)}return new Qt}function ee(t){return t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}zt.className="Rect",zt.parse=Gt,zt.stringify=Yt,zt.contains=_t,zt.intersects=Wt,zt.ZeroRect=$t=new zt(0,0,0,0).ca(),zt.NoRect=Jt=new zt(NaN,NaN,NaN,NaN).ca(),zt.parse=Gt,zt.stringify=Yt,zt.contains=_t,zt.intersects=Wt,Qt.prototype.assign=function(t){return this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},Qt.prototype.Ig=function(t,e,i,n){return this.top=t,this.right=e,this.bottom=i,this.left=n,this},Qt.prototype.set=function(t){return this.top=t.top,this.right=t.right,this.bottom=t.bottom,this.left=t.left,this},Qt.prototype.copy=function(){var t=new Qt;return t.top=this.top,t.right=this.right,t.bottom=this.bottom,t.left=this.left,t},i=Qt.prototype,i.ca=function(){return this.v=!0,Object.freeze(this),this},i.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()},i.freeze=function(){return this.v=!0,this},i.ea=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this.v=!1,this},i.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},i.w=function(t){return t instanceof Qt&&(this.top===t.top&&this.right===t.right&&this.bottom===t.bottom&&this.left===t.left)},i.fj=function(t,e,i,n){return this.top===t&&this.right===e&&this.bottom===i&&this.left===n},i.Qa=function(t){return _e.A(this.top,t.top)&&_e.A(this.right,t.right)&&_e.A(this.bottom,t.bottom)&&_e.A(this.left,t.left)},i.s=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},Qt.alloc=function(){var t=Ve.pop();return void 0===t?new Qt:t},Qt.free=function(t){Ve.push(t)},Qt.prototype.isReal=Qt.prototype.s,Qt.prototype.equalsApprox=Qt.prototype.Qa,Qt.prototype.equalTo=Qt.prototype.fj,Qt.prototype.equals=Qt.prototype.w,Qt.prototype.set=Qt.prototype.set,Qt.prototype.setTo=Qt.prototype.Ig;var ie,ne,oe,re,se,ae,he,le,ue,ce,fe,de,pe,ge,ye,me,ve,xe,be,we,ke,Me,Se,Pe,Ne,Ce,Te,Ae,Le,je,Oe,De,Fe,Be,Ie,Ee,Re=null,ze=null,Ve=[];function Ge(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.v=!1}function Ye(t,e){return t.x=NaN,t.y=NaN,t.offsetX=e,t}function Xe(t){if("string"===typeof t){if(t=t.trim(),"None"===t)return ie;if("TopLeft"===t)return ne;if("Top"===t||"TopCenter"===t||"MiddleTop"===t)return oe;if("TopRight"===t)return re;if("Left"===t||"LeftCenter"===t||"MiddleLeft"===t)return se;if("Center"===t)return ae;if("Right"===t||"RightCenter"===t||"MiddleRight"===t)return he;if("BottomLeft"===t)return le;if("Bottom"===t||"BottomCenter"===t||"MiddleBottom"===t)return ue;if("BottomRight"===t)return ce;if("TopSide"===t)return fe;if("LeftSide"===t)return de;if("RightSide"===t)return pe;if("BottomSide"===t)return ge;if("TopBottomSides"===t)return ye;if("LeftRightSides"===t)return me;if("TopLeftSides"===t)return ve;if("TopRightSides"===t)return xe;if("BottomLeftSides"===t)return be;if("BottomRightSides"===t)return we;if("NotTopSide"===t)return ke;if("NotLeftSide"===t)return Me;if("NotRightSide"===t)return Se;if("NotBottomSide"===t)return Pe;if("AllSides"===t)return Ne;if("Default"===t)return Ce;t=t.split(" ");for(var e=0,i=0;""===t[e];)e++;var n=t[e++];void 0!==n&&0<n.length&&(i=parseFloat(n));for(var o=0;""===t[e];)e++;n=t[e++],void 0!==n&&0<n.length&&(o=parseFloat(n));for(var r=0;""===t[e];)e++;n=t[e++],void 0!==n&&0<n.length&&(r=parseFloat(n));for(var s=0;""===t[e];)e++;return n=t[e++],void 0!==n&&0<n.length&&(s=parseFloat(n)),new Ge(i,o,r,s)}return new Ge}function qe(t){return t.kb()?t.x.toString()+" "+t.y.toString()+" "+t.offsetX.toString()+" "+t.offsetY.toString():t.toString()}Qt.className="Margin",Qt.parse=te,Qt.stringify=ee,Qt.ZeroMargin=Re=new Qt(0,0,0,0).ca(),Qt.TwoMargin=ze=new Qt(2,2,2,2).ca(),Qt.parse=te,Qt.stringify=ee,Ge.prototype.assign=function(t){return this.x=t.x,this.y=t.y,this.offsetX=t.offsetX,this.offsetY=t.offsetY,this},Ge.prototype.Ig=function(t,e,i,n){return this.x=t,this.y=e,this.offsetX=i,this.offsetY=n,this},Ge.prototype.set=function(t){return this.x=t.x,this.y=t.y,this.offsetX=t.offsetX,this.offsetY=t.offsetY,this},Ge.prototype.copy=function(){var t=new Ge;return t.x=this.x,t.y=this.y,t.offsetX=this.offsetX,t.offsetY=this.offsetY,t},i=Ge.prototype,i.ca=function(){return this.v=!0,Object.freeze(this),this},i.H=function(){return this.v||Object.isFrozen(this)?this:this.copy().freeze()},i.freeze=function(){return this.v=!0,this},i.ea=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this.v=!1,this},i.toString=function(){return this.kb()?0===this.offsetX&&0===this.offsetY?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.w(ie)?"None":this.w(ne)?"TopLeft":this.w(oe)?"Top":this.w(re)?"TopRight":this.w(se)?"Left":this.w(ae)?"Center":this.w(he)?"Right":this.w(le)?"BottomLeft":this.w(ue)?"Bottom":this.w(ce)?"BottomRight":this.w(fe)?"TopSide":this.w(de)?"LeftSide":this.w(pe)?"RightSide":this.w(ge)?"BottomSide":this.w(ye)?"TopBottomSides":this.w(me)?"LeftRightSides":this.w(ve)?"TopLeftSides":this.w(xe)?"TopRightSides":this.w(be)?"BottomLeftSides":this.w(we)?"BottomRightSides":this.w(ke)?"NotTopSide":this.w(Me)?"NotLeftSide":this.w(Se)?"NotRightSide":this.w(Pe)?"NotBottomSide":this.w(Ne)?"AllSides":this.w(Ce)?"Default":"None"},i.w=function(t){return t instanceof Ge&&((this.x===t.x||isNaN(this.x)&&isNaN(t.x))&&(this.y===t.y||isNaN(this.y)&&isNaN(t.y))&&this.offsetX===t.offsetX&&this.offsetY===t.offsetY)},i.mw=function(){return new Ge(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},i.Ef=function(t){if(!this.Oc())return!1;if(!t.Oc())if(t.w(Te))t=de;else if(t.w(Ae))t=pe;else if(t.w(Le))t=fe;else{if(!t.w(je))return!1;t=ge}return t=t.offsetY,(this.offsetY&t)===t},i.kb=function(){return!isNaN(this.x)&&!isNaN(this.y)},i.nc=function(){return isNaN(this.x)||isNaN(this.y)},i.Oc=function(){return isNaN(this.x)&&isNaN(this.y)&&1===this.offsetX&&0!==this.offsetY},i.Vt=function(){return isNaN(this.x)&&isNaN(this.y)&&0===this.offsetX&&0===this.offsetY},i.Mb=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY},Ge.alloc=function(){var t=Ue.pop();return void 0===t?new Ge:t},Ge.free=function(t){Ue.push(t)},Ge.prototype.isDefault=Ge.prototype.Mb,Ge.prototype.isNone=Ge.prototype.Vt,Ge.prototype.isSide=Ge.prototype.Oc,Ge.prototype.isNoSpot=Ge.prototype.nc,Ge.prototype.isSpot=Ge.prototype.kb,Ge.prototype.includesSide=Ge.prototype.Ef,Ge.prototype.opposite=Ge.prototype.mw,Ge.prototype.equals=Ge.prototype.w,Ge.prototype.set=Ge.prototype.set,Ge.prototype.setTo=Ge.prototype.Ig;var Ue=[];function Ke(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}Ge.className="Spot",Ge.parse=Xe,Ge.stringify=qe,Ge.None=ie=Ye(new Ge(0,0,0,0),0).ca(),Ge.Default=Ce=Ye(new Ge(0,0,-1,0),-1).ca(),Ge.TopLeft=ne=new Ge(0,0,0,0).ca(),Ge.TopCenter=oe=new Ge(.5,0,0,0).ca(),Ge.TopRight=re=new Ge(1,0,0,0).ca(),Ge.LeftCenter=se=new Ge(0,.5,0,0).ca(),Ge.Center=ae=new Ge(.5,.5,0,0).ca(),Ge.RightCenter=he=new Ge(1,.5,0,0).ca(),Ge.BottomLeft=le=new Ge(0,1,0,0).ca(),Ge.BottomCenter=ue=new Ge(.5,1,0,0).ca(),Ge.BottomRight=ce=new Ge(1,1,0,0).ca(),Ge.MiddleTop=Oe=oe,Ge.MiddleLeft=De=se,Ge.MiddleRight=Fe=he,Ge.MiddleBottom=Be=ue,Ge.Top=Le=oe,Ge.Left=Te=se,Ge.Right=Ae=he,Ge.Bottom=je=ue,Ge.TopSide=fe=Ye(new Ge(0,0,1,1),1).ca(),Ge.LeftSide=de=Ye(new Ge(0,0,1,2),1).ca(),Ge.RightSide=pe=Ye(new Ge(0,0,1,4),1).ca(),Ge.BottomSide=ge=Ye(new Ge(0,0,1,8),1).ca(),Ge.TopBottomSides=ye=Ye(new Ge(0,0,1,9),1).ca(),Ge.LeftRightSides=me=Ye(new Ge(0,0,1,6),1).ca(),Ge.TopLeftSides=ve=Ye(new Ge(0,0,1,3),1).ca(),Ge.TopRightSides=xe=Ye(new Ge(0,0,1,5),1).ca(),Ge.BottomLeftSides=be=Ye(new Ge(0,0,1,10),1).ca(),Ge.BottomRightSides=we=Ye(new Ge(0,0,1,12),1).ca(),Ge.NotTopSide=ke=Ye(new Ge(0,0,1,14),1).ca(),Ge.NotLeftSide=Me=Ye(new Ge(0,0,1,13),1).ca(),Ge.NotRightSide=Se=Ye(new Ge(0,0,1,11),1).ca(),Ge.NotBottomSide=Pe=Ye(new Ge(0,0,1,7),1).ca(),Ge.AllSides=Ne=Ye(new Ge(0,0,1,15),1).ca(),Ie=new Ge(.156,.156).ca(),Ee=new Ge(.844,.844).ca(),Ge.parse=Xe,Ge.stringify=qe,Ke.prototype.set=function(t){return this.m11=t.m11,this.m12=t.m12,this.m21=t.m21,this.m22=t.m22,this.dx=t.dx,this.dy=t.dy,this},Ke.prototype.copy=function(){var t=new Ke;return t.m11=this.m11,t.m12=this.m12,t.m21=this.m21,t.m22=this.m22,t.dx=this.dx,t.dy=this.dy,t},Ke.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},Ke.prototype.w=function(t){return this.m11===t.m11&&this.m12===t.m12&&this.m21===t.m21&&this.m22===t.m22&&this.dx===t.dx&&this.dy===t.dy},Ke.prototype.Tt=function(){return 0===this.dx&&0===this.dy&&1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22},Ke.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},Ke.prototype.multiply=function(t){var e=this.m11*t.m11+this.m21*t.m12,i=this.m12*t.m11+this.m22*t.m12,n=this.m11*t.m21+this.m21*t.m22,o=this.m12*t.m21+this.m22*t.m22;return this.dx=this.m11*t.dx+this.m21*t.dy+this.dx,this.dy=this.m12*t.dx+this.m22*t.dy+this.dy,this.m11=e,this.m12=i,this.m21=n,this.m22=o,this},Ke.prototype.jw=function(t){var e=1/(t.m11*t.m22-t.m12*t.m21),i=t.m22*e,n=-t.m12*e,o=-t.m21*e,r=t.m11*e,s=e*(t.m21*t.dy-t.m22*t.dx);return t=e*(t.m12*t.dx-t.m11*t.dy),e=this.m11*i+this.m21*n,i=this.m12*i+this.m22*n,n=this.m11*o+this.m21*r,o=this.m12*o+this.m22*r,this.dx=this.m11*s+this.m21*t+this.dx,this.dy=this.m12*s+this.m22*t+this.dy,this.m11=e,this.m12=i,this.m21=n,this.m22=o,this},Ke.prototype.St=function(){var t=1/(this.m11*this.m22-this.m12*this.m21),e=-this.m12*t,i=-this.m21*t,n=this.m11*t,o=t*(this.m21*this.dy-this.m22*this.dx),r=t*(this.m12*this.dx-this.m11*this.dy);return this.m11=this.m22*t,this.m12=e,this.m21=i,this.m22=n,this.dx=o,this.dy=r,this},Ke.prototype.rotate=function(t,e,i){if(360<=t?t-=360:0>t&&(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},i=Ke.prototype,i.translate=function(t,e){return this.dx+=this.m11*t+this.m21*e,this.dy+=this.m12*t+this.m22*e,this},i.scale=function(t,e){return void 0===e&&(e=t),this.m11*=t,this.m12*=t,this.m21*=e,this.m22*=e,this},i.ta=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)},i.Jd=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))},i.Zx=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))},i.Pw=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},Ke.alloc=function(){var t=He.pop();return void 0===t?new Ke:t},Ke.free=function(t){He.push(t)},Ke.prototype.transformRect=Ke.prototype.Pw,Ke.prototype.transformPoint=Ke.prototype.ta,Ke.prototype.scale=Ke.prototype.scale,Ke.prototype.translate=Ke.prototype.translate,Ke.prototype.rotate=Ke.prototype.rotate,Ke.prototype.invert=Ke.prototype.St,Ke.prototype.multiplyInverted=Ke.prototype.jw,Ke.prototype.multiply=Ke.prototype.multiply,Ke.prototype.reset=Ke.prototype.reset,Ke.prototype.isIdentity=Ke.prototype.Tt,Ke.prototype.equals=Ke.prototype.w,Ke.prototype.set=Ke.prototype.set;var He=[];Ke.className="Transform",Ke.xF="54a702f3e53909c447824c6706603faf4c";var _e={lB:"7da71ca0ad381e90",Kg:(Math.sqrt(2)-1)/3*4,jx:null,sqrt:function(t){if(0>=t)return 0;var e=_e.jx;if(null===e){e=[];for(var i=0;2e3>=i;i++)e[i]=Math.sqrt(i);_e.jx=e}return 1>t?(i=1/t,2e3>=i?1/e[0|i]:Math.sqrt(t)):2e3>=t?e[0|t]:Math.sqrt(t)},A:function(t,e){return t-=e,.5>t&&-.5<t},aa:function(t,e){return t-=e,5e-8>t&&-5e-8<t},Nb:function(t,e,i,n,o,r,s){if(0>=o&&(o=1e-6),t<i)var a=t,h=i;else a=i,h=t;if(e<n)var l=e,u=n;else l=n,u=e;if(t===i)return l<=s&&s<=u&&t-o<=r&&r<=t+o;if(e===n)return a<=r&&r<=h&&e-o<=s&&s<=e+o;if(h+=o,a-=o,a<=r&&r<=h&&(u+=o,l-=o,l<=s&&s<=u))if(h-a>u-l){if(!(t-i>o||i-t>o))return!0;if(r=(n-e)/(i-t)*(r-t)+e,r-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,s-o<=r&&r<=s+o)return!0}return!1},yt:function(t,e,i,n,o,r,s,a,h,l,u,c){if(_e.Nb(t,e,s,a,c,i,n)&&_e.Nb(t,e,s,a,c,o,r))return _e.Nb(t,e,s,a,c,l,u);var f=(t+i)/2,d=(e+n)/2,p=(i+o)/2,g=(n+r)/2;o=(o+s)/2,r=(r+a)/2,n=(f+p)/2,i=(d+g)/2,p=(p+o)/2,g=(g+r)/2;var y=(n+p)/2,m=(i+g)/2;return _e.yt(t,e,f,d,n,i,y,m,h,l,u,c)||_e.yt(y,m,p,g,o,r,s,a,h,l,u,c)},yz: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},xz: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)},vm:function(t,e,i,n,o,r,s,a,h,l){if(_e.Nb(t,e,s,a,h,i,n)&&_e.Nb(t,e,s,a,h,o,r))Ht(l,t,e,0,0),Ht(l,s,a,0,0);else{var u=(t+i)/2,c=(e+n)/2,f=(i+o)/2,d=(n+r)/2;o=(o+s)/2,r=(r+a)/2,n=(u+f)/2,i=(c+d)/2,f=(f+o)/2,d=(d+r)/2;var p=(n+f)/2,g=(i+d)/2;_e.vm(t,e,u,c,n,i,p,g,h,l),_e.vm(p,g,f,d,o,r,s,a,h,l)}return l},Fe:function(t,e,i,n,o,r,s,a,h,l){if(_e.Nb(t,e,s,a,h,i,n)&&_e.Nb(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;o=(o+s)/2,r=(r+a)/2,n=(u+f)/2,i=(c+d)/2,f=(f+o)/2,d=(d+r)/2;var p=(n+f)/2,g=(i+d)/2;_e.Fe(t,e,u,c,n,i,p,g,h,l),_e.Fe(p,g,f,d,o,r,s,a,h,l)}return l},qw:function(t,e,i,n,o,r,s,a,h,l){if(_e.Nb(t,e,o,r,l,i,n))return _e.Nb(t,e,o,r,l,a,h);var u=(t+i)/2,c=(e+n)/2;i=(i+o)/2,n=(n+r)/2;var f=(u+i)/2,d=(c+n)/2;return _e.qw(t,e,u,c,f,d,s,a,h,l)||_e.qw(f,d,i,n,o,r,s,a,h,l)},AB: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},pw:function(t,e,i,n,o,r,s,a){if(_e.Nb(t,e,o,r,s,i,n))Ht(a,t,e,0,0),Ht(a,o,r,0,0);else{var h=(t+i)/2,l=(e+n)/2;i=(i+o)/2,n=(n+r)/2;var u=(h+i)/2,c=(l+n)/2;_e.pw(t,e,h,l,u,c,s,a),_e.pw(u,c,i,n,o,r,s,a)}return a},Vq:function(t,e,i,n,o,r,s,a){if(_e.Nb(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;i=(i+o)/2,n=(n+r)/2;var u=(h+i)/2,c=(l+n)/2;_e.Vq(t,e,h,l,u,c,s,a),_e.Vq(u,c,i,n,o,r,s,a)}return a},wq:function(t,e,i,n,o,r,s,a,h,l,u,c,f,d){if(_e.Nb(t,e,s,a,f,i,n)&&_e.Nb(t,e,s,a,f,o,r))return!!_e.Cm(t,e,s,a,h,l,u,c)&&(f=(t-s)*(l-c)-(e-a)*(h-u),0!==f&&(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,y=(i+o)/2,m=(n+r)/2;o=(o+s)/2,r=(r+a)/2,n=(p+y)/2,i=(g+m)/2,y=(y+o)/2,m=(m+r)/2;var v=(n+y)/2,x=(i+m)/2,b=1/0,w=!1,k=0,M=0;return _e.wq(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),t<b&&(b=t,w=!0,k=d.x,M=d.y)),_e.wq(v,x,y,m,o,r,s,a,h,l,u,c,f,d)&&(d.x-h)*(d.x-h)+(d.y-l)*(d.y-l)<b&&(w=!0,k=d.x,M=d.y),w&&(d.x=k,d.y=M),w},xq:function(t,e,i,n,o,r,s,a,h,l,u,c,f){var d=0;if(_e.Nb(t,e,s,a,f,i,n)&&_e.Nb(t,e,s,a,f,o,r)){if(f=(t-s)*(l-c)-(e-a)*(h-u),0===f)return d;var p=((t*a-e*s)*(h-u)-(t-s)*(h*c-l*u))/f,g=((t*a-e*s)*(l-c)-(e-a)*(h*c-l*u))/f;if(p>=u)return d;if((h>u?h-u:u-h)<(l>c?l-c:c-l)){if(e<a?(t=e,e=a):t=a,g<t||g>e)return d}else if(t<s?(e=t,t=s):e=s,p<e||p>t)return d;0<f?d++:0>f&&d--}else{p=(t+i)/2,g=(e+n)/2;var y=(i+o)/2,m=(n+r)/2;o=(o+s)/2,r=(r+a)/2,n=(p+y)/2,i=(g+m)/2,y=(y+o)/2,m=(m+r)/2;var v=(n+y)/2,x=(i+m)/2;d+=_e.xq(t,e,p,g,n,i,v,x,h,l,u,c,f),d+=_e.xq(v,x,y,m,o,r,s,a,h,l,u,c,f)}return d},Qh:function(t,e,i,n,o,r,s){return _e.aa(t,i)?(e<n?(i=e,e=n):i=n,r<i?(s.h(t,i),!1):r>e?(s.h(t,e),!1):(s.h(t,r),!0)):_e.aa(e,n)?(t<i?(n=t,t=i):n=i,o<n?(s.h(n,e),!1):o>t?(s.h(t,e),!1):(s.h(o,e),!0)):(o=((t-o)*(t-i)+(e-r)*(e-n))/((i-t)*(i-t)+(n-e)*(n-e)),-5e-6>o?(s.h(t,e),!1):1.000005<o?(s.h(i,n),!1):(s.h(t+o*(i-t),e+o*(n-e)),!0))},Me:function(t,e,i,n,o,r,s,a,h){return _e.A(t,i)&&_e.A(e,n)?(h.h(t,e),!1):_e.aa(o,s)?_e.aa(t,i)?(_e.Qh(t,e,i,n,o,r,h),!1):_e.Qh(t,e,i,n,o,(n-e)/(i-t)*(o-t)+e,h):(a=(a-r)/(s-o),_e.aa(t,i)?(i=a*(t-o)+r,e<n?(o=e,e=n):o=n,i<o?(h.h(t,o),!1):i>e?(h.h(t,e),!1):(h.h(t,i),!0)):(s=(n-e)/(i-t),_e.aa(a,s)?(_e.Qh(t,e,i,n,o,r,h),!1):(o=(s*t-a*o+r-e)/(s-a),_e.aa(s,0)?(t<i?(n=t,t=i):n=i,o<n?(h.h(n,e),!1):o>t?(h.h(t,e),!1):(h.h(o,e),!0)):_e.Qh(t,e,i,n,o,s*(o-t)+e,h))))},yB:function(t,e,i,n,o){return _e.Me(i.x,i.y,n.x,n.y,t.x,t.y,e.x,e.y,o)},wB: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<c&&(c=o,h.h(i,n))}var c=1/0;u(h.x,h.y);var f=0,d=0,p=0,g=0;if(o<s?(f=o,d=s):(f=s,d=o),r<a?(p=o,g=s):(p=s,g=o),f=(d-f)/2+l,l=(g-p)/2+l,o=(o+s)/2,r=(r+a)/2,0===f||0===l)return h;if(.5>(i>t?i-t:t-i)){if(f=1-(i-o)*(i-o)/(f*f),0>f)return h;f=Math.sqrt(f),n=-l*f+r,u(i,l*f+r),u(i,n)}else{if(i=(n-e)/(i-t),n=1/(f*f)+i*i/(l*l),a=2*i*(e-i*t)/(l*l)-2*i*r/(l*l)-2*o/(f*f),f=a*a-4*n*(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)),0>f)return h;f=Math.sqrt(f),l=(-a+f)/(2*n),u(l,i*l-i*t+e),f=(-a-f)/(2*n),u(f,i*f-i*t+e)}return h},Cf:function(t,e,i,n,o,r,s,a,h){var l=1e21,u=t,c=e;if(_e.Me(t,e,t,n,o,r,s,a,h)){var f=(h.x-o)*(h.x-o)+(h.y-r)*(h.y-r);f<l&&(l=f,u=h.x,c=h.y)}return _e.Me(i,e,i,n,o,r,s,a,h)&&(f=(h.x-o)*(h.x-o)+(h.y-r)*(h.y-r),f<l&&(l=f,u=h.x,c=h.y)),_e.Me(t,e,i,e,o,r,s,a,h)&&(e=(h.x-o)*(h.x-o)+(h.y-r)*(h.y-r),e<l&&(l=e,u=h.x,c=h.y)),_e.Me(t,n,i,n,o,r,s,a,h)&&(t=(h.x-o)*(h.x-o)+(h.y-r)*(h.y-r),t<l&&(l=t,u=h.x,c=h.y)),h.h(u,c),1e21>l},vB:function(t,e,i,n,o,r,s,a,h){return i=t-i,s=o-s,0===i||0===s?0===i?(e=(r-a)/s,a=t,o=e*a+(r-e*o)):(r=(e-n)/i,a=o,o=r*a+(e-r*t)):(n=(e-n)/i,a=(r-a)/s,t=e-n*t,a=(r-a*o-t)/(n-a),o=n*a+t),h.h(a,o),h},Qt:function(t,e,i){return _e.Ey(t.x,t.y,t.width,t.height,e.x,e.y,i.x,i.y)},Ey:function(t,e,i,n,o,r,s,a){var h=t+i,l=e+n;return o===s?(r<a?(s=r,r=a):s=a,t<=o&&o<=h&&s<=l&&r>=e):r===a?(o<s?(a=o,o=s):a=s,e<=r&&r<=l&&a<=h&&o>=t):!!(_t(t,e,i,n,o,r)||_t(t,e,i,n,s,a)||_e.Cm(t,e,h,e,o,r,s,a)||_e.Cm(h,e,h,l,o,r,s,a)||_e.Cm(h,l,t,l,o,r,s,a)||_e.Cm(t,l,t,e,o,r,s,a))},Cm:function(t,e,i,n,o,r,s,a){return 0>=_e.Bt(t,e,i,n,o,r)*_e.Bt(t,e,i,n,s,a)&&0>=_e.Bt(o,r,s,a,t,e)*_e.Bt(o,r,s,a,i,n)},Bt:function(t,e,i,n,o,r){return i-=t,n-=e,t=o-t,e=r-e,r=t*n-e*i,0===r&&(r=t*i+e*n,0<r&&(r=(t-i)*i+(e-n)*n,0>r&&(r=0))),0>r?-1:0<r?1:0},Tq:function(t){return 0>t&&(t+=360),360<=t&&(t-=360),t},hy: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(n=Math.min(2*s,Math.abs(o-n)),1e-5>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-5<n;)o=l+a*Math.min(n,h),r.push(_e.Hz(i,l,o,t,e)),n-=Math.abs(o-l),l=o;return r},Hz:function(t,e,i,n,o){var r=(i-e)/2,s=t*Math.cos(r),a=t*Math.sin(r),h=-a,l=s*s+h*h,u=l+s*s+h*a;return l=4/3*(Math.sqrt(2*l*u)-u)/(s*a-h*s),a=s-l*h,s=h+l*s,h=-s,l=r+e,r=Math.cos(l),l=Math.sin(l),[n+t*Math.cos(e),o+t*Math.sin(e),n+a*r-s*l,o+a*l+s*r,n+a*r-h*l,o+a*l+h*r,n+t*Math.cos(i),o+t*Math.sin(i)]},Gq:function(t,e,i,n,o,r,s){i=Math.floor((t-i)/o)*o+i,n=Math.floor((e-n)/r)*r+n;var a=i;return i+o-t<o/2&&(a=i+o),t=n,n+r-e<r/2&&(t=n+r),s.h(a,t),s},uy:function(t,e){var i,n=Math.max(t,e);t=Math.min(t,e);do{e=n%t,n=i=t,t=e}while(0<e);return i},Mz:function(t,e,i,n){var o=0>i,r=0>n;if(t<e)var s=1,a=0;else s=0,a=1;var h=0===s?t:e,l=0===s?i:n;return(0===s?o:r)&&(l=-l),s=a,i=0===s?i:n,(0===s?o:r)&&(i=-i),_e.Nz(h,0===s?t:e,l,i,0,0)},Nz:function(t,e,i,n,o,r){if(0<n)if(0<i){o=t*t,r=e*e,t*=i;var s=e*n,a=-r+s,h=-r+Math.sqrt(t*t+s*s);e=a;for(var l=0;9999999999>l;++l){if(e=.5*(a+h),e===a||e===h)break;var u=t/(e+o),c=s/(e+r);if(u=u*u+c*c-1,0<u)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 n=t*t-e*e,r=t*i,r<n?(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},Qe:new _,dn:new _,Uh:new _,Vh:0};function We(t){ot(this),this.v=!1,void 0===t&&(t=li),this.qa=t,this.oc=this.hc=this.dd=this.cd=0,this.Jj=new et,this.Xr=this.Jj.Ba,this.Fr=(new zt).freeze(),this.ra=!0,this.ln=this.al=null,this.mn=NaN,this.pf=ne,this.qf=ce,this.Cl=this.Dl=NaN,this.Sf=Xs}function $e(t,e){return t.type===si&&e.type===li&&!!(1===e.figures.count&&(e=e.figures.J(0),1===e.segments.count&&_e.A(t.startX,e.startX)&&_e.A(t.startY,e.startY)&&(e=e.segments.J(0),e.type===yi&&_e.A(t.endX,e.endX)&&_e.A(t.endY,e.endY))))}function Je(t){return t.toString()}function Ze(t,e){function i(){return g>=b-1||null!==c[g+1].match(w)}function n(){return g++,c[g]}function o(t){var e=parseFloat(n()),i=parseFloat(n());y===y.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=m.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=new RegExp("(["+ui+"])(["+ui+"])","gm"),l=new RegExp("(["+ui+"])([^s])","gm"),u=new RegExp("([^s])(["+ui+"])","gm");t=t.replace(/,/gm," "),t=t.replace(h,"$1 $2"),t=t.replace(h,"$1 $2"),t=t.replace(l,"$1 $2"),t=t.replace(u,"$1 $2"),t=t.replace(/([0-9])([+\-])/gm,"$1 $2"),t=t.replace(/[\s\r\t\n]+/gm," "),t=t.replace(/^\s+|\s+$/g,"");var c=t.split(" ");for(t=0;t<c.length;t++)if(l=c[t],null!==l.match(/(\.[0-9]*)(\.)/gm)){h=j(),u="";for(var f=!1,d=0;d<l.length;d++){var p=l[d];"."!==p||f?"."===p?(h.push(u),u="."):u+=p:(f=!0,u+=p)}for(h.push(u),c.splice(t,1),l=0;l<h.length;l++)c.splice(t+l,0,h[l]);t+=h.length-1,O(h)}var g=-1,y="",m="";h=new pt(0,0);var v=new pt(0,0),x=new pt(0,0),b=c.length;t=Cu(null),u=l=!1,f=!0,d=null;for(var w=new RegExp("["+ui+"]");!(g>=b-1);)if(m=y,y=n(),""!==y)switch(y.toUpperCase()){case"X":f=!0,u=l=!1;break;case"M":for(d=r(),null===t.ic||!0===f?(ku(t,d.x,d.y,l,!u),f=!1):t.moveTo(d.x,d.y),h.assign(x);!i();)d=r(),t.lineTo(d.x,d.y);break;case"L":for(;!i();)d=r(),t.lineTo(d.x,d.y);break;case"H":for(;!i();)x=new pt((y===y.toLowerCase()?x.x:0)+parseFloat(n()),x.y),t.lineTo(x.x,x.y);break;case"V":for(;!i();)x=new pt(x.x,(y===y.toLowerCase()?x.y:0)+parseFloat(n())),t.lineTo(x.x,x.y);break;case"C":for(;!i();){d=new pt,o(d),p=s();var k=r();Su(t,d.x,d.y,p.x,p.y,k.x,k.y)}break;case"S":for(;!i();)d=a(),p=s(),k=r(),Su(t,d.x,d.y,p.x,p.y,k.x,k.y);break;case"Q":for(;!i();)d=s(),p=r(),Pu(t,d.x,d.y,p.x,p.y);break;case"T":for(;!i();)v=d=a(),p=r(),Pu(t,d.x,d.y,p.x,p.y);break;case"B":for(;!i();){d=parseFloat(n()),p=parseFloat(n()),k=parseFloat(n());var M=parseFloat(n()),S=parseFloat(n()),P=S,N=!1;i()||(P=parseFloat(n()),i()||(N=0!==parseFloat(n()))),y===y.toLowerCase()&&(k+=x.x,M+=x.y),t.arcTo(d,p,k,M,S,P,N)}break;case"A":for(;!i();)d=Math.abs(parseFloat(n())),p=Math.abs(parseFloat(n())),k=parseFloat(n()),S=M=!1,N=P=0,P=n(),1===P.length?(M=!!parseFloat(P),S=!!parseFloat(n()),P=parseFloat(n())):2===P.length?(M=!!parseFloat(P[0]),S=!!parseFloat(P[1]),P=parseFloat(n())):(M=!!parseFloat(P[0]),S=!!parseFloat(P[1]),P=parseFloat(P.slice(2))),N=parseFloat(n()),y===y.toLowerCase()&&(P=x.x+P,N=x.y+N),x.h(P,N),Nu(t,d,p,k,M,S,P,N);break;case"Z":Mu(t),x.assign(h);break;case"F":for(d="",p=1;c[g+p];)if(null!==c[g+p].match(/[Uu]/))p++;else{if(null!==c[g+p].match(w)){d=c[g+p];break}p++}d.match(/[Mm]/)?l=!0:0<t.ic.segments.length&&(t.ic.isFilled=!0);break;case"U":for(d="",p=1;c[g+p];)if(null!==c[g+p].match(/[Ff]/))p++;else{if(null!==c[g+p].match(w)){d=c[g+p];break}p++}d.match(/[Mm]/)?u=!0:t.Ym(!1)}if(h=t.Kt,Tu=t,e)for(e=h.figures.iterator;e.next();)e.value.isFilled=!0;return h}function Qe(t,e){for(var i=t.length,n=pt.alloc(),o=0;o<i;o++){var r=t[o];n.x=r[0],n.y=r[1],e.ta(n),r[0]=n.x,r[1]=n.y,n.x=r[2],n.y=r[3],e.ta(n),r[2]=n.x,r[3]=n.y,n.x=r[4],n.y=r[5],e.ta(n),r[4]=n.x,r[5]=n.y,n.x=r[6],n.y=r[7],e.ta(n),r[6]=n.x,r[7]=n.y}pt.free(n)}function ti(t,e,i){switch(t.type){case si:case ai:case hi:i?e.h(t.cd,t.dd,0,0):Ht(e,t.cd,t.dd,0,0),Ht(e,t.hc,t.oc,0,0);break;case li:var n=t.figures;t=n.j,n=n.length;for(var o=0;o<n;o++){var r=t[o];i&&0===o?e.h(r.startX,r.startY,0,0):Ht(e,r.startX,r.startY,0,0);for(var s=r.segments.j,a=s.length,h=r.startX,l=r.startY,u=0;u<a;u++){var c=s[u];switch(c.type){case yi:case gi:h=c.endX,l=c.endY,Ht(e,h,l,0,0);break;case mi:_e.vm(h,l,c.point1X,c.point1Y,c.point2X,c.point2Y,c.endX,c.endY,.5,e),h=c.endX,l=c.endY;break;case vi:_e.pw(h,l,c.point1X,c.point1Y,c.endX,c.endY,.5,e),h=c.endX,l=c.endY;break;case xi:case bi:var f=c.type===xi?di(c,r):pi(c,r,h,l),d=f.length;if(0===d){h=c.type===xi?c.centerX:c.endX,l=c.type===xi?c.centerY:c.endY,Ht(e,h,l,0,0);break}c=null;for(var p=0;p<d;p++)c=f[p],_e.vm(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],.5,e);null!==c&&(h=c[6],l=c[7]);break;default:w("Unknown Segment type: "+c.type)}}}break;default:w("Unknown Geometry type: "+t.type)}}function ei(t,e,i,n,o){var r=e.x;e=e.y;for(var s,a,h,l,u=t.bounds.x-20,c=0,f=t.figures.j,d=f.length,p=0;p<d;p++){var g=f[p];if(g.isFilled){if(n&&g.$(r,e,i))return!0;var y=g.segments;s=g.startX,a=g.startY;for(var m=s,v=a,x=y.j,b=0;b<=y.length;b++){var k=void 0;if(b!==y.length){k=x[b];var M=k.type;t=k.endX,l=k.endY}else M=yi,t=m,l=v;switch(M){case gi:if(m=ii(r,e,u,e,s,a,m,v),isNaN(m))return!0;c+=m,m=t,v=l;break;case yi:if(s=ii(r,e,u,e,s,a,t,l),isNaN(s))return!0;c+=s;break;case mi:h=_e.xq(s,a,k.point1X,k.point1Y,k.point2X,k.point2Y,t,l,u,e,r,e,.5),c+=h;break;case vi:h=_e.xq(s,a,(s+2*k.point1X)/3,(a+2*k.point1Y)/3,(2*k.point1X+t)/3,(2*k.point1Y+l)/3,t,l,u,e,r,e,.5),c+=h;break;case xi:case bi:M=k.type===xi?di(k,g):pi(k,g,s,a);var S=M.length;if(0===S){if(s=ii(r,e,u,e,s,a,k.type===xi?k.centerX:k.endX,k.type===xi?k.centerY:k.endY),isNaN(s))return!0;c+=s;break}k=null;for(var P=0;P<S;P++){if(k=M[P],0===P){if(h=ii(r,e,u,e,s,a,k[0],k[1]),isNaN(h))return!0;c+=h}h=_e.xq(k[0],k[1],k[2],k[3],k[4],k[5],k[6],k[7],u,e,r,e,.5),c+=h}null!==k&&(t=k[6],l=k[7]);break;default:w("Unknown Segment type: "+k.type)}s=t,a=l}if(0!==c)return!0;c=0}else if(g.$(r,e,o?i:i+2))return!0}return 0!==c}function ii(t,e,i,n,o,r,s,a){if(_e.Nb(o,r,s,a,.05,t,e))return NaN;var h=(t-i)*(r-a);if(0===h)return 0;var l=((t*n-e*i)*(o-s)-(t-i)*(o*a-r*s))/h;if(e=(t*n-e*i)*(r-a)/h,l>=t)return 0;if((o>s?o-s:s-o)<(r>a?r-a:a-r)){if(r<a){if(e<r||e>a)return 0}else if(e<a||e>r)return 0}else if(o<s){if(l<o||l>s)return 0}else if(l<s||l>o)return 0;return 0<h?1:-1}function ni(t,e,i,n){t=t.figures.j;for(var o=t.length,r=0;r<o;r++)if(t[r].$(e,i,n))return!0;return!1}function oi(t){if(null===t.al){var e=t.al=[],i=t.ln=[],n=[],o=[];if(t.type===si)n.push(t.startX),n.push(t.startY),n.push(t.endX),n.push(t.endY),e.push(n),o.push(Math.sqrt((t.startX-t.endX)*(t.startX-t.endX)+(t.startY-t.endY)*(t.startY-t.endY))),i.push(o);else if(t.type===ai)n.push(t.startX),n.push(t.startY),n.push(t.endX),n.push(t.startY),n.push(t.endX),n.push(t.endY),n.push(t.startX),n.push(t.endY),n.push(t.startX),n.push(t.startY),e.push(n),o.push(Math.abs(t.startX-t.endX)),o.push(Math.abs(t.startY-t.endY)),o.push(Math.abs(t.startX-t.endX)),o.push(Math.abs(t.startY-t.endY)),i.push(o);else if(t.type===hi){var r=new ci;r.startX=t.endX,r.startY=(t.startY+t.endY)/2;var s=new fi(xi);if(s.startAngle=0,s.sweepAngle=360,s.centerX=(t.startX+t.endX)/2,s.centerY=(t.startY+t.endY)/2,s.radiusX=Math.abs(t.startX-t.endX)/2,s.radiusY=Math.abs(t.startY-t.endY)/2,r.add(s),t=di(s,r),o=t.length,0===o)n.push(s.centerX),n.push(s.centerY);else{s=r.startX,r=r.startY;for(var a=0;a<o;a++){var h=t[a];_e.Fe(s,r,h[2],h[3],h[4],h[5],h[6],h[7],.5,n),s=h[6],r=h[7]}}e.push(n),i.push(ri(n))}else for(t=t.figures.iterator;t.next();){o=t.value,n=[],n.push(o.startX),n.push(o.startY),s=o.startX,r=o.startY,a=s,h=r;for(var l=o.segments.j,u=l.length,c=0;c<u;c++){var f=l[c];switch(f.type){case gi:4<=n.length&&(e.push(n),i.push(ri(n))),n=[],n.push(f.endX),n.push(f.endY),s=f.endX,r=f.endY,a=s,h=r;break;case yi:n.push(f.endX),n.push(f.endY),s=f.endX,r=f.endY;break;case mi:_e.Fe(s,r,f.point1X,f.point1Y,f.point2X,f.point2Y,f.endX,f.endY,.5,n),s=f.endX,r=f.endY;break;case vi:_e.Vq(s,r,f.point1X,f.point1Y,f.endX,f.endY,.5,n),s=f.endX,r=f.endY;break;case xi:var d=di(f,o),p=d.length;if(0===p){n.push(f.centerX),n.push(f.centerY),s=f.centerX,r=f.centerY;break}for(var g=0;g<p;g++){var y=d[g];_e.Fe(s,r,y[2],y[3],y[4],y[5],y[6],y[7],.5,n),s=y[6],r=y[7]}break;case bi:if(d=pi(f,o,s,r),p=d.length,g=f.endX,y=f.endY,0===p){n.push(g),n.push(y),s=g,r=y;break}for(g=0;g<p;g++)y=d[g],_e.Fe(s,r,y[2],y[3],y[4],y[5],y[6],y[7],.5,n),s=y[6],r=y[7];break;default:w("Segment not of valid type: "+f.type)}f.isClosed&&(n.push(a),n.push(h))}4<=n.length&&(e.push(n),i.push(ri(n)))}}}function ri(t){for(var e=[],i=0,n=0,o=t.length,r=0;r<o;r+=2){var s=t[r],a=t[r+1];0!==r&&e.push(Math.sqrt(bt(i,n,s,a))),i=s,n=a}return e}_e.za=_e.lB,We.prototype.copy=function(){var t=new We;t.qa=this.qa,t.cd=this.cd,t.dd=this.dd,t.hc=this.hc,t.oc=this.oc;for(var e=this.Jj.j,i=e.length,n=t.Jj,o=0;o<i;o++){var r=e[o].copy();n.add(r)}return t.Xr=this.Xr,t.Fr.assign(this.Fr),t.ra=this.ra,t.al=this.al,t.ln=this.ln,t.mn=this.mn,t.pf=this.pf.H(),t.qf=this.qf.H(),t.Dl=this.Dl,t.Cl=this.Cl,t.Sf=this.Sf,t},i=We.prototype,i.ca=function(){return this.freeze(),Object.freeze(this),this},i.freeze=function(){this.v=!0;var t=this.figures;t.freeze(),t=t.j;for(var e=t.length,i=0;i<e;i++)t[i].freeze();return this},i.ea=function(){Object.isFrozen(this)&&w("cannot thaw constant: "+this),this.v=!1;var t=this.figures;t.ea(),t=t.j;for(var e=t.length,i=0;i<e;i++)t[i].ea();return this},i.Qa=function(t){if(!(t instanceof We))return!1;if(this.type!==t.type)return this.type===si&&t.type===li?$e(this,t):t.type===si&&this.type===li&&$e(t,this);if(this.type===li){var e=this.figures.j;t=t.figures.j;var i=e.length;if(i!==t.length)return!1;for(var n=0;n<i;n++)if(!e[n].Qa(t[n]))return!1;return!0}return _e.A(this.startX,t.startX)&&_e.A(this.startY,t.startY)&&_e.A(this.endX,t.endX)&&_e.A(this.endY,t.endY)},i.jb=function(t){t.classType===We&&(this.type=t)},i.toString=function(t){switch(void 0===t&&(t=-1),this.type){case si:return 0>t?"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 ai:var e=new zt(this.startX,this.startY,0,0);return e.Rw(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 hi:if(e=new zt(this.startX,this.startY,0,0),e.Rw(this.endX,this.endY,0,0),0>t)return t=e.left.toString()+" "+(e.y+e.height/2).toString(),"M"+t+"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 li:e="",i=this.figures.j;for(var n=i.length,o=0;o<n;o++){var r=i[o];0<o&&(e+=" x "),r.isFilled&&(e+="F "),e+=r.toString(t)}return e;default:return this.type.toString()}},i.gw=function(){if(this.ra||this.Xr!==this.figures.Ba)return!0;for(var t=this.figures.j,e=t.length,i=0;i<e;i++)if(t[i].gw())return!0;return!1},We.prototype.computeBounds=function(){this.ra=!1,this.ln=this.al=null,this.mn=NaN,this.Xr=this.figures.Ba;for(var t=this.figures.j,e=t.length,i=0;i<e;i++){var n=t[i];n.ra=!1;var o=n.segments;n.bt=o.Ba,n=o.j,o=n.length;for(var r=0;r<o;r++){var s=n[r];s.ra=!1,s.Qd=null}}t=this.Fr,t.ea(),isNaN(this.Dl)||isNaN(this.Cl)?t.h(0,0,0,0):t.h(0,0,this.Dl,this.Cl),ti(this,t,!1),Ht(t,0,0,0,0),t.freeze()},We.prototype.ey=function(){var t=new zt;return ti(this,t,!0),t},We.prototype.normalize=function(){this.v&&k(this);var t=this.ey();return this.offset(-t.x,-t.y),new pt(-t.x,-t.y)},We.prototype.offset=function(t,e){return this.v&&k(this),this.transform(1,0,0,1,t,e),this},We.prototype.scale=function(t,e){return this.v&&k(this),this.transform(t,0,0,e,0,0),this},We.prototype.rotate=function(t,e,i){this.v&&k(this),void 0===e&&(e=0),void 0===i&&(i=0);var n=Ke.alloc();return n.reset(),n.rotate(t,e,i),this.transform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),Ke.free(n),this},i=We.prototype,i.transform=function(t,e,i,n,o,r){switch(this.type){case si:case ai:case hi:var s=this.cd,a=this.dd;this.cd=s*t+a*i+o,this.dd=s*e+a*n+r,s=this.hc,a=this.oc,this.hc=s*t+a*i+o,this.oc=s*e+a*n+r;break;case li:for(var h=this.figures.j,l=h.length,u=0;u<l;u++){var c=h[u];s=c.startX,a=c.startY,c.startX=s*t+a*i+o,c.startY=s*e+a*n+r,c=c.segments.j;for(var f=c.length,d=0;d<f;d++){var p=c[d];switch(p.type){case yi:case gi:s=p.endX,a=p.endY,p.endX=s*t+a*i+o,p.endY=s*e+a*n+r;break;case mi:s=p.point1X,a=p.point1Y,p.point1X=s*t+a*i+o,p.point1Y=s*e+a*n+r,s=p.point2X,a=p.point2Y,p.point2X=s*t+a*i+o,p.point2Y=s*e+a*n+r,s=p.endX,a=p.endY,p.endX=s*t+a*i+o,p.endY=s*e+a*n+r;break;case vi:s=p.point1X,a=p.point1Y,p.point1X=s*t+a*i+o,p.point1Y=s*e+a*n+r,s=p.endX,a=p.endY,p.endX=s*t+a*i+o,p.endY=s*e+a*n+r;break;case xi:s=p.centerX,a=p.centerY,p.centerX=s*t+a*i+o,p.centerY=s*e+a*n+r,0!==e&&(s=180*Math.atan2(e,t)/Math.PI,0>s&&(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 bi: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&&(s=180*Math.atan2(e,t)/Math.PI,0>s&&(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.ra=!0,this},i.$=function(t,e){void 0===e&&(e=0);var i=this.cd,n=this.dd,o=this.hc,r=this.oc;switch(this.type){case si:return _e.Nb(i,n,o,r,e,t.x,t.y);case ai:var s=zt.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.$(t),zt.free(s),t;case hi: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:(s=t.x-(s+i),a=t.y-(a+e),1>=s*s/(i*i)+a*a/(e*e));case li:return ei(this,t,e,!0,!1);default:return!1}},i.Xv=function(t,e){if(0>t?t=0:1<t&&(t=1),void 0===e&&(e=new pt),this.type===si)return e.h(this.startX+t*(this.endX-this.startX),this.startY+t*(this.endY-this.startY)),e;for(var i=this.flattenedSegments,n=this.flattenedLengths,o=i.length,r=this.flattenedTotalLength*t,s=0,a=0;a<o;a++){var h=n[a],l=h.length;for(t=0;t<l;t++){var u=h[t];if(s+u>=r)return n=r-s,n=0===u?0:n/u,i=i[a],a=i[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},i.vy=function(t){if(0>t?t=0:1<t&&(t=1),this.type===si)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var e=this.flattenedSegments,i=this.flattenedLengths,n=e.length,o=this.flattenedTotalLength*t,r=0,s=0;s<n;s++){var a=i[s],h=a.length;for(t=0;t<h;t++){var l=a[t];if(r+l>=o)return o=e[s],e=o[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},i.Yv=function(t,e){if(0>t?t=0:1<t&&(t=1),void 0===e&&(e=[]),e.length=3,this.type===si)return e[0]=this.startX+t*(this.endX-this.startX),e[1]=this.startY+t*(this.endY-this.startY),e[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,e;for(var i=this.flattenedSegments,n=this.flattenedLengths,o=i.length,r=this.flattenedTotalLength*t,s=0,a=0;a<o;a++){var h=n[a],l=h.length;for(t=0;t<l;t++){var u=h[t];if(s+u>=r)return n=r-s,n=0===u?0:n/u,u=i[a],i=u[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},i.wy=function(t){if(this.type===si){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<o){var s=i;n=o}else s=o,n=i;return t<=s?s===i?0:1:t>=n?n===i?0:1:Math.abs(t-i)/(n-s)}if(i===o)return e<n?s=e:(s=n,n=e),r<=s?s===e?0:1:r>=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 _e.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!==ai){e=this.flattenedSegments,i=this.flattenedLengths,r=this.flattenedTotalLength,n=pt.alloc(),o=1/0,a=s=0,m=e.length;for(var h=v=0,l=0;l<m;l++)for(var u=e[l],c=i[l],f=u.length,d=0;d<f;d+=2){var p=u[d],g=u[d+1];if(0!==d){_e.Qh(v,h,p,g,t.x,t.y,n);var y=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y);y<o&&(o=y,s=a,s+=Math.sqrt((n.x-v)*(n.x-v)+(n.y-h)*(n.y-h))),a+=c[(d-2)/2]}v=p,h=g}return pt.free(n),t=s/r,0>t?0:1<t?1:t}s=this.startX,a=this.startY;var m=this.endX;if(o=this.endY,s!==m||a!==o){e=m-s,i=o-a,r=2*e+2*i,n=t.x,t=t.y,n=Math.min(Math.max(n,s),m),t=Math.min(Math.max(t,a),o),s=Math.abs(n-s),m=Math.abs(n-m),a=Math.abs(t-a),o=Math.abs(t-o);var v=Math.min(s,m,a,o);if(v===a)return n/r;if(v===m)return(e+t)/r;if(v===o)return(2*e+i-n)/r;if(v===s)return(2*e+2*i-t)/r}}return 0},i.add=function(t){return this.Jj.add(t),this},i.Zm=function(t,e,i,n,o,r,s,a){return this.v&&k(this),this.pf=new Ge(t,e,o,r).freeze(),this.qf=new Ge(i,n,s,a).freeze(),this},d.Object.defineProperties(We.prototype,{flattenedSegments:{get:function(){return oi(this),this.al}},flattenedLengths:{get:function(){return oi(this),this.ln}},flattenedTotalLength:{get:function(){var t=this.mn;if(isNaN(t)){if(this.type===si){t=Math.abs(this.endX-this.startX);var e=Math.abs(this.endY-this.startY);t=Math.sqrt(t*t+e*e)}else if(this.type===ai)t=2*Math.abs(this.endX-this.startX)+2*Math.abs(this.endY-this.startY);else{e=this.flattenedLengths;for(var i=e.length,n=t=0;n<i;n++)for(var o=e[n],r=o.length,s=0;s<r;s++)t+=o[s]}this.mn=t}return t}},type:{get:function(){return this.qa},set:function(t){this.qa!==t&&(this.v&&k(this,t),this.qa=t,this.ra=!0)}},startX:{get:function(){return this.cd},set:function(t){this.cd!==t&&(this.v&&k(this,t),this.cd=t,this.ra=!0)}},startY:{get:function(){return this.dd},set:function(t){this.dd!==t&&(this.v&&k(this,t),this.dd=t,this.ra=!0)}},endX:{get:function(){return this.hc},set:function(t){this.hc!==t&&(this.v&&k(this,t),this.hc=t,this.ra=!0)}},endY:{get:function(){return this.oc},set:function(t){this.oc!==t&&(this.v&&k(this,t),this.oc=t,this.ra=!0)}},figures:{get:function(){return this.Jj},set:function(t){this.Jj!==t&&(this.v&&k(this,t),this.Jj=t,this.ra=!0)}},spot1:{get:function(){return this.pf},set:function(t){this.v&&k(this,t),this.pf=t.H()}},spot2:{get:function(){return this.qf},set:function(t){this.v&&k(this,t),this.qf=t.H()}},defaultStretch:{get:function(){return this.Sf},set:function(t){this.v&&k(this,t),this.Sf=t}},bounds:{get:function(){return this.gw()&&this.computeBounds(),this.Fr}}}),We.prototype.setSpots=We.prototype.Zm,We.prototype.add=We.prototype.add,We.prototype.getFractionForPoint=We.prototype.wy,We.prototype.getPointAndAngleAlongPath=We.prototype.Yv,We.prototype.getAngleAlongPath=We.prototype.vy,We.prototype.getPointAlongPath=We.prototype.Xv,We.prototype.containsPoint=We.prototype.$,We.prototype.transform=We.prototype.transform,We.prototype.rotate=We.prototype.rotate,We.prototype.scale=We.prototype.scale,We.prototype.offset=We.prototype.offset,We.prototype.normalize=We.prototype.normalize,We.prototype.computeBoundsWithoutOrigin=We.prototype.ey,We.prototype.equalsApprox=We.prototype.Qa;var si=new U(We,"Line",0),ai=new U(We,"Rectangle",1),hi=new U(We,"Ellipse",2),li=new U(We,"Path",3),ui="UuBbMmZzLlHhVvCcSsQqTtAaFfXx";function ci(t,e,i,n){ot(this),this.sx=null,this.v=!1,void 0===i&&(i=!0),this.js=i,void 0===n&&(n=!0),this.os=n,this.cd=void 0!==t?t:0,this.dd=void 0!==e?e:0,this.dm=new et,this.bt=this.dm.Ba,this.ra=!0}function fi(t,e,i,n,o,r,s,a){ot(this),this.v=!1,void 0===t&&(t=yi),this.qa=t,this.hc=void 0!==e?e:0,this.oc=void 0!==i?i:0,void 0===n&&(n=0),void 0===o&&(o=0),void 0===r&&(r=0),void 0===s&&(s=0),t===bi?(t=r%360,0>t&&(t+=360),this.Ce=t,this.Qi=0,this.Ri=Math.max(n,0),this.qh=Math.max(o,0),this.Ll="boolean"===typeof s?s:"number"===typeof s&&!!s,this.el=!!a):(this.Ce=n,this.Qi=o,t===xi&&(r=Math.max(r,0)),this.Ri=r,"number"===typeof s?(t===xi&&(s=Math.max(s,0)),this.qh=s):this.qh=0,this.el=this.Ll=!1),this.Oj=!1,this.ra=!0,this.Qd=null}function di(t,e){if(null!==t.Qd&&!1===e.ra)return t.Qd;var i=t.radiusX,n=t.radiusY;if(void 0===n&&(n=i),0===i||0===n)return t.Qd=[],t.Qd;e=t.Ce;var o=t.Qi,r=_e.hy(0,0,i<n?i:n,t.startAngle,t.startAngle+t.sweepAngle,!1);if(i!==n){var s=Ke.alloc();s.reset(),i<n?s.scale(1,n/i):s.scale(i/n,1),Qe(r,s),Ke.free(s)}for(i=r.length,n=0;n<i;n++)s=r[n],s[0]+=e,s[1]+=o,s[2]+=e,s[3]+=o,s[4]+=e,s[5]+=o,s[6]+=e,s[7]+=o;return t.Qd=r,t.Qd}function pi(t,e,i,n){function o(t,e,i,n){return(t*n<e*i?-1:1)*Math.acos((t*i+e*n)/(Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n)))}if(null!==t.Qd&&!1===e.ra)return t.Qd;if(0===t.radiusX||0===t.radiusY)return t.Qd=[],t.Qd;e=t.Ri;var r=t.qh;0===e&&(e=1e-4),0===r&&(r=1e-4);var s=Math.PI/180*t.Ce,a=t.Ll,h=t.el,l=t.hc,u=t.oc,c=Math.cos(s),f=Math.sin(s),d=c*(i-l)/2+f*(n-u)/2;s=-f*(i-l)/2+c*(n-u)/2;var p=d*d/(e*e)+s*s/(r*r);return 1<p&&(e*=Math.sqrt(p),r*=Math.sqrt(p)),p=(a===h?-1:1)*Math.sqrt((e*e*r*r-e*e*s*s-r*r*d*d)/(e*e*s*s+r*r*d*d)),isNaN(p)&&(p=0),a=p*e*s/r,p=p*-r*d/e,isNaN(a)&&(a=0),isNaN(p)&&(p=0),i=(i+l)/2+c*a-f*p,n=(n+u)/2+f*a+c*p,u=o(1,0,(d-a)/e,(s-p)/r),c=(d-a)/e,l=(s-p)/r,d=(-d-a)/e,a=(-s-p)/r,s=o(c,l,d,a),d=(c*d+l*a)/(Math.sqrt(c*c+l*l)*Math.sqrt(d*d+a*a)),-1>=d?s=Math.PI:1<=d&&(s=0),!h&&0<s&&(s-=2*Math.PI),h&&0>s&&(s+=2*Math.PI),h=e>r?1:e/r,d=e>r?r/e:1,e=_e.hy(0,0,e>r?e:r,u,u+s,!0),r=Ke.alloc(),r.reset(),r.translate(i,n),r.rotate(t.Ce,0,0),r.scale(h,d),Qe(e,r),Ke.free(r),t.Qd=e,t.Qd}We.className="Geometry",We.stringify=Je,We.fillPath=function(t){t=t.split(/[Xx]/);for(var e=t.length,i="",n=0;n<e;n++){var o=t[n];i=null!==o.match(/[Ff]/)?0===n?i+o:i+"X"+(" "===o[0]?"":" ")+o:i+(0===n?"":"X ")+"F"+(" "===o[0]?"":" ")+o}return i},We.parse=Ze,We.Line=si,We.Rectangle=ai,We.Ellipse=hi,We.Path=li,ci.prototype.copy=function(){var t=new ci;t.js=this.js,t.os=this.os,t.cd=this.cd,t.dd=this.dd;for(var e=this.dm.j,i=e.length,n=t.dm,o=0;o<i;o++){var r=e[o].copy();n.add(r)}return t.bt=this.bt,t.ra=this.ra,t.sx=this.sx,t},i=ci.prototype,i.Qa=function(t){if(!(t instanceof ci&&_e.A(this.startX,t.startX)&&_e.A(this.startY,t.startY)))return!1;var e=this.segments.j;t=t.segments.j;var i=e.length;if(i!==t.length)return!1;for(var n=0;n<i;n++)if(!e[n].Qa(t[n]))return!1;return!0},i.toString=function(t){void 0===t&&(t=-1);for(var e=0>t?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(t)+" "+this.startY.toFixed(t),i=this.segments.j,n=i.length,o=0;o<n;o++)e+=" "+i[o].toString(t);return e},i.freeze=function(){this.v=!0;var t=this.segments;t.freeze();var e=t.j;t=t.length;for(var i=0;i<t;i++)e[i].freeze();return this},i.ea=function(){this.v=!1;var t=this.segments;t.ea(),t=t.j;for(var e=t.length,i=0;i<e;i++)t[i].ea();return this},i.gw=function(){if(this.ra)return!0;var t=this.segments;if(this.bt!==t.Ba)return!0;t=t.j;for(var e=t.length,i=0;i<e;i++)if(t[i].ra)return!0;return!1},i.add=function(t){return this.dm.add(t),this},i.$=function(t,e,i){for(var n=this.startX,o=this.startY,r=n,s=o,a=this.segments.j,h=a.length,l=0;l<h;l++){var u=a[l];switch(u.type){case gi:r=u.endX,s=u.endY,n=u.endX,o=u.endY;break;case yi:if(_e.Nb(n,o,u.endX,u.endY,i,t,e))return!0;n=u.endX,o=u.endY;break;case mi:if(_e.yt(n,o,u.point1X,u.point1Y,u.point2X,u.point2Y,u.endX,u.endY,.5,t,e,i))return!0;n=u.endX,o=u.endY;break;case vi:if(_e.qw(n,o,u.point1X,u.point1Y,u.endX,u.endY,.5,t,e,i))return!0;n=u.endX,o=u.endY;break;case xi:case bi:var c=u.type===xi?di(u,this):pi(u,this,n,o),f=c.length,d=u.type===xi?u.centerX:u.endX,p=u.type===xi?u.centerY:u.endY;if(0===f){if(_e.Nb(n,o,d,p,i,t,e))return!0;n=d,o=p;break}for(d=null,p=0;p<f;p++)if(d=c[p],0===p&&_e.Nb(n,o,d[0],d[1],i,t,e)||_e.yt(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],.5,t,e,i))return!0;null!==d&&(n=d[6],o=d[7]);break;default:w("Unknown Segment type: "+u.type)}if(u.isClosed&&(n!==r||o!==s)&&_e.Nb(n,o,r,s,i,t,e))return!0}return!1},d.Object.defineProperties(ci.prototype,{isFilled:{get:function(){return this.js},set:function(t){this.v&&k(this,t),this.js=t}},isShadowed:{get:function(){return this.os},set:function(t){this.v&&k(this,t),this.os=t}},startX:{get:function(){return this.cd},set:function(t){this.v&&k(this,t),this.cd=t,this.ra=!0}},startY:{get:function(){return this.dd},set:function(t){this.v&&k(this,t),this.dd=t,this.ra=!0}},segments:{get:function(){return this.dm},set:function(t){this.v&&k(this,t),this.dm=t,this.ra=!0}}}),ci.prototype.add=ci.prototype.add,ci.prototype.equalsApprox=ci.prototype.Qa,ci.className="PathFigure",fi.prototype.copy=function(){var t=new fi;return t.qa=this.qa,t.hc=this.hc,t.oc=this.oc,t.Ce=this.Ce,t.Qi=this.Qi,t.Ri=this.Ri,t.qh=this.qh,t.Ll=this.Ll,t.el=this.el,t.Oj=this.Oj,t.ra=this.ra,t},i=fi.prototype,i.Qa=function(t){if(!(t instanceof fi)||this.type!==t.type||this.isClosed!==t.isClosed)return!1;switch(this.type){case gi:case yi:return _e.A(this.endX,t.endX)&&_e.A(this.endY,t.endY);case mi:return _e.A(this.endX,t.endX)&&_e.A(this.endY,t.endY)&&_e.A(this.point1X,t.point1X)&&_e.A(this.point1Y,t.point1Y)&&_e.A(this.point2X,t.point2X)&&_e.A(this.point2Y,t.point2Y);case vi:return _e.A(this.endX,t.endX)&&_e.A(this.endY,t.endY)&&_e.A(this.point1X,t.point1X)&&_e.A(this.point1Y,t.point1Y);case xi:return _e.A(this.startAngle,t.startAngle)&&_e.A(this.sweepAngle,t.sweepAngle)&&_e.A(this.centerX,t.centerX)&&_e.A(this.centerY,t.centerY)&&_e.A(this.radiusX,t.radiusX)&&_e.A(this.radiusY,t.radiusY);case bi:return this.isClockwiseArc===t.isClockwiseArc&&this.isLargeArc===t.isLargeArc&&_e.A(this.xAxisRotation,t.xAxisRotation)&&_e.A(this.endX,t.endX)&&_e.A(this.endY,t.endY)&&_e.A(this.radiusX,t.radiusX)&&_e.A(this.radiusY,t.radiusY);default:return!1}},i.jb=function(t){t.classType===fi&&(this.type=t)},i.toString=function(t){switch(void 0===t&&(t=-1),this.type){case gi:t=0>t?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case yi:t=0>t?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(t)+" "+this.endY.toFixed(t);break;case mi: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 vi: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 xi: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 bi: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.Oj?"z":"")},i.freeze=function(){return this.v=!0,this},i.ea=function(){return this.v=!1,this},i.close=function(){return this.Oj=!0,this},d.Object.defineProperties(fi.prototype,{isClosed:{get:function(){return this.Oj},set:function(t){this.Oj!==t&&(this.Oj=t,this.ra=!0)}},type:{get:function(){return this.qa},set:function(t){this.v&&k(this,t),this.qa=t,this.ra=!0}},endX:{get:function(){return this.hc},set:function(t){this.v&&k(this,t),this.hc=t,this.ra=!0}},endY:{get:function(){return this.oc},set:function(t){this.v&&k(this,t),this.oc=t,this.ra=!0}},point1X:{get:function(){return this.Ce},set:function(t){this.v&&k(this,t),this.Ce=t,this.ra=!0}},point1Y:{get:function(){return this.Qi},set:function(t){this.v&&k(this,t),this.Qi=t,this.ra=!0}},point2X:{get:function(){return this.Ri},set:function(t){this.v&&k(this,t),this.Ri=t,this.ra=!0}},point2Y:{get:function(){return this.qh},set:function(t){this.v&&k(this,t),this.qh=t,this.ra=!0}},centerX:{get:function(){return this.Ce},set:function(t){this.v&&k(this,t),this.Ce=t,this.ra=!0}},centerY:{get:function(){return this.Qi},set:function(t){this.v&&k(this,t),this.Qi=t,this.ra=!0}},radiusX:{get:function(){return this.Ri},set:function(t){0>t&&M(t,">= zero",fi,"radiusX"),this.v&&k(this,t),this.Ri=t,this.ra=!0}},radiusY:{get:function(){return this.qh},set:function(t){0>t&&M(t,">= zero",fi,"radiusY"),this.v&&k(this,t),this.qh=t,this.ra=!0}},startAngle:{get:function(){return this.hc},set:function(t){this.hc!==t&&(this.v&&k(this,t),t%=360,0>t&&(t+=360),this.hc=t,this.ra=!0)}},sweepAngle:{get:function(){return this.oc},set:function(t){this.v&&k(this,t),360<t&&(t=360),-360>t&&(t=-360),this.oc=t,this.ra=!0}},isClockwiseArc:{get:function(){return this.el},set:function(t){this.v&&k(this,t),this.el=t,this.ra=!0}},isLargeArc:{get:function(){return this.Ll},set:function(t){this.v&&k(this,t),this.Ll=t,this.ra=!0}},xAxisRotation:{get:function(){return this.Ce},set:function(t){t%=360,0>t&&(t+=360),this.v&&k(this,t),this.Ce=t,this.ra=!0}}}),fi.prototype.equalsApprox=fi.prototype.Qa;var gi=new U(fi,"Move",0),yi=new U(fi,"Line",1),mi=new U(fi,"Bezier",2),vi=new U(fi,"QuadraticBezier",3),xi=new U(fi,"Arc",4),bi=new U(fi,"SvgArc",4);function wi(){this.C=null,this.yv=new pt(0,0).freeze(),this.Iu=new pt(0,0).freeze(),this.xr=this.zs=0,this.yr=1,this.Di="",this.st=this.Rr=!1,this.Or=this.Ar=0,this.Pg=this.bs=this.ms=!1,this.Wr=null,this.nt=0,this.pd=this.mt=null}function ki(){this.C=null,this.oa="",this.Js=this.kt=null}function Mi(){this.wn=Pi,this.gf=this.ys="",this.hp=this.ip=this.op=this.pp=this.np=this.C=this.cc=null}fi.className="PathSegment",fi.Move=gi,fi.Line=yi,fi.Bezier=mi,fi.QuadraticBezier=vi,fi.Arc=xi,fi.SvgArc=bi,wi.prototype.copy=function(){var t=new wi;return this.clone(t)},wi.prototype.clone=function(t){return t.C=this.C,t.yv.assign(this.viewPoint),t.Iu.assign(this.documentPoint),t.zs=this.zs,t.xr=this.xr,t.yr=this.yr,t.Di=this.Di,t.Rr=this.Rr,t.st=this.st,t.Ar=this.Ar,t.Or=this.Or,t.ms=this.ms,t.bs=this.bs,t.Pg=this.Pg,t.Wr=this.Wr,t.nt=this.nt,t.mt=this.mt,t.pd=this.pd,t},wi.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},wi.prototype.Jq=function(t,e){var i=this.diagram;return null===i||xr(i,this.event,t,e),e},wi.prototype.mA=function(t,e){var i=this.diagram;return null===i||(xr(i,this.event,t,e),e.assign(i.ou(e))),e},d.Object.defineProperties(wi.prototype,{diagram:{get:function(){return this.C},set:function(t){this.C=t}},viewPoint:{get:function(){return this.yv},set:function(t){this.yv.assign(t)}},documentPoint:{get:function(){return this.Iu},set:function(t){this.Iu.assign(t)}},modifiers:{get:function(){return this.zs},set:function(t){this.zs=t}},button:{get:function(){return this.xr},set:function(t){if(this.xr=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.yr},set:function(t){this.yr=t}},key:{get:function(){return this.Di},set:function(t){this.Di=t}},down:{get:function(){return this.Rr},set:function(t){this.Rr=t}},up:{get:function(){return this.st},set:function(t){this.st=t}},clickCount:{get:function(){return this.Ar},set:function(t){this.Ar=t}},delta:{get:function(){return this.Or},set:function(t){this.Or=t}},isMultiTouch:{get:function(){return this.ms},set:function(t){this.ms=t}},handled:{get:function(){return this.bs},set:function(t){this.bs=t}},bubbles:{get:function(){return this.Pg},set:function(t){this.Pg=t}},event:{get:function(){return this.Wr},set:function(t){this.Wr=t}},isTouchEvent:{get:function(){var t=y.TouchEvent,e=this.event;return!!(t&&e instanceof t)||(t=y.PointerEvent)&&e instanceof t&&("touch"===e.pointerType||"pen"===e.pointerType)}},timestamp:{get:function(){return this.nt},set:function(t){this.nt=t}},targetDiagram:{get:function(){return this.mt},set:function(t){this.mt=t}},targetObject:{get:function(){return this.pd},set:function(t){this.pd=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}}}),wi.prototype.getMultiTouchDocumentPoint=wi.prototype.mA,wi.prototype.getMultiTouchViewPoint=wi.prototype.Jq,wi.className="InputEvent",ki.prototype.copy=function(){var t=new ki;return t.C=this.C,t.oa=this.oa,t.kt=this.kt,t.Js=this.Js,t},ki.prototype.toString=function(){var t="*"+this.name;return null!==this.subject&&(t+=":"+this.subject.toString()),null!==this.parameter&&(t+="("+this.parameter.toString()+")"),t},d.Object.defineProperties(ki.prototype,{diagram:{get:function(){return this.C},set:function(t){this.C=t}},name:{get:function(){return this.oa},set:function(t){this.oa=t}},subject:{get:function(){return this.kt},set:function(t){this.kt=t}},parameter:{get:function(){return this.Js},set:function(t){this.Js=t}}}),ki.className="DiagramEvent",Mi.prototype.clear=function(){this.hp=this.ip=this.op=this.pp=this.np=this.C=this.cc=null},Mi.prototype.copy=function(){var t=new Mi;t.wn=this.wn,t.ys=this.ys,t.gf=this.gf,t.cc=this.cc,t.C=this.C,t.np=this.np;var e=this.pp;return t.pp=N(e)&&"function"===typeof e.H?e.H():e,e=this.op,t.op=N(e)&&"function"===typeof e.H?e.H():e,e=this.ip,t.ip=N(e)&&"function"===typeof e.H?e.H():e,e=this.hp,t.hp=N(e)&&"function"===typeof e.H?e.H():e,t},Mi.prototype.jb=function(t){t.classType===Mi&&(this.change=t)},Mi.prototype.toString=function(){var t="";return t=this.change===Si?t+"* ":this.change===Pi?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===Si?null!==this.oldValue&&(t+=" "+this.oldValue):(null!==this.object&&(t+=F(this.object)),null!==this.oldValue&&(t+="  old: "+F(this.oldValue)),null!==this.oldParam&&(t+=" "+this.oldParam),null!==this.newValue&&(t+="  new: "+F(this.newValue)),null!==this.newParam&&(t+=" "+this.newParam)),t},Mi.prototype.G=function(t){return t?this.oldValue:this.newValue},Mi.prototype.oA=function(t){return t?this.oldParam:this.newParam},Mi.prototype.canUndo=function(){return null!==this.model||null!==this.diagram},Mi.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))},Mi.prototype.canRedo=function(){return null!==this.model||null!==this.diagram},Mi.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))},d.Object.defineProperties(Mi.prototype,{model:{get:function(){return this.cc},set:function(t){this.cc=t}},diagram:{get:function(){return this.C},set:function(t){this.C=t}},change:{get:function(){return this.wn},set:function(t){this.wn=t}},modelChange:{get:function(){return this.ys},set:function(t){this.ys=t}},propertyName:{get:function(){return this.gf},set:function(t){this.gf=t}},isTransactionFinished:{get:function(){return this.wn===Si&&("CommittedTransaction"===this.gf||"FinishedUndo"===this.gf||"FinishedRedo"===this.gf)}},object:{get:function(){return this.np},set:function(t){this.np=t}},oldValue:{get:function(){return this.pp},set:function(t){this.pp=t}},oldParam:{get:function(){return this.op},set:function(t){this.op=t}},newValue:{get:function(){return this.ip},set:function(t){this.ip=t}},newParam:{get:function(){return this.hp},set:function(t){this.hp=t}}}),Mi.prototype.redo=Mi.prototype.redo,Mi.prototype.canRedo=Mi.prototype.canRedo,Mi.prototype.undo=Mi.prototype.undo,Mi.prototype.canUndo=Mi.prototype.canUndo,Mi.prototype.getParam=Mi.prototype.oA,Mi.prototype.getValue=Mi.prototype.G,Mi.prototype.clear=Mi.prototype.clear;var Si=new U(Mi,"Transaction",-1),Pi=new U(Mi,"Property",0),Ni=new U(Mi,"Insert",1),Ci=new U(Mi,"Remove",2);function Ti(){this.u=(new et).freeze(),this.oa="",this.l=!1}function Ai(){this.gv=new nt,this.md=!1,this.I=(new et).freeze(),this.Xd=-1,this.u=999,this.se=!1,this.Lr=null,this.Yi=0,this.l=!1,this.ye=(new et).freeze(),this.Tl=new et,this.Qu=!0,this.Wu=this.ks=this.$u=this.Zu=!1}function Li(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.Bb("CommittingTransaction",i,o));var r=0;if(0<t.transactionLevel&&(t.Yi--,t.isEnabled)){var s=t.ye.count;0<s&&(""===i&&(i=t.ye.J(0)),t.ye.ea(),t.ye.cb(s-1),t.ye.freeze()),s=t.Tl.count,0<s&&(r=t.Tl.J(s-1),t.Tl.cb(s-1))}if(n){if(e){if(t.ks=!1,null===o&&""!==i&&(o=t.currentTransaction),t.isEnabled&&null!==o){for(o.isComplete||(o.isComplete=!0,o.name=i),e=t.history,e.ea(),n=e.count-1;n>t.historyIndex;n--)r=e.J(n),null!==r&&r.clear(),e.cb(n),t.ks=!0;n=t.maxHistoryLength,0<=n&&(0===n?e.clear():e.count>=n&&(r=e.J(0),null!==r&&r.clear(),e.cb(0),t.Xd--)),0===n||0!==e.count&&e.get(e.count-1)===o||(e.add(o),t.Xd++),e.freeze()}t.isInternalTransaction||t.Bb("CommittedTransaction",i,o)}else{t.se=!0;try{t.isEnabled&&null!==o&&(o.isComplete=!0,o.undo())}finally{t.isInternalTransaction||t.Bb("RolledBackTransaction",i,o),t.se=!1}null!==o&&o.clear()}return t.Lr=null,t.isPendingClear&&t.clear(),t.isPendingClear=!1,t.isPendingUnmodified=!1,!0}if(t.isEnabled&&!e&&null!==o){for(t=r,i=o.changes,o=i.count-1;o>=t;o--)e=i.J(o),null!==e&&e.undo(),i.ea(),i.cb(o);i.freeze()}return!1}function ji(){ot(this),this.C=fs,this.oa="",this.md=!0,this.Sc=!1,this.ix=null,this.lz=new wi,this.vt=-1}function Oi(t,e,i){if(e.handled=!1,null===t||t.Hg()){var n=0;e.left?n=1===e.clickCount?1:2===e.clickCount?2:1:e.right&&1===e.clickCount&&(n=3);var o="ObjectSingleClicked";if(null!==t){switch(n){case 1:o="ObjectSingleClicked";break;case 2:o="ObjectDoubleClicked";break;case 3:o="ObjectContextClicked"}0!==n&&i.R(o,t)}else{switch(n){case 1:o="BackgroundSingleClicked";break;case 2:o="BackgroundDoubleClicked";break;case 3:o="BackgroundContextClicked"}0!==n&&i.R(o)}if(null!==t)for(;null!==t;){switch(i=null,n){case 1:i=t.click;break;case 2:i=t.doubleClick?t.doubleClick:t.click;break;case 3:i=t.contextClick}if(null!==i&&(i(e,t),e.handled))break;t=t.panel}else{switch(t=null,n){case 1:t=i.click;break;case 2:t=i.doubleClick?i.doubleClick:i.click;break;case 3:t=i.contextClick}null!==t&&t(e)}}}function Di(){ji.call(this),this.name="ToolManager",this.Cc=new et,this.Tc=new et,this.Od=new et,this.T=this.Ka=850,this.u=new Bt(2,2).ca(),this.eb=5e3,this.La=Bi,this.I=Ri,this.Kr=this.l=null,this.ik=-1}function Fi(t,e){t.standardMouseOver(),t.isBeyondDragSize()&&t.standardWaitAfter(t.isActive?t.holdDelay:t.hoverDelay,e.lastInput)}Mi.className="ChangedEvent",Mi.Transaction=Si,Mi.Property=Pi,Mi.Insert=Ni,Mi.Remove=Ci,Ti.prototype.toString=function(t){var e="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==t&&0<t){t=this.changes.count;for(var i=0;i<t;i++){var n=this.changes.J(i);null!==n&&(e+="\n  "+n.toString())}}return e},Ti.prototype.clear=function(){var t=this.changes;t.ea();for(var e=t.count-1;0<=e;e--){var i=t.J(e);null!==i&&i.clear()}t.clear(),t.freeze()},Ti.prototype.canUndo=function(){return this.isComplete},Ti.prototype.undo=function(){if(this.canUndo())for(var t=this.changes.count-1;0<=t;t--){var e=this.changes.J(t);null!==e&&e.undo()}},Ti.prototype.canRedo=function(){return this.isComplete},Ti.prototype.redo=function(){if(this.canRedo())for(var t=this.changes.count,e=0;e<t;e++){var i=this.changes.J(e);null!==i&&i.redo()}},Ti.prototype.nw=function(){if(this.isComplete){var t=this.changes;t.ea();for(var e=new dt,i=0;i<t.count;i++){var n=t.J(i);if(null!==n&&n.change===Pi&&n.object){var o=e.get(n.object);o||(o=new dt,e.set(n.object,o));var r=o.get(n.propertyName);null===r?o.set(n.propertyName,-1):(0<r&&t.Pc(r,null),o.set(n.propertyName,i))}}for(i=e=0;i<t.count;i++)n=t.J(i),null!==n&&(i>e&&t.Pc(e,n),e++);for(;t.length>e;)t.pop();t.freeze()}},d.Object.defineProperties(Ti.prototype,{changes:{get:function(){return this.u}},name:{get:function(){return this.oa},set:function(t){this.oa=t}},isComplete:{get:function(){return this.l},set:function(t){this.l=t}}}),Ti.prototype.optimize=Ti.prototype.nw,Ti.prototype.redo=Ti.prototype.redo,Ti.prototype.canRedo=Ti.prototype.canRedo,Ti.prototype.undo=Ti.prototype.undo,Ti.prototype.canUndo=Ti.prototype.canUndo,Ti.prototype.clear=Ti.prototype.clear,Ti.className="Transaction",Ai.prototype.toString=function(t){var e="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;e+="[";for(var i=this.nestedTransactionNames.count,n=0;n<i;n++)0<n&&(e+=" "),e+=this.nestedTransactionNames.J(n);if(e+="]",void 0!==t&&0<t)for(i=this.history.count,n=0;n<i;n++)e+="\n "+this.history.J(n).toString(t-1);return e},Ai.prototype.clear=function(){var t=this.history;t.ea();for(var e=t.count-1;0<=e;e--){var i=t.J(e);null!==i&&i.clear()}t.clear(),this.Xd=-1,t.freeze(),this.se=!1,this.Lr=null,this.Yi=0,this.ye.ea(),this.ye.clear(),this.ye.freeze(),this.Tl.clear(),this.Wu=this.ks=this.$u=this.Zu=!1},Ai.prototype.copyProperties=function(t){this.isEnabled=t.isEnabled,this.maxHistoryLength=t.maxHistoryLength,this.checksTransactionLevel=t.checksTransactionLevel},i=Ai.prototype,i.Vx=function(t){this.gv.add(t)},i.Py=function(t){this.gv.remove(t)},i.va=function(t){if(void 0===t&&(t=""),null===t&&(t=""),this.isUndoingRedoing)return!1;!0===this.Qu&&(this.Qu=!1,this.Yi++,this.isInternalTransaction||this.Bb("StartingFirstTransaction",t,this.currentTransaction),0<this.Yi&&this.Yi--),this.isEnabled&&(this.ye.ea(),this.ye.add(t),this.ye.freeze(),null===this.currentTransaction?this.Tl.add(0):this.Tl.add(this.currentTransaction.changes.count)),this.Yi++;var e=1===this.transactionLevel;return e&&(this.isInternalTransaction||this.Bb("StartedTransaction",t,this.currentTransaction)),e},i.Xa=function(t){return void 0===t&&(t=""),Li(this,!0,t)},i.If=function(){return Li(this,!1,"")},Ai.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var t=this.transactionToUndo;return!(null===t||!t.canUndo())},Ai.prototype.undo=function(){if(this.canUndo()){var t=this.transactionToUndo;try{this.se=!0,this.Bb("StartingUndo","Undo",t),this.Xd--,t.undo()}catch(e){S("undo error: "+e.toString())}finally{this.Bb("FinishedUndo","Undo",t),this.se=!1}}},Ai.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var t=this.transactionToRedo;return!(null===t||!t.canRedo())},Ai.prototype.redo=function(){if(this.canRedo()){var t=this.transactionToRedo;try{this.se=!0,this.Bb("StartingRedo","Redo",t),this.Xd++,t.redo()}catch(e){S("redo error: "+e.toString())}finally{this.Bb("FinishedRedo","Redo",t),this.se=!1}}},Ai.prototype.Bb=function(t,e,i){void 0===i&&(i=null);var n=new Mi;for(n.change=Si,n.propertyName=t,n.object=i,n.oldValue=e,t=this.models;t.next();)e=t.value,n.model=e,e.zt(n)},Ai.prototype.aw=function(t){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(t)){var e=this.currentTransaction;null===e&&(this.Lr=e=new Ti);var i=t.copy();e=e.changes,e.ea(),e.add(i),e.freeze(),this.checksTransactionLevel&&0>=this.transactionLevel&&!this.Qu&&(t=t.diagram,null!==t&&!1===t.pj||S("Change not within a transaction: "+i.toString()))}},Ai.prototype.skipsEvent=function(t){if(null===t||0>t.change.value)return!0;if(t=t.object,null===t)return!1;if(void 0!==t.layer){if(t=t.layer,null!==t&&t.isTemporary)return!0}else if(t.isTemporary)return!0;return!1},d.Object.defineProperties(Ai.prototype,{models:{get:function(){return this.gv.iterator}},isEnabled:{get:function(){return this.md},set:function(t){this.md=t}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.J(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndex<this.history.count-1?this.history.J(this.historyIndex+1):null}},isUndoingRedoing:{get:function(){return this.se}},history:{get:function(){return this.I}},maxHistoryLength:{get:function(){return this.u},set:function(t){this.u=t}},historyIndex:{get:function(){return this.Xd}},currentTransaction:{get:function(){return this.Lr}},transactionLevel:{get:function(){return this.Yi}},isInTransaction:{get:function(){return 0<this.Yi}},checksTransactionLevel:{get:function(){return this.l},set:function(t){this.l=t}},nestedTransactionNames:{get:function(){return this.ye}},isPendingClear:{get:function(){return this.Zu},set:function(t){this.Zu=t}},isPendingUnmodified:{get:function(){return this.$u},set:function(t){this.$u=t}},isInternalTransaction:{get:function(){return this.Wu},set:function(t){this.Wu=t}},isJustDiscarded:{get:function(){return this.ks}}}),Ai.prototype.handleChanged=Ai.prototype.aw,Ai.prototype.redo=Ai.prototype.redo,Ai.prototype.undo=Ai.prototype.undo,Ai.prototype.canUndo=Ai.prototype.canUndo,Ai.prototype.rollbackTransaction=Ai.prototype.If,Ai.prototype.commitTransaction=Ai.prototype.Xa,Ai.prototype.startTransaction=Ai.prototype.va,Ai.prototype.removeModel=Ai.prototype.Py,Ai.prototype.addModel=Ai.prototype.Vx,Ai.prototype.clear=Ai.prototype.clear,Ai.className="UndoManager",ji.prototype.toString=function(){return""!==this.name?this.name+" Tool":D(this.constructor)},ji.prototype.updateAdornments=function(){},ji.prototype.canStart=function(){return this.isEnabled},ji.prototype.doStart=function(){},ji.prototype.doActivate=function(){this.isActive=!0},ji.prototype.doDeactivate=function(){this.isActive=!1},ji.prototype.doStop=function(){},ji.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},ji.prototype.stopTool=function(){var t=this.diagram;t.currentTool===this&&(t.currentTool=null,t.currentCursor="")},ji.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},ji.prototype.doMouseMove=function(){},ji.prototype.doMouseUp=function(){this.stopTool()},ji.prototype.doMouseWheel=function(){},ji.prototype.canStartMultiTouch=function(){return!0},ji.prototype.standardPinchZoomStart=function(){var t=this.diagram,e=t.lastInput,i=e.Jq(0,pt.allocAt(NaN,NaN)),n=e.Jq(1,pt.allocAt(NaN,NaN));if(i.s()&&n.s()&&(this.doCancel(),t.Bm("hasGestureZoom"))){t.Vl=t.scale;var o=n.x-i.x,r=n.y-i.y;t.sv=Math.sqrt(o*o+r*r),e.bubbles=!1}pt.free(i),pt.free(n)},ji.prototype.standardPinchZoomMove=function(){var t=this.diagram,e=t.lastInput,i=e.Jq(0,pt.allocAt(NaN,NaN)),n=e.Jq(1,pt.allocAt(NaN,NaN));if(i.s()&&n.s()&&(this.doCancel(),t.Bm("hasGestureZoom"))){var o=n.x-i.x,r=n.y-i.y;r=Math.sqrt(o*o+r*r)/t.sv,o=new pt((Math.min(n.x,i.x)+Math.max(n.x,i.x))/2,(Math.min(n.y,i.y)+Math.max(n.y,i.y))/2),r*=t.Vl;var s=t.commandHandler;if(r!==t.scale&&s.canResetZoom(r)){var a=t.zoomPoint;t.zoomPoint=o,s.resetZoom(r),t.zoomPoint=a}e.bubbles=!1}pt.free(i),pt.free(n)},ji.prototype.doKeyDown=function(){"Esc"===this.diagram.lastInput.key&&this.doCancel()},ji.prototype.doKeyUp=function(){},ji.prototype.va=function(t){return void 0===t&&(t=this.name),this.transactionResult=null,this.diagram.va(t)},ji.prototype.Jg=function(){var t=this.diagram;return null===this.transactionResult?t.If():t.Xa(this.transactionResult)},ji.prototype.standardMouseSelect=function(){var t=this.diagram;if(t.allowSelect){var e=t.lastInput,i=t.zm(e.documentPoint,!1);if(null!==i){if(Y?e.meta:e.control){for(t.R("ChangingSelection",t.selection),e=i;null!==e&&!e.canSelect();)e=e.containingGroup;null!==e&&(e.isSelected=!e.isSelected),t.R("ChangedSelection",t.selection)}else if(e.shift){if(!i.isSelected){for(t.R("ChangingSelection",t.selection),e=i;null!==e&&!e.canSelect();)e=e.containingGroup;null!==e&&(e.isSelected=!0),t.R("ChangedSelection",t.selection)}}else if(!i.isSelected){for(e=i;null!==e&&!e.canSelect();)e=e.containingGroup;null!==e&&t.select(e)}}else!e.left||(Y?e.meta:e.control)||e.shift||t.clearSelection()}},ji.prototype.standardMouseClick=function(t,e){void 0===t&&(t=null),void 0===e&&(e=function(t){return!t.layer.isTemporary});var i=this.diagram,n=i.lastInput;return t=i.Vb(n.documentPoint,t,e),n.targetObject=t,Oi(t,n,i),n.handled},ji.prototype.standardMouseOver=function(){var t=this.diagram,e=t.lastInput;if(!0!==t.animationManager.sc){var i=t.skipsUndoManager;t.skipsUndoManager=!0;var n=t.viewportBounds.$(e.documentPoint)?t.Vb(e.documentPoint,null,null):null;e.targetObject=n;var o=!1;if(n!==t.Ej){var r=t.Ej,s=r;for(t.Ej=n,this.doCurrentObjectChanged(r,n),e.handled=!1;null!==r;){var a=r.mouseLeave;if(null!==a){if(n===r)break;if(null!==n&&n.Gg(r))break;if(a(e,r,n),o=!0,e.handled)break}r=r.panel}for(r=s,e.handled=!1;null!==n;){if(s=n.mouseEnter,null!==s){if(r===n)break;if(null!==r&&r.Gg(n))break;if(s(e,n,r),o=!0,e.handled)break}n=n.panel}n=t.Ej}if(null!==n){for(r=n,s="";null!==r;){if(s=r.cursor,""!==s)break;r=r.panel}for(t.currentCursor=s,e.handled=!1,r=n;null!==r;){if(n=r.mouseOver,null!==n&&(n(e,r),o=!0,e.handled))break;r=r.panel}}else t.currentCursor="",n=t.mouseOver,null!==n&&(n(e),o=!0);o&&t.Db(),t.skipsUndoManager=i}},ji.prototype.doCurrentObjectChanged=function(){},ji.prototype.standardMouseWheel=function(){var t=this.diagram,e=t.lastInput,i=e.delta;if(0!==i&&t.documentBounds.s()){var n=t.commandHandler,o=t.toolManager.mouseWheelBehavior;if(null!==n&&(o===Ii&&!e.shift||o===Bi&&e.control))(0<i?n.canIncreaseZoom():n.canDecreaseZoom())&&(o=t.zoomPoint,t.zoomPoint=e.viewPoint,0<i?n.increaseZoom():n.decreaseZoom(),t.zoomPoint=o),e.bubbles=!1;else if(o===Ii&&e.shift||o===Bi&&!e.control){n=t.position.copy();var r=0<i?i:-i,s=e.event,a=s.deltaMode;if(o=s.deltaX,s=s.deltaY,(z||V||G)&&(a=1,0<o&&(o=3),0>o&&(o=-3),0<s&&(s=3),0>s&&(s=-3)),void 0===a||void 0===o||void 0===s||0===o&&0===s||e.shift)!e.shift&&t.allowVerticalScroll?(r=3*r*t.scrollVerticalLineChange,0<i?t.scroll("pixel","up",r):t.scroll("pixel","down",r)):e.shift&&t.allowHorizontalScroll&&(r=3*r*t.scrollHorizontalLineChange,0<i?t.scroll("pixel","left",r):t.scroll("pixel","right",r));else{switch(a){case 0:i="pixel";break;case 1:i="line";break;case 2:i="page";break;default:i="pixel"}0!==o&&t.allowHorizontalScroll&&(o*=t.scrollHorizontalLineChange/16,0<o?t.scroll(i,"left",-o):t.scroll(i,"right",o)),0!==s&&t.allowVerticalScroll&&(s*=t.scrollVerticalLineChange/16,0<s?t.scroll(i,"up",-s):t.scroll(i,"down",s))}t.position.w(n)||(e.bubbles=!1)}}},ji.prototype.standardWaitAfter=function(t,e){void 0===e&&(e=this.diagram.lastInput),this.cancelWaitAfter();var i=this,n=e.clone(this.lz);this.vt=x((function(){i.doWaitAfter(n)}),t)},ji.prototype.cancelWaitAfter=function(){-1!==this.vt&&y.clearTimeout(this.vt),this.vt=-1},ji.prototype.doWaitAfter=function(){},ji.prototype.findToolHandleAt=function(t,e){return t=this.diagram.Vb(t,(function(t){for(;null!==t&&!(t.panel instanceof Qu);)t=t.panel;return t})),null===t?null:t.part.category===e?t:null},ji.prototype.isBeyondDragSize=function(t,e){var i=this.diagram;void 0===t&&(t=i.firstInput.viewPoint),void 0===e&&(e=i.lastInput.viewPoint);var n=i.toolManager.dragSize,o=n.width;return n=n.height,i.firstInput.isTouchEvent&&(o+=6,n+=6),Math.abs(e.x-t.x)>o||Math.abs(e.y-t.y)>n},d.Object.defineProperties(ji.prototype,{diagram:{get:function(){return this.C},set:function(t){t instanceof Ko&&(this.C=t)}},name:{get:function(){return this.oa},set:function(t){this.oa=t}},isEnabled:{get:function(){return this.md},set:function(t){this.md=t}},isActive:{get:function(){return this.Sc},set:function(t){this.Sc=t}},transactionResult:{get:function(){return this.ix},set:function(t){this.ix=t}}}),ji.prototype.stopTransaction=ji.prototype.Jg,ji.prototype.startTransaction=ji.prototype.va,ji.className="Tool",f(Di,ji),Di.prototype.initializeStandardTools=function(){},Di.prototype.updateAdornments=function(t){var e=this.currentToolTip;if(e instanceof Qu&&this.Kr===t){var i=e.adornedObject;(null!==t?i.part===t:null===i)?this.showToolTip(e,i):this.hideToolTip()}},Di.prototype.doMouseDown=function(){var t=this.diagram,e=t.lastInput;if(e.isTouchEvent&&this.gestureBehavior===zi&&(e.bubbles=!1),e.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===Vi)return void(e.bubbles=!0);if(this.gestureBehavior===zi)return;if(t.currentTool.canStartMultiTouch())return void t.currentTool.standardPinchZoomStart()}for(var i=this.mouseDownTools.length,n=0;n<i;n++){var o=this.mouseDownTools.J(n);if(o.diagram=this.diagram,o.canStart())return t.doFocus(),t.currentTool=o,void(t.currentTool===o&&(o.isActive||o.doActivate(),o.doMouseDown()))}1===t.lastInput.button&&(this.mouseWheelBehavior===Bi?this.mouseWheelBehavior=Ii:this.mouseWheelBehavior===Ii&&(this.mouseWheelBehavior=Bi)),this.doActivate(),this.standardWaitAfter(this.holdDelay,e)},Di.prototype.doMouseMove=function(){var t=this.diagram,e=t.lastInput;if(e.isMultiTouch){if(this.gestureBehavior===Vi)return void(e.bubbles=!0);if(this.gestureBehavior===zi)return;if(t.currentTool.canStartMultiTouch())return void t.currentTool.standardPinchZoomMove()}if(this.isActive)for(var i=this.mouseMoveTools.length,n=0;n<i;n++){var o=this.mouseMoveTools.J(n);if(o.diagram=this.diagram,o.canStart())return t.doFocus(),t.currentTool=o,void(t.currentTool===o&&(o.isActive||o.doActivate(),o.doMouseMove()))}Fi(this,t),t=e.event,null===t||"mousemove"!==t.type&&"pointermove"!==t.type&&t.cancelable||(e.bubbles=!0)},Di.prototype.doCurrentObjectChanged=function(t,e){t=this.currentToolTip,null===t||null!==e&&t instanceof Qu&&(e===t||e.Gg(t))||this.hideToolTip()},Di.prototype.doWaitAfter=function(t){var e=this.diagram;e.wa&&(this.doMouseHover(),this.isActive||this.doToolTip(),t.isTouchEvent&&!e.lastInput.handled&&(t=t.copy(),t.button=2,t.buttons=2,e.lastInput=t,e.hk=!0,e.doMouseUp()))},Di.prototype.doMouseHover=function(){var t=this.diagram,e=t.lastInput;null===e.targetObject&&(e.targetObject=t.Vb(e.documentPoint,null,null));var i=e.targetObject;if(null!==i)for(e.handled=!1;null!==i;){if(t=this.isActive?i.mouseHold:i.mouseHover,null!==t&&(t(e,i),e.handled))break;i=i.panel}else i=this.isActive?t.mouseHold:t.mouseHover,null!==i&&i(e)},Di.prototype.doToolTip=function(){var t=this.diagram,e=t.lastInput;if(null===e.targetObject&&(e.targetObject=t.Vb(e.documentPoint,null,null)),e=e.targetObject,null!==e){if(t=this.currentToolTip,!(t instanceof Qu)||e!==t&&!e.Gg(t)){for(;null!==e;){if(t=e.toolTip,null!==t)return void this.showToolTip(t,e);e=e.panel}this.hideToolTip()}}else e=t.toolTip,null!==e?this.showToolTip(e,null):this.hideToolTip()},Di.prototype.showToolTip=function(t,e){var i=this.diagram;if(t!==this.currentToolTip&&this.hideToolTip(),t instanceof Qu){t.layerName="Tool",t.selectable=!1,t.scale=1/i.scale,t.category="ToolTip",null!==t.placeholder&&(t.placeholder.scale=i.scale);var n=t.diagram;null!==n&&n!==i&&n.remove(t),i.add(t),null!==e?t.adornedObject=e:t.data=i.model,t.Ta(),this.positionToolTip(t,e)}else t instanceof Fn&&t!==this.currentToolTip&&t.show(e,i,this);if(this.currentToolTip=t,-1!==this.ik&&(y.clearTimeout(this.ik),this.ik=-1),t=this.toolTipDuration,0<t&&1/0!==t){var o=this;this.ik=x((function(){o.hideToolTip()}),t)}},Di.prototype.positionToolTip=function(t){if(null===t.placeholder){var e=this.diagram,i=e.lastInput.documentPoint.copy(),n=t.measuredBounds,o=e.viewportBounds;e.lastInput.isTouchEvent&&(i.x-=n.width),i.x+n.width>o.right&&(i.x-=n.width+5/e.scale),i.x<o.x&&(i.x=o.x),i.y=i.y+20/e.scale+n.height>o.bottom?i.y-(n.height+5/e.scale):i.y+20/e.scale,i.y<o.y&&(i.y=o.y),t.position=i}},Di.prototype.hideToolTip=function(){-1!==this.ik&&(y.clearTimeout(this.ik),this.ik=-1);var t=this.diagram,e=this.currentToolTip;null!==e&&(e instanceof Qu?(t.remove(e),null!==this.Kr&&this.Kr.Hf(e.category),e.data=null,e.adornedObject=null):e instanceof Fn&&null!==e.hide&&e.hide(t,this),this.currentToolTip=null)},Di.prototype.doMouseUp=function(){this.cancelWaitAfter();var t=this.diagram;if(this.isActive)for(var e=this.mouseUpTools.length,i=0;i<e;i++){var n=this.mouseUpTools.J(i);if(n.diagram=this.diagram,n.canStart())return t.doFocus(),t.currentTool=n,void(t.currentTool===n&&(n.isActive||n.doActivate(),n.doMouseUp()))}t.doFocus(),this.doDeactivate()},Di.prototype.doMouseWheel=function(){this.standardMouseWheel()},Di.prototype.doKeyDown=function(){var t=this.diagram;null!==t.commandHandler&&t.commandHandler.doKeyDown()},Di.prototype.doKeyUp=function(){var t=this.diagram;null!==t.commandHandler&&t.commandHandler.doKeyUp()},Di.prototype.findTool=function(t){for(var e=this.mouseDownTools.length,i=0;i<e;i++){var n=this.mouseDownTools.J(i);if(n.name===t)return n}for(e=this.mouseMoveTools.length,i=0;i<e;i++)if(n=this.mouseMoveTools.J(i),n.name===t)return n;for(e=this.mouseUpTools.length,i=0;i<e;i++)if(n=this.mouseUpTools.J(i),n.name===t)return n;return null},Di.prototype.replaceTool=function(t,e){null!==e&&(e.diagram=this.diagram);for(var i=this.mouseDownTools.length,n=0;n<i;n++){var o=this.mouseDownTools.J(n);if(o.name===t)return null!==e?this.mouseDownTools.Pc(n,e):this.mouseDownTools.cb(n),o}for(i=this.mouseMoveTools.length,n=0;n<i;n++)if(o=this.mouseMoveTools.J(n),o.name===t)return null!==e?this.mouseMoveTools.Pc(n,e):this.mouseMoveTools.cb(n),o;for(i=this.mouseUpTools.length,n=0;n<i;n++)if(o=this.mouseUpTools.J(n),o.name===t)return null!==e?this.mouseUpTools.Pc(n,e):this.mouseUpTools.cb(n),o;return null},Di.prototype.Ya=function(t,e,i){null!==e&&(e.name=t,e.diagram=this.diagram),this.findTool(t)?this.replaceTool(t,e):null!==e&&i.add(e)},d.Object.defineProperties(Di.prototype,{mouseWheelBehavior:{get:function(){return this.La},set:function(t){this.La=t}},gestureBehavior:{get:function(){return this.I},set:function(t){this.I=t}},currentToolTip:{get:function(){return this.l},set:function(t){this.l=t,this.Kr=null!==t&&t instanceof Qu?t.adornedPart:null}},mouseDownTools:{get:function(){return this.Cc}},mouseMoveTools:{get:function(){return this.Tc}},mouseUpTools:{get:function(){return this.Od}},hoverDelay:{get:function(){return this.Ka},set:function(t){this.Ka=t}},holdDelay:{get:function(){return this.T},set:function(t){this.T=t}},dragSize:{get:function(){return this.u},set:function(t){this.u=t.H()}},toolTipDuration:{get:function(){return this.eb},set:function(t){this.eb=t}}}),Di.prototype.replaceStandardTool=Di.prototype.Ya;var Bi=new U(Di,"WheelScroll",0),Ii=new U(Di,"WheelZoom",1),Ei=new U(Di,"WheelNone",2),Ri=new U(Di,"GestureZoom",3),zi=new U(Di,"GestureCancel",4),Vi=new U(Di,"GestureNone",5);function Gi(){ji.call(this),this.name="Dragging",this.I=this.Tc=!0,this.u=this.eb=this.Ka=this.qg=null,this.Tn=this.Od=!1,this.jm=new pt(NaN,NaN),this.it=new pt,this.Cc=!0,this.pl=100,this.Xg=[],this.lr=(new nt).freeze(),this.La=new ea,this.Fo=null,this.T="copy",this.Wh="",this.Xh="no-drop"}function Yi(t,e){if(t.dragsLink){var i=t.diagram;i.allowRelink&&(i.model.Ck()&&1===e.count&&e.first()instanceof Nc?(t.draggedLink=e.first(),t.draggedLink.canRelinkFrom()&&t.draggedLink.canRelinkTo()&&t.draggedLink.nk(),t.qg=i.toolManager.findTool("Relinking"),null===t.qg&&(t.qg=new xn,t.qg.diagram=i)):(t.draggedLink=null,t.qg=null))}}function Xi(t){var e=t.diagram,i=e.skipsUndoManager;e.skipsUndoManager=!0,Ji(t,e.lastInput,null),e.skipsUndoManager=i,t.Xg.length=0}function qi(){var t=hn;Ki(t),Wi(t);var e=t.diagram;t.jm.s()&&(e.position=t.jm),e.Jf()}function Ui(t,e){if(null===t.copiedParts){var i=t.diagram;if((!e||!i.isReadOnly&&!i.isModelReadOnly)&&null!==t.draggedParts){var n=i.undoManager;for(n.isEnabled&&n.isInTransaction?null!==n.currentTransaction&&0<n.currentTransaction.changes.count&&(i.undoManager.If(),i.va("Drag")):Wi(t),i.skipsUndoManager=!e,i.partManager.addsToTemporaryLayer=!e,t.startPoint=i.firstInput.documentPoint,e=t.copiesEffectiveCollection?t.draggedParts.Kf():i.selection,e=i.tk(e,i,!0),i=new dt,n=t.draggedParts.iterator;n.next();){var o=n.key;if(o.Nc()&&o.canCopy()){var r=e.G(o);null!==r&&(r.location=o.location,r.Ta(),i.add(r,t.Cd(r.location)))}}for(e=e.iterator;e.next();)n=e.value,n instanceof Nc&&n.canCopy()&&i.add(n,t.Cd());t.copiedParts=i,Yi(t,i.Kf()),null!==t.draggedLink&&(i=t.draggedLink,e=i.routeBounds,Ac(i,t.startPoint.x-(e.x+e.width/2),t.startPoint.y-(e.y+e.height/2)))}}}function Ki(t){var e=t.diagram;if(null!==t.copiedParts&&(e.gu(t.copiedParts.Kf(),!1),t.copiedParts=null,null!==t.draggedParts))for(var i=t.draggedParts.iterator;i.next();)i.key instanceof Nc&&(i.value.point=new pt(0,0));e.skipsUndoManager=!1,e.partManager.addsToTemporaryLayer=!1,t.startPoint=e.firstInput.documentPoint}function Hi(t){if(null!==t.draggedLink){if(t.dragsLink&&null!==t.qg){var e=t.qg;e.diagram.remove(e.temporaryFromNode),e.diagram.remove(e.temporaryToNode)}t.draggedLink=null,t.qg=null}}function _i(t,e,i){var n=t.diagram,o=t.startPoint,r=pt.alloc();r.assign(n.lastInput.documentPoint),t.moveParts(e,r.ge(o),i),pt.free(r),!0===n.Ke("temporaryPixelRatio")&&null===n.yh&&30<n.Yx&&(Jo(n),n.Yq())}function Wi(t){if(null!==t.draggedParts){for(var e=t.diagram,i=t.draggedParts.iterator;i.next();){var n=i.key;n.Nc()&&(n.location=i.value.point)}for(i=t.draggedParts.iterator;i.next();)if(n=i.key,n instanceof Nc&&n.suspendsRouting){var o=i.value.point;t.draggedParts.add(n,t.Cd()),Ac(n,-o.x,-o.y)}e.hd()}}function $i(t,e){var i=t.diagram;t.dragsLink&&(null!==t.draggedLink&&(t.draggedLink.fromNode=null,t.draggedLink.toNode=null),tn(t,!1));var n=t.findDragOverObject(e),o=i.lastInput;o.targetObject=n,t.doUpdateCursor(n);var r=i.skipsUndoManager,s=!1;try{if(i.skipsUndoManager=!0,s=Ji(t,o,n),!t.isActive&&null===hn)return;var a=null!==n?n.part:null;if(null===a||i.handlesDragDropForTopLevelParts&&a.isTopLevel&&!(a instanceof bc)){var h=i.mouseDragOver;null!==h&&(h(o),s=!0)}if(!t.isActive&&null===hn)return;if(t.doDragOver(e,n),!t.isActive&&null===hn)return}finally{i.skipsUndoManager=r,s&&i.hd()}t.Fo=n,i.isReadOnly||!i.allowMove&&!i.allowCopy||!i.allowHorizontalScroll&&!i.allowVerticalScroll||i.Et(o.viewPoint)}function Ji(t,e,i){var n=!1,o=t.Xg.length,r=0<o?t.Xg[0]:null;if(i===r)return!1;e.handled=!1;for(var s=0;s<o;s++){var a=t.Xg[s],h=a.mouseDragLeave;if(null!==h&&(h(e,a,i),n=!0,e.handled))break}if(t.Xg.length=0,!t.isActive&&null===hn||null===i)return n;for(e.handled=!1,o=i;null!==o;)t.Xg.push(o),o=Zi(o);for(o=t.Xg.length,i=0;i<o&&(s=t.Xg[i],a=s.mouseDragEnter,null===a||(a(e,s,r),n=!0,!e.handled));i++);return n}function Zi(t){var e=t.panel;return null!==e?e:t instanceof Lu&&!(t instanceof bc)&&(t=t.containingGroup,null!==t&&t.handlesDragDropForMembers)?t:null}function Qi(t,e,i){var n=t.qg;if(null===n)return null;var o=t.diagram.Eg(e,n.portGravity,(function(t){return n.findValidLinkablePort(t,i)}));t=pt.alloc();var r=1/0,s=null;for(o=o.iterator;o.next();){var a=o.value;if(null!==a.part){var h=a.da(ae,t);h=e.Ie(h),h<r&&(s=a,r=h)}}return pt.free(t),s}function tn(t,e){var i=t.draggedLink;if(null!==i&&!(2>i.pointsCount)){var n=t.diagram;if(!n.isReadOnly){var o=t.qg;if(null!==o){var r=null,s=null;null===i.fromNode&&(r=Qi(t,i.i(0),!1),null!==r&&(s=r.part));var a=null,h=null;null===i.toNode&&(a=Qi(t,i.i(i.pointsCount-1),!0),null!==a&&(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.Ky&&n.R("LinkRelinked",i,n.Ky),i.toPort!==n.Ly&&n.R("LinkRelinked",i,n.Ly)):bn(o,s,r,h,a):bn(o,null,null,null,null)}}}}function en(t,e){var i=t.diagram;t.dragsLink&&tn(t,!0),Xi(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;nn(t,o,r),r=Zi(r)}}else r=i.mouseDrop,null!==r&&r(o);if(t.isActive||null!==hn){for(o=(t.copiedParts||t.draggedParts).iterator;o.next();)r=o.key,r instanceof ec&&r.linksConnected.each((function(t){t.suspendsRouting=!1}));if(t.doDropOnto(e,n),t.isActive||null!==hn){for(t=zt.alloc(),e=i.selection.iterator;e.next();)n=e.value,n instanceof ec&&on(i,n,t);zt.free(t)}}}function nn(t,e,i){t=t.diagram,i=i.part,!t.handlesDragDropForTopLevelParts||!i.isTopLevel||i instanceof bc||(i=t.mouseDrop,null!==i&&i(e))}function on(t,e,i){var n=!1;if(e.getAvoidableRect(i),t.viewportBounds.Ge(i)&&(n=!0),t=t.Vv(i,(function(t){return t.part}),(function(t){return t instanceof Nc}),!0,(function(t){return t instanceof Nc}),n),0!==t.count)for(t=t.iterator;t.next();)i=t.value,!i.Kd(e)&&i.isAvoiding&&i.Ua()}function rn(t){if(null!==t.draggedParts)for(var e=t.draggedParts.iterator;e.next();){var i=e.key;i instanceof ec&&(i=i.containingGroup,null===i||null===i.placeholder||t.draggedParts.contains(i)||i.placeholder.o())}}function sn(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.tk(e,o,!0);var r=zt.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)||(l<n&&(n=l),u<o&&(o=u),l>s&&(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,zt.free(r),r=t.it,s=new dt,a=pt.alloc(),h=e.iterator;h.next();)l=h.value,l instanceof Nc&&l.canCopy()&&(u=i.G(l),null!==u&&(u.points=l.points,Ac(u,r.x-n,r.y-o),u.suspendsRouting=!0,s.add(u,t.Cd())));for(e=e.iterator;e.next();)l=e.value,l.Nc()&&l.canCopy()&&(h=i.G(l),null!==h&&(l=l.location,a.h(r.x-(n-l.x),r.y-(o-l.y)),h.location=a,h.Ta(),s.add(h,t.Cd(a))));pt.free(a),t.copiedParts=s,Yi(t,s.Kf()),null!==t.draggedLink&&(i=t.draggedLink,e=i.routeBounds,Ac(i,t.startPoint.x-(e.x+e.width/2),t.startPoint.y-(e.y+e.height/2)))}}}Di.className="ToolManager",Di.WheelScroll=Bi,Di.WheelZoom=Ii,Di.WheelNone=Ei,Di.GestureZoom=Ri,Di.GestureCancel=zi,Di.GestureNone=Vi,f(Gi,ji),Gi.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<this.pl))&&null!==this.findDraggablePart()},Gi.prototype.findDraggablePart=function(){var t=this.diagram;if(t=t.zm(t.firstInput.documentPoint,!1),null===t)return null;for(;null!==t&&!t.canSelect();)t=t.containingGroup;return null!==t&&(t.canMove()||t.canCopy())?t:null},Gi.prototype.standardMouseSelect=function(){var t=this.diagram;if(t.allowSelect){var e=t.zm(t.firstInput.documentPoint,!1);if(null!==e){for(;null!==e&&!e.canSelect();)e=e.containingGroup;this.currentPart=e,null===this.currentPart||this.currentPart.isSelected||(t.R("ChangingSelection",t.selection),e=t.lastInput,(Y?e.meta:e.control)||e.shift||t.clearSelection(!0),this.currentPart.isSelected=!0,t.R("ChangedSelection",t.selection))}}},Gi.prototype.doActivate=function(){var t=this.diagram;this.Fo=null,null===this.currentPart&&this.standardMouseSelect();var e=this.currentPart;null!==e&&(e.canMove()||e.canCopy())&&(hn=null,this.isActive=!0,this.jm.set(t.position),Yi(this,t.selection),this.Xg.length=0,t.animationManager.Bc(),this.draggedParts=this.computeEffectiveCollection(t.selection,this.dragOptions),t.mu=!0,!0===t.Ke("temporaryPixelRatio")&&30<t.Yx&&Jo(t),zr(t,this.draggedParts),this.va("Drag"),this.startPoint=t.firstInput.documentPoint,t.isMouseCaptured=!0,t.allowDragOut&&(this.isDragOutStarted=!0,this.Tn=!1,hn=this,ln=this.diagram,this.doSimulatedDragOut()))},Gi.prototype.computeEffectiveCollection=function(t,e){return this.diagram.commandHandler.computeEffectiveCollection(t,e)},Gi.prototype.Cd=function(t){return void 0===t?new Ys(At):this.isGridSnapEnabled?new Ys(new pt(Math.round(1e3*t.x)/1e3,Math.round(1e3*t.y)/1e3)):new Ys(t.copy())},Gi.prototype.doDeactivate=function(){this.isActive=!1;var t=this.diagram;if(t.Jf(),Xi(this),Vr(t,this.draggedParts),this.draggedParts=this.currentPart=this.Fo=null,this.Tn=this.isDragOutStarted=!1,0<an.count){for(var e=an,i=e.length,n=0;n<i;n++){var o=e.J(n);Hi(o),Ki(o),Xi(o),o.diagram.Jf()}e.clear()}Hi(this),this.jm.h(NaN,NaN),hn=ln=null,Ki(this),t.isMouseCaptured=!1,t.currentCursor="",t.mu=!1,this.Jg(),Zo(t,!0)},Gi.prototype.doCancel=function(){Ki(this),Wi(this);var t=this.diagram;this.jm.s()&&(t.position=this.jm),this.stopTool()},Gi.prototype.doKeyDown=function(){var t=this.diagram,e=t.lastInput;this.isActive&&("Esc"===e.key?this.doCancel():e.key!==t.previousInput.key&&this.doMouseMove())},Gi.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()},Gi.prototype.moveParts=function(t,e,i){void 0===i&&(i=!1);var n=this.diagram;null!==n&&Ir(n,t,e,this.dragOptions,i)},Gi.prototype.findDragOverObject=function(t){var e=this;return hr(this.diagram,t,null,(function(t){return null===t?t=!0:(t=t.part,t=!!(null===t||t instanceof Qu||t.layer.isTemporary||e.draggedParts&&e.draggedParts.contains(t)||e.copiedParts&&e.copiedParts.contains(t))),!t}))},Gi.prototype.doUpdateCursor=function(t){var e=this.diagram;this.Fo!==t&&(!this.diagram.currentTool.isActive||this.mayCopy()?e.currentCursor=this.copyCursor:this.mayMove()?e.currentCursor=this.moveCursor:this.mayDragOut()&&(e.currentCursor=this.nodropCursor))},Gi.prototype.doDragOver=function(){},Gi.prototype.doDropOnto=function(){},Gi.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram,e=t.lastInput;this.simulatedMouseMove(e.event,e.documentPoint,e.targetDiagram)||null===this.currentPart||null===this.draggedParts||(this.mayCopy()?(Ui(this,!1),zr(t,this.copiedParts),_i(this,this.copiedParts,!1),Vr(t,this.copiedParts)):this.mayMove()?(Ki(this),_i(this,this.draggedParts,!0)):this.mayDragOut()?(Ui(this,!1),_i(this,this.copiedParts,!1)):Ki(this),$i(this,t.lastInput.documentPoint))}},Gi.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram,e=t.lastInput;if(!this.simulatedMouseUp(e.event,e.documentPoint,e.targetDiagram)){e=!1;var i=this.mayCopy();if(i&&null!==this.copiedParts?(Ki(this),Ui(this,!0),zr(t,this.copiedParts),_i(this,this.copiedParts,!1),Vr(t,this.copiedParts),null!==this.copiedParts&&(t.R("ChangingSelection",t.selection),t.clearSelection(!0),this.copiedParts.iteratorKeys.each((function(t){t.isSelected=!0})))):(e=!0,Ki(this),this.mayMove()&&(_i(this,this.draggedParts,!0),$i(this,t.lastInput.documentPoint))),this.Tn=!0,en(this,t.lastInput.documentPoint),this.isActive){var n=i?this.copiedParts.Kf():this.draggedParts.Kf();this.copiedParts=null,e&&rn(this),t.Na(),Vr(t,this.draggedParts),this.transactionResult=i?"Copy":"Move",t.R(i?"SelectionCopied":"SelectionMoved",n)}this.stopTool(),i&&t.R("ChangedSelection",t.selection)}}},Gi.prototype.simulatedMouseMove=function(t,e,i){if(null===hn)return!1;var n=hn.diagram;i instanceof Ko||(i=null);var o=ln;return i!==o&&(null!==o&&o!==n&&(o.Jf(),hn.isDragOutStarted=!1,o=o.toolManager.findTool("Dragging"),null!==o&&o.doSimulatedDragLeave()),ln=i,null!==i&&i!==n&&(qi(),o=i.toolManager.findTool("Dragging"),null!==o&&(an.contains(o)||an.add(o),o.doSimulatedDragEnter()))),!(null===i||i===n||!i.allowDrop||i.isReadOnly||!i.allowInsert)&&(n=i.toolManager.findTool("Dragging"),null!==n&&(null!==t&&(void 0!==t.targetTouches&&(0<t.targetTouches.length?t=t.targetTouches[0]:0<t.changedTouches.length&&(t=t.changedTouches[0])),e=i.getMouse(t)),i.lastInput.documentPoint=e,i.lastInput.viewPoint=i.gr(e),i.lastInput.down=!1,i.lastInput.up=!1,n.doSimulatedDragOver()),!0)},Gi.prototype.simulatedMouseUp=function(t,e,i){if(null===hn)return!1;var n=ln,o=hn.diagram;if(null===i)return hn.doCancel(),!0;if(i!==n){var r=n.toolManager.findTool("Dragging");if(null!==n&&n!==o&&null!==r)return n.Jf(),hn.isDragOutStarted=!1,r.doSimulatedDragLeave(),!1;ln=i,n=i.toolManager.findTool("Dragging"),null!==n&&(qi(),an.contains(n)||an.add(n),n.doSimulatedDragEnter())}return i!==this.diagram&&(null!==t?(void 0!==t.targetTouches&&(0<t.targetTouches.length?t=t.targetTouches[0]:0<t.changedTouches.length&&(t=t.changedTouches[0])),e=i.getMouse(t)):null===e&&(e=new pt),i.lastInput.documentPoint=e,i.lastInput.viewPoint=i.gr(e),i.lastInput.down=!1,i.lastInput.up=!0,t=i.toolManager.findTool("Dragging"),null!==t&&t.doSimulatedDrop(),t=hn,null!==t&&(i=t.mayCopy(),t.transactionResult=i?"Copy":"Move",t.stopTool()),!0)},Gi.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowCopy||(Y?!t.lastInput.alt:!t.lastInput.control))return!1;for(t=t.selection.iterator;t.next();)if(t.value.canCopy())return!0;return!(null===this.draggedLink||!this.dragsLink||!this.draggedLink.canCopy())},Gi.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var t=this.diagram;if(!t.allowDragOut||!t.allowCopy||t.allowMove)return!1;for(t=t.selection.iterator;t.next();)if(t.value.canCopy())return!0;return!(null===this.draggedLink||!this.dragsLink||!this.draggedLink.canCopy())},Gi.prototype.mayMove=function(){var t=this.diagram;if(t.isReadOnly||!t.allowMove)return!1;for(t=t.selection.iterator;t.next();)if(t.value.canMove())return!0;return!(null===this.draggedLink||!this.dragsLink||!this.draggedLink.canMove())},Gi.prototype.computeBorder=function(t,e,i){return this.Tn||null===this.draggedParts||this.draggedParts.contains(t)?null:i.assign(e)},Gi.prototype.lA=function(){return hn},Gi.prototype.mayDragIn=function(){var t=this.diagram;if(!t.allowDrop||t.isReadOnly||t.isModelReadOnly||!t.allowInsert)return!1;var e=hn;return null!==e&&e.diagram.model.dataFormat===t.model.dataFormat},Gi.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var t=this.diagram;t.animationManager.Bc(),kr(t),t.animationManager.Bc();var e=hn;null!==e&&(e.diagram.mu=!1),this.doUpdateCursor(t.grid)}},Gi.prototype.doSimulatedDragLeave=function(){var t=hn;null!==t&&t.doSimulatedDragOut(),this.doCancel()},Gi.prototype.doSimulatedDragOver=function(){var t=this.diagram;t.animationManager.tn=!0;var e=hn;if(null!==e&&null!==e.draggedParts){if(!this.mayDragIn())return;sn(this,e.draggedParts.Kf(),!1,t.firstInput),_i(this,this.copiedParts,!1),$i(this,t.lastInput.documentPoint)}t.animationManager.tn=!1},Gi.prototype.doSimulatedDrop=function(){var t=this.diagram,e=hn;if(null!==e){var i=e.diagram;if(e.Tn=!0,Ki(this),!this.mayDragIn())return;t.animationManager.tn=!0,t.R("ChangingSelection",t.selection),this.va("Drop"),sn(this,e.draggedParts.Kf(),!0,t.lastInput),_i(this,this.copiedParts,!1),null!==this.copiedParts&&(t.clearSelection(!0),this.copiedParts.iteratorKeys.each((function(t){t.isSelected=!0}))),en(this,t.lastInput.documentPoint),t.Na(),e=t.selection,null!==this.copiedParts?this.transactionResult="ExternalCopy":e=new nt,this.copiedParts=null,t.doFocus(),t.R("ExternalObjectsDropped",e,i),this.Jg(),t.R("ChangedSelection",t.selection)}t.animationManager.tn=!1},Gi.prototype.doSimulatedDragOut=function(){var t=this.diagram;t.mu=!1,this.mayCopy()||this.mayMove()?t.currentCursor="":t.currentCursor=this.nodropCursor,this.Fo=null},Gi.prototype.computeMove=function(t,e,i,n){return i=this.diagram,null!==i?i.computeMove(t,e,this.dragOptions,n):new pt},d.Object.defineProperties(Gi.prototype,{isCopyEnabled:{get:function(){return this.Tc},set:function(t){this.Tc=t}},copiesEffectiveCollection:{get:function(){return this.I},set:function(t){this.I=t}},dragOptions:{get:function(){return this.La},set:function(t){this.La=t}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(t){this.dragOptions.isGridSnapEnabled=t}},isComplexRoutingRealtime:{get:function(){return this.Cc},set:function(t){this.Cc=t}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(t){this.dragOptions.isGridSnapRealtime=t}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(t){this.dragOptions.gridSnapCellSize.w(t)||(t=t.H(),this.dragOptions.gridSnapCellSize=t)}},gridSnapCellSpot:{get:function(){return this.dragOptions.gridSnapCellSpot},set:function(t){this.dragOptions.gridSnapCellSpot.w(t)||(t=t.H(),this.dragOptions.gridSnapCellSpot=t)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(t){this.dragOptions.gridSnapOrigin.w(t)||(t=t.H(),this.dragOptions.gridSnapOrigin=t)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(t){this.dragOptions.dragsLink=t}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(t){this.dragOptions.dragsTree=t}},copyCursor:{get:function(){return this.T},set:function(t){this.T=t}},moveCursor:{get:function(){return this.Wh},set:function(t){this.Wh=t}},nodropCursor:{get:function(){return this.Xh},set:function(t){this.Xh=t}},currentPart:{get:function(){return this.Ka},set:function(t){this.Ka=t}},copiedParts:{get:function(){return this.u},set:function(t){this.u=t}},draggedParts:{get:function(){return this.eb},set:function(t){this.eb=t}},draggingParts:{get:function(){return null!==this.copiedParts?this.copiedParts.Kf():null!==this.draggedParts?this.draggedParts.Kf():this.lr}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(t){this.diagram.draggedLink=t}},isDragOutStarted:{get:function(){return this.Od},set:function(t){this.Od=t}},startPoint:{get:function(){return this.it},set:function(t){this.it.w(t)||this.it.assign(t)}},delay:{get:function(){return this.pl},set:function(t){this.pl=t}}}),Gi.prototype.getDraggingSource=Gi.prototype.lA;var an=null,hn=null,ln=null;function un(){ji.call(this),this.Xh=100,this.La=!1,this.oi="pointer";var t=new Nc,e=new Nl;e.isPanelMain=!0,e.stroke="blue",t.add(e),e=new Nl,e.toArrow="Standard",e.fill="blue",e.stroke="blue",t.add(e),t.layerName="Tool",this.gx=t,t=new ec,e=new Nl,e.portId="",e.figure="Rectangle",e.fill=null,e.stroke="magenta",e.strokeWidth=2,e.desiredSize=Mt,t.add(e),t.selectable=!1,t.layerName="Tool",this.ex=t,this.l=e,t=new ec,e=new Nl,e.portId="",e.figure="Rectangle",e.fill=null,e.stroke="magenta",e.strokeWidth=2,e.desiredSize=Mt,t.add(e),t.selectable=!1,t.layerName="Tool",this.hx=t,this.u=e,this.Wh=this.Od=this.Cc=this.eb=this.Tc=null,this.Ka=!0,this.cz=new dt,this.lr=this.Ii=this.bx=null}function cn(t,e,i,n){if(e===i)return!0;var o=e.fromNode;return!(null===o||!o.isLinkLabel||(n.add(o),!cn(t,o.labeledLink,i,n)))||(e=e.toNode,!(null===e||!e.isLinkLabel||(n.add(e),!cn(t,e.labeledLink,i,n))))}function fn(t,e,i,n,o){if(e===i)return!0;if(null===e||null===i)return!1;for(var r=e.linksConnected;r.next();){var s=r.value;if(s!==n&&(!o||s.isTreeLink)&&s.toNode===e&&(s=s.fromNode,s!==e&&fn(t,s,i,n,o)))return!0}return!1}function dn(t,e,i,n,o){if(i===n)return!0;if(null===i||null===n||e.contains(i))return!1;e.add(i);for(var r=i.linksConnected;r.next();){var s=r.value;if(s!==o&&s.toNode===i&&(s=s.fromNode,s!==i&&dn(t,e,s,n,o)))return!0}return!1}function pn(t,e,i,n,o){if(i===n)return!0;if(null===i||null===n||e.contains(i))return!1;e.add(i);for(var r=i.linksConnected;r.next();){var s=r.value;if(s!==o){var a=s.fromNode;if(s=s.toNode,a=a===i?s:a,a!==i&&pn(t,e,a,n,o))return!0}}return!1}function gn(){un.call(this),this.name="Linking",this.T={},this.I=null,this.K=yn,this.en=null}Gi.className="DraggingTool",an=new et,I("draggingTool",(function(){return this.findTool("Dragging")}),(function(t){this.Ya("Dragging",t,this.mouseMoveTools)})),Di.prototype.doCancel=function(){null!==hn&&hn.doCancel(),ji.prototype.doCancel.call(this)},f(un,ji),un.prototype.doStop=function(){this.diagram.Jf(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},un.prototype.copyPortProperties=function(t,e,i,n,o){if(null!==t&&null!==e&&null!==i&&null!==n){var r=e.Af(),s=Bt.alloc();s.width=e.naturalBounds.width*r,s.height=e.naturalBounds.height*r,n.desiredSize=s,Bt.free(s),o?(n.toSpot=e.toSpot,n.toEndSegmentLength=e.toEndSegmentLength):(n.fromSpot=e.fromSpot,n.fromEndSegmentLength=e.fromEndSegmentLength),i.locationSpot=ae,r=pt.alloc(),i.location=e.da(ae,r),pt.free(r),n.angle=e.lj(),null!==this.portTargeted&&this.portTargeted(t,e,i,n,o)}},un.prototype.setNoTargetPortProperties=function(t,e,i){null!==e&&(e.desiredSize=Mt,e.fromSpot=ie,e.toSpot=ie),null!==t&&(t.location=this.diagram.lastInput.documentPoint),null!==this.portTargeted&&this.portTargeted(null,null,t,e,i)},un.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},un.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),null!==this.targetPort&&this.targetPort.part instanceof ec){var e=this.targetPort.part;this.isForwards?this.copyPortProperties(e,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(e,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(t.allowHorizontalScroll||t.allowVerticalScroll)&&t.Et(t.lastInput.viewPoint)}},un.prototype.findValidLinkablePort=function(t,e){if(null===t)return null;var i=t.part;if(!(i instanceof ec))return null;for(;null!==t;){var n=e?t.toLinkable:t.fromLinkable;if(!0===n&&(null!==t.portId||t instanceof ec)&&(e?this.isValidTo(i,t):this.isValidFrom(i,t)))return t;if(!1===n)break;t=t.panel}return null},un.prototype.findTargetPort=function(t){var e=this.diagram,i=e.lastInput.documentPoint,n=this.portGravity;0>=n&&(n=.1);var o=this,r=e.Eg(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 ec){var h=s.da(ae,pt.alloc()),l=i.x-h.x,u=i.y-h.y;pt.free(h),h=l*l+u*u,h<n&&(l=this.validPortsCache.G(s),null!==l?l&&(e=s,n=h):t&&this.isValidLink(this.originalFromNode,this.originalFromPort,a,s)||!t&&this.isValidLink(a,s,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(s,!0),e=s,n=h):this.validPortsCache.add(s,!1))}}return null!==e&&(i=e.part,i instanceof ec&&(null===i.layer||i.layer.allowLink))?e:null},un.prototype.isValidFrom=function(t,e){if(null===t||null===e)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==t.layer&&!t.layer.allowLink||!0!==e.fromLinkable))return!1;var i=e.fromMaxLinks;if(1/0>i){if(null!==this.originalLink&&t===this.originalFromNode&&e===this.originalFromPort)return!0;if(e=e.portId,null===e&&(e=""),t.Fq(e).count>=i)return!1}return!0},un.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(e=e.portId,null===e&&(e=""),t.Hd(e).count>=i)return!1}return!0},un.prototype.isInSameNode=function(t,e){return null!==t&&null!==e&&(t===e||(t=t.part,e=e.part,null!==t&&t===e))},un.prototype.isLinked=function(t,e){if(null===t||null===e)return!1;var i=t.part;if(!(i instanceof ec))return!1;t=t.portId,null===t&&(t="");var n=e.part;if(!(n instanceof ec))return!1;for(e=e.portId,null===e&&(e=""),e=n.Hd(e);e.next();)if(n=e.value,n.fromNode===i&&n.fromPortId===t)return!0;return!1},un.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&&(o=i.linkValidation,null!==o&&!o(t,e,i,n,this.originalLink)))&&(o=this.linkValidation,null===o||o(t,e,i,n,this.originalLink))},un.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 nt;return n.add(t),cn(this,i,e,n)},un.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!==ks){if(n===Ns){if(n=i||this.temporaryLink,null!==n&&!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!fn(this,t,e,i,!0)}if(n===Cs){if(n=i||this.temporaryLink,null!==n&&!n.isTreeLink)return!0;for(n=t.linksConnected;n.next();)if(o=n.value,o!==i&&o.isTreeLink&&o.fromNode===t)return!1;return!fn(this,t,e,i,!0)}if(n===Ms)return t===e?t=!0:(n=new nt,n.add(e),t=dn(this,n,t,e,i)),!t;if(n===Ss)return!fn(this,t,e,i,!1);if(n===Ps)return t===e?t=!0:(n=new nt,n.add(e),t=pn(this,n,t,e,i)),!t}return!0},d.Object.defineProperties(un.prototype,{portGravity:{get:function(){return this.Xh},set:function(t){0<=t&&(this.Xh=t)}},isUnconnectedLinkValid:{get:function(){return this.La},set:function(t){this.La=t}},linkingCursor:{get:function(){return this.oi},set:function(t){this.oi=t}},temporaryLink:{get:function(){return this.gx},set:function(t){this.gx=t}},temporaryFromNode:{get:function(){return this.ex},set:function(t){(this.ex=t)&&(this.l=t.port)}},temporaryFromPort:{get:function(){return this.l},set:function(t){if(null!==this.l){var e=this.l.panel;if(null!==e){var i=e.W.indexOf(this.l);e.cb(i),e.wb(i,t)}}this.l=t}},temporaryToNode:{get:function(){return this.hx},set:function(t){(this.hx=t)&&(this.u=t.port)}},temporaryToPort:{get:function(){return this.u},set:function(t){if(null!==this.u){var e=this.u.panel;if(null!==e){var i=e.W.indexOf(this.u);e.cb(i),e.wb(i,t)}}this.u=t}},originalLink:{get:function(){return this.Tc},set:function(t){this.Tc=t}},originalFromNode:{get:function(){return this.eb},set:function(t){this.eb=t}},originalFromPort:{get:function(){return this.Cc},set:function(t){this.Cc=t}},originalToNode:{get:function(){return this.Od},set:function(t){this.Od=t}},originalToPort:{get:function(){return this.Wh},set:function(t){this.Wh=t}},isForwards:{get:function(){return this.Ka},set:function(t){this.Ka=t}},validPortsCache:{get:function(){return this.cz}},targetPort:{get:function(){return this.bx},set:function(t){this.bx=t}},linkValidation:{get:function(){return this.Ii},set:function(t){this.Ii=t}},portTargeted:{get:function(){return this.lr},set:function(t){this.lr=t}}}),un.className="LinkingBaseTool",f(gn,un),gn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowLink||!t.model.Ut()||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize())&&null!==this.findLinkablePort()},gn.prototype.findLinkablePort=function(){var t=this.diagram,e=this.startObject;if(null===e&&(e=t.Vb(t.firstInput.documentPoint,null,null)),null===e)return null;if(t=e.part,!(t instanceof ec))return null;var i=this.direction;if(i===yn||i===mn){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===yn||i===vn)&&(e=this.findValidLinkablePort(e,!0),null!==e||this.startObject===t&&(e=t.port,this.findValidLinkablePort(e,!0)))?(this.isForwards=!1,e):null},gn.prototype.doActivate=function(){var t=this.diagram,e=this.findLinkablePort();null===e?this.stopTool():(this.va(this.name),t.isMouseCaptured=!0,t.currentCursor=this.linkingCursor,this.isForwards?(null===this.temporaryToNode||this.temporaryToNode.location.s()||(this.temporaryToNode.location=t.lastInput.documentPoint),this.originalFromPort=e,e=this.originalFromPort.part,e instanceof ec&&(this.originalFromNode=e),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(null===this.temporaryFromNode||this.temporaryFromNode.location.s()||(this.temporaryFromNode.location=t.lastInput.documentPoint),this.originalToPort=e,e=this.originalToPort.part,e instanceof ec&&(this.originalToNode=e),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),t.add(this.temporaryFromNode),t.add(this.temporaryToNode),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.Ua(),t.add(this.temporaryLink)),this.isActive=!0)},gn.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.Jg()},gn.prototype.doStop=function(){un.prototype.doStop.call(this),this.startObject=null},gn.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){var 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 ec&&(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?(r=this.insertLink(e,i,n,o),null!==r?(null===s&&(this.isForwards?r.defaultToPoint=t.lastInput.documentPoint.copy():r.defaultFromPoint=t.lastInput.documentPoint.copy()),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)}}},gn.prototype.isNewTreeLink=function(){var t=this.archetypeLinkData;if(null===t)return!0;if(t instanceof Nc)return t.isTreeLink;var e=this.diagram;return null===e||(t=e.partManager.getLinkCategoryForData(t),e=e.partManager.findLinkTemplateForCategory(t),null===e||e.isTreeLink)},gn.prototype.insertLink=function(t,e,i,n){return this.diagram.partManager.insertLink(t,e,i,n)},gn.prototype.doNoLink=function(){},d.Object.defineProperties(gn.prototype,{archetypeLinkData:{get:function(){return this.T},set:function(t){this.T=t}},archetypeLabelNodeData:{get:function(){return this.I},set:function(t){this.I=t}},direction:{get:function(){return this.K},set:function(t){this.K=t}},startObject:{get:function(){return this.en},set:function(t){this.en=t}}});var yn=new U(gn,"Either",0),mn=new U(gn,"ForwardsOnly",0),vn=new U(gn,"BackwardsOnly",0);function xn(){un.call(this),this.name="Relinking";var t=new Nl;t.figure="Diamond",t.desiredSize=Pt,t.fill="lightblue",t.stroke="dodgerblue",t.cursor=this.linkingCursor,t.segmentIndex=0,this.T=t,t=new Nl,t.figure="Diamond",t.desiredSize=Pt,t.fill="lightblue",t.stroke="dodgerblue",t.cursor=this.linkingCursor,t.segmentIndex=-1,this.en=t,this.I=null,this.Hx=new zt}function bn(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 wn(){ji.call(this),this.name="LinkReshaping";var t=new Nl;t.figure="Rectangle",t.desiredSize=St,t.fill="lightblue",t.stroke="dodgerblue",this.u=t,t=new Nl,t.figure="Diamond",t.desiredSize=Pt,t.fill="lightblue",t.stroke="dodgerblue",t.cursor="move",this.I=t,this.T=3,this.wu=this.l=null,this.Ix=new pt,this.Is=new et}function kn(t,e,i,n,o,r){return r?Math.abs(e.y-i.y)<t.resegmentingDistance&&Math.abs(i.y-n.y)<t.resegmentingDistance&&Math.abs(n.y-o.y)<t.resegmentingDistance:Math.abs(e.x-i.x)<t.resegmentingDistance&&Math.abs(i.x-n.x)<t.resegmentingDistance&&Math.abs(n.x-o.x)<t.resegmentingDistance}gn.className="LinkingTool",gn.Either=yn,gn.ForwardsOnly=mn,gn.BackwardsOnly=vn,f(xn,un),xn.prototype.updateAdornments=function(t){if(null!==t&&t instanceof Nc){var e="RelinkFrom",i=null;if(t.isSelected&&!this.diagram.isReadOnly){var n=t.selectionObject;null!==n&&t.canRelinkFrom()&&t.actualBounds.s()&&t.isVisible()&&n.actualBounds.s()&&n.Gf()&&(i=t.wk(e),null===i&&(i=this.makeAdornment(n,!1),t.Gh(e,i)))}null===i&&t.Hf(e),e="RelinkTo",i=null,t.isSelected&&!this.diagram.isReadOnly&&(n=t.selectionObject,null!==n&&t.canRelinkTo()&&t.actualBounds.s()&&t.isVisible()&&n.actualBounds.s()&&n.Gf()&&(i=t.wk(e),null===i?(i=this.makeAdornment(n,!0),t.Gh(e,i)):i.o())),null===i&&t.Hf(e)}},xn.prototype.makeAdornment=function(t,e){var i=new Qu;return i.type=Uh.Link,e=e?this.toHandleArchetype:this.fromHandleArchetype,null!==e&&i.add(e.copy()),i.adornedObject=t,i},xn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowRelink||!t.model.Ut()||!t.lastInput.left)return!1;var e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkFrom");return null===e&&(e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkTo")),null!==e},xn.prototype.doActivate=function(){var t=this.diagram;if(null===this.originalLink){var e=this.handle;if(null===e&&(e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkFrom"),null===e&&(e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkTo"))),null===e)return;var i=e.part;if(!(i instanceof Qu&&i.adornedPart instanceof Nc))return;this.handle=e,this.isForwards=null===i||"RelinkTo"===i.category,this.originalLink=i.adornedPart}this.va(this.name),t.isMouseCaptured=!0,t.currentCursor=this.linkingCursor,this.originalFromPort=this.originalLink.fromPort,this.originalFromNode=this.originalLink.fromNode,this.originalToPort=this.originalLink.toPort,this.originalToNode=this.originalLink.toNode,this.Hx.set(this.originalLink.actualBounds),null!==this.originalLink&&0<this.originalLink.pointsCount&&(null===this.originalLink.fromNode&&(null!==this.temporaryFromPort&&(this.temporaryFromPort.desiredSize=kt),null!==this.temporaryFromNode&&(this.temporaryFromNode.location=this.originalLink.i(0))),null===this.originalLink.toNode&&(null!==this.temporaryToPort&&(this.temporaryToPort.desiredSize=kt),null!==this.temporaryToNode&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1)))),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0),t.add(this.temporaryFromNode),t.add(this.temporaryToNode),null!==this.temporaryLink&&(null!==this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode),null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.Ua(),t.add(this.temporaryLink)),this.isActive=!0},xn.prototype.copyLinkProperties=function(t,e){if(null!==t&&null!==e){e.adjusting=t.adjusting,e.corner=t.corner;var i=t.curve;i!==of&&i!==nf||(i=tf),e.curve=i,e.curviness=t.curviness,e.isTreeLink=t.isTreeLink,e.points=t.points,e.routing=t.routing,e.smoothness=t.smoothness,e.fromSpot=t.fromSpot,e.fromEndSegmentLength=t.fromEndSegmentLength,e.fromShortLength=t.fromShortLength,e.toSpot=t.toSpot,e.toEndSegmentLength=t.toEndSegmentLength,e.toShortLength=t.toShortLength}},xn.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.Jg()},xn.prototype.doStop=function(){un.prototype.doStop.call(this),this.handle=null},xn.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram;this.transactionResult=null;var e=this.originalFromNode,i=this.originalFromPort,n=this.originalToNode,o=this.originalToPort,r=this.originalLink;if(this.targetPort=this.findTargetPort(this.isForwards),null!==this.targetPort){var s=this.targetPort.part;s instanceof ec&&(this.isForwards?(n=s,o=this.targetPort):(e=s,i=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?o=n=null:i=e=null:r=null;null!==r?(this.reconnectLink(r,this.isForwards?n:e,this.isForwards?o:i,this.isForwards),null===this.targetPort&&(this.isForwards?r.defaultToPoint=t.lastInput.documentPoint.copy():r.defaultFromPoint=t.lastInput.documentPoint.copy(),r.Ua()),t.allowSelect&&(r.isSelected=!0),this.transactionResult=this.name,t.R("LinkRelinked",r,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards),this.originalLink.Oq(this.Hx)}this.stopTool()},xn.prototype.reconnectLink=function(t,e,i,n){return i=null!==i&&null!==i.portId?i.portId:"",n?(t.toNode=e,t.toPortId=i):(t.fromNode=e,t.fromPortId=i),!0},xn.prototype.doNoRelink=function(){},d.Object.defineProperties(xn.prototype,{fromHandleArchetype:{get:function(){return this.T},set:function(t){this.T=t}},toHandleArchetype:{get:function(){return this.en},set:function(t){this.en=t}},handle:{get:function(){return this.I},set:function(t){if(null!==t&&!(t.part instanceof Qu))throw Error("new handle is not in an Adornment: "+t);this.I=t}}}),xn.className="RelinkingTool",I("linkingTool",(function(){return this.findTool("Linking")}),(function(t){this.Ya("Linking",t,this.mouseMoveTools)})),I("relinkingTool",(function(){return this.findTool("Relinking")}),(function(t){this.Ya("Relinking",t,this.mouseDownTools)})),f(wn,ji),wn.prototype.Zv=function(t){return t&&t.Os&&0!==t.Os.value?t.Os:Mn},wn.prototype.Xm=function(t,e){t.Os=e},wn.prototype.updateAdornments=function(t){if(null!==t&&t instanceof Nc){var e=null;if(t.isSelected&&!this.diagram.isReadOnly){var i=t.path;null!==i&&t.canReshape()&&t.actualBounds.s()&&t.isVisible()&&i.actualBounds.s()&&i.Gf()&&(e=t.wk(this.name),null===e||e.Ex!==t.pointsCount||e.Sx!==t.resegmentable)&&(e=this.makeAdornment(i),null!==e&&(e.Ex=t.pointsCount,e.Sx=t.resegmentable,t.Gh(this.name,e)))}null===e&&t.Hf(this.name)}},wn.prototype.makeAdornment=function(t){var e=t.part,i=e.pointsCount,n=e.isOrthogonal,o=null;if(null!==e.points&&1<i){o=new Qu,o.type=Uh.Link,i=e.firstPickIndex;var r=e.lastPickIndex,s=n?1:0;if(e.resegmentable&&e.computeCurve()!==ef)for(var a=i+s;a<r-s;a++){var h=this.makeResegmentHandle(t,a);null!==h&&(h.segmentIndex=a,h.segmentFraction=.5,h.fromMaxLinks=999,o.add(h))}for(s=i+1;s<r;s++)if(a=this.makeHandle(t,s),null!==a){if(a.segmentIndex=s,s!==i)if(s===i+1&&n){h=e.i(i);var l=e.i(i+1);_e.A(h.x,l.x)&&_e.A(h.y,l.y)&&(l=e.i(i-1)),_e.A(h.x,l.x)?(this.Xm(a,Pn),a.cursor="n-resize"):_e.A(h.y,l.y)&&(this.Xm(a,Sn),a.cursor="w-resize")}else s===r-1&&n?(h=e.i(r-1),l=e.i(r),_e.A(h.x,l.x)&&_e.A(h.y,l.y)&&(h=e.i(r+1)),_e.A(h.x,l.x)?(this.Xm(a,Pn),a.cursor="n-resize"):_e.A(h.y,l.y)&&(this.Xm(a,Sn),a.cursor="w-resize")):s!==r&&(this.Xm(a,Nn),a.cursor="move");o.add(a)}o.adornedObject=t}return o},wn.prototype.makeHandle=function(){var t=this.handleArchetype;return null===t?null:t.copy()},wn.prototype.makeResegmentHandle=function(){var t=this.midHandleArchetype;return null===t?null:t.copy()},wn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(t.isReadOnly||!t.allowReshape||!t.lastInput.left)&&null!==this.findToolHandleAt(t.firstInput.documentPoint,this.name)},wn.prototype.doActivate=function(){var t=this.diagram;if(null===this.handle&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),null!==this.handle){var e=this.handle.part.adornedPart;if(e instanceof Nc){if(this.wu=e,t.isMouseCaptured=!0,this.va(this.name),e.resegmentable&&999===this.handle.fromMaxLinks){var i=e.points.copy(),n=this.getResegmentingPoint();if(i.wb(this.handle.segmentIndex+1,n),e.isOrthogonal&&i.wb(this.handle.segmentIndex+1,n),e.points=i,e.Lb(),e.updateAdornments(),this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name),null===this.handle)return void this.doDeactivate()}this.Ix=e.i(this.handle.segmentIndex),this.Is=e.points.copy(),this.isActive=!0}}},wn.prototype.doDeactivate=function(){this.Jg(),this.wu=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},wn.prototype.doCancel=function(){var t=this.adornedLink;null!==t&&(t.points=this.Is),this.stopTool()},wn.prototype.getResegmentingPoint=function(){return this.handle.da(ae)},wn.prototype.doMouseMove=function(){var t=this.diagram;this.isActive&&(t=this.computeReshape(t.lastInput.documentPoint),this.reshape(t))},wn.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){var e=this.computeReshape(t.lastInput.documentPoint);if(this.reshape(e),e=this.adornedLink,null!==e&&e.resegmentable){var i=this.handle.segmentIndex,n=e.i(i-1),o=e.i(i),r=e.i(i+1);if(e.isOrthogonal){if(i>e.firstPickIndex+1&&i<e.lastPickIndex-1){var s=e.i(i-2);if(Math.abs(n.x-o.x)<this.resegmentingDistance&&Math.abs(n.y-o.y)<this.resegmentingDistance&&(kn(this,s,n,o,r,!0)||kn(this,s,n,o,r,!1))){var a=e.points.copy();kn(this,s,n,o,r,!0)?(a.Pc(i-2,new pt(s.x,(r.y+s.y)/2)),a.Pc(i+1,new pt(r.x,(r.y+s.y)/2))):(a.Pc(i-2,new pt((r.x+s.x)/2,s.y)),a.Pc(i+1,new pt((r.x+s.x)/2,r.y))),a.cb(i),a.cb(i-1),e.points=a,e.Lb()}else s=e.i(i+2),Math.abs(o.x-r.x)<this.resegmentingDistance&&Math.abs(o.y-r.y)<this.resegmentingDistance&&(kn(this,n,o,r,s,!0)||kn(this,n,o,r,s,!1))&&(a=e.points.copy(),kn(this,n,o,r,s,!0)?(a.Pc(i-1,new pt(n.x,(n.y+s.y)/2)),a.Pc(i+2,new pt(s.x,(n.y+s.y)/2))):(a.Pc(i-1,new pt((n.x+s.x)/2,n.y)),a.Pc(i+2,new pt((n.x+s.x)/2,s.y))),a.cb(i+1),a.cb(i),e.points=a,e.Lb())}}else s=pt.alloc(),_e.Qh(n.x,n.y,r.x,r.y,o.x,o.y,s)&&s.Ie(o)<this.resegmentingDistance*this.resegmentingDistance&&(n=e.points.copy(),n.cb(i),e.points=n,e.Lb()),pt.free(s)}t.Na(),this.transactionResult=this.name,t.R("LinkReshaped",this.adornedLink,this.Is)}this.stopTool()},wn.prototype.reshape=function(t){var e=this.adornedLink;e.Th();var i=this.handle.segmentIndex,n=this.Zv(this.handle);if(e.isOrthogonal)if(i===e.firstPickIndex+1)i=e.firstPickIndex+1,n===Pn?(e.L(i,e.i(i-1).x,t.y),e.L(i+1,e.i(i+2).x,t.y)):n===Sn&&(e.L(i,t.x,e.i(i-1).y),e.L(i+1,t.x,e.i(i+2).y));else if(i===e.lastPickIndex-1)i=e.lastPickIndex-1,n===Pn?(e.L(i-1,e.i(i-2).x,t.y),e.L(i,e.i(i+1).x,t.y)):n===Sn&&(e.L(i-1,t.x,e.i(i-2).y),e.L(i,t.x,e.i(i+1).y));else{n=i;var o=e.i(n),r=e.i(n-1),s=e.i(n+1);_e.A(r.x,o.x)&&_e.A(o.y,s.y)?(_e.A(r.x,e.i(n-2).x)&&!_e.A(r.y,e.i(n-2).y)?(e.m(n,t.x,r.y),i++,n++):e.L(n-1,t.x,r.y),_e.A(s.y,e.i(n+2).y)&&!_e.A(s.x,e.i(n+2).x)?e.m(n+1,s.x,t.y):e.L(n+1,s.x,t.y)):_e.A(r.y,o.y)&&_e.A(o.x,s.x)?(_e.A(r.y,e.i(n-2).y)&&!_e.A(r.x,e.i(n-2).x)?(e.m(n,r.x,t.y),i++,n++):e.L(n-1,r.x,t.y),_e.A(s.x,e.i(n+2).x)&&!_e.A(s.y,e.i(n+2).y)?e.m(n+1,t.x,s.y):e.L(n+1,t.x,s.y)):_e.A(r.x,o.x)&&_e.A(o.x,s.x)?(_e.A(r.x,e.i(n-2).x)&&!_e.A(r.y,e.i(n-2).y)?(e.m(n,t.x,r.y),i++,n++):e.L(n-1,t.x,r.y),_e.A(s.x,e.i(n+2).x)&&!_e.A(s.y,e.i(n+2).y)?e.m(n+1,t.x,s.y):e.L(n+1,t.x,s.y)):_e.A(r.y,o.y)&&_e.A(o.y,s.y)&&(_e.A(r.y,e.i(n-2).y)&&!_e.A(r.x,e.i(n-2).x)?(e.m(n,r.x,t.y),i++,n++):e.L(n-1,r.x,t.y),_e.A(s.y,e.i(n+2).y)&&!_e.A(s.x,e.i(n+2).x)?e.m(n+1,s.x,t.y):e.L(n+1,s.x,t.y)),e.L(i,t.x,t.y)}else e.L(i,t.x,t.y),n=e.fromNode,o=e.fromPort,null!==n&&(r=n.findVisibleNode(),null!==r&&r!==n&&(n=r,o=n.port)),1===i&&e.computeSpot(!0,o).nc()&&(r=o.da(ae,pt.alloc()),n=e.getLinkPointFromPoint(n,o,r,t,!0,pt.alloc()),e.L(0,n.x,n.y),pt.free(r),pt.free(n)),n=e.toNode,o=e.toPort,null!==n&&(r=n.findVisibleNode(),null!==r&&r!==n&&(n=r,o=n.port)),i===e.pointsCount-2&&e.computeSpot(!1,o).nc()&&(i=o.da(ae,pt.alloc()),t=e.getLinkPointFromPoint(n,o,i,t,!1,pt.alloc()),e.L(e.pointsCount-1,t.x,t.y),pt.free(i),pt.free(t));e.xf()},wn.prototype.computeReshape=function(t){var e=this.adornedLink,i=this.handle.segmentIndex;switch(this.Zv(this.handle)){case Nn:return t;case Pn:return new pt(e.i(i).x,t.y);case Sn:return new pt(t.x,e.i(i).y);default:case Mn:return e.i(i)}},d.Object.defineProperties(wn.prototype,{handleArchetype:{get:function(){return this.u},set:function(t){this.u=t}},midHandleArchetype:{get:function(){return this.I},set:function(t){this.I=t}},handle:{get:function(){return this.l},set:function(t){if(null!==t&&!(t.part instanceof Qu))throw Error("new handle is not in an Adornment: "+t);this.l=t}},adornedLink:{get:function(){return this.wu}},resegmentingDistance:{get:function(){return this.T},set:function(t){this.T=t}},originalPoint:{get:function(){return this.Ix}},originalPoints:{get:function(){return this.Is}}}),wn.prototype.setReshapingBehavior=wn.prototype.Xm,wn.prototype.getReshapingBehavior=wn.prototype.Zv;var Mn=new U(wn,"None",0),Sn=new U(wn,"Horizontal",1),Pn=new U(wn,"Vertical",2),Nn=new U(wn,"All",3);function Cn(){ji.call(this),this.name="Resizing",this.fg=new Bt(1,1).freeze(),this.eg=new Bt(9999,9999).freeze(),this.Qg=new Bt(NaN,NaN).freeze(),this.I=!1,this.T=!0,this.ie=null;var t=new Nl;t.alignmentFocus=ae,t.figure="Rectangle",t.desiredSize=St,t.fill="lightblue",t.stroke="dodgerblue",t.strokeWidth=1,t.cursor="pointer",this.u=t,this.l=null,this.Hs=new pt,this.Gx=new Bt,this.qp=new pt,this.Nu=new Bt(0,0),this.Mu=new Bt(1/0,1/0),this.Lu=new Bt(1,1)}function Tn(){ji.call(this),this.name="Rotating",this.La=45,this.Ka=2,this.qp=new pt,this.ie=null;var t=new Nl;t.figure="Ellipse",t.desiredSize=Pt,t.fill="lightblue",t.stroke="dodgerblue",t.strokeWidth=1,t.cursor="pointer",this.u=t,this.l=null,this.Fx=0,this.Ps=new pt(NaN,NaN),this.I=0,this.T=50}function An(){ji.call(this),this.name="ClickSelecting"}function Ln(){ji.call(this),this.name="Action",this.Xk=null}function jn(){ji.call(this),this.name="ClickCreating",this.Aj=null,this.u=!0,this.l=!1,this.xx=new pt(0,0)}function On(){ji.call(this),this.name="DragSelecting",this.pl=175,this.u=!1;var t=new Lu;t.layerName="Tool",t.selectable=!1;var e=new Nl;e.name="SHAPE",e.figure="Rectangle",e.fill=null,e.stroke="magenta",t.add(e),this.l=t}function Dn(){ji.call(this),this.name="Panning",this.kv=new pt,this.kz=new pt,this.Pg=!1;var t=this;this.Lx=function(){var e=t.diagram;null!==e&&e.removeEventListener(y.document,"scroll",t.Lx,!1),t.stopTool()}}function Fn(){this.T=this.I=this.l=this.u=null}function Bn(t,e,i){this.text=t,this.by=e,this.visible=i}function In(){ji.call(this),this.name="ContextMenu",this.u=this.Cu=this.l=null,this.Cx=new pt,this.Du=null,this.Yu=!1;var t=this;this.wv=function(){t.stopTool()}}function En(t){var e=new Fn;e.show=function(t,e,i){i.showDefaultContextMenu()},e.hide=function(t,e){e.hideDefaultContextMenu()},Yn=e,t.wv=function(){t.stopTool()},e=b("div");var i=b("div");e.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px",i.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";var n=b("style");y.document.getElementsByTagName("head")[0].appendChild(n),n.sheet.insertRule(".goCXul { list-style: none; }",0),n.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),n.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),n=t.diagram,null!==n&&(n.addEventListener(e,"contextmenu",Rn,!1),n.addEventListener(e,"selectstart",Rn,!1),n.addEventListener(i,"contextmenu",Rn,!1)),e.className="goCXforeground",i.className="goCXbackground",y.document.body&&(y.document.body.appendChild(e),y.document.body.appendChild(i)),Un=e,qn=i,Xn=!0}function Rn(t){return t.preventDefault(),!1}function zn(t){var e=t.diagram;if(t.isActive){var i=t.currentContextMenu;if(null!==i){if(!(i instanceof Fn)){var n=e.Vb(e.lastInput.documentPoint,null,null);null!==n&&n.Gg(i)&&t.standardMouseClick(null,null)}t.stopTool(),t.canStart()&&(e.currentTool=t,t.doMouseUp())}}else t.canStart()&&(Vn(t,!0),t.isActive||t.stopTool())}function Vn(t,e,i){if(void 0===i&&(i=null),!t.Yu&&(t.Yu=!0,e&&t.standardMouseSelect(),e=t.standardMouseClick(),t.Yu=!1,!e)){if(t.isActive=!0,e=Yn,null===i&&(i=t.findObjectWithContextMenu()),null!==i){var n=i.contextMenu;null!==n?(t.currentObject=i instanceof ca?i:null,t.showContextMenu(n,t.currentObject)):null!==e&&t.showContextMenu(e,t.currentObject)}else null!==e&&t.showContextMenu(e,null);t.currentContextMenu instanceof Qu&&!t.currentContextMenu.visible&&t.stopTool()}}function Gn(t){var e=new et;return e.add(new Bn("Copy",(function(t){t.commandHandler.copySelection()}),(function(t){return t.commandHandler.canCopySelection()}))),e.add(new Bn("Cut",(function(t){t.commandHandler.cutSelection()}),(function(t){return t.commandHandler.canCutSelection()}))),e.add(new Bn("Delete",(function(t){t.commandHandler.deleteSelection()}),(function(t){return t.commandHandler.canDeleteSelection()}))),e.add(new Bn("Paste",(function(e){e.commandHandler.pasteSelection(t.mouseDownPoint)}),(function(e){return e.commandHandler.canPasteSelection(t.mouseDownPoint)}))),e.add(new Bn("Select All",(function(t){t.commandHandler.selectAll()}),(function(t){return t.commandHandler.canSelectAll()}))),e.add(new Bn("Undo",(function(t){t.commandHandler.undo()}),(function(t){return t.commandHandler.canUndo()}))),e.add(new Bn("Redo",(function(t){t.commandHandler.redo()}),(function(t){return t.commandHandler.canRedo()}))),e.add(new Bn("Scroll To Part",(function(t){t.commandHandler.scrollToPart()}),(function(t){return t.commandHandler.canScrollToPart()}))),e.add(new Bn("Zoom To Fit",(function(t){t.commandHandler.zoomToFit()}),(function(t){return t.commandHandler.canZoomToFit()}))),e.add(new Bn("Reset Zoom",(function(t){t.commandHandler.resetZoom()}),(function(t){return t.commandHandler.canResetZoom()}))),e.add(new Bn("Group Selection",(function(t){t.commandHandler.groupSelection()}),(function(t){return t.commandHandler.canGroupSelection()}))),e.add(new Bn("Ungroup Selection",(function(t){t.commandHandler.ungroupSelection()}),(function(t){return t.commandHandler.canUngroupSelection()}))),e.add(new Bn("Edit Text",(function(t){t.commandHandler.editTextBlock()}),(function(t){return t.commandHandler.canEditTextBlock()}))),e}wn.className="LinkReshapingTool",wn.None=Mn,wn.Horizontal=Sn,wn.Vertical=Pn,wn.All=Nn,I("linkReshapingTool",(function(){return this.findTool("LinkReshaping")}),(function(t){this.Ya("LinkReshaping",t,this.mouseDownTools)})),f(Cn,ji),Cn.prototype.updateAdornments=function(t){if(!(null===t||t instanceof Nc)){if(t.isSelected&&!this.diagram.isReadOnly){var e=t.resizeObject,i=t.wk(this.name);if(null!==e&&t.canResize()&&t.actualBounds.s()&&t.isVisible()&&e.actualBounds.s()&&e.Gf()&&(null!==i&&i.adornedObject===e||(i=this.makeAdornment(e)),null!==i))return e=e.lj(),Uu(t)&&this.updateResizeHandles(i,e),void t.Gh(this.name,i)}t.Hf(this.name)}},Cn.prototype.makeAdornment=function(t){var e=t.part.resizeAdornmentTemplate;if(null===e){e=new Qu,e.type=Uh.Spot,e.locationSpot=ae;var i=new Pc;i.isPanelMain=!0,e.add(i),e.add(this.makeHandle(t,ne)),e.add(this.makeHandle(t,re)),e.add(this.makeHandle(t,ce)),e.add(this.makeHandle(t,le)),e.add(this.makeHandle(t,Oe)),e.add(this.makeHandle(t,Fe)),e.add(this.makeHandle(t,Be)),e.add(this.makeHandle(t,De))}else if(ul(e),e=e.copy(),null===e)return null;return e.adornedObject=t,e},Cn.prototype.makeHandle=function(t,e){return t=this.handleArchetype,null===t?null:(t=t.copy(),t.alignment=e,t)},Cn.prototype.updateResizeHandles=function(t,e){if(null!==t)if(!t.alignment.Mb()&&("pointer"===t.cursor||0<t.cursor.indexOf("resize")))t:{var i=t.alignment;if(i.nc()&&(i=ae),0>=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 Uh)for(t=t.elements;t.next();)this.updateResizeHandles(t.value,e)},Cn.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)},Cn.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.Bc(),this.va(this.name),this.Hs.set(this.adornedObject.da(this.handle.alignment.mw())),this.qp.set(this.adornedObject.part.location),this.Gx.set(this.adornedObject.desiredSize),this.Lu=this.computeCellSize(),this.Nu=this.computeMinSize(),this.Mu=this.computeMaxSize(),this.isActive=!0))},Cn.prototype.doDeactivate=function(){var t=this.diagram;this.Jg(),this.ie=this.handle=null,this.isActive=t.isMouseCaptured=!1},Cn.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},Cn.prototype.doMouseMove=function(){var t=this.diagram;if(this.isActive){var e=this.Nu,i=this.Mu,n=this.Lu,o=this.adornedObject.Mt(t.lastInput.documentPoint,pt.alloc()),r=this.computeReshape();e=this.computeResize(o,this.handle.alignment,e,i,n,r),this.resize(e),t.hd(),pt.free(o)}},Cn.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){var e=this.Nu,i=this.Mu,n=this.Lu,o=this.adornedObject.Mt(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.Na(),this.transactionResult=this.name,t.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},Cn.prototype.resize=function(t){var e=this.diagram,i=this.adornedObject;if(null!==i){if(i.desiredSize=t.size,t=i.part,t.Ta(),i=i.da(this.handle.alignment.mw()),t instanceof bc){var n=new et;if(n.add(t),!this.dragsMembers&&null===t.placeholder){var o=new ea;o.dragsMembers=!1}e.moveParts(n,this.oppositePoint.copy().ge(i),!0,o)}else t.location=t.location.copy().ge(i).add(this.oppositePoint);e.hd()}},Cn.prototype.computeResize=function(t,e,i,n,o,r){e.nc()&&(e=ae);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(),_e.Gq(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},Cn.prototype.computeReshape=function(){var t=qs;return this.adornedObject instanceof Nl&&(t=Tl(this.adornedObject)),!(t===Us||this.diagram.lastInput.shift)},Cn.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},Cn.prototype.computeMaxSize=function(){var t=this.adornedObject.maxSize.copy(),e=this.maxSize;return!isNaN(e.width)&&e.width<t.width&&(t.width=e.width),!isNaN(e.height)&&e.height<t.height&&(t.height=e.height),t},Cn.prototype.computeCellSize=function(){var t=new Bt(NaN,NaN),e=this.adornedObject.part;return null!==e&&(e=e.resizeCellSize,!isNaN(e.width)&&0<e.width&&(t.width=e.width),!isNaN(e.height)&&0<e.height&&(t.height=e.height)),e=this.cellSize,isNaN(t.width)&&!isNaN(e.width)&&0<e.width&&(t.width=e.width),isNaN(t.height)&&!isNaN(e.height)&&0<e.height&&(t.height=e.height),e=this.diagram,(isNaN(t.width)||isNaN(t.height))&&e&&(e=e.grid,null!==e&&e.visible&&this.isGridSnapEnabled&&(e=e.gridCellSize,isNaN(t.width)&&!isNaN(e.width)&&0<e.width&&(t.width=e.width),isNaN(t.height)&&!isNaN(e.height)&&0<e.height&&(t.height=e.height))),(isNaN(t.width)||0===t.width||1/0===t.width)&&(t.width=1),(isNaN(t.height)||0===t.height||1/0===t.height)&&(t.height=1),t},d.Object.defineProperties(Cn.prototype,{handleArchetype:{get:function(){return this.u},set:function(t){this.u=t}},handle:{get:function(){return this.l},set:function(t){if(null!==t&&!(t.part instanceof Qu))throw Error("new handle is not in an Adornment: "+t);this.l=t}},adornedObject:{get:function(){return this.ie},set:function(t){if(null!==t&&t.part instanceof Qu)throw Error("new handle must not be in an Adornment: "+t);this.ie=t}},minSize:{get:function(){return this.fg},set:function(t){if(!this.fg.w(t)){var e=t.width;isNaN(e)&&(e=0),t=t.height,isNaN(t)&&(t=0),this.fg.h(e,t)}}},maxSize:{get:function(){return this.eg},set:function(t){if(!this.eg.w(t)){var e=t.width;isNaN(e)&&(e=1/0),t=t.height,isNaN(t)&&(t=1/0),this.eg.h(e,t)}}},cellSize:{get:function(){return this.Qg},set:function(t){this.Qg.w(t)||this.Qg.assign(t)}},isGridSnapEnabled:{get:function(){return this.I},set:function(t){this.I=t}},dragsMembers:{get:function(){return this.T},set:function(t){this.T=t}},oppositePoint:{get:function(){return this.Hs},set:function(t){this.Hs.w(t)||this.Hs.assign(t)}},originalDesiredSize:{get:function(){return this.Gx}},originalLocation:{get:function(){return this.qp}}}),Cn.className="ResizingTool",I("resizingTool",(function(){return this.findTool("Resizing")}),(function(t){this.Ya("Resizing",t,this.mouseDownTools)})),f(Tn,ji),Tn.prototype.updateAdornments=function(t){if(null!==t){if(t.Ph()){var e=t.rotateObject;if(e===t||e===t.path||e.isPanelMain)return}if(t.isSelected&&!this.diagram.isReadOnly&&(e=t.rotateObject,null!==e&&t.canRotate()&&t.actualBounds.s()&&t.isVisible()&&e.actualBounds.s()&&e.Gf())){var i=t.wk(this.name);if(null!==i&&i.adornedObject===e||(i=this.makeAdornment(e)),null!==i)return i.angle=e.lj(),null===i.placeholder&&(i.location=this.computeAdornmentLocation(e)),void t.Gh(this.name,i)}t.Hf(this.name)}},Tn.prototype.makeAdornment=function(t){var e=t.part.rotateAdornmentTemplate;if(null===e){e=new Qu,e.type=Uh.Position,e.locationSpot=ae;var i=this.handleArchetype;null!==i&&e.add(i.copy())}else if(ul(e),e=e.copy(),null===e)return null;return e.adornedObject=t,e},Tn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(t.isReadOnly||!t.allowRotate||!t.lastInput.left)&&null!==this.findToolHandleAt(t.firstInput.documentPoint,this.name)},Tn.prototype.doActivate=function(){var t=this.diagram;if(null===this.adornedObject){if(null===this.handle&&(this.handle=this.findToolHandleAt(t.firstInput.documentPoint,this.name)),null===this.handle)return;this.adornedObject=this.handle.part.adornedObject}null!==this.adornedObject&&(t.isMouseCaptured=!0,t.delaysLayout=!0,this.va(this.name),this.Fx=this.adornedObject.angle,this.Ps=this.computeRotationPoint(this.adornedObject),this.qp=this.adornedObject.part.location.copy(),this.isActive=!0)},Tn.prototype.computeRotationPoint=function(t){var e=t.part,i=e.locationObject;return e.rotationSpot.kb()?t.da(e.rotationSpot):t===e||t===i?i.da(e.locationSpot):t.da(ae)},Tn.prototype.computeAdornmentLocation=function(t){var e=this.rotationPoint;e.s()||(e=this.computeRotationPoint(t)),e=t.Mt(e);var i=this.handleAngle;0>i?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.da(e)},Tn.prototype.doDeactivate=function(){var t=this.diagram;this.Jg(),this.ie=this.handle=null,this.Ps=new pt(NaN,NaN),this.isActive=t.isMouseCaptured=!1},Tn.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},Tn.prototype.doMouseMove=function(){var t=this.diagram;this.isActive&&(t=this.computeRotate(t.lastInput.documentPoint),this.rotate(t))},Tn.prototype.doMouseUp=function(){var t=this.diagram;if(this.isActive){t.delaysLayout=!1;var e=this.computeRotate(t.lastInput.documentPoint);this.rotate(e),t.Na(),this.transactionResult=this.name,t.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()},Tn.prototype.rotate=function(t){var e=this.adornedObject;if(null!==e){e.angle=t,e=e.part,e.Ta();var i=e.locationObject,n=e.rotateObject;(i===n||i.Gg(n))&&(i=this.qp.copy(),e.location=i.ge(this.rotationPoint).rotate(t-this.originalAngle).add(this.rotationPoint)),this.diagram.hd()}},Tn.prototype.computeRotate=function(t){t=this.rotationPoint.Pa(t)-this.handleAngle;var e=this.adornedObject.panel;null!==e&&(t-=e.lj()),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&&0<e&&0<i&&(t%e<i?t=Math.floor(t/e)*e:t%e>e-i&&(t=(Math.floor(t/e)+1)*e)),360<=t?t-=360:0>t&&(t+=360),t},d.Object.defineProperties(Tn.prototype,{handleArchetype:{get:function(){return this.u},set:function(t){this.u=t}},handle:{get:function(){return this.l},set:function(t){if(null!==t&&!(t.part instanceof Qu))throw Error("new handle is not in an Adornment: "+t);this.l=t}},adornedObject:{get:function(){return this.ie},set:function(t){if(null!==t&&t.part instanceof Qu)throw Error("new handle must not be in an Adornment: "+t);this.ie=t}},snapAngleMultiple:{get:function(){return this.La},set:function(t){this.La=t}},snapAngleEpsilon:{get:function(){return this.Ka},set:function(t){this.Ka=t}},originalAngle:{get:function(){return this.Fx}},rotationPoint:{get:function(){return this.Ps},set:function(t){this.Ps=t.copy()}},handleAngle:{get:function(){return this.I},set:function(t){this.I=t}},handleDistance:{get:function(){return this.T},set:function(t){this.T=t}}}),Tn.className="RotatingTool",I("rotatingTool",(function(){return this.findTool("Rotating")}),(function(t){this.Ya("Rotating",t,this.mouseDownTools)})),f(An,ji),An.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},An.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},An.className="ClickSelectingTool",f(Ln,ji),Ln.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram,e=t.lastInput,i=t.Vb(e.documentPoint,(function(t){for(;null!==t.panel&&!t.isActionable;)t=t.panel;return t}));return null!==i&&(!!i.isActionable&&(this.Xk=i,t.Ej=t.Vb(e.documentPoint,null,null),!0))},Ln.prototype.doMouseDown=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.Xk;null!==e&&(t.targetObject=e,null!==e.actionDown&&e.actionDown(t,e))}else this.canStart()&&this.doActivate()},Ln.prototype.doMouseMove=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.Xk;null!==e&&(t.targetObject=e,null!==e.actionMove&&e.actionMove(t,e))}},Ln.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram.lastInput,e=this.Xk;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()},Ln.prototype.doCancel=function(){var t=this.diagram.lastInput,e=this.Xk;null!==e&&(t.targetObject=e,null!==e.actionCancel&&e.actionCancel(t,e),this.stopTool())},Ln.prototype.doStop=function(){this.Xk=null},Ln.className="ActionTool",f(jn,ji),jn.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.xx=t.lastInput.viewPoint.copy()),2!==t.lastInput.clickCount||this.isBeyondDragSize(this.xx))return!1}else if(1!==t.lastInput.clickCount)return!1;return t.currentTool===this||null===t.zm(t.lastInput.documentPoint,!0)},jn.prototype.doMouseUp=function(){var t=this.diagram;this.isActive&&this.insertPart(t.lastInput.documentPoint),this.stopTool()},jn.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.va(this.name),i instanceof Lu)i.Nc()&&(ul(i),n=i.copy(),null!==n&&e.add(n));else if(null!==i){var o=e.model.copyNodeData(i);N(o)&&(e.model.uf(o),n=e.zc(o))}if(null!==n){var r=pt.allocAt(t.x,t.y);this.isGridSnapEnabled&&Rr(this.diagram,n,t,r),n.location=r,e.allowSelect&&(e.clearSelection(!0),n.isSelected=!0),pt.free(r)}e.Na(),this.transactionResult=this.name,e.R("PartCreated",n)}finally{this.Jg(),e.R("ChangedSelection",e.selection)}return n},d.Object.defineProperties(jn.prototype,{archetypeNodeData:{get:function(){return this.Aj},set:function(t){this.Aj=t}},isDoubleClick:{get:function(){return this.u},set:function(t){this.u=t}},isGridSnapEnabled:{get:function(){return this.l},set:function(t){this.l=t}}}),jn.className="ClickCreatingTool",f(On,ji),On.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.timestamp<this.delay||null!==t.zm(e.documentPoint,!0)))},On.prototype.doActivate=function(){var t=this.diagram;this.isActive=!0,t.isMouseCaptured=!0,t.skipsUndoManager=!0,t.add(this.box),this.doMouseMove()},On.prototype.doDeactivate=function(){var t=this.diagram;t.Jf(),t.remove(this.box),t.skipsUndoManager=!1,this.isActive=t.isMouseCaptured=!1},On.prototype.doMouseMove=function(){var t=this.diagram;if(this.isActive&&null!==this.box){var e=this.computeBoxBounds(),i=this.box.bb("SHAPE");null===i&&(i=this.box.tb());var n=Bt.alloc().h(e.width,e.height);e=pt.allocAt(e.x,e.y),i.desiredSize=n,this.box.position=e,Bt.free(n),pt.free(e),(t.allowHorizontalScroll||t.allowVerticalScroll)&&t.Et(t.lastInput.viewPoint)}},On.prototype.doMouseUp=function(){if(this.isActive){var t=this.diagram;t.remove(this.box);try{t.currentCursor="wait",t.R("ChangingSelection",t.selection),this.selectInRect(this.computeBoxBounds()),t.R("ChangedSelection",t.selection)}finally{t.currentCursor=""}}this.stopTool()},On.prototype.computeBoxBounds=function(){var t=this.diagram;return new zt(t.firstInput.documentPoint,t.lastInput.documentPoint)},On.prototype.selectInRect=function(t){var e=this.diagram,i=e.lastInput;if(t=e.ty(t,this.isPartialInclusion),Y?i.meta:i.control)if(i.shift)for(t=t.iterator;t.next();)e=t.value,e.isSelected&&(e.isSelected=!1);else for(t=t.iterator;t.next();)e=t.value,e.isSelected=!e.isSelected;else if(i.shift)for(t=t.iterator;t.next();)e=t.value,e.isSelected||(e.isSelected=!0);else{for(i=new et,e=e.selection.iterator;e.next();){var n=e.value;t.contains(n)||i.add(n)}for(e=i.iterator;e.next();)e.value.isSelected=!1;for(t=t.iterator;t.next();)e=t.value,e.isSelected||(e.isSelected=!0)}},d.Object.defineProperties(On.prototype,{delay:{get:function(){return this.pl},set:function(t){this.pl=t}},isPartialInclusion:{get:function(){return this.u},set:function(t){this.u=t}},box:{get:function(){return this.l},set:function(t){this.l=t}}}),On.className="DragSelectingTool",f(Dn,ji),Dn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(!t.allowHorizontalScroll&&!t.allowVerticalScroll||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize())},Dn.prototype.doActivate=function(){var t=this.diagram;this.Pg?(t.lastInput.bubbles=!0,t.addEventListener(y.document,"scroll",this.Lx,!1)):(t.currentCursor="move",t.isMouseCaptured=!0,this.kv.assign(t.position)),this.isActive=!0},Dn.prototype.doDeactivate=function(){var t=this.diagram;t.currentCursor="",this.isActive=t.isMouseCaptured=!1},Dn.prototype.doCancel=function(){var t=this.diagram;t.position=this.kv,t.isMouseCaptured=!1,this.stopTool()},Dn.prototype.doMouseMove=function(){this.move()},Dn.prototype.doMouseUp=function(){this.move(),this.stopTool()},Dn.prototype.move=function(){var t=this.diagram;if(this.isActive&&t)if(this.Pg)t.lastInput.bubbles=!0;else{var e=t.position,i=t.firstInput.documentPoint,n=t.lastInput.documentPoint,o=e.x+i.x-n.x;i=e.y+i.y-n.y,t.allowHorizontalScroll||(o=e.x),t.allowVerticalScroll||(i=e.y),t.position=this.kz.h(o,i)}},d.Object.defineProperties(Dn.prototype,{bubbles:{get:function(){return this.Pg},set:function(t){this.Pg=t}},originalPosition:{get:function(){return this.kv}}}),Dn.className="PanningTool",I("clickCreatingTool",(function(){return this.findTool("ClickCreating")}),(function(t){this.Ya("ClickCreating",t,this.mouseUpTools)})),I("clickSelectingTool",(function(){return this.findTool("ClickSelecting")}),(function(t){this.Ya("ClickSelecting",t,this.mouseUpTools)})),I("panningTool",(function(){return this.findTool("Panning")}),(function(t){this.Ya("Panning",t,this.mouseMoveTools)})),I("dragSelectingTool",(function(){return this.findTool("DragSelecting")}),(function(t){this.Ya("DragSelecting",t,this.mouseMoveTools)})),I("actionTool",(function(){return this.findTool("Action")}),(function(t){this.Ya("Action",t,this.mouseDownTools)})),d.Object.defineProperties(Fn.prototype,{mainElement:{get:function(){return this.I},set:function(t){this.I=t}},show:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},hide:{get:function(){return this.l},set:function(t){this.l!==t&&(this.l=t)}},valueFunction:{get:function(){return this.T},set:function(t){this.T=t}}}),Fn.className="HTMLInfo",Bn.className="ContextMenuButtonInfo",f(In,ji),In.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;return!(this.isBeyondDragSize()||!t.lastInput.right||1<t.lastInput.clickCount)&&!!(t.lastInput.isTouchEvent&&null!==this.defaultTouchContextMenu||null!==this.findObjectWithContextMenu())},In.prototype.doStart=function(){this.Cx.set(this.diagram.firstInput.documentPoint)},In.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},In.prototype.findObjectWithContextMenu=function(t){void 0===t&&(t=null);var e=this.diagram,i=e.lastInput,n=null;if(t instanceof Ko||(n=t instanceof ca?t:e.Vb(i.documentPoint,null,(function(t){return!t.layer.isTemporary}))),null!==n){for(t=n;null!==t;){if(null!==t.contextMenu)return t;t=t.panel}if(e.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return n.part}else if(null!==e.contextMenu)return e;return null},In.prototype.doActivate=function(){},In.prototype.doMouseDown=function(){if(ji.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof Qu){var t=this.diagram.toolManager.findTool("Action");null!==t&&t.canStart()&&(t.doActivate(),t.doMouseDown(),t.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&zn(this)},In.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Qu){var t=this.diagram.toolManager.findTool("Action");null!==t&&t.canStart()&&(t.doActivate(),t.doCancel(),t.doDeactivate())}zn(this)},In.prototype.doMouseMove=function(){var t=this.diagram.toolManager.findTool("Action");null!==t&&t.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},In.prototype.showContextMenu=function(t,e){var i=this.diagram;if(t!==this.currentContextMenu&&this.hideContextMenu(),t instanceof Qu){t.layerName="Tool",t.selectable=!1,t.scale=1/i.scale,t.category=this.name,null!==t.placeholder&&(t.placeholder.scale=i.scale);var n=t.diagram;null!==n&&n!==i&&n.remove(t),i.add(t),null!==e?t.adornedObject=e:t.data=i.model,t.Ta(),this.positionContextMenu(t,e)}else t instanceof Fn&&t.show(e,i,this);this.currentContextMenu=t},In.prototype.positionContextMenu=function(t){if(null===t.placeholder){var e=this.diagram,i=e.lastInput.documentPoint.copy(),n=t.measuredBounds,o=e.viewportBounds;e.lastInput.isTouchEvent&&(i.x-=n.width),i.x+n.width>o.right&&(i.x-=n.width+5/e.scale),i.x<o.x&&(i.x=o.x),i.y+n.height>o.bottom&&(i.y-=n.height+5/e.scale),i.y<o.y&&(i.y=o.y),t.position=i}},In.prototype.hideContextMenu=function(){var t=this.diagram,e=this.currentContextMenu;null!==e&&(e instanceof Qu?(t.remove(e),null!==this.Cu&&this.Cu.Hf(e.category),e.data=null,e.adornedObject=null):e instanceof Fn&&(null!==e.hide?e.hide(t,this):null!==e.mainElement&&(e.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())},In.prototype.showDefaultContextMenu=function(){var t=this.diagram;null===this.Du&&(this.Du=Gn(this)),Un.innerHTML="",qn.addEventListener("click",this.wv,!1);var e=this,i=b("ul");i.className="goCXul",Un.appendChild(i),i.innerHTML="";for(var n=this.Du.iterator;n.next();){var o=n.value,r=o.visible;if("function"===typeof o.by&&("function"!==typeof r||r(t))){r=b("li"),r.className="goCXli";var s=b("a");s.className="goCXa",s.href="#",s.dz=o.by,s.addEventListener("click",(function(i){return this.dz(t),e.stopTool(),i.preventDefault(),!1}),!1),s.textContent=o.text,r.appendChild(s),i.appendChild(r)}}Un.style.display="block",qn.style.display="block"},In.prototype.hideDefaultContextMenu=function(){if(null!==this.currentContextMenu&&this.currentContextMenu===Yn){Un.style.display="none",qn.style.display="none";var t=this.diagram;null!==t&&t.removeEventListener(qn,"click",this.wv,!1),this.currentContextMenu=null}},d.Object.defineProperties(In.prototype,{currentContextMenu:{get:function(){return this.l},set:function(t){this.l=t,this.Cu=t instanceof Qu?t.adornedPart:null}},defaultTouchContextMenu:{get:function(){return!1===Xn&&null===Yn&&ys&&En(this),Yn},set:function(t){null===t&&(Xn=!0),Yn=t}},currentObject:{get:function(){return this.u},set:function(t){this.u=t}},mouseDownPoint:{get:function(){return this.Cx}}});var Yn=null,Xn=!1,qn=null,Un=null;function Kn(){ji.call(this),this.name="TextEditing",this.zh=new Il,this.La=null,this.Ka=to,this.Wi=null,this.ia=io,this.I=1,this.T=!0,this.u=null,this.l=new Fn,this.Hu=null,Hn(this,this.l)}function Hn(t,e){if(ys){var i=b("textarea");t.Hu=i,i.addEventListener("input",(function(){if(null!==t.textBlock){var e=t.Jy(this.value);this.style.width=20+e.measuredBounds.width*this.eB+"px",this.rows=e.lineCount}}),!1),i.addEventListener("keydown",(function(e){if(null!==t.textBlock){var i=e.key;"Enter"===i?(!1===t.textBlock.isMultiline&&e.preventDefault(),t.acceptText(Zn)):"Tab"===i?(t.acceptText(Jn),e.preventDefault()):"Escape"===i&&(t.doCancel(),null!==t.diagram&&t.diagram.doFocus())}}),!1),i.addEventListener("focus",(function(){if(null!==t.currentTextEditor&&t.state!==io){var e=t.Hu;t.ia===no&&(t.ia=oo),"function"===typeof e.select&&t.selectsTextOnActivate&&(e.select(),e.setSelectionRange(0,9999))}}),!1),i.addEventListener("blur",(function(){if(null!==t.currentTextEditor&&t.state!==io){var e=t.Hu;"function"===typeof e.focus&&e.focus(),"function"===typeof e.select&&t.selectsTextOnActivate&&(e.select(),e.setSelectionRange(0,9999))}}),!1),e.valueFunction=function(){return i.value},e.mainElement=i,e.show=function(t,e,n){if(t instanceof Il&&n instanceof Kn)if(n.state===so)i.style.border="3px solid red",i.focus();else{var o=t.da(ae),r=e.position,s=e.scale,a=t.Af()*s;a<n.minimumEditorScale&&(a=n.minimumEditorScale);var h=t.naturalBounds.width*a+6,l=t.naturalBounds.height*a+2,u=(o.x-r.x)*s;o=(o.y-r.y)*s,i.value=t.text,e.div.style.font=t.font,i.style.position="absolute",i.style.zIndex="100",i.style.font="inherit",i.style.fontSize=100*a+"%",i.style.lineHeight="normal",i.style.width=h+"px",i.style.left=(u-h/2|0)-1+"px",i.style.top=(o-l/2|0)-1+"px",i.style.textAlign=t.textAlign,i.style.margin="0",i.style.padding="1px",i.style.border="0",i.style.outline="none",i.style.whiteSpace="pre-wrap",i.style.overflow="hidden",i.rows=t.lineCount,i.eB=a,i.className="goTXarea",e.div.appendChild(i),i.focus(),n.selectsTextOnActivate&&(i.select(),i.setSelectionRange(0,9999))}},e.hide=function(t){t.div.removeChild(i)}}}function _n(t){var e=t.textBlock,i=t.diagram,n=t.currentTextEditor;if(null!==e&&null!==n){var o=e.text,r="";null!==n.valueFunction&&(r=n.valueFunction()),t.isValidText(e,o,r)?(t.va(t.name),t.ia=ao,t.transactionResult=t.name,e.text=r,t.doSuccess(o,r),null!==i&&i.R("TextEdited",e,o),t.Jg(),t.stopTool(),null!==i&&i.doFocus()):(t.ia=so,t.doError(o,r))}}In.className="ContextMenuTool",I("contextMenuTool",(function(){return this.findTool("ContextMenu")}),(function(t){this.Ya("ContextMenu",t,this.mouseUpTools)})),f(Kn,ji),Kn.prototype.canStart=function(){if(!this.isEnabled)return!1;var t=this.diagram;if(null===t||t.isReadOnly||ho&&ho!==this&&(ho.acceptText($n),ho&&ho!==this)||!t.lastInput.left||this.isBeyondDragSize())return!1;var e=t.Vb(t.lastInput.documentPoint);return!!(null!==e&&e instanceof Il&&e.editable&&e.part.canEdit())&&(e=e.part,!(null===e||this.starting===to&&!e.isSelected||this.starting===eo&&2>t.lastInput.clickCount))},Kn.prototype.doStart=function(){ho=this,null!==this.textBlock&&this.doActivate()},Kn.prototype.doActivate=function(){if(!this.isActive){var t=this.diagram;if(null!==t){var e=this.textBlock;if(null===e&&(e=t.Vb(t.lastInput.documentPoint)),null!==e&&e instanceof Il&&(this.textBlock=e,null!==e.part)){this.isActive=!0,this.ia=no;var i=this.defaultTextEditor;null!==e.textEditor&&(i=e.textEditor),this.zh=this.textBlock.copy();var n=new zt(this.textBlock.da(ne),this.textBlock.da(ce));t.Aw(n),i.show(e,t,this),this.currentTextEditor=i}}}},Kn.prototype.doCancel=function(){this.stopTool()},Kn.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Kn.prototype.doMouseDown=function(){this.isActive&&this.acceptText($n)},Kn.prototype.acceptText=function(t){switch(t){case $n:this.ia===ao?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():this.ia!==no&&this.ia!==so&&this.ia!==oo||(this.ia=ro,_n(this));break;case Wn:case Zn:case Jn:Zn===t&&!0===this.textBlock.isMultiline||this.ia!==no&&this.ia!==so&&this.ia!==oo||(this.ia=ro,_n(this))}},Kn.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)},Kn.prototype.doSuccess=function(t,e){var i=this.textBlock;null!==i.textEdited&&i.textEdited(i,t,e)},Kn.prototype.doDeactivate=function(){var t=this.diagram;null!==t&&(this.ia=io,this.textBlock=null,null!==this.currentTextEditor&&this.currentTextEditor.hide(t,this),this.isActive=!1)},Kn.prototype.doStop=function(){ho=null},Kn.prototype.isValidText=function(t,e,i){var n=this.textValidation;return!(null!==n&&!n(t,e,i))&&(n=t.textValidation,!(null!==n&&!n(t,e,i)))},Kn.prototype.Jy=function(t){var e=this.zh;return e.text=t,e.measure(this.textBlock.Ei,1/0),e},d.Object.defineProperties(Kn.prototype,{textBlock:{get:function(){return this.La},set:function(t){this.La=t}},currentTextEditor:{get:function(){return this.u},set:function(t){this.u=t}},defaultTextEditor:{get:function(){return this.l},set:function(t){this.l=t}},starting:{get:function(){return this.Ka},set:function(t){this.Ka=t}},textValidation:{get:function(){return this.Wi},set:function(t){this.Wi=t}},minimumEditorScale:{get:function(){return this.I},set:function(t){this.I=t}},selectsTextOnActivate:{get:function(){return this.T},set:function(t){this.T=t}},state:{get:function(){return this.ia},set:function(t){this.ia!==t&&(this.ia=t)}}}),Kn.prototype.measureTemporaryTextBlock=Kn.prototype.Jy;var Wn=new U(Kn,"LostFocus",0),$n=new U(Kn,"MouseDown",1),Jn=new U(Kn,"Tab",2),Zn=new U(Kn,"Enter",3),Qn=new U(Kn,"SingleClick",0),to=new U(Kn,"SingleClickSelected",1),eo=new U(Kn,"DoubleClick",2),io=new U(Kn,"StateNone",0),no=new U(Kn,"StateActive",1),oo=new U(Kn,"StateEditing",2),ro=new U(Kn,"StateValidating",3),so=new U(Kn,"StateInvalid",4),ao=new U(Kn,"StateValidated",5),ho=null;function lo(){So||(ko(),So=!0),this.C=fs,this.zl=this.ef=this.sc=this.ps=this.jc=!1,this.Qx=!0,this.Al=Po,this.tn=!1,this.zi=this.md=!0,this.Yg=600,this.ox=this.Px=!1,this.Re=new nt,this.Rd=new To,this.Rd.Uc=this,this.yj=new nt,this.tv=new nt,this.ot=new nt,this.$l=new nt}function uo(t,e){co(t,e)&&(t.ef=!0)}function co(t,e){return!(!t.md||!t.canStart(e))&&(t.Re.add(e),t.defaultAnimation.isAnimating&&t.Bc(),t.sc=!0)}function fo(t){if(t.md&&t.sc){var e=t.Rd,i=t.C,n=t.Re.contains("Model");n&&(t.zl=!0,t.Al===Po?(e.isViewportUnconstrained=!0,e.lc.clear(),e.add(i,"position",i.position.copy().offset(0,-200),i.position),e.add(i,"opacity",0,1)):t.Al===Co&&e.lc.clear(),t.Qx=!(t.Al!==No||!i.Ts.w(i.la)),i.R("InitialAnimationStarting",t)),n&&!t.zi||0===e.lc.count?(t.Re.clear(),t.sc=!1,t.ef=!1,e.lc.clear(),Ao(e,i),t.zl=!1,i.M()):(t.Re.clear(),i.Ee=!1,n=e.lc.get(i),i.autoScale!==xs&&null!==n&&(delete n.start.scale,delete n.end.scale),y.requestAnimationFrame((function(){!1===t.sc||e.jc||(i.Ke("temporaryPixelRatio")&&Jo(i),Qo(i),t.sc=!1,t.ef=!1,e.start(),mo(t),i.Na(),Do(e,0),kr(i,!0),vo(t),i.R("AnimationStarting",t))})))}}function po(t,e,i,n){t.isTicking||e instanceof Nc&&(null!==e.fromNode||null!==e.toNode)||t.Rd.add(e,"position",i,n,!1)}function go(t,e){function i(){if(0<o.ot.count&&(n.addAll(o.ot),o.ot.clear(),o.jc=!0),!1!==o.jc&&0!==n.count){o.tv.addAll(n);for(var t=o.tv.iterator;t.next();){var e=t.value;if(!1!==e.jc){t:if(0<e.qm.count)var r=!0;else{for(r=e.lc.iterator;r.next();){var s=r.key;if(s instanceof ca&&null!==s.diagram||s instanceof Ko){r=!0;break t}}r=!1}r?Oo(e,!1):e.Il=!0}}o.tv.clear(),mo(o),kr(o.C),vo(o),y.requestAnimationFrame(i)}}var n=t.yj,o=t;t.jc?t.ot.add(e):(t.jc=!0,n.add(e),y.requestAnimationFrame((function(){i()})))}function yo(t){for(t=t.yj.iterator;t.next();)t.value.Il=!1}function mo(t){if(!t.ps){var e=t.C;t.Px=e.skipsUndoManager,t.ox=e.skipsModelSourceBindings,e.skipsUndoManager=!0,e.skipsModelSourceBindings=!0,t.ps=!0}}function vo(t){var e=t.C;e.skipsUndoManager=t.Px,e.skipsModelSourceBindings=t.ox,t.ps=!1}function xo(t,e,i){t.ef&&!e.w(i)&&(t.C.pj||(e=i.copy()),Lo(t.Rd,t.C,"position",e,i))}function bo(t,e){for(e=e.findLinksConnected();e.next();){var i=e.value;i.jf=i.points.copy(),t.$l.add(i)}}function wo(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),180<Math.abs(h-r)&&(h>r?r+=360:h+=360),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),"hsla("+r+", "+s+"%, "+a+"%, "+i+")"}function ko(){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){o<r?t.er(n(o,e.x,i.x-e.x,r),n(o,e.y,i.y-e.y,r),!1):t.position=new pt(n(o,e.x,i.x-e.x,r),n(o,e.y,i.y-e.y,r))})),e.add("location",(function(t,e,i,n,o,r){o<r?t.er(n(o,e.x,i.x-e.x,r),n(o,e.y,i.y-e.y,r),!0):t.location=new pt(n(o,e.x,i.x-e.x,r),n(o,e.y,i.y-e.y,r))})),e.add("position:placeholder",(function(t,e,i,n,o,r){o<r?t.er(n(o,e.x,i.x-e.x,r),n(o,e.y,i.y-e.y,r),!1):t.position=new pt(n(o,e.x,i.x-e.x,r),n(o,e.y,i.y-e.y,r))})),e.add("position:nodeCollapse",(function(t,e,i,n,o,r){var s=t.actualBounds,a=i.actualBounds;i=a.x+a.width/2-s.width/2,s=a.y+a.height/2-s.height/2,o<r?t.er(n(o,e.x,i-e.x,r),n(o,e.y,s-e.y,r),!1):t.position=new pt(n(o,e.x,i-e.x,r),n(o,e.y,s-e.y,r))})),e.add("desiredSize",(function(t,e,i,n,o,r){t.desiredSize=new zt(n(o,e.width,i.width-e.width,r),n(o,e.height,i.height-e.height,r))})),e.add("width",(function(t,e,i,n,o,r){t.width=n(o,e,i-e,r)})),e.add("height",(function(t,e,i,n,o,r){t.height=n(o,e,i-e,r)})),e.add("fill",(function(t,e,i,n,o,r){t.fill=wo(e,i,o,r,n)})),e.add("stroke",(function(t,e,i,n,o,r){t.stroke=wo(e,i,o,r,n)})),e.add("strokeWidth",(function(t,e,i,n,o,r){t.strokeWidth=n(o,e,i-e,r)})),e.add("strokeDashOffset",(function(t,e,i,n,o,r){t.strokeDashOffset=n(o,e,i-e,r)})),e.add("background",(function(t,e,i,n,o,r){t.background=wo(e,i,o,r,n)})),e.add("areaBackground",(function(t,e,i,n,o,r){t.areaBackground=wo(e,i,o,r,n)})),e.add("opacity",(function(t,e,i,n,o,r){t.opacity=n(o,e,i-e,r)})),e.add("scale",(function(t,e,i,n,o,r){t.scale=n(o,e,i-e,r)})),e.add("angle",(function(t,e,i,n,o,r){t.angle=n(o,e,i-e,r)})),Mo=e}Kn.className="TextEditingTool",Kn.LostFocus=Wn,Kn.MouseDown=$n,Kn.Tab=Jn,Kn.Enter=Zn,Kn.SingleClick=Qn,Kn.SingleClickSelected=to,Kn.DoubleClick=eo,Kn.StateNone=io,Kn.StateActive=no,Kn.StateEditing=oo,Kn.StateValidating=ro,Kn.StateInvalid=so,Kn.StateValidated=ao,I("textEditingTool",(function(){return this.findTool("TextEditing")}),(function(t){this.Ya("TextEditing",t,this.mouseUpTools)})),lo.prototype.ee=function(t){this.C=t},lo.prototype.canStart=function(){return!0},i=lo.prototype,i.cu=function(t){return this.Rd.cu(t)},i.ew=function(t){return this.Rd.ew(t)},i.Bc=function(t){var e=this.Rd;if(!0===this.sc&&(this.zl=this.ef=this.sc=!1,this.Re.clear(),0<e.lc.count&&this.C.Db()),this.jc){if(e.xm(!0),e.lc.clear(),Ao(e,null),!0===t)for(t=this.yj.ma(),e=0;e<t.length;e++)t[e].xm(!0)}else e.lc.clear(),Ao(e,this.C)},i.xm=function(t){t===this.defaultAnimation&&this.defaultAnimation.lc.clear(),this.yj.remove(t),0===this.yj.count&&(this.jc=!1,this.C.Db()),t===this.defaultAnimation&&(this.defaultAnimation.lc.clear(),this.C.R("AnimationFinished",this))},i.lk=function(t,e){this.ef&&(this.Re.contains("Expand Tree")||this.Re.contains("Expand SubGraph"))&&(this.Rd.lk(t,e),bo(this,t))},i.jk=function(t,e){this.ef&&(this.Re.contains("Collapse Tree")||this.Re.contains("Collapse SubGraph"))&&(this.Rd.jk(t,e),Lo(this.Rd,e,"position",e.position,e.position),bo(this,t))},d.Object.defineProperties(lo.prototype,{animationReasons:{get:function(){return this.Re}},isEnabled:{get:function(){return this.md},set:function(t){(this.md=t)&&this.yj.each((function(t){t.isAnimating||1/0!==t.runCount||t.start()}))}},duration:{get:function(){return this.Yg},set:function(t){1>t&&M(t,">= 1",lo,"duration"),this.Yg=t}},isAnimating:{get:function(){return this.jc}},isTicking:{get:function(){return this.ps}},isInitial:{get:function(){return this.zi},set:function(t){this.zi=t}},defaultAnimation:{get:function(){return this.Rd}},activeAnimations:{get:function(){return this.yj}},initialAnimationStyle:{get:function(){return this.Al},set:function(t){this.Al=t}}}),lo.prototype.stopAnimation=lo.prototype.Bc;var Mo=null,So=!1,Po=new U(lo,"Default",1),No=new U(lo,"AnimateLocations",2),Co=new U(lo,"None",3);function To(){this.xv=this.Ox=this.Uc=this.C=null,this.Il=this.jc=this.l=!1,this.Zn=this.Dd=0,this.Ir=this.Ku=Fo,this.Hl=this.Fp=!1,this.nv=1,this.mv=0,this.vd=this.Yg=NaN,this.tx=0,this.$n=null,this.u=At,this.lc=new dt,this.iv=new dt,this.qm=new nt,this.jv=new nt,this.px=Ts}function Ao(t,e){if(t.iv.clear(),t.Hl=!1,t.mv=0,t.vd=NaN,0<t.qm.count&&t.qm.clear(),0<t.jv.count&&t.jv.clear(),null!==e)for(t=e.links;t.next();)t.value.jf=null}function Lo(t,e,i,n,o,r){var s=t.lc;if(e instanceof Ko&&"position"===i&&(i="position:diagram"),"fill"!==i&&"stroke"!==i&&"background"!==i&&"areaBackground"!==i||(ah(n),hh(),n=[Nh.l,Nh.I,Nh.u,Nh.T],ah(o),hh(),o=[Nh.l,Nh.I,Nh.u,Nh.T]),s.contains(e)){var a=s.G(e),h=a.start,l=a.end;void 0===h[i]&&(h[i]=jo(n)),l[i]=jo(o)}else h={},l={},h[i]=jo(n),l[i]=jo(o),a=h.position,e instanceof ca&&a instanceof pt&&!a.s()&&e.diagram.animationManager.Re.contains("Expand SubGraph")&&a.assign(l.position),a=new Io(h,l,r),s.add(e,a);s=h[i],s instanceof pt&&!s.s()&&s.assign(t.u),r&&0===i.indexOf("position:")&&e instanceof Lu?a.Qv.location=jo(e.location):r&&(a.Qv[i]=jo(n))}function jo(t){return t instanceof pt||t instanceof Bt?t.copy():t}function Oo(t,e){if(!t.Il||e){var i=t.Uc;if(!1!==t.jc){var n=+new Date,o=n>t.Zn?t.vd:n-t.Dd;e&&(o=t.tx,o<t.vd?(t.Dd=+new Date-o,t.Zn=t.Dd+t.vd):o=t.vd),mo(i),Do(t,o),kr(t.C,!0),vo(i),n>t.Zn&&(t.Fp&&!t.Hl?(t.Dd=+new Date,t.Zn=t.Dd+t.vd,t.Hl=!0):t.xm(!1))}}}function Do(t,e){for(var i=t.vd,n=t.lc.iterator,o=t.Hl;n.next();){var r=n.key;if(!(r instanceof ca&&null===r.diagram)){var s=n.value,a=o?s.end:s.start;s=o?s.start:s.end;var h,l=Mo;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.Ir,e,i,t)}}}function Fo(t,e,i,n){return t/=n/2,1>t?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e}function Bo(t,e,i,n){return t===n?e+i:i*(1-Math.pow(2,-10*t/n))+e}function Io(t,e,i){this.start=t,this.end=e,this.Qv={},this.Kv=i,this.sw=!1}function Eo(t,e,i){this.pd=null,this.gf=t,this.cq=i||zo,this.bl=null,void 0!==e&&(this.bl=e,void 0===i&&(this.cq=Vo))}function Ro(t,e){t=t.bl,null!==t&&(t.duration&&(e.duration=t.duration),t.finished&&(e.finished=t.finished),t.easing&&(e.easing=t.easing))}lo.className="AnimationManager",lo.defineAnimationEffect=function(t,e){So||(ko(),So=!0),Mo.add(t,e)},lo.Default=Po,lo.AnimateLocations=No,lo.None=Co,To.prototype.suspend=function(){this.Il=!0},To.prototype.advanceTo=function(t,e){e&&(this.Il=!1),this.Fp&&t>=this.vd&&(this.Hl=!0,t-=this.vd),this.tx=t,Oo(this,!0),mo(this.Uc),kr(this.C),vo(this.Uc),this.C.redraw()},i=To.prototype,i.start=function(){if(0!==this.lc.count&&!this.jc){for(var t=this.C,e=this.lc.iterator;e.next();){var i=e.value.end,n=e.key;if(i["position:placeholder"]){var o=n.findVisibleNode();if(o instanceof bc&&null!==o.placeholder){var r=o.placeholder;o=r.da(ne),r=r.padding,o.x+=r.left,o.y+=r.top,i["position:placeholder"]=o}}null===t&&(n instanceof Ko?t=n:n instanceof ca&&(t=n.diagram))}null!==t&&(this.C=t,e=this.Uc=t.animationManager,!1!==e.isEnabled&&(this.vd=isNaN(this.Yg)?e.duration:this.Yg,this.Ir=this.Ku,e.zl&&e.Al===Po&&this===e.defaultAnimation&&(this.Ir=Bo,this.vd=isNaN(this.Yg)?600===e.duration?900:e.duration:this.Yg),this.px=t.scrollMode,this.isViewportUnconstrained&&(t.Ti=As),mo(e),this.qm.each((function(e){e.data=null,t.add(e)})),vo(e),this.jc=!0,this.Dd=+new Date,this.Zn=this.Dd+this.vd,go(e,this)))}},i.sz=function(t,e){t.Nc()&&(this.qm.add(t),this.C=e)},i.add=function(t,e,i,n,o){if("position"!==e||!i.w(n)){if(null===this.C&&(t instanceof Ko?this.C=t:t instanceof ca&&null!==t.diagram&&(this.C=t.diagram)),t instanceof Lu){if(!t.isAnimated)return;"position"===e&&(e="position:part")}Lo(this,t,e,i,n,o)}},i.cu=function(t){return!!this.jc&&(t=this.lc.G(t),null!==t&&t.sw)},i.ew=function(t){return!!this.jc&&(t=this.lc.G(t),null!==t&&(t.start.position||t.start.location))},i.stop=function(){this.jc&&this.xm(!0)},i.xm=function(t){if(null!==this.xv&&this.xv.Mp.remove(this.Ox),this.jc){var e=this.C,i=this.Uc;this.Il=this.jc=i.zl=!1,mo(i);for(var n=this.lc,o=this.qm.iterator;o.next();)e.remove(o.value);for(o=this.jv.iterator;o.next();)o.value.o();o=this.Fp,n=n.iterator;for(var r=Mo;n.next();){var s,a=n.key,h=n.value,l=o?h.end:h.start,u=o?h.start:h.end,c=h.Qv;for(s in u)if(null!==r.get(s)){var f=s;!h.Kv||"position:nodeCollapse"!==f&&"position:placeholder"!==f||(f="position"),r.get(f)(a,l[s],void 0!==c[s]?c[s]:h.Kv?l[s]:u[s],this.Ir,this.vd,this.vd,this)}h.Kv&&void 0!==c.location&&a instanceof Lu&&(a.location=c.location),h.sw&&a instanceof Lu&&a.Ob(!1)}if(e.Yt.clear(),Zo(e,!1),e.Na(),e.M(),kr(e,!0),i.defaultAnimation===this){for(s=i.$l.iterator;s.next();)o=s.value,null!==o.jf&&(o.points=o.jf,o.jf=null);i.$l.clear()}this.isViewportUnconstrained&&(e.scrollMode=this.px),vo(i),this.mv++,!t&&this.nv>this.mv?(this.Hl=!1,this.start()):(this.$n&&this.$n(this),Ao(this,null),i.xm(this),e.Db())}},i.lk=function(t,e){var i=e.actualBounds,n=null;if(e instanceof bc&&(n=e.placeholder),null!==n?(i=n.da(ne),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 bc)for(t=t.memberParts;t.next();)n=t.value,n instanceof ec&&this.lk(n,e)},i.jk=function(t,e){if(t.isVisible()){var i=null;if(e instanceof bc&&(i=e.placeholder),null!==i?this.add(t,"position:placeholder",t.position,i,!0):this.add(t,"position:nodeCollapse",t.position,e,!0),this.add(t,"scale",t.scale,.01,!0),i=this.lc,i.contains(t)&&(i.G(t).sw=!0),t instanceof bc)for(t=t.memberParts;t.next();)i=t.value,i instanceof ec&&this.jk(i,e)}},i.pA=function(t){var e=this.iv.get(t);return null===e&&(e={},this.iv.add(t,e)),e},d.Object.defineProperties(To.prototype,{duration:{get:function(){return this.Yg},set:function(t){1>t&&M(t,">= 1",To,"duration"),this.Yg=t}},reversible:{get:function(){return this.Fp},set:function(t){this.Fp=t}},runCount:{get:function(){return this.nv},set:function(t){0<t?this.nv=t:w("Animation.runCount value must be a positive integer.")}},finished:{get:function(){return this.$n},set:function(t){this.$n!==t&&(this.$n=t)}},easing:{get:function(){return this.Ku},set:function(t){this.Ku=t}},isViewportUnconstrained:{get:function(){return this.l},set:function(t){this.l=t}},isAnimating:{get:function(){return this.jc}}}),To.prototype.getTemporaryState=To.prototype.pA,To.prototype.stop=To.prototype.stop,To.prototype.add=To.prototype.add,To.prototype.addTemporaryPart=To.prototype.sz,To.className="Animation",To.EaseLinear=function(t,e,i,n){return i*t/n+e},To.EaseInOutQuad=Fo,To.EaseInQuad=function(t,e,i,n){return i*(t/=n)*t+e},To.EaseOutQuad=function(t,e,i,n){return-i*(t/=n)*(t-2)+e},To.EaseInExpo=function(t,e,i,n){return 0===t?e:i*Math.pow(2,10*(t/n-1))+e},To.EaseOutExpo=Bo,Io.className="AnimationState",Eo.prototype.copy=function(){var t=new Eo(this.gf);t.cq=this.cq;var e=this.bl;if(null!==e){var i={};void 0!==e.duration&&(i.ny=e.duration),void 0!==e.finished&&(i.ny=e.finished),void 0!==e.easing&&(i.ny=e.easing),t.bl=i}return t},d.Object.defineProperties(Eo.prototype,{propertyName:{get:function(){return this.gf},set:function(t){this.gf=t}},animationSettings:{get:function(){return this.bl},set:function(t){this.bl=t}},startCondition:{get:function(){return this.cq},set:function(t){this.cq=t}}});var zo=new U(Eo,"Default",1),Vo=new U(Eo,"Immediate",2),Go=new U(Eo,"Bundled",3);function Yo(){ot(this),this.C=null,this.Ea=new et,this.oa="",this.hb=1,this.u=!1,this.l=this.Pi=this.I=this.ii=this.hi=this.gi=this.fi=this.di=this.ei=this.ci=this.ki=this.bi=this.ji=this.ai=this.$h=!0,this.rp=[]}function Xo(t,e){var i=1;return 1!==t.hb&&(i=e.globalAlpha,e.globalAlpha=i*t.hb),i}function qo(t,e,i){if(e=Uo(t,e,i),i instanceof bc&&null!==i&&isNaN(i.zOrder)){if(0!==i.memberParts.count){for(var n=-1,o=t.Ea.j,r=o.length,s=0;s<r;s++){var a=o[s];if(a===i&&(e=s,0<=n))break;if(0>n&&a.containingGroup===i&&(n=s,0<=e))break}!(0>n)&&n<e&&(o=t.Ea,o.cb(e),o.wb(n,i))}i=i.containingGroup,null!==i&&qo(t,-1,i)}}function Uo(t,e,i){var n=i.zOrder;if(isNaN(n))return e;t=t.Ea;var o=t.count;if(1>=o)return e;if(0>e&&(e=t.indexOf(i)),0>e)return-1;for(var r=e-1,s=NaN;0<=r;){if(s=t.J(r).zOrder,!isNaN(s))break;r--}for(var a=e+1,h=NaN;a<o;){if(h=t.J(a).zOrder,!isNaN(h))break;a++}if(!isNaN(s)&&s>n)for(;;){if(-1===r||s<=n){if(r++,r===e)break;return t.cb(e),t.wb(r,i),r}for(s=NaN;0<=--r&&(s=t.J(r).zOrder,isNaN(s)););}else if(!isNaN(h)&&h<n)for(;;){if(a===o||h>=n){if(a--,a===e)break;return t.cb(e),t.wb(a,i),a}for(h=NaN;++a<o&&(h=t.J(a).zOrder,isNaN(h)););}return e}function Ko(t){if(1<arguments.length&&w("Diagram constructor can only take one optional argument, the DIV HTML element or its id."),Es||(Rs(),Es=!0),ot(this),fs=this,this.Sb=!0,this.Uc=new lo,this.Uc.ee(this),this.rb=17,this.Gl=this.pv=!1,this.Ss="default",this.Fa=null,ys){var e=this,i=function(){e.removeEventListener(y.document,"DOMContentLoaded",i,!1),e.setRTL()};null!==y.document.body?this.setRTL():e.addEventListener(y.document,"DOMContentLoaded",i,!1)}this.Ma=new et,this.xa=this.ya=0,this.Zl=this.wa=null,this.Kx=new dt,this.hf=this.Gb=null,this.xw(),this.Nj=null,this.ww(),this.hb=1,this.la=new pt(NaN,NaN).freeze(),this.Ts=new pt(NaN,NaN),this.Qn=this.Aa=1,this.es=new pt(NaN,NaN).freeze(),this.fs=NaN,this.xs=1e-4,this.vs=100,this.sb=new Ke,this.xt=new pt(NaN,NaN).freeze(),this.Zr=new zt(NaN,NaN,NaN,NaN).freeze(),this.Si=new Qt(0,0,0,0).freeze(),this.Ti=Ts,this.at=!1,this.Us=this.Ns=null,this.Og=xs,this.Dj=Ce,this.Yf=xs,this.to=Ce,this.gs=this.ds=ne,this.Dc=!0,this.El=!1,this.wd=new nt,this.Vg=new dt,this.rl=!0,this.qn=250,this.Bj=-1,this.sn=new Qt(16,16,16,16).freeze(),this.Hj=this.Ee=!1,this.Kj=!0,this.Wf=new wi,this.Wf.diagram=this,this.od=new wi,this.od.diagram=this,this.hh=new wi,this.hh.diagram=this,this.we=this.Of=null,this.hk=!1,this.Pr=this.Qr=null,this.zj=y.PointerEvent&&(z||V||G)&&y.navigator&&!1!==y.navigator.msPointerEnabled,es(this),this.Dh=new nt,this.qs=!0,this.rt=Ls,this.Uu=!1,this.tt=ks,this.La=null,ds.add("Model",vd),this.Jr=this.Mr=this.pt=null,this.Pn=this.Hr="auto",this.gg=this.As=this.ig=this.jg=this.lg=this.Qf=this.Uf=this.Pf=null,this.cs=!1,this.Rf=this.wg=this.kg=this.hg=null,this.Bs=!1,this.Ls={},this.bk=[null,null],this.Br=null,this.Nr=this.gt=this.rv=this.vg=!1,this.av=!0,this.yi=this.ac=!1,this.cc=null;var n=this;this.Cc=function(t){var e=n.partManager;if(t.model===e.diagram.model&&e.diagram.Z){e.diagram.Z=!1;try{var i=t.change;""===t.modelChange&&i===Pi&&e.updateDataBindings(t.object,t.propertyName)}finally{e.diagram.Z=!0}}},this.Tc=function(t){n.partManager.doModelChanged(t)},this.zv=!0,this.Xd=-2,this.pg=new dt,this.Wl=new et,this.$f=!1,this.ai=this.$h=this.nr=this.md=!0,this.pr=!1,this.vr=this.tr=this.ii=this.hi=this.gi=this.fi=this.di=this.ei=this.ci=this.sr=this.ki=this.bi=this.ji=this.qr=!0,this.Zf=this.Xu=!1,this.ur=this.rr=this.wl=this.vl=!0,this.$s=this.Ws=16,this.Vs=this.Op=!1,this.Pp=this.Ys=null,this.Xs=this.Zs=0,this.ib=new Qt(5).freeze(),this.qv=(new nt).freeze(),this.ws=999999999,this.Su=(new nt).freeze(),this.xi=this.wi=this.vi=!0,this.Ye=this.pe=!1,this.kc=null,this.Ng=!0,this.qe=!1,this.Ax=new nt,this.Tu=new nt,this.Gc=null,this.Vl=1,this.sv=0,this.Ic={scale:1,position:new pt,bounds:new zt,Gv:new Bt,kw:new Bt,hw:!1},this.Rx=new zt(NaN,NaN,NaN,NaN).freeze(),this.sm=new Bt(NaN,NaN).freeze(),this.Rn=new zt(NaN,NaN,NaN,NaN).freeze(),this.rs=!1,this.Lo=this.qo=this.kp=this.Fu=this.Eu=this.Gu=this.bg=this.fh=this.df=this.Tr=null,Wo(this),this.Ib=null,this.po=!1,this.Ej=null,this.partManager=new vd,this.toolManager=new Di,this.toolManager.initializeStandardTools(),this.currentTool=this.defaultTool=this.toolManager,this.Sr=null,this.kl=new ea,this.Gs=this.Fs=null,this.fq=!1,this.commandHandler=_o(),this.model=op(),this.vg=!0,tr(this),this.layout=new zf,this.vg=!1,this.ux=this.Ju=null,this.Tb=1,this.yh=null,this.Xo=1,this.cp=0,this.hv=[0,0,0,0,0],this.ep=0,this.xd=1,this.Sj=0,this.Go=new pt,this.qt=500,this.rn=new pt,this.re=!1,this.Qk=this.Rk=this.Pk=this.Ok=this.Jk=this.Lk=this.Kk=this.Hk=this.Ik=this.Ww=this.Mw=this.Nw=this.Ow=null,this.Yq=function(){},this.preventDefault=null,this.wo=!1,this.ui=new zs,this.gq=!1,void 0!==t&&Gs(this,t),this.ao=null,this.bo=Dt,this.Sb=!1}function Ho(t,e){t.animationManager.Bc(!0),t.qv=(new nt).freeze(),t.Su=(new nt).freeze();var i=t.skipsUndoManager;null!==t.model&&(t.skipsUndoManager=!0);var n=null;null!==t.Ib&&(n=t.Ib.part,null!==n&&t.remove(n));var o=[],r=t.Ma.length;if(e){for(e=0;e<r;e++)for(var s=t.Ma.j[e].parts;s.next();){var a=s.value;a!==n&&null===a.data&&o.push(a)}for(e=0;e<o.length;e++)t.remove(o[e])}for(e=0;e<r;e++)t.Ma.j[e].clear();return t.partManager.clear(),t.wd.clear(),t.Vg.clear(),t.Dh.clear(),t.Ej=null,t.Wl.clear(),fu(),t.pg.clear(),q=[],null!==n&&(t.add(n),t.partManager.parts.remove(n)),null!==t.model&&(t.skipsUndoManager=i),o}function _o(){return null}function Wo(t){t.df=new dt;var e=new ec,i=new Il;i.bind(new cp("text","",F)),e.add(i),t.Gu=e,t.df.add("",e),e=new ec,i=new Il,i.stroke="brown",i.bind(new cp("text","",F)),e.add(i),t.df.add("Comment",e),e=new ec,e.selectable=!1,e.avoidable=!1,i=new Nl,i.figure="Ellipse",i.fill="black",i.stroke=null,i.desiredSize=new Bt(3,3).ca(),e.add(i),t.df.add("LinkLabel",e),t.fh=new dt,e=new bc,e.selectionObjectName="GROUPPANEL",e.type=Uh.Vertical,i=new Il,i.font="bold 12pt sans-serif",i.bind(new cp("text","",F)),e.add(i),i=new Uh(Uh.Auto),i.name="GROUPPANEL";var n=new Nl;n.figure="Rectangle",n.fill="rgba(128,128,128,0.2)",n.stroke="black",i.add(n),n=new Pc,n.padding=new Qt(5,5,5,5).ca(),i.add(n),e.add(i),t.Eu=e,t.fh.add("",e),t.bg=new dt,e=new Nc,i=new Nl,i.isPanelMain=!0,e.add(i),i=new Nl,i.toArrow="Standard",i.fill="black",i.stroke=null,i.strokeWidth=0,e.add(i),t.Fu=e,t.bg.add("",e),e=new Nc,i=new Nl,i.isPanelMain=!0,i.stroke="brown",e.add(i),t.bg.add("Comment",e),e=new Qu,e.type=Uh.Auto,i=new Nl,i.fill=null,i.stroke="dodgerblue",i.strokeWidth=3,e.add(i),i=new Pc,i.margin=new Qt(1.5,1.5,1.5,1.5).ca(),e.add(i),t.kp=e,t.qo=e,e=new Qu,e.type=Uh.Link,i=new Nl,i.isPanelMain=!0,i.fill=null,i.stroke="dodgerblue",i.strokeWidth=3,e.add(i),t.Lo=e}function $o(t){var e=t.wa.Ja;e instanceof HTMLCanvasElement&&(t.zj?(t.addEventListener(e,"pointerdown",t.Ok,!1),t.addEventListener(e,"pointermove",t.Pk,!1),t.addEventListener(e,"pointerup",t.Rk,!1),t.addEventListener(e,"pointerout",t.Qk,!1)):(t.addEventListener(e,"touchstart",t.Ow,!1),t.addEventListener(e,"touchmove",t.Nw,!1),t.addEventListener(e,"touchend",t.Mw,!1),t.addEventListener(e,"mousemove",t.Ik,!1),t.addEventListener(e,"mousedown",t.Hk,!1),t.addEventListener(e,"mouseup",t.Kk,!1),t.addEventListener(e,"mouseout",t.Jk,!1)),t.addEventListener(e,"mouseenter",t.Oz,!1),t.addEventListener(e,"mouseleave",t.Pz,!1),t.addEventListener(e,"wheel",t.Lk,!1),t.addEventListener(e,"keydown",t.BA,!1),t.addEventListener(e,"keyup",t.CA,!1),t.addEventListener(e,"blur",t.Az,!1),t.addEventListener(e,"focus",t.Bz,!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(e,"gesturestart",(function(e){t.toolManager.gestureBehavior!==Vi&&(t.toolManager.gestureBehavior===zi?e.preventDefault():t.re&&t.lastInput.handled||(e.preventDefault(),t.Vl=t.scale,t.currentTool.doCancel()))}),!1),t.addEventListener(e,"gesturechange",(function(e){if(t.toolManager.gestureBehavior!==Vi)if(t.toolManager.gestureBehavior===zi)e.preventDefault();else if(!t.re||!t.lastInput.handled){e.preventDefault();var i=e.scale;if(null!==t.Vl){var n=t.wa.getBoundingClientRect();if(e=new pt(e.pageX-y.scrollX-t.ya/n.width*n.left,e.pageY-y.scrollY-t.xa/n.height*n.top),i=t.Vl*i,n=t.commandHandler,i!==t.scale&&n.canResetZoom(i)){var o=t.zoomPoint;t.zoomPoint=e,n.resetZoom(i),t.zoomPoint=o}}}}),!1),t.addEventListener(y,"resize",t.Ww,!1))}function Jo(t){30<t.cp&&(t.yh=1)}function Zo(t,e){null!==t.yh&&(t.yh=null,e&&t.Yq(),W&&W.my||(t.cp=0,t.hv=[0,0,0,0,0],t.ep=0))}function Qo(t){if(null!==t.wa){var e=t.Fa;if(0!==e.clientWidth&&0!==e.clientHeight){t.pv||t.setScrollWidth();var i=t.Ye?t.rb:0,n=t.pe?t.rb:0,o=t.Tb;t.Tb=t.computePixelRatio(),t.Tb!==o&&(t.El=!0,t.Db()),e.clientWidth===t.ya+i&&e.clientHeight===t.xa+n||(t.wi=!0,t.Dc=!0,e=t.layout,null!==e&&e.isViewportSized&&t.autoScale===xs&&(t.Hj=!0,e.B()),t.ac||t.Db())}}}function tr(t){var e=new Yo;e.name="Background",t.um(e),e=new Yo,e.name="",t.um(e),e=new Yo,e.name="Foreground",t.um(e),e=new Yo,e.name="Adornment",e.isTemporary=!0,e.isInDocumentBounds=!1,t.um(e),e=new Yo,e.name="Tool",e.isTemporary=!0,e.isInDocumentBounds=!0,t.um(e),e=new Yo,e.name="Grid",e.allowSelect=!1,e.pickable=!1,e.isTemporary=!0,e.isInDocumentBounds=!1,t.Ux(e,t.xk("Background"))}function er(t){t.Ib=new Uh(Uh.Grid),t.Ib.name="GRID";var e=new Nl;e.figure="LineH",e.stroke="lightgray",e.strokeWidth=.5,e.interval=1,t.Ib.add(e),e=new Nl,e.figure="LineH",e.stroke="gray",e.strokeWidth=.5,e.interval=5,t.Ib.add(e),e=new Nl,e.figure="LineH",e.stroke="gray",e.strokeWidth=1,e.interval=10,t.Ib.add(e),e=new Nl,e.figure="LineV",e.stroke="lightgray",e.strokeWidth=.5,e.interval=1,t.Ib.add(e),e=new Nl,e.figure="LineV",e.stroke="gray",e.strokeWidth=.5,e.interval=5,t.Ib.add(e),e=new Nl,e.figure="LineV",e.stroke="gray",e.strokeWidth=1,e.interval=10,t.Ib.add(e),e=new Lu,e.add(t.Ib),e.layerName="Grid",e.zOrder=0,e.isInDocumentBounds=!1,e.isAnimated=!1,e.pickable=!1,e.locationObjectName="GRID",t.add(e),t.partManager.parts.remove(e),t.Ib.visible=!1}function ir(){this.C.Vs?this.C.Vs=!1:this.C.isEnabled?this.C.iy(this):Dr(this.C)}function nr(t){this.C.isEnabled?(this.C.Zs=t.target.scrollTop,this.C.Xs=t.target.scrollLeft):Dr(this.C)}function or(t){if(t.fixedBounds.s()){var e=t.fixedBounds.copy();return e.uq(t.ib),e}for(var i=!0,n=t.Ma.j,o=n.length,r=0;r<o;r++){var s=n[r];if(s.visible&&s.isInDocumentBounds){s=s.Ea.j;for(var a=s.length,h=0;h<a;h++){var l=s[h];l.isInDocumentBounds&&l.isVisible()&&(l=l.actualBounds,l.s()&&(i?(i=!1,e=l.copy()):e.Rc(l)))}}}return i&&(e=new zt(0,0,0,0)),e.uq(t.ib),e}function rr(t,e){if((e||t.qe)&&!t.Sb&&null!==t.wa&&t.documentBounds.s()){if(e){var i=t.initialPosition;if(i.s())return void(t.position=i);i=pt.alloc(),i.tj(t.documentBounds,t.initialDocumentSpot);var n=t.viewportBounds;n=zt.allocAt(0,0,n.width,n.height);var o=pt.alloc();o.tj(n,t.initialViewportSpot),o.h(i.x-o.x,i.y-o.y),t.position=o,zt.free(n),pt.free(o),pt.free(i)}t.Sb=!0,i=t.Og,e&&t.Yf!==xs&&(i=t.Yf),n=i!==xs?sr(t,i):t.scale,i=t.viewportBounds.copy(),o=t.ya/n;var r=t.xa/n,s=t.Dj,a=t.to;e&&!s.kb()&&(a.kb()||a.Mb())&&(s=a.Mb()?ae:a),ar(t,t.documentBounds,o,r,s,e),e=t.scale,t.scale=n,t.Sb=!1,n=t.viewportBounds,n.Qa(i)||t.onViewportBoundsChanged(i,n,e,!1),Ar(t),wr(t,!0,!1)}}function sr(t,e){var i=t.Qn;if(null===t.wa)return i;t.Ta();var n=t.documentBounds;if(!n.s())return i;var o=n.width;n=n.height;var r=t.ya+(t.Ye?t.rb:0),s=t.xa+(t.pe?t.rb:0),a=r/o,h=s/n;return e===bs?(e=Math.min(h,a),e>i&&(e=i),e<t.minScale&&(e=t.minScale),e>t.maxScale&&(e=t.maxScale),e):e===ws?(e=h>a?(s-t.rb)/n:(r-t.rb)/o,e>i&&(e=i),e<t.minScale&&(e=t.minScale),e>t.maxScale&&(e=t.maxScale),e):t.scale}function ar(t,e,i,n,o,r){var s=pt.allocAt(t.la.x,t.la.y),a=s.x,h=s.y;if(null!==t.ao){var l=pt.alloc();l=t.ao.da(ne,l),a=l.x-t.bo.x/t.scale,h=l.y-t.bo.y/t.scale,o=ie,pt.free(l)}(r||t.scrollMode===Ts)&&(o.kb()&&(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.Si,r=i-e.width,i<e.width+o.left+o.right?(a=Math.min(a+i/2,e.right+Math.max(r,o.right)-i/2),a=Math.max(a,e.left-Math.max(r,o.left)+i/2),a-=i/2):a>e.left?a=e.left:a<e.right-i&&(a=e.right-i),i=n-e.height,n<e.height+o.top+o.bottom?(h=Math.min(h+n/2,e.bottom+Math.max(i,o.bottom)-n/2),h=Math.max(h,e.top-Math.max(i,o.top)+n/2),h-=n/2):h>e.top?h=e.top:h<e.bottom-n&&(h=e.bottom-n)),s.x=isFinite(a)?a:-t.ib.left,s.y=isFinite(h)?h:-t.ib.top,null!==t.positionComputation&&(e=t.positionComputation(t,s),s.x=e.x,s.y=e.y),t.Uc.sc&&xo(t.Uc,t.la,s),t.la.h(s.x,s.y),pt.free(s)}function hr(t,e,i,n){for(void 0===i&&(i=null),void 0===n&&(n=null),Sr(t),t=t.Ma.iteratorBackwards;t.next();){var o=t.value;if(o.visible&&!o.isTemporary&&(o=o.Vb(e,i,n),null!==o))return o}return null}function lr(t,e,i,n,o){for(void 0===i&&(i=null),void 0===n&&(n=null),o instanceof et||o instanceof nt||(o=new nt),Sr(t),t=t.Ma.iteratorBackwards;t.next();){var r=t.value;r.visible&&!r.isTemporary&&r.hj(e,i,n,o)}return o}function ur(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 et||o instanceof nt||(o=new nt),Sr(t),t=t.Ma.iteratorBackwards;t.next();){var s=t.value;s.visible&&!s.isTemporary&&s.zf(e,r,i,n,o)}return o}function cr(t,e,i,n,o,r){var s=null;for(void 0===s&&(s=null),void 0===n&&(n=null),void 0===o&&(o=!0),!1!==o&&!0!==o&&((o instanceof et||o instanceof nt)&&(r=o),o=!0),r instanceof et||r instanceof nt||(r=new nt),Sr(t),t=t.Ma.iteratorBackwards;t.next();){var a=t.value;a.visible&&!a.isTemporary&&a.Eg(e,i,s,n,o,r)}return r}function fr(t,e,i){var n=t.od;return t.od=t.hh,t.hh=n,n.diagram=t,n.event=e,i?vr(t,e,n):(n.viewPoint=t.od.viewPoint,n.documentPoint=t.od.documentPoint),t=0,e.ctrlKey&&(t+=1),e.altKey&&(t+=2),e.shiftKey&&(t+=4),e.metaKey&&(t+=8),n.modifiers=t,n.button=e.button,void 0===e.buttons||R||(n.buttons=e.buttons),Y&&0===e.button&&e.ctrlKey&&(n.button=2),n.down=!1,n.up=!1,n.clickCount=1,n.delta=0,n.handled=!1,n.bubbles=!1,n.timestamp=e.timeStamp,n.isMultiTouch=!1,n.targetDiagram=dr(e),n.targetObject=null,n}function dr(t){var e=t.target.C;if(!e){var i=t.path;i||"function"!==typeof t.composedPath||(i=t.composedPath()),i&&i[0]&&(e=i[0].C)}return e||null}function pr(t,e,i,n){var o=yr(t,e,!0,!1,!0,n);return vr(t,i,o),o.targetDiagram=dr(e),o.targetObject=null,n||o.clone(t.Wf),o}function gr(t,e,i,n){if(n=yr(t,e,!1,!1,!1,n),null!==i){var o=y.document.elementFromPoint(i.clientX,i.clientY);null!==o&&void 0!==o.shadowRoot&&null!==o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(i.clientX,i.clientY)),o&&o.C?(e=i,i=o.C):(e=void 0!==e.targetTouches?e.targetTouches[0]:e,i=t),n.targetDiagram=i,vr(t,e,n)}else null!==t.od?(n.documentPoint=t.od.documentPoint,n.viewPoint=t.od.viewPoint,n.targetDiagram=t.od.targetDiagram):null!==t.Wf&&(n.documentPoint=t.Wf.documentPoint,n.viewPoint=t.Wf.viewPoint,n.targetDiagram=t.Wf.targetDiagram);return n.targetObject=null,n}function yr(t,e,i,n,o,r){var s=t.od;t.od=t.hh,t.hh=s,s.diagram=t,s.clickCount=1;var a=s.delta=0;return e.ctrlKey&&(a+=1),e.altKey&&(a+=2),e.shiftKey&&(a+=4),e.metaKey&&(a+=8),s.modifiers=a,s.button=0,s.buttons=1,s.event=e,s.timestamp=e.timeStamp,t.zj&&e instanceof y.PointerEvent&&"touch"!==e.pointerType&&(s.button=e.button,void 0===e.buttons||R||(s.buttons=e.buttons),Y&&0===e.button&&e.ctrlKey&&(s.button=2)),s.down=i,s.up=n,s.handled=!1,s.bubbles=o,s.isMultiTouch=r,s}function mr(t,e){return!!t.bubbles||(void 0!==e.stopPropagation&&e.stopPropagation(),!1!==e.cancelable&&e.preventDefault(),e.cancelBubble=!0,!1)}function vr(t,e,i){var n=t.wa,o=t.ya,r=t.xa,s=0,a=0;null!==n&&(n=n.getBoundingClientRect(),s=e.clientX-o/n.width*n.left,a=e.clientY-r/n.height*n.top),i.viewPoint.h(s,a),null!==t.sb?(e=pt.allocAt(s,a),t.sb.Jd(e),i.documentPoint.assign(e),pt.free(e)):i.documentPoint.h(s,a)}function xr(t,e,i,n){if(void 0!==e.targetTouches){if(2>e.targetTouches.length)return;e=e.targetTouches[i]}else{if(null===t.bk[0])return;e=t.bk[i]}i=t.wa,null!==i&&(i=i.getBoundingClientRect(),n.h(e.clientX-t.ya/i.width*i.left,e.clientY-t.xa/i.height*i.top))}function br(t){t.ac||Sr(t),t.Ta()}function wr(t,e,i){t.animationManager.defaultAnimation.isAnimating||t.Sb||!t.wi||Dr(t)||(e&&Sr(t),i&&rr(t,!1))}function kr(t,e){if(!t.ac&&(t.Ee=!1,null!==t.Fa||t.sm.s())){t.ac=!0;var i=t.animationManager,n=t.Wl;if(!i.isAnimating&&0!==n.length){for(var o=n.j,r=o.length,s=0;s<r;s++){var a=o[s];ja(a,!1),a.o()}n.clear()}n=t.Tu,0<n.count&&(n.each((function(t){t.Vw()})),n.clear()),o=n=!1,i.defaultAnimation.isAnimating&&(o=!0,n=t.skipsUndoManager,t.skipsUndoManager=!0),i.sc||Qo(t),wr(t,!1,!0),null!==t.Ib&&(t.Ib.visible&&!t.po&&(qr(t),t.po=!0),!t.Ib.visible&&t.po&&(t.po=!1)),Sr(t),r=!1,t.qe&&!t.Ng||(t.qe?Qr(t,!t.Hj):(t.va("Initial Layout"),!1===i.isEnabled&&i.Bc(),Qr(t,!1)),r=!0),t.Hj=!1,Sr(t),t.gt||br(t),wr(t,!0,!1),s=!1,r?(i=zt.alloc(),i.assign(t.viewportBounds),t.qe||(s=t.qe=!0,t.skipsUndoManager||(t.undoManager.isPendingClear=!0),t.undoManager.isPendingUnmodified=!0,Mr(t)),t.R("LayoutCompleted"),i.w(t.viewportBounds)||wr(t,!0,!1),zt.free(i)):i.zl&&i.Qx&&(t.Yf!==xs?t.scale=sr(t,t.Yf):t.Og!==xs?t.scale=sr(t,t.Og):(i=t.initialScale,isFinite(i)&&0<i&&(t.scale=i)),rr(t,!0)),Sr(t),r&&s&&t.Xa("Initial Layout"),t.Hv(),e||t.mc(t.Gb),o&&(t.skipsUndoManager=n),t.ac=!1}}function Mr(t){var e=t.Aa;if(t.Yf!==xs)t.scale=sr(t,t.Yf);else if(t.Og!==xs)t.scale=sr(t,t.Og);else{var i=t.initialScale;isFinite(i)&&0<i&&(t.scale=i)}t.Aa!==e&&(Ar(t),wr(t,!0,!1)),rr(t,!0),e=t.Ma.j,t.Nd(e,e.length,t),t.R("InitialLayoutCompleted"),t.Ts.assign(t.la),qr(t)}function Sr(t){if((t.ac||!t.animationManager.isTicking)&&0!==t.wd.count){for(var e=0;23>e;e++){var i=t.wd.iterator;if(null===i||0===t.wd.count)break;t.wd=new nt,t.Vw(i,t.wd)}t.nodes.each((function(t){t instanceof bc&&0!==(65536&t.P)!==!1&&(t.P=65536^t.P)}))}}function Pr(t,e){for(var i=j(),n=j(),o=e.memberParts;o.next();){var r=o.value;r.isVisible()&&(r instanceof bc?(La(r)||Oa(r)||Yu(r))&&Pr(t,r):r instanceof Nc?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;o<t;o++)r=i[o],r.measure(1/0,1/0),r.arrange();for(O(i),e.measure(1/0,1/0),e.arrange(),t=n.length,e=0;e<t;e++)i=n[e],i.measure(1/0,1/0),i.arrange();O(n)}function Nr(t,e,i,n,o,r,s,a,h,l){if(null!==t.Fa){null===t.wa&&w("No canvas specified"),void 0===s&&(s=null),void 0===a&&(a=null),void 0===h&&(h=!1),void 0===l&&(l=!1),jr(t),t.Gb.uc(!0),Lr(t),t.yi=!0;var u=t.Aa;t.Aa=o;var c=t.Ma.j,f=c.length;try{var d=new zt(r.x,r.y,n.width/o,n.height/o),p=d.copy();p.uq(i),qr(t,p),Sr(t),t.Nd(c,f,t,d),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,n.width,n.height),null!==a&&""!==a&&(e.fillStyle=a,e.fillRect(0,0,n.width,n.height));var g=t.Tb;e.scale(g,g);var y=Ke.alloc();y.reset(),y.translate(i.left,i.top),y.scale(o),0===r.x&&0===r.y||y.translate(-r.x,-r.y),e.setTransform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),Ke.free(y),Cr(t,e),e.globalAlpha=t.hb;var m=t.xk("Grid");if(s){var v=new nt,x=s.iterator;for(x.reset();x.next();){var b=x.value;b instanceof Lu&&(l||b.layer!==m)&&v.add(b)}for(l=0;l<f;l++){var k=c[l];m=e;var M=t;if(k.visible&&0!==k.hb&&(h||!k.isTemporary)){var S=k.Ea.j,P=S.length;if(0!==P){var N=Xo(k,m),C=k.rp;C.length=0;var T=M.scale,A=zt.alloc();for(i=0;i<P;i++){var L=S[i];v.contains(L)&&k.dj(m,L,M,C,T,A,!1)}zt.free(A),m.globalAlpha=N}}}}else for(v=0;v<f;v++)M=c[v],M===m?l&&M.mc(e,t,!0):M.mc(e,t,h);t.yi=!1,t.ui&&Vs(t.ui,t)&&t.Tr()}finally{t.Aa=u,t.Gb.uc(!0),Lr(t),t.Nd(c,f,t),qr(t)}}}function Cr(t,e){t=t.hf,null!==t&&(void 0!==t.imageSmoothingEnabled&&e.Sy(!!t.imageSmoothingEnabled),t=t.defaultFont,void 0!==t&&null!==t&&(e.font=t))}function Tr(t,e){var i,n=t instanceof Uh,o=t instanceof Ko;for(i in e){""===i&&w("Setting properties requires non-empty property names");var r=t,s=i;if(n||o){var a=i.indexOf(".");if(0<a){var h=i.substring(0,a);n?r=t.bb(h):(r=t[h],(void 0===r||null===r)&&(r=t.toolManager[h])),N(r)?s=i.substr(a+1):w("Unable to find object named: "+h+" in "+t.toString()+" when trying to set property: "+i)}}if("_"!==s[0]&&!B(r,s)){if(o&&"ModelChanged"===s){t.Wx(e[s]);continue}if(o&&"Changed"===s){t.Hh(e[s]);continue}if(o&&B(t.toolManager,s))r=t.toolManager;else{if(o&&is(t,s)){t.kk(s,e[s]);continue}if(t instanceof Bd&&"Changed"===s){t.Hh(e[s]);continue}w('Trying to set undefined property "'+s+'" on object: '+r.toString())}}r[s]=e[i],"_"===s[0]&&r instanceof ca&&r.Tx(s)}}function Ar(t){!1===t.wi&&(t.wi=!0)}function Lr(t){!1===t.xi&&(t.xi=!0)}function jr(t){!1!==t.El&&(t.El=!1,Or(t,t.ya,t.xa))}function Or(t,e,i){var n=t.Tb;t.wa.resize(e*n,i*n,e,i)&&(t.Dc=!0,t.Gb.uc(!0))}function Dr(t){var e=t.wa;if(null===e||t.sm.s())return!0;var i=t.Fa,n=t.ya,o=t.xa,r=t.viewportBounds.copy();if(!r.s())return!0;var s=!1,a=t.Ye?t.rb:0,h=t.pe?t.rb:0,l=i.clientWidth||n+a,u=i.clientHeight||o+h;if(l===n+a&&u===o+h||(t.Ye=!1,t.pe=!1,h=a=0,t.ya=l,t.xa=u,s=t.El=!0),!(s||t.Ye||t.pe||t.vl||t.wl))return!0;t.wi=!1;var c=t.viewportBounds,f=t.documentBounds,d=0,p=0,g=0,y=0;i=c.width;var m=c.height,v=t.Si;t.contentAlignment.kb()?(f.width>i&&(d=v.left,p=v.right),f.height>m&&(g=v.top,y=v.bottom)):(d=v.left,p=v.right,g=v.top,y=v.bottom),v=f.width+d+p;var x=f.height+g+y;d=f.x-d;var b=c.x;p=f.right+p;var w=c.right+a;g=f.y-g;var k=c.y;f=f.bottom+y,c=c.bottom+h;var M="1px",S="1px";if(y=t.scale,l=v>l/y,u=x>u/y,t.scrollMode===Ts&&(l||u)&&(l&&t.hasHorizontalScrollbar&&t.allowHorizontalScroll&&(l=1,d+1<b&&(l=Math.max((b-d)*y+t.ya,l)),p>w+1&&(l=Math.max((p-w)*y+t.ya,l)),i+a+1<v&&(l=Math.max((v-i)*y+t.ya,l)),M=l.toString()+"px"),u&&t.hasVerticalScrollbar&&t.allowVerticalScroll&&(l=1,g+1<k&&(l=Math.max((k-g)*y+t.xa,l)),f>c+1&&(l=Math.max((f-c)*y+t.xa,l)),m+h+1<x&&(l=Math.max((x-m)*y+t.xa,l)),S=l.toString()+"px")),l="1px"!==M,u="1px"!==S,l&&u||!l&&!u||(u&&(w-=t.rb),l&&(c-=t.rb),v<i+a||!t.hasHorizontalScrollbar||!t.allowHorizontalScroll||(a=1,d+1<b&&(a=Math.max((b-d)*y+t.ya,a)),p>w+1&&(a=Math.max((p-w)*y+t.ya,a)),i+1<v&&(a=Math.max((v-i)*y+t.ya,a)),M=a.toString()+"px"),l="1px"!==M,a=t.xa,l!==t.pe&&(a=l?t.xa-t.rb:t.xa+t.rb),x<m+h||!t.hasVerticalScrollbar||!t.allowVerticalScroll||(h=1,g+1<k&&(h=Math.max((k-g)*y+a,h)),f>c+1&&(h=Math.max((f-c)*y+a,h)),m+1<x&&(h=Math.max((x-m)*y+a,h)),S=h.toString()+"px"),u="1px"!==S),t.Op&&l===t.pe&&u===t.Ye)return n===t.ya&&o===t.xa||t.hd(),!1;if(l!==t.pe&&(t.xa="1px"===M?t.xa+t.rb:Math.max(t.xa-t.rb,1),s=!0),t.pe=l,t.Pp.style.width=M,u!==t.Ye&&(t.ya="1px"===S?t.ya+t.rb:Math.max(t.ya-t.rb,1),s=!0,t.Gl&&(h=pt.alloc(),u?(e.style.left=t.rb+"px",t.position=h.h(t.la.x+t.rb/t.scale,t.la.y)):(e.style.left="0px",t.position=h.h(t.la.x-t.rb/t.scale,t.la.y)),pt.free(h))),t.Ye=u,t.Pp.style.height=S,t.Vs=!0,s&&(t.El=!0),e=t.Ys,h=e.scrollLeft,t.hasHorizontalScrollbar&&t.allowHorizontalScroll&&(i+1<v?h=(t.position.x-d)*y:d+1<b?h=e.scrollWidth-e.clientWidth:p>w+1&&(h=t.position.x*y)),t.Gl)switch(t.Ss){case"negative":h=-(e.scrollWidth-h-e.clientWidth);break;case"reverse":h=e.scrollWidth-h-e.clientWidth}return e.scrollLeft=h,t.hasVerticalScrollbar&&t.allowVerticalScroll&&(m+1<x?e.scrollTop=(t.position.y-g)*y:g+1<k?e.scrollTop=e.scrollHeight-e.clientHeight:f>c+1&&(e.scrollTop=t.position.y*y)),l=t.ya,u=t.xa,e.style.width=l+(t.Ye?t.rb:0)+"px",e.style.height=u+(t.pe?t.rb:0)+"px",n===l&&o===u&&!t.animationManager.sc||(t.onViewportBoundsChanged(r,t.viewportBounds,y,s),!1)}function Fr(t,e,i){var n=e.layer;null!==n&&n.diagram===t&&(e.isSelected=!1,e.isHighlighted=!1,e.B(2),i&&e.uk(),i=n.Lc(-1,e,!1),0<=i&&t.Va(Ci,"parts",n,e,null,i,null),t=e.layerChanged,null!==t&&t(e,n,null))}function Br(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=Er(t)),i instanceof ec){if(e.add(i,t.Cd(o,i,i.location)),i instanceof bc&&(null!==i.placeholder||o.dragsMembers))for(r=i.memberParts;r.next();)Br(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)&&Br(t,e,s,n,o)}}if(o.dragsTree)for(i=i.Wv();i.next();)Br(t,e,i.value,n,o)}else if(i instanceof Nc)for(e.add(i,t.Cd(o,i)),i=i.labelNodes;i.next();)Br(t,e,i.value,n,o);else i instanceof Qu||e.add(i,t.Cd(o,i,i.location))}function Ir(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.fq)||zr(t,e);for(var a=j(),h=j(),l=e.iterator,u=pt.alloc();l.next();){var c=l.key,f=l.value;if(c.Nc()){var d=Gr(t,c,e);null!==d?a.push(new ta(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.ge(d)))}else l.key instanceof Nc&&h.push(l.ka)}for(pt.free(u),o=a.length,l=0;l<o;l++)c=a[l],r.assign(c.info.point),void 0===c.$v.shifted&&(c.$v.shifted=new pt),c.node.location=r.add(c.$v.shifted);for(o=pt.alloc(),l=pt.alloc(),c=h.length,f=0;f<c;f++){var p=h[f];if(d=p.key,d instanceof Nc)if(d.suspendsRouting){d.jf=null,u=d.fromNode;var g=d.toNode;if(null!==t.draggedLink&&n.dragsLink)if(g=p.value.point,null===d.dragComputation)e.add(d,t.Cd(n,d,s)),Ac(d,s.x-g.x,s.y-g.y);else{p=pt.allocAt(0,0),(u=d.i(0))&&u.s()&&p.assign(u);var y=u=pt.alloc().assign(p).add(s);n.isGridSnapEnabled&&(n.isGridSnapRealtime||t.lastInput.up)&&(y=pt.alloc(),Rr(t,d,u,y,n)),u.assign(d.dragComputation(d,u,y)).ge(p),e.add(d,t.Cd(n,d,u)),Ac(d,u.x-g.x,u.y-g.y),pt.free(p),pt.free(u),y!==u&&pt.free(y)}else null!==u&&(o.assign(u.location),y=e.G(u),null!==y&&o.ge(y.point)),null!==g&&(l.assign(g.location),y=e.G(g),null!==y&&l.ge(y.point)),null!==u&&null!==g?o.Qa(l)?(u=p.value.point,g=r,g.assign(o),g.ge(u),e.add(d,t.Cd(n,d,o)),Ac(d,g.x,g.y)):(d.suspendsRouting=!1,d.Ua()):(p=p.value.point,u=null!==u?o:null!==g?l:s,e.add(d,t.Cd(n,d,u)),Ac(d,u.x-p.x,u.y-p.y))}else null!==d.fromNode&&null!==d.toNode||(u=p.value.point,e.add(d,t.Cd(n,d,s)),Ac(d,s.x-u.x,s.y-u.y))}pt.free(r),pt.free(s),pt.free(o),pt.free(l),O(a),O(h),i||(Sr(t),Vr(t,e))}}function Er(t){var e=t.toolManager.findTool("Dragging");return null!==e?e.dragOptions:t.kl}function Rr(t,e,i,n,o){if(void 0===o&&(o=Er(t)),n.assign(i),null!==e){var r=t.grid;e=o.gridSnapCellSize,t=e.width,e=e.height;var s=o.gridSnapOrigin,a=s.x;if(s=s.y,o=o.gridSnapCellSpot,null!==r){var h=r.gridCellSize;isNaN(t)&&(t=h.width),isNaN(e)&&(e=h.height),r=r.gridOrigin,isNaN(a)&&(a=r.x),isNaN(s)&&(s=r.y)}r=pt.allocAt(0,0),r.Uk(0,0,t,e,o),_e.Gq(i.x,i.y,a+r.x,s+r.y,t,e,n),pt.free(r)}}function zr(t,e){if(null!==e)for(t.fq=!0,t=e.iterator;t.next();)e=t.key,e instanceof Nc&&(e.suspendsRouting=!0)}function Vr(t,e){if(null!==e){for(e=e.iterator;e.next();){var i=e.key;i instanceof Nc&&(i.suspendsRouting=!1,Bc(i)&&i.Ua())}t.fq=!1}}function Gr(t,e,i){if(e=e.containingGroup,null!==e){if(t=Gr(t,e,i),null!==t)return t;if(t=i.G(e),null!==t)return t}return null}function Yr(t,e,i){if(null!==e.diagram&&e.diagram!==t&&w("Cannot share a Layer with another Diagram: "+e+" of "+e.diagram),null===i?null!==e.diagram&&w("Cannot add an existing Layer to this Diagram again: "+e):(i.diagram!==t&&w("Existing Layer must be in this Diagram: "+i+" not in "+i.diagram),e===i&&w("Cannot move a Layer before or after itself: "+e)),e.diagram!==t){e=e.name,t=t.Ma,i=t.count;for(var n=0;n<i;n++)t.J(n).name===e&&w("Cannot add Layer with the name '"+e+"'; a Layer with the same name is already present in this Diagram.")}}function Xr(t,e,i){var n=t.animationManager;if(t.Sb||t.ac)t.Aa=i,n.ef&&n.Rd.add(n.C,"scale",e,t.Aa);else if(null===t.wa)t.Aa=i;else{t.Sb=!0;var o=t.viewportBounds.copy(),r=t.ya,s=t.xa;o.width=t.ya/e,o.height=t.xa/e;var a=t.zoomPoint.x,h=t.zoomPoint.y,l=t.contentAlignment;isNaN(a)&&(l.Oc()?l.Ef(de)?a=0:l.Ef(pe)&&(a=r-1):a=l.kb()?l.x*(r-1):r/2),isNaN(h)&&(l.Oc()?l.Ef(fe)?h=0:l.Ef(ge)&&(h=s-1):h=l.kb()?l.y*(s-1):s/2),null===t.scaleComputation||t.animationManager.defaultAnimation.isAnimating||(i=t.scaleComputation(t,i)),i<t.minScale&&(i=t.minScale),i>t.maxScale&&(i=t.maxScale),r=pt.allocAt(t.la.x+a/e-a/i,t.la.y+h/e-h/i),t.position=r,pt.free(r),t.Aa=i,t.onViewportBoundsChanged(o,t.viewportBounds,e,!1),t.Sb=!1,rr(t,!1),n.ef&&n.Rd.add(n.C,"scale",e,t.Aa),t.M(),Ar(t)}}function qr(t,e){void 0===e&&(e=null);var i=t.Ib;if(null!==i&&i.visible){for(var n=Bt.alloc(),o=1,r=1,s=i.W.j,a=s.length,h=0;h<a;h++){var l=s[h],u=Math.abs(l.interval);2>u||(Wh(l.figure)?r=r*u/_e.uy(r,u):o=o*u/_e.uy(o,u))}if(s=i.gridCellSize,n.h(r*s.width,o*s.height),null!==e)o=e.width,r=e.height,t=e.x,s=e.y;else{if(e=zt.alloc(),t=t.viewportBounds,e.h(t.x,t.y,t.width,t.height),!e.s())return void zt.free(e);o=e.width,r=e.height,t=e.x,s=e.y,zt.free(e)}i.width=o+2*n.width,i.height=r+2*n.height,e=pt.alloc(),_e.Gq(t,s,0,0,n.width,n.height,e),e.offset(-n.width,-n.height),Bt.free(n),i.part.location=e,pt.free(e)}}function Ur(t){var e=t.isModified;t.zv!==e&&(t.zv=e,t.R("Modified"))}function Kr(t){return t=ds.get(t),null!==t?new t:new vd}function Hr(t,e){e=e.W.j;for(var i=e.length,n=0;n<i;n++)_r(t,e[n])}function _r(t,e){if(e instanceof cu){var i=e.element;if(null!==i&&i instanceof HTMLImageElement){i.Wg instanceof nt&&i.Wg.add(t);var n=e.Zg;if(null!==n&&!0===n.ls&&null!==e.diagram&&e.diagram.Wl.add(e),i.io)if(i=i.getAttribute("src"),n=t.pg.G(i),null===n)n=[],n.push(e),t.pg.add(i,n);else{for(t=0;t<n.length;t++)if(n[t]===e)return;n.push(e)}}}}function Wr(t,e){if(e instanceof cu){var i=e.element;if(null!==i&&i instanceof HTMLImageElement&&(i.Wg instanceof nt&&i.Wg.remove(t),pu(i),i.io)){i=i.getAttribute("src");var n=t.pg.G(i);if(null!==n)for(var o=0;o<n.length;o++)if(n[o]===e){n.splice(o,1),0===n.length&&(t.pg.remove(i),fu(i));break}}}}function $r(t,e){t.vi=!1;var i=t.Rn;i.w(e)||(e=e.H(),t.Rn=e,rr(t,!1),t.R("DocumentBoundsChanged",null,i.copy()),Ar(t))}function Jr(t,e){for(var i=t.Dh.iterator;i.next();)Zr(t,i.value,e);null!==t.layout&&(e?t.layout.isValidLayout=!1:t.layout.B())}function Zr(t,e,i){if(null!==e){for(var n=e.Sl.iterator;n.next();)Zr(t,n.value,i);null!==e.layout&&(i?e.layout.isValidLayout=!1:e.layout.B())}}function Qr(t,e){if(t.Ng&&!t.Nr){var i=t.Z;t.Z=!0;var n=t.undoManager.transactionLevel,o=t.layout,r=t.animationManager;try{0===n&&(t.undoManager.isInternalTransaction=!0,t.va("Layout")),1>=n&&!r.defaultAnimation.isAnimating&&!r.sc&&(e||uo(r,"Layout")),t.Ng=!1;for(var s=t.Dh.iterator;s.next();)ts(t,s.value,e,n);o.isValidLayout||(!e||o.isRealtime||null===o.isRealtime||0===n?(o.doLayout(t),Sr(t),o.isValidLayout=!0):t.Ng=!0)}finally{e=t.undoManager.isInternalTransaction,0===n&&(t.Xa("Layout"),t.undoManager.isInternalTransaction=!1),!e||0!==n&&1!==n||fo(r),t.Z=i}}}function ts(t,e,i,n){if(null!==e){for(var o=e.Sl.iterator;o.next();)ts(t,o.value,i,n);o=e.layout,null===o||o.isValidLayout||(!i||o.isRealtime||0===n?(e.Rh=!e.location.s(),o.doLayout(e),e.B(32),Pr(t,e),o.isValidLayout=!0):t.Ng=!0)}}function es(t){function e(t){var e=t.toLowerCase(),o=new et;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.Qr=i,t.Pr=n}function is(t,e){var i=t.Pr.G(e);return null!==i?i:t.Pr.G(e.toLowerCase())}function ns(t,e){var i=t.Qr.G(e);return null!==i?i:(i=t.Qr.G(e.toLowerCase()),null!==i?i:void w("Unknown DiagramEvent name: "+e))}function os(t){if(t.animationManager.isTicking)return!1;var e=t.currentTool;return e!==t.toolManager.findTool("Dragging")||(!t.fq||e.isComplexRoutingRealtime)}function rs(t,e,i,n){if(null===t.Gc&&(t.Gc=new bf),t.Gc.Rt||t.Gc.group!==i||t.Gc.Vy!==n){if(null!==i&&(i=ss(t,i)),null===i){e=t.computeOccupiedArea(),e.Jc(100,100),t.Gc.initialize(e),e=zt.alloc();for(var o=t.nodes;o.next();){var r=o.value,s=r.layer;null!==s&&s.visible&&!s.isTemporary&&as(t,r,n,e)}zt.free(e)}else{for(0<i.memberParts.count&&(e=t.computePartsBounds(i.memberParts,!1),e.Jc(20,20),t.Gc.initialize(e)),e=zt.alloc(),o=i.memberParts;o.next();)r=o.value,r instanceof ec&&as(t,r,n,e);zt.free(e)}t.Gc.group=i,t.Gc.Vy=n,t.Gc.Rt=!1}else e&&Mf(t.Gc);return t.Gc}function ss(t,e){return e.avoidable&&!e.isLinkLabel?e:null!==e.containingGroup?ss(t,e.containingGroup):null}function as(t,e,i,n){if(e!==i&&e.isVisible())if(e.avoidable&&!e.isLinkLabel){e=e.getAvoidableRect(n),t=t.Gc;var o=e.x,r=e.y;if(wf(t,o,r))for(i=(r-t.Bd)/t.gc|0,n=Math.min((o+e.width-t.Ad)/t.fc|0,t.Zi),e=Math.min((r+e.height-t.Bd)/t.gc|0,t.$i),o=(o-t.Ad)/t.fc|0;o<=n;o++)if(r=t.Rb[o],r.fill)r.fill(Af,i,e+1);else for(var s=i;s<=e;s++)r[s]=Af}else if(e instanceof bc)for(e=e.memberParts;e.next();)o=e.value,o instanceof ec&&as(t,o,i,n)}function hs(t,e){null!==t.Gc&&!t.Gc.Rt&&(void 0===e&&(e=null),null===e||e.avoidable&&!e.isLinkLabel)&&(t.Gc.Rt=!0)}function ls(t){-1===t.Bj&&(t.Bj=x((function(){if(-1!==t.Bj&&(t.Jf(),null!==t.lastInput.event)){var e=t.computeAutoScrollPosition(t.rn);e.Qa(t.position)||(t.position=e,t.lastInput.documentPoint=t.ou(t.rn),t.doMouseMove(),t.vi=!0,$r(t,t.documentBounds.copy().Rc(t.computeBounds())),t.Dc=!0,t.hd(),ls(t))}}),t.qn))}function us(t,e,i){function n(){var t=+new Date;for(r=!0,s.reset();s.next();)if(!s.value[0].Ol){r=!1;break}r||t-l>h?e(i,o,a):y.requestAnimationFrame(n)}for(var o=i.callback,r=!0,s=t.pg.iterator;s.next();)if(!s.value[0].Ol){r=!1;break}if("function"!==typeof o||r)return e(i,o,t);var a=t,h=i.callbackTimeout||300,l=+new Date;return y.requestAnimationFrame((function(){n()})),null}function cs(t,e,i,n){if(t.animationManager.Bc(),t.hd(),null===t.wa)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 Bt(1/0,1/0):new Bt(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),e=e.showGrid,void 0===e&&(e=p),null!==o&&isNaN(o.width)&&isNaN(o.height)&&(o=null),"number"===typeof l?l=new Qt(l):l instanceof Qt||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.Gb.uc(!0),c=new Ja(null,f);var g=c.context;if(!(o||r||h||a))return c.width=t.ya+Math.ceil(l.left+l.right),c.height=t.xa+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.Dq=d,Nr(t,n.context,l,new Bt(c.width,c.height),t.Aa,t.la,h,u,p,e),n.context):(t.rl=!1,Nr(t,g,l,new Bt(c.width,c.height),t.Aa,t.la,h,u,p,e),t.rl=!0,c.context);var y=t.Qn,m=t.documentBounds.copy();if(m.Jw(t.ib),p)for(var v=t.Ma.j,x=v.length,b=0;b<x;b++){var k=v[b];if(k.visible&&k.isTemporary){k=k.Ea.j;for(var M=k.length,S=0;S<M;S++){var P=k[S];P.isInDocumentBounds&&P.isVisible()&&(P=P.actualBounds,P.s()&&m.Rc(P))}}}if(v=new pt(m.x,m.y),null!==h){for(x=!0,b=h.iterator,b.reset();b.next();)if(k=b.value,k instanceof Lu&&(M=k.layer,(null===M||M.visible)&&(null===M||p||!M.isTemporary)&&k.isVisible()&&(k=k.actualBounds,k.s())))if(x){x=!1;var N=k.copy()}else N.Rc(k);x&&(N=new zt(0,0,0,0)),m.width=N.width,m.height=N.height,v.x=N.x,v.y=N.y}return null!==a&&a.s()&&(v=a,r||(r=y)),N=a=0,null!==l&&(a=l.left+l.right,N=l.top+l.bottom),x=b=0,null!==o&&(b=o.width,x=o.height,isFinite(b)&&(b=Math.max(0,b-a)),isFinite(x)&&(x=Math.max(0,x-N))),null!==o&&null!==r?("NaN"===r&&(r=y),o.s()?(o=b,m=x):isNaN(x)?(o=b,m=m.height*r):(o=m.width*r,m=x)):null!==o?o.s()?(r=Math.min(b/m.width,x/m.height),o=b,m=x):isNaN(x)?(r=b/m.width,o=b,m=m.height*r):(r=x/m.height,o=m.width*r,m=x):null!==r?"NaN"===r&&s.s()?(r=Math.min((s.width-a)/m.width,(s.height-N)/m.height),r>y?(r=y,o=m.width,m=m.height):(o=s.width,m=s.height)):(o=m.width*r,m=m.height*r):(r=y,o=m.width,m=m.height),null!==l?(o+=a,m+=N):l=new Qt(0),null!==s&&(y=s.width,s=s.height,isNaN(y)&&(y=2e3),isNaN(s)&&(s=2e3),isFinite(y)&&(o=Math.min(o,y)),isFinite(s)&&(m=Math.min(m,s))),c.width=Math.ceil(o),c.height=Math.ceil(m),"SVG"===i?null===n?null:(n.resize(c.width,c.height,c.width,c.height),n.ownerDocument=f,n.Dq=d,Nr(t,n.context,l,new Bt(Math.ceil(o),Math.ceil(m)),r,v,h,u,p,e),n.context):(t.rl=!1,Nr(t,g,l,new Bt(Math.ceil(o),Math.ceil(m)),r,v,h,u,p,e),t.rl=!0,c.context)}Eo.className="AnimationTrigger",Eo.Default=zo,Eo.Immediate=Vo,Eo.Bundled=Go,i=Yo.prototype,i.clear=function(){this.Ea.clear(),this.rp.length=0},i.ee=function(t){this.C=t},i.toString=function(t){void 0===t&&(t=0);var e='Layer "'+this.name+'"';if(0>=t)return e;for(var i=0,n=0,o=0,r=0,s=0,a=this.Ea.iterator;a.next();){var h=a.value;h instanceof bc?o++:h instanceof ec?n++:h instanceof Nc?r++:h instanceof Qu?s++:i++}if(a="",0<i&&(a+=i+" Parts "),0<n&&(a+=n+" Nodes "),0<o&&(a+=o+" Groups "),0<r&&(a+=r+" Links "),0<s&&(a+=s+" Adornments "),1<t)for(t=this.Ea.iterator;t.next();)i=t.value,a+="\n    "+i.toString(),n=i.data,null!==n&&st(n)&&(a+=" #"+st(n)),i instanceof ec?a+=" "+F(n):i instanceof Nc&&(a+=" "+F(i.fromNode)+" "+F(i.toNode));return e+" "+this.Ea.count+": "+a},i.Vb=function(t,e,i){if(void 0===e&&(e=null),void 0===i&&(i=null),!1===this.Pi)return null;var n=!1;null!==this.diagram&&this.diagram.viewportBounds.$(t)&&(n=!0);for(var o=pt.alloc(),r=this.Ea.j,s=r.length;s--;){var a=r[s];if((!0!==n||!1!==Uu(a))&&a.isVisible()&&(o.assign(t),vt(o,a.Fd),a=a.Vb(o,e,i),null!==a&&(null!==e&&(a=e(a)),null!==a&&(null===i||i(a)))))return pt.free(o),a}return pt.free(o),null},i.hj=function(t,e,i,n){if(void 0===e&&(e=null),void 0===i&&(i=null),n instanceof et||n instanceof nt||(n=new nt),!1===this.Pi)return n;var o=!1;null!==this.diagram&&this.diagram.viewportBounds.$(t)&&(o=!0);for(var r=pt.alloc(),s=this.Ea.j,a=s.length;a--;){var h=s[a];if((!0!==o||!1!==Uu(h))&&h.isVisible()){r.assign(t),vt(r,h.Fd);var l=h;h.hj(r,e,i,n)&&(null!==e&&(l=e(l)),null===l||null!==i&&!i(l)||n.add(l))}}return pt.free(r),n},i.zf=function(t,e,i,n,o){if(void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=!1),o instanceof et||o instanceof nt||(o=new nt),!1===this.Pi)return o;var r=!1;null!==this.diagram&&this.diagram.viewportBounds.Ge(t)&&(r=!0);for(var s=this.Ea.j,a=s.length;a--;){var h=s[a];if((!0!==r||!1!==Uu(h))&&h.isVisible()){var l=h;h.zf(t,e,i,n,o)&&(null!==e&&(l=e(l)),null===l||null!==i&&!i(l)||o.add(l))}}return o},i.Vv=function(t,e,i,n,o,r,s){if(!1===this.Pi)return o;for(var a=this.Ea.j,h=a.length;h--;){var l=a[h];if((!0!==s||!1!==Uu(l))&&r(l)&&l.isVisible()){var u=l;l.zf(t,e,i,n,o)&&(null!==e&&(u=e(u)),null===u||null!==i&&!i(u)||o.add(u))}}return o},i.Eg=function(t,e,i,n,o,r){if(void 0===i&&(i=null),void 0===n&&(n=null),void 0===o&&(o=!0),!1!==o&&!0!==o&&((o instanceof et||o instanceof nt)&&(r=o),o=!0),r instanceof et||r instanceof nt||(r=new nt),!1===this.Pi)return r;var s=!1;null!==this.diagram&&this.diagram.viewportBounds.$(t)&&(s=!0);for(var a=pt.alloc(),h=pt.alloc(),l=this.Ea.j,u=l.length;u--;){var c=l[u];if((!0!==s||!1!==Uu(c))&&c.isVisible()){a.assign(t),vt(a,c.Fd),h.h(t.x+e,t.y),vt(h,c.Fd);var f=c;c.Eg(a,h,i,n,o,r)&&(null!==i&&(f=i(f)),null===f||null!==n&&!n(f)||r.add(f))}}return pt.free(a),pt.free(h),r},i.Nd=function(t,e){if(this.visible){var i=this.Ea.j,n=i.length;if(0!==n){t=j();for(var o=j(),r=0;r<n;r++){var s=i[r];if(s.zx=r,s instanceof Nc){if(!1===s.ud)continue}else if(s instanceof Qu&&null!==s.adornedPart)continue;Kt(s.actualBounds,e)?(s.Nd(!0),t.push(s)):(s.Nd(!1),null!==s.adornments&&0<s.adornments.count&&o.push(s))}for(e=0;e<t.length;e++)for(i=t[e],ju(i),i=i.adornments;i.next();)n=i.value,n.measure(1/0,1/0),n.arrange(),n.Nd(!0);for(e=0;e<o.length;e++)ju(o[e]);O(t),O(o)}}},i.mc=function(t,e,i){if(this.visible&&0!==this.hb&&(void 0===i&&(i=!0),i||!this.isTemporary)){i=this.Ea.j;var n=i.length;if(0!==n){var o=Xo(this,t),r=this.rp;r.length=0;for(var s=e.scale,a=zt.alloc(),h=0;h<n;h++)this.dj(t,i[h],e,r,s,a,!0);zt.free(a),t.globalAlpha=o}}},i.dj=function(t,e,i,n,o,r,s){if(!s||Uu(e)){if(null!==n&&e instanceof Nc&&(e.isOrthogonal&&n.push(e),!1===e.ud))return;for(s=!1,n=e.containingGroup;null!==n;)s?null!==n.Za&&r.Dy(n.Za):null!==n.Za&&(s=!0,r.assign(n.Za)),n=n.containingGroup;var a=e.actualBounds;if(n=!1,s&&e.isVisible()){if(!r.Mc(a))return;n=!r.Ge(a)}n&&(t.save(),t.beginPath(),t.rect(r.x,r.y,r.width,r.height),t.clip()),a.width*o>i.Xo||a.height*o>i.Xo?e.mc(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&&(va(e,t,e.areaBackground,!0,!0,r,o),t.fillRect(o.x,o.y,o.width,o.height)),null===e.areaBackground&&null===e.background&&(va(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),va(e,t,e.background,!0,!1,r,o),t.fillRect(0,0,r.width/2,r.height/2),i.Tt()||(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.uc(!0))}},i.g=function(t,e,i,n,o){var r=this.diagram;null!==r&&r.Va(Pi,t,this,e,i,n,o)},i.oj=function(t,e,i){var n=this.Ea;if(e.Fi=this,t>=n.count)t=n.count;else if(n.J(t)===e)return-1;return n.wb(t,e),e.Mq(i),n=this.diagram,null!==n&&(i?n.M():n.oj(e)),qo(this,t,e),t},i.Lc=function(t,e,i){if(!i&&e.layer!==this&&null!==e.layer)return e.layer.Lc(t,e,i);var n=this.Ea;if(0>t||t>=n.length){if(t=n.indexOf(e),0>t)return-1}else if(n.J(t)!==e&&(t=n.indexOf(e),0>t))return-1;return e.Nq(i),n.cb(t),n=this.diagram,null!==n&&(i?n.M():n.Lc(e)),e.Fi=null,t},d.Object.defineProperties(Yo.prototype,{parts:{get:function(){return this.Ea.iterator}},partsBackwards:{get:function(){return this.Ea.iteratorBackwards}},diagram:{get:function(){return this.C}},name:{get:function(){return this.oa},set:function(t){var e=this.oa;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.oa=t,this.g("name",e,t),t=this.Ea.iterator;t.next();)t.value.layerName=this.oa}}},opacity:{get:function(){return this.hb},set:function(t){var e=this.hb;e!==t&&((0>t||1<t)&&M(t,"0 <= value <= 1",Yo,"opacity"),this.hb=t,this.g("opacity",e,t),t=this.diagram,null!==t&&t.M())}},isTemporary:{get:function(){return this.u},set:function(t){var e=this.u;e!==t&&(this.u=t,this.isInDocumentBounds=!1,this.g("isTemporary",e,t))}},visible:{get:function(){return this.I},set:function(t){var e=this.I;if(e!==t){for(this.I=t,this.g("visible",e,t),e=this.Ea.iterator;e.next();)e.value.Ob(t);t=this.diagram,null!==t&&t.M()}}},pickable:{get:function(){return this.Pi},set:function(t){var e=this.Pi;e!==t&&(this.Pi=t,this.g("pickable",e,t))}},isInDocumentBounds:{get:function(){return this.l},set:function(t){this.l!==t&&(this.l=t,null!==this.diagram&&this.diagram.Na())}},allowCopy:{get:function(){return this.$h},set:function(t){var e=this.$h;e!==t&&(this.$h=t,this.g("allowCopy",e,t))}},allowDelete:{get:function(){return this.ai},set:function(t){var e=this.ai;e!==t&&(this.ai=t,this.g("allowDelete",e,t))}},allowTextEdit:{get:function(){return this.ji},set:function(t){var e=this.ji;e!==t&&(this.ji=t,this.g("allowTextEdit",e,t))}},allowGroup:{get:function(){return this.bi},set:function(t){var e=this.bi;e!==t&&(this.bi=t,this.g("allowGroup",e,t))}},allowUngroup:{get:function(){return this.ki},set:function(t){var e=this.ki;e!==t&&(this.ki=t,this.g("allowUngroup",e,t))}},allowLink:{get:function(){return this.ci},set:function(t){var e=this.ci;e!==t&&(this.ci=t,this.g("allowLink",e,t))}},allowRelink:{get:function(){return this.ei},set:function(t){var e=this.ei;e!==t&&(this.ei=t,this.g("allowRelink",e,t))}},allowMove:{get:function(){return this.di},set:function(t){var e=this.di;e!==t&&(this.di=t,this.g("allowMove",e,t))}},allowReshape:{get:function(){return this.fi},set:function(t){var e=this.fi;e!==t&&(this.fi=t,this.g("allowReshape",e,t))}},allowResize:{get:function(){return this.gi},set:function(t){var e=this.gi;e!==t&&(this.gi=t,this.g("allowResize",e,t))}},allowRotate:{get:function(){return this.hi},set:function(t){var e=this.hi;e!==t&&(this.hi=t,this.g("allowRotate",e,t))}},allowSelect:{get:function(){return this.ii},set:function(t){var e=this.ii;e!==t&&(this.ii=t,this.g("allowSelect",e,t))}}}),Yo.prototype.findObjectsNear=Yo.prototype.Eg,Yo.prototype.findObjectsIn=Yo.prototype.zf,Yo.prototype.findObjectsAt=Yo.prototype.hj,Yo.prototype.findObjectAt=Yo.prototype.Vb,Yo.className="Layer",Ko.prototype.clear=function(){this.animationManager.Bc(),this.model.clear(),ms=null,vs="",Ho(this,!1),this.Wl.clear(),fu(),this.pg.clear(),this.Na(),this.Ta(),this.M()},Ko.prototype.reset=function(){this.clear(),this.Sb=!0,this.Uc=new lo,this.Uc.ee(this),this.rb=17,this.Gl=this.pv=!1,this.Ss="default",this.Ma=new et,this.Kx=new dt,this.hf=null,this.xw(),this.Nj=null,this.ww(),this.hb=1,this.la=new pt(NaN,NaN).freeze(),this.Ts=new pt(NaN,NaN),this.Qn=this.Aa=1,this.es=new pt(NaN,NaN).freeze(),this.fs=NaN,this.xs=1e-4,this.vs=100,this.sb=new Ke,this.xt=new pt(NaN,NaN).freeze(),this.Zr=new zt(NaN,NaN,NaN,NaN).freeze(),this.Si=new Qt(0,0,0,0).freeze(),this.Ti=Ts,this.at=!1,this.Us=this.Ns=null,this.Og=xs,this.Dj=Ce,this.Yf=xs,this.to=Ce,this.gs=this.ds=ne,this.Dc=!0,this.El=!1,this.wd=new nt,this.Vg=new dt,this.rl=!0,this.qn=250,this.Bj=-1,this.sn=new Qt(16,16,16,16).freeze(),this.Hj=this.Ee=!1,this.Kj=!0,this.Wf=new wi,this.Wf.diagram=this,this.od=new wi,this.od.diagram=this,this.hh=new wi,this.hh.diagram=this,this.we=this.Of=null,this.hk=!1,this.Pr=this.Qr=null,this.zj=y.PointerEvent&&(z||V||G)&&y.navigator&&!1!==y.navigator.msPointerEnabled,es(this),this.Dh=new nt,this.qs=!0,this.rt=Ls,this.Uu=!1,this.tt=ks,this.Jr=this.Mr=this.pt=null,this.Pn=this.Hr="auto",this.gg=this.As=this.ig=this.jg=this.lg=this.Qf=this.Uf=this.Pf=null,this.cs=!1,this.Rf=this.wg=this.kg=this.hg=null,this.Bs=!1,this.Ls={},this.bk=[null,null],this.Br=null,this.Nr=this.gt=this.rv=this.vg=!1,this.av=!0,this.yi=this.ac=!1,this.zv=!0,this.Xd=-2,this.pg=new dt,this.Wl=new et,this.$f=!1,this.ai=this.$h=this.nr=this.md=!0,this.pr=!1,this.vr=this.tr=this.ii=this.hi=this.gi=this.fi=this.di=this.ei=this.ci=this.sr=this.ki=this.bi=this.ji=this.qr=!0,this.Zf=this.Xu=!1,this.ur=this.rr=this.wl=this.vl=!0,this.$s=this.Ws=16,this.Vs=this.Op=!1,this.Xs=this.Zs=0,this.ib=new Qt(5).freeze(),this.qv=(new nt).freeze(),this.ws=999999999,this.Su=(new nt).freeze(),this.xi=this.wi=this.vi=!0,this.Ye=this.pe=!1,this.kc=null,this.Ng=!0,this.qe=!1,this.Ax=new nt,this.Tu=new nt,this.Gc=null,this.Vl=1,this.sv=0,this.Ic={scale:1,position:new pt,bounds:new zt,Gv:new Bt,kw:new Bt,hw:!1},this.Rx=new zt(NaN,NaN,NaN,NaN).freeze(),this.sm=new Bt(NaN,NaN).freeze(),this.Rn=new zt(NaN,NaN,NaN,NaN).freeze(),this.rs=!1,this.Lo=this.qo=this.kp=this.Fu=this.Eu=this.Gu=this.bg=this.fh=this.df=null,Wo(this),this.Ib=null,this.po=!1,this.Ej=null,this.partManager=new vd,this.toolManager=new Di,this.toolManager.initializeStandardTools(),this.currentTool=this.defaultTool=this.toolManager,this.Sr=null,this.kl=new ea,this.Gs=this.Fs=null,this.fq=!1,this.commandHandler=_o(),this.vg=!0,tr(this),this.layout=new zf,this.vg=!1,this.model=op(),this.model.undoManager=new Ai,this.qe=!1,this.Kj=!0,this.Ee=!1,this.Tb=1,this.yh=null,this.Xo=1,this.cp=0,this.hv=[0,0,0,0,0],this.ep=0,this.xd=1,this.Sj=0,this.Go=new pt,this.qt=500,this.rn=new pt,this.gq=this.wo=this.re=!1,this.ao=null,this.bo=Dt,this.Sb=!1,this.M()},Ko.prototype.setRTL=function(t){t=void 0===t?this.div:t,null===t&&(t=y.document.body);var e=b("div");e.dir="rtl",e.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",e.textContent="A",t.appendChild(e);var i="reverse";0<e.scrollLeft?i="default":(e.scrollLeft=1,0===e.scrollLeft&&(i="negative")),t.removeChild(e),this.Ss=i},Ko.prototype.setScrollWidth=function(t){t=void 0===t?this.div:t,null===t&&(t=y.document.body);var e=0;if(ys){var i=gs;e=ps,null===i&&(i=gs=b("p"),i.style.width="100%",i.style.height="200px",i.style.boxSizing="content-box",e=ps=b("div"),e.style.position="absolute",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.boxSizing="content-box",e.appendChild(i)),e.style.overflow="hidden",t.appendChild(e);var n=i.offsetWidth;e.style.overflow="scroll",i=i.offsetWidth,n===i&&(i=e.clientWidth),t.removeChild(e),e=n-i,0!==e||X||(e=11)}this.rb=e,this.pv=!0},Ko.prototype.jb=function(t){t.classType===Ko&&(this.autoScale=t)},Ko.prototype.toString=function(t){void 0===t&&(t=0);var e="";if(this.div&&this.div.id&&(e=this.div.id),e='Diagram "'+e+'"',0>=t)return e;for(var i=this.Ma.iterator;i.next();)e+="\n  "+i.value.toString(t-1);return e},Ko.prototype.addEventListener=function(t,e,i,n){t.addEventListener(e,i,{capture:n,passive:!1})},Ko.prototype.removeEventListener=function(t,e,i,n){t.removeEventListener(e,i,{capture:n})},Ko.prototype.computePixelRatio=function(){return null!==this.yh?this.yh:y.devicePixelRatio||1},Ko.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},Ko.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},Ko.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},Ko.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},Ko.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},Ko.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},Ko.prototype.doFocus=function(){this.focus()},Ko.prototype.focus=function(){if(this.wa)if(this.scrollsPageOnFocus)this.wa.focus();else{var t=y.scrollX||y.pageXOffset,e=y.scrollY||y.pageYOffset;this.wa.focus(),y.scrollTo(t,e)}},Ko.prototype.Bz=function(){this.C.R("GainedFocus")},Ko.prototype.Az=function(){this.C.R("LostFocus")},Ko.prototype.iy=function(t){if(null!==this.wa){this.Op=!0;var e=this.documentBounds,i=this.viewportBounds,n=this.Si,o=e.x-n.left,r=e.y-n.top,s=e.width+n.left+n.right,a=e.height+n.top+n.bottom,h=e.right+n.right;n=e.bottom+n.bottom;var l=i.x;e=i.y;var u=i.width,c=i.height,f=i.right,d=i.bottom;i=this.scale;var p=t.scrollLeft;if(this.Gl)switch(this.Ss){case"negative":p=p+t.scrollWidth-t.clientWidth;break;case"reverse":p=t.scrollWidth-p-t.clientWidth}var g=p;u<s||c<a?(p=pt.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.Xs!==g&&(p.x=g/i+o,this.Xs=g),this.allowVerticalScroll&&this.Zs!==t.scrollTop&&(p.y=t.scrollTop/i+r,this.Zs=t.scrollTop),this.position=p,pt.free(p),this.wi=this.Op=!1):(p=pt.alloc(),t.hz&&this.allowHorizontalScroll&&(o<l&&(this.position=p.h(g+o,this.position.y)),h>f&&(this.position=p.h(-(this.Ys.scrollWidth-this.ya)+g-this.ya/i+h,this.position.y))),t.iz&&this.allowVerticalScroll&&(r<e&&(this.position=p.h(this.position.x,t.scrollTop+r)),n>d&&(this.position=p.h(this.position.x,-(this.Ys.scrollHeight-this.xa)+t.scrollTop-this.xa/i+n))),pt.free(p),Lr(this),this.wi=this.Op=!1,e=this.documentBounds,i=this.viewportBounds,h=e.right,f=i.right,n=e.bottom,d=i.bottom,o=e.x,l=i.x,r=e.y,e=i.y,u>=s&&o>=l&&h<=f&&(this.Pp.style.width="1px"),c>=a&&r>=e&&n<=d&&(this.Pp.style.height="1px"))}},Ko.prototype.computeBounds=function(){return 0<this.wd.count&&Sr(this),or(this)},Ko.prototype.computePartsBounds=function(t,e){void 0===e&&(e=!1);var i=null;if(C(t))for(var n=0;n<t.length;n++){var o=t[n];!e&&o instanceof Nc||(o.Ta(),null===i?i=o.actualBounds.copy():i.Rc(o.actualBounds))}else for(t=t.iterator;t.next();)n=t.value,!e&&n instanceof Nc||(n.Ta(),null===i?i=n.actualBounds.copy():i.Rc(n.actualBounds));return null===i?new zt(NaN,NaN,0,0):i},Ko.prototype.zoomToFit=function(){var t=this.Ti;this.Ti=Ts,this.scale=sr(this,bs),t!==Ts&&(rr(this,!1),ar(this,this.documentBounds,this.ya/this.Aa,this.xa/this.Aa,this.Dj,!1)),this.Ti=t},i=Ko.prototype,i.mB=function(t,e){void 0===e&&(e=bs);var i=t.width,n=t.height;if(!(0===i||0===n||isNaN(i)&&isNaN(n))){var o=1;if(e===bs||e===ws)if(isNaN(i))o=this.viewportBounds.height*this.scale/n;else if(isNaN(n))o=this.viewportBounds.width*this.scale/i;else{o=this.ya;var r=this.xa;o=e===ws?r/n>o/i?(r-(this.pe?this.rb:0))/n:(o-(this.Ye?this.rb:0))/i:Math.min(r/n,o/i)}this.scale=o,this.position=new pt(t.x,t.y)}},i.uz=function(t,e){this.Ta();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))},i.kA=function(t){if(t instanceof ca){this.ao=t;var e=pt.alloc();this.bo=this.gr(t.da(ne,e)),pt.free(e)}else this.ao=null,this.bo=Dt},i.zm=function(t,e){if(void 0===e&&(e=!0),e){if(t=hr(this,t,(function(t){return t.part}),(function(t){return t.canSelect()})),t instanceof Lu)return t}else if(t=hr(this,t,(function(t){return t.part})),t instanceof Lu)return t;return null},i.Vb=function(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null),Sr(this);for(var n=this.Ma.iteratorBackwards;n.next();){var o=n.value;if(o.visible&&(o=o.Vb(t,e,i),null!==o))return o}return null},i.Zz=function(t,e,i){return void 0===e&&(e=!0),lr(this,t,(function(t){return t.part}),e?function(t){return t instanceof Lu&&t.canSelect()}:null,i)},i.hj=function(t,e,i,n){void 0===e&&(e=null),void 0===i&&(i=null),n instanceof et||n instanceof nt||(n=new nt),Sr(this);for(var o=this.Ma.iteratorBackwards;o.next();){var r=o.value;r.visible&&r.hj(t,e,i,n)}return n},i.ty=function(t,e,i,n){return void 0===e&&(e=!1),void 0===i&&(i=!0),ur(this,t,(function(t){return t instanceof Lu&&(!i||t.canSelect())}),e,n)},i.zf=function(t,e,i,n,o){void 0===e&&(e=null),void 0===i&&(i=null),void 0===n&&(n=!1),o instanceof et||o instanceof nt||(o=new nt),Sr(this);for(var r=this.Ma.iteratorBackwards;r.next();){var s=r.value;s.visible&&s.zf(t,e,i,n,o)}return o},i.Vv=function(t,e,i,n,o,r){var s=new nt;Sr(this);for(var a=this.Ma.iteratorBackwards;a.next();){var h=a.value;h.visible&&h.Vv(t,e,i,n,s,o,r)}return s},i.$z=function(t,e,i,n,o){return void 0===i&&(i=!0),void 0===n&&(n=!0),cr(this,t,e,(function(t){return t instanceof Lu&&(!n||t.canSelect())}),i,o)},i.Eg=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 et||o instanceof nt)&&(r=o),o=!0),r instanceof et||r instanceof nt||(r=new nt),Sr(this);for(var s=this.Ma.iteratorBackwards;s.next();){var a=s.value;a.visible&&a.Eg(t,e,i,n,o,r)}return r},Ko.prototype.acceptEvent=function(t){return fr(this,t,t instanceof MouseEvent)},Ko.prototype.BA=function(t){var e=this.C;if(!this.C.isEnabled)return!1;var i=fr(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(),mr(i,t)},Ko.prototype.CA=function(t){var e=this.C;if(!e.isEnabled)return!1;var i=fr(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(),mr(i,t)},Ko.prototype.Oz=function(t){var e=this.C;if(!e.isEnabled)return!1;var i=fr(e,t,!0);return null!==e.mouseEnter&&e.mouseEnter(i),mr(i,t)},Ko.prototype.Pz=function(t){var e=this.C;if(!e.isEnabled)return!1;var i=fr(e,t,!0);return null!==e.mouseLeave&&e.mouseLeave(i),mr(i,t)},Ko.prototype.getMouse=function(t){var e=this.wa;if(null===e)return new pt(0,0);var i=e.getBoundingClientRect();return e=t.clientX-this.ya/i.width*i.left,t=t.clientY-this.xa/i.height*i.top,null!==this.sb?vt(new pt(e,t),this.sb):new pt(e,t)},Ko.prototype.Na=function(){this.vi||(this.vi=!0,this.Db(!0))},Ko.prototype.redraw=function(){this.Sb||this.ac||(this.M(),Ar(this),Lr(this),this.Na(),this.hd())},i=Ko.prototype,i.AA=function(){return this.Ee},i.Jz=function(t){void 0===t&&(t=null);var e=this.animationManager,i=e.isEnabled;e.Bc(),e.isEnabled=!1,kr(this),this.qe=!1,this.Ts=new pt(NaN,NaN),e.isEnabled=i,this.ac=!0;var n=this;null!==t&&x((function(){n.ac=!1,uo(e,"Model"),t(n)}),1)},i.Db=function(t){if(void 0===t&&(t=!1),!0!==this.Ee&&!(this.Sb||!1===t&&this.ac)){this.Ee=!0;var e=this;y.requestAnimationFrame((function(){e.Ee&&e.hd()}))}},i.hd=function(){this.Kj&&!this.Ee||(this.Kj&&(this.Kj=!1),kr(this))},i.Vw=function(t,e){for(t.reset();t.next();){var i=t.value;!i.Nc()||i instanceof bc||(i.rj()?(i.measure(1/0,1/0),i.arrange()):e.add(i))}for(t.reset();t.next();)i=t.value,i instanceof bc&&i.isVisible()&&Pr(this,i);for(t.reset();t.next();)i=t.value,i instanceof Nc&&i.isVisible()&&(i.rj()?(i.measure(1/0,1/0),i.arrange()):e.add(i));for(t.reset();t.next();)i=t.value,i instanceof Qu&&i.isVisible()&&(i.rj()?(i.measure(1/0,1/0),i.arrange()):e.add(i))},i.Nd=function(t,e,i,n){if(this.xi||this.animationManager.isAnimating){void 0===n&&(n=i.viewportBounds);for(var o=0;o<e;o++)t[o].Nd(i,n)}},i.mc=function(t,e){if(void 0===e&&(e=null),null!==this.Fa){null===this.wa&&w("No canvas specified");var i=this.animationManager;if(!i.sc&&(!i.isAnimating||i.isTicking)){var n=new Date;if(jr(this),"0"!==this.Fa.style.opacity){var o=t!==this.Gb,r=this.Ma.j,s=r.length,a=this;if(this.Nd(r,s,a),o)t.uc(!0),Lr(this);else if(!this.Dc&&null===e&&!i.isAnimating)return;s=this.la;var h=this.Aa,l=Math.round(s.x*h)/h,u=Math.round(s.y*h)/h;for(i=this.sb,i.reset(),1!==h&&i.scale(h),0===s.x&&0===s.y||i.translate(-l,-u),h=this.Tb,t.setTransform(1,0,0,1,0,0),t.scale(h,h),t.clearRect(0,0,this.ya,this.xa),1!==this.hb&&(t.globalAlpha=this.hb),Cr(this,t),l=null!==e?function(i){var n=e;if(i.visible&&0!==i.hb){var o=i.Ea.j,r=o.length;if(0!==r){var s=Xo(i,t),h=i.rp;h.length=0;for(var l=a.scale,u=zt.alloc(),c=0;c<r;c++){var f=o[c];n.contains(f)||i.dj(t,f,a,h,l,u,!0)}zt.free(u),t.globalAlpha=s}}}:function(e){e.mc(t,a)},s=r.length,u=0;u<s;u++)t.setTransform(1,0,0,1,0,0),t.scale(h,h),t.transform(i.m11,i.m12,i.m21,i.m22,i.dx,i.dy),l(r[u]);if(r=!1,this.ui?Vs(this.ui,this)&&(r=this.Tr()):r=!0,r&&(Ke.prototype.Jd=Ke.prototype.Zx),o?(this.Gb.uc(!0),Lr(this)):this.Dc=this.xi=!1,r=+new Date-+n,o=W&&W.my,n=this.hv,o||null===this.yh){for(n[this.ep]=r,this.ep=(this.ep+1)%n.length,i=r=0;i<n.length;i++)r+=n[i];this.cp=r/n.length}if(1!==this.hb&&(t.globalAlpha=1),o)for(t.setTransform(1,0,0,1,0,0),o=0;o<n.length;o++)t.fillText(n[o].toString(),20,150+20*o)}}}},i.Ke=function(t){return this.hf[t]},i.Ty=function(t,e){"minDrawingLength"===t&&(this.Xo=e),this.hf[t]=e,this.redraw()},i.xw=function(){this.hf=new _,this.hf.drawShadows=!0,this.hf.textGreeking=!0,this.hf.viewportOptimizations=!(X||z||V),this.hf.temporaryPixelRatio=!0,this.hf.pictureRatioOptimization=!0,this.Xo=this.hf.minDrawingLength=1},i.Bm=function(t){return this.Nj[t]},i.aB=function(t,e){this.Nj[t]=e},i.ww=function(){this.Nj=new _,this.Nj.extraTouchArea=10,this.Nj.extraTouchThreshold=10,this.Nj.hasGestureZoom=!0},i.Fw=function(t){Tr(this,t)},i.Hv=function(){if(0===this.undoManager.transactionLevel&&0!==this.Vg.count){for(;0<this.Vg.count;){var t=this.Vg;for(this.Vg=new dt,t=t.iterator;t.next();){var e=t.key;e.Oq(t.value),e.dc()}}this.M()}},i.M=function(t){if(void 0===t&&(t=null),null===t)this.Dc=!0,this.Db();else{var e=this.viewportBounds;null!==t&&t.s()&&e.Mc(t)&&(this.Dc=!0,this.Db())}this.R("InvalidateDraw")},Ko.prototype.invalidateViewport=function(t,e){if(!0!==this.Dc){this.Dc=!0;var i=!0===this.Ke("temporaryPixelRatio");if(!0===this.Ke("viewportOptimizations")&&this.scrollMode!==As&&this.Si.fj(0,0,0,0)&&e.width===t.width&&e.height===t.height){var n=this.scale,o=Math.max(t.x,e.x),r=Math.max(t.y,e.y);if(n=zt.allocAt(o,r,Math.max(0,Math.min(t.x+t.width,e.x+e.width)-o)*n,Math.max(0,Math.min(t.y+t.height,e.y+e.height)-r)*n),!this.gq&&0<n.width&&0<n.height){if(!(this.ac||(this.Ee=!1,null===this.Fa||(this.ac=!0,this.Hv(),this.documentBounds.s()||$r(this,this.computeBounds()),o=this.wa,null===o||o instanceof qa)))){var s=this.Tb;r=this.ya*s;var a=this.xa*s,h=this.scale*s,l=Math.round(Math.round(e.x*h)-Math.round(t.x*h));e=Math.round(Math.round(e.y*h)-Math.round(t.y*h)),h=this.Ju,t=this.ux,h.width!==r&&(h.width=r),h.height!==a&&(h.height=a),t.clearRect(0,0,r,a),h=190*s;var u=70*s,c=Math.max(l,0),f=Math.max(e,0),d=Math.floor(r-c),p=Math.floor(a-f);t.drawImage(o.Ja,c,f,d,p,0,0,d,p),Vs(this.ui,this)&&t.clearRect(0,0,h,u),o=j(),t=j(),p=Math.abs(l),d=Math.abs(e);var g=0===c?0:r-p;c=pt.allocAt(g,0),p=pt.allocAt(p+g,a),t.push(new zt(Math.min(c.x,p.x),Math.min(c.y,p.y),Math.abs(c.x-p.x),Math.abs(c.y-p.y)));var y=this.sb;if(y.reset(),y.scale(s,s),1!==this.Aa&&y.scale(this.Aa),s=this.la,(0!==s.x||0!==s.y)&&isFinite(s.x)&&isFinite(s.y)&&y.translate(-s.x,-s.y),vt(c,y),vt(p,y),o.push(new zt(Math.min(c.x,p.x),Math.min(c.y,p.y),Math.abs(c.x-p.x),Math.abs(c.y-p.y))),g=0===f?0:a-d,c.h(0,g),p.h(r,d+g),t.push(new zt(Math.min(c.x,p.x),Math.min(c.y,p.y),Math.abs(c.x-p.x),Math.abs(c.y-p.y))),vt(c,y),vt(p,y),o.push(new zt(Math.min(c.x,p.x),Math.min(c.y,p.y),Math.abs(c.x-p.x),Math.abs(c.y-p.y))),Vs(this.ui,this)&&(r=0<l?0:-l,a=0<e?0:-e,c.h(r,a),p.h(h+r,u+a),t.push(new zt(Math.min(c.x,p.x),Math.min(c.y,p.y),Math.abs(c.x-p.x),Math.abs(c.y-p.y))),vt(c,y),vt(p,y),o.push(new zt(Math.min(c.x,p.x),Math.min(c.y,p.y),Math.abs(c.x-p.x),Math.abs(c.y-p.y)))),pt.free(c),pt.free(p),wr(this,!1,!0),null===this.Fa&&w("No div specified"),null===this.wa&&w("No canvas specified"),!this.animationManager.sc&&(r=this.Gb,this.Dc)){for(jr(this),a=this.Tb,r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,this.ya*a,this.xa*a),r.drawImage(this.Ju.Ja,0<l?0:Math.round(-l),0<e?0:Math.round(-e)),l=this.la,s=this.Aa,h=Math.round(l.x*s)/s,u=Math.round(l.y*s)/s,e=this.sb,e.reset(),1!==s&&e.scale(s),0===l.x&&0===l.y||e.translate(-h,-u),r.save(),r.beginPath(),l=t.length,s=0;s<l;s++)h=t[s],0!==h.width&&0!==h.height&&r.rect(Math.floor(h.x),Math.floor(h.y),Math.ceil(h.width),Math.ceil(h.height));for(r.clip(),r.setTransform(1,0,0,1,0,0),r.scale(a,a),r.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy),e=this.Ma.j,l=e.length,this.Nd(e,l,this),Cr(this,r),r.globalAlpha=this.hb,a=0;a<l;a++)if(s=e[a],h=o,s.visible&&0!==s.hb){u=Xo(s,r),f=s.rp,f.length=0,c=this.scale,d=zt.alloc(),p=s.Ea.j,y=p.length,g=h.length;for(var m=0;m<y;m++){var v=p[m],x=Bu(v,v.actualBounds);t:{for(var b=2/c,k=4/c,M=0;M<g;M++){var S=h[M];if(0!==S.width&&0!==S.height&&x.cw(S.x-b,S.y-b,S.width+k,S.height+k)){x=!0;break t}}x=!1}x&&s.dj(r,v,this,f,c,d,!0)}zt.free(d),r.globalAlpha=u}r.restore(),r.uc(!0),this.ui&&Vs(this.ui,this)&&this.Tr(),this.Dc=this.xi=!1,this.Yq()}O(o),O(t),this.ac=!1}}else this.hd();zt.free(n),i&&(Jo(this),this.hd(),Zo(this,!0))}else i?(Jo(this),this.hd(),Zo(this,!0)):this.hd()}},i=Ko.prototype,i.add=function(t){var e=t.diagram;if(e!==this&&(null!==e&&w("Cannot add part "+t.toString()+" to "+this.toString()+". It is already a part of "+e.toString()),e=this.xk(t.layerName),null===e&&(e=this.xk("")),null===e&&w('Cannot add a Part when unable find a Layer named "'+t.layerName+'" and there is no default Layer'),t.layer!==e)){var i=e.oj(99999999,t,t.diagram===this);0<=i&&this.Va(Ni,"parts",e,null,t,null,i),e.isTemporary||this.Na(),t.B(1),i=t.layerChanged,null!==i&&i(t,null,e)}},i.oj=function(t){this.partManager.oj(t);var e=this;Jh(t,(function(t){Hr(e,t)})),(t instanceof Qu||t instanceof bc&&null!==t.placeholder)&&t.o(),null!==t.data&&Jh(t,(function(t){Md(e.partManager,t)})),!0!==Oa(t)&&!0!==Yu(t)||this.wd.add(t),Vu(t,!0,this),$u(t)?(t.actualBounds.s()&&this.M(Bu(t,t.actualBounds)),this.Na()):t.isVisible()&&t.actualBounds.s()&&this.M(Bu(t,t.actualBounds)),this.Db()},i.Lc=function(t){t.nk(),this.partManager.Lc(t);var e=this;null!==t.data&&Jh(t,(function(t){Sd(e.partManager,t,e)})),this.wd.remove(t),$u(t)?(t.actualBounds.s()&&this.M(Bu(t,t.actualBounds)),this.Na()):t.isVisible()&&t.actualBounds.s()&&this.M(Bu(t,t.actualBounds)),this.Db()},i.remove=function(t){Fr(this,t,!0)},i.gu=function(t,e){if(void 0===e&&(e=!1),C(t))for(var i=t.length,n=0;n<i;n++){var o=t[n];e&&!o.canDelete()||this.remove(o)}else for(i=new nt,i.addAll(t),t=i.iterator;t.next();)i=t.value,e&&!i.canDelete()||this.remove(i)},i.tk=function(t,e,i){return void 0===i&&(i=!1),this.partManager.tk(t,e,i)},Ko.prototype.moveParts=function(t,e,i,n){if(void 0===i&&(i=!1),void 0===n&&(n=Er(this)),null!==this.toolManager){var o=new dt;if(null!==t)if(C(t))for(var r=0;r<t.length;r++)Br(this,o,t[r],i,n);else for(t=t.iterator;t.next();)Br(this,o,t.value,i,n);else{for(t=this.parts;t.next();)Br(this,o,t.value,i,n);for(t=this.nodes;t.next();)Br(this,o,t.value,i,n);for(t=this.links;t.next();)Br(this,o,t.value,i,n)}Ir(this,o,e,n,i)}},Ko.prototype.computeMove=function(t,e,i,n){if(void 0===n&&(n=new pt),n.assign(e),null===t)return n;var o=e,r=i.isGridSnapEnabled;r&&(i.isGridSnapRealtime||this.lastInput.up)&&(o=pt.alloc(),Rr(this,t,e,o,i)),i=null!==t.dragComputation?t.dragComputation(t,e,o):o;var s=t.minLocation,a=s.x;isNaN(a)&&(a=r?Math.round(1e3*t.location.x)/1e3:t.location.x),s=s.y,isNaN(s)&&(s=r?Math.round(1e3*t.location.y)/1e3:t.location.y);var h=t.maxLocation,l=h.x;return isNaN(l)&&(l=r?Math.round(1e3*t.location.x)/1e3:t.location.x),h=h.y,isNaN(h)&&(h=r?Math.round(1e3*t.location.y)/1e3:t.location.y),n.h(Math.max(a,Math.min(i.x,l)),Math.max(s,Math.min(i.y,h))),o!==e&&pt.free(o),n},i=Ko.prototype,i.Cd=function(t,e,i){if(void 0===i)return new Ys(At);var n=t.isGridSnapEnabled;return t.groupsSnapMembers||null===e.containingGroup||(n=!1),new Ys(n?new pt(Math.round(1e3*i.x)/1e3,Math.round(1e3*i.y)/1e3):i.copy())},i.um=function(t){Yr(this,t,null),t.ee(this);var e=this.Ma,i=e.count-1;if(!t.isTemporary)for(;0<=i&&e.J(i).isTemporary;)i--;e.wb(i+1,t),null!==this.cc&&this.Va(Ni,"layers",this,null,t,null,i+1),this.M(),this.Na()},i.Ux=function(t,e){Yr(this,t,e),t.ee(this);var i=this.Ma,n=i.indexOf(t);0<=n&&(i.remove(t),null!==this.cc&&this.Va(Ci,"layers",this,t,null,n,null));var o,r=i.count;for(o=0;o<r;o++)if(i.J(o)===e){i.wb(o,t);break}null!==this.cc&&this.Va(Ni,"layers",this,null,t,null,o),this.M(),0>n&&this.Na()},i.nz=function(t,e){Yr(this,t,e),t.ee(this);var i=this.Ma,n=i.indexOf(t);0<=n&&(i.remove(t),null!==this.cc&&this.Va(Ci,"layers",this,t,null,n,null));var o,r=i.count;for(o=0;o<r;o++)if(i.J(o)===e){i.wb(o+1,t);break}null!==this.cc&&this.Va(Ni,"layers",this,null,t,null,o+1),this.M(),0>n&&this.Na()},i.TA=function(t){if(t.diagram!==this&&w("Cannot remove a Layer from another Diagram: "+t+" of "+t.diagram),""!==t.name){var e=this.Ma,i=e.indexOf(t);if(e.remove(t)){for(e=t.Ea.copy().iterator;e.next();){var n=e.value,o=n.layerName;o!==t.name?n.layerName=o:n.layerName=""}null!==this.cc&&this.Va(Ci,"layers",this,t,null,i,null),this.M(),this.Na()}}},i.xk=function(t){for(var e=this.layers;e.next();){var i=e.value;if(i.name===t)return i}return null},i.Wx=function(t){null===this.we&&(this.we=new et),this.we.add(t),this.model.Hh(t)},i.VA=function(t){null!==this.we&&(this.we.remove(t),0===this.we.count&&(this.we=null)),this.model.Tk(t)},i.Hh=function(t){null===this.Of&&(this.Of=new et),this.Of.add(t)},i.Tk=function(t){null!==this.Of&&(this.Of.remove(t),0===this.Of.count&&(this.Of=null))},i.zt=function(t){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.aw(t),t.change!==Si&&(this.isModified=!0),null!==this.Of)for(var e=this.Of,i=e.length,n=0;n<i;n++)e.J(n)(t)},i.Va=function(t,e,i,n,o,r,s){void 0===r&&(r=null),void 0===s&&(s=null);var a=new Mi;a.diagram=this,a.change=t,a.propertyName=e,a.object=i,a.oldValue=n,a.oldParam=r,a.newValue=o,a.newParam=s,this.zt(a)},i.g=function(t,e,i,n,o){this.Va(Pi,t,this,e,i,n,o)},Ko.prototype.changeState=function(t,e){if(null!==t&&t.diagram===this){var i=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var n=t.change;if(n===Pi){var o=t.object;if(hp(o,t.propertyName,t.G(e)),o instanceof ca){var r=o.part;null!==r&&r.Lb()}this.isModified=!0}else if(n===Ni){var s=t.object,a=t.newParam,h=t.newValue;if(s instanceof Uh)if("number"===typeof a&&h instanceof ca){e?s.Lc(a):s.wb(a,h);var l=s.part;null!==l&&l.Lb()}else"number"===typeof a&&h instanceof wl&&(h.isRow?al(s,a,e?void 0:h):hl(s,a,e?void 0:h));else if(s instanceof Yo){var u=!0===t.oldParam;"number"===typeof a&&h instanceof Lu&&(e?(h.isSelected=!1,h.isHighlighted=!1,h.Lb(),s.Lc(u?a:-1,h,u)):s.oj(a,h,u))}else s instanceof Ko?"number"===typeof a&&h instanceof Yo&&(e?this.Ma.cb(a):(h.ee(this),this.Ma.wb(a,h))):w("unknown ChangedEvent.Insert object: "+t.toString());this.isModified=!0}else if(n===Ci){var c=t.object,f=t.oldParam,d=t.oldValue;if(c instanceof Uh)"number"===typeof f&&d instanceof ca?e?c.wb(f,d):c.Lc(f):"number"===typeof f&&d instanceof wl&&(d.isRow?al(c,f,e?d:void 0):hl(c,f,e?d:void 0));else if(c instanceof Yo){var p=!0===t.newParam;"number"===typeof f&&d instanceof Lu&&(e?0>c.Ea.indexOf(d)&&c.oj(f,d,p):(d.isSelected=!1,d.isHighlighted=!1,d.Lb(),c.Lc(p?f:-1,d,p)))}else c instanceof Ko?"number"===typeof f&&d instanceof Yo&&(e?(d.ee(this),this.Ma.wb(f,d)):this.Ma.cb(f)):w("unknown ChangedEvent.Remove object: "+t.toString());this.isModified=!0}else n!==Si&&w("unknown ChangedEvent: "+t.toString())}finally{this.skipsModelSourceBindings=i}}},Ko.prototype.va=function(t){return this.undoManager.va(t)},Ko.prototype.Xa=function(t){return this.undoManager.Xa(t)},Ko.prototype.If=function(){return this.undoManager.If()},Ko.prototype.commit=function(t,e){void 0===e&&(e="");var i=this.skipsUndoManager;null===e&&(this.skipsUndoManager=!0,e=""),this.undoManager.va(e);var n=!1;try{t(this),n=!0}finally{n?this.undoManager.Xa(e):this.undoManager.If(),this.skipsUndoManager=i}},Ko.prototype.updateAllTargetBindings=function(t){this.partManager.updateAllTargetBindings(t)},Ko.prototype.ir=function(){this.partManager.ir()},Ko.prototype.onViewportBoundsChanged=function(t,e,i,n){if(!t.w(e)){void 0===n&&(n=!1),n||Ar(this),Lr(this);var o=this.layout;null===o||!o.isViewportSized||this.autoScale!==xs||n||t.width===e.width&&t.height===e.height||o.B(),o=this.currentTool,!0===this.Zf&&o instanceof Di&&(this.lastInput.documentPoint=this.ou(this.lastInput.viewPoint),Fi(o,this)),this.Sb||this.invalidateViewport(t,e),qr(this),this.Ic.scale=i,this.Ic.position.x=t.x,this.Ic.position.y=t.y,this.Ic.bounds.assign(t),this.Ic.Gv.width=Math.round(t.width*i),this.Ic.Gv.height=Math.round(t.height*i),this.Ic.kw.width=this.ya,this.Ic.kw.height=this.xa,this.Ic.hw=n,this.R("ViewportBoundsChanged",this.Ic,t),this.isVirtualized&&this.links.each((function(t){t.isAvoiding&&t.actualBounds.Mc(e)&&t.Ua()}))}},Ko.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.ma(),n=i.length,o=0;o<n;o++)i[o].isSelected=!1;e.ea(),e.clear(),e.freeze(),t||this.R("ChangedSelection",e)}},Ko.prototype.select=function(t){null!==t&&t.layer.diagram===this&&(!t.isSelected||1<this.selection.count)&&(this.R("ChangingSelection",this.selection),this.clearSelection(!0),t.isSelected=!0,this.R("ChangedSelection",this.selection))},Ko.prototype.$A=function(t){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),C(t))for(var e=t.length,i=0;i<e;i++){var n=t[i];n instanceof Lu||w("Diagram.selectCollection given something that is not a Part: "+n),n.isSelected=!0}else for(t=t.iterator;t.next();)e=t.value,e instanceof Lu||w("Diagram.selectCollection given something that is not a Part: "+e),e.isSelected=!0;this.R("ChangedSelection",this.selection)},Ko.prototype.clearHighlighteds=function(){var t=this.highlighteds;if(0<t.count){for(var e=t.ma(),i=e.length,n=0;n<i;n++)e[n].isHighlighted=!1;t.ea(),t.clear(),t.freeze()}},i=Ko.prototype,i.uA=function(t){null!==t&&t.layer.diagram===this&&(!t.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),t.isHighlighted=!0)},i.vA=function(t){t=(new nt).addAll(t);for(var e=this.highlighteds.copy().Zq(t).iterator;e.next();)e.value.isHighlighted=!1;for(t=t.iterator;t.next();)e=t.value,e instanceof Lu||w("Diagram.highlightCollection given something that is not a Part: "+e),e.isHighlighted=!0},i.scroll=function(t,e,i){void 0===i&&(i=1);var n="up"===e||"down"===e,o=0;if("pixel"===t)o=i;else if("line"===t)o=i*(n?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if("page"===t)t=n?this.viewportBounds.height:this.viewportBounds.width,t*=this.scale,0!==t&&(o=i*Math.max(t-(n?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if("document"===t)return o=this.documentBounds,i=this.viewportBounds,n=pt.alloc(),"up"===e?this.position=n.h(i.x,o.y):"left"===e?this.position=n.h(o.x,i.y):"down"===e?this.position=n.h(i.x,o.bottom-i.height):"right"===e&&(this.position=n.h(o.right-i.width,i.y)),void pt.free(n);w("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+t)}o/=this.scale,i=this.position.copy(),"up"===e?i.y=this.position.y-o:"down"===e?i.y=this.position.y+o:"left"===e?i.x=this.position.x-o:"right"===e?i.x=this.position.x+o:w("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+e),this.position=i},i.Aw=function(t){var e=this.viewportBounds;e.Ge(t)||(t=t.center,t.x-=e.width/2,t.y-=e.height/2,this.position=t)},i.At=function(t){var e=this.viewportBounds;t=t.center,t.x-=e.width/2,t.y-=e.height/2,this.position=t},i.gr=function(t){var e=this.sb;e.reset(),1!==this.Aa&&e.scale(this.Aa);var i=this.la;return(0!==i.x||0!==i.y)&&isFinite(i.x)&&isFinite(i.y)&&e.translate(-i.x,-i.y),t.copy().transform(this.sb)},i.iB=function(t){var e=this.sb,i=t.x,n=t.y,o=i+t.width,r=n+t.height,s=e.m11,a=e.m12,h=e.m21,l=e.m22,u=e.dx,c=e.dy,f=i*s+n*h+u;e=i*a+n*l+c;var d=o*s+n*h+u;return t=o*a+n*l+c,n=i*s+r*h+u,i=i*a+r*l+c,s=o*s+r*h+u,o=o*a+r*l+c,r=Math.min(f,d),f=Math.max(f,d),d=Math.min(e,t),e=Math.max(e,t),r=Math.min(r,n),f=Math.max(f,n),d=Math.min(d,i),e=Math.max(e,i),r=Math.min(r,s),f=Math.max(f,s),d=Math.min(d,o),e=Math.max(e,o),new zt(r,d,f-r,e-d)},i.ou=function(t){var e=this.sb;e.reset(),1!==this.Aa&&e.scale(this.Aa);var i=this.la;return(0!==i.x||0!==i.y)&&isFinite(i.x)&&isFinite(i.y)&&e.translate(-i.x,-i.y),vt(t.copy(),this.sb)},Ko.prototype.doModelChanged=function(t){var e=this;if(t.model===this.model){var i=t.change,n=t.propertyName;if(i===Si&&"S"===n[0])if("StartingFirstTransaction"===n){var o=this;t=this.toolManager,t.mouseDownTools.each((function(t){t.diagram=o})),t.mouseMoveTools.each((function(t){t.diagram=o})),t.mouseUpTools.each((function(t){t.diagram=o})),this.ac||this.qe||(this.Hj=!0,this.Kj&&(this.Ee=!0))}else"StartingUndo"===n||"StartingRedo"===n?(t=this.animationManager,t.defaultAnimation.isAnimating&&!this.skipsUndoManager&&t.Bc(),this.R("ChangingSelection",this.selection)):"StartedTransaction"===n&&(t=this.animationManager,t.defaultAnimation.isAnimating&&!this.skipsUndoManager&&t.Bc());else if(this.Z){this.Z=!1;try{if(""===t.modelChange&&i===Si){"FinishedUndo"!==n&&"FinishedRedo"!==n||(this.R("ChangedSelection",this.selection),Sr(this));var r=this.animationManager;"RolledBackTransaction"===n&&r.Bc(),this.Hj=!0,this.hd(),0!==this.undoManager.transactionLevel&&1!==this.undoManager.transactionLevel||fo(r),"CommittedTransaction"===n&&this.undoManager.isJustDiscarded&&(this.Xd=Math.min(this.Xd,this.undoManager.historyIndex-1)),"CommittedTransaction"!==n&&"RolledBackTransaction"!==n||!this.undoManager.isPendingUnmodified||setTimeout((function(){e.isModified=!1}),1);var s=t.isTransactionFinished;if(s&&(Ur(this),this.Yt.clear(),yo(this.animationManager)),!this.Bs&&s&&this.lastInput.targetDiagram){this.Bs=!0;var a=this;x((function(){a.currentTool.standardMouseOver(),a.Bs=!1}),10)}}}finally{this.Z=!0}}}},Ko.prototype.Md=function(){this.partManager.Md()},Ko.prototype.jk=function(t,e){this.Uc.jk(t,e)},Ko.prototype.lk=function(t,e){this.Uc.lk(t,e)},Ko.prototype.findPartForKey=function(t){return this.partManager.findPartForKey(t)},Ko.prototype.Cb=function(t){return this.partManager.Cb(t)},Ko.prototype.findLinkForKey=function(t){return this.partManager.findLinkForKey(t)},i=Ko.prototype,i.zc=function(t){return this.partManager.zc(t)},i.gj=function(t){return this.partManager.gj(t)},i.yc=function(t){return this.partManager.yc(t)},i.It=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];return this.partManager.It.apply(this.partManager,e instanceof Array?e:r(o(e)))},i.Ht=function(t){for(var e=[],i=0;i<arguments.length;++i)e[i]=arguments[i];return this.partManager.Ht.apply(this.partManager,e instanceof Array?e:r(o(e)))},i.Ta=function(){this.vi&&$r(this,this.computeBounds())},i.dA=function(){for(var t=new nt,e=this.nodes;e.next();){var i=e.value;i.isTopLevel&&t.add(i)}for(e=this.links;e.next();)i=e.value,i.isTopLevel&&t.add(i);return t.iterator},i.cA=function(){return this.Dh.iterator},i.EA=function(t){Sr(this),t&&Jr(this,!0),this.ac?Qr(this,!1):(this.Hj=!0,kr(this))},i.jA=function(){for(var t=new et,e=this.nodes;e.next();){var i=e.value;i.isTopLevel&&null===i.jj()&&t.add(i)}return t.iterator},i.kk=function(t,e){t=ns(this,t),null!==t&&t.add(e)},i.Lm=function(t,e){t=ns(this,t),null!==t&&t.remove(e)},i.R=function(t,e,i){var n=ns(this,t),o=new ki;if(o.diagram=this,t=is(this,t),null!==t&&(o.name=t),void 0!==e&&(o.subject=e),void 0!==i&&(o.parameter=i),e=n.length,1===e)n.J(0)(o);else if(0!==e)for(n=n.ma(),i=0;i<e;i++)(0,n[i])(o)},i.Ek=function(t,e){return void 0===e&&(e=null),rs(this,!1,null,e).Ek(t.x,t.y,t.width,t.height)},Ko.prototype.computeOccupiedArea=function(){return this.isVirtualized?this.viewportBounds.copy():this.vi?or(this):this.documentBounds.copy()},Ko.prototype.Et=function(t){this.rn.assign(t),this.computeAutoScrollPosition(this.rn).Qa(this.position)?this.Jf():ls(this)},Ko.prototype.Jf=function(){-1!==this.Bj&&(y.clearTimeout(this.Bj),this.Bj=-1)},Ko.prototype.computeAutoScrollPosition=function(t){var e=this.position,i=this.sn;if(0>=i.top&&0>=i.left&&0>=i.right&&0>=i.bottom)return e;var n=this.viewportBounds,o=this.scale;n=zt.allocAt(0,0,n.width*o,n.height*o);var r=pt.allocAt(0,0);if(t.x>=n.x&&t.x<n.x+i.left&&this.allowHorizontalScroll){var s=Math.max(this.scrollHorizontalLineChange,1);s|=0,r.x-=s,t.x<n.x+i.left/2&&(r.x-=s),t.x<n.x+i.left/4&&(r.x-=4*s)}else t.x<=n.x+n.width&&t.x>n.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.y<n.y+i.top&&this.allowVerticalScroll?(s=Math.max(this.scrollVerticalLineChange,1),s|=0,r.y-=s,t.y<n.y+i.top/2&&(r.y-=s),t.y<n.y+i.top/4&&(r.y-=4*s)):t.y<=n.y+n.height&&t.y>n.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.Qa(At)||(e=new pt(e.x+r.x/o,e.y+r.y/o)),zt.free(n),pt.free(r),e},i=Ko.prototype,i.$t=function(){return null},i.iw=function(){return null},i.rz=function(t,e){this.Kx.add(t,e)},i.GA=function(t){return ys?(void 0===t&&(t=new _),t.returnType="Image",this.Hy(t)):null},i.Hy=function(t){return void 0===t&&(t=new _),us(this,this.HA,t)},i.HA=function(t,e,i){var n=cs(i,t,"canvas",null);if(null===n)return null;i=n.Y.canvas;var o=null;if(null!==i)switch(o=t.returnType,o=void 0===o?"string":o.toLowerCase(),o){case Bs+"data":o=n.getImageData(0,0,i.width,i.height);break;case Bs:n=(t.document||document).createElement("img"),n.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"):"function"===typeof i.msToBlob?(e(i.msToBlob()),"msToBlob"):(e(null),null);default:o=i.toDataURL(t.type,t.details)}return"function"===typeof e?(e(o),null):o},d.Object.defineProperties(Ko.prototype,{div:{get:function(){return this.Fa},set:function(t){if(this.Fa!==t){var e=this.Fa;null!==e?(e.C=void 0,e.goDiagram=void 0,e.innerHTML="",null!==this.wa&&(e=this.wa.Ja,this.zj?(this.removeEventListener(e,"pointermove",this.Pk,!1),this.removeEventListener(e,"pointerdown",this.Ok,!1),this.removeEventListener(e,"pointerup",this.Rk,!1),this.removeEventListener(e,"pointerout",this.Qk,!1)):(this.removeEventListener(e,"touchstart",this.Ow,!1),this.removeEventListener(e,"touchmove",this.Nw,!1),this.removeEventListener(e,"touchend",this.Mw,!1)),this.wa.ky()),this.Zl&&(this.Zl.disconnect(),this.Zl=null),e=this.toolManager,null!==e&&(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.Gb=this.wa=null,this.removeEventListener(y,"resize",this.Ww,!1),this.zj||(this.removeEventListener(y,"mousemove",this.Ik,!0),this.removeEventListener(y,"mousedown",this.Hk,!0),this.removeEventListener(y,"mouseup",this.Kk,!0),this.removeEventListener(y,"mouseout",this.Jk,!0)),this.removeEventListener(y,"wheel",this.Lk,!0),fs===this&&(fs=null)):this.qe=!1,this.Fa=null,null!==t&&((e=t.C)&&(e.div=null),Gs(this,t),this.redraw())}}},Yx:{get:function(){return this.cp}},pj:{get:function(){return this.qe}},draggedLink:{get:function(){return this.Sr},set:function(t){this.Sr!==t&&(this.Sr=t,null!==t&&(this.Fs=t.fromPort,this.Gs=t.toPort))}},Ky:{get:function(){return this.Fs},set:function(t){this.Fs=t}},Ly:{get:function(){return this.Gs},set:function(t){this.Gs=t}},animationManager:{get:function(){return this.Uc}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.vg},set:function(t){this.vg=t,this.cc.skipsUndoManager=t}},delaysLayout:{get:function(){return this.Nr},set:function(t){this.Nr=t}},opacity:{get:function(){return this.hb},set:function(t){var e=this.hb;e!==t&&((0>t||1<t)&&M(t,"0 <= value <= 1",Ko,"opacity"),this.hb=t,this.g("opacity",e,t),this.M())}},validCycle:{get:function(){return this.tt},set:function(t){var e=this.tt;e!==t&&(this.tt=t,this.g("validCycle",e,t))}},layers:{get:function(){return this.Ma.iterator}},isModelReadOnly:{get:function(){var t=this.cc;return null!==t&&t.isReadOnly},set:function(t){var e=this.cc;null!==e&&(e.isReadOnly=t)}},isReadOnly:{get:function(){return this.$f},set:function(t){var e=this.$f;e!==t&&(this.$f=t,this.g("isReadOnly",e,t))}},isEnabled:{get:function(){return this.md},set:function(t){var e=this.md;e!==t&&(this.md=t,this.g("isEnabled",e,t))}},allowClipboard:{get:function(){return this.nr},set:function(t){var e=this.nr;e!==t&&(this.nr=t,this.g("allowClipboard",e,t))}},allowCopy:{get:function(){return this.$h},set:function(t){var e=this.$h;e!==t&&(this.$h=t,this.g("allowCopy",e,t))}},allowDelete:{get:function(){return this.ai},set:function(t){var e=this.ai;e!==t&&(this.ai=t,this.g("allowDelete",e,t))}},allowDragOut:{get:function(){return this.pr},set:function(t){var e=this.pr;e!==t&&(this.pr=t,this.g("allowDragOut",e,t))}},allowDrop:{get:function(){return this.qr},set:function(t){var e=this.qr;e!==t&&(this.qr=t,this.g("allowDrop",e,t))}},allowTextEdit:{get:function(){return this.ji},set:function(t){var e=this.ji;e!==t&&(this.ji=t,this.g("allowTextEdit",e,t))}},allowGroup:{get:function(){return this.bi},set:function(t){var e=this.bi;e!==t&&(this.bi=t,this.g("allowGroup",e,t))}},allowUngroup:{get:function(){return this.ki},set:function(t){var e=this.ki;e!==t&&(this.ki=t,this.g("allowUngroup",e,t))}},allowInsert:{get:function(){return this.sr},set:function(t){var e=this.sr;e!==t&&(this.sr=t,this.g("allowInsert",e,t))}},allowLink:{get:function(){return this.ci},set:function(t){var e=this.ci;e!==t&&(this.ci=t,this.g("allowLink",e,t))}},allowRelink:{get:function(){return this.ei},set:function(t){var e=this.ei;e!==t&&(this.ei=t,this.g("allowRelink",e,t))}},allowMove:{get:function(){return this.di},set:function(t){var e=this.di;e!==t&&(this.di=t,this.g("allowMove",e,t))}},allowReshape:{get:function(){return this.fi},set:function(t){var e=this.fi;e!==t&&(this.fi=t,this.g("allowReshape",e,t))}},allowResize:{get:function(){return this.gi},set:function(t){var e=this.gi;e!==t&&(this.gi=t,this.g("allowResize",e,t))}},allowRotate:{get:function(){return this.hi},set:function(t){var e=this.hi;e!==t&&(this.hi=t,this.g("allowRotate",e,t))}},allowSelect:{get:function(){return this.ii},set:function(t){var e=this.ii;e!==t&&(this.ii=t,this.g("allowSelect",e,t))}},allowUndo:{get:function(){return this.tr},set:function(t){var e=this.tr;e!==t&&(this.tr=t,this.g("allowUndo",e,t))}},allowZoom:{get:function(){return this.vr},set:function(t){var e=this.vr;e!==t&&(this.vr=t,this.g("allowZoom",e,t))}},hasVerticalScrollbar:{get:function(){return this.wl},set:function(t){var e=this.wl;e!==t&&(this.wl=t,Ar(this),this.M(),this.g("hasVerticalScrollbar",e,t),rr(this,!1))}},hasHorizontalScrollbar:{get:function(){return this.vl},set:function(t){var e=this.vl;e!==t&&(this.vl=t,Ar(this),this.M(),this.g("hasHorizontalScrollbar",e,t),rr(this,!1))}},allowHorizontalScroll:{get:function(){return this.rr},set:function(t){var e=this.rr;e!==t&&(this.rr=t,this.g("allowHorizontalScroll",e,t),rr(this,!1))}},allowVerticalScroll:{get:function(){return this.ur},set:function(t){var e=this.ur;e!==t&&(this.ur=t,this.g("allowVerticalScroll",e,t),rr(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.Ws},set:function(t){var e=this.Ws;e!==t&&(0>t&&M(t,">= 0",Ko,"scrollHorizontalLineChange"),this.Ws=t,this.g("scrollHorizontalLineChange",e,t))}},scrollVerticalLineChange:{get:function(){return this.$s},set:function(t){var e=this.$s;e!==t&&(0>t&&M(t,">= 0",Ko,"scrollVerticalLineChange"),this.$s=t,this.g("scrollVerticalLineChange",e,t))}},lastInput:{get:function(){return this.hh},set:function(t){this.hh=t}},previousInput:{get:function(){return this.od},set:function(t){this.od=t}},firstInput:{get:function(){return this.Wf},set:function(t){this.Wf=t}},currentCursor:{get:function(){return this.Hr},set:function(t){if(""===t&&(t=this.Pn),this.Hr!==t){var e=this.wa,i=this.Fa;if(null!==e){this.Hr=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.Pn},set:function(t){""===t&&(t="auto");var e=this.Pn;e!==t&&(this.Pn=t,this.g("defaultCursor",e,t))}},click:{get:function(){return this.Pf},set:function(t){var e=this.Pf;e!==t&&(this.Pf=t,this.g("click",e,t))}},doubleClick:{get:function(){return this.Uf},set:function(t){var e=this.Uf;e!==t&&(this.Uf=t,this.g("doubleClick",e,t))}},contextClick:{get:function(){return this.Qf},set:function(t){var e=this.Qf;e!==t&&(this.Qf=t,this.g("contextClick",e,t))}},mouseOver:{get:function(){return this.lg},set:function(t){var e=this.lg;e!==t&&(this.lg=t,this.g("mouseOver",e,t))}},mouseHover:{get:function(){return this.jg},set:function(t){var e=this.jg;e!==t&&(this.jg=t,this.g("mouseHover",e,t))}},mouseHold:{get:function(){return this.ig},set:function(t){var e=this.ig;e!==t&&(this.ig=t,this.g("mouseHold",e,t))}},mouseDragOver:{get:function(){return this.As},set:function(t){var e=this.As;e!==t&&(this.As=t,this.g("mouseDragOver",e,t))}},mouseDrop:{get:function(){return this.gg},set:function(t){var e=this.gg;e!==t&&(this.gg=t,this.g("mouseDrop",e,t))}},handlesDragDropForTopLevelParts:{get:function(){return this.cs},set:function(t){var e=this.cs;e!==t&&(this.cs=t,this.g("handlesDragDropForTopLevelParts",e,t))}},mouseEnter:{get:function(){return this.hg},set:function(t){var e=this.hg;e!==t&&(this.hg=t,this.g("mouseEnter",e,t))}},mouseLeave:{get:function(){return this.kg},set:function(t){var e=this.kg;e!==t&&(this.kg=t,this.g("mouseLeave",e,t))}},toolTip:{get:function(){return this.wg},set:function(t){var e=this.wg;e!==t&&(this.wg=t,this.g("toolTip",e,t))}},contextMenu:{get:function(){return this.Rf},set:function(t){var e=this.Rf;e!==t&&(this.Rf=t,this.g("contextMenu",e,t))}},commandHandler:{get:function(){return this.Br},set:function(t){this.Br!==t&&(this.Br=t,t.ee(this))}},toolManager:{get:function(){return this.pt},set:function(t){this.pt!==t&&(this.pt=t,t.diagram=this)}},defaultTool:{get:function(){return this.Mr},set:function(t){var e=this.Mr;e!==t&&(this.Mr=t,t.diagram=this,this.currentTool===e&&(this.currentTool=t))}},currentTool:{get:function(){return this.Jr},set:function(t){var e=this.Jr;null!==e&&(e.isActive&&e.doDeactivate(),e.cancelWaitAfter(),e.doStop()),null===t&&(t=this.defaultTool),null!==t&&(this.Jr=t,t.diagram=this,t.doStart())}},selection:{get:function(){return this.qv}},maxSelectionCount:{get:function(){return this.ws},set:function(t){var e=this.ws;if(e!==t)if(0<=t&&!isNaN(t)){if(this.ws=t,this.g("maxSelectionCount",e,t),!this.undoManager.isUndoingRedoing&&(t=this.selection.count-t,0<t)){this.R("ChangingSelection",this.selection),e=this.selection.ma();for(var i=0;i<t;i++)e[i].isSelected=!1;this.R("ChangedSelection",this.selection)}}else M(t,">= 0",Ko,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.kp},set:function(t){var e=this.kp;e!==t&&(this.kp=t,this.g("nodeSelectionAdornmentTemplate",e,t))}},groupSelectionAdornmentTemplate:{get:function(){return this.qo},set:function(t){var e=this.qo;e!==t&&(this.qo=t,this.g("groupSelectionAdornmentTemplate",e,t))}},linkSelectionAdornmentTemplate:{get:function(){return this.Lo},set:function(t){var e=this.Lo;e!==t&&(this.Lo=t,this.g("linkSelectionAdornmentTemplate",e,t))}},highlighteds:{get:function(){return this.Su}},isModified:{get:function(){var t=this.undoManager;return t.isEnabled?null!==t.currentTransaction||this.wo&&this.Xd!==t.historyIndex:this.wo},set:function(t){if(this.wo!==t){this.wo=t;var e=this.undoManager;!t&&e.isEnabled&&(this.Xd=e.historyIndex),t||Ur(this)}}},model:{get:function(){return this.cc},set:function(t){var e=this.cc;if(e!==t){this.currentTool.doCancel(),null!==e&&e.undoManager!==t.undoManager&&e.undoManager.isInTransaction&&w("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Bc(!0);var i=Ho(this,!0);this.qe=!1,this.Kj=!0,this.Xd=-2,this.Ee=!1;var n=this.ac;this.ac=!0,uo(this.animationManager,"Model"),null!==e&&(null!==this.we&&this.we.each((function(t){e.Tk(t)})),e.Tk(this.Tc)),this.cc=t,this.partManager=Kr(this.cc.type);for(var o=0;o<i.length;o++)this.add(i[o]);t.Hh(this.Cc),this.partManager.addAllModeledParts(),t.Tk(this.Cc),t.Hh(this.Tc),null!==this.we&&this.we.each((function(e){t.Hh(e)})),this.ac=n,this.Na(),this.Sb||this.M(),null!==e&&t.undoManager.copyProperties(e.undoManager)}}},Z:{get:function(){return this.av},set:function(t){this.av=t}},Yt:{get:function(){return this.Ax}},skipsModelSourceBindings:{get:function(){return this.rv},set:function(t){this.rv=t}},mu:{get:function(){return this.gt},set:function(t){this.gt=t}},nodeTemplate:{get:function(){return this.df.G("")},set:function(t){var e=this.df.G("");e!==t&&(this.df.add("",t),this.g("nodeTemplate",e,t),this.undoManager.isUndoingRedoing||this.Md())}},nodeTemplateMap:{get:function(){return this.df},set:function(t){var e=this.df;e!==t&&(this.df=t,this.g("nodeTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.Md())}},groupTemplate:{get:function(){return this.fh.G("")},set:function(t){var e=this.fh.G("");e!==t&&(this.fh.add("",t),this.g("groupTemplate",e,t),this.undoManager.isUndoingRedoing||this.Md())}},groupTemplateMap:{get:function(){return this.fh},set:function(t){var e=this.fh;e!==t&&(this.fh=t,this.g("groupTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.Md())}},linkTemplate:{get:function(){return this.bg.G("")},set:function(t){var e=this.bg.G("");e!==t&&(this.bg.add("",t),this.g("linkTemplate",e,t),this.undoManager.isUndoingRedoing||this.Md())}},linkTemplateMap:{get:function(){return this.bg},set:function(t){var e=this.bg;e!==t&&(this.bg=t,this.g("linkTemplateMap",e,t),this.undoManager.isUndoingRedoing||this.Md())}},isMouseCaptured:{get:function(){return this.Xu},set:function(t){var e=this.wa;null!==e&&(e=e.Ja,e instanceof SVGElement||(t?(this.lastInput.bubbles=!1,this.zj?(this.removeEventListener(e,"pointermove",this.Pk,!1),this.removeEventListener(e,"pointerdown",this.Ok,!1),this.removeEventListener(e,"pointerup",this.Rk,!1),this.removeEventListener(e,"pointerout",this.Qk,!1),this.addEventListener(y,"pointermove",this.Pk,!0),this.addEventListener(y,"pointerdown",this.Ok,!0),this.addEventListener(y,"pointerup",this.Rk,!0),this.addEventListener(y,"pointerout",this.Qk,!0)):(this.removeEventListener(e,"mousemove",this.Ik,!1),this.removeEventListener(e,"mousedown",this.Hk,!1),this.removeEventListener(e,"mouseup",this.Kk,!1),this.removeEventListener(e,"mouseout",this.Jk,!1),this.addEventListener(y,"mousemove",this.Ik,!0),this.addEventListener(y,"mousedown",this.Hk,!0),this.addEventListener(y,"mouseup",this.Kk,!0),this.addEventListener(y,"mouseout",this.Jk,!0)),this.removeEventListener(e,"wheel",this.Lk,!1),this.addEventListener(y,"wheel",this.Lk,!0),this.addEventListener(y,"selectstart",this.preventDefault,!1)):(this.zj?(this.removeEventListener(y,"pointermove",this.Pk,!0),this.removeEventListener(y,"pointerdown",this.Ok,!0),this.removeEventListener(y,"pointerup",this.Rk,!0),this.removeEventListener(y,"pointerout",this.Qk,!0),this.addEventListener(e,"pointermove",this.Pk,!1),this.addEventListener(e,"pointerdown",this.Ok,!1),this.addEventListener(e,"pointerup",this.Rk,!1),this.addEventListener(e,"pointerout",this.Qk,!1)):(this.removeEventListener(y,"mousemove",this.Ik,!0),this.removeEventListener(y,"mousedown",this.Hk,!0),this.removeEventListener(y,"mouseup",this.Kk,!0),this.removeEventListener(y,"mouseout",this.Jk,!0),this.addEventListener(e,"mousemove",this.Ik,!1),this.addEventListener(e,"mousedown",this.Hk,!1),this.addEventListener(e,"mouseup",this.Kk,!1),this.addEventListener(e,"mouseout",this.Jk,!1)),this.removeEventListener(y,"wheel",this.Lk,!0),this.removeEventListener(y,"selectstart",this.preventDefault,!1),this.addEventListener(e,"wheel",this.Lk,!1)),this.Xu=t))}},position:{get:function(){return this.la},set:function(t){var e=pt.alloc().assign(this.la);if(!e.w(t)){var i=this.viewportBounds.copy();this.la.assign(t),xo(this.animationManager,e,this.la),this.Sb||null===this.wa&&!this.sm.s()||(this.Sb=!0,t=this.scale,ar(this,this.Rn,this.ya/t,this.xa/t,this.Dj,!1),this.Sb=!1),this.Sb||this.onViewportBoundsChanged(i,this.viewportBounds,this.Aa,!1)}pt.free(e)}},initialPosition:{get:function(){return this.es},set:function(t){this.es.w(t)||(this.es=t.H())}},initialScale:{get:function(){return this.fs},set:function(t){this.fs!==t&&(this.fs=t)}},grid:{get:function(){return null===this.Ib&&er(this),this.Ib},set:function(t){var e=this.Ib;if(e!==t){null===e&&(er(this),e=this.Ib),t.type!==Uh.Grid&&w("Diagram.grid must be a Panel of type Panel.Grid");var i=e.panel;null!==i&&i.remove(e),this.Ib=t,t.name="GRID",null!==i&&i.add(t),qr(this),this.M(),this.g("grid",e,t)}}},viewportBounds:{get:function(){var t=this.Rx,e=this.la,i=this.Aa;return t.h(e.x,e.y,Math.max(this.ya,0)/i,Math.max(this.xa,0)/i),t}},viewSize:{get:function(){return this.sm},set:function(t){var e=this.viewSize;e.w(t)||(this.sm=t=t.H(),this.ya=t.width,this.xa=t.height,this.Na(),this.g("viewSize",e,t))}},fixedBounds:{get:function(){return this.Zr},set:function(t){var e=this.Zr;e.w(t)||(-1/0!==t.width&&1/0!==t.height&&-1/0!==t.height||w("fixedBounds width/height must not be Infinity"),this.Zr=t=t.H(),this.Na(),this.g("fixedBounds",e,t))}},scrollMargin:{get:function(){return this.Si},set:function(t){"number"===typeof t&&(t=new Qt(t));var e=this.Si;e.w(t)||(this.Si=t=t.H(),this.g("scrollMargin",e,t),this.Yq())}},scrollMode:{get:function(){return this.Ti},set:function(t){var e=this.Ti;e!==t&&(this.Ti=t,t===Ts&&rr(this,!1),this.g("scrollMode",e,t),this.M())}},scrollsPageOnFocus:{get:function(){return this.at},set:function(t){var e=this.at;e!==t&&(this.at=t,this.g("scrollsPageOnFocus",e,t))}},positionComputation:{get:function(){return this.Ns},set:function(t){var e=this.Ns;e!==t&&(this.Ns=t,rr(this,!1),this.g("positionComputation",e,t))}},scaleComputation:{get:function(){return this.Us},set:function(t){var e=this.Us;e!==t&&(this.Us=t,Xr(this,this.scale,this.scale),this.g("scaleComputation",e,t))}},documentBounds:{get:function(){return this.Rn}},isVirtualized:{get:function(){return this.rs},set:function(t){var e=this.rs;e!==t&&(this.rs=t,this.g("isVirtualized",e,t))}},scale:{get:function(){return this.Aa},set:function(t){var e=this.Aa;e!==t&&Xr(this,e,t)}},defaultScale:{get:function(){return this.Qn},set:function(t){this.Qn=t}},autoScale:{get:function(){return this.Og},set:function(t){var e=this.Og;e!==t&&(this.Og=t,this.g("autoScale",e,t),t!==xs&&rr(this,!1))}},initialAutoScale:{get:function(){return this.Yf},set:function(t){var e=this.Yf;e!==t&&(this.Yf=t,this.g("initialAutoScale",e,t))}},initialViewportSpot:{get:function(){return this.gs},set:function(t){var e=this.gs;e!==t&&(t.kb()||w("initialViewportSpot must be a specific Spot: "+t),this.gs=t,this.g("initialViewportSpot",e,t))}},initialDocumentSpot:{get:function(){return this.ds},set:function(t){var e=this.ds;e!==t&&(t.kb()||w("initialViewportSpot must be a specific Spot: "+t),this.ds=t,this.g("initialDocumentSpot",e,t))}},minScale:{get:function(){return this.xs},set:function(t){var e=this.xs;e!==t&&(0<t?(this.xs=t,this.g("minScale",e,t),t>this.scale&&(this.scale=t)):M(t,"> 0",Ko,"minScale"))}},maxScale:{get:function(){return this.vs},set:function(t){var e=this.vs;e!==t&&(0<t?(this.vs=t,this.g("maxScale",e,t),t<this.scale&&(this.scale=t)):M(t,"> 0",Ko,"maxScale"))}},zoomPoint:{get:function(){return this.xt},set:function(t){this.xt.w(t)||(this.xt=t=t.H())}},contentAlignment:{get:function(){return this.Dj},set:function(t){var e=this.Dj;e.w(t)||(this.Dj=t=t.H(),this.g("contentAlignment",e,t),rr(this,!1))}},initialContentAlignment:{get:function(){return this.to},set:function(t){var e=this.to;e.w(t)||(this.to=t=t.H(),this.g("initialContentAlignment",e,t))}},padding:{get:function(){return this.ib},set:function(t){"number"===typeof t&&(t=new Qt(t));var e=this.ib;e.w(t)||(this.ib=t=t.H(),this.Na(),this.g("padding",e,t))}},partManager:{get:function(){return this.La},set:function(t){var e=this.La;e!==t&&(null!==t.diagram&&w("Cannot share PartManagers between Diagrams: "+t.toString()),null!==e&&e.ee(null),this.La=t,t.ee(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.kc},set:function(t){var e=this.kc;e!==t&&(this.kc=t,t.diagram=this,t.group=null,this.Ng=!0,this.g("layout",e,t),this.Db())}},isTreePathToChildren:{get:function(){return this.qs},set:function(t){var e=this.qs;if(e!==t&&(this.qs=t,this.g("isTreePathToChildren",e,t),!this.undoManager.isUndoingRedoing))for(t=this.nodes;t.next();)lc(t.value)}},treeCollapsePolicy:{get:function(){return this.rt},set:function(t){var e=this.rt;e!==t&&(t!==Ls&&t!==js&&t!==Os&&w("Unknown Diagram.treeCollapsePolicy: "+t),this.rt=t,this.g("treeCollapsePolicy",e,t))}},Le:{get:function(){return this.Uu},set:function(t){this.Uu=t}},autoScrollInterval:{get:function(){return this.qn},set:function(t){var e=this.qn;e!==t&&(this.qn=t,this.g("autoScrollInterval",e,t))}},autoScrollRegion:{get:function(){return this.sn},set:function(t){"number"===typeof t&&(t=new Qt(t));var e=this.sn;e.w(t)||(this.sn=t=t.H(),this.Na(),this.g("autoScrollRegion",e,t))}}}),d.Object.defineProperties(Ko,{licenseKey:{get:function(){return Ds.Xb()},set:function(t){Ds.add(t)}},version:{get:function(){return Fs}}}),Ko.prototype.makeImageData=Ko.prototype.Hy,Ko.prototype.makeImage=Ko.prototype.GA,Ko.prototype.addRenderer=Ko.prototype.rz,Ko.prototype.makeSVG=Ko.prototype.iw,Ko.prototype.makeSvg=Ko.prototype.$t,Ko.prototype.stopAutoScroll=Ko.prototype.Jf,Ko.prototype.doAutoScroll=Ko.prototype.Et,Ko.prototype.isUnoccupied=Ko.prototype.Ek,Ko.prototype.raiseDiagramEvent=Ko.prototype.R,Ko.prototype.removeDiagramListener=Ko.prototype.Lm,Ko.prototype.addDiagramListener=Ko.prototype.kk,Ko.prototype.findTreeRoots=Ko.prototype.jA,Ko.prototype.layoutDiagram=Ko.prototype.EA,Ko.prototype.findTopLevelGroups=Ko.prototype.cA,Ko.prototype.findTopLevelNodesAndLinks=Ko.prototype.dA,Ko.prototype.ensureBounds=Ko.prototype.Ta,Ko.prototype.findLinksByExample=Ko.prototype.Ht,Ko.prototype.findNodesByExample=Ko.prototype.It,Ko.prototype.findLinkForData=Ko.prototype.yc,Ko.prototype.findNodeForData=Ko.prototype.gj,Ko.prototype.findPartForData=Ko.prototype.zc,Ko.prototype.findLinkForKey=Ko.prototype.findLinkForKey,Ko.prototype.findNodeForKey=Ko.prototype.Cb,Ko.prototype.findPartForKey=Ko.prototype.findPartForKey,Ko.prototype.rebuildParts=Ko.prototype.Md,Ko.prototype.transformViewToDoc=Ko.prototype.ou,Ko.prototype.transformRectDocToView=Ko.prototype.iB,Ko.prototype.transformDocToView=Ko.prototype.gr,Ko.prototype.centerRect=Ko.prototype.At,Ko.prototype.scrollToRect=Ko.prototype.Aw,Ko.prototype.scroll=Ko.prototype.scroll,Ko.prototype.highlightCollection=Ko.prototype.vA,Ko.prototype.highlight=Ko.prototype.uA,Ko.prototype.selectCollection=Ko.prototype.$A,Ko.prototype.select=Ko.prototype.select,Ko.prototype.updateAllRelationshipsFromData=Ko.prototype.ir,Ko.prototype.updateAllTargetBindings=Ko.prototype.updateAllTargetBindings,Ko.prototype.commit=Ko.prototype.commit,Ko.prototype.rollbackTransaction=Ko.prototype.If,Ko.prototype.commitTransaction=Ko.prototype.Xa,Ko.prototype.startTransaction=Ko.prototype.va,Ko.prototype.raiseChanged=Ko.prototype.g,Ko.prototype.raiseChangedEvent=Ko.prototype.Va,Ko.prototype.removeChangedListener=Ko.prototype.Tk,Ko.prototype.addChangedListener=Ko.prototype.Hh,Ko.prototype.removeModelChangedListener=Ko.prototype.VA,Ko.prototype.addModelChangedListener=Ko.prototype.Wx,Ko.prototype.findLayer=Ko.prototype.xk,Ko.prototype.removeLayer=Ko.prototype.TA,Ko.prototype.addLayerAfter=Ko.prototype.nz,Ko.prototype.addLayerBefore=Ko.prototype.Ux,Ko.prototype.addLayer=Ko.prototype.um,Ko.prototype.moveParts=Ko.prototype.moveParts,Ko.prototype.copyParts=Ko.prototype.tk,Ko.prototype.removeParts=Ko.prototype.gu,Ko.prototype.remove=Ko.prototype.remove,Ko.prototype.add=Ko.prototype.add,Ko.prototype.clearDelayedGeometries=Ko.prototype.Hv,Ko.prototype.setProperties=Ko.prototype.Fw,Ko.prototype.resetInputOptions=Ko.prototype.ww,Ko.prototype.setInputOption=Ko.prototype.aB,Ko.prototype.getInputOption=Ko.prototype.Bm,Ko.prototype.resetRenderingHints=Ko.prototype.xw,Ko.prototype.setRenderingHint=Ko.prototype.Ty,Ko.prototype.getRenderingHint=Ko.prototype.Ke,Ko.prototype.maybeUpdate=Ko.prototype.hd,Ko.prototype.requestUpdate=Ko.prototype.Db,Ko.prototype.delayInitialization=Ko.prototype.Jz,Ko.prototype.isUpdateRequested=Ko.prototype.AA,Ko.prototype.invalidateDocumentBounds=Ko.prototype.Na,Ko.prototype.findObjectsNear=Ko.prototype.Eg,Ko.prototype.findPartsNear=Ko.prototype.$z,Ko.prototype.findObjectsIn=Ko.prototype.zf,Ko.prototype.findPartsIn=Ko.prototype.ty,Ko.prototype.findObjectsAt=Ko.prototype.hj,Ko.prototype.findPartsAt=Ko.prototype.Zz,Ko.prototype.findObjectAt=Ko.prototype.Vb,Ko.prototype.findPartAt=Ko.prototype.zm,Ko.prototype.focusObject=Ko.prototype.kA,Ko.prototype.alignDocument=Ko.prototype.uz,Ko.prototype.zoomToRect=Ko.prototype.mB,Ko.prototype.zoomToFit=Ko.prototype.zoomToFit,Ko.prototype.diagramScroll=Ko.prototype.iy,Ko.prototype.focus=Ko.prototype.focus,Ko.useDOM=function(t){ys=!!t&&void 0!==y.document},Ko.isUsingDOM=function(){return ys};var fs=null,ds=new dt,ps=null,gs=null,ys=void 0!==y.document,ms=null,vs="",xs=new U(Ko,"None",0),bs=new U(Ko,"Uniform",1),ws=new U(Ko,"UniformToFill",2),ks=new U(Ko,"CycleAll",10),Ms=new U(Ko,"CycleNotDirected",11),Ss=new U(Ko,"CycleNotDirectedFast",12),Ps=new U(Ko,"CycleNotUndirected",13),Ns=new U(Ko,"CycleDestinationTree",14),Cs=new U(Ko,"CycleSourceTree",15),Ts=new U(Ko,"DocumentScroll",1),As=new U(Ko,"InfiniteScroll",2),Ls=new U(Ko,"TreeParentCollapsed",21),js=new U(Ko,"AllParentsCollapsed",22),Os=new U(Ko,"AnyParentsCollapsed",23),Ds=new et,Fs="2.1.53",Bs="image",Is=null,Es=!1;function Rs(){if(ys){var t=y.document.createElement("canvas"),e=t.getContext("2d"),i=E("7ca11abfd022028846");e[i]=E("398c3597c01238");for(var n=["5da73c80a36455d5038e4972187c3cae51fd22",m.Dx+"4ae6247590da4bb21c324ba3a84e385776",Ke.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",_e.za],o=1;5>o;o++)e[E("7ca11abfd7330390")](E(n[o-1]),10,15*o);for(e[i]=E("39f046ebb36e4b"),i=1;5>i;i++)e[E("7ca11abfd7330390")](E(n[i-1]),10,15*i);4===n.length&&"5"===n[0][0]&&"7"===n[3][0]||(Ke.prototype.Jd=Ke.prototype.Zx),Is=t}}function zs(){this.jz=null,this.l="zz@orderNum","63ad05bbe23a1786468a4c741b6d2"===this._tk?this.Ve=this.l=!0:this.Ve=null}function Vs(t,e){if(e.Gb.setTransform(e.Tb,0,0,e.Tb,0,0),null===t.Ve)t:{e="f";var i=y[E("76a715b2f73f148a")][E("72ba13b5")];if(t.Ve=!0,ys){var n=Ko[E("76a115b6ed251eaf4692")];if(n)for(var o=Ds.iterator;o.next();){if(n=o.value,n=E(n).split(E("39e9")),6>n.length)break;var r=E(n[1]).split(".");if("7da71ca0"!==n[4])break;var s=E(m[E("6cae19")]).split(".");if(r[0]>s[0]||r[0]===s[0]&&r[1]>=s[1]){for(r=i[E("76ad18b4f73e")],s=i[E("73a612b6fb191d")](E("35e7"))+2;s<r;s++)e+=i[s];if(r=e[E("73a612b6fb191d")](E(n[2])),0>r&&E(n[2])!==E("7da71ca0ad381e90")&&(r=e[E("73a612b6fb191d")](E("76a715b2ef3e149757"))),0>r&&(r=e[E("73a612b6fb191d")](E("76a715b2ef3e149757"))),0>r&&(r=i[E("73a612b6fb191d")](E("7baa19a6f76c1988428554"))),t.Ve=!(0<=r&&r<e[E("73a612b6fb191d")](E("35"))||-1===e[E("73a612b6fb191d")](E("35"))),!t.Ve)break;if(r=E(n[2]),"#"===r[0]){s=y.document.createElement("div");for(var a=n[0].replace(/[A-Za-z]/g,"");4>a.length;)a+="9";if(a=a.substr(a.length-4),n="",n+=["gsh","gsf"][parseInt(a.substr(0,1),10)%2],n+=["Header","Background","Display","Feedback"][parseInt(a.substr(0,1),10)%4],s[E("79a417a0f0181a8946")]=n,y.document[E("78a712aa")]){if(y.document[E("78a712aa")][E("7bb806b6ed32388c4a875b")](s),a=y.getComputedStyle(s).getPropertyValue(E("78a704b7e62456904c9b12701b6532a8")),y.document[E("78a712aa")][E("68ad1bbcf533388c4a875b")](s),a){if(-1!==a.indexOf(parseInt(r[1]+r[2],16))&&-1!==a.indexOf(parseInt(r[3]+r[4],16))){t.Ve=!1;break}if(R||z||V||G)for(n="."+n,r=0;r<document.styleSheets.length;r++)for(var h in s=document.styleSheets[r].rules||document.styleSheets[r].cssRules,s)if(n===s[h].selectorText){t.Ve=!1;break t}}}else t.Ve=null,t.Ve=!1}}}else{for(h=i[E("76ad18b4f73e")],o=i[E("73a612b6fb191d")](E("35e7"))+2;o<h;o++)e+=i[o];i=e[E("73a612b6fb191d")](E("7da71ca0ad381e90")),t.Ve=!(0<=i&&i<e[E("73a612b6fb191d")](E("35")))}}}return 0<t.Ve&&t!==t.jz}function Gs(t,e){if(ys){if(void 0!==e&&null!==e||w("Diagram setup requires an argument DIV."),null!==t.Fa&&w("Diagram has already completed setup."),"string"===typeof e?t.Fa=y.document.getElementById(e):e instanceof HTMLDivElement?t.Fa=e:w("No DIV or DIV id supplied: "+e),null===t.Fa&&w("Invalid DIV id; could not get element with id: "+e),void 0!==t.Fa.C&&w("Invalid div id; div already has a Diagram associated with it."),!t.Zl&&y.ResizeObserver){var i=v((function(){t.Db()}),250);t.Zl=new y.ResizeObserver((function(){i()})),t.Zl.observe(t.Fa)}"static"===y.getComputedStyle(t.Fa,null).position&&(t.Fa.style.position="relative"),e=5;var n="rgba(2"+e+"5, 255, 255, 0)";e--,t.Fa.style["-webkit-tap-highlight-color"]=n,t.Fa.style["-ms-touch-action"]="none",t.Fa.innerHTML="",t.Fa.C=t,t.Fa.goDiagram=t,t.Fa.go=y.go;var o=t.gq?new qa(t):new Ja(t);if(void 0!==o.style&&(o.style.position="absolute",o.style.top="0px",o.style.left="0px","rtl"===y.getComputedStyle(t.Fa,null).getPropertyValue("direction")&&(t.Gl=!0),o.style.zIndex="2",o.style.userSelect="none",o.style.MozUserSelect="none"),t.wa=o,t.Gb=o.context,n=t.Gb,t.Tb=t.computePixelRatio(),t.viewSize.s()||(t.ya=t.Fa.clientWidth||1,t.xa=t.Fa.clientHeight||1),Or(t,t.ya,t.xa),t.Fa.insertBefore(o.Ja,t.Fa.firstChild),o=new Ja(null),o.width=1,o.height=1,t.Ju=o,t.ux=o.context,ys){o=b("div");var r=b("div");o.style.position="absolute",o.style.overflow="auto",o.style.width=t.ya+"px",o.style.height=t.xa+"px",o.style.zIndex="1",r.style.position="absolute",r.style.width="1px",r.style.height="1px",t.Fa.appendChild(o),o.appendChild(r),o.onscroll=ir,o.addEventListener("mousedown",nr),o.addEventListener("touchstart",nr,{passive:!0}),o.C=t,o.hz=!0,o.iz=!0,t.Ys=o,t.Pp=r}t.Yq=v((function(){t.yh=null,t.M()}),300),t.Ww=v((function(){Qo(t)}),250),t.preventDefault=function(t){return t.preventDefault(),!1},t.Ik=function(e){if(t.isEnabled){t.Zf=!0;var i=fr(t,e,!0);t.doMouseMove(),t.currentTool.isBeyondDragSize()&&(t.xd=0),mr(i,e)}},t.Hk=function(e){if(t.isEnabled)if(t.Zf=!0,t.re)e.preventDefault();else{var i=fr(t,e,!0);i.down=!0,i.clickCount=e.detail,(z||V)&&(e.timeStamp-t.Sj<t.qt&&!t.currentTool.isBeyondDragSize()?t.xd++:t.xd=1,t.Sj=e.timeStamp,i.clickCount=t.xd),i.clone(t.firstInput),t.doMouseDown(),1===e.button?e.preventDefault():mr(i,e)}},t.Kk=function(e){if(t.isEnabled)if(t.re&&2===e.button)e.preventDefault();else if(t.re&&0===e.button&&(t.re=!1),t.hk)e.preventDefault();else{t.Zf=!0;var i=fr(t,e,!0);i.up=!0,i.clickCount=e.detail,(z||V)&&(i.clickCount=t.xd),i.bubbles=e.bubbles,i.targetDiagram=dr(e),t.doMouseUp(),t.Jf(),mr(i,e)}},t.Lk=function(e){if(t.isEnabled){var i=fr(t,e,!0);i.bubbles=!0;var n=0,o=0;i.delta=0,void 0!==e.deltaX?(0!==e.deltaX&&(n=0<e.deltaX?1:-1),0!==e.deltaY&&(o=0<e.deltaY?1:-1),i.delta=Math.abs(e.deltaX)>Math.abs(e.deltaY)?-n:-o):void 0!==e.wheelDeltaX?(0!==e.wheelDeltaX&&(n=0<e.wheelDeltaX?-1:1),0!==e.wheelDeltaY&&(o=0<e.wheelDeltaY?-1:1),i.delta=Math.abs(e.wheelDeltaX)>Math.abs(e.wheelDeltaY)?-n:-o):void 0!==e.wheelDelta&&0!==e.wheelDelta&&(i.delta=0<e.wheelDelta?1:-1),t.doMouseWheel(),mr(i,e)}},t.Jk=function(e){t.isEnabled&&(t.Zf=!1,fr(t,e,!0),e=t.currentTool,e.cancelWaitAfter(),e.standardMouseOver())},t.Ow=function(e){if(t.isEnabled){t.hk=!1,t.re=!0;var i=pr(t,e,e.targetTouches[0],1<e.touches.length),n=null;if(0<e.targetTouches.length?n=e.targetTouches[0]:0<e.changedTouches.length&&(n=e.changedTouches[0]),null!==n){var o=n.screenX;n=n.screenY;var r=t.Go;e.timeStamp-t.Sj<t.qt&&!(25<Math.abs(r.x-o)||25<Math.abs(r.y-n))?t.xd++:t.xd=1,i.clickCount=t.xd,t.Sj=e.timeStamp,t.Go.h(o,n)}t.doMouseDown(),mr(i,e)}},t.Nw=function(e){if(t.isEnabled){var i=null;0<e.targetTouches.length?i=e.targetTouches[0]:0<e.changedTouches.length&&(i=e.changedTouches[0]),i=gr(t,e,i,1<e.touches.length),t.doMouseMove(),mr(i,e)}},t.Mw=function(e){if(t.isEnabled)if(t.hk)e.preventDefault();else if(!(1<e.touches.length)){var i=null,n=null;0<e.targetTouches.length?n=e.targetTouches[0]:0<e.changedTouches.length&&(n=e.changedTouches[0]);var o=yr(t,e,!1,!0,!1,!1);null!==n&&(i=y.document.elementFromPoint(n.clientX,n.clientY),null!==i&&void 0!==i.shadowRoot&&null!==i&&null!==i.shadowRoot&&(i=i.shadowRoot.elementFromPoint(n.clientX,n.clientY)),null!==i&&i.C instanceof Ko&&i.C!==t&&vr(i.C,n,o),vr(t,n,o),o.clickCount=t.xd),null===i?o.targetDiagram=dr(e):i.C?o.targetDiagram=i.C:o.targetDiagram=null,o.targetObject=null,t.doMouseUp(),mr(o,e),t.re=!1}},t.Ok=function(e){if(t.isEnabled){t.Zf=!0;var i=t.Ls;void 0===i[e.pointerId]&&(i[e.pointerId]=e),i=t.bk;var n=!1;if(null!==i[0]&&i[0].pointerId===e.pointerId)i[0]=e;else if(null!==i[1]&&i[1].pointerId===e.pointerId)i[1]=e,n=!0;else if(null===i[0])i[0]=e;else{if(null!==i[1])return void e.preventDefault();i[1]=e,n=!0}"touch"!==e.pointerType&&"pen"!==e.pointerType||(t.hk=!1,t.re=!0),i=pr(t,e,e,n),n=t.Go;var o="touch"===e.pointerType||"pen"===e.pointerType?25:10;e.timeStamp-t.Sj<t.qt&&!(Math.abs(n.x-e.screenX)>o||Math.abs(n.y-e.screenY)>o)?t.xd++:t.xd=1,i.clickCount=t.xd,t.Sj=e.timeStamp,t.Go.Ig(e.screenX,e.screenY),t.doMouseDown(),1===e.button?e.preventDefault():mr(i,e)}},t.Pk=function(e){if(t.isEnabled){t.Zf=!0;var i=t.bk;if(null!==i[0]&&i[0].pointerId===e.pointerId)i[0]=e;else{if(null!==i[1]&&i[1].pointerId===e.pointerId)return void(i[1]=e);if(null!==i[0])return;i[0]=e}i[0].pointerId===e.pointerId&&(i=gr(t,e,e,null!==i[1]),i.targetDiagram=dr(e),t.doMouseMove(),mr(i,e))}},t.Rk=function(e){if(t.isEnabled){t.Zf=!0;var i="touch"===e.pointerType||"pen"===e.pointerType,n=t.Ls;if(i&&t.hk)delete n[e.pointerId],e.preventDefault();else if(n=t.bk,null!==n[0]&&n[0].pointerId===e.pointerId){n[0]=null,n=yr(t,e,!1,!0,!0,!1);var o=y.document.elementFromPoint(e.clientX,e.clientY);null!==o&&o.C instanceof Ko&&o.C!==t&&vr(o.C,e,n),vr(t,e,n),n.clickCount=t.xd,null===o?n.targetDiagram=dr(e):o.C?n.targetDiagram=o.C:n.targetDiagram=null,n.targetObject=null,t.doMouseUp(),mr(n,e),i&&(t.re=!1)}else null!==n[1]&&n[1].pointerId===e.pointerId&&(n[1]=null)}},t.Qk=function(e){if(t.isEnabled){t.Zf=!1;var i=t.Ls;i[e.pointerId]&&delete i[e.pointerId],i=t.bk,null!==i[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,e.cancelWaitAfter(),e.standardMouseOver())}},t.Tr=n.Y["d"+Qs[1]+Qs[2]+"wI"+Bs.slice(1,5)]["b"+dp.slice(1,e)](n.Y,Is,e,e),n.uc(!0),$o(t)}}function Ys(t){this.l=void 0===t?new pt:t,this.u=new pt}Ko.className="Diagram",Ko.fromDiv=function(t){var e=t;return"string"===typeof t&&(e=y.document.getElementById(t)),e instanceof HTMLDivElement&&e.C instanceof Ko?e.C:null},Ko.inherit=function(t,e){function i(){}if(Object.getPrototypeOf(t).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+t);i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t},Ko.None=xs,Ko.Uniform=bs,Ko.UniformToFill=ws,Ko.CycleAll=ks,Ko.CycleNotDirected=Ms,Ko.CycleNotDirectedFast=Ss,Ko.CycleNotUndirected=Ps,Ko.CycleDestinationTree=Ns,Ko.CycleSourceTree=Cs,Ko.DocumentScroll=Ts,Ko.InfiniteScroll=As,Ko.TreeParentCollapsed=Ls,Ko.AllParentsCollapsed=js,Ko.AnyParentsCollapsed=Os,zs.className="DiagramHelper",d.Object.defineProperties(Ys.prototype,{point:{get:function(){return this.l},set:function(t){this.l=t}},shifted:{get:function(){return this.u},set:function(t){this.u=t}}});var Xs,qs,Us,Ks,Hs,_s,Ws,$s,Js,Zs,Qs="DraggingInfo";function ta(t,e,i){this.node=t,this.info=e,this.$v=i}function ea(){this.reset()}function ia(t){1<arguments.length&&w("Palette constructor can only take one optional argument, the DIV HTML element or its id."),Ko.call(this,t),na(this)}function na(t){t.allowDragOut=!0,t.allowMove=!1,t.isReadOnly=!0,t.contentAlignment=oe,t.layout=new hd}function oa(t){1<arguments.length&&w("Overview constructor can only take one optional argument, the DIV HTML element or its id."),Ko.call(this,t);var e=this;this.animationManager.isEnabled=!1,this.Sb=!0,this.Ka=null,this.wl=this.vl=!1,this.I=this.T=!0,this.eb=0,this.u=!1,this.fm=null,this.Ty("drawShadows",!1);var i=new Lu,n=new Nl;n.stroke="magenta",n.strokeWidth=2,n.fill="transparent",n.name="BOXSHAPE",i.selectable=!0,i.selectionAdorned=!1,i.selectionObjectName="BOXSHAPE",i.locationObjectName="BOXSHAPE",i.resizeObjectName="BOXSHAPE",i.cursor="move",i.add(n),this.l=i,this.allowDelete=this.allowCopy=!1,this.allowSelect=!0,this.autoScrollRegion=new Qt(0,0,0,0),this.la.h(0,0),this.toolManager.Ya("Dragging",new aa,this.toolManager.mouseMoveTools),this.click=function(){var t=e.observed;if(null!==t){var i=t.viewportBounds,n=e.lastInput.documentPoint;t.position=new pt(n.x-i.width/2,n.y-i.height/2)}},this.Xh=function(){e.Na(),sa(e)},this.Wh=function(){null!==e.observed&&(e.Na(),e.M())},this.Sc=function(){1>e.updateDelay?e.M():e.u||(e.u=!0,setTimeout((function(){return e.redraw()}),e.updateDelay))},this.Od=function(){null!==e.observed&&sa(e)},this.autoScale=bs,this.Sb=!1}function ra(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)&&(o=zt.alloc().assign(t.viewportBounds).Rc(e.viewportBounds),qr(e,o),zt.free(o),Sr(e));var r=t.sb;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.Gb,o.scale(t.Tb,t.Tb),o.transform(r.m11,r.m12,r.m21,r.m22,r.dx,r.dy),e=e.Ma.j,r=e.length;for(var s=0;s<r;s++){var a=e[s],h=t;if(a.visible&&0!==a.opacity){var l=a.diagram.grid.part;if(!i&&a.isTemporary)n&&l.layer===a&&(a=Xo(a,o),l.mc(o,h),o.globalAlpha=a);else{for(var u=Xo(a,o),c=h.scale,f=zt.alloc(),d=a.Ea.j,p=d.length,g=0;g<p;g++){var y=d[g];(n||y!==l)&&a.dj(o,y,h,null,c,f,!1)}zt.free(f),o.globalAlpha=u}}}}}function sa(t){var e=t.box;if(null!==e){var i=t.observed;if(null!==i){t.Dc=!0,i=i.viewportBounds;var n=e.selectionObject,o=Bt.alloc();o.h(i.width,i.height),n.desiredSize=o,Bt.free(o),t=2/t.scale,n instanceof Nl&&(n.strokeWidth=t),e.location=new pt(i.x-t/2,i.y-t/2),e.isSelected=!0}}}function aa(){Gi.call(this),this.l=null}function ha(){ot(this),this.C=fs,this.eb=this.I=this.u=!0,this.T=this.Ka=this.Sc=this.La=!1,this.Ki=this.l=null,this.Od=1.05,this.bv=NaN,this.yx=null,this.Bv=NaN,this.Av=$t,this.Cc=!0,this.rg=null,this.Tc=200}function la(t,e,i){if(e.isVisible())return i;if(e instanceof Qu)la(t,e.adornedPart,i);else if(e instanceof Nc){var n=e.fromNode;null!==n&&la(t,n,i),e=e.toNode,null!==e&&la(t,e,i)}else e instanceof ec&&(n=e.labeledLink,null!==n&&la(t,n,i),n=e.Fg(),null!==n&&(n.isTreeExpanded||n.wasTreeExpanded||i.push(n),la(t,n,i))),e=e.containingGroup,null!==e&&(e.isSubGraphExpanded||e.wasSubGraphExpanded||i.push(e),la(t,e,i));return i}function ua(t){var e=j();for(t=t.iterator;t.next();){var i=t.value;i instanceof Nc||e.push(i)}t=new nt,i=e.length;for(var n=0;n<i;n++){for(var o=e[n],r=!0,s=0;s<i;s++)if(o.Kd(e[s])){r=!1;break}r&&t.add(o)}return O(e),t}function ca(){ot(this),this.F=4225027,this.hb=1,this.og=null,this.oa="",this.ec=this.mb=null,this.la=new pt(NaN,NaN).freeze(),this.Xc=Tt,this.fg=kt,this.eg=Ct,this.sb=new Ke,this.Zh=new Ke,this.cg=new Ke,this.Aa=this.ql=1,this.Yb=0,this.De=Ks,this.jh=Re,this.qc=new zt(NaN,NaN,NaN,NaN).freeze(),this.xb=new zt(NaN,NaN,NaN,NaN).freeze(),this.rc=new zt(0,0,NaN,NaN).freeze(),this.O=this.xp=this.yp=null,this.$k=this.yb=Ce,this.Jp=0,this.Kp=1,this.Rg=0,this.zn=1,this.aq=null,this.Qp=-1/0,this.am=0,this.bm=At,this.cm=tf,this.oi="",this.fb=this.N=null,this.dl=-1,this.em=this.Za=this.ni=this.im=null,this.Os=qs,this.Mp=this.Mg=this.ak=null}function fa(t){null===t.N&&(t.N=new Ga)}function da(t,e,i){var n=t.ij();if(null!==n)for(var o=t.fb.iterator;o.next();){var r=o.value,s=null;if(null!==r.sourceName){if(s=fp(r,n,t),null===s)continue;r.jr(t,s,i,null)}else if(r.isToModel){var a=e.diagram;null===a||a.skipsModelSourceBindings||r.jr(t,a.model.modelData,i,n)}else{if(a=n.data,null===a)continue;var h=e.diagram;null===h||h.skipsModelSourceBindings||r.jr(t,a,i,n)}s===t&&(a=n.Gt(r.wj),null!==a&&r.Tw(a,s,i))}}function pa(t,e,i,n,o){var r=t.qc,s=t.cg;s.reset(),ba(t,s,e,i,n,o),t.cg=s,r.h(e,i,n,o),s.Tt()||s.Pw(r)}function ga(t,e,i,n){return!1!==t.pickable&&(n.multiply(t.transform),i?t.Mc(e,n):t.Jh(e,n))}function ya(t,e,i,n,o){if(t.xb.h(e,i,n,o),!t.desiredSize.s()){var r=t.qc;i=t.jh,e=i.right+i.left;var s=i.top+i.bottom;switch(i=r.width+e,r=r.height+s,n+=e,o+=s,e=ka(t,!0),i===n&&r===o&&(e=qs),e){case qs:(i>n||r>o)&&(ja(t,!0),t.measure(i>n?n:i,r>o?o:r,0,0));break;case Xs:ja(t,!0),t.measure(n,o,0,0);break;case Hs:ja(t,!0),t.measure(n,r,0,0);break;case _s:ja(t,!0),t.measure(i,o,0,0)}}}function ma(t,e,i){var n=t.xb,o=t.rc;null!==t.ec&&(va(t,e,t.ec,!0,!0,o,n),t.ec instanceof eh&&t.ec.type===mh?(e.beginPath(),e.rect(n.x,n.y,n.width,n.height),e.Je(t.ec)):e.fillRect(n.x,n.y,n.width,n.height)),null!==t.mb&&(va(t,e,t.mb,!0,!1,o,n),t.mb instanceof eh&&t.mb.type===mh?(e.beginPath(),e.rect(n.x,n.y,n.width,n.height),e.Je(t.mb)):e.fillRect(n.x,n.y,n.width,n.height)),t.ej(e,i)}function va(t,e,i,n,o,r,s){if(null!==i){var a=1,h=1;if("string"===typeof i)n?e.fillStyle=i:e.strokeStyle=i;else if(i.type===gh)n?e.fillStyle=i.color:e.strokeStyle=i.color;else{var l=0;if(t instanceof Nl&&(l=t.strokeWidth),a=r.width,h=r.height,o?(a=s.width,h=s.height):n||(a+=l,h+=l),(r=e instanceof Za)&&i.ke&&(i.type===vh||i.gl===a&&i.Au===h))var u=i.ke;else{var c=0,f=0,d=0,p=0,g=0,y=0;if(y=g=0,o?(g=s.x,y=s.y):n||(g-=l/2,y-=l/2),c=i.start.x*a+i.start.offsetX,f=i.start.y*h+i.start.offsetY,d=i.end.x*a+i.end.offsetX,p=i.end.y*h+i.end.offsetY,c+=g,d+=g,f+=y,p+=y,i.type===yh)u=e.createLinearGradient(c,f,d,p);else if(i.type===mh)y=isNaN(i.endRadius)?Math.max(a,h)/2:i.endRadius,isNaN(i.startRadius)?(g=0,y=Math.max(a,h)/2):g=i.startRadius,u=e.createRadialGradient(c,f,g,d,p,y);else if(i.type===vh)try{u=e.createPattern(i.pattern,"repeat")}catch(v){u=null}if(i.type!==vh&&(o=i.colorStops,null!==o))for(o=o.iterator;o.next();)u.addColorStop(o.key,o.value);if(r&&(i.ke=u,null!==u&&(i.gl=a,i.Au=h),null===u&&i.type===vh&&-1!==i.gl)){i.gl=-1;var m=t.diagram;null!==m&&-1===i.gl&&x((function(){m.redraw()}),600)}}n?e.fillStyle=u:e.strokeStyle=u}}}function xa(t){if(0!==(2048&t.F)===!0){var e=t.sb;if(e.reset(),!t.xb.s()||!t.qc.s())return void Ta(t,!1);if(e.translate(t.xb.x-t.qc.x,t.xb.y-t.qc.y),1!==t.scale||0!==t.angle){var i=t.naturalBounds;ba(t,e,i.x,i.y,i.width,i.height)}Ta(t,!1),Aa(t,!0)}0!==(4096&t.F)===!0&&(e=t.panel,null===e?(t.Zh.set(t.sb),t.ql=t.scale,Aa(t,!1)):null!==e.Fd&&(i=t.Zh,i.reset(),e.he()?i.multiply(e.Zh):null!==e.panel&&i.multiply(e.panel.Zh),i.multiply(t.sb),t.ql=t.scale*e.ql,Aa(t,!1)))}function ba(t,e,i,n,o,r){if(1!==t.scale&&e.scale(t.scale),0!==t.Yb){var s=ae;t.Ff()&&t.locationSpot.kb()&&(s=t.locationSpot);var a=pt.alloc();if(t instanceof Lu&&t.locationObject!==t)for(i=t.locationObject,n=i.naturalBounds,a.Uk(n.x,n.y,n.width,n.height,s),i.cg.ta(a),a.offset(-i.measuredBounds.x,-i.measuredBounds.y),s=i.panel;null!==s&&s!==t;)s.cg.ta(a),a.offset(-s.measuredBounds.x,-s.measuredBounds.y),s=s.panel;else a.Uk(i,n,o,r,s);e.rotate(t.Yb,a.x,a.y),pt.free(a)}}function wa(t){if(!Oa(t)){var e=t.panel;null!==e?e.o():t.Ff()&&(e=t.diagram,null!==e&&(e.wd.add(t),t instanceof ec&&t.sd(),e.Db())),Da(t,!0)}}function ka(t,e){var i=t.stretch,n=t.panel;return null!==n&&n.type===Uh.Table?Ma(t,n.getRowDefinition(t.row),n.getColumnDefinition(t.column),e):null!==n&&n.type===Uh.Auto&&n.tb()===t?Sa(t,Xs,e):i===Ks?null!==n?n.type===Uh.Spot&&n.tb()===t?Sa(t,Xs,e):(i=n.defaultStretch,Sa(t,i===Ks?qs:i,e)):Sa(t,qs,e):Sa(t,i,e)}function Ma(t,e,i,n){var o=t.stretch;if(o!==Ks)return Sa(t,o,n);var r=o=null;switch(e.stretch){case _s:r=!0;break;case Xs:r=!0}switch(i.stretch){case Hs:o=!0;break;case Xs:o=!0}return e=t.panel.defaultStretch,null===o&&(o=e===Hs||e===Xs),null===r&&(r=e===_s||e===Xs),Sa(t,!0===o&&!0===r?Xs:!0===o?Hs:!0===r?_s:qs,n)}function Sa(t,e,i){if(i)return e;if(e===qs)return qs;if(i=t.desiredSize,i.s())return qs;if(t=t.angle,!isNaN(i.width))if(90!==t&&270!==t){if(e===Hs)return qs;if(e===Xs)return _s}else{if(e===_s)return qs;if(e===Xs)return Hs}if(!isNaN(i.height))if(90!==t&&270!==t){if(e===_s)return qs;if(e===Xs)return Hs}else{if(e===Hs)return qs;if(e===Xs)return _s}return e}function Pa(t,e){t.F=e?512|t.F:-513&t.F}function Na(t){return 0!==(1024&t.F)}function Ca(t,e){t.F=e?1024|t.F:-1025&t.F}function Ta(t,e){t.F=e?2048|t.F:-2049&t.F}function Aa(t,e){t.F=e?4096|t.F:-4097&t.F}function La(t){return 0!==(8192&t.F)}function ja(t,e){t.F=e?8192|t.F:-8193&t.F}function Oa(t){return 0!==(16384&t.F)}function Da(t,e){t.F=e?16384|t.F:-16385&t.F}function Fa(t){var e=t.part;if(e instanceof ec&&(null!==t.portId||t===e.port)){var i=e.diagram;null===i||i.undoManager.isUndoingRedoing||oc(e,t)}}function Ba(t){var e=t.diagram;null===e||e.undoManager.isUndoingRedoing||(t instanceof Uh?t instanceof ec?t.sd():t.an(t,(function(t){Fa(t)})):Fa(t))}function Ia(t,e){for(var i=1;i<arguments.length;++i);i=arguments;var n=null,o=null;if("function"===typeof t)o=t;else if("string"===typeof t){var r=Va.G(t);"function"===typeof r?(i=T(arguments),n=r(i),N(n)||w('GraphObject.make invoked object builder "'+t+'", but it did not return an Object')):o=y.go[t]}if(null===n&&(void 0!==o&&null!==o&&o.constructor||w("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+t),n=new o),o=1,n instanceof Ko&&1<i.length){r=n;var s=i[1];("string"===typeof s||s instanceof HTMLDivElement)&&(Gs(r,s),o++)}for(;o<i.length;o++)r=i[o],void 0===r?w("Undefined value at argument "+o+" for object being constructed by GraphObject.make: "+n):Ea(n,r);return n}function Ea(t,e){if("string"===typeof e)if(t instanceof Il)t.text=e;else if(t instanceof Nl)t.figure=e;else if(t instanceof cu)t.source=e;else if(t instanceof Uh)e=bl.G(e),null!==e&&(t.type=e);else if(t instanceof eh){var i=K(eh,e);null!==i?t.type=i:w("Unknown Brush type as an argument to GraphObject.make: "+e)}else t instanceof We?(e=K(We,e),null!==e&&(t.type=e)):t instanceof fi&&(e=K(fi,e),null!==e&&(t.type=e));else if(e instanceof ca)t instanceof Uh||w("A GraphObject can only be added to a Panel, not to: "+t),t.add(e);else if(e instanceof wl){var n;e.isRow&&"function"===typeof t.getRowDefinition?n=t.getRowDefinition(e.index):e.isRow||"function"!==typeof t.getColumnDefinition||(n=t.getColumnDefinition(e.index)),n instanceof wl?n.gy(e):w("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+t)}else if(e instanceof U)"function"===typeof t.jb&&t.jb(e);else if(e instanceof Lh)t.type=e;else if(e instanceof cp)t instanceof ca||t instanceof wl?t.bind(e):w("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+t);else if(e instanceof Eo)t instanceof ca?t.Qw(e):w("An AnimationTrigger can only be applied to a GraphObject, not to: "+t);else if(e instanceof ci)t instanceof We?t.figures.add(e):w("A PathFigure can only be added to a Geometry, not to: "+t);else if(e instanceof fi)t instanceof ci?t.segments.add(e):w("A PathSegment can only be added to a PathFigure, not to: "+t);else if(e instanceof zf)t instanceof Ko||t instanceof bc?t.layout=e:w("A Layout can only be assigned to a Diagram or a Group, not to: "+t);else if(Array.isArray(e))for(i=0;i<e.length;i++)Ea(t,e[i]);else if("object"===typeof e&&null!==e)if(t instanceof eh){for(var o in i=new _,e)n=parseFloat(o),isNaN(n)?i[o]=e[o]:t.addColorStop(n,e[o]);Tr(t,i)}else if(t instanceof wl){for(i in void 0!==e.row?(o=e.row,(void 0===o||null===o||1/0===o||isNaN(o)||0>o)&&w("Must specify non-negative integer row for RowColumnDefinition "+e+", not: "+o),t.isRow=!0,t.index=o):void 0!==e.column&&(o=e.column,(void 0===o||null===o||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 _,e)"row"!==i&&"column"!==i&&(o[i]=e[i]);Tr(t,o)}else Tr(t,e);else w('Unknown initializer "'+e+'" for object being constructed by GraphObject.make: '+t)}function Ra(t,e){Va.add(t,e)}function za(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}Ys.className="DraggingInfo",ta.className="DraggingNodeInfoPair",ea.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new Bt(NaN,NaN).freeze(),this.gridSnapCellSpot=ne,this.gridSnapOrigin=new pt(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},ea.className="DraggingOptions",f(ia,Ko),ia.prototype.reset=function(){Ko.prototype.reset.call(this),na(this)},ia.className="Palette",f(oa,Ko),oa.prototype.computePixelRatio=function(){return 1},oa.prototype.redraw=function(){if(this.u&&1<=this.updateDelay){this.u=!1;var t=this.wa,e=this.Gb;if(null!==t&&null!==e){if(jr(this),null===this.fm){var i=new Ja(null);i.width=t.width,i.height=t.height,this.fm=i}try{this.wa=this.fm,this.Gb=this.wa.context,this.Gb.uc(!0),this.Gb.setTransform(1,0,0,1,0,0),this.Gb.clearRect(0,0,this.wa.width,this.wa.height),ra(this)}finally{this.wa=t,this.Gb=e}}}Ko.prototype.redraw.call(this)},oa.prototype.mc=function(){if(null===this.Fa&&w("No div specified"),null===this.wa&&w("No canvas specified"),!(this.wa instanceof qa)&&(ju(this.box),this.Dc)){var t=this.observed;if(null!==t&&!t.animationManager.defaultAnimation.isAnimating&&t.pj){jr(this);var e=this.wa;t=this.Gb,t.uc(!0),t.setTransform(1,0,0,1,0,0),t.clearRect(0,0,e.width,e.height),1>this.updateDelay?ra(this):null!==this.fm&&(t.drawImage(this.fm.Ja,0,0),e=this.sb,e.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.Tb,this.Tb),t.transform(e.m11,e.m12,e.m21,e.m22,e.dx,e.dy)),e=this.Ma.j;for(var i=e.length,n=0;n<i;n++)e[n].mc(t,this);this.Dc=this.xi=!1}}},oa.prototype.computeBounds=function(){var t=this.observed;if(null===t)return $t;var e=t.documentBounds.copy();return e.Rc(t.viewportBounds),e},oa.prototype.invalidateViewport=function(){!0!==this.Dc&&(this.Dc=!0,this.Db())},oa.prototype.onViewportBoundsChanged=function(t,e,i,n){this.Sb||(Lr(this),this.M(),Ar(this),this.Na(),sa(this),this.Ic.scale=i,this.Ic.position.x=t.x,this.Ic.position.y=t.y,this.Ic.bounds.assign(t),this.Ic.hw=n,this.R("ViewportBoundsChanged",this.Ic,t))},d.Object.defineProperties(oa.prototype,{observed:{get:function(){return this.Ka},set:function(t){var e=this.Ka;if(t instanceof oa&&w("Overview.observed Diagram may not be an Overview itself: "+t),e!==t){if(null!==e&&(this.remove(this.box),e.Lm("ViewportBoundsChanged",this.Xh),e.Lm("DocumentBoundsChanged",this.Wh),e.Lm("InvalidateDraw",this.Sc),e.Lm("AnimationFinished",this.Od)),this.Ka=t,null!==t&&(t.kk("ViewportBoundsChanged",this.Xh),t.kk("DocumentBoundsChanged",this.Wh),t.kk("InvalidateDraw",this.Sc),t.kk("AnimationFinished",this.Od),this.add(this.box)),this.Na(),null===t){this.fm=null;var i=this.wa,n=this.Gb;i&&n&&(n.setTransform(1,0,0,1,0,0),n.clearRect(0,0,i.width,i.height))}else this.Sc(null),sa(this),this.M();this.g("observed",e,t)}}},box:{get:function(){return this.l},set:function(t){var e=this.l;e!==t&&(this.l=t,this.remove(e),this.add(this.l),sa(this),this.g("box",e,t))}},drawsTemporaryLayers:{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.redraw())}},drawsGrid:{get:function(){return this.I},set:function(t){this.I!==t&&(this.I=t,this.redraw())}},updateDelay:{get:function(){return this.eb},set:function(t){0>t&&(t=0),this.eb!==t&&(this.eb=t)}}}),oa.className="Overview",f(aa,Gi),aa.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.timestamp<this.delay))&&(null===this.findDraggablePart()&&(i=e.viewportBounds,this.l=new pt(i.width/2,i.height/2),t=t.firstInput.documentPoint,e.position=new pt(t.x-this.l.x,t.y-this.l.y)),!0)},aa.prototype.doActivate=function(){this.l=null,Gi.prototype.doActivate.call(this)},aa.prototype.doUpdateCursor=function(){var t=this.diagram,e=t.box;null!==e&&e.cursor&&(t.currentCursor=e.cursor)},aa.prototype.moveParts=function(){var t=this.diagram,e=t.observed;if(null!==e){var i=t.box;if(null!==i){if(null===this.l){var n=t.firstInput.documentPoint;i=i.location,this.l=new pt(n.x-i.x,n.y-i.y)}t=t.lastInput.documentPoint,e.position=new pt(t.x-this.l.x,t.y-this.l.y)}}},aa.className="OverviewDraggingTool",ha.prototype.toString=function(){return"CommandHandler"},ha.prototype.ee=function(t){this.C=t},ha.prototype.doKeyDown=function(){var t=this.diagram,e=t.lastInput,i=Y?e.meta:e.control,n=e.shift,o=e.alt,r=e.key;!i||"C"!==r&&"Insert"!==r?i&&"X"===r||n&&"Del"===r?this.canCutSelection()&&this.cutSelection():i&&"V"===r||n&&"Insert"===r?this.canPasteSelection()&&this.pasteSelection():i&&"Y"===r||o&&n&&"Backspace"===r?this.canRedo()&&this.redo():i&&"Z"===r||o&&"Backspace"===r?this.canUndo()&&this.undo():"Del"===r||"Backspace"===r?this.canDeleteSelection()&&this.deleteSelection():i&&"A"===r?this.canSelectAll()&&this.selectAll():"Esc"===r?this.canStopCommand()&&this.stopCommand():"Up"===r?t.allowVerticalScroll&&(i?t.scroll("pixel","up"):t.scroll("line","up")):"Down"===r?t.allowVerticalScroll&&(i?t.scroll("pixel","down"):t.scroll("line","down")):"Left"===r?t.allowHorizontalScroll&&(i?t.scroll("pixel","left"):t.scroll("line","left")):"Right"===r?t.allowHorizontalScroll&&(i?t.scroll("pixel","right"):t.scroll("line","right")):"PageUp"===r?n&&t.allowHorizontalScroll?t.scroll("page","left"):t.allowVerticalScroll&&t.scroll("page","up"):"PageDown"===r?n&&t.allowHorizontalScroll?t.scroll("page","right"):t.allowVerticalScroll&&t.scroll("page","down"):"Home"===r?i&&t.allowVerticalScroll?t.scroll("document","up"):!i&&t.allowHorizontalScroll&&t.scroll("document","left"):"End"===r?i&&t.allowVerticalScroll?t.scroll("document","down"):!i&&t.allowHorizontalScroll&&t.scroll("document","right"):" "===r?this.canScrollToPart()&&this.scrollToPart():"Subtract"===r?this.canDecreaseZoom()&&this.decreaseZoom():"Add"===r?this.canIncreaseZoom()&&this.increaseZoom():i&&"0"===r?this.canResetZoom()&&this.resetZoom():n&&"Z"===r?this.canZoomToFit()&&this.zoomToFit():i&&!n&&"G"===r?this.canGroupSelection()&&this.groupSelection():i&&n&&"G"===r?this.canUngroupSelection()&&this.ungroupSelection():"F2"===r||e.event&&"F2"===e.event.key?this.canEditTextBlock()&&this.editTextBlock():"ContextMenu"===r||e.event&&"ContextMenu"===e.event.key?this.canShowContextMenu()&&this.showContextMenu():e.bubbles=!0:this.canCopySelection()&&this.copySelection()},ha.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},ha.prototype.stopCommand=function(){var t=this.diagram,e=t.currentTool;e instanceof Di&&t.allowSelect&&t.clearSelection(),null!==e&&e.doCancel()},ha.prototype.canStopCommand=function(){return!0},ha.prototype.selectAll=function(){var t=this.diagram;t.M();try{t.currentCursor="wait",t.R("ChangingSelection",t.selection);for(var e=t.parts;e.next();)e.value.isSelected=!0;for(var i=t.nodes;i.next();)i.value.isSelected=!0;for(var n=t.links;n.next();)n.value.isSelected=!0}finally{t.R("ChangedSelection",t.selection),t.currentCursor=""}},ha.prototype.canSelectAll=function(){return this.diagram.allowSelect},ha.prototype.deleteSelection=function(){var t=this.diagram;try{t.currentCursor="wait",t.R("ChangingSelection",t.selection),t.va("Delete"),t.R("SelectionDeleting",t.selection);for(var e=new nt,i=t.selection.iterator;i.next();)Ju(e,i.value,!0,this.deletesTree?1/0:0,!!this.deletesConnectedLinks&&null,(function(t){return t.canDelete()}));t.gu(e,!0),t.R("SelectionDeleted",e)}finally{t.Xa("Delete"),t.R("ChangedSelection",t.selection),t.currentCursor=""}},ha.prototype.canDeleteSelection=function(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowDelete||0===t.selection.count)},ha.prototype.copySelection=function(){var t=this.diagram,e=new nt;for(t=t.selection.iterator;t.next();)Ju(e,t.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,(function(t){return t.canCopy()}));this.copyToClipboard(e)},ha.prototype.canCopySelection=function(){var t=this.diagram;return!(!t.allowCopy||!t.allowClipboard||0===t.selection.count)},ha.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},ha.prototype.canCutSelection=function(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowCopy||!t.allowDelete||!t.allowClipboard||0===t.selection.count)},ha.prototype.copyToClipboard=function(t){var e=this.diagram,i=null;if(null===t)ms=null,vs="";else{i=e.model;var n=!1,o=!1,r=null;try{i.Em()&&(n=i.sk,i.sk=this.copiesParentKey),i.Ck()&&(o=i.rk,i.rk=this.copiesGroupKey),r=e.tk(t,null,!0)}finally{i.Em()&&(i.sk=n),i.Ck()&&(i.rk=o),i=new et,i.addAll(r),ms=i,vs=e.model.dataFormat}}e.R("ClipboardChanged",i)},ha.prototype.pasteFromClipboard=function(){var t=new nt,e=ms;if(null===e)return t;var i=this.diagram;if(vs!==i.model.dataFormat)return t;var n=i.model,o=!1,r=!1,s=null;try{n.Em()&&(o=n.sk,n.sk=this.copiesParentKey),n.Ck()&&(r=n.rk,n.rk=this.copiesGroupKey),s=i.tk(e,i,!1)}finally{for(n.Em()&&(n.sk=o),n.Ck()&&(n.rk=r),e=s.iterator;e.next();)i=e.value,n=e.key,i.location.s()||(n.location.s()?i.location=n.location:!i.position.s()&&n.position.s()&&(i.position=n.position)),t.add(i)}return t},ha.prototype.pasteSelection=function(t){void 0===t&&(t=null);var e=this.diagram;try{e.currentCursor="wait",e.R("ChangingSelection",e.selection),e.va("Paste");var i=this.pasteFromClipboard();0<i.count&&e.clearSelection(!0);for(var n=i.iterator;n.next();)n.value.isSelected=!0;if(null!==t){var o=e.computePartsBounds(e.selection);if(o.s()){var r=this.computeEffectiveCollection(e.selection,e.kl);Ir(e,r,new pt(t.x-o.centerX,t.y-o.centerY),e.kl,!1)}}e.R("ClipboardPasted",i)}finally{e.Xa("Paste"),e.R("ChangedSelection",e.selection),e.currentCursor=""}},ha.prototype.canPasteSelection=function(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowClipboard||null===ms||0===ms.count||vs!==t.model.dataFormat)},ha.prototype.undo=function(){this.diagram.undoManager.undo()},ha.prototype.canUndo=function(){var t=this.diagram;return!t.isReadOnly&&!t.isModelReadOnly&&(t.allowUndo&&t.undoManager.canUndo())},ha.prototype.redo=function(){this.diagram.undoManager.redo()},ha.prototype.canRedo=function(){var t=this.diagram;return!t.isReadOnly&&!t.isModelReadOnly&&(t.allowUndo&&t.undoManager.canRedo())},ha.prototype.decreaseZoom=function(t){void 0===t&&(t=1/this.zoomFactor);var e=this.diagram;e.autoScale===xs&&(t=e.scale*t,t<e.minScale||t>e.maxScale||(e.scale=t))},ha.prototype.canDecreaseZoom=function(t){void 0===t&&(t=1/this.zoomFactor);var e=this.diagram;return e.autoScale===xs&&(t=e.scale*t,!(t<e.minScale||t>e.maxScale)&&e.allowZoom)},ha.prototype.increaseZoom=function(t){void 0===t&&(t=this.zoomFactor);var e=this.diagram;e.autoScale===xs&&(t=e.scale*t,t<e.minScale||t>e.maxScale||(e.scale=t))},ha.prototype.canIncreaseZoom=function(t){void 0===t&&(t=this.zoomFactor);var e=this.diagram;return e.autoScale===xs&&(t=e.scale*t,!(t<e.minScale||t>e.maxScale)&&e.allowZoom)},ha.prototype.resetZoom=function(t){void 0===t&&(t=this.defaultScale);var e=this.diagram;t<e.minScale||t>e.maxScale||(e.scale=t)},ha.prototype.canResetZoom=function(t){void 0===t&&(t=this.defaultScale);var e=this.diagram;return!(t<e.minScale||t>e.maxScale)&&e.allowZoom},ha.prototype.zoomToFit=function(){var t=this.diagram,e=t.animationManager;e.Bc(),t.redraw();var i=t.position,n=t.scale;uo(e,"Zoom To Fit"),this.isZoomToFitRestoreEnabled&&n===this.Bv&&!isNaN(this.bv)&&t.documentBounds.w(this.Av)?(t.scale=this.bv,t.position=this.yx,this.Bv=NaN,this.Av=$t):(this.bv=n,this.yx=i.copy(),t.zoomToFit(),this.Bv=t.scale,this.Av=t.documentBounds.copy()),fo(e)},ha.prototype.canZoomToFit=function(){return this.diagram.allowZoom},ha.prototype.scrollToPart=function(t){void 0===t&&(t=null);var e=this.diagram;if(e.Ta(),null===t){try{null!==this.rg&&(this.rg.next()?t=this.rg.value:this.rg=null)}catch(h){this.rg=null}null===t&&(0<e.highlighteds.count?this.rg=e.highlighteds.iterator:0<e.selection.count&&(this.rg=e.selection.iterator),null!==this.rg&&this.rg.next()&&(t=this.rg.value))}if(null!==t){var i=e.animationManager;uo(i,"Scroll To Part");var n=this.scrollToPartPause;if(0<n){var o=la(this,t,[t]);if(1===o.length)e.va(),e.At(t.actualBounds),e.Xa("Scroll To Part");else{var r=function(){e.va();for(var t=o.pop();0<o.length&&t instanceof ec&&t.isTreeExpanded&&(!(t instanceof bc)||t.isSubGraphExpanded);)t=o.pop();0<o.length?(t instanceof Lu&&e.Aw(t.actualBounds),t instanceof ec&&!t.isTreeExpanded&&(t.isTreeExpanded=!0),t instanceof bc&&!t.isSubGraphExpanded&&(t.isSubGraphExpanded=!0)):(t instanceof Lu&&e.At(t.actualBounds),e.Lm("LayoutCompleted",s)),e.Xa("Scroll To Part")},s=function(){x(r,(i.isEnabled?i.duration:0)+n)};e.kk("LayoutCompleted",s),r()}}else{var a=e.position.copy();e.At(t.actualBounds),a.Qa(e.position)&&i.Bc()}}},ha.prototype.canScrollToPart=function(t){return void 0===t&&(t=null),(null===t||t instanceof Lu)&&(t=this.diagram,(0!==t.selection.count||0!==t.highlighteds.count)&&(t.allowHorizontalScroll&&t.allowVerticalScroll))},ha.prototype.collapseTree=function(t){void 0===t&&(t=null);var e=this.diagram;try{e.va("Collapse Tree"),uo(e.animationManager,"Collapse Tree");var i=new et;if(null!==t&&t.isTreeExpanded)t.collapseTree(),i.add(t);else if(null===t)for(var n=e.selection.iterator;n.next();){var o=n.value;o instanceof ec&&o.isTreeExpanded&&(o.collapseTree(),i.add(o))}e.R("TreeCollapsed",i)}finally{e.Xa("Collapse Tree")}},ha.prototype.canCollapseTree=function(t){void 0===t&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(null!==t){if(!(t instanceof ec&&t.isTreeExpanded))return!1;if(0<t.Hq().count)return!0}else for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof ec&&e.isTreeExpanded&&0<e.Hq().count)return!0;return!1},ha.prototype.expandTree=function(t){void 0===t&&(t=null);var e=this.diagram;try{e.va("Expand Tree"),uo(e.animationManager,"Expand Tree");var i=new et;if(null===t||t.isTreeExpanded){if(null===t)for(var n=e.selection.iterator;n.next();){var o=n.value;o instanceof ec&&!o.isTreeExpanded&&(o.expandTree(),i.add(o))}}else t.expandTree(),i.add(t);e.R("TreeExpanded",i)}finally{e.Xa("Expand Tree")}},ha.prototype.canExpandTree=function(t){void 0===t&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(null!==t){if(!(t instanceof ec)||t.isTreeExpanded)return!1;if(0<t.Hq().count)return!0}else for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof ec&&!e.isTreeExpanded&&0<e.Hq().count)return!0;return!1},ha.prototype.groupSelection=function(){var t=this.diagram,e=t.model;if(e.Dk()){var i=this.archetypeGroupData;if(null!==i){var n=null;try{t.currentCursor="wait",t.R("ChangingSelection",t.selection),t.va("Group");for(var o=new et,r=t.selection.iterator;r.next();){var s=r.value;s.Nc()&&s.canGroup()&&o.add(s)}for(var a=new et,h=o.iterator;h.next();){var l=h.value;r=!1;for(var u=o.iterator;u.next();)if(l.Kd(u.value)){r=!0;break}r||a.add(l)}if(0<a.count){var c=a.first().containingGroup;if(null!==c)for(;null!==c;){o=!1;for(var f=a.iterator;f.next();)if(!f.value.Kd(c)){o=!0;break}if(!o)break;c=c.containingGroup}if(i instanceof bc)ul(i),n=i.copy(),null!==n&&t.add(n);else if(e.fw(i)){var d=e.copyNodeData(i);N(d)&&(e.uf(d),n=t.gj(d))}if(null!==n){null!==c&&this.isValidMember(c,n)&&(n.containingGroup=c);for(var p=a.iterator;p.next();){var g=p.value;this.isValidMember(n,g)&&(g.containingGroup=n)}t.clearSelection(!0),n.isSelected=!0}}t.R("SelectionGrouped",n)}finally{t.Xa("Group"),t.R("ChangedSelection",t.selection),t.currentCursor=""}}}},ha.prototype.canGroupSelection=function(){var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowInsert||!t.allowGroup||!t.model.Dk()||null===this.archetypeGroupData)return!1;for(t=t.selection.iterator;t.next();){var e=t.value;if(e.Nc()&&e.canGroup())return!0}return!1},ha.prototype.isValidMember=function(t,e){if(null===e||t===e||e instanceof Nc)return!1;if(null!==t){if(t===e||t.Kd(e))return!1;var i=t.memberValidation;if(null!==i&&!i(t,e)||null===t.data&&null!==e.data||null!==t.data&&null===e.data)return!1}return i=this.memberValidation,null===i||i(t,e)},ha.prototype.ungroupSelection=function(t){void 0===t&&(t=null);var e=this.diagram,i=e.model;if(i.Dk())try{e.currentCursor="wait",e.R("ChangingSelection",e.selection),e.va("Ungroup");var n=new et;if(null!==t)n.add(t);else for(var o=e.selection.iterator;o.next();){var r=o.value;r instanceof bc&&r.canUngroup()&&n.add(r)}var s=new et;if(0<n.count){e.clearSelection(!0);for(var a=n.iterator;a.next();){var h=a.value;h.expandSubGraph();var l=h.containingGroup,u=null!==l&&null!==l.data?i.ja(l.data):void 0;s.addAll(h.memberParts);for(var c=s.iterator;c.next();){var f=c.value;if(f.isSelected=!0,!(f instanceof Nc)){var d=f.data;null!==d?i.dr(d,u):f.containingGroup=l}}e.remove(h)}}e.R("SelectionUngrouped",n,s)}finally{e.Xa("Ungroup"),e.R("ChangedSelection",e.selection),e.currentCursor=""}},ha.prototype.canUngroupSelection=function(t){void 0===t&&(t=null);var e=this.diagram;if(e.isReadOnly||e.isModelReadOnly||!e.allowDelete||!e.allowUngroup||!e.model.Dk())return!1;if(null!==t){if(!(t instanceof bc))return!1;if(t.canUngroup())return!0}else for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof bc&&e.canUngroup())return!0;return!1},ha.prototype.addTopLevelParts=function(t,e){var i=!0;for(t=ua(t).iterator;t.next();){var n=t.value;null!==n.containingGroup&&(!e||this.isValidMember(null,n)?n.containingGroup=null:i=!1)}return i},ha.prototype.collapseSubGraph=function(t){void 0===t&&(t=null);var e=this.diagram;try{e.va("Collapse SubGraph"),uo(e.animationManager,"Collapse SubGraph");var i=new et;if(null!==t&&t.isSubGraphExpanded)t.collapseSubGraph(),i.add(t);else if(null===t)for(var n=e.selection.iterator;n.next();){var o=n.value;o instanceof bc&&o.isSubGraphExpanded&&(o.collapseSubGraph(),i.add(o))}e.R("SubGraphCollapsed",i)}finally{e.Xa("Collapse SubGraph")}},ha.prototype.canCollapseSubGraph=function(t){void 0===t&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(null!==t)return!!(t instanceof bc&&t.isSubGraphExpanded);for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof bc&&e.isSubGraphExpanded)return!0;return!1},ha.prototype.expandSubGraph=function(t){void 0===t&&(t=null);var e=this.diagram;try{e.va("Expand SubGraph"),uo(e.animationManager,"Expand SubGraph");var i=new et;if(null===t||t.isSubGraphExpanded){if(null===t)for(var n=e.selection.iterator;n.next();){var o=n.value;o instanceof bc&&!o.isSubGraphExpanded&&(o.expandSubGraph(),i.add(o))}}else t.expandSubGraph(),i.add(t);e.R("SubGraphExpanded",i)}finally{e.Xa("Expand SubGraph")}},ha.prototype.canExpandSubGraph=function(t){void 0===t&&(t=null);var e=this.diagram;if(e.isReadOnly)return!1;if(null!==t)return t instanceof bc&&!t.isSubGraphExpanded;for(t=e.selection.iterator;t.next();)if(e=t.value,e instanceof bc&&!e.isSubGraphExpanded)return!0;return!1},ha.prototype.editTextBlock=function(t){void 0===t&&(t=null);var e=this.diagram,i=e.toolManager.findTool("TextEditing");if(null!==i){if(null===t){t=null;for(var n=e.selection.iterator;n.next();){var o=n.value;if(o.canEdit()){t=o;break}}if(null===t)return;t=t.ym((function(t){return t instanceof Il&&t.editable}))}null!==t&&(e.currentTool=null,i.textBlock=t,e.currentTool=i)}},ha.prototype.canEditTextBlock=function(t){void 0===t&&(t=null);var e=this.diagram;if(e.isReadOnly||e.isModelReadOnly||!e.allowTextEdit||null===e.toolManager.findTool("TextEditing"))return!1;if(null!==t){if(!(t instanceof Il))return!1;if(t=t.part,null!==t&&t.canEdit())return!0}else for(e=e.selection.iterator;e.next();)if(t=e.value,t.canEdit()&&(t=t.ym((function(t){return t instanceof Il&&t.editable})),null!==t))return!0;return!1},ha.prototype.showContextMenu=function(t){var e=this.diagram,i=e.toolManager.findTool("ContextMenu");if(null!==i&&(void 0===t&&(t=0<e.selection.count?e.selection.first():e),t=i.findObjectWithContextMenu(t),null!==t)){var n=e.lastInput,o=null;t instanceof ca?o=t.da(ae):e.viewportBounds.$(n.documentPoint)||(o=e.viewportBounds,o=new pt(o.x+o.width/2,o.y+o.height/2)),null!==o&&(n.viewPoint=e.gr(o),n.documentPoint=o,n.left=!1,n.right=!0,n.up=!0),e.currentTool=i,Vn(i,!1,t)}},ha.prototype.canShowContextMenu=function(t){var e=this.diagram,i=e.toolManager.findTool("ContextMenu");return null!==i&&(void 0===t&&(t=0<e.selection.count?e.selection.first():e),null!==i.findObjectWithContextMenu(t))},ha.prototype.computeEffectiveCollection=function(t,e){var i=this.diagram,n=i.toolManager.findTool("Dragging"),o=i.currentTool===n;if(void 0===e&&(e=o?n.dragOptions:i.kl),n=new dt,null===t)return n;for(var r=t.iterator;r.next();)Br(i,n,r.value,o,e);if(null!==i.draggedLink&&e.dragsLink)return n;for(r=t.iterator;r.next();)t=r.value,t instanceof Nc&&(e=t.fromNode,null===e||n.contains(e)?(e=t.toNode,null===e||n.contains(e)||n.remove(t)):n.remove(t));return n},d.Object.defineProperties(ha.prototype,{diagram:{get:function(){return this.C}},copiesClipboardData:{get:function(){return this.u},set:function(t){this.u=t}},copiesConnectedLinks:{get:function(){return this.I},set:function(t){this.I=t}},deletesConnectedLinks:{get:function(){return this.eb},set:function(t){this.eb=t}},copiesTree:{get:function(){return this.La},set:function(t){this.La=t}},deletesTree:{get:function(){return this.Sc},set:function(t){this.Sc=t}},copiesParentKey:{get:function(){return this.Ka},set:function(t){this.Ka=t}},copiesGroupKey:{get:function(){return this.T},set:function(t){this.T=t}},archetypeGroupData:{get:function(){return this.l},set:function(t){this.l=t}},memberValidation:{get:function(){return this.Ki},set:function(t){this.Ki=t}},defaultScale:{get:function(){return this.diagram.defaultScale},set:function(t){this.diagram.defaultScale=t}},zoomFactor:{get:function(){return this.Od},set:function(t){1<t||w("zoomFactor must be larger than 1.0, not: "+t),this.Od=t}},isZoomToFitRestoreEnabled:{get:function(){return this.Cc},set:function(t){this.Cc=t}},scrollToPartPause:{get:function(){return this.Tc},set:function(t){this.Tc=t}}}),ha.className="CommandHandler",_o=function(){return new ha},ca.prototype.cloneProtected=function(t){t.F=6144|this.F,t.hb=this.hb,t.oa=this.oa,t.mb=this.mb,t.ec=this.ec,t.Mg=this.Mg,t.la.assign(this.la),t.Xc=this.Xc.H(),t.fg=this.fg.H(),t.eg=this.eg.H(),t.cg=this.cg.copy(),t.Aa=this.Aa,t.Yb=this.Yb,t.De=this.De,t.jh=this.jh.H(),t.qc.assign(this.qc),t.xb.assign(this.xb),t.rc.assign(this.rc),t.xp=this.xp,null!==this.O&&(t.O=this.O.copy()),t.yb=this.yb.H(),t.$k=this.$k.H(),t.Jp=this.Jp,t.Kp=this.Kp,t.Rg=this.Rg,t.zn=this.zn,t.aq=this.aq,t.Qp=this.Qp,t.am=this.am,t.bm=this.bm.H(),t.cm=this.cm,t.oi=this.oi,null!==this.N&&(t.N=this.N.copy()),t.fb=this.fb,t.dl=this.dl,null!==this.ni&&(t.ni=T(this.ni)),null!==this.Za&&(t.Za=this.Za.copy()),t.em=this.em},ca.prototype.Tx=function(t){var e=this.ni;if(C(e)){for(var i=0;i<e.length;i++)if(e[i]===t)return}else this.ni=e=[];e.push(t)},ca.prototype.yf=function(t){t.yp=null,t.ak=null,t.o()},ca.prototype.clone=function(){var t=new this.constructor;if(this.cloneProtected(t),null!==this.ni)for(var e=0;e<this.ni.length;e++){var i=this.ni[e];t[i]=this[i]}return t},ca.prototype.copy=function(){return this.clone()},i=ca.prototype,i.jb=function(t){t.classType===Nc?0===t.name.indexOf("Orient")?this.segmentOrientation=t:w("Unknown Link enum value for GraphObject.segmentOrientation property: "+t):t.classType===ca&&(this.stretch=t)},i.toString=function(){return D(this.constructor)+"#"+st(this)},i.Kc=function(){if(null===this.O){var t=new Rf;t.bh=ie,t.Ch=ie,t.$g=10,t.Ah=10,t.ah=0,t.Bh=0,this.O=t}},i.Va=function(t,e,i,n,o,r,s){var a=this.part;if(null!==a&&(a.Sk(t,e,i,n,o,r,s),i===this&&t===Pi&&Na(this)&&da(this,a,e),r=this.diagram,null===this.Mg||null===r||!r.pj||r.undoManager.isUndoingRedoing||r.currentTool!==r.toolManager||r.animationManager.tn||(t=this.Mg.get(e),null!==t&&r.animationManager.isEnabled&&!r.animationManager.isTicking&&(null===this.Mp&&(this.Mp=new dt),s=0===r.undoManager.transactionLevel,t.startCondition===Vo?s=!0:t.startCondition===Go&&(s=!1),s?(r=new To,Ro(t,r),s=this.Mp.get(t),null!==s&&s.stop(),this.Mp.add(t,r),r.xv=this,r.Ox=t,r.add(this,e,n,o),r.start()):(co(r.animationManager,"Trigger"),r.animationManager.defaultAnimation.add(this,e,n,o)))),this instanceof Uh&&i===a&&0!==(16777216&a.F)&&null!==a.data))for(i=this.W.j,n=i.length,o=0;o<n;o++)a=i[o],a instanceof Uh&&Jh(a,(function(t){null!==t.data&&0!==(16777216&t.F)&&t.Da(e)}))},i.Gt=function(t){return this.dl===t?this:null},i.g=function(t,e,i){this.Va(Pi,t,this,e,i)},i.sy=function(t,e,i){if(!1===this.pickable)return!1;var n=this.naturalBounds;return e=t.Ie(e),i?xt(t.x,t.y,0,0,0,n.height)<=e||xt(t.x,t.y,0,n.height,n.width,n.height)<=e||xt(t.x,t.y,n.width,n.height,n.width,0)<=e||xt(t.x,t.y,n.width,0,0,0)<=e:t.qd(0,0)<=e&&t.qd(0,n.height)<=e&&t.qd(n.width,0)<=e&&t.qd(n.width,n.height)<=e},i.he=function(){return!0},i.$=function(t){var e=pt.alloc();e.assign(t),this.transform.ta(e);var i=this.actualBounds;if(!i.s())return pt.free(e),!1;var n=this.diagram;if(null!==n&&n.re){var o=n.Bm("extraTouchThreshold"),r=n.Bm("extraTouchArea"),s=r/2,a=this.naturalBounds;n=this.Af()*n.scale;var h=1/n;if(a.width*n<o&&a.height*n<o)return t=_t(i.x-s*h,i.y-s*h,i.width+r*h,i.height+r*h,e.x,e.y),pt.free(e),t}return o=!1,(this instanceof Qu||this instanceof Nl?_t(i.x-5,i.y-5,i.width+10,i.height+10,e.x,e.y):i.$(e))&&(o=!(this.Za&&!this.Za.$(e))&&(!(null===this.ec||!i.$(e))||(!(null===this.mb||!this.rc.$(t))||this.Kh(t)))),pt.free(e),o},i.Kh=function(t){var e=this.naturalBounds;return _t(0,0,e.width,e.height,t.x,t.y)},i.Ge=function(t){if(0===this.angle)return this.actualBounds.Ge(t);var e=this.naturalBounds;e=zt.allocAt(0,0,e.width,e.height);var i=this.transform,n=!1,o=pt.allocAt(t.x,t.y);return e.$(i.Jd(o))&&(o.h(t.x,t.bottom),e.$(i.Jd(o))&&(o.h(t.right,t.bottom),e.$(i.Jd(o))&&(o.h(t.right,t.y),e.$(i.Jd(o))&&(n=!0)))),pt.free(o),zt.free(e),n},i.Jh=function(t,e){if(void 0===e)return t.Ge(this.actualBounds);var i=this.naturalBounds,n=!1,o=pt.allocAt(0,0);return t.$(e.ta(o))&&(o.h(0,i.height),t.$(e.ta(o))&&(o.h(i.width,i.height),t.$(e.ta(o))&&(o.h(i.width,0),t.$(e.ta(o))&&(n=!0)))),pt.free(o),n},i.Mc=function(t,e){if(void 0===e&&(e=this.transform,0===this.angle))return t.Mc(this.actualBounds);var i=this.naturalBounds,n=pt.allocAt(0,0),o=pt.allocAt(0,i.height),r=pt.allocAt(i.width,i.height),s=pt.allocAt(i.width,0),a=!1;if(t.$(e.ta(n))||t.$(e.ta(o))||t.$(e.ta(r))||t.$(e.ta(s)))a=!0;else{i=zt.allocAt(0,0,i.width,i.height);var h=pt.allocAt(t.x,t.y);i.$(e.Jd(h))?a=!0:(h.h(t.x,t.bottom),i.$(e.Jd(h))?a=!0:(h.h(t.right,t.bottom),i.$(e.Jd(h))?a=!0:(h.h(t.right,t.y),i.$(e.Jd(h))&&(a=!0)))),pt.free(h),zt.free(i),!a&&(_e.Qt(t,n,o)||_e.Qt(t,o,r)||_e.Qt(t,r,s)||_e.Qt(t,s,n))&&(a=!0)}return pt.free(n),pt.free(o),pt.free(r),pt.free(s),a},i.da=function(t,e){if(void 0===e&&(e=new pt),t instanceof Ge){var i=this.naturalBounds;e.h(t.x*i.width+t.offsetX,t.y*i.height+t.offsetY)}else e.set(t);return this.Fd.ta(e),e},i.mj=function(t){void 0===t&&(t=new zt);var e=this.naturalBounds,i=this.Fd,n=pt.allocAt(0,0).transform(i);return t.h(n.x,n.y,0,0),n.h(e.width,0).transform(i),Ht(t,n.x,n.y,0,0),n.h(e.width,e.height).transform(i),Ht(t,n.x,n.y,0,0),n.h(0,e.height).transform(i),Ht(t,n.x,n.y,0,0),pt.free(n),t},i.lj=function(){var t=this.Fd;return 1===t.m11&&0===t.m12?t=0:(t=180*Math.atan2(t.m12,t.m11)/Math.PI,0>t&&(t+=360)),t},i.Af=function(){if(0!==(4096&this.F)===!1)return this.ql;var t=this.Aa;return null!==this.panel?t*this.panel.Af():t},i.Mt=function(t,e){return void 0===e&&(e=new pt),e.assign(t),this.Fd.Jd(e),e},i.Nt=function(t,e,i){return this.zk(t.x,t.y,e.x,e.y,i)},i.zk=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,_e.Cf(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=_e.Cf(0,0,n.width,n.height,s,t,e,i,o),o.transform(r),i)},ca.prototype.measure=function(t,e,i,n){if(!1!==La(this)){var o=this.jh,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=0;this instanceof Nl&&(s=this.strokeWidth),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 Uh;switch(ka(this,!0)){case qs:s=o=0,a&&(e=t=1/0);break;case Xs:isFinite(t)&&t>i&&(o=t),isFinite(e)&&e>n&&(s=e);break;case Hs:isFinite(t)&&t>i&&(o=t),s=0,a&&(e=1/0);break;case _s:isFinite(e)&&e>n&&(s=e),o=0,a&&(t=1/0)}a=this.maxSize;var h=this.minSize;o>a.width&&h.width<a.width&&(o=a.width),s>a.height&&h.height<a.height&&(s=a.height),i=Math.max(o/this.scale,h.width),n=Math.max(s/this.scale,h.height),a.width<i&&(i=Math.min(h.width,i)),a.height<n&&(n=Math.min(h.height,n)),t=Math.min(a.width,t),e=Math.min(a.height,e),t=Math.max(i,t),e=Math.max(n,e),90!==r&&270!==r||(r=t,t=e,e=r,r=i,i=n,n=r),this.qc.ea(),this.Hm(t,e,i,n),this.qc.freeze(),this.qc.s()||w("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.qc.toString()),ja(this,!1)}},ca.prototype.Hm=function(){},ca.prototype.Ff=function(){return!1},ca.prototype.arrange=function(t,e,i,n,o){this.Fl();var r=zt.alloc();r.assign(this.xb),this.xb.ea(),!1===Oa(this)?this.xb.h(t,e,i,n):this.Ih(t,e,i,n),this.xb.freeze(),this.Za=void 0===o?null:o,i=!1,void 0!==o?i=!0:(o=this.panel,null===o||o.type!==Uh.TableRow&&o.type!==Uh.TableColumn||(o=o.panel),null!==o&&(o=o.rc,n=this.measuredBounds,null!==this.areaBackground&&(n=this.xb),i=e+n.height,n=t+n.width,i=!(0<=t+.05&&n<=o.width+.05&&0<=e+.05&&i<=o.height+.05),this instanceof Il&&(t=this.naturalBounds,this.us>t.height||this.vb>t.width))&&(i=!0)),this.F=i?256|this.F:-257&this.F,this.xb.s()||w("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.xb.toString()),this.Im(r,this.xb),Da(this,!1),zt.free(r)},i=ca.prototype,i.Ih=function(){},i.Im=function(t,e){var i=this.part;null!==i&&null!==i.diagram&&(i.selectionObject!==this&&i.resizeObject!==this&&i.rotateObject!==this||qu(i,!0),this.M(),Xt(t,e)||(i.Oh(),this.mp(i)))},i.mp=function(t){null!==this.portId&&(qu(t,!0),t instanceof ec&&oc(t,this))},i.mc=function(t,e){if(this.visible){var i=this instanceof Uh&&(this.type===Uh.TableRow||this.type===Uh.TableColumn),n=this.xb;if(i||0!==n.width&&0!==n.height&&!isNaN(n.x)&&!isNaN(n.y)){var o=this.opacity;if(0!==o){var r=1;if(1!==o&&(r=t.globalAlpha,t.globalAlpha=r*o),!this.ly(t,e))if(i)ma(this,t,e);else{this instanceof Nc&&this.Gk(!1),i=this.transform;var s=this.panel;0!==(4096&this.F)===!0&&xa(this);var a=this.part,h=!1,l=0;if(a&&e.Ke("drawShadows")&&(h=a.isShadowed)){var u=a.shadowOffset;l=Math.max(u.y,u.x)*e.scale*e.Tb}if(!(u=e.yi||!this.Ff())){var c=this.naturalBounds;u=this.Zh;var f,d=u.m11,p=u.m21,g=u.dx,y=u.m12,m=u.m22,v=u.dy,x=f=0;u=f*d+x*p+g;var b=f*y+x*m+v;f=c.width+l,x=0;var w=f*d+x*p+g;f=f*y+x*m+v,x=Math.min(u,w);var k=Math.min(b,f),M=Math.max(u+0,w)-x,S=Math.max(b+0,f)-k;u=x,b=k,f=c.width+l,x=c.height+l,w=f*d+x*p+g,f=f*y+x*m+v,x=Math.min(u,w),k=Math.min(b,f),M=Math.max(u+M,w)-x,S=Math.max(b+S,f)-k,u=x,b=k,f=0,x=c.height+l,w=f*d+x*p+g,f=f*y+x*m+v,x=Math.min(u,w),k=Math.min(b,f),M=Math.max(u+M,w)-x,S=Math.max(b+S,f)-k,u=x,b=k,l=e.viewportBounds,c=l.x,d=l.y,u=!(u>l.width+c||c>M+u||b>l.height+d||d>S+b)}if(u){if(u=0!==(256&this.F),t.clipInsteadOfFill&&(u=!1),this instanceof Il&&(t.font=this.font),u){if(b=s.he()?s.naturalBounds:s.actualBounds,null!==this.Za?(c=this.Za,M=c.x,S=c.y,l=c.width,c=c.height):(M=Math.max(n.x,b.x),S=Math.max(n.y,b.y),l=Math.min(n.right,b.right)-M,c=Math.min(n.bottom,b.bottom)-S),M>n.width+n.x||n.x>b.width+b.x)return void(1!==o&&(t.globalAlpha=r));t.save(),t.beginPath(),t.rect(M,S,l,c),t.clip()}if(this.Ff()){if(!a.isVisible())return void(1!==o&&(t.globalAlpha=r));h&&(b=a.shadowOffset,t.Iw(b.x*e.scale*e.Tb,b.y*e.scale*e.Tb,a.shadowBlur),$a(t),t.shadowColor=a.shadowColor)}h&&!0===this.shadowVisible?$a(t):h&&!1===this.shadowVisible&&Wa(t),a=this.naturalBounds,null!==this.ec&&(va(this,t,this.ec,!0,!0,a,n),this.ec instanceof eh&&this.ec.type===mh?(t.beginPath(),t.rect(n.x,n.y,n.width,n.height),t.Je(this.ec)):t.fillRect(n.x,n.y,n.width,n.height)),t.transform(i.m11,i.m12,i.m21,i.m22,i.dx,i.dy),h&&(null!==s&&0!==(512&s.F)||null!==s&&(s.type===Uh.Auto||s.type===Uh.Spot)&&s.tb()!==this)&&null===this.shadowVisible&&Wa(t),null!==this.mb&&(l=this.naturalBounds,M=b=0,S=l.width,l=l.height,c=0,this instanceof Nl&&(l=this.na.bounds,b=l.x,M=l.y,S=l.width,l=l.height,c=this.strokeWidth),va(this,t,this.mb,!0,!1,a,n),this.mb instanceof eh&&this.mb.type===mh?(t.beginPath(),t.rect(b-c/2,M-c/2,S+c,l+c),t.Je(this.mb)):t.fillRect(b-c/2,M-c/2,S+c,l+c)),h&&(null!==this.mb||null!==this.ec||null!==s&&0!==(512&s.F)||null!==s&&(s.type===Uh.Auto||s.type===Uh.Spot)&&s.tb()!==this)?(Pa(this,!0),null===this.shadowVisible&&Wa(t)):Pa(this,!1),this.ej(t,e),h&&0!==(512&this.F)===!0&&$a(t),this.Ff()&&h&&Wa(t),u?(t.restore(),this instanceof Uh?t.uc(!0):t.uc(!1)):i.Tt()||(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)))}}1!==o&&(t.globalAlpha=r)}}}},i.ly=function(){return!1},i.ej=function(){},i.Gg=function(t){if(t instanceof Uh)t:{if(this!==t&&null!==t)for(var e=this.panel;null!==e;){if(e===t){t=!0;break t}e=e.panel}t=!1}else t=!1;return t},i.Gf=function(){if(!this.visible)return!1;var t=this.panel;return null===t||t.Gf()},i.Hg=function(){for(var t=this instanceof Uh?this:this.panel;null!==t&&t.isEnabled;)t=t.panel;return null===t},i.o=function(t){if(!La(this)){void 0===t&&(t=!1),ja(this,!0),Da(this,!0);var e=this.panel;null===e||t||e.o()}},i.Bk=function(){La(this)||(ja(this,!0),Da(this,!0))},i.Fl=function(){0!==(2048&this.F)===!1&&(Ta(this,!0),Aa(this,!0))},i.dw=function(){Aa(this,!0)},i.M=function(){var t=this.part;null!==t&&t.M()},i.sj=function(t){this.og=t},i.lu=function(){},i.Ew=function(t){return this.la.assign(t),wa(this),!0},i.er=function(t,e){this.la.x===t&&this.la.y===e||(this.la.h(t,e),this.Fl())},i.bind=function(t){t.pd=this;var e=this.ij();null!==e&&ll(e)&&w("Cannot add a Binding to a template that has already been copied: "+t),null===this.fb&&(this.fb=new et),this.fb.add(t)},i.ij=function(){for(var t=this instanceof Uh?this:this.panel;null!==t;){if(null!==t.li)return t;t=t.panel}return null},i.Fw=function(t){Tr(this,t)},i.Qw=function(t){t.pd=this,null===this.Mg&&(this.Mg=new dt),this.Mg.add(t.propertyName,t)},d.Object.defineProperties(ca.prototype,{shadowVisible:{get:function(){return this.em},set:function(t){var e=this.em;e!==t&&(this.em=t,this.M(),this.g("shadowVisible",e,t))}},enabledChanged:{get:function(){return null!==this.N?this.N.Wn:null},set:function(t){fa(this);var e=this.N.Wn;e!==t&&(this.N.Wn=t,this.g("enabledChanged",e,t))}},segmentOrientation:{get:function(){return this.cm},set:function(t){var e=this.cm;e!==t&&(this.cm=t,this.o(),this.g("segmentOrientation",e,t),t===tf&&(this.angle=0))}},segmentIndex:{get:function(){return this.Qp},set:function(t){t=Math.round(t);var e=this.Qp;e!==t&&(this.Qp=t,this.o(),this.g("segmentIndex",e,t))}},segmentFraction:{get:function(){return this.am},set:function(t){isNaN(t)||0>t?t=0:1<t&&(t=1);var e=this.am;e!==t&&(this.am=t,this.o(),this.g("segmentFraction",e,t))}},segmentOffset:{get:function(){return this.bm},set:function(t){var e=this.bm;e.w(t)||(this.bm=t=t.H(),this.o(),this.g("segmentOffset",e,t))}},stretch:{get:function(){return this.De},set:function(t){var e=this.De;e!==t&&(this.De=t,this.o(),this.g("stretch",e,t))}},name:{get:function(){return this.oa},set:function(t){var e=this.oa;e!==t&&(this.oa=t,null!==this.part&&(this.part.Xj=null),this.g("name",e,t))}},opacity:{get:function(){return this.hb},set:function(t){var e=this.hb;e!==t&&((0>t||1<t)&&M(t,"0 <= value <= 1",ca,"opacity"),this.hb=t,this.g("opacity",e,t),t=this.diagram,e=this.part,null!==t&&null!==e&&t.M(Bu(e,e.actualBounds)))}},visible:{get:function(){return 0!==(1&this.F)},set:function(t){var e=0!==(1&this.F);e!==t&&(this.F^=1,this.g("visible",e,t),e=this.panel,null!==e?e.o():this.Ff()&&this.Ob(t),this.M(),Ba(this))}},pickable:{get:function(){return 0!==(2&this.F)},set:function(t){var e=0!==(2&this.F);e!==t&&(this.F^=2,this.g("pickable",e,t))}},fromLinkableDuplicates:{get:function(){return 0!==(4&this.F)},set:function(t){var e=0!==(4&this.F);e!==t&&(this.F^=4,this.g("fromLinkableDuplicates",e,t))}},fromLinkableSelfNode:{get:function(){return 0!==(8&this.F)},set:function(t){var e=0!==(8&this.F);e!==t&&(this.F^=8,this.g("fromLinkableSelfNode",e,t))}},toLinkableDuplicates:{get:function(){return 0!==(16&this.F)},set:function(t){var e=0!==(16&this.F);e!==t&&(this.F^=16,this.g("toLinkableDuplicates",e,t))}},toLinkableSelfNode:{get:function(){return 0!==(32&this.F)},set:function(t){var e=0!==(32&this.F);e!==t&&(this.F^=32,this.g("toLinkableSelfNode",e,t))}},isPanelMain:{get:function(){return 0!==(64&this.F)},set:function(t){var e=0!==(64&this.F);e!==t&&(this.F^=64,this.o(),this.g("isPanelMain",e,t))}},isActionable:{get:function(){return 0!==(128&this.F)},set:function(t){var e=0!==(128&this.F);e!==t&&(this.F^=128,this.g("isActionable",e,t))}},areaBackground:{get:function(){return this.ec},set:function(t){var e=this.ec;e!==t&&(null!==t&&dh(t,"GraphObject.areaBackground"),t instanceof eh&&t.freeze(),this.ec=t,this.M(),this.g("areaBackground",e,t))}},background:{get:function(){return this.mb},set:function(t){var e=this.mb;e!==t&&(null!==t&&dh(t,"GraphObject.background"),t instanceof eh&&t.freeze(),this.mb=t,this.M(),this.g("background",e,t))}},part:{get:function(){if(this.Ff())return this;if(null!==this.ak)return this.ak;var t;for(t=this.panel;t;){if(t instanceof Lu)return this.ak=t;t=t.panel}return null}},svg:{get:function(){return this.gq},set:function(t){this.gq=t}},panel:{get:function(){return this.og}},layer:{get:function(){var t=this.part;return null!==t?t.layer:null}},diagram:{get:function(){var t=this.part;return null!==t?t.diagram:null}},position:{get:function(){return this.la},set:function(t){var e=t.x,i=t.y,n=this.la,o=n.x,r=n.y;(o===e||isNaN(o)&&isNaN(e))&&(r===i||isNaN(r)&&isNaN(i))?this.lu():(t=t.copy(),this.Ew(t,n)&&this.g("position",n.copy(),t.copy()))}},actualBounds:{get:function(){return this.xb}},scale:{get:function(){return this.Aa},set:function(t){var e=this.Aa;e!==t&&(0>=t&&w("GraphObject.scale for "+this+" must be greater than zero, not: "+t),this.Aa=t,this.o(),this.g("scale",e,t))}},angle:{get:function(){return this.Yb},set:function(t){var e=this.Yb;e!==t&&(t%=360,0>t&&(t+=360),e!==t&&(this.Yb=t,Ba(this),this.o(),this.g("angle",e,t)))}},desiredSize:{get:function(){return this.Xc},set:function(t){var e=t.width,i=t.height,n=this.Xc,o=n.width,r=n.height;(o===e||isNaN(o)&&isNaN(e))&&(r===i||isNaN(r)&&isNaN(i))||(this.Xc=t=t.H(),this.o(),this instanceof Nl&&this.dc(),this.g("desiredSize",n,t),Na(this)&&(t=this.part,null!==t&&(da(this,t,"width"),da(this,t,"height"))))}},width:{get:function(){return this.Xc.width},set:function(t){var e=this.Xc.width;e===t||isNaN(e)&&isNaN(t)||(e=this.Xc,this.Xc=t=new Bt(t,this.Xc.height).freeze(),this.o(),this instanceof Nl&&this.dc(),this.g("desiredSize",e,t),Na(this)&&(t=this.part,null!==t&&da(this,t,"width")))}},height:{get:function(){return this.Xc.height},set:function(t){var e=this.Xc.height;e===t||isNaN(e)&&isNaN(t)||(e=this.Xc,this.Xc=t=new Bt(this.Xc.width,t).freeze(),this.o(),this instanceof Nl&&this.dc(),this.g("desiredSize",e,t),Na(this)&&(t=this.part,null!==t&&da(this,t,"height")))}},minSize:{get:function(){return this.fg},set:function(t){var e=this.fg;e.w(t)||(t=t.copy(),isNaN(t.width)&&(t.width=0),isNaN(t.height)&&(t.height=0),t.freeze(),this.fg=t,this.o(),this.g("minSize",e,t))}},maxSize:{get:function(){return this.eg},set:function(t){var e=this.eg;e.w(t)||(t=t.copy(),isNaN(t.width)&&(t.width=1/0),isNaN(t.height)&&(t.height=1/0),t.freeze(),this.eg=t,this.o(),this.g("maxSize",e,t))}},measuredBounds:{get:function(){return this.qc}},naturalBounds:{get:function(){return this.rc}},margin:{get:function(){return this.jh},set:function(t){"number"===typeof t&&(t=new Qt(t));var e=this.jh;e.w(t)||(this.jh=t=t.H(),this.o(),this.g("margin",e,t))}},transform:{get:function(){return 0!==(2048&this.F)===!0&&xa(this),this.sb}},Fd:{get:function(){return 0!==(4096&this.F)===!0&&xa(this),this.Zh}},alignment:{get:function(){return this.yb},set:function(t){var e=this.yb;e.w(t)||(t.nc()&&!t.Mb()&&w("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+t),this.yb=t=t.H(),wa(this),this.g("alignment",e,t))}},column:{get:function(){return this.Rg},set:function(t){t=Math.round(t);var e=this.Rg;e!==t&&(0>t&&M(t,">= 0",ca,"column"),this.Rg=t,this.o(),this.g("column",e,t))}},columnSpan:{get:function(){return this.zn},set:function(t){t=Math.round(t);var e=this.zn;e!==t&&(1>t&&M(t,">= 1",ca,"columnSpan"),this.zn=t,this.o(),this.g("columnSpan",e,t))}},row:{get:function(){return this.Jp},set:function(t){t=Math.round(t);var e=this.Jp;e!==t&&(0>t&&M(t,">= 0",ca,"row"),this.Jp=t,this.o(),this.g("row",e,t))}},rowSpan:{get:function(){return this.Kp},set:function(t){t=Math.round(t);var e=this.Kp;e!==t&&(1>t&&M(t,">= 1",ca,"rowSpan"),this.Kp=t,this.o(),this.g("rowSpan",e,t))}},spanAllocation:{get:function(){return this.aq},set:function(t){var e=this.aq;e!==t&&(this.aq=t,this.o(),this.g("spanAllocation",e,t))}},alignmentFocus:{get:function(){return this.$k},set:function(t){var e=this.$k;e.w(t)||(this.$k=t=t.H(),this.o(),this.g("alignmentFocus",e,t))}},portId:{get:function(){return this.xp},set:function(t){var e=this.xp;if(e!==t){var i=this.part;null===i||i instanceof ec||(w("Cannot set portID on a Link: "+t),i=null),null!==e&&null!==i&&fc(i,this),this.xp=t,null!==t&&null!==i&&(i.Nh=!0,cc(i,this)),this.g("portId",e,t)}}},toSpot:{get:function(){return null!==this.O?this.O.Ch:ie},set:function(t){this.Kc();var e=this.O.Ch;e.w(t)||(t=t.H(),this.O.Ch=t,this.g("toSpot",e,t),Fa(this))}},toEndSegmentLength:{get:function(){return null!==this.O?this.O.Ah:10},set:function(t){this.Kc();var e=this.O.Ah;e!==t&&(0>t&&M(t,">= 0",ca,"toEndSegmentLength"),this.O.Ah=t,this.g("toEndSegmentLength",e,t),Fa(this))}},toShortLength:{get:function(){return null!==this.O?this.O.Bh:0},set:function(t){this.Kc();var e=this.O.Bh;e!==t&&(this.O.Bh=t,this.g("toShortLength",e,t),Fa(this))}},toLinkable:{get:function(){return null!==this.O?this.O.kq:null},set:function(t){this.Kc();var e=this.O.kq;e!==t&&(this.O.kq=t,this.g("toLinkable",e,t))}},toMaxLinks:{get:function(){return null!==this.O?this.O.lq:1/0},set:function(t){this.Kc();var e=this.O.lq;e!==t&&(0>t&&M(t,">= 0",ca,"toMaxLinks"),this.O.lq=t,this.g("toMaxLinks",e,t))}},fromSpot:{get:function(){return null!==this.O?this.O.bh:ie},set:function(t){this.Kc();var e=this.O.bh;e.w(t)||(t=t.H(),this.O.bh=t,this.g("fromSpot",e,t),Fa(this))}},fromEndSegmentLength:{get:function(){return null!==this.O?this.O.$g:10},set:function(t){this.Kc();var e=this.O.$g;e!==t&&(0>t&&M(t,">= 0",ca,"fromEndSegmentLength"),this.O.$g=t,this.g("fromEndSegmentLength",e,t),Fa(this))}},fromShortLength:{get:function(){return null!==this.O?this.O.ah:0},set:function(t){this.Kc();var e=this.O.ah;e!==t&&(this.O.ah=t,this.g("fromShortLength",e,t),Fa(this))}},fromLinkable:{get:function(){return null!==this.O?this.O.co:null},set:function(t){this.Kc();var e=this.O.co;e!==t&&(this.O.co=t,this.g("fromLinkable",e,t))}},fromMaxLinks:{get:function(){return null!==this.O?this.O.eo:1/0},set:function(t){this.Kc();var e=this.O.eo;e!==t&&(0>t&&M(t,">= 0",ca,"fromMaxLinks"),this.O.eo=t,this.g("fromMaxLinks",e,t))}},cursor:{get:function(){return this.oi},set:function(t){var e=this.oi;e!==t&&(this.oi=t,this.g("cursor",e,t))}},click:{get:function(){return null!==this.N?this.N.Pf:null},set:function(t){fa(this);var e=this.N.Pf;e!==t&&(this.N.Pf=t,this.g("click",e,t))}},doubleClick:{get:function(){return null!==this.N?this.N.Uf:null},set:function(t){fa(this);var e=this.N.Uf;e!==t&&(this.N.Uf=t,this.g("doubleClick",e,t))}},contextClick:{get:function(){return null!==this.N?this.N.Qf:null},set:function(t){fa(this);var e=this.N.Qf;e!==t&&(this.N.Qf=t,this.g("contextClick",e,t))}},mouseEnter:{get:function(){return null!==this.N?this.N.hg:null},set:function(t){fa(this);var e=this.N.hg;e!==t&&(this.N.hg=t,this.g("mouseEnter",e,t))}},mouseLeave:{get:function(){return null!==this.N?this.N.kg:null},set:function(t){fa(this);var e=this.N.kg;e!==t&&(this.N.kg=t,this.g("mouseLeave",e,t))}},mouseOver:{get:function(){return null!==this.N?this.N.lg:null},set:function(t){fa(this);var e=this.N.lg;e!==t&&(this.N.lg=t,this.g("mouseOver",e,t))}},mouseHover:{get:function(){return null!==this.N?this.N.jg:null},set:function(t){fa(this);var e=this.N.jg;e!==t&&(this.N.jg=t,this.g("mouseHover",e,t))}},mouseHold:{get:function(){return null!==this.N?this.N.ig:null},set:function(t){fa(this);var e=this.N.ig;e!==t&&(this.N.ig=t,this.g("mouseHold",e,t))}},mouseDragEnter:{get:function(){return null!==this.N?this.N.$o:null},set:function(t){fa(this);var e=this.N.$o;e!==t&&(this.N.$o=t,this.g("mouseDragEnter",e,t))}},mouseDragLeave:{get:function(){return null!==this.N?this.N.ap:null},set:function(t){fa(this);var e=this.N.ap;e!==t&&(this.N.ap=t,this.g("mouseDragLeave",e,t))}},mouseDrop:{get:function(){return null!==this.N?this.N.gg:null},set:function(t){fa(this);var e=this.N.gg;e!==t&&(this.N.gg=t,this.g("mouseDrop",e,t))}},actionDown:{get:function(){return null!==this.N?this.N.gn:null},set:function(t){fa(this);var e=this.N.gn;e!==t&&(this.N.gn=t,this.g("actionDown",e,t))}},actionMove:{get:function(){return null!==this.N?this.N.hn:null},set:function(t){fa(this);var e=this.N.hn;e!==t&&(this.N.hn=t,this.g("actionMove",e,t))}},actionUp:{get:function(){return null!==this.N?this.N.jn:null},set:function(t){fa(this);var e=this.N.jn;e!==t&&(this.N.jn=t,this.g("actionUp",e,t))}},actionCancel:{get:function(){return null!==this.N?this.N.fn:null},set:function(t){fa(this);var e=this.N.fn;e!==t&&(this.N.fn=t,this.g("actionCancel",e,t))}},toolTip:{get:function(){return null!==this.N?this.N.wg:null},set:function(t){fa(this);var e=this.N.wg;e!==t&&(this.N.wg=t,this.g("toolTip",e,t))}},contextMenu:{get:function(){return null!==this.N?this.N.Rf:null},set:function(t){fa(this);var e=this.N.Rf;e!==t&&(this.N.Rf=t,this.g("contextMenu",e,t))}}}),ca.prototype.trigger=ca.prototype.Qw,ca.prototype.setProperties=ca.prototype.Fw,ca.prototype.findTemplateBinder=ca.prototype.ij,ca.prototype.bind=ca.prototype.bind,ca.prototype.isEnabledObject=ca.prototype.Hg,ca.prototype.isVisibleObject=ca.prototype.Gf,ca.prototype.isContainedBy=ca.prototype.Gg,ca.prototype.getNearestIntersectionPoint=ca.prototype.Nt,ca.prototype.getLocalPoint=ca.prototype.Mt,ca.prototype.getDocumentScale=ca.prototype.Af,ca.prototype.getDocumentAngle=ca.prototype.lj,ca.prototype.getDocumentBounds=ca.prototype.mj,ca.prototype.getDocumentPoint=ca.prototype.da,ca.prototype.intersectsRect=ca.prototype.Mc,ca.prototype.containedInRect=ca.prototype.Jh,ca.prototype.containsRect=ca.prototype.Ge,ca.prototype.containsPoint=ca.prototype.$,ca.prototype.raiseChanged=ca.prototype.g,ca.prototype.raiseChangedEvent=ca.prototype.Va,ca.prototype.addCopyProperty=ca.prototype.Tx;var Va=null;function Ga(){this.Wn=this.Rf=this.wg=this.fn=this.jn=this.hn=this.gn=this.gg=this.ap=this.$o=this.ig=this.jg=this.lg=this.kg=this.hg=this.Qf=this.Uf=this.Pf=null}function Ya(){this.Oa=[1,0,0,1,0,0]}function Xa(t){this.type=t,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.ay=[],this.pattern=null}function qa(t,e){this.ownerDocument=t=void 0===e?y.document:e,this.LA="http://www.w3.org/2000/svg",void 0!==t&&(this.Ja=this.Pb("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.Ja.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Ja.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")),this.Dq=null,this.context=new Ua(this)}function Ua(t){this.nu=t,this.svg=t.Ja,this.stack=[],this.gd=[],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.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.ug=this.ft=this.et=0,this.Wt=null,this.path=[],this.Vu=!1,this.uh=null,this.vh=0,this.He=new Ya,_a(this,1,0,0,1,0,0);var e=at++,i=this.Pb("clipPath",{id:"mainClip"+e});i.appendChild(this.Pb("rect",{x:0,y:0,width:t.width,height:t.height})),this.Bx=i,this.nu.Ja.appendChild(i),this.gd[0].setAttributeNS(null,"clip-path","url(#mainClip"+e+")"),this.NA={}}function Ka(t,e,i,n,o){1!==t.globalAlpha&&(i.opacity=t.globalAlpha),"fill"===e?(t.fillStyle instanceof Xa?i.fill=Ha(t,t.fillStyle):/^rgba\(/.test(t.fillStyle)?(t=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.fillStyle),i.fill="rgb("+t[1]+","+t[2]+","+t[3]+")",i["fill-opacity"]=t[4]):i.fill=t.fillStyle,i.stroke="none"):"stroke"===e&&(i.fill="none",t.strokeStyle instanceof Xa?i.stroke=Ha(t,t.strokeStyle):/^rgba\(/.test(t.strokeStyle)?(e=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(t.strokeStyle),i.stroke="rgb("+e[1]+","+e[2]+","+e[3]+")",i["stroke-opacity"]=e[4]):i.stroke=t.strokeStyle,i["stroke-width"]=t.lineWidth,i["stroke-linecap"]=t.lineCap,i["stroke-linejoin"]=t.lineJoin,i["stroke-miterlimit"]=t.miterLimit),n=n.Oa,n="matrix("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+", "+n[4]+", "+n[5]+")",void 0!==o&&(n+=o),i.transform=n}function Ha(t,e){var i="GRAD"+at++;if("linear"===e.type)var n=t.Pb("linearGradient",{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,id:i,gradientUnits:"userSpaceOnUse"});else{if("radial"!==e.type)throw Error("invalid gradient");n=t.Pb("radialGradient",{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,r1:e.r1,r2:e.r2,id:i})}var o=e.ay;e=o.length;for(var r=[],s=0;s<e;s++){var a=o[s],h=a.color;a={offset:a.offset,"stop-color":h},/^rgba\(/.test(h)&&(h=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(h),a["stop-color"]="rgb("+h[1]+","+h[2]+","+h[3]+")",a["stop-opacity"]=h[4]),r.push(a)}for(r.sort((function(t,e){return t.offset>e.offset?1:-1})),o=0;o<e;o++)n.appendChild(t.Pb("stop",r[o]));return t.svg.appendChild(n),"url(#"+i+")"}function _a(t,e,i,n,o,r,s){var a=new Ya;a.Oa=[e,i,n,o,r,s],e={},Ka(t,"g",e,a),a=t.addElement("g",e),t.gd.push(a)}function Wa(t){t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0}function $a(t){t.shadowOffsetX=t.et,t.shadowOffsetY=t.ft,t.shadowBlur=t.ug}function Ja(t,e){this.ownerDocument=e=void 0===e?y.document:e,this.Dq=null,e=e.createElement("canvas"),e.tabIndex=0,this.Ja=e,this.Ja.innerHTML="This text is displayed if your browser does not support the Canvas HTML element.",this.context=new Za(e),e.C=t}function Za(t){t.getContext&&t.getContext("2d")||w("Browser does not support HTML Canvas Element"),this.Y=t.getContext("2d"),this.xu=this.zu=this.yu="",this.yn=!1,this.ug=this.ft=this.et=0}ca.className="GraphObject",Va=new dt,Ra("Button",(function(){function t(t,e){return null!==t.diagram.Vb(t.documentPoint,(function(t){for(;null!==t.panel&&!t.isActionable;)t=t.panel;return t}),(function(t){return t===e}))}var e=Ia(Uh,Uh.Auto,{isActionable:!0,enabledChanged:function(t,e){if(t instanceof Uh){var i=t.bb("ButtonBorder");null!==i&&(i.fill=e?t._buttonFillNormal:t._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD",_buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},Ia(Nl,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new Ge(0,0,2.76142374915397,2.761423749153969),spot2:new Ge(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));return e.mouseEnter=function(t,e){if(e.Hg()&&e instanceof Uh&&(t=e.bb("ButtonBorder"),t instanceof Nl)){var i=e._buttonFillOver;e._buttonFillNormal=t.fill,t.fill=i,i=e._buttonStrokeOver,e._buttonStrokeNormal=t.stroke,t.stroke=i}},e.mouseLeave=function(t,e){e.Hg()&&e instanceof Uh&&(t=e.bb("ButtonBorder"),t instanceof Nl&&(t.fill=e._buttonFillNormal,t.stroke=e._buttonStrokeNormal))},e.actionDown=function(t,e){if(e.Hg()&&e instanceof Uh&&null!==e._buttonFillPressed&&0===t.button){var i=e.bb("ButtonBorder");if(i instanceof Nl){t=t.diagram;var n=t.skipsUndoManager;t.skipsUndoManager=!0;var o=e._buttonFillPressed;e._buttonFillOver=i.fill,i.fill=o,o=e._buttonStrokePressed,e._buttonStrokeOver=i.stroke,i.stroke=o,t.skipsUndoManager=n}}},e.actionUp=function(e,i){if(i.Hg()&&i instanceof Uh&&null!==i._buttonFillPressed&&0===e.button){var n=i.bb("ButtonBorder");if(n instanceof Nl){var o=e.diagram,r=o.skipsUndoManager;o.skipsUndoManager=!0,t(e,i)?(n.fill=i._buttonFillOver,n.stroke=i._buttonStrokeOver):(n.fill=i._buttonFillNormal,n.stroke=i._buttonStrokeNormal),o.skipsUndoManager=r}}},e.actionCancel=function(e,i){if(i.Hg()&&i instanceof Uh&&null!==i._buttonFillPressed){var n=i.bb("ButtonBorder");if(n instanceof Nl){var o=e.diagram,r=o.skipsUndoManager;o.skipsUndoManager=!0,t(e,i)?(n.fill=i._buttonFillOver,n.stroke=i._buttonStrokeOver):(n.fill=i._buttonFillNormal,n.stroke=i._buttonStrokeNormal),o.skipsUndoManager=r}}},e.actionMove=function(e,i){if(i.Hg()&&i instanceof Uh&&null!==i._buttonFillPressed){var n=e.diagram;if(0===n.firstInput.button&&(n.currentTool.standardMouseOver(),t(e,i)&&(e=i.bb("ButtonBorder"),e instanceof Nl))){var o=n.skipsUndoManager;n.skipsUndoManager=!0;var r=i._buttonFillPressed;e.fill!==r&&(e.fill=r),r=i._buttonStrokePressed,e.stroke!==r&&(e.stroke=r),n.skipsUndoManager=o}}},e})),Ra("TreeExpanderButton",(function(){var t=Ia("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},Ia(Nl,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Pt},new cp("figure","isTreeExpanded",(function(t,e){return e=e.panel,t?e._treeExpandedFigure:e._treeCollapsedFigure})).Uq()),{visible:!1},new cp("visible","isTreeLeaf",(function(t){return!t})).Uq());return t.click=function(t,e){if(e=e.part,e instanceof Qu&&(e=e.adornedPart),e instanceof ec){var i=e.diagram;if(null!==i){if(i=i.commandHandler,e.isTreeExpanded){if(!i.canCollapseTree(e))return}else if(!i.canExpandTree(e))return;t.handled=!0,e.isTreeExpanded?i.collapseTree(e):i.expandTree(e)}}},t})),Ra("SubGraphExpanderButton",(function(){var t=Ia("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},Ia(Nl,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Pt},new cp("figure","isSubGraphExpanded",(function(t,e){return e=e.panel,t?e._subGraphExpandedFigure:e._subGraphCollapsedFigure})).Uq()));return t.click=function(t,e){if(e=e.part,e instanceof Qu&&(e=e.adornedPart),e instanceof bc){var i=e.diagram;if(null!==i){if(i=i.commandHandler,e.isSubGraphExpanded){if(!i.canCollapseSubGraph(e))return}else if(!i.canExpandSubGraph(e))return;t.handled=!0,e.isSubGraphExpanded?i.collapseSubGraph(e):i.expandSubGraph(e)}}},t})),Ra("ToolTip",(function(){return Ia(Qu,Uh.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new pt(0,3),shadowBlur:5},Ia(Nl,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new Ge(0,0,4,6),spot2:new Ge(1,1,-4,-4)}))})),Ra("ContextMenu",(function(){return Ia(Qu,Uh.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new pt(0,3),shadowBlur:5},new cp("background","",(function(t){return null!==t.adornedPart&&null!==t.placeholder?null:"#F5F5F5"})))})),Ra("ContextMenuButton",(function(){var t=Ia("Button");t.stretch=Hs;var e=t.bb("ButtonBorder");return e instanceof Nl&&(e.figure="Rectangle",e.strokeWidth=0,e.spot1=new Ge(0,0,2,3),e.spot2=new Ge(1,1,-2,-2)),t})),Ra("PanelExpanderButton",(function(t){var e=za(t,"COLLAPSIBLE"),i=Ia("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},Ia(Nl,{name:"ButtonIcon",strokeWidth:2},new cp("geometryString","visible",(function(t){return t?i._buttonExpandedFigure:i._buttonCollapsedFigure})).Uq(e)));return t=i.bb("ButtonBorder"),t instanceof Nl&&(t.stroke=null,t.fill="rgba(0, 0, 0, 0)"),i.click=function(t,i){var n=i.diagram;if(null!==n&&!n.isReadOnly){var o=i.ij();null===o&&(o=i.part),null!==o&&(i=o.bb(e),null!==i&&(t.handled=!0,n.va("Collapse/Expand Panel"),i.visible=!i.visible,n.Xa("Collapse/Expand Panel")))}},i})),Ra("CheckBoxButton",(function(t){var e=za(t);return t=Ia("Button",{desiredSize:new Bt(14,14)},Ia(Nl,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Xs,geometryStretch:Us,visible:!1},""!==e?new cp("visible",e).Iy():[])),t.click=function(t,i){if(i instanceof Uh){var n=t.diagram;if(!(null===n||n.isReadOnly||""!==e&&n.model.isReadOnly)){t.handled=!0;var o=i.bb("ButtonIcon");n.va("checkbox"),o.visible=!o.visible,"function"===typeof i._doClick&&i._doClick(t,i),n.Xa("checkbox")}}},t})),Ra("CheckBox",(function(t){t=za(t),t=Ia("CheckBoxButton",t,{name:"Button",isActionable:!1,margin:new Qt(0,1,0,0)});var e=Ia(Uh,"Horizontal",t,{isActionable:!0,cursor:t.cursor,margin:1,_buttonFillNormal:t._buttonFillNormal,_buttonStrokeNormal:t._buttonStrokeNormal,_buttonFillOver:t._buttonFillOver,_buttonStrokeOver:t._buttonStrokeOver,_buttonFillPressed:t._buttonFillPressed,_buttonStrokePressed:t._buttonStrokePressed,_buttonFillDisabled:t._buttonFillDisabled,mouseEnter:t.mouseEnter,mouseLeave:t.mouseLeave,actionDown:t.actionDown,actionUp:t.actionUp,actionCancel:t.actionCancel,actionMove:t.actionMove,click:t.click,_buttonClick:t.click});return t.mouseEnter=null,t.mouseLeave=null,t.actionDown=null,t.actionUp=null,t.actionCancel=null,t.actionMove=null,t.click=null,e})),ca.None=qs=new U(ca,"None",0),ca.Default=Ks=new U(ca,"Default",0),ca.Vertical=_s=new U(ca,"Vertical",4),ca.Horizontal=Hs=new U(ca,"Horizontal",5),ca.Fill=Xs=new U(ca,"Fill",3),ca.Uniform=Us=new U(ca,"Uniform",1),ca.UniformToFill=Ws=new U(ca,"UniformToFill",2),ca.FlipVertical=$s=new U(ca,"FlipVertical",1),ca.FlipHorizontal=Js=new U(ca,"FlipHorizontal",2),ca.FlipBoth=Zs=new U(ca,"FlipBoth",3),ca.make=Ia,ca.getBuilders=function(){var t,e=new dt;for(t in Va)if(t!==t.toLowerCase()){var i=Va.G(t);"function"===typeof i&&e.add(t,i)}return e.freeze(),e},ca.defineBuilder=Ra,ca.takeBuilderArgument=za,Ga.prototype.copy=function(){var t=new Ga;return t.Pf=this.Pf,t.Uf=this.Uf,t.Qf=this.Qf,t.hg=this.hg,t.kg=this.kg,t.lg=this.lg,t.jg=this.jg,t.ig=this.ig,t.$o=this.$o,t.ap=this.ap,t.gg=this.gg,t.gn=this.gn,t.hn=this.hn,t.jn=this.jn,t.fn=this.fn,t.wg=this.wg,t.Rf=this.Rf,t.Wn=this.Wn,t},Ga.className="GraphObjectEventHandlers",Ya.prototype.copy=function(){var t=new Ya;return t.Oa[0]=this.Oa[0],t.Oa[1]=this.Oa[1],t.Oa[2]=this.Oa[2],t.Oa[3]=this.Oa[3],t.Oa[4]=this.Oa[4],t.Oa[5]=this.Oa[5],t},Ya.prototype.translate=function(t,e){this.Oa[4]+=this.Oa[0]*t+this.Oa[2]*e,this.Oa[5]+=this.Oa[1]*t+this.Oa[3]*e},Ya.prototype.scale=function(t,e){this.Oa[0]*=t,this.Oa[1]*=t,this.Oa[2]*=e,this.Oa[3]*=e},Ya.className="STransform",Xa.prototype.addColorStop=function(t,e){this.ay.push({offset:t,color:e})},Xa.className="SGradient",qa.prototype.resize=function(t,e,i,n){return(this.width!==t||this.height!==e)&&(this.style.width=i+"px",this.style.height=n+"px",this.Ja.setAttributeNS(null,"width",i+"px"),this.Ja.setAttributeNS(null,"height",n+"px"),this.Ja.setAttributeNS(null,"viewBox","0 0 "+i+" "+n),this.context.Bx.firstElementChild.setAttributeNS(null,"width",i+"px"),this.context.Bx.firstElementChild.setAttributeNS(null,"height",n+"px"),!0)},qa.prototype.Pb=function(t,e,i){if(t=this.ownerDocument.createElementNS(this.LA,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},qa.prototype.getBoundingClientRect=function(){return this.Ja.getBoundingClientRect()},qa.prototype.focus=function(){this.Ja.focus()},qa.prototype.ky=function(){this.ownerDocument=null},d.Object.defineProperties(qa.prototype,{width:{get:function(){return this.Ja.width.baseVal.value},set:function(t){this.Ja.width=t}},height:{get:function(){return this.Ja.height.baseVal.value},set:function(t){this.Ja.height=t}},style:{get:function(){return this.Ja.style}}}),qa.className="SVGSurface",i=Ua.prototype,i.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-6<Math.abs(s-f)||1e-6<Math.abs(a-d))&&this.path.push(["L",f,+d]),0>n&&(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<n&&this.path.push(["A",i,i,0,+(n>=Math.PI),p,t+i*Math.cos(o),e+i*Math.sin(o)])},i.beginPath=function(){this.path=[]},i.bezierCurveTo=function(t,e,i,n,o,r){this.path.push(["C",t,e,i,n,o,r])},i.clearRect=function(){},i.clip=function(){this.addPath("clipPath",this.path,this.He)},i.closePath=function(){this.path.push(["z"])},i.createLinearGradient=function(t,e,i,n){var o=new Xa("linear");return o.x1=t,o.y1=e,o.x2=i,o.y2=n,o},i.createPattern=function(t){var e="";t instanceof HTMLCanvasElement&&(e=t.toDataURL()),t instanceof HTMLImageElement&&(e=t.getAttribute("src"));var i=this.NA;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.Pb("pattern",{width:t.width,height:t.height,id:n,patternUnits:"userSpaceOnUse"}),t.appendChild(this.Pb(Bs,o)),this.svg.appendChild(t),i[e]=n,"url(#"+n+")"},i.createRadialGradient=function(t,e,i,n,o,r){var s=new Xa("radial");return s.x1=t,s.y1=e,s.r1=i,s.x2=n,s.y2=o,s.r2=r,s},i.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,c=t instanceof HTMLImageElement?t.naturalHeight:t.height;void 0===n&&(r=e,s=i,a=n=u,h=o=c),n=n||0,o=o||0,r=r||0,s=s||0,a=a||0,h=h||0,t={x:0,y:0,width:u||n,height:c||o,href:l},_e.aa(n,a)&&_e.aa(o,h)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&&(t.preserveAspectRatio="xMidYMid slice"):t.preserveAspectRatio="none",l="",a/=n,h/=o,0===r&&0===s||(l+=" translate("+r+", "+s+")"),1===a&&1===h||(l+=" scale("+a+", "+h+")"),0===e&&0===i||(l+=" translate("+-e+", "+-i+")"),0===e&&0===i&&n===u&&o===c||(r="CLIP"+at++,s=this.Pb("clipPath",{id:r}),s.appendChild(this.Pb("rect",{x:e,y:i,width:n,height:o})),this.svg.appendChild(s),t["clip-path"]="url(#"+r+")"),Ka(this,Bs,t,this.He,l),this.addElement(Bs,t)},i.fill=function(){this.addPath("fill",this.path,this.He)},i.Je=function(){this.clipInsteadOfFill?this.clip():this.fill()},i.fillRect=function(t,e,i,n){t=[t,e,i,n],t={x:t[0],y:t[1],width:t[2],height:t[3]},Ka(this,"fill",t,this.He),this.addElement("rect",t)},i.fillText=function(t,e,i){t=[t,e,i],e=this.textAlign,"left"===e?e="start":"right"===e?e="end":"center"===e&&(e="middle"),e={x:t[1],y:t[2],style:"font: "+this.font,"text-anchor":e},Ka(this,"fill",e,this.He),this.addElement("text",e,t[0])},i.lineTo=function(t,e){this.path.push(["L",t,e])},i.moveTo=function(t,e){this.path.push(["M",t,e])},i.quadraticCurveTo=function(t,e,i,n){this.path.push(["Q",t,e,i,n])},i.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"])},i.restore=function(){this.He=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},i.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});for(var t=[],e=0;e<this.path.length;e++)t.push(this.path[e]);this.stack.push(t),this.stack.push(this.He.copy())},i.setTransform=function(t,e,i,n,o,r){1===t&&0===e&&0===i&&1===n&&0===o&&0===r||_a(this,t,e,i,n,o,r)},i.scale=function(t,e){this.He.scale(t,e)},i.translate=function(t,e){this.He.translate(t,e)},i.transform=function(){},i.stroke=function(){this.addPath("stroke",this.path,this.He)},i.vj=function(){this.clipInsteadOfFill||this.stroke()},i.Pb=function(t,e,i){return this.nu.Pb(t,e,i)},i.addElement=function(t,e,i){return t=this.Pb(t,e,i),0<this.gd.length?this.gd[this.gd.length-1].appendChild(t):this.svg.appendChild(t),this.Wt=t},i.addPath=function(t,e,i){for(var n=[],o=0;o<e.length;o++){var r=T(e[o]),s=[r.shift()];if("A"===s[0])s.push(r.shift()+","+r.shift(),r.shift(),r.shift()+","+r.shift(),r.shift()+","+r.shift());else for(;r.length;)s.push(r.shift()+","+r.shift());n.push(s.join(" "))}e={d:n.join(" ")},"stroke"===t&&this.Vu&&(e["stroke-dasharray"]=this.uh.toString(),e["stroke-dashoffset"]=this.vh),Ka(this,t,e,i),"clipPath"===t?(t="CLIP"+at++,i=this.Pb("clipPath",{id:t}),i.appendChild(this.Pb("path",e)),this.svg.appendChild(i),0<this.gd.length&&this.gd[this.gd.length-1].setAttributeNS(null,"clip-path","url(#"+t+")")):this.addElement("path",e)},i.Ym=function(t){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var e="SHADOW"+at++,i=this.addElement("filter",{id:e,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),n=t.computePixelRatio();t=this.Pb("feGaussianBlur",{in:"SourceAlpha",result:"blur",stdDeviation:this.shadowBlur/2/n});var o=this.Pb("feFlood",{in:"blur",result:"flood","flood-color":this.shadowColor}),r=this.Pb("feComposite",{in:"flood",in2:"blur",operator:"in",result:"comp"});n=this.Pb("feOffset",{in:"comp",result:"offsetBlur",dx:this.shadowOffsetX/n,dy:this.shadowOffsetY/n});var s=this.Pb("feMerge",{});s.appendChild(this.Pb("feMergeNode",{in:"offsetBlur"})),s.appendChild(this.Pb("feMergeNode",{in:"SourceGraphic"})),i.appendChild(t),i.appendChild(o),i.appendChild(r),i.appendChild(n),i.appendChild(s),0<this.gd.length&&this.gd[this.gd.length-1].setAttributeNS(null,"filter","url(#"+e+")")}},i.Iw=function(t,e,i){this.et=t,this.ft=e,this.ug=i},i.Ft=function(t,e){this.Vu=!0,this.uh=t,this.vh=e},i.Dt=function(){this.Vu=!1},i.uc=function(){},i.Sy=function(){},Ua.prototype.rotate=function(){},Ua.prototype.getImageData=function(){return null},Ua.prototype.measureText=function(){return null},Ua.className="SVGContext",Ko.prototype.$t=function(t){var e=new qa(this,y.document);void 0===t&&(t=new _);var i=this;return us(this,(function(t,n){return t=cs(i,t,"SVG",e),t=null!==t?t.svg:null,"function"===typeof n?(n(t),null):t}),t)},Ko.prototype.makeSvg=Ko.prototype.$t,Ko.prototype.iw=function(t){return this.$t(t)},Ko.prototype.makeSVG=Ko.prototype.iw,ca.prototype.ly=function(t,e){if(!(t instanceof Ua))return!1;if(!this.visible)return!0;var i=null,n=t.Wt;if(this instanceof Uh&&(this.type===Uh.TableRow||this.type===Uh.TableColumn))return ma(this,t,e),!0;var o=this.xb;if(0===o.width||0===o.height||isNaN(o.x)||isNaN(o.y))return!0;var r=this.transform,s=this.panel;0!==(4096&this.F)===!0&&xa(this);var a=0!==(256&this.F);t.clipInsteadOfFill&&(a=!1);var h=!1;if(this instanceof Il&&(t.font=this.font),a){if(h=s.he()?s.naturalBounds:s.actualBounds,null!==this.Za){var l=this.Za,u=l.x,c=l.y,f=l.width;l=l.height}else u=Math.max(o.x,h.x),c=Math.max(o.y,h.y),f=Math.min(o.right,h.right)-u,l=Math.min(o.bottom,h.bottom)-c;if(u>o.width+o.x||o.x>h.width+h.x||c>o.height+o.y||o.y>h.height+h.y)return!0;h=!0,_a(t,1,0,0,1,0,0),t.save(),t.beginPath(),t.rect(u,c,f,l),t.clip()}if(this.Ff()&&!this.isVisible())return!0;if(t.He.Oa=[1,0,0,1,0,0],(this instanceof Il&&1<this.lineCount||this instanceof Nl&&1<this.geometry.figures.length)&&_a(t,1,0,0,1,0,0),u=!1,this.Ff()&&this.isShadowed&&e.Ke("drawShadows")&&(c=this.shadowOffset,t.Iw(c.x*e.scale*e.Tb,c.y*e.scale*e.Tb,this.shadowBlur),$a(t),t.shadowColor=this.shadowColor),c=!1,this.part&&e.Ke("drawShadows")&&(c=this.part.isShadowed),t.clipInsteadOfFill&&(c=!1),!0===this.shadowVisible?($a(t),!1===u&&c&&(_a(t,1,0,0,1,0,0),t.Ym(e),u=!0)):!1===this.shadowVisible&&Wa(t),f=this.naturalBounds,null!==this.areaBackground&&(va(this,t,this.areaBackground,!0,!0,f,o),!1===u&&c&&(_a(t,1,0,0,1,0,0),t.Ym(e),u=!0),this.areaBackground instanceof eh&&this.areaBackground.type===mh?(t.beginPath(),t.rect(o.x,o.y,o.width,o.height),t.Je(this.areaBackground)):t.fillRect(o.x,o.y,o.width,o.height)),this instanceof Uh?_a(t,r.m11,r.m12,r.m21,r.m22,r.dx,r.dy):(t.He.Oa=[r.m11,r.m12,r.m21,r.m22,r.dx,r.dy],!1===u&&c&&(_a(t,1,0,0,1,0,0),t.Ym(e),u=!0)),null!==this.background){!1===u&&c&&(_a(t,1,0,0,1,0,0),t.Ym(e),u=!0);var d=this.naturalBounds;l=r=0;var p=d.width;d=d.height;var g=0;this instanceof Nl&&(d=this.geometry.bounds,r=d.x,l=d.y,p=d.width,d=d.height,g=this.strokeWidth),va(this,t,this.background,!0,!1,f,o),this.background instanceof eh&&this.background.type===mh?(t.beginPath(),t.rect(r-g/2,l-g/2,p+g,d+g),t.Je(this.background)):t.fillRect(r-g/2,l-g/2,p+g,d+g)}return c&&(null!==this.background||null!==this.areaBackground||null!==s&&0!==(512&s.F)||null!==s&&(s.type===Uh.Auto||s.type===Uh.Spot)&&s.tb()!==this)?(Pa(this,!0),null===this.shadowVisible&&Wa(t)):Pa(this,!1),this.ej(t,e),c&&0!==(512&this.F)===!0&&$a(t),this.Ff()&&c&&Wa(t),a&&(t.restore(),h&&t.gd.pop()),this instanceof Uh&&(i=t.gd.pop()),!0===u&&t.gd.pop(),(this instanceof Il&&1<this.lineCount||this instanceof Nl&&1<this.geometry.figures.length)&&(i=t.gd.pop()),null!==t.nu.Dq&&(null===i&&(n===t.Wt?(_a(t,1,0,0,1,0,0),i=t.gd.pop()):i=t.Wt),t.nu.Dq(this,i)),this.svg=i,!0},Ja.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",!0)},Ja.prototype.toDataURL=function(t,e){return this.Ja.toDataURL(t,e)},Ja.prototype.getBoundingClientRect=function(){return this.Ja.getBoundingClientRect()},Ja.prototype.focus=function(){this.Ja.focus()},Ja.prototype.ky=function(){this.ownerDocument=this.Ja.C=null},d.Object.defineProperties(Ja.prototype,{width:{get:function(){return this.Ja.width},set:function(t){this.Ja.width=t}},height:{get:function(){return this.Ja.height},set:function(t){this.Ja.height=t}},style:{get:function(){return this.Ja.style}}}),Ja.className="CanvasSurface",i=Za.prototype,i.Sy=function(t){this.Y.imageSmoothingEnabled=t},i.arc=function(t,e,i,n,o,r){this.Y.arc(t,e,i,n,o,r)},i.beginPath=function(){this.Y.beginPath()},i.bezierCurveTo=function(t,e,i,n,o,r){this.Y.bezierCurveTo(t,e,i,n,o,r)},i.clearRect=function(t,e,i,n){this.Y.clearRect(t,e,i,n)},i.clip=function(){this.Y.clip()},i.closePath=function(){this.Y.closePath()},i.createLinearGradient=function(t,e,i,n){return this.Y.createLinearGradient(t,e,i,n)},i.createPattern=function(t,e){return this.Y.createPattern(t,e)},i.createRadialGradient=function(t,e,i,n,o,r){return this.Y.createRadialGradient(t,e,i,n,o,r)},i.drawImage=function(t,e,i,n,o,r,s,a,h){void 0===n?this.Y.drawImage(t,e,i):this.Y.drawImage(t,e,i,n,o,r,s,a,h)},i.fill=function(){this.Y.fill()},i.fillRect=function(t,e,i,n){this.Y.fillRect(t,e,i,n)},i.fillText=function(t,e,i){this.Y.fillText(t,e,i)},i.getImageData=function(t,e,i,n){return this.Y.getImageData(t,e,i,n)},i.lineTo=function(t,e){this.Y.lineTo(t,e)},i.measureText=function(t){return this.Y.measureText(t)},i.moveTo=function(t,e){this.Y.moveTo(t,e)},i.quadraticCurveTo=function(t,e,i,n){this.Y.quadraticCurveTo(t,e,i,n)},i.rect=function(t,e,i,n){this.Y.rect(t,e,i,n)},i.restore=function(){this.Y.restore()},Za.prototype.rotate=function(t){this.Y.rotate(t)},i=Za.prototype,i.save=function(){this.Y.save()},i.setTransform=function(t,e,i,n,o,r){this.Y.setTransform(t,e,i,n,o,r)},i.scale=function(t,e){this.Y.scale(t,e)},i.stroke=function(){this.Y.stroke()},i.transform=function(t,e,i,n,o,r){1===t&&0===e&&0===i&&1===n&&0===o&&0===r||this.Y.transform(t,e,i,n,o,r)},i.translate=function(t,e){this.Y.translate(t,e)},i.Je=function(t){if(t instanceof eh&&t.type===mh){var e=t.gl;t=t.Au,t>e?(this.scale(e/t,1),this.translate((t-e)/2,0)):e>t&&(this.scale(1,t/e),this.translate(0,(e-t)/2)),this.yn?this.clip():this.fill(),t>e?(this.translate(-(t-e)/2,0),this.scale(1/(e/t),1)):e>t&&(this.translate(0,-(e-t)/2),this.scale(1,1/(t/e)))}else this.yn?this.clip():this.fill()},i.vj=function(){this.yn||this.stroke()},i.Iw=function(t,e,i){this.et=t,this.ft=e,this.ug=i},i.Ft=function(t,e){var i=this.Y;void 0!==i.setLineDash&&(i.setLineDash(t),i.lineDashOffset=e)},i.Dt=function(){var t=this.Y;void 0!==t.setLineDash&&(t.setLineDash(Qa),t.lineDashOffset=0)},i.uc=function(t){t&&(this.yu=""),this.xu=this.zu=""},d.Object.defineProperties(Za.prototype,{fillStyle:{get:function(){return this.Y.fillStyle},set:function(t){this.xu!==t&&(this.xu=this.Y.fillStyle=t)}},font:{get:function(){return this.Y.font},set:function(t){this.yu!==t&&(this.yu=this.Y.font=t)}},globalAlpha:{get:function(){return this.Y.globalAlpha},set:function(t){this.Y.globalAlpha=t}},lineCap:{get:function(){return this.Y.lineCap},set:function(t){this.Y.lineCap=t}},lineDashOffset:{get:function(){return this.Y.lineDashOffset},set:function(t){this.Y.lineDashOffset=t}},lineJoin:{get:function(){return this.Y.lineJoin},set:function(t){this.Y.lineJoin=t}},lineWidth:{get:function(){return this.Y.lineWidth},set:function(t){this.Y.lineWidth=t}},miterLimit:{get:function(){return this.Y.miterLimit},set:function(t){this.Y.miterLimit=t}},shadowBlur:{get:function(){return this.Y.shadowBlur},set:function(t){this.Y.shadowBlur=t}},shadowColor:{get:function(){return this.Y.shadowColor},set:function(t){this.Y.shadowColor=t}},shadowOffsetX:{get:function(){return this.Y.shadowOffsetX},set:function(t){this.Y.shadowOffsetX=t}},shadowOffsetY:{get:function(){return this.Y.shadowOffsetY},set:function(t){this.Y.shadowOffsetY=t}},strokeStyle:{get:function(){return this.Y.strokeStyle},set:function(t){this.zu!==t&&(this.zu=this.Y.strokeStyle=t)}},textAlign:{get:function(){return this.Y.textAlign},set:function(t){this.Y.textAlign=t}},imageSmoothingEnabled:{get:function(){return this.Y.imageSmoothingEnabled},set:function(t){this.Y.imageSmoothingEnabled=t}},clipInsteadOfFill:{get:function(){return this.yn},set:function(t){this.yn=t}}});var Qa=Object.freeze([]);function th(){this.T=this.u=this.I=this.l=0}function eh(t){Ah||(ph(),Ah=!0),ot(this),this.v=!1,void 0===t?(this.qa=gh,this.fl="black"):"string"===typeof t?(this.qa=gh,this.fl=t):(this.qa=t,this.fl="black"),t=this.qa,t===yh?(this.Dd=oe,this.sl=ue):this.sl=this.Dd=t===mh?ae:ie,this.jt=0,this.Vr=NaN,this.ke=this.Ks=this.je=null,this.Au=this.gl=0}function ih(t,e,i){return e=void 0===e||"number"!==typeof e?.2:e,i=void 0===i?xh:i,ah(t),sh(e,i)}function nh(t,e,i){return e=void 0===e||"number"!==typeof e?.2:e,i=void 0===i?xh:i,ah(t),sh(-e,i)}function oh(t,e,i){ah(t),t=Ph.l;var n=Ph.I,o=Ph.u,r=Ph.T;return ah(e),void 0===i&&(i=.5),"rgba("+Math.round((Ph.l-t)*i+t)+", "+Math.round((Ph.I-n)*i+n)+", "+Math.round((Ph.u-o)*i+o)+", "+Math.round((Ph.T-r)*i+r)+")"}function rh(t){return!!t&&(t instanceof eh?t.Fy():(ah(t),128>(299*Ph.l+587*Ph.I+114*Ph.u)/1e3))}function sh(t,e){switch(e){case xh:e=100*lh(Ph.l);var i=100*lh(Ph.I),n=100*lh(Ph.u);return Ch.l=.4124564*e+.3575761*i+.1804375*n,Ch.I=.2126729*e+.7151522*i+.072175*n,Ch.u=.0193339*e+.119192*i+.9503041*n,Ch.T=Ph.T,e=ch(Ch.l/Mh[0]),i=ch(Ch.I/Mh[1]),n=ch(Ch.u/Mh[2]),Th.l=116*i-16,Th.I=500*(e-i),Th.u=200*(i-n),Th.T=Ch.T,Th.l=Math.min(100,Math.max(0,Th.l+100*t)),t=(Th.l+16)/116,e=t-Th.u/200,Ch.l=Mh[0]*fh(Th.I/500+t),Ch.I=Mh[1]*(Th.l>kh*wh?Math.pow(t,3):Th.l/kh),Ch.u=Mh[2]*fh(e),Ch.T=Th.T,t=-.969266*Ch.l+1.8760108*Ch.I+.041556*Ch.u,e=.0556434*Ch.l+-.2040259*Ch.I+1.0572252*Ch.u,Ph.l=255*uh((3.2404542*Ch.l+-1.5371385*Ch.I+-.4985314*Ch.u)/100),Ph.I=255*uh(t/100),Ph.u=255*uh(e/100),Ph.T=Ch.T,Ph.l=Math.round(Ph.l),255<Ph.l?Ph.l=255:0>Ph.l&&(Ph.l=0),Ph.I=Math.round(Ph.I),255<Ph.I?Ph.I=255:0>Ph.I&&(Ph.I=0),Ph.u=Math.round(Ph.u),255<Ph.u?Ph.u=255:0>Ph.u&&(Ph.u=0),"rgba("+Ph.l+", "+Ph.I+", "+Ph.u+", "+Ph.T+")";case bh:return hh(),Nh.u=Math.min(100,Math.max(0,Nh.u+100*t)),"hsla("+Nh.l+", "+Nh.I+"%, "+Nh.u+"%, "+Nh.T+")";default:return w("Unknown color space: "+e),"rgba(0, 0, 0, 1)"}}function ah(t){Ah||(ph(),Ah=!0);var e=Sh;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,Ph.l=t[0],Ph.I=t[1],Ph.u=t[2],Ph.T=t[3]/255):(e.fillStyle="#FFFFFF",e.fillStyle=t,Ph.l=0,Ph.I=0,Ph.u=0,Ph.T=1)}}function hh(){var t=Ph.l/255,e=Ph.I/255,i=Ph.u/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}s*=60,0>s&&(s+=360),t=r/(1-Math.abs(2*o-1))}Nh.l=Math.round(s),Nh.I=Math.round(100*t),Nh.u=Math.round(100*o),Nh.T=Ph.T}function lh(t){return t/=255,.04045>=t?t/12.92:Math.pow((t+.055)/1.055,2.4)}function uh(t){return.0031308>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function ch(t){return t>wh?Math.pow(t,1/3):(kh*t+16)/116}function fh(t){var e=t*t*t;return e>wh?e:(116*t-16)/kh}function dh(t,e){"string"!==typeof t&&(t instanceof eh||w("Value for "+e+" must be a color string or a Brush, not "+t))}function ph(){Sh=ys?new Ja(null).context:null}Za.className="CanvasSurfaceContext",th.className="ColorNumbers",eh.prototype.copy=function(){var t=new eh;return t.qa=this.qa,t.fl=this.fl,t.Dd=this.Dd.H(),t.sl=this.sl.H(),t.jt=this.jt,t.Vr=this.Vr,null!==this.je&&(t.je=this.je.copy()),t.Ks=this.Ks,t},i=eh.prototype,i.freeze=function(){return this.v=!0,null!==this.je&&this.je.freeze(),this},i.ea=function(){return Object.isFrozen(this)&&w("cannot thaw constant: "+this),this.v=!1,null!==this.je&&this.je.ea(),this},i.jb=function(t){t.classType===eh&&(this.type=t)},i.toString=function(){var t="Brush(";if(this.type===gh)t+=this.color;else if(t=this.type===yh?t+"Linear ":this.type===mh?t+"Radial ":this.type===vh?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+")"},i.addColorStop=function(t,e){return this.v&&k(this),("number"!==typeof t||!isFinite(t)||1<t||0>t)&&M(t,"0 <= loc <= 1",eh,"addColorStop:loc"),null===this.je&&(this.je=new dt),this.je.add(t,e),this.qa===gh&&(this.type=yh),this.ke=null,this},i.FA=function(t,e){if(this.v&&k(this),t=void 0===t||"number"!==typeof t?.2:t,e=void 0===e?xh:e,this.type===gh)ah(this.color),this.color=sh(t,e);else if((this.type===yh||this.type===mh)&&null!==this.colorStops)for(var i=this.colorStops.iterator;i.next();)ah(i.value),this.addColorStop(i.key,sh(t,e));return this},i.Iz=function(t,e){if(this.v&&k(this),t=void 0===t||"number"!==typeof t?.2:t,e=void 0===e?xh:e,this.type===gh)ah(this.color),this.color=sh(-t,e);else if((this.type===yh||this.type===mh)&&null!==this.colorStops)for(var i=this.colorStops.iterator;i.next();)ah(i.value),this.addColorStop(i.key,sh(-t,e));return this},i.Fy=function(){if(this.type===gh)return rh(this.color);if((this.type===yh||this.type===mh)&&null!==this.colorStops){var t=this.colorStops;if(this.type===mh)return rh(t.first().value);if(null!==t.get(.5))return rh(t.get(.5));if(2===t.count)return t=t.ma(),rh(oh(t[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?(i=s,o=a):r>=o&&a<r&&(n=s,r=a)}return i>n&&(r=i,i=n,n=r,r=o),o=n-i,rh(oh(t.get(i),t.get(n),1-r/o))}return!1},d.Object.defineProperties(eh.prototype,{type:{get:function(){return this.qa},set:function(t){this.v&&k(this,t),this.qa=t,this.start.nc()&&(t===yh?this.start=oe:t===mh&&(this.start=ae)),this.end.nc()&&(t===yh?this.end=ue:t===mh&&(this.end=ae)),this.ke=null}},color:{get:function(){return this.fl},set:function(t){this.v&&k(this,t),this.fl=t,this.ke=null}},start:{get:function(){return this.Dd},set:function(t){this.v&&k(this,t),this.Dd=t.H(),this.ke=null}},end:{get:function(){return this.sl},set:function(t){this.v&&k(this,t),this.sl=t.H(),this.ke=null}},startRadius:{get:function(){return this.jt},set:function(t){this.v&&k(this,t),0>t&&M(t,">= zero",eh,"startRadius"),this.jt=t,this.ke=null}},endRadius:{get:function(){return this.Vr},set:function(t){this.v&&k(this,t),0>t&&M(t,">= zero",eh,"endRadius"),this.Vr=t,this.ke=null}},colorStops:{get:function(){return this.je},set:function(t){this.v&&k(this,t),this.je=t,this.ke=null}},pattern:{get:function(){return this.Ks},set:function(t){this.v&&k(this,t),this.Ks=t,this.ke=null}}}),eh.prototype.isDark=eh.prototype.Fy,eh.prototype.darkenBy=eh.prototype.Iz,eh.prototype.lightenBy=eh.prototype.FA,eh.prototype.addColorStop=eh.prototype.addColorStop;var gh,yh,mh,vh,xh,bh,wh=216/24389,kh=24389/27,Mh=[95.047,100,108.883],Sh=null,Ph=new th,Nh=new th,Ch=new th,Th=new th,Ah=!1;function Lh(){this.oa="Base"}function jh(){this.oa="Base"}function Oh(){this.oa="Base"}function Dh(){this.oa="Base"}function Fh(){this.oa="Base"}function Bh(){this.oa="Base"}function Ih(){this.oa="Base",this.name="Table"}function Eh(){this.oa="Base"}function Rh(){this.oa="Base"}function zh(){this.oa="Base"}function Vh(){this.oa="Base"}function Gh(t,e,i,n){if(0>e)return t%e===i;if(t%e!==i)return!1;e=n.length;for(var o=0;o<e;o++)if(t%n[o]===i)return!1;return!0}function Yh(){this.oa="Base"}function Xh(t,e,i,n){if(!1!==La(n)){var o=n.strokeWidth;0===o&&t instanceof Qu&&t.type===Uh.Link&&t.adornedObject instanceof Nl&&(o=t.adornedObject.strokeWidth),o*=n.Aa,t instanceof Nc&&null!==t.na?(t=t.na.bounds,pa(n,t.x-o/2,t.y-o/2,t.width+o,t.height+o)):t instanceof Qu&&null!==t.adornedPart.na?(t=t.adornedPart.na.bounds,pa(n,t.x-o/2,t.y-o/2,t.width+o,t.height+o)):pa(n,-o/2,-o/2,e+o,i+o),ja(n,!1)}}function qh(){this.oa="Base"}function Uh(t){ca.call(this),this.qa=void 0===t?Uh.Position:t,null===this.qa&&w("Panel type not specified or PanelLayout not loaded: "+t),this.W=new et,this.ib=Re,this.qa===Uh.Grid&&(this.isAtomic=!0),this.Mn=Ce,this.Sf=Ks,this.qa===Uh.Table&&Kh(this),this.pq=Us,this.no=Nt,this.oo=At,this.ko=0,this.jo=100,this.mo=10,this.lo=0,this.li=this.ob=this.eh=this.dh=this.Mj=null,this.Do=NaN,this.te=this.Ci=null,this.Jl="category",this.Zd=null,this.xg=new zt(NaN,NaN,NaN,NaN),this.zh=this.Lp=this.Ui=null,this.Lg=""}function Kh(t){t.Fj=Re,t.Ug=1,t.si=null,t.ri=null,t.Tg=1,t.Sg=null,t.pi=null,t.qb=[],t.nb=[],t.dk=Pl,t.Cj=Pl,t.Xi=0,t.Gi=0}function Hh(t,e,i,n){for(var o=n.length,r=t.actualBounds,s=t.naturalBounds,a=!0,h=0;h<o;h++){var l=n[h];if(void 0!==l)if(a)a=!1;else if(0!==l.actual){if(i){if(l.position>r.height)continue}else if(l.position>r.width)continue;var u=l.separatorStrokeWidth;isNaN(u)&&(u=i?t.Ug:t.Tg);var c=l.separatorStroke;if(null===c&&(c=i?t.si:t.Sg),0!==u&&null!==c){va(t,e,c,!1,!1,s,r),c=!1;var f=l.separatorDashArray;null===f&&(f=i?t.ri:t.pi),null!==f&&(c=!0,e.Ft(f,0)),e.beginPath(),f=l.position+u,i?f>r.height&&(u-=f-r.height):f>r.width&&(u-=f-r.width),l=l.position+u/2,e.lineWidth=u,u=t.ib,i?(l+=u.top,f=r.width-u.right,e.moveTo(u.left,l),e.lineTo(f,l)):(l+=u.left,f=r.height-u.bottom,e.moveTo(l,u.top),e.lineTo(l,f)),e.stroke(),c&&e.Dt()}}}}function _h(t,e,i,n,o){for(var r=n.length,s=t.actualBounds,a=t.naturalBounds,h=0;h<r;h++){var l=n[h];if(void 0!==l&&null!==l.background&&l.coversSeparators!==o&&0!==l.actual){var u=i?s.height:s.width;if(!(l.position>u)){var c=l.wc(),f=l.separatorStrokeWidth;isNaN(f)&&(f=i?t.Ug:t.Tg);var d=l.separatorStroke;null===d&&(d=i?t.si:t.Sg),null===d&&(f=0),c-=f,f=l.position+f,c+=l.actual,f+c>u&&(c=u-f),0>=c||(u=t.ib,va(t,e,l.background,!0,!1,a,s),i?e.fillRect(u.left,f+u.top,s.width-(u.left+u.right),c):e.fillRect(f+u.left,u.top,c,s.height-(u.top+u.bottom)))}}}}function Wh(t){return"LineV"===t||"BarV"===t}function $h(t){return null!==t.part?t.part.locationObject:null}function Jh(t,e){Zh(t,t,e)}function Zh(t,e,i){i(e),e=e.W.j;for(var n=e.length,o=0;o<n;o++){var r=e[o];r instanceof Uh&&Zh(t,r,i)}}function Qh(t,e){tl(t,t,e)}function tl(t,e,i){if(i(e),e instanceof Uh){e=e.W.j;for(var n=e.length,o=0;o<n;o++)tl(t,e[o],i)}}function el(t,e,i){if(i(e))return e;if(e instanceof Uh){e=e.W.j;for(var n=e.length,o=0;o<n;o++){var r=el(t,e[o],i);if(null!==r)return r}}return null}function il(t){t=t.W.j;for(var e=t.length,i=0,n=0;n<e;n++){var o=t[n];o instanceof Uh?i=Math.max(i,il(o)):o instanceof Nl&&(i=Math.max(i,o.wh/2*o.gk*o.Af()))}return i}function nl(t,e,i,n){for(var o=t.W.j,r=o.length;r--;){var s=o[r];if(s.visible){var a=s.actualBounds,h=t.naturalBounds;a.x>h.width||a.y>h.height||0>a.x+a.width||0>a.y+a.height||(s instanceof Uh&&nl(s,e,i,n),null!==e&&(s=e(s)),null===s||null!==i&&!i(s)||n.add(s))}}}function ol(t){var e=null;return t instanceof Nl&&(e=t.spot1,e===Ce&&(e=null),t=t.geometry,null!==t&&null===e&&(e=t.spot1)),null===e&&(e=ne),e}function rl(t){var e=null;return t instanceof Nl&&(e=t.spot2,e===Ce&&(e=null),t=t.geometry,null!==t&&null===e&&(e=t.spot2)),null===e&&(e=ce),e}function sl(t,e){t.F=e?16777216|t.F:-16777217&t.F}function al(t,e,i){var n=t.qb;if(n&&!(0>e)){if(n[e]=i instanceof wl?i:void 0,!i)for(e=n.length-1;0<=e&&void 0===n[e--];)n.length--;t.o()}}function hl(t,e,i){var n=t.nb;if(n&&!(0>e)){if(n[e]=i instanceof wl?i:void 0,!i)for(e=n.length-1;0<=e&&void 0===n[e--];)n.length--;t.o()}}function ll(t){return t=t.li,null!==t&&t.v}function ul(t){var e=t.li;if(null===e)null!==t.data&&w("Template cannot have .data be non-null: "+t),t.li=e=new et;else if(e.v)return;var i=new et;sl(t,!1),t.an(t,(function(t,n){var o=n.fb;if(null!==o)for(Ca(n,!1),o=o.iterator;o.next();){var r=o.value;r.mode===gp&&Ca(n,!0);var s=r.sourceName;null!==s&&("/"===s&&sl(t,!0),s=fp(r,t,n),null!==s&&(i.add(s),null===s.im&&(s.im=new et),s.im.add(r))),e.add(r)}if(n instanceof Uh&&n.type===Uh.Table){if(0<n.qb.length)for(t=n.qb,o=t.length,r=0;r<o;r++)if(s=t[r],void 0!==s&&null!==s.fb)for(var a=s.fb.iterator;a.next();){var h=a.value;h.pd=s,h.hq=2,h.om=s.index,e.add(h)}if(0<n.nb.length)for(n=n.nb,t=n.length,o=0;o<t;o++)if(r=n[o],void 0!==r&&null!==r.fb)for(s=r.fb.iterator;s.next();)a=s.value,a.pd=r,a.hq=1,a.om=r.index,e.add(a)}}));for(var n=i.iterator;n.next();){var o=n.value;if(null!==o.im){Ca(o,!0);for(var r=o.im.iterator;r.next();){var s=r.value;null===o.fb&&(o.fb=new et),o.fb.add(s)}}o.im=null}for(n=e.iterator;n.next();)if(o=n.value,r=o.pd,null!==r){o.pd=null;var a=o.targetProperty,h=a.indexOf(".");0<h&&r instanceof Uh&&(s=a.substring(0,h),a=a.substr(h+1),h=r.bb(s),null!==h?(r=h,o.targetProperty=a):S('Warning: unable to find GraphObject named "'+s+'" for Binding: '+o.toString())),r instanceof wl?(s=st(r.panel),o.wj=void 0===s?-1:s,r.panel.dl=o.wj):r instanceof ca?(s=st(r),o.wj=void 0===s?-1:s,r.dl=o.wj):w("Unknown type of binding target: "+r)}e.freeze(),t instanceof Lu&&t.Nc()&&t.Ta()}function cl(t,e){t=t.W.j;for(var i=t.length,n=e.length,o=0,r=null;o<i&&(r=t[o],!(r instanceof Uh&&null!==r.data));)o++,r=t[o];if(i-o!==n)return!0;if(null===r)return 0<n;for(var s=0;o<i&&s<n;){if(r=t[o],!(r instanceof Uh)||r.data!==e[s])return!0;o++,s++}return!1}function fl(t){if(t.type===Uh.Spot||t.type===Uh.Auto)return Math.min(t.W.length,1);if(t.type===Uh.Link){t=t.W;for(var e=t.length,i=0;i<e;i++){var n=t.J(i);if(!(n instanceof Nl&&n.isPanelMain))break}return i}return t.type===Uh.Table&&0<t.W.length&&(t=t.W.J(0),t.isPanelMain&&t instanceof Uh&&(t.type===Uh.TableRow||t.type===Uh.TableColumn))?1:0}function dl(t,e,i){if(!(void 0===e||null===e||0>i)){var n=gl(t,e),o=t.itemTemplateMap,r=null;null!==o&&(r=o.G(n)),null===r&&(null!==o&&(r=o.G("")),null===r&&(vl||(vl=!0,S('No item template Panel found for category "'+n+'" on '+t),S("  Using default item template."),n=new Uh,o=new Il,o.bind(new cp("text","",F)),n.add(o),xl=n),r=xl)),n=r,null!==n&&(ul(n),n=n.copy(),0!==(16777216&n.F)&&(o=t.ij(),null!==o&&sl(o,!0)),"object"===typeof e&&(null===t.Zd&&(t.Zd=new dt),t.Zd.add(e,n)),o=i+fl(t),t.wb(o,n),n.ob=e,pl(t,o,i),n.ob=null,n.data=e)}}function pl(t,e,i){for(t=t.W;e<t.length;){var n=t.J(e);if(n instanceof Uh){var o=e,r=i;n.type===Uh.TableRow?n.row=o:n.type===Uh.TableColumn&&(n.column=o),n.itemIndex=r}e++,i++}}function gl(t,e){if(null===e)return"";if(t=t.Jl,"function"===typeof t)t=t(e);else{if("string"!==typeof t||"object"!==typeof e)return"";if(""===t)return"";t=ap(e,t)}return void 0===t?"":"string"===typeof t?t:(w("Panel.getCategoryForItemData found a non-string category for "+e+": "+t),"")}function yl(t,e,i){var n=e.enabledChanged;if(null!==n&&n(e,i),e instanceof Uh){e=e.W.j,n=e.length;for(var o=0;o<n;o++){var r=e[o];i&&r instanceof Uh&&!r.isEnabled||yl(t,r,i)}}}function ml(t,e){e.name=t,bl.add(t,e)}eh.className="Brush",eh.Solid=gh=new U(eh,"Solid",0),eh.Linear=yh=new U(eh,"Linear",1),eh.Radial=mh=new U(eh,"Radial",2),eh.Pattern=vh=new U(eh,"Pattern",4),eh.Lab=xh=new U(eh,"Lab",5),eh.HSL=bh=new U(eh,"HSL",6),eh.randomColor=function(t,e){void 0===t&&(t=128),void 0===e&&(e=Math.max(t,255));var i=Math.abs(e-t);e=Math.floor(t+Math.random()*i).toString(16);var n=Math.floor(t+Math.random()*i).toString(16);return t=Math.floor(t+Math.random()*i).toString(16),2>e.length&&(e="0"+e),2>n.length&&(n="0"+n),2>t.length&&(t="0"+t),"#"+e+n+t},eh.isValidColor=function(t){if("black"===t)return!0;if(""===t)return!1;Ah||(ph(),Ah=!0);var e=Sh;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)},eh.lighten=function(t){return ih(t)},eh.lightenBy=ih,eh.darken=function(t){return nh(t)},eh.darkenBy=nh,eh.mix=oh,eh.isDark=rh,Lh.prototype.measure=function(){},Lh.prototype.IA=function(t,e,i,n,o){t.measure(e,i,n,o)},Lh.prototype.arrange=function(){},Lh.prototype.wz=function(t,e,i,n,o,r){t.arrange(e,i,n,o,r)},Lh.prototype.RA=function(t){t.Bk()},Lh.prototype.mc=function(){},d.Object.defineProperties(Lh.prototype,{name:{get:function(){return this.oa},set:function(t){this.oa=t}},classType:{get:function(){return Uh}}}),Lh.prototype.remeasureObject=Lh.prototype.RA,Lh.prototype.arrangeElement=Lh.prototype.wz,Lh.prototype.measureElement=Lh.prototype.IA,Lh.className="PanelLayout",f(jh,Lh),jh.prototype.measure=function(t,e,i,n,o,r,s){var a=n.length;t=$h(t);for(var h=0;h<a;h++){var l=n[h];if(l.visible||l===t){var u=l.margin,c=u.right+u.left;u=u.top+u.bottom,l.measure(e,i,r,s);var f=l.measuredBounds;c=Math.max(f.width+c,0),u=Math.max(f.height+u,0),f=l.position.x;var d=l.position.y;isFinite(f)||(f=0),isFinite(d)||(d=0),l instanceof Nl&&l.isGeometryPositioned&&(l=l.strokeWidth/2,f-=l,d-=l),Ht(o,f,d,c,u)}}},jh.prototype.arrange=function(t,e,i){var n=e.length,o=t.padding;for(t=i.x-o.left,i=i.y-o.top,o=0;o<n;o++){var r=e[o],s=r.measuredBounds,a=r.margin,h=r.position.x,l=r.position.y;if(h=isNaN(h)?-t:h-t,l=isNaN(l)?-i:l-i,r instanceof Nl&&r.isGeometryPositioned){var u=r.strokeWidth/2;h-=u,l-=u}r.visible&&r.arrange(h+a.left,l+a.top,s.width,s.height)}},f(Oh,Lh),Oh.prototype.measure=function(t,e,i,n,o,r,s){var a=n.length;e=j(),r=$h(t);for(var h=0;h<a;h++){var l=n[h];if(l.visible||l===r){var u=ka(l,!1);if(u!==qs&&u!==Hs)e.push(l);else{l.measure(1/0,i,0,s),u=l.margin,l=l.measuredBounds;var c=Math.max(l.height+u.top+u.bottom,0);o.width+=Math.max(l.width+u.right+u.left,0),o.height=Math.max(o.height,c)}}}for(n=e.length,t.desiredSize.height?i=Math.min(t.desiredSize.height,t.maxSize.height):0!==o.height&&(i=Math.min(o.height,t.maxSize.height)),t=0;t<n;t++)h=e[t],(h.visible||h===r)&&(u=h.margin,a=u.right+u.left,u=u.top+u.bottom,h.measure(1/0,i,0,s),h=h.measuredBounds,u=Math.max(h.height+u,0),o.width+=Math.max(h.width+a,0),o.height=Math.max(o.height,u));O(e)},Oh.prototype.arrange=function(t,e,i){for(var n=e.length,o=t.padding,r=o.top,s=t.isOpposite,a=s?i.width:o.left,h=0;h<n;h++){var l=r,u=e[h];if(u.visible){var c=u.measuredBounds,f=u.margin,d=f.top+f.bottom,p=r+o.bottom,g=c.height,y=ka(u,!1);(isNaN(u.desiredSize.height)&&y===Xs||y===_s)&&(g=Math.max(i.height-d-p,0)),d=g+d+p,p=u.alignment,p.Mb()&&(p=t.defaultAlignment),p.kb()||(p=ae),s&&(a-=c.width+f.left+f.right),u.arrange(a+p.offsetX+f.left,l+p.offsetY+f.top+(i.height*p.y-d*p.y),c.width,g),s||(a+=c.width+f.left+f.right)}}},f(Dh,Lh),Dh.prototype.measure=function(t,e,i,n,o,r){var s=n.length;i=j();for(var a=$h(t),h=0;h<s;h++){var l=n[h];if(l.visible||l===a){var u=ka(l,!1);if(u!==qs&&u!==_s)i.push(l);else{var c=l.margin;u=c.right+c.left,c=c.top+c.bottom,l.measure(e,1/0,r,0),l=l.measuredBounds,Vt(o,Math.max(o.width,Math.max(l.width+u,0)),o.height+Math.max(l.height+c,0))}}}if(n=i.length,0!==n){for(t.desiredSize.width?e=Math.min(t.desiredSize.width,t.maxSize.width):0!==o.width&&(e=Math.min(o.width,t.maxSize.width)),t=0;t<n;t++)h=i[t],(h.visible||h===a)&&(l=h.margin,s=l.right+l.left,l=l.top+l.bottom,h.measure(e,1/0,r,0),h=h.measuredBounds,l=Math.max(h.height+l,0),o.width=Math.max(o.width,Math.max(h.width+s,0)),o.height+=l);O(i)}},Dh.prototype.arrange=function(t,e,i){for(var n=e.length,o=t.padding,r=o.left,s=t.isOpposite,a=s?i.height:o.top,h=0;h<n;h++){var l=r,u=e[h];if(u.visible){var c=u.measuredBounds,f=u.margin,d=f.left+f.right,p=r+o.right,g=c.width,y=ka(u,!1);(isNaN(u.desiredSize.width)&&y===Xs||y===Hs)&&(g=Math.max(i.width-d-p,0)),d=g+d+p,p=u.alignment,p.Mb()&&(p=t.defaultAlignment),p.kb()||(p=ae),s&&(a-=c.height+f.bottom+f.top),u.arrange(l+p.offsetX+f.left+(i.width*p.x-d*p.x),a+p.offsetY+f.top,g,c.height),s||(a+=c.height+f.bottom+f.top)}}},f(Fh,Lh),Fh.prototype.measure=function(t,e,i,n,o,r,s){var a=n.length,h=t.tb(),l=h.margin,u=l.right+l.left,c=l.top+l.bottom;h.measure(e,i,r,s);var f=h.measuredBounds;r=f.width,s=f.height;for(var d=Math.max(r+u,0),p=Math.max(s+c,0),g=t.isClipping,y=zt.allocAt(-l.left,-l.top,d,p),m=!0,v=$h(t),x=0;x<a;x++){var b=n[x];if(b!==h&&(b.visible||b===v)){switch(l=b.margin,d=l.right+l.left,p=l.top+l.bottom,f=ka(b,!1),f){case Xs:e=r,i=s;break;case Hs:e=r;break;case _s:i=s}b.measure(e,i,0,0),f=b.measuredBounds,d=Math.max(f.width+d,0),p=Math.max(f.height+p,0);var w=b.alignment;w.Mb()&&(w=t.defaultAlignment),w.kb()||(w=ae);var k=b.alignmentFocus;k.Mb()&&(k=ae);var M=null;if(b instanceof Uh&&""!==b.Lg&&(b.arrange(0,0,f.width,f.height),M=b.bb(b.Lg),M===b&&(M=null)),null!==M){for(l=M.naturalBounds,f=M.margin,l=pt.allocAt(k.x*l.width-k.offsetX-f.left,k.y*l.height-k.offsetY-f.top);M!==b;)M.transform.ta(l),M=M.panel;b=w.x*r+w.offsetX-l.x,f=w.y*s+w.offsetY-l.y,pt.free(l)}else b=w.x*r+w.offsetX-(k.x*f.width+k.offsetX)-l.left,f=w.y*s+w.offsetY-(k.y*f.height+k.offsetY)-l.top;m?(m=!1,o.h(b,f,d,p)):Ht(o,b,f,d,p)}}switch(m?o.assign(y):g?o.bw(y.x,y.y,y.width,y.height):Ht(o,y.x,y.y,y.width,y.height),zt.free(y),f=h.stretch,f===Ks&&(f=ka(h,!1)),f){case qs:return;case Xs:if(!isFinite(e)&&!isFinite(i))return;break;case Hs:if(!isFinite(e))return;break;case _s:if(!isFinite(i))return}for(f=h.measuredBounds,r=f.width,s=f.height,d=Math.max(r+u,0),p=Math.max(s+c,0),l=h.margin,y=zt.allocAt(-l.left,-l.top,d,p),e=0;e<a;e++)i=n[e],i===h||!i.visible&&i!==v||(l=i.margin,d=l.right+l.left,p=l.top+l.bottom,f=i.measuredBounds,d=Math.max(f.width+d,0),p=Math.max(f.height+p,0),u=i.alignment,u.Mb()&&(u=t.defaultAlignment),u.kb()||(u=ae),i=i.alignmentFocus,i.Mb()&&(i=ae),m?(m=!1,o.h(u.x*r+u.offsetX-(i.x*f.width+i.offsetX)-l.left,u.y*s+u.offsetY-(i.y*f.height+i.offsetY)-l.top,d,p)):Ht(o,u.x*r+u.offsetX-(i.x*f.width+i.offsetX)-l.left,u.y*s+u.offsetY-(i.y*f.height+i.offsetY)-l.top,d,p));m?o.assign(y):g?o.bw(y.x,y.y,y.width,y.height):Ht(o,y.x,y.y,y.width,y.height),zt.free(y)},Fh.prototype.arrange=function(t,e,i){var n=e.length,o=t.tb(),r=o.measuredBounds,s=r.width;r=r.height;var a=t.padding,h=a.left;a=a.top;var l=h-i.x,u=a-i.y;o.arrange(l,u,s,r);for(var c=0;c<n;c++){var f=e[c];if(f!==o){var d=f.measuredBounds,p=d.width;d=d.height,u=f.alignment,u.Mb()&&(u=t.defaultAlignment),u.kb()||(u=ae);var g=f.alignmentFocus;if(g.Mb()&&(g=ae),l=null,f instanceof Uh&&""!==f.Lg&&(l=f.bb(f.Lg),l===f&&(l=null)),null!==l){var y=l.naturalBounds;for(g=pt.allocAt(g.x*y.width-g.offsetX,g.y*y.height-g.offsetY);l!==f;)l.transform.ta(g),l=l.panel;l=u.x*s+u.offsetX-g.x,u=u.y*r+u.offsetY-g.y,pt.free(g)}else l=u.x*s+u.offsetX-(g.x*p+g.offsetX),u=u.y*r+u.offsetY-(g.y*d+g.offsetY);l-=i.x,u-=i.y,f.visible&&f.arrange(h+l,a+u,p,d)}}},f(Bh,Lh),Bh.prototype.measure=function(t,e,i,n,o,r,s){var a=n.length,h=t.tb(),l=h.margin,u=e,c=i,f=l.right+l.left,d=l.top+l.bottom;h.measure(e,i,r,s),l=h.measuredBounds;var p=0,g=null;h instanceof Nl&&(g=h,p=g.strokeWidth*g.scale);var y=Math.max(l.width+f,0);l=Math.max(l.height+d,0);var m=ol(h),v=m.x*y+m.offsetX;m=m.y*l+m.offsetY;var x=rl(h),b=x.x*y+x.offsetX;for(x=x.y*l+x.offsetY,isFinite(e)&&(u=Math.max(Math.abs(v-b)-p,0)),isFinite(i)&&(c=Math.max(Math.abs(m-x)-p,0)),p=Bt.alloc(),p.h(0,0),t=$h(t),x=0;x<a;x++)m=n[x],m===h||!m.visible&&m!==t||(l=m.margin,y=l.right+l.left,v=l.top+l.bottom,m.measure(u,c,0,0),l=m.measuredBounds,y=Math.max(l.width+y,0),l=Math.max(l.height+v,0),p.h(Math.max(y,p.width),Math.max(l,p.height)));if(1===a)o.width=y,o.height=l,Bt.free(p);else{switch(m=ol(h),x=rl(h),a=n=0,x.x!==m.x&&x.y!==m.y&&(n=p.width/Math.abs(x.x-m.x),a=p.height/Math.abs(x.y-m.y)),Bt.free(p),p=0,null!==g&&(p=g.strokeWidth*g.scale,Tl(g)===Us&&(n=a=Math.max(n,a))),n+=Math.abs(m.offsetX)+Math.abs(x.offsetX)+p,a+=Math.abs(m.offsetY)+Math.abs(x.offsetY)+p,g=h.stretch,g===Ks&&(g=ka(h,!1)),g){case qs:s=r=0;break;case Xs:isFinite(e)&&(n=e),isFinite(i)&&(a=i);break;case Hs:isFinite(e)&&(n=e),s=0;break;case _s:r=0,isFinite(i)&&(a=i)}h.Bk(),h.measure(n,a,r,s),o.width=h.measuredBounds.width+f,o.height=h.measuredBounds.height+d}},Bh.prototype.arrange=function(t,e){var i=e.length,n=t.tb(),o=n.measuredBounds,r=zt.alloc();r.h(0,0,1,1);var s=n.margin,a=s.left;s=s.top;var h=t.padding,l=h.left;h=h.top,n.arrange(l+a,h+s,o.width,o.height);var u=ol(n),c=rl(n),f=u.y*o.height+u.offsetY,d=c.x*o.width+c.offsetX;for(c=c.y*o.height+c.offsetY,r.x=u.x*o.width+u.offsetX,r.y=f,Ht(r,d,c,0,0),r.x+=a+l,r.y+=s+h,o=0;o<i;o++)a=e[o],a!==n&&(l=a.measuredBounds,s=a.margin,h=Math.max(l.width+s.right+s.left,0),u=Math.max(l.height+s.top+s.bottom,0),f=a.alignment,f.Mb()&&(f=t.defaultAlignment),f.kb()||(f=ae),h=r.width*f.x+f.offsetX-h*f.x+s.left+r.x,s=r.height*f.y+f.offsetY-u*f.y+s.top+r.y,a.visible&&(_t(r.x,r.y,r.width,r.height,h,s,l.width,l.height)?a.arrange(h,s,l.width,l.height):a.arrange(h,s,l.width,l.height,new zt(r.x,r.y,r.width,r.height))));zt.free(r)},f(Ih,Lh),Ih.prototype.measure=function(t,e,i,n,o){for(var r=n.length,s=j(),a=j(),h=0;h<r;h++){var l=n[h],u=l instanceof Uh?l:null;if(null===u||u.type!==Uh.TableRow&&u.type!==Uh.TableColumn||!l.visible)s.push(l);else{a.push(u);for(var c=u.W.j,f=c.length,d=0;d<f;d++){var p=c[d];u.type===Uh.TableRow?p.row=l.row:u.type===Uh.TableColumn&&(p.column=l.column),s.push(p)}}}r=s.length,0===r&&(t.getRowDefinition(0),t.getColumnDefinition(0));for(var g=[],y=0;y<r;y++){var m=s[y];ja(m,!0),Da(m,!0),g[m.row]||(g[m.row]=[]),g[m.row][m.column]||(g[m.row][m.column]=[]),g[m.row][m.column].push(m)}O(s);var v=j(),x=j(),b=j(),w={count:0},k={count:0},M=e,S=i,P=t.qb;r=P.length;for(var N=0;N<r;N++){var C=P[N];void 0!==C&&(C.actual=0)}P=t.nb,r=P.length;for(var T=0;T<r;T++)C=P[T],void 0!==C&&(C.actual=0);for(var A=g.length,L=0,D=0;D<A;D++)g[D]&&(L=Math.max(L,g[D].length));var F=Math.min(t.topIndex,A-1),B=Math.min(t.leftIndex,L-1),I=0;A=g.length;for(var E=$h(t),R=0;R<A;R++)if(g[R]){L=g[R].length;var z=t.getRowDefinition(R);z.actual=0;for(var V=z.bc=0;V<L;V++)if(g[R][V]){var G=t.getColumnDefinition(V);void 0===v[V]&&(G.actual=0,G.bc=0,v[V]=!0);for(var Y=g[R][V],X=Y.length,q=0;q<X;q++){var U=Y[q];if(U.visible||U===E){var K=1<U.rowSpan||1<U.columnSpan;K&&(R<F||V<B||x.push(U));var H=U.margin,_=H.right+H.left,W=H.top+H.bottom,$=Ma(U,z,G,!1),J=U.desiredSize,Z=!isNaN(J.height),Q=!isNaN(J.width)&&Z;if(K||$===qs||Q||R<F||V<B||(void 0!==w[V]||$!==Xs&&$!==Hs||(w[V]=-1,w.count++),void 0!==k[R]||$!==Xs&&$!==_s||(k[R]=-1,k.count++),b.push(U)),U.measure(1/0,1/0,0,0),!(R<F||V<B)){var tt=U.measuredBounds,et=Math.max(tt.width+_,0),it=Math.max(tt.height+W,0);if(1===U.rowSpan&&($===qs||$===Hs)){C=t.getRowDefinition(R);var nt=C.wc();I=Math.max(it-C.actual,0),I+nt>S&&(I=Math.max(S-nt,0));var ot=0===C.ha;C.bc=C.bc+I,C.actual=C.ha+I,S=Math.max(S-(I+(ot?nt:0)),0)}if(1===U.columnSpan&&($===qs||$===_s)){C=t.getColumnDefinition(V);var rt=C.wc();I=Math.max(et-C.actual,0),I+rt>M&&(I=Math.max(M-rt,0));var st=0===C.ha;C.bc=C.bc+I,C.actual=C.ha+I,M=Math.max(M-(I+(st?rt:0)),0)}K&&U.Bk()}}}}}O(v);var at=0,ht=0;r=t.columnCount;for(var lt=0;lt<r;lt++){var ut=t.nb[lt];void 0!==ut&&(at+=ut.bc,0!==ut.bc&&(at+=ut.wc()))}r=t.rowCount;for(var ct=0;ct<r;ct++){var ft=t.qb[ct];void 0!==ft&&(ht+=ft.bc,0!==ft.bc&&(ht+=ft.wc()))}M=Math.max(e-at,0);var dt=S=Math.max(i-ht,0),pt=M;r=b.length;for(var gt=0;gt<r;gt++){var yt=b[gt],mt=t.getRowDefinition(yt.row),vt=t.getColumnDefinition(yt.column),xt=yt.measuredBounds,bt=yt.margin,wt=bt.right+bt.left,kt=bt.top+bt.bottom;w[yt.column]=0===vt.bc&&void 0!==w[yt.column]?Math.max(xt.width+wt,w[yt.column]):null,k[yt.row]=0===mt.bc&&void 0!==k[yt.row]?Math.max(xt.height+kt,k[yt.row]):null}var Mt,St=0,Pt=0;for(Mt in k)"count"!==Mt&&(St+=k[Mt]);for(Mt in w)"count"!==Mt&&(Pt+=w[Mt]);for(var Nt=Bt.alloc(),Ct=0;Ct<r;Ct++){var Tt=b[Ct];if(Tt.visible||Tt===E){var At=t.getRowDefinition(Tt.row),Lt=t.getColumnDefinition(Tt.column),jt=0;isFinite(Lt.width)?jt=Lt.width:(jt=isFinite(M)&&null!==w[Tt.column]?0===Pt?Lt.actual+M:w[Tt.column]/Pt*pt:null!==w[Tt.column]?M:Lt.actual||M,jt=Math.max(0,jt-Lt.wc()));var Ot=0;switch(isFinite(At.height)?Ot=At.height:(Ot=isFinite(S)&&null!==k[Tt.row]?0===St?At.actual+S:k[Tt.row]/St*dt:null!==k[Tt.row]?S:At.actual||S,Ot=Math.max(0,Ot-At.wc())),Nt.h(Math.max(Lt.minimum,Math.min(jt,Lt.maximum)),Math.max(At.minimum,Math.min(Ot,At.maximum))),$=Ma(Tt,At,Lt,!1),$){case Hs:Nt.height=Math.max(Nt.height,At.actual+S);break;case _s:Nt.width=Math.max(Nt.width,Lt.actual+M)}var Dt=Tt.margin,Ft=Dt.right+Dt.left,It=Dt.top+Dt.bottom;Tt.Bk(),Tt.measure(Nt.width,Nt.height,Lt.minimum,At.minimum);var Et=Tt.measuredBounds,Rt=Math.max(Et.width+Ft,0),zt=Math.max(Et.height+It,0);isFinite(M)&&(Rt=Math.min(Rt,Nt.width)),isFinite(S)&&(zt=Math.min(zt,Nt.height));var Vt=0;Vt=At.actual,At.actual=Math.max(At.actual,zt),At.bc=Math.max(At.bc,zt),I=At.actual-Vt,S=Math.max(S-I,0),null===k[Tt.row]&&(dt=Math.max(dt-I,0)),Vt=Lt.actual,Lt.actual=Math.max(Lt.actual,Rt),Lt.bc=Math.max(Lt.bc,Rt),I=Lt.actual-Vt,M=Math.max(M-I,0),null===w[Tt.column]&&(pt=Math.max(pt-I,0))}}O(b);var Gt=Bt.alloc(),Yt=j(),Xt=j();if(r=x.length,0!==r)for(var qt=0;qt<A;qt++)if(g[qt]){L=g[qt].length;var Ut=t.getRowDefinition(qt);Yt[qt]=Ut.actual;for(var Kt=0;Kt<L;Kt++)if(g[qt][Kt]){var Ht=t.getColumnDefinition(Kt);Xt[Kt]=Ht.actual}}for(var _t=0;_t<r;_t++){var Wt=x[_t];if(Wt.visible||Wt===E){var $t=t.getRowDefinition(Wt.row),Jt=t.getColumnDefinition(Wt.column);switch(Nt.h(Math.max(Jt.minimum,Math.min(e,Jt.maximum)),Math.max($t.minimum,Math.min(i,$t.maximum))),$=Ma(Wt,$t,Jt,!1),$){case Xs:0!==Xt[Jt.index]&&(Nt.width=Math.min(Nt.width,Xt[Jt.index])),0!==Yt[$t.index]&&(Nt.height=Math.min(Nt.height,Yt[$t.index]));break;case Hs:0!==Xt[Jt.index]&&(Nt.width=Math.min(Nt.width,Xt[Jt.index]));break;case _s:0!==Yt[$t.index]&&(Nt.height=Math.min(Nt.height,Yt[$t.index]))}isFinite(Jt.width)&&(Nt.width=Jt.width),isFinite($t.height)&&(Nt.height=$t.height),Gt.h(0,0);for(var Zt=Jt.minimum,Qt=$t.minimum,te=1;te<Wt.rowSpan&&!(Wt.row+te>=t.rowCount);te++)C=t.getRowDefinition(Wt.row+te),I=0,I=$===Xs||$===_s?Math.max(C.minimum,0===Yt[Wt.row+te]?C.maximum:Math.min(Yt[Wt.row+te],C.maximum)):Math.max(C.minimum,isNaN(C.ad)?C.maximum:Math.min(C.ad,C.maximum)),Gt.height+=I,Qt+=C.minimum;for(var ee=1;ee<Wt.columnSpan&&!(Wt.column+ee>=t.columnCount);ee++)C=t.getColumnDefinition(Wt.column+ee),I=0,I=$===Xs||$===Hs?Math.max(C.minimum,0===Xt[Wt.column+ee]?C.maximum:Math.min(Xt[Wt.column+ee],C.maximum)):Math.max(C.minimum,isNaN(C.ad)?C.maximum:Math.min(C.ad,C.maximum)),Gt.width+=I,Zt+=C.minimum;Nt.width+=Gt.width,Nt.height+=Gt.height;var ie=Wt.margin,ne=ie.right+ie.left,oe=ie.top+ie.bottom;Wt.measure(Nt.width,Nt.height,Zt,Qt);for(var re=Wt.measuredBounds,se=Math.max(re.width+ne,0),ae=Math.max(re.height+oe,0),he=0,le=0;le<Wt.rowSpan&&!(Wt.row+le>=t.rowCount);le++)C=t.getRowDefinition(Wt.row+le),he+=C.total||0;if(he<ae){var ue=ae-he,ce=ae-he;if(null!==Wt.spanAllocation)for(var fe=Wt.spanAllocation,de=0;de<Wt.rowSpan&&!(0>=ue)&&!(Wt.row+de>=t.rowCount);de++){C=t.getRowDefinition(Wt.row+de);var pe=C.ha||0,ge=fe(Wt,C,ce);C.actual=Math.min(C.maximum,pe+ge),C.ha!==pe&&(ue-=C.ha-pe)}for(;0<ue;){var ye=C.ha||0;if(isNaN(C.height)&&C.maximum>ye&&(C.actual=Math.min(C.maximum,ye+ue),C.ha!==ye&&(ue-=C.ha-ye)),0===C.index)break;C=t.getRowDefinition(C.index-1)}}for(var me=0,ve=0;ve<Wt.columnSpan&&!(Wt.column+ve>=t.columnCount);ve++)C=t.getColumnDefinition(Wt.column+ve),me+=C.total||0;if(me<se){var xe=se-me,be=se-me;if(null!==Wt.spanAllocation)for(var we=Wt.spanAllocation,ke=0;ke<Wt.columnSpan&&!(0>=xe)&&!(Wt.column+ke>=t.columnCount);ke++){C=t.getColumnDefinition(Wt.column+ke);var Me=C.ha||0,Se=we(Wt,C,be);C.actual=Math.min(C.maximum,Me+Se),C.ha!==Me&&(xe-=C.ha-Me)}for(;0<xe;){var Pe=C.ha||0;if(isNaN(C.width)&&C.maximum>Pe&&(C.actual=Math.min(C.maximum,Pe+xe),C.ha!==Pe&&(xe-=C.ha-Pe)),0===C.index)break;C=t.getColumnDefinition(C.index-1)}}}}O(x),Bt.free(Gt),Bt.free(Nt),void 0!==Yt&&O(Yt),void 0!==Xt&&O(Xt);var Ne=0,Ce=0,Te=t.desiredSize,Ae=t.maxSize;$=ka(t,!0);var Le=ht=at=0,je=0;r=t.columnCount;for(var Oe=0;Oe<r;Oe++)void 0!==t.nb[Oe]&&(C=t.getColumnDefinition(Oe),isFinite(C.width)?(Le+=C.width,Le+=C.wc()):kl(C)===Sl?(Le+=C.ha,Le+=C.wc()):0!==C.ha&&(at+=C.ha,at+=C.wc()));Ne=isFinite(Te.width)?Math.min(Te.width,Ae.width):$!==qs&&isFinite(e)?e:at,Ne=Math.max(Ne,t.minSize.width),Ne=Math.max(Ne-Le,0);for(var De=0===at?1:Math.max(Ne/at,1),Fe=0;Fe<r;Fe++)void 0!==t.nb[Fe]&&(C=t.getColumnDefinition(Fe),isFinite(C.width)||kl(C)===Sl||(C.actual=C.ha*De),C.position=o.width,0!==C.ha&&(o.width+=C.ha,o.width+=C.wc()));r=t.rowCount;for(var Be=0;Be<r;Be++)void 0!==t.qb[Be]&&(C=t.getRowDefinition(Be),isFinite(C.height)?(je+=C.height,je+=C.wc()):kl(C)===Sl?(je+=C.ha,je+=C.wc()):0!==C.ha&&(ht+=C.ha,0!==C.ha&&(ht+=C.wc())));Ce=isFinite(Te.height)?Math.min(Te.height,Ae.height):$!==qs&&isFinite(i)?i:ht,Ce=Math.max(Ce,t.minSize.height),Ce=Math.max(Ce-je,0);for(var Ie=0===ht?1:Math.max(Ce/ht,1),Ee=0;Ee<r;Ee++)void 0!==t.qb[Ee]&&(C=t.getRowDefinition(Ee),isFinite(C.height)||kl(C)===Sl||(C.actual=C.ha*Ie),C.position=o.height,0!==C.ha&&(o.height+=C.ha,0!==C.ha&&(o.height+=C.wc())));r=a.length;for(var Re=0;Re<r;Re++){var ze=a[Re],Ve=0,Ge=0;ze.type===Uh.TableRow?(Ve=o.width,C=t.getRowDefinition(ze.row),Ge=C.actual):(C=t.getColumnDefinition(ze.column),Ve=C.actual,Ge=o.height),ze.measuredBounds.h(0,0,Ve,Ge),ja(ze,!1),g[ze.row]||(g[ze.row]=[]),g[ze.row][ze.column]||(g[ze.row][ze.column]=[]),g[ze.row][ze.column].push(ze)}O(a),t.Lp=g},Ih.prototype.arrange=function(t,e,i){var n=e.length,o=t.padding,r=o.left;o=o.top;for(var s,a,h=t.Lp,l=h.length,u=0,c=0;c<l;c++)h[c]&&(u=Math.max(u,h[c].length));for(c=Math.min(t.topIndex,l-1);c!==l&&(void 0===t.qb[c]||0===t.qb[c].ha);)c++;for(c=Math.min(c,l-1),c=-t.qb[c].position,s=Math.min(t.leftIndex,u-1);s!==u&&(void 0===t.nb[s]||0===t.nb[s].ha);)s++;s=Math.min(s,u-1);for(var f=-t.nb[s].position,d=Bt.alloc(),p=0;p<l;p++)if(h[p]){u=h[p].length;var g=t.getRowDefinition(p);a=g.position+c+o,0!==g.ha&&(a+=g.Jv());for(var y=0;y<u;y++)if(h[p][y]){var m=t.getColumnDefinition(y);s=m.position+f+r,0!==m.ha&&(s+=m.Jv());for(var v=h[p][y],x=v.length,b=0;b<x;b++){var w=v[b],k=w.measuredBounds,M=w instanceof Uh?w:null;if(null===M||M.type!==Uh.TableRow&&M.type!==Uh.TableColumn){d.h(0,0);for(var S=1;S<w.rowSpan&&!(p+S>=t.rowCount);S++)M=t.getRowDefinition(p+S),d.height+=M.total;for(S=1;S<w.columnSpan&&!(y+S>=t.columnCount);S++)M=t.getColumnDefinition(y+S),d.width+=M.total;var P=m.ha+d.width,N=g.ha+d.height;S=s,M=a;var C=P,T=N,A=s,L=a,j=P,O=N;s+P>i.width&&(j=Math.max(i.width-s,0)),a+N>i.height&&(O=Math.max(i.height-a,0));var D=w.alignment;if(D.Mb()){D=t.defaultAlignment,D.kb()||(D=ae);var F=D.x,B=D.y,I=D.offsetX;D=D.offsetY;var E=m.alignment,R=g.alignment;E.kb()&&(F=E.x,I=E.offsetX),R.kb()&&(B=R.y,D=R.offsetY)}else F=D.x,B=D.y,I=D.offsetX,D=D.offsetY;(isNaN(F)||isNaN(B))&&(B=F=.5,D=I=0),E=k.width,R=k.height;var z=w.margin,V=z.left+z.right,G=z.top+z.bottom,Y=Ma(w,g,m,!1);!isNaN(w.desiredSize.width)||Y!==Xs&&Y!==Hs||(E=Math.max(P-V,0)),!isNaN(w.desiredSize.height)||Y!==Xs&&Y!==_s||(R=Math.max(N-G,0)),P=w.maxSize,N=w.minSize,E=Math.min(P.width,E),R=Math.min(P.height,R),E=Math.max(N.width,E),R=Math.max(N.height,R),P=R+G,S+=C*F-(E+V)*F+I+z.left,M+=T*B-P*B+D+z.top,w.visible&&(_t(A,L,j,O,S,M,k.width,k.height)?w.arrange(S,M,E,R):w.arrange(S,M,E,R,new zt(A,L,j,O)))}else w.Fl(),w.actualBounds.ea(),C=w.actualBounds,S=zt.allocAt(C.x,C.y,C.width,C.height),C.x=M.type===Uh.TableRow?r:s,C.y=M.type===Uh.TableColumn?o:a,C.width=k.width,C.height=k.height,w.actualBounds.freeze(),Da(w,!1),Xt(S,C)||(k=w.part,null!==k&&(k.Oh(),w.mp(k))),zt.free(S)}}}for(Bt.free(d),t=0;t<n;t++)i=e[t],r=i instanceof Uh?i:null,null===r||r.type!==Uh.TableRow&&r.type!==Uh.TableColumn||(r=i.actualBounds,i.naturalBounds.ea(),i.naturalBounds.h(0,0,r.width,r.height),i.naturalBounds.freeze())},f(Eh,Lh),Eh.prototype.measure=function(){},Eh.prototype.arrange=function(){},f(Rh,Lh),Rh.prototype.measure=function(){},Rh.prototype.arrange=function(){},f(zh,Lh),zh.prototype.measure=function(t,e,i,n,o,r,s){1<n.length&&w("Viewbox Panel cannot contain more than one GraphObject."),n=n[0],n.Aa=1,n.Bk(),n.measure(1/0,1/0,r,s);var a=n.measuredBounds,h=n.margin,l=h.right+h.left;if(h=h.top+h.bottom,isFinite(e)||isFinite(i)){var u=n.scale,c=a.width;a=a.height;var f=Math.max(e-l,0),d=Math.max(i-h,0),p=1;t.viewboxStretch===Us?0!==c&&0!==a&&(p=Math.min(f/c,d/a)):0!==c&&0!==a&&(p=Math.max(f/c,d/a)),0===p&&(p=1e-4),n.Aa*=p,u!==n.scale&&(ja(n,!0),n.measure(1/0,1/0,r,s))}a=n.measuredBounds,o.width=isFinite(e)?e:Math.max(a.width+l,0),o.height=isFinite(i)?i:Math.max(a.height+h,0)},zh.prototype.arrange=function(t,e,i){e=e[0];var n=e.measuredBounds,o=e.margin,r=Math.max(n.width+(o.right+o.left),0);o=Math.max(n.height+(o.top+o.bottom),0);var s=e.alignment;s.Mb()&&(s=t.defaultAlignment),s.kb()||(s=ae),e.arrange(i.width*s.x-r*s.x+s.offsetX,i.height*s.y-o*s.y+s.offsetY,n.width,n.height)},f(Vh,Lh),Vh.prototype.measure=function(){},Vh.prototype.arrange=function(){},Vh.prototype.mc=function(t,e,i){i=t.Af()*i.scale,0>=i&&(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();for(var d=[],p=t.W.j,g=p.length,y=0;y<g;y++){var m=p[y],v=[];if(d.push(v),m.visible){var x=m.interval;if(!(0>x)){m=Wh(m.figure);for(var b=0;b<g;b++)if(b!==y){var w=p[b];w.visible&&Wh(w.figure)===m&&(w=w.interval,w>x&&v.push(w))}}}}for(p=t.W.j,g=p.length,y=0;y<g;y++){var k=p[y];if(k.visible&&(v=k.interval||1,m=Math.abs(v),!(2>o*m*i))){if(x=k.segmentIndex,isFinite(x)&&!isNaN(x)||(x=0),0>x&&(x=m-Math.min(-x,m)),x=Math.round(x%m),m=k.opacity,b=1,1!==m){if(0===m)continue;b=e.globalAlpha,e.globalAlpha=b*m}w=d[y];var M=!1,S=k.strokeDashArray;if(null!==S&&(M=!0,e.Ft(S,k.strokeDashOffset)),"LineV"===k.figure&&null!==k.stroke&&0<k.strokeWidth){for(e.lineWidth=k.strokeWidth,va(t,e,k.stroke,!1,!1,r,s),e.beginPath(),S=k=Math.floor((f-o)/o);S<=k+l;S++){var P=S*o+f;0<=P&&P<=a&&Gh(S,v,x,w)&&(e.moveTo(P,0),e.lineTo(P,h))}e.stroke()}else if("LineH"===k.figure&&null!==k.stroke&&0<k.strokeWidth){for(e.lineWidth=k.strokeWidth,va(t,e,k.stroke,!1,!1,r,s),e.beginPath(),S=k=Math.floor((c-n)/n);S<=k+u;S++)P=S*n+c,0<=P&&P<=h&&Gh(S,v,x,w)&&(e.moveTo(0,P),e.lineTo(a,P));e.stroke()}else if("BarV"===k.figure&&null!==k.fill)for(va(t,e,k.fill,!0,!1,r,s),k=k.width,isNaN(k)&&(k=o),P=S=Math.floor((f-o)/o);P<=S+l;P++){var N=P*o+f;0<=N+k&&N<=a&&Gh(P,v,x,w)&&e.fillRect(N,0,k,h)}else if("BarH"===k.figure&&null!==k.fill)for(va(t,e,k.fill,!0,!1,r,s),k=k.height,isNaN(k)&&(k=n),P=S=Math.floor((c-n)/n);P<=S+u;P++)N=P*n+c,0<=N+k&&N<=h&&Gh(P,v,x,w)&&e.fillRect(0,N,a,k);M&&e.Dt(),1!==m&&(e.globalAlpha=b)}}e.restore(),e.uc(!1)},f(Yh,Lh),Yh.prototype.measure=function(t,e,i,n,o){if(i=n.length,t instanceof Qu||t instanceof Nc){var r=null,s=null,a=null;if(t instanceof Nc&&(s=r=t),t instanceof Qu&&(a=t,r=a.adornedPart),r instanceof Nc){var h=r;if(0===i)Vt(t.naturalBounds,0,0),t.measuredBounds.h(0,0,0,0);else{var l=t instanceof Qu?null:r.path,u=r.routeBounds;e=t.xg,e.h(0,0,u.width,u.height);var c=h.points;r=r.pointsCount,null!==a?a.Gk(!1):null!==s&&s.Gk(!1);var f=u.width,d=u.height;t.location.h(u.x,u.y),t.l.length=0,null!==l&&(Xh(t,f,d,l),a=l.measuredBounds,e.Rc(a),t.l.push(a)),a=Ke.alloc();for(var p=pt.alloc(),g=pt.alloc(),y=0;y<i;y++){var m=n[y];if(m!==l)if(m.isPanelMain&&m instanceof Nl){Xh(t,f,d,m);var v=m.measuredBounds;e.Rc(v),t.l.push(v)}else if(2>r)m.measure(1/0,1/0,0,0),v=m.measuredBounds,e.Rc(v),t.l.push(v);else{var x=m.segmentIndex,b=m.segmentFraction,w=m.alignmentFocus;w.nc()&&(w=ae);var k=m.segmentOrientation,M=m.segmentOffset;if(isNaN(x)){var S=h.na;v=j(),S.Yv(b,v);var P=pt.allocAt(v[0],v[1]);if(P.add(h.i(0)),S.type===si||(S=S.figures.first()),P.offset(-S.startX,-S.startY),S=v[2],k!==tf){var N=h.computeAngle(m,k,S);m.Yb=N}N=P.x-u.x;var C=P.y-u.y;pt.free(P),O(v)}else if(x<-r||x>=r)C=h.midPoint,S=h.midAngle,k!==tf&&(N=h.computeAngle(m,k,S),m.Yb=N),N=C.x-u.x,C=C.y-u.y;else{if(N=0,0<=x?(C=c.J(x),v=x<r-1?c.J(x+1):C):(N=r+x,C=c.J(N),v=0<N?c.J(N-1):C),C.Qa(v)){0<=x?(S=0<x?c.J(x-1):C,N=x<r-2?c.J(x+2):v):(S=N<r-1?c.J(N+1):C,N=1<N?c.J(N-2):v),P=S.Ie(C);var T=v.Ie(N);S=P>T+10?0<=x?S.Pa(C):C.Pa(S):T>P+10?0<=x?v.Pa(N):N.Pa(v):0<=x?S.Pa(N):N.Pa(S)}else S=0<=x?C.Pa(v):v.Pa(C);k!==tf&&(N=h.computeAngle(m,k,S),m.Yb=N),N=C.x+(v.x-C.x)*b-u.x,C=C.y+(v.y-C.y)*b-u.y}m.measure(1/0,1/0,0,0),v=m.measuredBounds,P=m.naturalBounds;var A=0;m instanceof Nl&&(A=m.strokeWidth),T=P.width+A;var L=P.height+A;a.reset(),a.translate(-v.x,-v.y),a.scale(m.scale,m.scale),a.rotate(k===tf?m.angle:S,T/2,L/2),k!==lf&&k!==df||a.rotate(90,T/2,L/2),k!==uf&&k!==pf||a.rotate(-90,T/2,L/2),k===gf&&(45<S&&135>S||225<S&&315>S)&&a.rotate(-S,T/2,L/2),P=new zt(0,0,T,L),p.tj(P,w),a.ta(p),w=-p.x+A/2*m.scale,m=-p.y+A/2*m.scale,g.assign(M),A=isNaN(M.x);var D=isNaN(M.y);if(A||D){T=T/2+3,L=L/2+3;var F=45<=S&&135>=S,B=225<=S&&315>=S;k===tf&&(F||B)?(g.x=D?T:M.y,g.y=A?L:M.x,F?0<=x||isNaN(x)&&.5>b||!A||(g.y=-L):B&&((0<=x||isNaN(x)&&.5>b)&&A&&(g.y=-L),D&&(g.x=-T))):(A&&(g.x=0<=x||isNaN(x)&&.5>b?T:-T),D&&(g.y=-L),g.rotate(S))}else g.rotate(S);N+=g.x,C+=g.y,P.set(v),P.h(N+w,C+m,v.width,v.height),t.l.push(P),e.Rc(P)}}if(null!==s)for(n=s.labelNodes;n.next();)n.value.measure(1/0,1/0);t.xg=e,t=t.location,t.h(t.x+e.x,t.y+e.y),Vt(o,e.width||0,e.height||0),Ke.free(a),pt.free(p),pt.free(g)}}}},Yh.prototype.arrange=function(t,e){var i=e.length;if(t instanceof Qu||t instanceof Nc){var n=null,o=null,r=null;t instanceof Nc&&(o=n=t),t instanceof Qu&&(r=t,n=r.adornedPart);var s=t instanceof Qu?null:n.path;if(0!==t.l.length){var a=t.l,h=0;if(null!==s&&h<t.l.length){var l=a[h];h++,s.arrange(l.x-t.xg.x,l.y-t.xg.y,l.width,l.height)}for(l=0;l<i;l++){var u=e[l];if(u!==s&&h<t.l.length){var c=a[h];h++,u.arrange(c.x-t.xg.x,c.y-t.xg.y,c.width,c.height)}}}if(e=n.points,i=e.count,2<=i&&t instanceof Nc)for(n=t.labelNodes;n.next();){var f=t;s=n.value,a=s.segmentIndex,h=s.segmentFraction;var d=s.alignmentFocus;if(l=s.segmentOrientation,u=s.segmentOffset,isNaN(a)){c=f.na;var p=j();c.Yv(h,p);var g=pt.allocAt(p[0],p[1]);g.add(f.i(0)),c.type===si||(c=c.figures.first()),g.offset(-c.startX,-c.startY),c=p[2],l!==tf&&(f=f.computeAngle(s,l,c),s.angle=f),f=g.x;var y=g.y;pt.free(g),O(p)}else if(a<-i||a>=i)y=f.midPoint,c=f.midAngle,l!==tf&&(f=f.computeAngle(s,l,c),s.angle=f),f=y.x,y=y.y;else{if(g=0,0<=a?(p=e.j[a],y=a<i-1?e.j[a+1]:p):(g=i+a,p=e.j[g],y=0<g?e.j[g-1]:p),p.Qa(y)){0<=a?(c=0<a?e.j[a-1]:p,g=a<i-2?e.j[a+2]:y):(c=g<i-1?e.j[g+1]:p,g=1<g?e.j[g-2]:y);var m=c.Ie(p),v=y.Ie(g);c=m>v+10?0<=a?c.Pa(p):p.Pa(c):v>m+10?0<=a?y.Pa(g):g.Pa(y):0<=a?c.Pa(g):g.Pa(c)}else c=0<=a?p.Pa(y):y.Pa(p);l!==tf&&(f=f.computeAngle(s,l,c),s.angle=f),f=p.x+(y.x-p.x)*h,y=p.y+(y.y-p.y)*h}if(d.Vt())s.location=new pt(f,y);else{d.nc()&&(d=ae),p=Ke.alloc(),p.reset(),p.scale(s.scale,s.scale),p.rotate(s.angle,0,0);var x=s.naturalBounds;g=zt.allocAt(0,0,x.width,x.height),m=pt.alloc(),m.tj(g,d),p.ta(m),d=-m.x,v=-m.y;var b=x.width,w=x.height;x=pt.alloc(),x.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<=c&&135>=c,P=225<=c&&315>=c;l===tf&&(S||P)?(x.x=M?b:u.y,x.y=k?w:u.x,S?0<=a||isNaN(a)&&.5>h||!k||(x.y=-w):P&&((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(c))}else x.rotate(c);f+=x.x,y+=x.y,p.Pw(g),d+=g.x,v+=g.y,a=pt.allocAt(f+d,y+v),s.move(a),pt.free(a),pt.free(x),pt.free(m),zt.free(g),Ke.free(p)}}null!==r?r.Gk(!1):null!==o&&o.Gk(!1)}},f(qh,Lh),qh.prototype.measure=function(t,e,i,n,o,r,s){var a=t.tb();t.dh=[];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 zt(-h.left,-h.top,Math.max(c.width+l,0),Math.max(c.height+u,0));t.dh.push(f),o.assign(f);for(var d=a.geometry,p=a.strokeWidth,g=d.flattenedSegments,y=d.flattenedLengths,m=d.flattenedTotalLength,v=g.length,x=0,b=0,w=j(),k=0;k<v;k++){var M=g[k],S=[];b=x=0;for(var P=M.length,N=0;N<P;N+=2){var C=M[N],T=M[N+1];if(0!==N){var A=180*Math.atan2(T-b,C-x)/Math.PI;0>A&&(A+=360),S.push(A)}x=C,b=T}w.push(S)}if(null===t.eh){for(var L=[],D=t.W.j,F=D.length,B=0;B<F;B++){var I=D[B],E=[];if(L.push(E),I.visible){var R=I.interval;if(!(0>R))for(var z=0;z<F;z++)if(z!==B){var V=D[z];if(V.visible&&I.constructor===V.constructor){var G=V.interval;G>R&&E.push(G)}}}}t.eh=L}var Y=t.eh,X=t.W.j,q=X.length,U=0,K=0,H=m;t.Mj=[];for(var _,W=0;W<q;W++){var $=X[W];if(_=[],$.visible&&$!==a){var J=Math.abs($.interval),Z=t.graduatedTickUnit;if(!(2>Z*J*m/t.graduatedRange)){var Q=y[0][0],tt=0,et=0;K=m*$.graduatedStart-1e-4,H=m*$.graduatedEnd+1e-4;var it=Z*J,nt=t.graduatedTickBase;if(nt<t.graduatedMin){var ot=(t.graduatedMin-nt)/it;ot=0===ot%1?ot:Math.floor(ot+1),nt+=ot*it}else nt>t.graduatedMin+it&&(nt-=Math.floor((nt-t.graduatedMin)/it)*it);for(var rt=Y[W],st=nt,at=1;nt<t.graduatedMax+5e-8;at++){t:{for(var ht=rt.length,lt=0;lt<ht;lt++)if(_e.aa((nt-t.graduatedTickBase)%(rt[lt]*t.graduatedTickUnit),0)){var ut=!1;break t}ut=!0}if(ut&&(null===$.graduatedSkip||!$.graduatedSkip(nt))&&(U=(nt-t.graduatedMin)*m/t.graduatedRange,U>m&&(U=m),K<=U&&U<=H)){for(var ct=w[tt][et],ft=y[tt][et];tt<y.length;){for(;U>Q&&et<y[tt].length-1;)et++,ct=w[tt][et],ft=y[tt][et],Q+=ft;if(U<=Q)break;tt++,et=0,ct=w[tt][et],ft=y[tt][et],Q+=ft}var dt=g[tt],gt=dt[2*et],yt=dt[2*et+1],mt=(U-(Q-ft))/ft,vt=new pt(gt+(dt[2*et+2]-gt)*mt+p/2-d.bounds.x,yt+(dt[2*et+3]-yt)*mt+p/2-d.bounds.y);vt.scale(a.scale,a.scale);var xt=ct,bt=w[tt];if(1e-4>mt?0<et?xt=bt[et-1]:_e.aa(dt[0],dt[dt.length-2])&&_e.aa(dt[1],dt[dt.length-1])&&(xt=bt[bt.length-1]):.9999<mt&&(et+1<bt.length?xt=bt[et+1]:_e.aa(dt[0],dt[dt.length-2])&&_e.aa(dt[1],dt[dt.length-1])&&(xt=bt[0])),ct!==xt&&(180<Math.abs(ct-xt)&&(ct<xt?ct+=360:xt+=360),ct=(ct+xt)/2%360),$ instanceof Il){var wt="";null!==$.graduatedFunction?(wt=$.graduatedFunction(nt),wt=null!==wt&&void 0!==wt?wt.toString():""):wt=(+nt.toFixed(2)).toString(),""!==wt&&_.push({Km:vt,angle:ct,text:wt})}else _.push({Km:vt,angle:ct})}nt=st+at*it}}}t.Mj.push(_)}O(w);var kt=t.Mj;if(null!==kt)for(var Mt=n.length,St=0;St<Mt;St++){var Pt=n[St],Nt=kt[St];if(Pt.visible&&Pt!==a&&0!==Nt.length){if(Pt instanceof Nl){var Ct=t,Tt=o,At=Pt.alignmentFocus;At.nc()&&(At=oe);var Lt=Pt.angle;Pt.Yb=0,Pt.measure(1/0,1/0,0,0),Pt.Yb=Lt;var jt=Pt.measuredBounds,Ot=jt.width,Dt=jt.height,Ft=zt.allocAt(0,0,Ot,Dt),Bt=pt.alloc();Bt.tj(Ft,At),zt.free(Ft);for(var It=-Bt.x,Et=-Bt.y,Rt=new zt,Vt=Nt.length,Gt=0;Gt<Vt;Gt++)for(var Yt=Nt[Gt],Xt=Yt.Km.x,qt=Yt.Km.y,Ut=Yt.angle,Kt=0;4>Kt;Kt++){switch(Kt){case 0:Bt.h(It,Et);break;case 1:Bt.h(It+Ot,Et);break;case 2:Bt.h(It,Et+Dt);break;case 3:Bt.h(It+Ot,Et+Dt)}Bt.rotate(Ut+Pt.angle),Bt.offset(Xt,qt),0===Gt&&0===Kt?Rt.h(Bt.x,Bt.y,0,0):Rt.Oe(Bt),Bt.offset(-Xt,-qt),Bt.rotate(-Ut-Pt.angle)}pt.free(Bt),null!==Ct.dh&&Ct.dh.push(Rt),Ht(Tt,Rt.x,Rt.y,Rt.width,Rt.height)}else if(Pt instanceof Il){var _t=t,Wt=o;null===_t.zh&&(_t.zh=new Il);var $t=_t.zh;El($t,Pt);var Jt=Pt.alignmentFocus;Jt.nc()&&(Jt=oe);for(var Zt=Pt.segmentOrientation,Qt=Pt.segmentOffset,te=new zt,ee=0,ie=0,ne=0,re=0,se=0,ae=Nt.length,he=0;he<ae;he++){var le=Nt[he];ee=le.Km.x,ie=le.Km.y,ne=le.angle,se=re=Pt.angle,Zt!==tf&&(se=Zt===hf||Zt===ff?ne+Pt.angle:ne,re=Nc.computeAngle(Zt,se)),$t.Yb=re,$t.text=le.text||"",$t.measure(1/0,1/0,0,0);var ue=$t.measuredBounds,ce=$t.naturalBounds,fe=ce.width,de=ce.height,pe=Ke.alloc();pe.reset(),pe.translate(-ue.x,-ue.y),pe.scale($t.scale,$t.scale),pe.rotate(se,fe/2,de/2),Zt!==lf&&Zt!==df||pe.rotate(90,fe/2,de/2),Zt!==uf&&Zt!==pf||pe.rotate(-90,fe/2,de/2),Zt===gf&&(45<ne&&135>ne||225<ne&&315>ne)&&pe.rotate(-ne,fe/2,de/2);var ge=zt.allocAt(0,0,fe,de),ye=pt.alloc();ye.tj(ge,Jt),pe.ta(ye);var me=-ye.x,ve=-ye.y,xe=pt.alloc();xe.assign(Qt),isNaN(xe.x)&&(xe.x=fe/2+3),isNaN(xe.y)&&(xe.y=-(de/2+3)),xe.rotate(ne),ee+=xe.x+me,ie+=xe.y+ve;var be=new zt(ee,ie,ue.width,ue.height),we=new zt(ue.x,ue.y,ue.width,ue.height),ke=new zt(ce.x,ce.y,ce.width,ce.height);le.DA=re,le.lineCount=$t.lineCount,le.lines=[$t.vb,$t.Ei,$t.oe,$t.Be,$t.Qb,$t.lb,$t.me],le.actualBounds=be,le.measuredBounds=we,le.naturalBounds=ke,0===he?te.assign(be):te.Rc(be),pt.free(xe),pt.free(ye),zt.free(ge),Ke.free(pe)}null!==_t.dh&&_t.dh.push(te),Ht(Wt,te.x,te.y,te.width,te.height)}ja(Pt,!1)}}},qh.prototype.arrange=function(t,e,i){if(null!==t.dh){var n=t.tb(),o=t.Mj;if(null!==o){var r=t.dh,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<h;l++){var u=e[l];a=o[l],u.visible&&u!==n&&0!==a.length&&(a=r[s],s++,u.arrange(a.x-i.x,a.y-i.y,a.width,a.height))}t.dh=null}}},qh.prototype.mc=function(t,e,i){var n=i.yi;i.yi=!0;var o=t.naturalBounds,r=o.width;o=o.height,e.save(),e.beginPath(),e.rect(-1,-1,r+1,o+1),e.clip(),r=t.tb(),r.mc(e,i),o=t.Af()*i.scale,0>=o&&(o=1);for(var s=r.actualBounds,a=t.W.j,h=t.Mj,l=a.length,u=0;u<l;u++){var c=a[u],f=h[u],d=f.length;if(c.visible&&c!==r&&0!==f.length)if(c instanceof Nl){if(!(2>t.graduatedTickUnit*c.interval*r.geometry.flattenedTotalLength/t.graduatedRange*o)){var p=c.measuredBounds,g=c.strokeWidth*c.scale,y=c.alignmentFocus;y.nc()&&(y=oe);for(var m=0;m<d;m++){var v=f[m].Km,x=f[m].angle,b=y,w=c.sb;w.reset(),w.translate(v.x+s.x,v.y+s.y),w.rotate(x+c.angle,0,0),w.translate(-p.width*b.x+b.offsetX+g/2,-p.height*b.y+b.offsetY+g/2),w.scale(c.scale,c.scale),Ta(c,!1),c.Zh.set(c.sb),c.ql=c.scale,Aa(c,!1),c.mc(e,i),c.sb.reset()}}}else if(c instanceof Il)for(null===t.zh&&(t.zh=new Il),p=t.zh,El(p,c),c=0;c<d;c++)g=f[c],g.actualBounds&&g.measuredBounds&&g.naturalBounds&&(p.Ub=g.text||"",p.Yb=g.DA||0,p.Zc=g.lineCount||0,y=g.lines,void 0!==y&&(p.vb=y[0],p.Ei=y[1],p.oe=y[2],p.Be=y[3],p.Qb=y[4],p.lb=y[5],p.me=y[6]),g.naturalBounds&&(p.rc=g.naturalBounds),g.actualBounds&&(y=g.actualBounds,p.arrange(y.x,y.y,y.width,y.height)),y=g.actualBounds,p.arrange(y.x,y.y,y.width,y.height),m=g.measuredBounds,g=g.naturalBounds,v=p.sb,v.reset(),v.translate(y.x+s.x,y.y+s.y),v.translate(-m.x,-m.y),ba(p,v,g.x,g.y,g.width,g.height),Ta(p,!1),p.Zh.set(p.sb),p.ql=p.scale,Aa(p,!1),p.mc(e,i))}i.yi=n,e.restore(),e.uc(!0)},f(Uh,ca),Uh.prototype.cloneProtected=function(t){if(ca.prototype.cloneProtected.call(this,t),t.qa=this.qa,t.ib=this.ib.H(),t.Mn=this.Mn.H(),t.Sf=this.Sf,t.qa===Uh.Table){t.Fj=this.Fj.H(),t.Ug=this.Ug,t.si=this.si,t.ri=this.ri,t.Tg=this.Tg,t.Sg=this.Sg,t.pi=this.pi;var e=[];if(0<this.qb.length)for(var i=this.qb,n=i.length,o=0;o<n;o++)if(void 0!==i[o]){var r=i[o].copy();r.sj(t),e[o]=r}if(t.qb=e,e=[],0<this.nb.length)for(i=this.nb,n=i.length,o=0;o<n;o++)void 0!==i[o]&&(r=i[o].copy(),r.sj(t),e[o]=r);t.nb=e,t.dk=this.dk,t.Cj=this.Cj,t.Xi=this.Xi,t.Gi=this.Gi}t.pq=this.pq,t.no=this.no.H(),t.oo=this.oo.H(),t.ko=this.ko,t.jo=this.jo,t.mo=this.mo,t.lo=this.lo,t.Mj=this.Mj,t.eh=this.eh,t.ob=this.ob,t.li=this.li,t.Do=this.Do,t.Ci=this.Ci,t.te=this.te,t.Jl=this.Jl,t.xg.assign(this.xg),t.Lg=this.Lg,null!==this.Lp&&(t.Lp=this.Lp)},Uh.prototype.yf=function(t){ca.prototype.yf.call(this,t),t.W=this.W;for(var e=t.W.j,i=e.length,n=0;n<i;n++)e[n].og=t;t.Ui=null},Uh.prototype.copy=function(){var t=ca.prototype.copy.call(this);if(null!==t){for(var e=this.W.j,i=e.length,n=0;n<i;n++){var o=e[n].copy();o.sj(t),o.ak=null;var r=t.W,s=r.count;if(r.wb(s,o),r=t.part,null!==r){r.Xj=null,null!==o.portId&&r instanceof ec&&(r.Nh=!0);var a=t.diagram;null!==a&&a.undoManager.isUndoingRedoing||r.Va(Ni,"elements",t,null,o,null,s)}}return t}return null},i=Uh.prototype,i.toString=function(){return"Panel("+this.type.name+")#"+st(this)},i.mp=function(t){ca.prototype.mp.call(this,t);for(var e=this.W.j,i=e.length,n=0;n<i;n++)e[n].mp(t)},i.ej=function(t,e){if(this.qa===Uh.Grid)this.qa.mc(this,t,e);else if(this.qa===Uh.Graduated)this.qa.mc(this,t,e);else{this.qa===Uh.Table&&(t.lineCap="butt",_h(this,t,!0,this.qb,!0),_h(this,t,!1,this.nb,!0),Hh(this,t,!0,this.qb),Hh(this,t,!1,this.nb),_h(this,t,!0,this.qb,!1),_h(this,t,!1,this.nb,!1));var i=this.isClipping&&this.qa===Uh.Spot;i&&t.save();for(var n=this.tb(),o=this.W.j,r=o.length,s=0;s<r;s++){var a=o[s];i&&a===n&&(t.clipInsteadOfFill=!0),a.mc(t,e),i&&a===n&&(t.clipInsteadOfFill=!1)}i&&(t.restore(),t.uc(!0))}},i.zk=function(t,e,i,n,o){var r=this.he(),s=this.transform,a=1/(s.m11*s.m22-s.m12*s.m21),h=s.m22*a,l=-s.m12*a,u=-s.m21*a,c=s.m11*a,f=a*(s.m21*s.dy-s.m22*s.dx),d=a*(s.m12*s.dx-s.m11*s.dy);if(null!==this.areaBackground)return s=this.actualBounds,_e.Cf(s.left,s.top,s.right,s.bottom,t,e,i,n,o);if(null!==this.background)return r=t*h+e*u+f,a=t*l+e*c+d,t=i*h+n*u+f,h=i*l+n*c+d,o.h(0,0),i=this.naturalBounds,r=_e.Cf(0,0,i.width,i.height,r,a,t,h,o),o.transform(s),r;r||(h=1,u=l=0,c=1,d=f=0),a=t*h+e*u+f,t=t*l+e*c+d,h=i*h+n*u+f,i=i*l+n*c+d,o.h(h,i),n=(h-a)*(h-a)+(i-t)*(i-t),l=!1,c=this.W.j,d=c.length,u=pt.alloc(),f=null,e=1/0;var p=null,g=this.isClipping&&this.qa===Uh.Spot;g&&(p=pt.alloc(),f=this.tb(),(l=f.zk(a,t,h,i,p))&&(e=(a-p.x)*(a-p.x)+(t-p.y)*(t-p.y)));for(var y=0;y<d;y++){var m=c[y];m.visible&&m!==f&&m.zk(a,t,h,i,u)&&(l=!0,m=(a-u.x)*(a-u.x)+(t-u.y)*(t-u.y),m<n&&(n=m,o.set(u)))}return g&&(e>n&&o.set(p),pt.free(p)),pt.free(u),r&&o.transform(s),l},i.o=function(t){if(!La(this)){ca.prototype.o.call(this,t),t=null,this.qa!==Uh.Auto&&this.qa!==Uh.Link||(t=this.tb());for(var e=this.W.j,i=e.length,n=0;n<i;n++){var o=e[n];if((o===t||o.isPanelMain)&&o.o(!0),!o.desiredSize.s()){var r=ka(o,!1);(o instanceof Pc||o instanceof Uh||o instanceof Il||r!==qs)&&o.o(!0)}}}},i.Bk=function(){if(!La(this)){ja(this,!0),Da(this,!0);for(var t=this.W.j,e=t.length,i=0;i<e;i++)t[i].Bk()}},i.Fl=function(){if(0!==(2048&this.F)===!1){Ta(this,!0),Aa(this,!0);for(var t=this.W.j,e=t.length,i=0;i<e;i++)t[i].dw()}},i.dw=function(){Aa(this,!0);for(var t=this.W.j,e=t.length,i=0;i<e;i++)t[i].dw()},i.Hm=function(t,e,i,n){var o=this.xg;o.h(0,0,0,0);var r=this.desiredSize,s=this.minSize;void 0===i&&(i=s.width,n=s.height),i=Math.max(i,s.width),n=Math.max(n,s.height);var a=this.maxSize;isNaN(r.width)||(t=Math.min(r.width,a.width)),isNaN(r.height)||(e=Math.min(r.height,a.height)),t=Math.max(i,t),e=Math.max(n,e);var h=this.ib;t=Math.max(t-h.left-h.right,0),e=Math.max(e-h.top-h.bottom,0);var l=this.W.j;0!==l.length&&this.qa.measure(this,t,e,l,o,i,n),t=o.width+h.left+h.right,h=o.height+h.top+h.bottom,isFinite(r.width)&&(t=r.width),isFinite(r.height)&&(h=r.height),t=Math.min(a.width,t),h=Math.min(a.height,h),t=Math.max(s.width,t),h=Math.max(s.height,h),t=Math.max(i,t),h=Math.max(n,h),Vt(o,t,h),Vt(this.naturalBounds,t,h),pa(this,0,0,t,h)},i.tb=function(){if(null===this.Ui){var t=this.W.j,e=t.length;if(0===e)return null;for(var i=0;i<e;i++){var n=t[i];if(!0===n.isPanelMain)return this.Ui=n}this.Ui=t[0]}return this.Ui},i.Ih=function(t,e,i,n){var o=this.W.j;if(this.actualBounds.h(t,e,i,n),0!==o.length){if(!this.desiredSize.s()){t=ka(this,!0);var r=this.measuredBounds;e=r.width,r=r.height;var s=this.jh,a=s.left+s.right;switch(s=s.top+s.bottom,e===i&&r===n&&(t=qs),t){case qs:(e>i||r>n)&&(this.o(),this.measure(e>i?i:e,r>n?n:r,0,0));break;case Xs:this.o(!0),this.measure(i+a,n+s,0,0);break;case Hs:this.o(!0),this.measure(i+a,r+s,0,0);break;case _s:this.o(!0),this.measure(e+a,n+s,0,0)}}this.qa.arrange(this,o,this.xg)}},i.Kh=function(t){var e=this.naturalBounds,i=$h(this);if(_t(0,0,e.width,e.height,t.x,t.y)){e=this.W.j;for(var n=e.length,o=pt.allocAt(0,0);n--;){var r=e[n];if((r.visible||r===i)&&(vt(o.set(t),r.transform),r.$(o)))return pt.free(o),!0}return pt.free(o),null!==this.mb||null!==this.ec}return!1},i.Gt=function(t){if(this.dl===t)return this;for(var e=this.W.j,i=e.length,n=0;n<i;n++){var o=e[n].Gt(t);if(null!==o)return o}return null},i.an=function(t,e){if(e(this,t),t instanceof Uh){t=t.W.j;for(var i=t.length,n=0;n<i;n++)this.an(t[n],e)}},i.ym=function(t){return el(this,this,t)},i.bb=function(t){if(this.name===t)return this;var e=this.W.j,i=e.length;null===this.Ci&&null===this.te||(i=fl(this));for(var n=0;n<i;n++){var o=e[n];if(o instanceof Uh){var r=o.bb(t);if(null!==r)return r}if(o.name===t)return o}return null},i.he=function(){return!(this.type===Uh.TableRow||this.type===Uh.TableColumn)},i.Vb=function(t,e,i){if(!1===this.pickable)return null;if(void 0===e&&(e=null),void 0===i&&(i=null),Oa(this))return null;var n=this.naturalBounds,o=1/this.Af(),r=this.he(),s=r?t:vt(pt.allocAt(t.x,t.y),this.transform),a=this.diagram,h=10,l=5;if(null!==a&&(h=a.Bm("extraTouchArea"),l=h/2),_t(-l*o,-l*o,n.width+h*o,n.height+h*o,s.x,s.y)){if(!this.isAtomic){o=this.W.j;var u=o.length;if(a=pt.alloc(),l=(h=this.isClipping&&this.qa===Uh.Spot)?this.tb():null,h&&(l.he()?vt(a.set(t),l.transform):a.set(t),!l.$(a)))return pt.free(a),r||pt.free(s),null;for(var c=$h(this);u--;){var f=o[u];if((f.visible||f===c)&&(f.he()?vt(a.set(t),f.transform):a.set(t),!h||f!==l)){var d=null;if(f instanceof Uh?d=f.Vb(a,e,i):!0===f.pickable&&f.$(a)&&(d=f),null!==d&&(null!==e&&(d=e(d)),null!==d&&(null===i||i(d))))return pt.free(a),r||pt.free(s),d}}pt.free(a)}return null===this.background&&null===this.areaBackground?(r||pt.free(s),null):(t=_t(0,0,n.width,n.height,s.x,s.y)?this:null,r||pt.free(s),t)}return r||pt.free(s),null},i.hj=function(t,e,i,n){if(!1===this.pickable)return!1;void 0===e&&(e=null),void 0===i&&(i=null);var o=this.naturalBounds,r=this.he(),s=r?t:vt(pt.allocAt(t.x,t.y),this.transform);if(o=_t(0,0,o.width,o.height,s.x,s.y),this.type===Uh.TableRow||this.type===Uh.TableColumn||o){if(!this.isAtomic){for(var a=this.W.j,h=a.length,l=pt.alloc(),u=$h(this);h--;){var c=a[h];if(c.visible||c===u){c.he()?vt(l.set(t),c.transform):l.set(t);var f=c;c=c instanceof Uh?c:null,(null!==c?c.hj(l,e,i,n):f.$(l))&&!1!==f.pickable&&(null!==e&&(f=e(f)),null===f||null!==i&&!i(f)||n.add(f))}}pt.free(l)}return r||pt.free(s),o&&(null!==this.background||null!==this.areaBackground)}return r||pt.free(s),!1},i.zf=function(t,e,i,n,o,r){if(!1===this.pickable)return!1;void 0===e&&(e=null),void 0===i&&(i=null);var s=r;if(void 0===r&&(s=Ke.alloc(),s.reset()),s.multiply(this.transform),this.Jh(t,s))return nl(this,e,i,o),void 0===r&&Ke.free(s),!0;if(this.Mc(t,s)){if(!this.isAtomic)for(var a=$h(this),h=this.W.j,l=h.length;l--;){var u=h[l];if(u.visible||u===a){var c=u.actualBounds,f=this.naturalBounds;c.x>f.width||c.y>f.height||0>c.x+c.width||0>c.y+c.height||(c=u,u=u instanceof Uh?u:null,f=Ke.alloc(),f.set(s),(null!==u?u.zf(t,e,i,n,o,f):ga(c,t,n,f))&&(null!==e&&(c=e(c)),null===c||null!==i&&!i(c)||o.add(c)),Ke.free(f))}}return void 0===r&&Ke.free(s),n}return void 0===r&&Ke.free(s),!1},i.Eg=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.he(),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.Ie(l),c=0<h.x&&h.x<s.width&&0<h.y&&h.y<s.height||xt(h.x,h.y,0,0,0,s.height)<=u||xt(h.x,h.y,0,s.height,s.width,s.height)<=u||xt(h.x,h.y,s.width,s.height,s.width,0)<=u||xt(h.x,h.y,s.width,0,0,0)<=u;if(s=h.qd(0,0)<=u&&h.qd(0,s.height)<=u&&h.qd(s.width,0)<=u&&h.qd(s.width,s.height)<=u,a||(pt.free(h),pt.free(l)),c){if(!this.isAtomic){h=pt.alloc(),l=pt.alloc(),u=$h(this);for(var f=this.W.j,d=f.length;d--;){var p=f[d];if(p.visible||p===u){var g=p.actualBounds,y=this.naturalBounds;a&&(g.x>y.width||g.y>y.height||0>g.x+g.width||0>g.y+g.height)||(p.he()?(g=p.transform,vt(h.set(t),g),vt(l.set(e),g)):(h.set(t),l.set(e)),g=p,p=p instanceof Uh?p:null,(null!==p?p.Eg(h,l,i,n,o,r):g.sy(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},i.add=function(t){this.wb(this.W.count,t)},i.J=function(t){return this.W.J(t)},i.wb=function(t,e){e instanceof Lu&&w("Cannot add a Part to a Panel: "+e+"; use a Panel instead"),(this===e||this.Gg(e))&&(this===e&&w("Cannot make a Panel contain itself: "+this.toString()),w("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+e.toString()));var i=e.panel;if(null!==i&&i!==this&&w("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+e.toString()+", already contained by "+i.toString()+", cannot be shared by this Panel: "+this.toString()),this.qa!==Uh.Grid||e instanceof Nl||w("Can only add Shapes to a Grid Panel, not: "+e),this.qa!==Uh.Graduated||e instanceof Nl||e instanceof Il||w("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+e),e.sj(this),e.ak=null,null!==this.itemArray){var n=e.data;null!==n&&"object"===typeof n&&(null===this.Zd&&(this.Zd=new dt),this.Zd.add(n,e))}var o=this.W;if(n=-1,i===this){for(var r=-1,s=this.W.j,a=s.length,h=0;h<a;h++)if(s[h]===e){r=h;break}if(-1!==r){if(r===t||r+1>=o.count&&t>=o.count)return;o.cb(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.wb(t,e),(0===t||e.isPanelMain)&&(this.Ui=null),La(this)||this.o(),e.o(!1),(null!==e.portId||e instanceof Uh&&!0===e.Nh)&&(this.Nh=!0),this.eh=null,i=this.part,null!==i&&(i.Xj=null,i.kh=NaN,this.Nh&&i instanceof ec&&(i.Nh=!0),i.Nh&&i instanceof ec&&(i.tc=null),o=this.diagram,null!==o&&o.undoManager.isUndoingRedoing||(-1!==n&&i.Va(Ci,"elements",this,e,null,n,null),i.Va(Ni,"elements",this,null,e,null,t),this.Hg()||yl(this,e,!1)))},i.remove=function(t){for(var e=this.W.j,i=e.length,n=-1,o=0;o<i;o++)if(e[o]===t){n=o;break}-1!==n&&this.Lc(n,!0)},i.cb=function(t){0<=t&&this.Lc(t,!0)},i.Lc=function(t,e){var i=this.W,n=i.J(t);if(n.ak=null,n.sj(null),null!==this.Zd){var o=n.data;"object"===typeof o&&this.Zd.remove(o)}i.cb(t),ja(this,!1),this.o(),this.Ui===n&&(this.Ui=null),this.eh=null;var r=this.part;null!==r&&(r.Xj=null,r.kh=NaN,r.Lb(),r instanceof ec&&(n instanceof Uh?n.an(n,(function(t,i){fc(r,i,e)})):fc(r,n,e)),i=this.diagram,null!==i&&i.undoManager.isUndoingRedoing||r.Va(Ci,"elements",this,n,null,t,null))},Uh.prototype.getRowDefinition=function(t){0>t&&M(t,">= 0",Uh,"getRowDefinition:idx"),t=Math.round(t);var e=this.qb;if(void 0===e)return null;if(void 0===e[t]){var i=new wl;i.sj(this),i.isRow=!0,i.index=t,e[t]=i,this.Va(Ni,"rowdefs",this,null,i,null,t)}return e[t]},Uh.prototype.XA=function(t){0>t&&M(t,">= 0",Uh,"removeRowDefinition:idx"),t=Math.round(t);var e=this.qb;if(void 0!==e){var i=e[t];if(i){e[t]=void 0;for(var n=e.length-1;0<=n&&void 0===e[n--];)e.length--;this.Va(Ci,"rowdefs",this,i,null,t,null),this.o()}}},Uh.prototype.getColumnDefinition=function(t){0>t&&M(t,">= 0",Uh,"getColumnDefinition:idx"),t=Math.round(t);var e=this.nb;if(void 0===e)return null;if(void 0===e[t]){var i=new wl;i.sj(this),i.isRow=!1,i.index=t,e[t]=i,this.Va(Ni,"coldefs",this,null,i,null,t)}return e[t]},i=Uh.prototype,i.SA=function(t){0>t&&M(t,">= 0",Uh,"removeColumnDefinition:idx"),t=Math.round(t);var e=this.nb;if(void 0!==e){var i=e[t];if(i){e[t]=void 0;for(var n=e.length-1;0<=n&&void 0===e[n--];)e.length--;this.Va(Ci,"coldefs",this,i,null,t,null),this.o()}}},i.aA=function(t){if(0>t||this.type!==Uh.Table)return-1;for(var e=0,i=this.qb,n=i.length,o=this.Xi;o<n;o++){var r=i[o];if(void 0!==r&&(e+=r.total,t<e))break}return o},i.Tz=function(t){if(0>t||this.type!==Uh.Table)return-1;for(var e=0,i=this.nb,n=i.length,o=this.Gi;o<n;o++){var r=i[o];if(void 0!==r&&(e+=r.total,t<e))break}return o},i.qA=function(t,e){if(void 0===e&&(e=new pt(NaN,NaN)),this.type!==Uh.Graduated)return e.h(NaN,NaN),e;t=Math.min(Math.max(t,this.graduatedMin),this.graduatedMax);var i=this.tb();return i.geometry.Xv((t-this.graduatedMin)/this.graduatedRange,e),i.transform.ta(e)},i.rA=function(t){if(this.type!==Uh.Graduated)return NaN;var e=this.tb();return e.transform.Jd(t),e.geometry.wy(t)*this.graduatedRange+this.graduatedMin},i.Gz=function(t){void 0===t&&(t=!1);var e=this.copy();return Qh(e,(function(t){t instanceof Uh&&(t.li=null,t.ob=null);var e=t.fb;null!==e&&(t.fb=null,e.each((function(e){t.bind(e.copy())}))),e=t.Mg,null!==e&&(t.Mg=null,e.each((function(e){t.Qw(e.value.copy())})))})),t&&ul(e),e},i.Da=function(t){var e=this.li;if(null!==e)for(void 0===t&&(t=""),e=e.iterator;e.next();){var i=e.value,n=i.sourceProperty;if((""===t||""===n||n===t)&&(n=i.targetProperty,null!==i.converter||""!==n)){n=this.data;var o=i.sourceName;if(null!==o){if(""===o)n=this;else if("/"===o)n=this;else if("."===o)n=this;else if(".."===o)n=this;else if(n=this.bb(o),null===n)continue}else if(i.isToModel){if(n=this.diagram,null===n)continue;n=n.model.modelData}var r=this,s=i.wj;if(-1!==s){if(r=this.Gt(s),null===r)continue}else null!==i.pd&&(r=i.pd);if("/"===o?n=r.part:"."===o?n=r:".."===o&&(n=r.panel),o=i.hq,0!==o){if(!(r instanceof Uh))continue;1===o?r=r.getColumnDefinition(i.om):2===o&&(r=r.getRowDefinition(i.om))}void 0!==r&&i.Tw(r,n)}}},i.eu=function(){for(var t=fl(this);this.W.length>t;)this.Lc(this.W.length-1,!1);if(t=this.itemArray,null!==t)for(var e=t.length,i=0;i<e;i++)dl(this,t[i],i)},i.qy=function(t){return void 0===t||null===t||null===this.Zd?null:this.Zd.G(t)},d.Object.defineProperties(Uh.prototype,{type:{get:function(){return this.qa},set:function(t){var e=this.qa;e!==t&&(this.qa=t,this.qa===Uh.Grid?this.isAtomic=!0:this.qa===Uh.Table&&Kh(this),this.o(),this.g("type",e,t))}},elements:{get:function(){return this.W.iterator}},naturalBounds:{get:function(){return this.rc}},padding:{get:function(){return this.ib},set:function(t){"number"===typeof t?(0>t&&M(t,">= 0",Uh,"padding"),t=new Qt(t)):(0>t.left&&M(t.left,">= 0",Uh,"padding:value.left"),0>t.right&&M(t.right,">= 0",Uh,"padding:value.right"),0>t.top&&M(t.top,">= 0",Uh,"padding:value.top"),0>t.bottom&&M(t.bottom,">= 0",Uh,"padding:value.bottom"));var e=this.ib;e.w(t)||(this.ib=t=t.H(),this.o(),this.g("padding",e,t))}},defaultAlignment:{get:function(){return this.Mn},set:function(t){var e=this.Mn;e.w(t)||(this.Mn=t=t.H(),this.o(),this.g("defaultAlignment",e,t))}},defaultStretch:{get:function(){return this.Sf},set:function(t){var e=this.Sf;e!==t&&(this.Sf=t,this.o(),this.g("defaultStretch",e,t))}},defaultSeparatorPadding:{get:function(){return void 0===this.Fj?Re:this.Fj},set:function(t){if(void 0!==this.Fj){"number"===typeof t&&(t=new Qt(t));var e=this.Fj;e.w(t)||(this.Fj=t=t.H(),this.o(),this.g("defaultSeparatorPadding",e,t))}}},defaultRowSeparatorStroke:{get:function(){return void 0===this.si?null:this.si},set:function(t){var e=this.si;e!==t&&(null===t||"string"===typeof t||t instanceof eh)&&(t instanceof eh&&t.freeze(),this.si=t,this.M(),this.g("defaultRowSeparatorStroke",e,t))}},defaultRowSeparatorStrokeWidth:{get:function(){return void 0===this.Ug?1:this.Ug},set:function(t){if(void 0!==this.Ug){var e=this.Ug;e!==t&&isFinite(t)&&0<=t&&(this.Ug=t,this.o(),this.g("defaultRowSeparatorStrokeWidth",e,t))}}},defaultRowSeparatorDashArray:{get:function(){return void 0===this.ri?null:this.ri},set:function(t){if(void 0!==this.ri){var e=this.ri;if(e!==t){if(null!==t){for(var i=t.length,n=0,o=0;o<i;o++){var r=t[o];"number"===typeof r&&0<=r&&isFinite(r)||w("defaultRowSeparatorDashArray value "+r+" at index "+o+" must be a positive number or zero."),n+=r}if(0===n){if(null===e)return;t=null}}this.ri=t,this.M(),this.g("defaultRowSeparatorDashArray",e,t)}}}},defaultColumnSeparatorStroke:{get:function(){return void 0===this.Sg?null:this.Sg},set:function(t){if(void 0!==this.Sg){var e=this.Sg;e!==t&&(null===t||"string"===typeof t||t instanceof eh)&&(t instanceof eh&&t.freeze(),this.Sg=t,this.M(),this.g("defaultColumnSeparatorStroke",e,t))}}},defaultColumnSeparatorStrokeWidth:{get:function(){return void 0===this.Tg?1:this.Tg},set:function(t){if(void 0!==this.Tg){var e=this.Tg;e!==t&&isFinite(t)&&0<=t&&(this.Tg=t,this.o(),this.g("defaultColumnSeparatorStrokeWidth",e,t))}}},defaultColumnSeparatorDashArray:{get:function(){return void 0===this.pi?null:this.pi},set:function(t){if(void 0!==this.pi){var e=this.pi;if(e!==t){if(null!==t){for(var i=t.length,n=0,o=0;o<i;o++){var r=t[o];"number"===typeof r&&0<=r&&isFinite(r)||w("defaultColumnSeparatorDashArray value "+r+" at index "+o+" must be a positive number or zero."),n+=r}if(0===n){if(null===e)return;t=null}}this.pi=t,this.M(),this.g("defaultColumnSeparatorDashArray",e,t)}}}},viewboxStretch:{get:function(){return this.pq},set:function(t){var e=this.pq;e!==t&&(this.pq=t,this.o(),this.g("viewboxStretch",e,t))}},gridCellSize:{get:function(){return this.no},set:function(t){var e=this.no;if(!e.w(t)){t.s()&&0!==t.width&&0!==t.height||w("Invalid Panel.gridCellSize: "+t),this.no=t.H();var i=this.diagram;null!==i&&this===i.grid&&qr(i),this.M(),this.g("gridCellSize",e,t)}}},gridOrigin:{get:function(){return this.oo},set:function(t){var e=this.oo;if(!e.w(t)){t.s()||w("Invalid Panel.gridOrigin: "+t),this.oo=t.H();var i=this.diagram;null!==i&&this===i.grid&&qr(i),this.M(),this.g("gridOrigin",e,t)}}},graduatedMin:{get:function(){return this.ko},set:function(t){var e=this.ko;e!==t&&(this.ko=t,this.o(),this.g("graduatedMin",e,t),Na(this)&&(t=this.part,null!==t&&da(this,t,"graduatedRange")))}},graduatedMax:{get:function(){return this.jo},set:function(t){var e=this.jo;e!==t&&(this.jo=t,this.o(),this.g("graduatedMax",e,t),Na(this)&&(t=this.part,null!==t&&da(this,t,"graduatedRange")))}},graduatedRange:{get:function(){return this.graduatedMax-this.graduatedMin}},graduatedTickUnit:{get:function(){return this.mo},set:function(t){var e=this.mo;e!==t&&0<t&&(this.mo=t,this.o(),this.g("graduatedTickUnit",e,t))}},graduatedTickBase:{get:function(){return this.lo},set:function(t){var e=this.lo;e!==t&&(this.lo=t,this.o(),this.g("graduatedTickBase",e,t))}},Nh:{get:function(){return 0!==(8388608&this.F)},set:function(t){0!==(8388608&this.F)!==t&&(this.F^=8388608)}},rowCount:{get:function(){return void 0===this.qb?0:this.qb.length}},columnCount:{get:function(){return void 0===this.nb?0:this.nb.length}},rowSizing:{get:function(){return void 0===this.dk?Pl:this.dk},set:function(t){if(void 0!==this.dk){var e=this.dk;e!==t&&(this.dk=t,this.o(),this.g("rowSizing",e,t))}}},columnSizing:{get:function(){return void 0===this.Cj?Pl:this.Cj},set:function(t){if(void 0!==this.Cj){var e=this.Cj;e!==t&&(this.Cj=t,this.o(),this.g("columnSizing",e,t))}}},topIndex:{get:function(){return void 0===this.Xi?0:this.Xi},set:function(t){if(void 0!==this.Xi){var e=this.Xi;e!==t&&((!isFinite(t)||0>t)&&w("Panel.topIndex must be greater than zero and a real number, not: "+t),this.Xi=t,this.o(),this.g("topIndex",e,t))}}},leftIndex:{get:function(){return void 0===this.Gi?0:this.Gi},set:function(t){if(void 0!==this.Gi){var e=this.Gi;e!==t&&((!isFinite(t)||0>t)&&w("Panel.leftIndex must be greater than zero and a real number, not: "+t),this.Gi=t,this.o(),this.g("leftIndex",e,t))}}},data:{get:function(){return this.ob},set:function(t){var e=this.ob;if(e!==t){var i=this instanceof Lu&&!(this instanceof Qu);ul(this),this.ob=t;var n=this.diagram;null!==n&&(i?(i=n.partManager,this instanceof Nc?(null!==e&&i.Te.remove(e),null!==t&&i.Te.add(t,this)):this instanceof Lu&&(null!==e&&i.Ue.remove(e),null!==t&&i.Ue.add(t,this))):(i=this.panel,null!==i&&null!==i.Zd&&(null!==e&&i.Zd.remove(e),null!==t&&i.Zd.add(t,this)))),this.g("data",e,t),null!==n&&n.undoManager.isUndoingRedoing||null!==t&&this.Da()}}},itemIndex:{get:function(){return this.Do},set:function(t){var e=this.Do;e!==t&&(this.Do=t,this.g("itemIndex",e,t))}},itemArray:{get:function(){return this.Ci},set:function(t){var e=this.Ci;if(e!==t||null!==t&&cl(this,t)){var i=this.diagram;e!==t&&(null!==i&&null!==e&&Sd(i.partManager,this,i),this.Ci=t,null!==i&&null!==t&&Md(i.partManager,this)),this.g("itemArray",e,t),null!==i&&i.undoManager.isUndoingRedoing||this.eu()}}},itemTemplate:{get:function(){return null===this.te?null:this.te.G("")},set:function(t){if(null===this.te){if(null===t)return;this.te=new dt}var e=this.te.G("");e!==t&&((t instanceof Lu||t.isPanelMain)&&w("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+t),this.te.add("",t),this.g("itemTemplate",e,t),t=this.diagram,null!==t&&t.undoManager.isUndoingRedoing||this.eu())}},itemTemplateMap:{get:function(){return this.te},set:function(t){var e=this.te;if(e!==t){for(var i=t.iterator;i.next(););this.te=t,this.g("itemTemplateMap",e,t),t=this.diagram,null!==t&&t.undoManager.isUndoingRedoing||this.eu()}}},itemCategoryProperty:{get:function(){return this.Jl},set:function(t){var e=this.Jl;e!==t&&(this.Jl=t,this.g("itemCategoryProperty",e,t))}},isAtomic:{get:function(){return 0!==(1048576&this.F)},set:function(t){var e=0!==(1048576&this.F);e!==t&&(this.F^=1048576,this.g("isAtomic",e,t))}},isClipping:{get:function(){return 0!==(2097152&this.F)},set:function(t){var e=0!==(2097152&this.F);e!==t&&(!t||this.type===Uh.Spot||this instanceof bc||S("Warning: Panel.isClipping set on non-Spot Panel: "+this.toString()),this.F^=2097152,this instanceof bc&&(this.Za=null),this.o(),this.g("isClipping",e,t))}},isOpposite:{get:function(){return 0!==(33554432&this.F)},set:function(t){var e=0!==(33554432&this.F);e!==t&&(this.F^=33554432,this.o(),this.g("isOpposite",e,t))}},isEnabled:{get:function(){return 0!==(4194304&this.F)},set:function(t){var e=0!==(4194304&this.F);if(e!==t){var i=null===this.panel||this.panel.Hg();this.F^=4194304,this.g("isEnabled",e,t),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||i&&yl(this,this,t)}}},alignmentFocusName:{get:function(){return this.Lg},set:function(t){var e=this.Lg;e!==t&&(this.Lg=t,this.o(),this.g("alignmentFocusName",e,t))}}}),d.Object.defineProperties(Uh,{Position:{get:function(){return bl.G("Position")}},Horizontal:{get:function(){return bl.G("Horizontal")}},Vertical:{get:function(){return bl.G("Vertical")}},Spot:{get:function(){return bl.G("Spot")}},Auto:{get:function(){return bl.G("Auto")}},Table:{get:function(){return bl.G("Table")}},Viewbox:{get:function(){return bl.G("Viewbox")}},TableRow:{get:function(){return bl.G("TableRow")}},TableColumn:{get:function(){return bl.G("TableColumn")}},Link:{get:function(){return bl.G("Link")}},Grid:{get:function(){return bl.G("Grid")}},Graduated:{get:function(){return bl.G("Graduated")}}}),Uh.prototype.findItemPanelForData=Uh.prototype.qy,Uh.prototype.rebuildItemElements=Uh.prototype.eu,Uh.prototype.updateTargetBindings=Uh.prototype.Da,Uh.prototype.copyTemplate=Uh.prototype.Gz,Uh.prototype.graduatedValueForPoint=Uh.prototype.rA,Uh.prototype.graduatedPointForValue=Uh.prototype.qA,Uh.prototype.findColumnForLocalX=Uh.prototype.Tz,Uh.prototype.findRowForLocalY=Uh.prototype.aA,Uh.prototype.removeColumnDefinition=Uh.prototype.SA,Uh.prototype.removeRowDefinition=Uh.prototype.XA,Uh.prototype.removeAt=Uh.prototype.cb,Uh.prototype.remove=Uh.prototype.remove,Uh.prototype.insertAt=Uh.prototype.wb,Uh.prototype.elt=Uh.prototype.J,Uh.prototype.add=Uh.prototype.add,Uh.prototype.findObject=Uh.prototype.bb,Uh.prototype.findInVisualTree=Uh.prototype.ym,Uh.prototype.walkVisualTreeFrom=Uh.prototype.an,Uh.prototype.findMainElement=Uh.prototype.tb;var vl=!1,xl=null,bl=new dt;function wl(){ot(this),this.og=null,this.ns=!0,this.Ra=0,this.ad=NaN,this.nh=0,this.lh=1/0,this.yb=Ce,this.la=this.bc=this.ha=0,this.fb=null,this.Yp=Ml,this.De=Ks,this.Up=this.sg=null,this.Vp=NaN,this.mb=this.fk=null,this.In=!1}function kl(t){if(t.sizing===Ml){var e=t.og;return t.isRow?e.rowSizing:e.columnSizing}return t.sizing}Uh.className="Panel",Uh.definePanelLayout=ml,ml("Position",new jh),ml("Vertical",new Dh),ml("Auto",new Bh),ml("Link",new Yh),wl.prototype.copy=function(){var t=new wl;return t.ns=this.ns,t.Ra=this.Ra,t.ad=this.ad,t.nh=this.nh,t.lh=this.lh,t.yb=this.yb,t.ha=this.ha,t.bc=this.bc,t.la=this.la,t.De=this.De,t.Yp=this.Yp,null===this.sg?t.sg=null:t.sg=this.sg.H(),t.Up=this.Up,t.Vp=this.Vp,t.fk=null,null!==this.fk&&(t.separatorDashArray=T(this.separatorDashArray)),t.mb=this.mb,t.In=this.In,t.fb=this.fb,t},i=wl.prototype,i.gy=function(t){t.isRow?this.height=t.height:this.width=t.width,this.minimum=t.minimum,this.maximum=t.maximum,this.alignment=t.alignment,this.stretch=t.stretch,this.sizing=t.sizing,this.sg=null===t.separatorPadding?null:t.separatorPadding.H(),this.separatorStroke=t.separatorStroke,this.separatorStrokeWidth=t.separatorStrokeWidth,this.fk=null,t.separatorDashArray&&(this.fk=T(t.separatorDashArray)),this.background=t.background,this.coversSeparators=t.coversSeparators,this.fb=t.fb},i.jb=function(t){t.classType===wl&&(this.sizing=t)},i.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+st(this)},i.sj=function(t){this.og=t},i.Jv=function(){var t=0,e=0,i=this.og,n=this.isRow;if(null!==i&&i.type===Uh.Table)for(var o=n?i.qb.length:i.nb.length,r=0;r<o;r++){var s=n?i.qb[r]:i.nb[r];if(void 0!==s){e=s.index;break}}if(this.index!==e&&(e=this.separatorStroke,null===e&&null!==i&&(e=this.isRow?i.defaultRowSeparatorStroke:i.defaultColumnSeparatorStroke),null!==e&&(t=this.separatorStrokeWidth,isNaN(t)&&(t=null!==i?this.isRow?i.defaultRowSeparatorStrokeWidth:i.defaultColumnSeparatorStrokeWidth:0))),e=this.sg,null===e){if(null===i)return t;e=i.defaultSeparatorPadding}return t+(this.isRow?e.top:e.left)},i.wc=function(){var t=0,e=this.og,i=0,n=this.isRow;if(null!==e&&e.type===Uh.Table)for(var o=n?e.qb.length:e.nb.length,r=0;r<o;r++){var s=n?e.qb[r]:e.nb[r];if(void 0!==s){i=s.index;break}}if(this.index!==i&&(i=this.separatorStroke,null===i&&null!==e&&(i=n?e.defaultRowSeparatorStroke:e.defaultColumnSeparatorStroke),null!==i&&(t=this.separatorStrokeWidth,isNaN(t)&&(t=null!==e?n?e.defaultRowSeparatorStrokeWidth:e.defaultColumnSeparatorStrokeWidth:0))),n=this.sg,null===n){if(null===e)return t;n=e.defaultSeparatorPadding}return t+(this.isRow?n.top+n.bottom:n.left+n.right)},i.Bb=function(t,e,i){var n=this.og;if(null!==n&&(n.Va(Pi,t,this,e,i,void 0,void 0),null!==this.fb&&(e=n.diagram,null!==e&&!e.skipsModelSourceBindings&&(n=n.ij(),null!==n&&(e=n.data,null!==e)))))for(i=this.fb.iterator;i.next();)i.value.jr(this,e,t,n)},i.bind=function(t){t.pd=this;var e=this.panel;if(null!==e){var i=e.ij();null!==i&&ll(i)&&w("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+t+" on "+e)}null===this.fb&&(this.fb=new et),this.fb.add(t)},d.Object.defineProperties(wl.prototype,{panel:{get:function(){return this.og}},isRow:{get:function(){return this.ns},set:function(t){this.ns=t}},index:{get:function(){return this.Ra},set:function(t){this.Ra=t}},height:{get:function(){return this.ad},set:function(t){var e=this.ad;e!==t&&(0>t&&M(t,">= 0",wl,"height"),this.ad=t,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.Bb("height",e,t))}},width:{get:function(){return this.ad},set:function(t){var e=this.ad;e!==t&&(0>t&&M(t,">= 0",wl,"width"),this.ad=t,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.Bb("width",e,t))}},minimum:{get:function(){return this.nh},set:function(t){var e=this.nh;e!==t&&((0>t||!isFinite(t))&&M(t,">= 0",wl,"minimum"),this.nh=t,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.Bb("minimum",e,t))}},maximum:{get:function(){return this.lh},set:function(t){var e=this.lh;e!==t&&(0>t&&M(t,">= 0",wl,"maximum"),this.lh=t,this.actual=this.ha,null!==this.panel&&this.panel.o(),this.Bb("maximum",e,t))}},alignment:{get:function(){return this.yb},set:function(t){var e=this.yb;e.w(t)||(this.yb=t.H(),null!==this.panel&&this.panel.o(),this.Bb("alignment",e,t))}},stretch:{get:function(){return this.De},set:function(t){var e=this.De;e!==t&&(this.De=t,null!==this.panel&&this.panel.o(),this.Bb("stretch",e,t))}},separatorPadding:{get:function(){return this.sg},set:function(t){"number"===typeof t&&(t=new Qt(t));var e=this.sg;null!==t&&null!==e&&e.w(t)||(null!==t&&(t=t.H()),this.sg=t,null!==this.panel&&this.panel.o(),this.Bb("separatorPadding",e,t))}},separatorStroke:{get:function(){return this.Up},set:function(t){var e=this.Up;e!==t&&(null!==t&&dh(t,"RowColumnDefinition.separatorStroke"),t instanceof eh&&t.freeze(),this.Up=t,null!==this.panel&&this.panel.o(),this.Bb("separatorStroke",e,t))}},separatorStrokeWidth:{get:function(){return this.Vp},set:function(t){var e=this.Vp;e!==t&&(this.Vp=t,null!==this.panel&&this.panel.o(),this.Bb("separatorStrokeWidth",e,t))}},separatorDashArray:{get:function(){return this.fk},set:function(t){var e=this.fk;if(e!==t){if(null!==t){for(var i=t.length,n=0,o=0;o<i;o++){var r=t[o];"number"===typeof r&&0<=r&&isFinite(r)||w("separatorDashArray value "+r+" at index "+o+" must be a positive number or zero."),n+=r}if(0===n){if(null===e)return;t=null}}this.fk=t,null!==this.panel&&this.panel.M(),this.Bb("separatorDashArray",e,t)}}},background:{get:function(){return this.mb},set:function(t){var e=this.mb;e!==t&&(null!==t&&dh(t,"RowColumnDefinition.background"),t instanceof eh&&t.freeze(),this.mb=t,null!==this.panel&&this.panel.M(),this.Bb("background",e,t))}},coversSeparators:{get:function(){return this.In},set:function(t){var e=this.In;e!==t&&(this.In=t,null!==this.panel&&this.panel.M(),this.Bb("coversSeparators",e,t))}},sizing:{get:function(){return this.Yp},set:function(t){var e=this.Yp;e!==t&&(this.Yp=t,null!==this.panel&&this.panel.o(),this.Bb("sizing",e,t))}},actual:{get:function(){return this.ha},set:function(t){this.ha=isNaN(this.ad)?Math.max(Math.min(this.lh,t),this.nh):Math.max(Math.min(this.lh,this.ad),this.nh)}},measured:{get:function(){return this.bc},set:function(t){this.bc=t}},total:{get:function(){return this.ha+this.wc()},set:function(t){this.ha=isNaN(this.ad)?Math.max(Math.min(this.lh,t),this.nh):Math.max(Math.min(this.lh,this.ad),this.nh),this.ha=Math.max(0,this.ha-this.wc())}},position:{get:function(){return this.la},set:function(t){this.la=t}}}),wl.prototype.bind=wl.prototype.bind,wl.prototype.computeEffectiveSpacing=wl.prototype.wc,wl.prototype.computeEffectiveSpacingTop=wl.prototype.Jv;var Ml=new U(wl,"Default",0),Sl=new U(wl,"None",1),Pl=new U(wl,"ProportionalExtra",2);function Nl(){ca.call(this),this.Ed=this.na=null,this.Yn="None",this.ho=Ks,this.Hc=this.tl="black",this.wh=1,this.km="butt",this.lm="miter",this.gk=10,this.uh=null,this.vh=0,this.qf=this.pf=Ce,this.tp=this.sp=NaN,this.vo=!1,this.wp=null,this.ul=this.rm="None",this.Yd=1,this.Wd=0,this.Ud=1,this.Vd=null}function Cl(t,e,i,n){var o=i.length;if(!(4>o)){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,y=j(),m=2;m<o;m+=2)a=i[m],h=i[m+1],l=a-d,d=h-p,0===l&&(l=.001),u=d/l,c=Math.atan2(d,l),f=Math.sqrt(l*l+d*d),y.push([l,c,u,f]),g+=f,d=a,p=h;d=i[0],p=i[1],l=n.measuredBounds.width,n instanceof Nl&&(l-=n.strokeWidth),1>l&&(l=1),o=i=l,a=s/2,h=0!==a,m=0,f=y[m],l=f[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 O(y);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.ej(t,e),t.translate(s/2,r/2),t.rotate(-c),t.translate(-d,-p),g-=o,f-=o,0!==v){if(m++,m===y.length)return void O(y);f=y[m],l=f[0],c=f[1],u=f[2],f=f[3],o=v}}O(y)}}function Tl(t){var e=t.geometryStretch;return null!==t.Ed?e===Ks?Xs:e:e===Ks?Bl[t.figure].defaultStretch:e}function Al(t,e,i,n,o){return t=i.x-t,e=i.y-e,e=t*t+e*e,e<n?(o.x=i.x,o.y=i.y,e):n}function Ll(t,e,i,n,o,r,s,a,h){var l=!1,u=(o-s)*(e-n)-(r-a)*(t-i);return 0!==u&&(h.x=((o*a-r*s)*(t-i)-(o-s)*(t*n-e*i))/u,h.y=((o*a-r*s)*(e-n)-(r-a)*(t*n-e*i))/u,(t>i?t-i:i-t)<(e>n?e-n:n-e)?(t=e<n?e:n,e=e<n?n:e,(h.y>t||_e.aa(h.y,t))&&(h.y<e||_e.aa(h.y,e))&&(l=!0)):(e=t<i?t:i,t=t<i?i:t,(h.x>e||_e.aa(h.x,e))&&(h.x<t||_e.aa(h.x,t))&&(l=!0)),l)}function jl(t,e,i,n){if(!t.Nt(e,i,n))return!1;t=e.x,e=e.y;var o=i.x,r=i.y;return i=n.x,n=n.y,t===o?(e<r?(t=e,e=r):t=r,n>=t&&n<=e):(t<o?(n=t,t=o):n=o,i>=n&&i<=t)}function Ol(t){var e=t.diagram;null!==e&&e.undoManager.isUndoingRedoing||(t.segmentOrientation=hf,"None"!==t.rm?(t.segmentIndex=-1,t.alignmentFocus=Fe):"None"!==t.ul&&(t.segmentIndex=0,t.alignmentFocus=new Ge(1-Fe.x,Fe.y)))}function Dl(t){var e=Fl[t];if(void 0===e){var i=t.toLowerCase();if("none"===i)return"None";if(e=Fl[i],void 0===e){var n,o=null;for(n in _e.dn)if(n.toLowerCase()===i){o=n;break}if(null!==o)return t=Ze(_e.dn[o],!1),Fl[o]=t,i!==o&&(Fl[i]=o),o}}return"string"===typeof e?e:e instanceof We?t:null}wl.className="RowColumnDefinition",wl.Default=Ml,wl.None=Sl,wl.ProportionalExtra=Pl,f(Nl,ca),Nl.prototype.cloneProtected=function(t){ca.prototype.cloneProtected.call(this,t),t.na=this.na,t.Yn=this.Yn,t.ho=this.ho,t.Ed=this.Ed,t.tl=this.tl,t.Hc=this.Hc,t.wh=this.wh,t.km=this.km,t.lm=this.lm,t.gk=this.gk,null!==this.uh&&(t.uh=T(this.uh)),t.vh=this.vh,t.pf=this.pf.H(),t.qf=this.qf.H(),t.sp=this.sp,t.tp=this.tp,t.vo=this.vo,t.wp=this.wp,t.rm=this.rm,t.ul=this.ul,t.Yd=this.Yd,t.Wd=this.Wd,t.Ud=this.Ud,t.Vd=this.Vd},i=Nl.prototype,i.jb=function(t){t===qs||t===Us||t===Ws||t===Ks?this.geometryStretch=t:ca.prototype.jb.call(this,t)},i.toString=function(){return"Shape("+("None"!==this.figure?this.figure:"None"!==this.toArrow?this.toArrow:this.fromArrow)+")#"+st(this)},i.ej=function(t,e){var i=this.Hc,n=this.tl;if(null!==i||null!==n){var o=this.actualBounds,r=this.naturalBounds;null!==n&&va(this,t,n,!0,!1,r,o);var s=this.part,a=this.wh;null===i||0!==a||null===s||!this.isPanelMain&&s.tb()!==this||(a=s.type===Uh.Link&&s instanceof Qu&&"Selection"===s.category&&s.adornedObject instanceof Nl&&s.adornedPart.tb()===s.adornedObject?s.adornedObject.strokeWidth:0),0===a&&(i=null),null!==i&&0!==a&&(va(this,t,i,!1,!1,r,o),t.lineWidth=a,t.lineJoin=this.lm,t.lineCap=this.km,t.miterLimit=this.gk),o=!1,s&&e.Ke("drawShadows")&&(o=s.isShadowed),s=!0,null===i||null!==n&&"transparent"!==n||(s=!1),r=!1,a=this.strokeDashArray,null!==a&&(r=!0,t.Ft(a,this.vh));var h=this.na;if(null!==h){if(h.type===si)t.beginPath(),t.moveTo(h.startX,h.startY),t.lineTo(h.endX,h.endY),null!==i&&t.vj();else if(h.type===ai){var l=h.startX;a=h.startY;var u=h.endX,c=h.endY;h=Math.min(l,u);var f=Math.min(a,c);l=Math.abs(u-l),a=Math.abs(c-a),t.beginPath(),t.rect(h,f,l,a),null!==n&&t.Je(n),null!==i&&(s&&o&&Wa(t),0!==l&&0!==a||(t.beginPath(),t.rect(h,f,Math.max(l,.1),Math.max(a,.1))),t.vj(),s&&o&&$a(t))}else if(h.type===hi)l=h.startX,a=h.startY,u=h.endX,c=h.endY,h=Math.abs(u-l)/2,f=Math.abs(c-a)/2,l=Math.min(l,u)+h,a=Math.min(a,c)+f,t.beginPath(),t.moveTo(l,a-f),t.bezierCurveTo(l+_e.Kg*h,a-f,l+h,a-_e.Kg*f,l+h,a),t.bezierCurveTo(l+h,a+_e.Kg*f,l+_e.Kg*h,a+f,l,a+f),t.bezierCurveTo(l-_e.Kg*h,a+f,l-h,a+_e.Kg*f,l-h,a),t.bezierCurveTo(l-h,a-_e.Kg*f,l-_e.Kg*h,a-f,l,a-f),t.closePath(),null!==n&&t.Je(n),null!==i&&(s&&o?(Wa(t),t.vj(),$a(t)):t.vj());else if(h.type===li)for(a=h.figures,h=a.length,f=0;f<h;f++){l=a.j[f],t.beginPath(),t.moveTo(l.startX,l.startY),u=l.segments.j,c=u.length;for(var d=null,p=0;p<c;p++){var g=u[p];switch(g.type){case gi:t.moveTo(g.endX,g.endY);break;case yi:t.lineTo(g.endX,g.endY);break;case mi:t.bezierCurveTo(g.point1X,g.point1Y,g.point2X,g.point2Y,g.endX,g.endY);break;case vi:t.quadraticCurveTo(g.point1X,g.point1Y,g.endX,g.endY);break;case xi:if(g.radiusX===g.radiusY){var y=Math.PI/180;t.arc(g.point1X,g.point1Y,g.radiusX,g.startAngle*y,(g.startAngle+g.sweepAngle)*y,0>g.sweepAngle,null!==d?d.endX:l.startX,null!==d?d.endY:l.startY)}else if(d=di(g,l),y=d.length,0===y)t.lineTo(g.centerX,g.centerY);else for(var m=0;m<y;m++){var v=d[m];0===m&&t.lineTo(v[0],v[1]),t.bezierCurveTo(v[2],v[3],v[4],v[5],v[6],v[7])}break;case bi:if(m=y=0,null!==d&&d.type===xi){if(d=di(d,l),v=d.length,0===v){t.lineTo(g.endX,g.endY);break}d=d[v-1]||null,null!==d&&(y=d[6],m=d[7])}else y=null!==d?d.endX:l.startX,m=null!==d?d.endY:l.startY;if(d=pi(g,l,y,m),y=d.length,0===y){t.lineTo(g.endX,g.endY);break}for(m=0;m<y;m++)v=d[m],t.bezierCurveTo(v[2],v[3],v[4],v[5],v[6],v[7]);break;default:w("Segment not of valid type: "+g.type)}g.isClosed&&t.closePath(),d=g}u=l.isFilled,o?l.isShadowed?(!0===u&&"transparent"!==n&&null!==n&&t.Je(n),null!==i&&(u&&s&&Wa(t),t.vj(),u&&s&&$a(t))):(Wa(t),u&&"transparent"!==n&&null!==n&&t.Je(n),null!==i&&t.vj(),$a(t)):(u&&null!==n&&t.Je(n),null!==i&&t.vj())}if(r&&t.Dt(),null!==this.pathPattern){if(i=this.pathPattern,i.measure(1/0,1/0),n=i.measuredBounds,i.arrange(0,0,n.width,n.height),o=this.geometry,t.save(),t.beginPath(),n=j(),o.type===si)n.push(o.startX),n.push(o.startY),n.push(o.endX),n.push(o.endY),Cl(t,e,n,i);else if(o.type===li)for(o=o.figures.iterator;o.next();){for(s=o.value,n.length=0,n.push(s.startX),n.push(s.startY),r=s.startX,a=s.startY,h=r,f=a,l=s.segments.j,u=l.length,c=0;c<u;c++){switch(p=l[c],p.type){case gi:Cl(t,e,n,i),n.length=0,n.push(p.endX),n.push(p.endY),r=p.endX,a=p.endY,h=r,f=a;break;case yi:n.push(p.endX),n.push(p.endY),r=p.endX,a=p.endY;break;case mi:_e.Fe(r,a,p.point1X,p.point1Y,p.point2X,p.point2Y,p.endX,p.endY,.5,n),r=p.endX,a=p.endY;break;case vi:_e.Vq(r,a,p.point1X,p.point1Y,p.endX,p.endY,.5,n),r=p.endX,a=p.endY;break;case xi:if(g=di(p,s),d=g.length,0===d){n.push(p.centerX),n.push(p.centerY),r=p.centerX,a=p.centerY;break}for(y=0;y<d;y++)m=g[y],_e.Fe(r,a,m[2],m[3],m[4],m[5],m[6],m[7],.5,n),r=m[6],a=m[7];break;case bi:if(g=pi(p,s,r,a),d=g.length,0===d){n.push(p.endX),n.push(p.endY),r=p.endX,a=p.endY;break}for(y=0;y<d;y++)m=g[y],_e.Fe(r,a,m[2],m[3],m[4],m[5],m[6],m[7],.5,n),r=m[6],a=m[7];break;default:w("Segment not of valid type: "+p.type)}p.isClosed&&(n.push(h),n.push(f),Cl(t,e,n,i))}Cl(t,e,n,i)}else if(o.type===ai)n.push(o.startX),n.push(o.startY),n.push(o.endX),n.push(o.startY),n.push(o.endX),n.push(o.endY),n.push(o.startX),n.push(o.endY),n.push(o.startX),n.push(o.startY),Cl(t,e,n,i);else if(o.type===hi){if(a=new ci,a.startX=o.endX,a.startY=(o.startY+o.endY)/2,r=new fi(xi),r.startAngle=0,r.sweepAngle=360,r.centerX=(o.startX+o.endX)/2,r.centerY=(o.startY+o.endY)/2,r.radiusX=Math.abs(o.startX-o.endX)/2,r.radiusY=Math.abs(o.startY-o.endY)/2,a.add(r),o=di(r,a),s=o.length,0===s)n.push(r.centerX),n.push(r.centerY);else for(r=a.startX,a=a.startY,h=0;h<s;h++)f=o[h],_e.Fe(r,a,f[2],f[3],f[4],f[5],f[6],f[7],.5,n),r=f[6],a=f[7];Cl(t,e,n,i)}O(n),t.restore(),t.uc(!1)}}}},i.da=function(t,e){if(void 0===e&&(e=new pt),t instanceof Ge){t.nc()&&w("getDocumentPoint Spot must be a real, specific Spot, not: "+t.toString());var i=this.naturalBounds,n=this.strokeWidth;e.h(t.x*(i.width+n)-n/2+i.x+t.offsetX,t.y*(i.height+n)-n/2+i.y+t.offsetY)}else e.set(t);return this.Fd.ta(e),e},i.mj=function(t){void 0===t&&(t=new zt);var e=this.naturalBounds,i=this.Fd;e=zt.allocAt(e.x,e.y,e.width,e.height);var n=this.strokeWidth;return e.Jc(n/2,n/2),n=pt.allocAt(e.x,e.y).transform(i),t.h(n.x,n.y,0,0),n.h(e.right,e.y).transform(i),Ht(t,n.x,n.y,0,0),n.h(e.right,e.bottom).transform(i),Ht(t,n.x,n.y,0,0),n.h(e.x,e.bottom).transform(i),Ht(t,n.x,n.y,0,0),zt.free(e),pt.free(n),t},i.Kh=function(t,e){var i=this.geometry;if(null===i||null===this.fill&&null===this.stroke)return!1;var n=i.bounds,o=this.strokeWidth/2;i.type!==si||e||(o+=2);var r=zt.alloc();if(r.assign(n),r.Jc(o+2,o+2),!r.$(t))return zt.free(r),!1;if(n=o+1e-4,i.type===si)return null!==this.stroke&&(n=(i.endX-i.startX)*(t.x-i.startX)+(i.endY-i.startY)*(t.y-i.startY),!(0>(i.startX-i.endX)*(t.x-i.endX)+(i.startY-i.endY)*(t.y-i.endY)||0>n)&&(zt.free(r),_e.Nb(i.startX,i.startY,i.endX,i.endY,o,t.x,t.y)));if(i.type===ai){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.Jc(-n,-n),r.$(t))return zt.free(r),!1;r.Jc(n,n)}return null!==this.stroke&&r.Jc(o,o),t=r.$(t),zt.free(r),t}if(i.type===hi){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(s-=n,o-=n,0>=s||0>=o||1>=i*i/(s*s)+e*e/(o*o))return zt.free(r),!1;s+=n,o+=n}return null!==this.stroke&&(s+=n,o+=n),zt.free(r),!(0>=s||0>=o)&&1>=i*i/(s*s)+e*e/(o*o)}return i.type===li?(zt.free(r),null===this.fill?ni(i,t.x,t.y,o):ei(i,t,o,1<this.strokeWidth,e)):(w("Unknown Geometry type: "+i.type),!1)},i.Hm=function(t,e,i,n){var o=this.desiredSize,r=this.wh;if(t=Math.max(t,0),e=Math.max(e,0),null!==this.Ed)var s=this.geometry.bounds;else{var a=this.figure,h=Bl[a];if(void 0===h){var l=_e.Qe[a];"string"===typeof l&&(l=_e.Qe[l]),"function"===typeof l?(h=l(null,100,100),Bl[a]=h):w("Unsupported Figure: "+a)}s=h.bounds}a=s.width,h=s.height,l=s.width;var u=s.height;switch(ka(this,!0)){case qs:n=i=0;break;case Xs:l=Math.max(t-r,0),u=Math.max(e-r,0);break;case Hs:l=Math.max(t-r,0),n=0;break;case _s:i=0,u=Math.max(e-r,0)}switch(isFinite(o.width)&&(l=o.width),isFinite(o.height)&&(u=o.height),o=this.maxSize,s=this.minSize,i=Math.max(i-r,s.width),n=Math.max(n-r,s.height),l=Math.min(o.width,l),u=Math.min(o.height,u),l=isFinite(l)?Math.max(i,l):Math.max(a,i),u=isFinite(u)?Math.max(n,u):Math.max(h,n),i=Tl(this),i){case qs:break;case Xs:a=l,h=u;break;case Us:i=Math.min(l/a,u/h),isFinite(i)||(i=1),a*=i,h*=i;break;default:w(i+" is not a valid geometryStretch.")}null!==this.Ed?(0===a&&(a=.001),0===h&&(h=.001),i=null!==this.Ed?this.Ed:this.na,o=i.bounds,n=a/o.width,o=h/o.height,isFinite(n)||(n=1),isFinite(o)||(o=1),this.na=1===n&&1===o?i:i.copy().scale(n,o)):null!==this.na&&_e.aa(this.na.Dl,t-r)&&_e.aa(this.na.Cl,e-r)||(this.na=Nl.makeGeometry(this,a,h)),s=this.na.bounds,1/0===t||1/0===e?pa(this,s.x-r/2,s.y-r/2,0===t&&0===a?0:s.width+r,0===e&&0===h?0:s.height+r):pa(this,-r/2,-r/2,l+r,u+r)},i.Ih=function(t,e,i,n){ya(this,t,e,i,n)},i.Nt=function(t,e,i){return this.zk(t.x,t.y,e.x,e.y,i)},i.zk=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);r=t*a+e*l+c,s=t*h+e*u+f,a=i*a+n*l+c,h=i*h+n*u+f,c=this.wh/2,l=this.na,null===l&&(this.measure(1/0,1/0),l=this.na);var d=l.bounds;if(u=!1,l.type===si)if(1.5>=this.strokeWidth)u=_e.Me(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),u=c/Math.sqrt(1+e*e),n=u*e),e=j(),t=new pt,_e.Me(l.startX+n,l.startY+u,l.endX+n,l.endY+u,r,s,a,h,t)&&e.push(t),t=new pt,_e.Me(l.startX-n,l.startY-u,l.endX-n,l.endY-u,r,s,a,h,t)&&e.push(t),t=new pt,_e.Me(l.startX+n,l.startY+u,l.startX-n,l.startY-u,r,s,a,h,t)&&e.push(t),t=new pt,_e.Me(l.endX+n,l.endY+u,l.endX-n,l.endY-u,r,s,a,h,t)&&e.push(t),a=e.length,0===a)return O(e),!1;for(u=!0,h=1/0,n=0;n<a;n++)t=e[n],i=(t.x-r)*(t.x-r)+(t.y-s)*(t.y-s),i<h&&(h=i,o.x=t.x,o.y=t.y);O(e)}else if(l.type===ai)u=_e.Cf(d.x-c,d.y-c,d.x+d.width+c,d.y+d.height+c,r,s,a,h,o);else if(l.type===hi){e=zt.allocAt(d.x,d.y,d.width,d.height).Jc(c,c);t:if(0===e.width)u=_e.Me(e.x,e.y,e.x,e.y+e.height,r,s,a,h,o);else if(0===e.height)u=_e.Me(e.x,e.y,e.x+e.width,e.y,r,s,a,h,o);else{if(t=e.width/2,l=e.height/2,n=e.x+t,u=e.y+l,i=9999,r!==a&&(i=(s-h)/(r-a)),9999>Math.abs(i)){if(h=s-u-i*(r-n),0>t*t*i*i+l*l-h*h){o.x=NaN,o.y=NaN,u=!1;break t}c=Math.sqrt(t*t*i*i+l*l-h*h),a=(-t*t*i*h+t*l*c)/(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))<Math.abs((r-t)*(r-t))+Math.abs((s-h)*(s-h))?(o.x=a,o.y=l):(o.x=t,o.y=h)}else{if(a=l*l,h=r-n,a-=a/(t*t)*h*h,0>a){o.x=NaN,o.y=NaN,u=!1;break t}h=Math.sqrt(a),a=u+h,h=u-h,Math.abs(a-s)<Math.abs(h-s)?(o.x=r,o.y=a):(o.x=r,o.y=h)}u=!0}zt.free(e)}else if(l.type===li){f=pt.alloc();var p=a-r,g=h-s,y=p*p+g*g,m=r,v=s;if(0<y&&d.contains(m,v)&&(f.x=m,f.y=v,this.$(f)))for(0!==p&&.5>Math.abs(p)?(g*=.5/p,p=.5):0!==g&&.5>Math.abs(g)&&(p*=.5/g,g=.5),m-=p,v-=g;d.contains(m,v);)m-=p,v-=g;for(o.x=a,o.y=h,g=0;g<l.figures.count;g++){var x=l.figures.j[g],b=x.isFilled?m:r,k=x.isFilled?v:s,M=x.segments;d=x.startX,p=x.startY;for(var S=d,P=p,N=0;N<M.count;N++){var C=M.j[N],T=C.type,A=C.endX,L=C.endY,D=!1;switch(T){case gi:S=A,P=L;break;case yi:D=Ll(d,p,A,L,b,k,a,h,f);break;case mi:D=_e.wq(d,p,C.point1X,C.point1Y,C.point2X,C.point2Y,A,L,b,k,a,h,.6,f);break;case vi:D=_e.wq(d,p,d+2/3*(C.point1X-d),p+2/3*(C.point1Y-p),A+2/3*(C.point1X-A),L+2/3*(C.point1Y-L),A,L,b,k,a,h,.6,f);break;case xi:case bi:T=C.type===xi?di(C,x):pi(C,x,d,p);var F=T.length;if(0===F){D=Ll(d,p,C.type===xi?C.centerX:C.endX,C.type===xi?C.centerY:C.endY,b,k,a,h,f);break}for(L=null,A=0;A<F;A++){if(L=T[A],0===A&&Ll(d,p,L[0],L[1],b,k,a,h,f)){var B=Al(b,k,f,y,o);B<y&&(y=B,u=!0)}_e.wq(L[0],L[1],L[2],L[3],L[4],L[5],L[6],L[7],b,k,a,h,.6,f)&&(B=Al(b,k,f,y,o),B<y&&(y=B,u=!0))}A=L[6],L=L[7];break;default:w("Unknown Segment type: "+T)}d=A,p=L,D&&(D=Al(b,k,f,y,o),D<y&&(y=D,u=!0)),C.isClosed&&(A=S,L=P,Ll(d,p,A,L,b,k,a,h,f)&&(C=Al(b,k,f,y,o),C<y&&(y=C,u=!0)))}}r=i-t,s=n-e,a=Math.sqrt(r*r+s*s),0!==a&&(r/=a,s/=a),o.x-=r*c,o.y-=s*c,pt.free(f)}else w("Unknown Geometry type: "+l.type);return!!u&&(this.transform.ta(o),!0)},i.Jh=function(t,e){if(void 0===e)return t.Ge(this.actualBounds);var i=this.na;null===i&&(this.measure(1/0,1/0),i=this.na),i=i.bounds;var n=this.strokeWidth/2,o=!1,r=pt.alloc();return r.h(i.x-n,i.y-n),t.$(e.ta(r))&&(r.h(i.x-n,i.bottom+n),t.$(e.ta(r))&&(r.h(i.right+n,i.bottom+n),t.$(e.ta(r))&&(r.h(i.right+n,i.y-n),t.$(e.ta(r))&&(o=!0)))),pt.free(r),o},i.Mc=function(t,e){if(this.Jh(t,e)||void 0===e&&(e=this.transform,t.Ge(this.actualBounds)))return!0;var i=Ke.alloc();i.set(e),i.St();var n=t.left,o=t.right,r=t.top;t=t.bottom;var s=pt.alloc();if(s.h(n,r),i.ta(s),this.Kh(s,!0))return pt.free(s),!0;if(s.h(o,r),i.ta(s),this.Kh(s,!0))return pt.free(s),!0;if(s.h(n,t),i.ta(s),this.Kh(s,!0))return pt.free(s),!0;if(s.h(o,t),i.ta(s),this.Kh(s,!0))return pt.free(s),!0;var a=pt.alloc(),h=pt.alloc();return i.set(e),i.jw(this.transform),i.St(),a.x=o,a.y=r,a.transform(i),s.x=n,s.y=r,s.transform(i),e=!1,jl(this,s,a,h)?e=!0:(s.x=o,s.y=t,s.transform(i),jl(this,s,a,h)?e=!0:(a.x=n,a.y=t,a.transform(i),jl(this,s,a,h)?e=!0:(s.x=n,s.y=r,s.transform(i),jl(this,s,a,h)&&(e=!0)))),pt.free(s),Ke.free(i),pt.free(a),pt.free(h),e},i.sy=function(t,e,i){function n(t,e){for(var i=t.length,n=0;n<i;n+=2)if(e.qd(t[n],t[n+1])>o)return!0;return!1}if(i&&null!==this.fill&&this.Kh(t,!0))return!0;var o=t.Ie(e),r=o;if(1.5<this.strokeWidth&&(o=this.strokeWidth/2+Math.sqrt(o),o*=o),e=this.na,null===e&&(this.measure(1/0,1/0),e=this.na,null===e))return!1;if(!i){var s=e.bounds,a=s.x,h=s.y,l=s.x+s.width;if(s=s.y+s.height,bt(t.x,t.y,a,h)<=o&&bt(t.x,t.y,l,h)<=o&&bt(t.x,t.y,a,s)<=o&&bt(t.x,t.y,l,s)<=o)return!0}if(a=e.startX,h=e.startY,l=e.endX,s=e.endY,e.type===si){if(i=(a-l)*(t.x-l)+(h-s)*(t.y-s),xt(t.x,t.y,a,h,l,s)<=(0<=(l-a)*(t.x-a)+(s-h)*(t.y-h)&&0<=i?o:r))return!0}else{if(e.type===ai)return e=!1,i&&(e=xt(t.x,t.y,a,h,a,s)<=o||xt(t.x,t.y,a,h,l,h)<=o||xt(t.x,t.y,l,h,l,s)<=o||xt(t.x,t.y,a,s,l,s)<=o),e;if(e.type===hi){e=t.x-(a+l)/2,r=t.y-(h+s)/2;var u=Math.abs(l-a)/2,c=Math.abs(s-h)/2;if(0===u||0===c)return xt(t.x,t.y,a,h,l,s)<=o;if(!i)return!(bt(e,r,-u,0)>=o||bt(e,r,0,-c)>=o||bt(e,r,0,c)>=o||bt(e,r,u,0)>=o);if(t=_e.Mz(u,c,e,r),t*t<=o)return!0}else if(e.type===li){if(l=e.bounds,r=l.x,a=l.y,h=l.x+l.width,l=l.y+l.height,t.x>h&&t.x<r&&t.y>l&&t.y<a&&xt(t.x,t.y,r,a,r,l)>o&&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;e<i.count;e++){if(r=i.j[e],s=r.startX,u=r.startY,t.qd(s,u)>o)return!1;for(a=r.segments.j,h=a.length,l=0;l<h;l++)switch(c=a[l],c.type){case gi:case yi:if(s=c.endX,u=c.endY,t.qd(s,u)>o)return!1;break;case mi:var f=j();if(_e.Fe(s,u,c.point1X,c.point1Y,c.point2X,c.point2Y,c.endX,c.endY,.8,f),s=n(f,t),O(f),s)return!1;if(s=c.endX,u=c.endY,t.qd(s,u)>o)return!1;break;case vi:if(f=j(),_e.Vq(s,u,c.point1X,c.point1Y,c.endX,c.endY,.8,f),s=n(f,t),O(f),s)return!1;if(s=c.endX,u=c.endY,t.qd(s,u)>o)return!1;break;case xi:case bi:f=c.type===xi?di(c,r):pi(c,r,s,u);var d=f.length;if(0===d){if(s=c.type===xi?c.centerX:c.endX,u=c.type===xi?c.centerY:c.endY,t.qd(s,u)>o)return!1;break}c=null;for(var p=j(),g=0;g<d;g++)if(c=f[g],p.length=0,_e.Fe(c[0],c[1],c[2],c[3],c[4],c[5],c[6],c[7],.8,p),n(p,t))return O(p),!1;O(p),null!==c&&(s=c[6],u=c[7]);break;default:w("Unknown Segment type: "+c.type)}}return!0}if(null===this.fill?ni(e,t.x,t.y,r):ei(e,t,r,!0,!1))return!0}}return!1},i.dc=function(){this.na=null},Nl.makeGeometry=function(t,e,i){if("None"!==t.toArrow)var n=Fl[t.toArrow];else"None"!==t.fromArrow?n=Fl[t.fromArrow]:(n=_e.Qe[t.figure],"string"===typeof n&&(n=_e.Qe[n]),void 0===n&&w("Unknown Shape.figure: "+t.figure),n=n(t,e,i),n.Dl=e,n.Cl=i);if(null===n){var o=_e.Qe.Rectangle;"function"===typeof o&&(n=o(t,e,i))}return n},d.Object.defineProperties(Nl.prototype,{geometry:{get:function(){return null!==this.na?this.na:this.Ed},set:function(t){var e=this.na,i=this.Ed;if(e!==t){this.Ed=this.na=null!==t?t.freeze():null;var n=this.part;null!==n&&(n.kh=NaN),this.o(),this.g("geometry",e||i,t),Na(this)&&(t=this.part,null!==t&&da(this,t,"geometryString"))}}},geometryString:{get:function(){return null===this.geometry?"":this.geometry.toString()},set:function(t){t=Ze(t);var e=t.normalize();this.geometry=t,this.position=t=pt.allocAt(-e.x,-e.y),pt.free(t)}},isGeometryPositioned:{get:function(){return this.vo},set:function(t){var e=this.vo;e!==t&&(this.vo=t,this.o(),this.g("isGeometryPositioned",e,t))}},fill:{get:function(){return this.tl},set:function(t){var e=this.tl;e!==t&&(null!==t&&dh(t,"Shape.fill"),t instanceof eh&&t.freeze(),this.tl=t,this.M(),this.g("fill",e,t))}},stroke:{get:function(){return this.Hc},set:function(t){var e=this.Hc;e!==t&&(null!==t&&dh(t,"Shape.stroke"),t instanceof eh&&t.freeze(),this.Hc=t,this.M(),this.g("stroke",e,t))}},strokeWidth:{get:function(){return this.wh},set:function(t){var e=this.wh;if(e!==t)if(0<=t){this.wh=t,this.o();var i=this.part;null!==i&&(i.kh=NaN),this.g("strokeWidth",e,t)}else M(t,"value >= 0",Nl,"strokeWidth:value")}},strokeCap:{get:function(){return this.km},set:function(t){var e=this.km;e!==t&&("string"!==typeof t||"butt"!==t&&"round"!==t&&"square"!==t?M(t,'"butt", "round", or "square"',Nl,"strokeCap"):(this.km=t,this.M(),this.g("strokeCap",e,t)))}},strokeJoin:{get:function(){return this.lm},set:function(t){var e=this.lm;e!==t&&("string"!==typeof t||"miter"!==t&&"bevel"!==t&&"round"!==t?M(t,'"miter", "bevel", or "round"',Nl,"strokeJoin"):(this.lm=t,this.M(),this.g("strokeJoin",e,t)))}},strokeMiterLimit:{get:function(){return this.gk},set:function(t){var e=this.gk;if(e!==t&&1<=t){this.gk=t,this.M();var i=this.part;null!==i&&(i.kh=NaN),this.g("strokeMiterLimit",e,t)}}},strokeDashArray:{get:function(){return this.uh},set:function(t){var e=this.uh;if(e!==t){if(null!==t){for(var i=t.length,n=0,o=0;o<i;o++){var r=t[o];0<=r&&isFinite(r)||w("strokeDashArray:value "+r+" at index "+o+" must be a positive number or zero."),n+=r}if(0===n){if(null===e)return;t=null}}this.uh=t,this.M(),this.g("strokeDashArray",e,t)}}},strokeDashOffset:{get:function(){return this.vh},set:function(t){var e=this.vh;e!==t&&0<=t&&(this.vh=t,this.M(),this.g("strokeDashOffset",e,t))}},figure:{get:function(){return this.Yn},set:function(t){var e=this.Yn;if(e!==t){var i=_e.Qe[t];"function"===typeof i?i=t:(i=_e.Qe[t.toLowerCase()])||w("Unknown Shape.figure: "+t),e!==i&&(t=this.part,null!==t&&(t.kh=NaN),this.Yn=i,this.Ed=null,this.dc(),this.o(),this.g("figure",e,i))}}},toArrow:{get:function(){return this.rm},set:function(t){var e=this.rm;if(!0===t?t="Standard":!1===t&&(t=""),e!==t){var i=Dl(t);null===i?w("Unknown Shape.toArrow: "+t):e!==i&&(this.rm=i,this.Ed=null,this.dc(),this.o(),Ol(this),this.g("toArrow",e,i))}}},fromArrow:{get:function(){return this.ul},set:function(t){var e=this.ul;if(!0===t?t="Standard":!1===t&&(t=""),e!==t){var i=Dl(t);null===i?w("Unknown Shape.fromArrow: "+t):e!==i&&(this.ul=i,this.Ed=null,this.dc(),this.o(),Ol(this),this.g("fromArrow",e,i))}}},spot1:{get:function(){return this.pf},set:function(t){var e=this.pf;e.w(t)||(this.pf=t=t.H(),this.o(),this.g("spot1",e,t))}},spot2:{get:function(){return this.qf},set:function(t){var e=this.qf;e.w(t)||(this.qf=t=t.H(),this.o(),this.g("spot2",e,t))}},parameter1:{get:function(){return this.sp},set:function(t){var e=this.sp;e!==t&&(this.sp=t,this.dc(),this.o(),this.g("parameter1",e,t))}},parameter2:{get:function(){return this.tp},set:function(t){var e=this.tp;e!==t&&(this.tp=t,this.dc(),this.o(),this.g("parameter2",e,t))}},naturalBounds:{get:function(){var t=this.desiredSize;return t.s()||null===this.na?new zt(0,0,t.width,t.height):(this.rc.assign(this.na.bounds),this.rc)}},pathPattern:{get:function(){return this.wp},set:function(t){var e=this.wp;e!==t&&(this.wp=t,this.M(),this.g("pathPattern",e,t))}},geometryStretch:{get:function(){return this.ho},set:function(t){var e=this.ho;e!==t&&(this.ho=t,this.o(),this.g("geometryStretch",e,t))}},interval:{get:function(){return this.Yd},set:function(t){var e=this.Yd;if(t=Math.round(t),e!==t&&0!==t&&isFinite(t)){this.Yd=t;var i=this.diagram;null!==i&&this.panel===i.grid&&qr(i),this.o(),i=this.panel,null!==i&&(i.eh=null),this.g("interval",e,t)}}},graduatedStart:{get:function(){return this.Wd},set:function(t){var e=this.Wd;e!==t&&(0>t?t=0:1<t&&(t=1),this.Wd=t,this.o(),this.g("graduatedStart",e,t))}},graduatedEnd:{get:function(){return this.Ud},set:function(t){var e=this.Ud;e!==t&&(0>t?t=0:1<t&&(t=1),this.Ud=t,this.o(),this.g("graduatedEnd",e,t))}},graduatedSkip:{get:function(){return this.Vd},set:function(t){var e=this.Vd;e!==t&&(this.Vd=t,this.o(),this.g("graduatedSkip",e,t))}}}),Nl.prototype.intersectsRect=Nl.prototype.Mc,Nl.prototype.containedInRect=Nl.prototype.Jh,Nl.prototype.getNearestIntersectionPoint=Nl.prototype.Nt,Nl.prototype.getDocumentBounds=Nl.prototype.mj,Nl.prototype.getDocumentPoint=Nl.prototype.da;var Fl=new _,Bl=new _;function Il(){ca.call(this),lu||(hu=ys?new Ja(null).context:null,lu=!0),this.Jx=this.Ub="",this.Hc="black",this.ne="13px sans-serif",this.Vi="start",this.Td=qs,this.aj=Le,this.Pj=!0,this.Ai=this.Bi=!1,this.mg=Jl,this.zg=Wl,this.us=this.vb=this.Zc=0,this.ev=this.fv=null,this.Vn=!1,this.ld=this.xn=this.iq=this.Wi=this.jq=null,this.nf=this.mf=0,this.ti=Ql,this.ve=1/0,this.Ei=0,this.oe=null,this.Be=0,this.me=this.lb=this.Qb=null,this.Yd=1,this.Wd=0,this.Ud=1,this.Vd=this.Lj=null}function El(t,e){t.F=6144|e.F,t.hb=e.opacity,t.mb=e.background,t.ec=e.areaBackground,t.Xc=e.desiredSize.H(),t.fg=e.minSize.H(),t.eg=e.maxSize.H(),t.cg=e.cg.copy(),t.Aa=e.scale,t.Yb=e.angle,t.De=e.stretch,t.jh=e.margin.H(),t.yb=e.alignment.H(),t.$k=e.alignmentFocus.H(),t.am=e.segmentFraction,t.bm=e.segmentOffset.H(),t.cm=e.segmentOrientation,null!==e.Za&&(t.Za=e.Za.copy()),t.em=e.shadowVisible,e instanceof Il&&(t.Ub=e.Ub,t.Hc=e.Hc,t.ne=e.ne,t.Vi=e.Vi,t.Td=e.Td,t.aj=e.aj,t.Pj=e.Pj,t.Bi=e.Bi,t.Ai=e.Ai,t.mg=e.mg,t.zg=e.zg,t.oe=null,t.mf=e.mf,t.nf=e.nf,t.ve=e.ve,t.Ei=e.Ei,t.Yd=e.Yd,t.Wd=e.Wd,t.Ud=e.Ud,t.Lj=e.Lj,t.Vd=e.Vd)}function Rl(t,e,i){null===t.me?(t.me=e,t.vb=i):(null!==t.lb&&null!==t.Qb||(t.lb=[],t.Qb=[],t.lb.push(t.me),t.Qb.push(t.vb)),t.lb.push(e),t.Qb.push(i))}function zl(t,e,i,n){var o=t.ti===Ql;o&&(e=e.trim());var r=0,s=t.ne,a=t.mf+t.nf;a=Math.max(0,Yl(t)+a);var h=t.mg===Zl?Xl(s):0;if(t.Zc>=t.ve)null!==n&&n.h(0,a);else if(s=e,t.zg===Hl){t.Be=1;var l=Gl(e);if(0===h||l<=i)t.vb=Math.max(t.vb,l),Rl(t,e,t.vb),null!==n&&n.h(l,a);else{for(r=Vl(t,s),s=s.substr(r.length),e=Vl(t,s),l=Gl(r+e);0<e.length&&l<=i;)r+=e,s=s.substr(e.length),e=Vl(t,s),l=r+e,o&&(l=l.trim()),l=Gl(l);for(o&&(e=e.trim()),r+=e,i=Math.max(1,i-h);Gl(r)>i&&1<r.length;)r=r.substr(0,r.length-1);r+=su;var u=Gl(r);t.vb=u,Rl(t,r,u),null!==n&&n.h(u,a)}}else{for(h=0,0===s.length&&(h=1,Rl(t,s,0));0<s.length;){for(e=Vl(t,s),s=s.substr(e.length);Gl(e)>i;){var c=1;for(l=Gl(e.substr(0,c)),u=0;l<=i;)c++,u=l,l=Gl(e.substr(0,c));if(1===c){var f=l;r=Math.max(r,l)}else f=u,r=Math.max(r,u);if(c--,1>c&&(c=1),Rl(t,e.substr(0,c),f),h++,e=e.substr(c),t.Zc+h>t.ve)break}for(u=Vl(t,s),l=Gl(e+u);0<u.length&&l<=i;)e+=u,s=s.substr(u.length),u=Vl(t,s),l=e+u,o&&(l=l.trim()),l=Gl(l);if(o&&(e=e.trim()),""!==e&&("­"===e[e.length-1]&&(e=e.substring(0,e.length-1)+"‐"),0===u.length?(c=l,r=Math.max(r,l)):(c=u=Gl(e),r=Math.max(r,u)),Rl(t,e,c),h++,t.Zc+h>t.ve))break}t.Be=Math.min(t.ve,h),t.vb=Math.max(t.vb,r),null!==n&&n.h(t.vb,a*t.Be)}}function Vl(t,e){if(t.zg===$l)return e.substr(0,1);for(var i=e.length,n=0,o=eu;n<i&&!o.test(e.charAt(n));)n++;for(t.ti===tu&&(i=Math.min(i,n+1));n<i&&o.test(e.charAt(n));)n++;return n>=e.length?e:e.substr(0,n)}function Gl(t){return null===hu?8*t.length:hu.measureText(t).width}function Yl(t){if(null!==t.oe)return t.oe;var e=t.ne;if(null===hu){var i=16;return t.oe=i}return void 0!==iu[e]&&5e3>nu?i=iu[e]:(i=1.3*hu.measureText("M").width,iu[e]=i,nu++),t.oe=i}function Xl(t){if(null===hu)return 6;if(void 0!==ou[t]&&5e3>ru)var e=ou[t];else e=hu.measureText(su).width,ou[t]=e,ru++;return e}function ql(t,e){var i=t.Ub.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),n=t.mf+t.nf;if(n=Math.max(0,Yl(t)+n),0===i.length)return t.vb=0,t.Zc=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.Zc=0,a=!1;!a;){if(r=i.indexOf("\n",s),-1===r&&(r=i.length,a=!0),s<=r){if(s=i.substr(s,r-s),t.zg!==Hl){t.Be=0;var h=Bt.alloc();zl(t,s,e,h),o+=h.height,Bt.free(h),t.Zc+=t.Be}else zl(t,s,e,null),o+=n,t.Zc++;t.Zc===t.ve&&(a=!0)}s=r+1}return t.us=o}Nl.className="Shape",Nl.getFigureGenerators=function(){var t,e=new dt;for(t in _e.Qe)t!==t.toLowerCase()&&e.add(t,_e.Qe[t]);return e.freeze(),e},Nl.defineFigureGenerator=function(t,e){var i=t.toLowerCase(),n=_e.Qe;n[t]=e,n[i]=t},Nl.getArrowheadGeometries=function(){var t=new dt;for(n in _e.dn)if(void 0===Fl[n]){var e=Ze(_e.dn[n],!1);Fl[n]=e,e=n.toLowerCase(),e!==n&&(Fl[e]=n)}for(var i in Fl)if(i!==i.toLowerCase()){var n=Fl[i];n instanceof We&&t.add(i,n)}return t.freeze(),t},Nl.defineArrowheadGeometry=function(t,e){var i=null;i="string"===typeof e?Ze(e,!1):e,e=t.toLowerCase(),"none"!==e&&t!==e||w("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t);var n=Fl;n[t]=i,n[e]=t},f(Il,ca),Il.prototype.cloneProtected=function(t){ca.prototype.cloneProtected.call(this,t),t.Ub=this.Ub,t.Jx=this.Jx,t.Hc=this.Hc,t.ne=this.ne,t.Vi=this.Vi,t.Td=this.Td,t.aj=this.aj,t.Pj=this.Pj,t.Bi=this.Bi,t.Ai=this.Ai,t.mg=this.mg,t.zg=this.zg,t.Zc=this.Zc,t.us=this.us,t.vb=this.vb,t.fv=this.fv,t.ev=this.ev,t.Vn=this.Vn,t.jq=this.jq,t.Wi=this.Wi,t.iq=this.iq,t.xn=this.xn,t.ld=this.ld,t.mf=this.mf,t.nf=this.nf,t.ti=this.ti,t.ve=this.ve,t.oe=this.oe,t.Be=this.Be,t.Qb=this.Qb,t.lb=this.lb,t.me=this.me,t.Ei=this.Ei,t.Yd=this.Yd,t.Wd=this.Wd,t.Ud=this.Ud,t.Lj=this.Lj,t.Vd=this.Vd},i=Il.prototype,i.jb=function(t){t.classType===Il?this.wrap=t:ca.prototype.jb.call(this,t)},i.toString=function(){return 22<this.Ub.length?'TextBlock("'+this.Ub.substring(0,20)+'"...)':'TextBlock("'+this.Ub+'")'},i.o=function(){ca.prototype.o.call(this),this.ev=this.fv=null},i.ej=function(t,e){if(null!==this.Hc&&0!==this.Ub.length&&null!==this.ne){var i=this.naturalBounds,n=this.actualBounds,o=i.width,r=i.height,s=Yl(this),a=t.textAlign=this.Vi,h=e.Gl;"start"===a?a=h?"right":"left":"end"===a&&(a=h?"left":"right"),h=this.Bi;var l=this.Ai;va(this,t,this.Hc,!0,!1,i,n),(h||l)&&va(this,t,this.Hc,!1,!1,i,n),n=0,i=!1;var u=pt.allocAt(0,0);this.Fd.ta(u);var c=pt.allocAt(0,s);this.Fd.ta(c);var f=u.Ie(c);switch(pt.free(u),pt.free(c),u=e.scale,8>f*u*u&&(i=!0),e.Gb!==t&&(i=!1),!1===e.Ke("textGreeking")&&(i=!1),e=this.mf,f=this.nf,this.flip){case Js:t.translate(o,0),t.scale(-1,1);break;case $s:t.translate(0,r),t.scale(1,-1);break;case Zs:t.translate(o,r),t.scale(-1,-1)}if(u=this.Zc,c=(e+s+f)*u,r>c&&(n=this.aj,n=n.y*r-n.y*c+n.offsetY),1===u&&null!==this.me)f=this.vb,f>o&&(f=o),this.dj(this.me,t,0,n+e,o,s,f,i,a,h,l);else if(null!==this.Qb&&null!==this.lb)for(c=0;c<u;c++){var d=this.Qb[c];d>o&&(d=o),n+=e,this.dj(this.lb[c],t,0,n,o,s,d,i,a,h,l),n+=s+f}switch(this.flip){case Js:t.scale(-1,1),t.translate(-o,0);break;case $s:t.scale(1,-1),t.translate(0,-r);break;case Zs:t.scale(-1,-1),t.translate(-o,-r)}}},i.dj=function(t,e,i,n,o,r,s,a,h,l,u){var c=0;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)):("left"===h?c=0:"right"===h?c=o:"center"===h&&(c=o/2),o=null!==Ul?Ul(this,r):.75*r,e.fillText(t,i+c,n+o),t=r/20|0,0===t&&(t=1),"right"===h?c-=s:"center"===h&&(c-=s/2),l&&(h=null!==Kl?Kl(this,r):.8*r,e.beginPath(),e.lineWidth=t,e.moveTo(i+c,n+h),e.lineTo(i+c+s,n+h),e.stroke()),u&&(e.beginPath(),e.lineWidth=t,n=n+r-r/2.2|0,0!==t%2&&(n+=.5),e.moveTo(i+c,n),e.lineTo(i+c+s,n),e.stroke()))},i.Hm=function(t,e,i,n){this.Ei=t;var o,r=this.ne;if(null!==hu&&au!==r&&(au=hu.font=r),this.vb=this.Be=0,this.me=this.lb=this.Qb=this.oe=null,isNaN(this.desiredSize.width)){if(r=this.Ub.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),0===r.length)r=0;else if(this.isMultiline){for(var s=o=0,a=!1;!a;){var h=r.indexOf("\n",s);-1===h&&(h=r.length,a=!0),s=r.substr(s,h-s),this.ti===Ql&&(s=s.trim()),o=Math.max(o,Gl(s)),s=h+1}r=o}else o=r.indexOf("\n",0),0<=o&&(r=r.substr(0,o)),r=Gl(r);r=Math.min(r,t/this.scale),r=Math.max(8,r)}else r=this.desiredSize.width;if(null!==this.panel&&(r=Math.min(r,this.panel.maxSize.width)),o=ql(this,r),o=isNaN(this.desiredSize.height)?Math.min(o,e/this.scale):this.desiredSize.height,a=o,0!==this.vb&&null!==this.Qb&&null!==this.lb&&this.mg===Zl&&(e=this.ne,e=this.mg===Zl?Xl(e):0,h=this.mf+this.nf,h=Math.max(0,Yl(this)+h),a=Math.min(this.maxLines-1,Math.max(Math.floor(a/h+.01)-1,0)),!(a+1>=this.lb.length))){for(h=this.lb[a],e=Math.max(1,t-e);Gl(h)>e&&1<h.length;)h=h.substr(0,h.length-1);h+=su,e=Gl(h),this.lb[a]=h,this.lb=this.lb.slice(0,a+1),this.Qb[a]=e,this.Qb=this.Qb.slice(0,a+1),this.Be=this.lb.length,this.vb=Math.max(this.vb,e),this.Zc=this.Be,1===this.Zc&&(this.me=this.lb[0])}(this.wrap===_l||isNaN(this.desiredSize.width))&&(r=isNaN(t)?this.vb:Math.min(t,this.vb),isNaN(this.desiredSize.width)&&(r=Math.max(8,r))),r=Math.max(i,r),o=Math.max(n,o),Vt(this.rc,r,o),pa(this,0,0,r,o)},i.Ih=function(t,e,i,n){ya(this,t,e,i,n)},d.Object.defineProperties(Il.prototype,{font:{get:function(){return this.ne},set:function(t){var e=this.ne;e!==t&&(this.ne=t,this.oe=null,this.o(),this.g("font",e,t))}},text:{get:function(){return this.Ub},set:function(t){var e=this.Ub;t=null!==t&&void 0!==t?t.toString():"",e!==t&&(this.Ub=t,this.o(),this.g("text",e,t))}},textAlign:{get:function(){return this.Vi},set:function(t){var e=this.Vi;e===t||"start"!==t&&"end"!==t&&"left"!==t&&"right"!==t&&"center"!==t||(this.Vi=t,this.M(),this.g("textAlign",e,t))}},flip:{get:function(){return this.Td},set:function(t){var e=this.Td;e!==t&&(this.Td=t,this.M(),this.g("flip",e,t))}},verticalAlignment:{get:function(){return this.aj},set:function(t){var e=this.aj;e.w(t)||(this.aj=t=t.H(),wa(this),this.g("verticalAlignment",e,t))}},naturalBounds:{get:function(){if(!this.rc.s()){var t=Bt.alloc();zl(this,this.Ub,999999,t);var e=t.width;Bt.free(t),t=ql(this,e);var i=this.desiredSize;isNaN(i.width)||(e=i.width),isNaN(i.height)||(t=i.height),Vt(this.rc,e,t)}return this.rc}},isMultiline:{get:function(){return this.Pj},set:function(t){var e=this.Pj;e!==t&&(this.Pj=t,this.o(),this.g("isMultiline",e,t))}},isUnderline:{get:function(){return this.Bi},set:function(t){var e=this.Bi;e!==t&&(this.Bi=t,this.M(),this.g("isUnderline",e,t))}},isStrikethrough:{get:function(){return this.Ai},set:function(t){var e=this.Ai;e!==t&&(this.Ai=t,this.M(),this.g("isStrikethrough",e,t))}},wrap:{get:function(){return this.zg},set:function(t){var e=this.zg;e!==t&&(this.zg=t,this.o(),this.g("wrap",e,t))}},overflow:{get:function(){return this.mg},set:function(t){var e=this.mg;e!==t&&(this.mg=t,this.o(),this.g("overflow",e,t))}},stroke:{get:function(){return this.Hc},set:function(t){var e=this.Hc;e!==t&&(null!==t&&dh(t,"TextBlock.stroke"),t instanceof eh&&t.freeze(),this.Hc=t,this.M(),this.g("stroke",e,t))}},lineCount:{get:function(){return this.Zc}},editable:{get:function(){return this.Vn},set:function(t){var e=this.Vn;e!==t&&(this.Vn=t,this.g("editable",e,t))}},textEditor:{get:function(){return this.jq},set:function(t){var e=this.jq;e!==t&&(this.jq=t,this.g("textEditor",e,t))}},errorFunction:{get:function(){return this.ld},set:function(t){var e=this.ld;e!==t&&(this.ld=t,this.g("errorFunction",e,t))}},interval:{get:function(){return this.Yd},set:function(t){var e=this.Yd;if(t=Math.round(t),e!==t&&0!==t&&isFinite(t)){this.Yd=t,this.o();var i=this.panel;null!==i&&(i.eh=null),this.g("interval",e,t)}}},graduatedStart:{get:function(){return this.Wd},set:function(t){var e=this.Wd;e!==t&&(0>t?t=0:1<t&&(t=1),this.Wd=t,this.o(),this.g("graduatedStart",e,t))}},graduatedEnd:{get:function(){return this.Ud},set:function(t){var e=this.Ud;e!==t&&(0>t?t=0:1<t&&(t=1),this.Ud=t,this.o(),this.g("graduatedEnd",e,t))}},graduatedFunction:{get:function(){return this.Lj},set:function(t){var e=this.Lj;e!==t&&(this.Lj=t,this.o(),this.g("graduatedFunction",e,t))}},graduatedSkip:{get:function(){return this.Vd},set:function(t){var e=this.Vd;e!==t&&(this.Vd=t,this.o(),this.g("graduatedSkip",e,t))}},textValidation:{get:function(){return this.Wi},set:function(t){var e=this.Wi;e!==t&&(this.Wi=t,this.g("textValidation",e,t))}},textEdited:{get:function(){return this.iq},set:function(t){var e=this.iq;e!==t&&(this.iq=t,this.g("textEdited",e,t))}},spacingAbove:{get:function(){return this.mf},set:function(t){var e=this.mf;e!==t&&(this.mf=t,this.o(),this.g("spacingAbove",e,t))}},spacingBelow:{get:function(){return this.nf},set:function(t){var e=this.nf;e!==t&&(this.nf=t,this.o(),this.g("spacingBelow",e,t))}},formatting:{get:function(){return this.ti},set:function(t){var e=this.ti;e!==t&&(this.ti=t,this.o(),this.g("formatting",e,t))}},maxLines:{get:function(){return this.ve},set:function(t){var e=this.ve;e!==t&&(t=Math.floor(t),0>=t&&M(t,"> 0",Il,"maxLines"),this.ve=t,this.o(),this.g("maxLines",e,t))}},metrics:{get:function(){return{arrSize:null!==this.Qb?this.Qb:[this.vb],arrText:null!==this.lb?this.lb:[this.me],maxLineWidth:this.vb,fontHeight:this.oe}}},choices:{get:function(){return this.xn},set:function(t){var e=this.xn;e!==t&&(this.xn=t,this.g("choices",e,t))}}});var Ul=null,Kl=null,Hl=new U(Il,"None",0),_l=new U(Il,"WrapFit",1),Wl=new U(Il,"WrapDesiredSize",2),$l=new U(Il,"WrapBreakAll",3),Jl=new U(Il,"OverflowClip",0),Zl=new U(Il,"OverflowEllipsis",1),Ql=new U(Il,"FormatTrim",0),tu=new U(Il,"FormatNone",0),eu=/[ \u200b\u00ad]/,iu=new _,nu=0,ou=new _,ru=0,su="...",au="",hu=null,lu=!1;function uu(){this.Qb=[],this.lb=[]}function cu(){ca.call(this),this.Zg=null,this.$p="",this.th=Jt,this.yl=Xs,this.xh=this.ld=null,this.xl=ae,this.Td=qs,this.nm=null,this.uo=!1,this.Yr=!0,this.Ol=!1,this.gm=null}function fu(t){void 0===t&&(t=""),""!==t?gu[t]&&(delete gu[t],yu--):(gu=new _,yu=0)}function du(t,e){e.fz||(e.dv=function(i){e.ls=!0,e.ro=!1;var n=e.Wg.copy();if(null!==n&&void 0!==n){for(n=n.iterator;n.next();){var o=n.value,r=e.getAttribute("src"),s=o.pg.G(r);if(null!==s)for(var a=s.length,h=0;h<a;h++)r=s[h],o.Wl.add(r),o.Db(),e.io&&(void 0===e.ov&&(e.ov=i),null!==r.xh&&r.xh(r,i))}e.Wg=null}t.desiredSize.s()||(ja(t,!1),t.o())},e.Pu=function(t){e.ro=t;var i=e.Wg.copy();if(null!==i&&void 0!==i){for(i=i.iterator;i.next();){var n=i.value,o=e.getAttribute("src"),r=n.pg.G(o);if(null!==r){n=r.length,o=j();for(var s=0;s<n;s++)o.push(r[s]);if(e.io)for(s=0;s<n;s++)r=o[s],null!==r.ld&&r.ld(r,t);O(o)}}e.Wg=null}},e.addEventListener("load",e.dv),e.addEventListener("error",e.Pu),e.fz=!0)}function pu(t){t.removeEventListener("load",t.dv),t.removeEventListener("error",t.Pu),delete t.dv,delete t.Pu}Il.className="TextBlock",Il.getEllipsis=function(){return su},Il.setEllipsis=function(t){su=t,ou=new _,ru=0},Il.getBaseline=function(){return Ul},Il.setBaseline=function(t){Ul=t},Il.getUnderline=function(){return Kl},Il.setUnderline=function(t){Kl=t},Il.isValidFont=function(t){if(lu||(hu=ys?new Ja(null).context:null,lu=!0),null===hu)return!0;var e=hu.font;if(t===e||"10px sans-serif"===t)return!0;hu.font="10px sans-serif",hu.font=t;var i=hu.font;if("10px sans-serif"!==i)return hu.font=e,!0;hu.font="19px serif";var n=hu.font;return hu.font=t,i=hu.font,hu.font=e,i!==n},Il.None=Hl,Il.WrapFit=_l,Il.WrapDesiredSize=Wl,Il.WrapBreakAll=$l,Il.OverflowClip=Jl,Il.OverflowEllipsis=Zl,uu.prototype.reset=function(){this.Qb=[],this.lb=[]},uu.prototype.gy=function(t){this.Qb=T(t.Qb),this.lb=T(t.lb)},uu.className="TextBlockMetrics",f(cu,ca),cu.prototype.cloneProtected=function(t){ca.prototype.cloneProtected.call(this,t),t.element=this.Zg,t.$p=this.$p,t.th=this.th.H(),t.yl=this.yl,t.Td=this.Td,t.ld=this.ld,t.xh=this.xh,t.xl=this.xl.H(),t.Yr=this.Yr,t.gm=this.gm},cu.prototype.jb=function(t){t===qs||t===Us||t===Ws?this.imageStretch=t:ca.prototype.jb.call(this,t)},cu.prototype.toString=function(){return"Picture("+this.source+")#"+st(this)},cu.prototype.QA=function(){if(""!==this.source){fu(this.source);var t=this.source;this.source="",this.source=t}},cu.prototype.redraw=function(){this.M()},cu.prototype.ej=function(t,e){var i=this.Zg;if(null!==i){var n=i.getAttribute("src");if(!(i instanceof HTMLImageElement&&(null===n||""===n)||i.ro instanceof Event&&t instanceof Za)){n=this.naturalBounds;var o=0,r=0,s=this.uo,a=s?+i.width:i.naturalWidth;if(s=s?+i.height:i.naturalHeight,void 0===a&&i.videoWidth&&(a=i.videoWidth),void 0===s&&i.videoHeight&&(s=i.videoHeight),a=a||n.width,s=s||n.height,0!==a&&0!==s){var h=a,l=s;this.sourceRect.s()&&(o=this.th.x,r=this.th.y,a=this.th.width,s=this.th.height);var u=a,c=s,f=this.yl,d=this.xl;switch(f){case qs:if(this.sourceRect.s())break;u>=n.width&&(o=o+d.offsetX+(u*d.x-n.width*d.x)),c>=n.height&&(r=r+d.offsetY+(c*d.y-n.height*d.y)),a=Math.min(n.width,u),s=Math.min(n.height,c);break;case Xs:u=n.width,c=n.height;break;case Us:case Ws:f===Us?(f=Math.min(n.height/c,n.width/u),u*=f,c*=f):f===Ws&&(f=Math.max(n.height/c,n.width/u),u*=f,c*=f,u>=n.width&&(o=(o+d.offsetX+(u*d.x-n.width*d.x)/u)*a),c>=n.height&&(r=(r+d.offsetY+(c*d.y-n.height*d.y)/c)*s),a*=1/(u/n.width),s*=1/(c/n.height),u=n.width,c=n.height)}f=this.Af()*e.scale;var p=u*f*c*f,g=a*s/p,y=i.__goCache;f=null;var m=mu;if(i.ls&&void 0!==y&&4<p&&g>m*m)for(null===y.cj&&(xu(y,4,h,l,i),xu(y,16,h,l,i)),h=y.cj,l=h.length,p=0;p<l;p++){if(!(h[p].ratio*h[p].ratio<g))break;f=h[p]}if(!e.rl){if(null===this.nm)if(null===this.Zg)this.nm=!1;else{h=new Ja(null).context,h.drawImage(this.Zg,0,0);try{h.getImageData(0,0,1,1).data[3]&&(this.nm=!1),this.nm=!1}catch(v){this.nm=!0}}if(this.nm)return}switch(h=0,u<n.width&&(h=d.offsetX+(n.width*d.x-u*d.x)),l=0,c<n.height&&(l=d.offsetY+(n.height*d.y-c*d.y)),this.flip){case Js:t.translate(Math.min(n.width,u),0),t.scale(-1,1);break;case $s:t.translate(0,Math.min(n.height,c)),t.scale(1,-1);break;case Zs:t.translate(Math.min(n.width,u),Math.min(n.height,c)),t.scale(-1,-1)}if(e.Ke("pictureRatioOptimization")&&!e.yi&&void 0!==y&&null!==f&&1!==f.ratio){t.save(),e=f.ratio;try{t.drawImage(f.source,o/e,r/e,Math.min(f.source.width,a/e),Math.min(f.source.height,s/e),h,l,Math.min(n.width,u),Math.min(n.height,c))}catch(v){this.Yr=!1}t.restore()}else try{t.drawImage(i,o,r,a,s,h,l,Math.min(n.width,u),Math.min(n.height,c))}catch(v){this.Yr=!1}switch(this.flip){case Js:t.scale(-1,1),t.translate(-Math.min(n.width,u),0);break;case $s:t.scale(1,-1),t.translate(0,-Math.min(n.height,c));break;case Zs:t.scale(-1,-1),t.translate(-Math.min(n.width,u),-Math.min(n.height,c))}}}}},cu.prototype.Hm=function(t,e,i,n){var o=this.desiredSize,r=ka(this,!0),s=this.Zg,a=this.uo;(a||!this.Ol&&s&&s.complete)&&(this.Ol=!0),null===s&&(isFinite(o.width)||(t=0),isFinite(o.height)||(e=0)),isFinite(o.width)||r===Xs||r===Hs?(isFinite(t)||(t=this.sourceRect.s()?this.sourceRect.width:a?+s.width:s.naturalWidth),i=0):null!==s&&!1!==this.Ol&&(t=this.sourceRect.s()?this.sourceRect.width:a?+s.width:s.naturalWidth),isFinite(o.height)||r===Xs||r===_s?(isFinite(e)||(e=this.sourceRect.s()?this.sourceRect.height:a?+s.height:s.naturalHeight),n=0):null!==s&&!1!==this.Ol&&(e=this.sourceRect.s()?this.sourceRect.height:a?+s.height:s.naturalHeight),isFinite(o.width)&&(t=o.width),isFinite(o.height)&&(e=o.height),o=this.maxSize,r=this.minSize,i=Math.max(i,r.width),n=Math.max(n,r.height),t=Math.min(o.width,t),e=Math.min(o.height,e),t=Math.max(i,t),e=Math.max(n,e),null===s||s.complete||(isFinite(t)||(t=0),isFinite(e)||(e=0)),Vt(this.rc,t,e),pa(this,0,0,t,e)},cu.prototype.Ih=function(t,e,i,n){ya(this,t,e,i,n)},d.Object.defineProperties(cu.prototype,{element:{get:function(){return this.Zg},set:function(t){var e=this.Zg;if(e!==t){this.uo=t instanceof HTMLCanvasElement;var i=t instanceof HTMLImageElement;e instanceof HTMLImageElement&&pu(e),null===t||i||t instanceof HTMLVideoElement||this.uo||w("Picture.element must be an instance of Image, Canvas, or Video, not: "+t);var n=this.diagram;null!==n&&Wr(n,this),this.Zg=t,null!==t&&i&&void 0===t.Wg&&(t.Wg=new nt),null!==n&&i&&_r(n,this),null!==t&&(this.uo||!0===t.complete?(t.io&&(t.ro instanceof Event&&null!==this.ld?this.ld(this,t.ro):!0===t.ls&&!t.ro&&null!==this.xh&&t.ov&&this.xh(this,t.ov)),t.ls=!0,this.desiredSize.s()||(ja(this,!1),this.o())):i&&du(this,t)),this.g("element",e,t),this.M()}}},source:{get:function(){return this.$p},set:function(t){var e=this.$p;if(e!==t){this.$p=t;var i=gu;if(ys){var n=null;if(void 0!==i[t])n=i[t];else if(""!==t){30<yu&&(fu(),i=gu),n=b("img"),n.io=!0,du(this,n);var o=this.gm;null!==o&&(n.crossOrigin=o(this)),n.src=t,i[t]=n,yu++}this.element=n,null!==n&&void 0===n.__goCache&&(n.__goCache=new vu),this.o(),this.M()}this.g("source",e,t)}}},sourceCrossOrigin:{get:function(){return this.gm},set:function(t){if(this.gm!==t&&(this.gm=t,null!==this.element)){var e=this.element.getAttribute("src");null===t&&"string"===typeof e?this.element.crossOrigin=null:null!==t&&(this.element.crossOrigin=t(this)),this.element.src=e}}},sourceRect:{get:function(){return this.th},set:function(t){var e=this.th;e.w(t)||(this.th=t=t.H(),this.M(),this.g("sourceRect",e,t))}},imageStretch:{get:function(){return this.yl},set:function(t){var e=this.yl;e!==t&&(this.yl=t,this.M(),this.g("imageStretch",e,t))}},flip:{get:function(){return this.Td},set:function(t){var e=this.Td;e!==t&&(this.Td=t,this.M(),this.g("flip",e,t))}},imageAlignment:{get:function(){return this.xl},set:function(t){var e=this.xl;e.w(t)||(this.xl=t=t.H(),this.M(),this.g("imageAlignment",e,t))}},errorFunction:{get:function(){return this.ld},set:function(t){var e=this.ld;e!==t&&(this.ld=t,this.g("errorFunction",e,t))}},successFunction:{get:function(){return this.xh},set:function(t){var e=this.xh;e!==t&&(this.xh=t,this.g("successFunction",e,t))}},naturalBounds:{get:function(){return this.rc}}}),cu.prototype.redraw=cu.prototype.redraw,cu.prototype.reloadSource=cu.prototype.QA;var gu=null,yu=0,mu=4;function vu(){this.cj=null}function xu(t,e,i,n,o){null===t.cj&&(t.cj=[]);var r=new Ja(null),s=r.context,a=1/e;r.width=i/e,r.height=n/e,0!==r.width&&0!==r.height&&(e=new bu(r.Ja,e),i=1,0<t.cj.length&&(i=t.cj[t.cj.length-1],o=i.source,i=i.ratio),s.setTransform(a*i,0,0,a*i,0,0),s.drawImage(o,0,0),t.cj.push(e))}function bu(t,e){this.source=t,this.ratio=e}function wu(){this.Kt=new We,this.ic=null}function ku(t,e,i,n,o){t.ic=new ci,t.ic.startX=e,t.ic.startY=i,t.ic.isFilled=n,t.Kt.figures.add(t.ic),void 0!==o&&(t.ic.isShadowed=o)}function Mu(t){var e=t.ic.segments.length;0<e&&t.ic.segments.J(e-1).close()}function Su(t,e,i,n,o,r,s){var a;void 0===a&&(a=!1);var h=new fi(mi);h.point1X=e,h.point1Y=i,h.point2X=n,h.point2Y=o,h.endX=r,h.endY=s,a&&h.close(),t.ic.segments.add(h)}function Pu(t,e,i,n,o){var r;void 0===r&&(r=!1);var s=new fi(vi);s.point1X=e,s.point1Y=i,s.endX=n,s.endY=o,r&&s.close(),t.ic.segments.add(s)}function Nu(t,e,i,n,o,r,s,a){var h;void 0===h&&(h=!1),e=new fi(bi,s,a,e,i,n,o,r),h&&e.close(),t.ic.segments.add(e)}function Cu(t){var e=Tu;return null!==e?(Tu=null,e.reset(t),e):(e=new wu,e.reset(t),e)}cu.className="Picture",gu=new _,cu.clearCache=fu,vu.className="PictureCacheArray",bu.className="PictureCacheInstance",wu.prototype.reset=function(t){null!==t?(t.ea(),this.Kt=t,t.figures.clear()):this.Kt=new We,this.ic=null},wu.prototype.Ym=function(t){this.ic.isShadowed=t},wu.prototype.moveTo=function(t,e,i){void 0===i&&(i=!1);var n=new fi(gi);n.endX=t,n.endY=e,i&&n.close(),this.ic.segments.add(n)},wu.prototype.lineTo=function(t,e,i){void 0===i&&(i=!1);var n=new fi(yi);n.endX=t,n.endY=e,i&&n.close(),this.ic.segments.add(n)},wu.prototype.arcTo=function(t,e,i,n,o,r,s){void 0===r&&(r=0),void 0===s&&(s=!1);var a=new fi(xi);a.startAngle=t,a.sweepAngle=e,a.centerX=i,a.centerY=n,a.radiusX=o,a.radiusY=0!==r?r:o,s&&a.close(),this.ic.segments.add(a)};var Tu=null;function Au(t,e){var i=t.toLowerCase(),n=_e.Qe;n[t]=e,n[i]=t}function Lu(t){Uh.call(this,t),this.D=2408959,this.ih=this.Nf="",this.Gp=this.Cp=this.Rp=this.Ho=null,this.Tp="",this.Lf=this.so=this.Sp=this.sh=null,this.Ep="",this.Dp=Tt,this.Ub=this.Hp="",this.Fi=this.An=this.mi=null,this.dg=new pt(NaN,NaN).freeze(),this.Oo="",this.cf=null,this.Po=ne,this.Ip=Ce,this.Yo=Lt,this.Qo=jt,this.Sn=null,this.Io=127,this.Xp=Ot,this.Wp="gray",this.ug=4,this.zx=-1,this.tq=NaN,this.ez=new zt,this.Xj=null,this.kh=NaN}function ju(t){0!==(16384&t.D)!==!1&&(t.updateAdornments(),t.D&=-16385)}function Ou(t,e){e.toolManager.mouseDownTools.each((function(e){e.isEnabled&&e.updateAdornments(t)})),e.toolManager.updateAdornments(t)}function Du(t){if(!1===Yu(t)){Xu(t,!0),t.Fl();var e=t.diagram;null!==e&&(e.wd.add(t),e.Db())}}function Fu(t){if(t.D|=2097152,!1!==Yu(t)){var e=t.position,i=t.location;i.s()&&e.s()||Eu(t,e,i),i=t.xb;var n=zt.alloc().assign(i);i.ea(),i.x=e.x,i.y=e.y,i.freeze(),t.Im(n,i),zt.free(n),Xu(t,!1)}}function Bu(t,e){var i=t.ez;isNaN(t.kh)&&(t.kh=il(t));var n=t.kh,o=2*n;if(!t.isShadowed)return i.h(e.x-1-n,e.y-1-n,e.width+2+o,e.height+2+o),i;n=e.x,o=e.y;var r=e.width;e=e.height;var s=t.shadowBlur;return t=t.shadowOffset,r+=s,e+=s,n-=s/2,o-=s/2,0<t.x?r+=t.x:(n+=t.x,r-=t.x),0<t.y?e+=t.y:(o+=t.y,e-=t.y),i.h(n-1,o-1,r+2,e+2),i}function Iu(t,e,i,n){null===e||t instanceof Qu||(e=e.animationManager,e.ef&&po(e,t,n.copy(),i.copy()))}function Eu(t,e,i){var n=pt.alloc(),o=t.locationSpot,r=t.locationObject;o.nc()&&w("determineOffset: Part's locationSpot must be real: "+o.toString());var s=r.naturalBounds,a=r instanceof Nl?r.strokeWidth:0;if(n.Uk(0,0,s.width+a,s.height+a,o),r!==t)for(n.offset(-a/2,-a/2),r.transform.ta(n),o=r.panel;null!==o&&o!==t;)o.transform.ta(n),o=o.panel;t.cg.ta(n),n.offset(-t.qc.x,-t.qc.y),o=t.diagram,r=i.s(),s=e.s(),r&&s?0!==(2097152&t.D)?Ru(t,e,i,o,n):zu(t,e,i,o,n):r?Ru(t,e,i,o,n):s&&zu(t,e,i,o,n),t.D|=2097152,pt.free(n),t.Fl()}function Ru(t,e,i,n,o){var r=e.x,s=e.y;e.h(i.x-o.x,i.y-o.y),null!==n&&(i=n.animationManager,(n=i.defaultAnimation.isAnimating)||!i.ef||t instanceof Qu||po(i,t,new pt(r,s),e),n||e.x===r&&e.y===s||t.g("position",new pt(r,s),e.copy()))}function zu(t,e,i,n,o){var r=i.copy();i.h(e.x+o.x,e.y+o.y),i.w(r)||null===n||t.g("location",r,i.copy())}function Vu(t,e,i){qu(t,!1),t instanceof ec&&hs(i,t),t.layer.isTemporary||e||i.Na(),e=t.xb;var n=i.viewportBounds;n.s()?Uu(t)?(Kt(e,n)||t.Nd(!1),t.updateAdornments()):e.Mc(n)?(t.Nd(!0),t.updateAdornments()):t.Lb():i.xi=!0}function Gu(t,e,i,n){e.constructor===t.constructor||Zu||(Zu=!0,S('Should not change the class of the Part when changing category from "'+i+'" to "'+n+'"'),S("  Old class: "+D(t.constructor)+", new class: "+D(e.constructor)+", part: "+t.toString())),t.nk();var o=t.data;i=t.layerName;var r=t.isSelected,s=t.isHighlighted,a=!0,h=!0,l=!1;t instanceof ec&&(a=t.isTreeLeaf,h=t.isTreeExpanded,l=t.wasTreeExpanded),e.yf(t),e.cloneProtected(t),t.Nf=n,t.o(),t.M(),e=t.diagram,n=!0,null!==e&&(n=e.skipsUndoManager,e.skipsUndoManager=!0),t.ob=o,t.D=r?4096|t.D:-4097&t.D,t.D=s?524288|t.D:-524289&t.D,t instanceof ec&&(t.P=a?4|t.P:-5&t.P,t.P=h?1|t.P:-2&t.P,t.P=l?2|t.P:-3&t.P),null!==o&&t.Da(),o=t.layerName,o!==i&&(t.ih=i,t.layerName=o),null!==e&&(e.skipsUndoManager=n),t.Nc()&&t.B(64)}function Yu(t){return 0!==(32768&t.D)}function Xu(t,e){t.D=e?32768|t.D:-32769&t.D}function qu(t,e){t.D=e?65536|t.D:-65537&t.D}function Uu(t){return 0!==(131072&t.D)}function Ku(t,e){t.D=e?1048576|t.D:-1048577&t.D}function Hu(t,e){var i=e.containingGroup;return null!==i?1+Hu(t,i):e instanceof ec&&(e=e.labeledLink,null!==e)?Hu(t,e):0}function _u(t,e){var i=e.containingGroup;return null!==i||e instanceof ec&&(i=e.labeledLink,null!==i)?_u(t,i):e}function Wu(t,e,i){if(e===i||null===i)return!1;var n=e.containingGroup;return!(null===n||n!==i&&!Wu(t,n,i))||e instanceof ec&&(e=e.labeledLink,null!==e)&&Wu(t,e,i)}function $u(t){return!!t.isVisible()&&(t=t.layer,null===t||!t.isTemporary)}function Ju(t,e,i,n,o,r){if(void 0===r&&(r=null),!(t.contains(e)||null!==r&&!r(e)||e instanceof Qu))if(t.add(e),e instanceof ec){if(i&&e instanceof bc)for(var s=e.memberParts;s.next();)Ju(t,s.value,i,n,o,r);if(!1!==o)for(s=e.linksConnected;s.next();){var a=s.value;if(!t.contains(a)){var h=a.fromNode,l=a.toNode;h=null===h||t.contains(h),l=null===l||t.contains(l),(o?h&&l:h||l)&&Ju(t,a,i,n,o,r)}}if(1<n)for(e=e.Wv();e.next();)Ju(t,e.value,i,n-1,o,r)}else if(e instanceof Nc)for(e=e.labelNodes;e.next();)Ju(t,e.value,i,n,o,r)}wu.className="StreamGeometryContext",Au("Rectangle",(function(t,e,i){t="r"+e+","+i;var n=_e.Uh[t];return void 0!==n||(n=new We(ai),n.endX=e,n.endY=i,50>_e.Vh&&(_e.Uh[t]=n,_e.Vh++)),n})),Au("Square",(function(t,e,i){t="s"+e+","+i;var n=_e.Uh[t];return void 0!==n||(n=new We(ai),n.endX=e,n.endY=i,n.defaultStretch=Us,50>_e.Vh&&(_e.Uh[t]=n,_e.Vh++)),n})),Au("RoundedRectangle",(function(t,e,i){var n=t?t.parameter1:NaN;return(isNaN(n)||0>n)&&(n=5),n=Math.min(n,e/3),n=Math.min(n,i/3),t=n*_e.Kg,e=(new We).add(new ci(n,0,!0).add(new fi(yi,e-n,0)).add(new fi(mi,e,n,e-t,0,e,t)).add(new fi(yi,e,i-n)).add(new fi(mi,e-n,i,e,i-t,e-t,i)).add(new fi(yi,n,i)).add(new fi(mi,0,i-n,t,i,0,i-t)).add(new fi(yi,0,n)).add(new fi(mi,n,0,0,t,t,0).close())),1<t&&(e.spot1=new Ge(0,0,t,t),e.spot2=new Ge(1,1,-t,-t)),e})),Au("Border","RoundedRectangle"),Au("Ellipse",(function(t,e,i){t="e"+e+","+i;var n=_e.Uh[t];return void 0!==n||(n=new We(hi),n.endX=e,n.endY=i,n.spot1=Ie,n.spot2=Ee,50>_e.Vh&&(_e.Uh[t]=n,_e.Vh++)),n})),Au("Circle",(function(t,e,i){t="c"+e+","+i;var n=_e.Uh[t];return void 0!==n||(n=new We(hi),n.endX=e,n.endY=i,n.spot1=Ie,n.spot2=Ee,n.defaultStretch=Us,50>_e.Vh&&(_e.Uh[t]=n,_e.Vh++)),n})),Au("TriangleRight",(function(t,e,i){return(new We).add(new ci(0,0).add(new fi(yi,e,.5*i)).add(new fi(yi,0,i).close())).Zm(0,.25,.5,.75)})),Au("TriangleDown",(function(t,e,i){return(new We).add(new ci(0,0).add(new fi(yi,e,0)).add(new fi(yi,.5*e,i).close())).Zm(.25,0,.75,.5)})),Au("TriangleLeft",(function(t,e,i){return(new We).add(new ci(e,i).add(new fi(yi,0,.5*i)).add(new fi(yi,e,0).close())).Zm(.5,.25,1,.75)})),Au("TriangleUp",(function(t,e,i){return(new We).add(new ci(e,i).add(new fi(yi,0,i)).add(new fi(yi,.5*e,0).close())).Zm(.25,.5,.75,1)})),Au("Triangle","TriangleUp"),Au("Diamond",(function(t,e,i){return(new We).add(new ci(.5*e,0).add(new fi(yi,0,.5*i)).add(new fi(yi,.5*e,i)).add(new fi(yi,e,.5*i).close())).Zm(.25,.25,.75,.75)})),Au("LineH",(function(t,e,i){return t=new We(si),t.startX=0,t.startY=i/2,t.endX=e,t.endY=i/2,t})),Au("LineV",(function(t,e,i){return t=new We(si),t.startX=e/2,t.startY=0,t.endX=e/2,t.endY=i,t})),Au("None","Rectangle"),Au("BarH","Rectangle"),Au("BarV","Rectangle"),Au("MinusLine","LineH"),Au("PlusLine",(function(t,e,i){return(new We).add(new ci(0,i/2,!1).add(new fi(yi,e,i/2)).add(new fi(gi,e/2,0)).add(new fi(yi,e/2,i)))})),Au("XLine",(function(t,e,i){return(new We).add(new ci(0,i,!1).add(new fi(yi,e,0)).add(new fi(gi,0,0)).add(new fi(yi,e,i)))})),_e.dn={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",BackwardOpenTriangleLine:"m 8,0 l  -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z  m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"},f(Lu,Uh),Lu.prototype.cloneProtected=function(t){Uh.prototype.cloneProtected.call(this,t),t.D=-4097&this.D|49152,t.Nf=this.Nf,t.ih=this.ih,t.Ho=this.Ho,t.Rp=this.Rp,t.Cp=this.Cp,t.Gp=this.Gp,t.Tp=this.Tp,t.Sp=this.Sp,t.so=this.so,t.Lf=null,t.Ep=this.Ep,t.Dp=this.Dp.H(),t.Hp=this.Hp,t.Ip=this.Ip.H(),t.Ub=this.Ub,t.An=this.An,t.dg.assign(this.dg),t.Oo=this.Oo,t.Po=this.Po.H(),t.Yo=this.Yo.H(),t.Qo=this.Qo.H(),t.Sn=this.Sn,t.Io=this.Io,t.Xp=this.Xp.H(),t.Wp=this.Wp,t.ug=this.ug,t.tq=this.tq},Lu.prototype.yf=function(t){Uh.prototype.yf.call(this,t),t.Oh(),t.sh=null,t.cf=null,t.Xj=null},Lu.prototype.toString=function(){var t=D(this.constructor)+"#"+st(this);return null!==this.data&&(t+="("+F(this.data)+")"),t},Lu.prototype.Sk=function(t,e,i,n,o,r,s){var a=this.diagram;null!==a&&(t===Ni&&"elements"===e?o instanceof Uh?Jh(o,(function(t){Md(a.partManager,t),Hr(a,t)})):_r(a,o):t===Ci&&"elements"===e&&(o instanceof Uh?Jh(o,(function(t){Sd(a.partManager,t,a)})):Wr(a,o)),a.Va(t,e,i,n,o,r,s))},Lu.prototype.Da=function(t){if(Uh.prototype.Da.call(this,t),null!==this.data){for(var e=this.W.j,i=e.length,n=0;n<i;n++){var o=e[n];o instanceof Uh&&Jh(o,(function(t){null!==t.data&&t.Da()}))}for(e=this.adornments;e.next();)e.value.Da(t)}},Lu.prototype.updateRelationshipsFromData=function(){null!==this.data&&this.diagram.partManager.updateRelationshipsFromData(this)},Lu.prototype.wk=function(t){var e=this.Lf;return null===e?null:e.G(t)},Lu.prototype.Gh=function(t,e){if(null!==e){var i=null,n=this.Lf;if(null!==n&&(i=n.G(t)),i!==e){if(null!==i){var o=i.diagram;null!==o&&o.remove(i)}null===n&&(this.Lf=n=new dt),e.Nf!==t&&(e.category=t),n.add(t,e),t=this.diagram,null!==t&&(t.add(e),t=e.adornedObject,null!==t&&(t=t.ij(),null!==t&&(e.data=t.data)))}}},Lu.prototype.Hf=function(t){var e=this.Lf;if(null!==e){var i=e.G(t);if(null!==i){var n=i.diagram;null!==n&&n.remove(i)}e.remove(t),0===e.count&&(this.Lf=null)}},Lu.prototype.nk=function(){var t=this.Lf;if(null!==t){var e=j();for(t=t.iterator;t.next();)e.push(t.key);t=e.length;for(var i=0;i<t;i++)this.Hf(e[i]);O(e)}},Lu.prototype.updateAdornments=function(){var t=this.diagram;if(null!==t){for(var e=this.adornments;e.next();){var i=e.value;i.o(),i.placeholder&&i.placeholder.o()}t:{if(this.isSelected&&this.selectionAdorned&&(e=this.selectionObject,null!==e&&this.actualBounds.s()&&this.isVisible()&&e.Gf()&&e.actualBounds.s())){if(i=this.wk("Selection"),null===i){if(i=this.selectionAdornmentTemplate,null===i&&(i=this.Ph()?t.linkSelectionAdornmentTemplate:this instanceof bc?t.groupSelectionAdornmentTemplate:t.nodeSelectionAdornmentTemplate),!(i instanceof Qu))break t;ul(i),i=i.copy(),null!==i&&(this.Ph()&&this.selectionObject===this.path&&(i.type=Uh.Link),i.adornedObject=e)}if(null!==i){i.type===Uh.Link&&i.o(),this.Gh("Selection",i);break t}}this.Hf("Selection")}for(Ou(this,t),e=this.adornments;e.next();)e.value.Da()}},Lu.prototype.Lb=function(){var t=this.diagram;null!==t&&(Lr(t),0!==(16384&this.D)!==!0&&(this.D|=16384,t.Db()))},Lu.prototype.move=function(t,e){!0===e?this.location=t:this.position=t},Lu.prototype.moveTo=function(t,e,i){t=pt.allocAt(t,e),this.move(t,i),pt.free(t)},Lu.prototype.isVisible=function(){if(!this.visible)return!1;var t=this.layer;if(null!==t){if(!t.visible)return!1;if(t=t.diagram,null!==t&&t.animationManager.cu(this))return!0}return t=this.containingGroup,!!(null===t||t.isSubGraphExpanded&&t.isVisible())},i=Lu.prototype,i.Ob=function(t){var e=this.diagram;t?(this.B(4),this.Lb(),null!==e&&e.wd.add(this)):(this.B(8),this.nk()),this.Oh(),null!==e&&(e.Na(),e.M())},i.bb=function(t){if(this.name===t)return this;var e=this.Xj;if(null===e&&(this.Xj=e=new dt),null!==e.G(t))return e.G(t);var i=Uh.prototype.bb.call(this,t);return null!==i?(e.set(t,i),i):(e.set(t,null),null)},i.Df=function(t,e,i){void 0===i&&(i=new pt),e=e.nc()?ae:e;var n=t.naturalBounds;if(i.h(n.width*e.x+e.offsetX,n.height*e.y+e.offsetY),null===t||t===this)return i;for(t.transform.ta(i),t=t.panel;null!==t&&t!==this;)t.transform.ta(i),t=t.panel;return this.cg.ta(i),i.offset(-this.qc.x,-this.qc.y),i},i.mj=function(t){return void 0===t&&(t=new zt),t.assign(this.actualBounds)},i.Ta=function(){!0===La(this)&&this.measure(1/0,1/0),this.arrange()},Lu.prototype.arrange=function(){if(!1===Oa(this))Fu(this);else{Da(this,!1);var t=this.xb,e=zt.alloc();e.assign(t);var i=Uu(this);this.Ih(0,0,this.qc.width,this.qc.height);var n=this.position;Eu(this,n,this.location),t.ea(),t.x=n.x,t.y=n.y,t.freeze(),this.Im(e,t),e.w(t)?this.Nd(i):!this.Nc()||_e.A(e.width,t.width)&&_e.A(e.height,t.height)||0<=this.zx&&this.B(16),zt.free(e),Xu(this,!1)}},i=Lu.prototype,i.Im=function(t,e){var i=this.diagram;if(null!==i){var n=!1;if(!1===i.vi&&t.s()){var o=zt.alloc();o.assign(i.documentBounds),o.Jw(i.padding),t.x>o.x&&t.y>o.y&&t.right<o.right&&t.bottom<o.bottom&&e.x>o.x&&e.y>o.y&&e.right<o.right&&e.bottom<o.bottom&&(n=!0),zt.free(o)}0!==(65536&this.D)!==!0&&t.w(e)||Vu(this,n,i),i.M(),!t.s()&&!e.s()||Xt(t,e)||(this instanceof ec&&!i.undoManager.isUndoingRedoing&&this.sd(),this.Oh())}},i.Ew=function(t,e){if(this.Ph()||!t.s())return!1;var i=this.diagram;null!==i&&Iu(this,i,t,e),this.la=t,this.D&=-2097153;var n=this.dg;return!n.s()||null!==i&&!i.animationManager.isTicking&&i.undoManager.isUndoingRedoing||(i=n.copy(),n.h(n.x+(t.x-e.x),n.y+(t.y-e.y)),this.g("location",i,n.copy())),!1===Yu(this)&&!1===Oa(this)&&(Du(this),Fu(this)),!0},i.er=function(t,e,i){var n=this.dg,o=this.la;if(i){if(n.x===t&&n.y===e)return;Yu(this)||Oa(this)?o.h(NaN,NaN):o.h(o.x+t-n.x,o.y+e-n.y),n.h(t,e)}else{if(o.x===t&&o.y===e)return;Yu(this)||Oa(this)?this.lu():n.h(n.x+t-o.x,n.y+e-o.y),o.h(t,e)}Du(this)},i.lu=function(){this.D&=-2097153,Du(this)},i.rj=function(){return!0},i.Nc=function(){return!0},i.Ph=function(){return!1},i.Ff=function(){return!0},Lu.prototype.canCopy=function(){if(!this.copyable)return!1;var t=this.layer;return null===t||!!t.allowCopy&&(t=t.diagram,null===t||!!t.allowCopy)},Lu.prototype.canDelete=function(){if(!this.deletable)return!1;var t=this.layer;return null===t||!!t.allowDelete&&(t=t.diagram,null===t||!!t.allowDelete)},Lu.prototype.canEdit=function(){if(!this.textEditable)return!1;var t=this.layer;return null===t||!!t.allowTextEdit&&(t=t.diagram,null===t||!!t.allowTextEdit)},Lu.prototype.canGroup=function(){if(!this.groupable)return!1;var t=this.layer;return null===t||!!t.allowGroup&&(t=t.diagram,null===t||!!t.allowGroup)},Lu.prototype.canMove=function(){if(!this.movable)return!1;var t=this.layer;return null===t||!!t.allowMove&&(t=t.diagram,null===t||!!t.allowMove)},Lu.prototype.canReshape=function(){if(!this.reshapable)return!1;var t=this.layer;return null===t||!!t.allowReshape&&(t=t.diagram,null===t||!!t.allowReshape)},Lu.prototype.canResize=function(){if(!this.resizable)return!1;var t=this.layer;return null===t||!!t.allowResize&&(t=t.diagram,null===t||!!t.allowResize)},Lu.prototype.canRotate=function(){if(!this.rotatable)return!1;var t=this.layer;return null===t||!!t.allowRotate&&(t=t.diagram,null===t||!!t.allowRotate)},Lu.prototype.canSelect=function(){if(!this.selectable)return!1;var t=this.layer;return null===t||!!t.allowSelect&&(t=t.diagram,null===t||!!t.allowSelect)},i=Lu.prototype,i.Nd=function(t){this.D=t?131072|this.D:-131073&this.D},i.Oh=function(){var t=this.containingGroup;null!==t&&(t.o(),null!==t.placeholder&&t.placeholder.o(),t.sd())},i.M=function(){var t=this.diagram;null!==t&&!Oa(this)&&!Yu(this)&&this.isVisible()&&this.xb.s()&&t.M(Bu(this,this.xb))},i.o=function(){Uh.prototype.o.call(this);var t=this.diagram;null!==t&&(t.wd.add(this),this instanceof ec&&null!==this.labeledLink&&wa(this.labeledLink),t.Db(!0))},i.Mq=function(t){t||(t=this.mi,null!==t&&wc(t,this))},i.Nq=function(t){t||(t=this.mi,null!==t&&kc(t,this))},i.uk=function(){var t=this.data;if(null!==t){var e=this.diagram;null!==e&&(e=e.model,null!==e&&e.Nm(t))}},i.bA=function(){return Hu(this,this)},i.eA=function(){return _u(this,this)},i.Kd=function(t){return t instanceof bc&&Wu(this,this,t)},i.oy=function(t){if(null===t)return null;if(this===t)return this.containingGroup;for(var e=this;null!==e;){if(e instanceof bc&&Ku(e,!0),e instanceof ec){var i=e.labeledLink;null!==i&&(e=i)}e=e.containingGroup}for(i=null,e=t;null!==e;){if(0!==(1048576&e.D)){i=e;break}e instanceof ec&&(t=e.labeledLink,null!==t&&(e=t)),e=e.containingGroup}for(e=this;null!==e;)e instanceof bc&&Ku(e,!1),e instanceof ec&&(t=e.labeledLink,null!==t&&(e=t)),e=e.containingGroup;return i},Lu.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var t=this.layer;return!(null!==t&&t.isTemporary||this instanceof ec&&this.isLinkLabel)},Lu.prototype.B=function(t){if(void 0===t&&(t=16777215),this.isLayoutPositioned&&0!==(t&this.layoutConditions)){var e=this.layer;null!==e&&e.isTemporary||this instanceof ec&&this.isLinkLabel?e=!1:(e=this.diagram,e=null===e||!e.undoManager.isUndoingRedoing)}else e=!1;if(e)if(e=this.mi,null!==e){var i=e.layout;null!==i?i.B():e.B(t)}else t=this.diagram,null!==t&&(t=t.layout,null!==t&&t.B())},d.Object.defineProperties(Lu.prototype,{key:{get:function(){var t=this.diagram;if(null!==t)return t.model.ja(this.data)}},adornments:{get:function(){return null===this.Lf?J:this.Lf.iteratorValues}},layer:{get:function(){return this.Fi}},diagram:{get:function(){var t=this.Fi;return null!==t?t.diagram:null}},layerName:{get:function(){return this.ih},set:function(t){var e=this.ih;if(e!==t){var i=this.diagram;if((null===i||null!==i.xk(t)&&!i.partManager.addsToTemporaryLayer)&&(this.ih=t,null!==i&&i.Na(),this.g("layerName",e,t),e=this.layer,null!==e&&e.name!==t&&(i=e.diagram,null!==i&&(t=i.xk(t),null!==t&&t!==e)))){var n=e.Lc(-1,this,!0);if(0<=n&&i.Va(Ci,"parts",e,this,null,n,!0),n=t.oj(99999999,this,!0),e.visible!==t.visible&&this.Ob(t.visible),0<=n&&i.Va(Ni,"parts",t,null,this,!0,n),n=this.layerChanged,null!==n){var o=i.Z;i.Z=!0,n(this,e,t),i.Z=o}}}}},layerChanged:{get:function(){return this.Ho},set:function(t){var e=this.Ho;e!==t&&(this.Ho=t,this.g("layerChanged",e,t))}},zOrder:{get:function(){return this.tq},set:function(t){var e=this.tq;if(e!==t){this.tq=t;var i=this.layer;null!==i&&qo(i,-1,this),this.g("zOrder",e,t),t=this.diagram,null!==t&&t.M()}}},locationObject:{get:function(){if(null===this.cf){var t=this.locationObjectName;""!==t?(t=this.bb(t),this.cf=null!==t?t:this):this instanceof Qu&&this.type!==Uh.Link&&null!==this.placeholder?this.cf=this.placeholder:this.cf=this}return this.cf.visible?this.cf:this}},minLocation:{get:function(){return this.Yo},set:function(t){var e=this.Yo;e.w(t)||(this.Yo=t=t.H(),this.g("minLocation",e,t))}},maxLocation:{get:function(){return this.Qo},set:function(t){var e=this.Qo;e.w(t)||(this.Qo=t=t.H(),this.g("maxLocation",e,t))}},locationObjectName:{get:function(){return this.Oo},set:function(t){var e=this.Oo;e!==t&&(this.Oo=t,this.cf=null,this.o(),this.g("locationObjectName",e,t))}},locationSpot:{get:function(){return this.Po},set:function(t){var e=this.Po;e.w(t)||(this.Po=t=t.H(),this.o(),this.g("locationSpot",e,t))}},location:{get:function(){return this.dg},set:function(t){var e=t.x,i=t.y,n=this.dg,o=n.x,r=n.y;(o===e||isNaN(o)&&isNaN(e))&&(r===i||isNaN(r)&&isNaN(i))||(t=t.copy(),e=t,this.Ph()?e=!1:(this.dg=e,this.D|=2097152,!1===Oa(this)&&(Du(this),i=this.la,i.s()&&(o=this.diagram,null===o||o.animationManager.isTicking||!o.undoManager.isUndoingRedoing))&&(r=i.copy(),i.h(i.x+(e.x-n.x),i.y+(e.y-n.y)),Iu(this,o,i,r),this.g("position",r,i.copy())),e=!0),e&&this.g("location",n.copy(),t.copy()))}},category:{get:function(){return this.Nf},set:function(t){var e=this.Nf;if(e!==t){var i=this.diagram,n=this.data,o=null;if(null!==i&&null!==n&&!(this instanceof Qu)){var r=i.model.undoManager;r.isEnabled&&!r.isUndoingRedoing&&(o=this.clone(),o.W.addAll(this.W))}this.Nf=t,this.g("category",e,t),null===i||null===n||this instanceof Qu?this instanceof Qu&&(o=this.adornedPart,null!==o&&(t=o.Lf,null!==t&&t.remove(e),o.Gh(this.category,this))):(r=i.model,r.undoManager.isUndoingRedoing||(this.Ph()?(i.partManager.setLinkCategoryForData(n,t),i=i.partManager.findLinkTemplateForCategory(t),null!==i&&(ul(i),i=i.copy(),null!==i&&Gu(this,i,e,t))):(null!==r&&r.Um(n,t),i=bd(i.partManager,n,t),null!==i&&(ul(i),i=i.copy(),null===i||i instanceof Nc||(n=this.location.copy(),Gu(this,i,e,t),this.location.s()||(this.location=n)))),null!==o&&(e=this.clone(),e.W.addAll(this.W),this.g("self",o,e))))}}},self:{get:function(){return this},set:function(t){Gu(this,t,this.category,t.category)}},copyable:{get:function(){return 0!==(1&this.D)},set:function(t){var e=0!==(1&this.D);e!==t&&(this.D^=1,this.g("copyable",e,t))}},deletable:{get:function(){return 0!==(2&this.D)},set:function(t){var e=0!==(2&this.D);e!==t&&(this.D^=2,this.g("deletable",e,t))}},textEditable:{get:function(){return 0!==(4&this.D)},set:function(t){var e=0!==(4&this.D);e!==t&&(this.D^=4,this.g("textEditable",e,t),this.Lb())}},groupable:{get:function(){return 0!==(8&this.D)},set:function(t){var e=0!==(8&this.D);e!==t&&(this.D^=8,this.g("groupable",e,t))}},movable:{get:function(){return 0!==(16&this.D)},set:function(t){var e=0!==(16&this.D);e!==t&&(this.D^=16,this.g("movable",e,t))}},selectionAdorned:{get:function(){return 0!==(32&this.D)},set:function(t){var e=0!==(32&this.D);e!==t&&(this.D^=32,this.g("selectionAdorned",e,t),this.Lb())}},isInDocumentBounds:{get:function(){return 0!==(64&this.D)},set:function(t){var e=0!==(64&this.D);if(e!==t){this.D^=64;var i=this.diagram;null!==i&&i.Na(),this.g("isInDocumentBounds",e,t)}}},isLayoutPositioned:{get:function(){return 0!==(128&this.D)},set:function(t){var e=0!==(128&this.D);e!==t&&(this.D^=128,this.g("isLayoutPositioned",e,t),this.B(t?4:8))}},selectable:{get:function(){return 0!==(256&this.D)},set:function(t){var e=0!==(256&this.D);e!==t&&(this.D^=256,this.g("selectable",e,t),this.Lb())}},reshapable:{get:function(){return 0!==(512&this.D)},set:function(t){var e=0!==(512&this.D);e!==t&&(this.D^=512,this.g("reshapable",e,t),this.Lb())}},resizable:{get:function(){return 0!==(1024&this.D)},set:function(t){var e=0!==(1024&this.D);e!==t&&(this.D^=1024,this.g("resizable",e,t),this.Lb())}},rotatable:{get:function(){return 0!==(2048&this.D)},set:function(t){var e=0!==(2048&this.D);e!==t&&(this.D^=2048,this.g("rotatable",e,t),this.Lb())}},isSelected:{get:function(){return 0!==(4096&this.D)},set:function(t){var e=0!==(4096&this.D);if(e!==t){var i=this.diagram;if(!t||this.canSelect()&&!(null!==i&&i.selection.count>=i.maxSelectionCount)){this.D^=4096;var n=!1;if(null!==i){n=i.skipsUndoManager,i.skipsUndoManager=!0;var o=i.selection;o.ea(),t?o.add(this):o.remove(this),o.freeze()}this.g("isSelected",e,t),this.Lb(),t=this.selectionChanged,null!==t&&t(this),null!==i&&(i.Db(),i.skipsUndoManager=n)}}}},isHighlighted:{get:function(){return 0!==(524288&this.D)},set:function(t){var e=0!==(524288&this.D);if(e!==t){this.D^=524288;var i=this.diagram;null!==i&&(i=i.highlighteds,i.ea(),t?i.add(this):i.remove(this),i.freeze()),this.g("isHighlighted",e,t),this.M(),t=this.highlightedChanged,null!==t&&t(this)}}},isShadowed:{get:function(){return 0!==(8192&this.D)},set:function(t){var e=0!==(8192&this.D);e!==t&&(this.D^=8192,this.g("isShadowed",e,t),this.M())}},isAnimated:{get:function(){return 0!==(262144&this.D)},set:function(t){var e=0!==(262144&this.D);e!==t&&(this.D^=262144,this.g("isAnimated",e,t))}},highlightedChanged:{get:function(){return this.so},set:function(t){var e=this.so;e!==t&&(this.so=t,this.g("highlightedChanged",e,t))}},selectionObjectName:{get:function(){return this.Tp},set:function(t){var e=this.Tp;e!==t&&(this.Tp=t,this.sh=null,this.g("selectionObjectName",e,t))}},selectionAdornmentTemplate:{get:function(){return this.Rp},set:function(t){var e=this.Rp;e!==t&&(this.Rp=t,this.g("selectionAdornmentTemplate",e,t))}},selectionObject:{get:function(){if(null===this.sh){var t=this.selectionObjectName;null!==t&&""!==t?(t=this.bb(t),this.sh=null!==t?t:this):this instanceof Nc?(t=this.path,this.sh=null!==t?t:this):this.sh=this}return this.sh}},selectionChanged:{get:function(){return this.Sp},set:function(t){var e=this.Sp;e!==t&&(this.Sp=t,this.g("selectionChanged",e,t))}},resizeAdornmentTemplate:{get:function(){return this.Cp},set:function(t){var e=this.Cp;e!==t&&(this.Cp=t,this.g("resizeAdornmentTemplate",e,t))}},resizeObjectName:{get:function(){return this.Ep},set:function(t){var e=this.Ep;e!==t&&(this.Ep=t,this.g("resizeObjectName",e,t))}},resizeObject:{get:function(){var t=this.resizeObjectName;return""!==t&&(t=this.bb(t),null!==t)?t:this}},resizeCellSize:{get:function(){return this.Dp},set:function(t){var e=this.Dp;e.w(t)||(this.Dp=t=t.H(),this.g("resizeCellSize",e,t))}},rotateAdornmentTemplate:{get:function(){return this.Gp},set:function(t){var e=this.Gp;e!==t&&(this.Gp=t,this.g("rotateAdornmentTemplate",e,t))}},rotateObjectName:{get:function(){return this.Hp},set:function(t){var e=this.Hp;e!==t&&(this.Hp=t,this.g("rotateObjectName",e,t))}},rotateObject:{get:function(){var t=this.rotateObjectName;return""!==t&&(t=this.bb(t),null!==t)?t:this}},rotationSpot:{get:function(){return this.Ip},set:function(t){var e=this.Ip;e.w(t)||(this.Ip=t=t.H(),this.g("rotationSpot",e,t))}},text:{get:function(){return this.Ub},set:function(t){var e=this.Ub;e!==t&&(this.Ub=t,this.g("text",e,t))}},containingGroup:{get:function(){return this.mi},set:function(t){if(this.Nc()){var e=this.mi;if(e!==t){null===t||this!==t&&!t.Kd(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.B(2);var i=this.diagram;if(null!==e?kc(e,this):this instanceof bc&&null!==i&&i.Dh.remove(this),this.mi=t,null!==t?wc(t,this):this instanceof bc&&null!==i&&i.Dh.add(this),this.B(1),null!==i&&i.Z){var n=this.data,o=i.model;if(null!==n&&o.Dk()){var r=o.ja(null!==t?t.data:null);o.dr(n,r)}}if(n=this.containingGroupChanged,null!==n&&(o=!0,null!==i&&(o=i.Z,i.Z=!0),n(this,e,t),null!==i&&(i.Z=o)),this instanceof bc)for(i=new nt,Ju(i,this,!0,0,!0),i=i.iterator;i.next();)if(n=i.value,n instanceof ec)for(n=n.linksConnected;n.next();)Cc(n.value);if(this instanceof ec){for(i=this.linksConnected;i.next();)Cc(i.value);i=this.labeledLink,null!==i&&Cc(i)}this.g("containingGroup",e,t),null!==t&&(e=t.layer,null!==e&&qo(e,-1,t))}}else w("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return this.An},set:function(t){var e=this.An;e!==t&&(this.An=t,this.g("containingGroupChanged",e,t))}},isTopLevel:{get:function(){return!(null!==this.containingGroup||this instanceof ec&&null!==this.labeledLink)}},layoutConditions:{get:function(){return this.Io},set:function(t){var e=this.Io;e!==t&&(this.Io=t,this.g("layoutConditions",e,t))}},dragComputation:{get:function(){return this.Sn},set:function(t){var e=this.Sn;e!==t&&(this.Sn=t,this.g("dragComputation",e,t))}},shadowOffset:{get:function(){return this.Xp},set:function(t){var e=this.Xp;e.w(t)||(this.Xp=t=t.H(),this.M(),this.g("shadowOffset",e,t))}},shadowColor:{get:function(){return this.Wp},set:function(t){var e=this.Wp;e!==t&&(this.Wp=t,this.M(),this.g("shadowColor",e,t))}},shadowBlur:{get:function(){return this.ug},set:function(t){var e=this.ug;e!==t&&(this.ug=t,this.M(),this.g("shadowBlur",e,t))}}}),Lu.prototype.invalidateLayout=Lu.prototype.B,Lu.prototype.findCommonContainingGroup=Lu.prototype.oy,Lu.prototype.isMemberOf=Lu.prototype.Kd,Lu.prototype.findTopLevelPart=Lu.prototype.eA,Lu.prototype.findSubGraphLevel=Lu.prototype.bA,Lu.prototype.ensureBounds=Lu.prototype.Ta,Lu.prototype.getDocumentBounds=Lu.prototype.mj,Lu.prototype.getRelativePoint=Lu.prototype.Df,Lu.prototype.findObject=Lu.prototype.bb,Lu.prototype.moveTo=Lu.prototype.moveTo,Lu.prototype.invalidateAdornments=Lu.prototype.Lb,Lu.prototype.clearAdornments=Lu.prototype.nk,Lu.prototype.removeAdornment=Lu.prototype.Hf,Lu.prototype.addAdornment=Lu.prototype.Gh,Lu.prototype.findAdornment=Lu.prototype.wk,Lu.prototype.updateTargetBindings=Lu.prototype.Da;var Zu=!1;function Qu(t){Lu.call(this,t),this.D&=-257,this.ih="Adornment",this.ie=null,this.Ex=0,this.Sx=!1,this.l=t instanceof Yh?[]:tc,this.Sa=null}Lu.className="Part",Lu.LayoutNone=0,Lu.LayoutAdded=1,Lu.LayoutRemoved=2,Lu.LayoutShown=4,Lu.LayoutHidden=8,Lu.LayoutNodeSized=16,Lu.LayoutGroupLayout=32,Lu.LayoutNodeReplaced=64,Lu.LayoutStandard=127,Lu.LayoutAll=16777215,f(Qu,Lu),Qu.prototype.toString=function(){var t=this.adornedPart;return"Adornment("+this.category+")"+(null!==t?t.toString():"")},Qu.prototype.updateRelationshipsFromData=function(){},Qu.prototype.Gk=function(t){var e=this.adornedObject.part;if(e instanceof Nc&&this.adornedObject instanceof Nl){var i=e.path;e.Gk(t),t=i.geometry,e=this.W.j,i=e.length;for(var n=0;n<i;n++){var o=e[n];o.isPanelMain&&o instanceof Nl&&(o.na=t)}}},Qu.prototype.rj=function(){var t=this.ie;return null===t||(t=t.part,null===t||!Oa(t))},Qu.prototype.Nc=function(){return!1},Qu.prototype.Sk=function(t,e,i,n,o,r,s){if(t===Ni&&"elements"===e){if(o instanceof Pc)null===this.Sa&&(this.Sa=o);else if(o instanceof Uh){var a=o.ym((function(t){return t instanceof Pc}));a instanceof Pc&&null===this.Sa&&(this.Sa=a)}}else t===Ci&&"elements"===e&&null!==this.Sa&&(n===this.Sa||n instanceof Uh&&this.Sa.Gg(n))&&(this.Sa=null);Lu.prototype.Sk.call(this,t,e,i,n,o,r,s)},Qu.prototype.updateAdornments=function(){},Qu.prototype.uk=function(){},d.Object.defineProperties(Qu.prototype,{placeholder:{get:function(){return this.Sa}},adornedObject:{get:function(){return this.ie},set:function(t){var e=this.adornedPart,i=null;null!==t&&(i=t.part),null===e||null!==t&&e===i||e.Hf(this.category),this.ie=t,null!==i&&i.Gh(this.category,this)}},adornedPart:{get:function(){var t=this.ie;return null!==t?t.part:null}},containingGroup:{get:function(){return null}}});var tc=[];function ec(t){Lu.call(this,t),this.P=13,this.$a=new et,this.nq=this.Kl=this.Ii=this.Ko=this.Jo=null,this.cl=ze,this.tc=this.Se=null,this.zp=vc,this.Eh=!1}function ic(t,e){null!==e&&(null===t.Se&&(t.Se=new nt),t.Se.add(e))}function nc(t,e,i,n){if(null===e||null===t.Se)return null;for(var o=t.Se.iterator;o.next();){var r=o.value;if(r.au===t&&r.lw===e&&r.My===i&&r.Ny===n||r.au===e&&r.lw===t&&r.My===n&&r.Ny===i)return r}return null}function oc(t,e){for(t=t.linksConnected;t.next();){var i=t.value;i.fromPort!==e&&i.toPort!==e||(rc(i.fromPort),rc(i.toPort),i.Ua())}}function rc(t){if(null!==t){var e=t.yp;null!==e&&e.Dm(),t=t.part,e=t.containingGroup,null===e||t.isVisible()||rc(e.port)}}function sc(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)&&sc(t,o?r.toNode:r.fromNode,i,n):n.add(r)}))}}function ac(t,e,i){rc(i);var n=t.$a.contains(e);if(n||t.$a.add(e),!n||e.fromNode===e.toNode){var o=t.linkConnected;if(null!==o){var r=!0,s=t.diagram;null!==s&&(r=s.Z,s.Z=!0),o(t,e,i),null!==s&&(s.Z=r)}}!n&&e.isTreeLink&&(i=e.fromNode,e=e.toNode,null!==i&&null!==e&&i!==e&&(n=!0,t=t.diagram,null!==t&&(n=t.isTreePathToChildren),o=n?e:i,r=n?i:e,o.Eh||(o.Eh=r),!r.isTreeLeaf||null!==t&&t.undoManager.isUndoingRedoing||(n?i===r&&(r.isTreeLeaf=!1):e===r&&(r.isTreeLeaf=!1))))}function hc(t,e,i){rc(i);var n=t.$a.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.Z,o.Z=!0),r(t,e,i),null!==o&&(o.Z=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.Eh=!1),null===e||e.isTreeLeaf||(0===e.$a.count?(e.Eh=null,null!==o&&o.undoManager.isUndoingRedoing||(e.isTreeLeaf=!0)):lc(e)))}function lc(t){if(t.Eh=!1,0!==t.$a.count){var e=!0,i=t.diagram;if(null===i||!i.undoManager.isUndoingRedoing){for(null!==i&&(e=i.isTreePathToChildren),i=t.$a.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 uc(t){null===t.tc?t.tc=new dt:t.tc.clear(),t.an(t,(function(t,e){cc(t,e)})),0===t.tc.count&&t.tc.add("",t)}function cc(t,e){var i=e.portId;null!==i&&null!==t.tc&&t.tc.add(i,e)}function fc(t,e,i){var n=e.portId;if(null!==n&&(null!==t.tc&&t.tc.remove(n),e=t.diagram,null!==e&&i)){for(i=null,t=t.findLinksConnected(n);t.next();)n=t.value,null===i&&(i=j()),i.push(n);if(null!==i){for(t=0;t<i.length;t++)e.remove(i[t]);O(i)}}}function dc(t,e){return e=e.Fg(),null===e?0:1+dc(t,e)}function pc(t,e,i,n,o,r,s){if(1<n)for(var a=i?t.Fq():t.Hd();a.next();){var h=a.value;h.isTreeLink&&(h=h.Kq(t),null===h||h===t||e.contains(h)||(e.add(h),pc(h,e,i,n-1,o,r,s)))}else gc(t,e,i,o,r,s)}function gc(t,e,i,n,o,r){for(var s=o===t||t.isTreeExpanded,a=i?t.Fq():t.Hd();a.next();){var h=a.value;if(h.isTreeLink&&(h=h.Kq(t),null!==h&&h!==t)){var l=e.contains(h);l||e.add(h),s&&(r&&n.jk(h,o),h.Oh(),h.Ob(!1)),h.isTreeExpanded&&(h.wasTreeExpanded=h.isTreeExpanded,l||gc(h,e,i,n,o,r))}}t.isTreeExpanded=!1}function yc(t,e,i,n,o,r,s){for(var a=r!==t&&t.isTreeExpanded,h=i?t.Fq():t.Hd();h.next();){var l=h.value;l.isTreeLink&&(a||l.ud||l.Ua(),l=l.Kq(t),null!==l&&l!==t&&!e.contains(l)&&(e.add(l),a||(l.Ob(!0),l.Oh(),s&&o.lk(l,r)),2<n||l.wasTreeExpanded))&&(l.wasTreeExpanded=!1,yc(l,e,i,n-1,o,r,s))}t.isTreeExpanded=!0}Qu.className="Adornment",f(ec,Lu),ec.prototype.cloneProtected=function(t){Lu.prototype.cloneProtected.call(this,t),t.P=this.P,t.P=-17&this.P,t.Jo=this.Jo,t.Ko=this.Ko,t.Ii=this.Ii,t.nq=this.nq,t.cl=this.cl.H(),t.zp=this.zp},i=ec.prototype,i.yf=function(t){Lu.prototype.yf.call(this,t),t.sd(),t.Se=this.Se,t.tc=null},i.xA=function(t,e,i){void 0!==e&&null!==e||(e=""),void 0!==i&&null!==i||(i=""),t=nc(this,t,e,i),null!==t&&t.Dm()},i.Sk=function(t,e,i,n,o,r,s){(t===Ni&&"elements"===e||t===Ci&&"elements"===e)&&(this.tc=null),Lu.prototype.Sk.call(this,t,e,i,n,o,r,s)},i.sd=function(t){void 0===t&&(t=null);for(var e=this.linksConnected;e.next();){var i=e.value;null!==t&&t.contains(i)||(rc(i.fromPort),rc(i.toPort),i.Ua())}},i.rj=function(){return!0},ec.prototype.getAvoidableRect=function(t){return t.set(this.actualBounds),t.uq(this.cl),t},ec.prototype.findVisibleNode=function(){for(var t=this;null!==t&&!t.isVisible();)t=t.containingGroup;return t},ec.prototype.isVisible=function(){if(!Lu.prototype.isVisible.call(this))return!1;var t=!0,e=Ls,i=this.diagram;if(null!==i){if(i.animationManager.cu(this))return!0;t=i.isTreePathToChildren,e=i.treeCollapsePolicy}if(e===Ls){if(t=this.Fg(),null!==t&&!t.isTreeExpanded)return!1}else if(e===js){if(t=t?this.Tv():this.Uv(),0<t.count&&t.all((function(t){return!t.isTreeExpanded})))return!1}else if(e===Os&&(t=t?this.Tv():this.Uv(),0<t.count&&t.any((function(t){return!t.isTreeExpanded}))))return!1;return t=this.labeledLink,null===t||t.isVisible()},ec.prototype.Ob=function(t){Lu.prototype.Ob.call(this,t);for(var e=this.linksConnected;e.next();){var i=e.value;if(t&&null!==this.containingGroup){var n=i.Kq(this);null===n||n.Kd(this.containingGroup)||i.Ua()}i.Ob(t)}},ec.prototype.py=function(){var t=new nt,e=new nt;return sc(this,this,t,e),e.iterator},ec.prototype.findLinksConnected=function(t){if(void 0===t&&(t=null),null===t)return this.$a.iterator;var e=new Q(this.$a),i=this;return e.predicate=function(e){return e.fromNode===i&&e.fromPortId===t||e.toNode===i&&e.toPortId===t},e},i=ec.prototype,i.Fq=function(t){void 0===t&&(t=null);var e=new Q(this.$a),i=this;return e.predicate=function(e){return e.fromNode===i&&(null===t||e.fromPortId===t)},e},i.Hd=function(t){void 0===t&&(t=null);var e=new Q(this.$a),i=this;return e.predicate=function(e){return e.toNode===i&&(null===t||e.toPortId===t)},e},i.Sv=function(t){void 0===t&&(t=null);for(var e=null,i=null,n=this.$a.iterator;n.next();){var o=n.value;o.fromNode===this?null!==t&&o.fromPortId!==t||(o=o.toNode,null!==e?e.add(o):null!==i&&i!==o?(e=new nt,e.add(i),e.add(o)):i=o):o.toNode!==this||null!==t&&o.toPortId!==t||(o=o.fromNode,null!==e?e.add(o):null!==i&&i!==o?(e=new nt,e.add(i),e.add(o)):i=o)}return null!==e?e.iterator:null!==i?new Z(i):J},i.Uv=function(t){void 0===t&&(t=null);for(var e=null,i=null,n=this.$a.iterator;n.next();){var o=n.value;o.fromNode!==this||null!==t&&o.fromPortId!==t||(o=o.toNode,null!==e?e.add(o):null!==i&&i!==o?(e=new nt,e.add(i),e.add(o)):i=o)}return null!==e?e.iterator:null!==i?new Z(i):J},i.Tv=function(t){void 0===t&&(t=null);for(var e=null,i=null,n=this.$a.iterator;n.next();){var o=n.value;o.toNode!==this||null!==t&&o.toPortId!==t||(o=o.fromNode,null!==e?e.add(o):null!==i&&i!==o?(e=new nt,e.add(i),e.add(o)):i=o)}return null!==e?e.iterator:null!==i?new Z(i):J},i.Xz=function(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null);var n=new Q(this.$a),o=this;return n.predicate=function(n){return!(n.fromNode!==o||n.toNode!==t||null!==e&&n.fromPortId!==e||null!==i&&n.toPortId!==i)||!(n.fromNode!==t||n.toNode!==o||null!==i&&n.fromPortId!==i||null!==e&&n.toPortId!==e)},n},i.Yz=function(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null);var n=new Q(this.$a),o=this;return n.predicate=function(n){return!(n.fromNode!==o||n.toNode!==t||null!==e&&n.fromPortId!==e||null!==i&&n.toPortId!==i)},n},ec.prototype.updateRelationshipsFromData=function(){var t=this.diagram;null!==t&&t.partManager.updateRelationshipsFromData(this)},i=ec.prototype,i.Mq=function(t){Lu.prototype.Mq.call(this,t),t||(lc(this),t=this.Kl,null!==t&&Tc(t,this))},i.Nq=function(t){Lu.prototype.Nq.call(this,t),t||(t=this.Kl,null!==t&&null!==t.nd&&(t.nd.remove(this),t.o()))},i.uk=function(){if(0<this.$a.count){var t=this.diagram;if(null!==t)for(var e=null===t.commandHandler||t.commandHandler.deletesConnectedLinks,i=this.$a.copy().iterator;i.next();){var n=i.value;e?t.remove(n):(n.fromNode===this&&(n.fromNode=null),n.toNode===this&&(n.toNode=null))}}this.labeledLink=null,Lu.prototype.uk.call(this)},i.Jt=function(t){if(null===this.tc){if(""===t&&!1===this.Nh)return this;uc(this)}var e=this.tc.G(t);return null!==e||""!==t&&(e=this.tc.G(""),null!==e)?e:this},i.zA=function(t){if(null===t||t===this)return!1;var e=!0,i=this.diagram;if(null!==i&&(e=i.isTreePathToChildren),i=this,e)for(;i!==t;){e=null;for(var n=i.$a.iterator;n.next();){var o=n.value;if(o.isTreeLink&&(e=o.fromNode,e!==i&&e!==this))break}if(e===this||null===e||e===i)return!1;i=e}else for(;i!==t;){for(e=null,n=i.$a.iterator;n.next()&&(o=n.value,!o.isTreeLink||(e=o.toNode,e===i||e===this)););if(e===this||null===e||e===i)return!1;i=e}return!0},i.iA=function(){var t=!0,e=this.diagram;if(null!==e&&(t=e.isTreePathToChildren),e=this,t)for(;;){t=null;for(var i=e.$a.iterator;i.next();){var n=i.value;if(n.isTreeLink&&(t=n.fromNode,t!==e&&t!==this))break}if(t===this)return this;if(null===t||t===e)return e;e=t}else for(;;){for(t=null,i=e.$a.iterator;i.next()&&(n=i.value,!n.isTreeLink||(t=n.toNode,t===e||t===this)););if(t===this)return this;if(null===t||t===e)return e;e=t}},i.Uz=function(t){if(null===t)return null;if(this===t)return this;for(var e=this;null!==e;)Ku(e,!0),e=e.Fg();var i=null;for(e=t;null!==e;){if(0!==(1048576&e.D)){i=e;break}e=e.Fg()}for(e=this;null!==e;)Ku(e,!1),e=e.Fg();return i},i.jj=function(){var t=!0,e=this.diagram;if(null!==e&&(t=e.isTreePathToChildren),e=this.$a.iterator,t){for(;e.next();)if(t=e.value,t.isTreeLink&&t.fromNode!==this)return t}else for(;e.next();)if(t=e.value,t.isTreeLink&&t.toNode!==this)return t;return null},i.Fg=function(){var t=this.Eh;if(null===t)return null;if(t instanceof ec)return t;var e=!0;if(t=this.diagram,null!==t&&(e=t.isTreePathToChildren),t=this.$a.iterator,e){for(;t.next();)if(e=t.value,e.isTreeLink&&(e=e.fromNode,e!==this))return this.Eh=e}else for(;t.next();)if(e=t.value,e.isTreeLink&&(e=e.toNode,e!==this))return this.Eh=e;return this.Eh=null},i.gA=function(){function t(e,i){if(null!==e){i.add(e);var n=e.jj();null!==n&&(i.add(n),t(e.Fg(),i))}}var e=new nt;return t(this,e),e},i.fA=function(){return dc(this,this)},i.Hq=function(){var t=!0,e=this.diagram;null!==e&&(t=e.isTreePathToChildren),e=new Q(this.$a);var i=this;return e.predicate=t?function(t){return!(!t.isTreeLink||t.fromNode!==i)}:function(t){return!(!t.isTreeLink||t.toNode!==i)},e},i.Wv=function(){var t=!0,e=this.diagram;null!==e&&(t=e.isTreePathToChildren);var i=e=null,n=this.$a.iterator;if(t)for(;n.next();)t=n.value,t.isTreeLink&&t.fromNode===this&&(t=t.toNode,null!==e?e.add(t):null!==i&&i!==t?(e=new et,e.add(i),e.add(t)):i=t);else for(;n.next();)t=n.value,t.isTreeLink&&t.toNode===this&&(t=t.fromNode,null!==e?e.add(t):null!==i&&i!==t?(e=new et,e.add(i),e.add(t)):i=t);return null!==e?e.iterator:null!==i?new Z(i):J},i.hA=function(t){void 0===t&&(t=1/0);var e=new nt;return Ju(e,this,!1,t,!0),e},ec.prototype.collapseTree=function(t){void 0===t&&(t=1),1>t&&(t=1);var e=this.diagram;if(null!==e&&!e.Le){e.Le=!0;var i=new nt;i.add(this),pc(this,i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===Ls),e.Le=!1}},ec.prototype.expandTree=function(t){void 0===t&&(t=2),2>t&&(t=2);var e=this.diagram;if(null!==e&&!e.Le){e.Le=!0;var i=new nt;i.add(this),yc(this,i,e.isTreePathToChildren,t,e,this,e.treeCollapsePolicy===Ls),e.Le=!1}},d.Object.defineProperties(ec.prototype,{portSpreading:{get:function(){return this.zp},set:function(t){var e=this.zp;e!==t&&(this.zp=t,this.g("portSpreading",e,t),t=this.diagram,null!==t&&t.undoManager.isUndoingRedoing||this.sd())}},avoidable:{get:function(){return 0!==(8&this.P)},set:function(t){var e=0!==(8&this.P);if(e!==t){this.P^=8;var i=this.diagram;null!==i&&hs(i,this),this.g("avoidable",e,t)}}},avoidableMargin:{get:function(){return this.cl},set:function(t){"number"===typeof t&&(t=new Qt(t));var e=this.cl;if(!e.w(t)){this.cl=t=t.H();var i=this.diagram;null!==i&&hs(i,this),this.g("avoidableMargin",e,t)}}},linksConnected:{get:function(){return this.$a.iterator}},linkConnected:{get:function(){return this.Jo},set:function(t){var e=this.Jo;e!==t&&(this.Jo=t,this.g("linkConnected",e,t))}},linkDisconnected:{get:function(){return this.Ko},set:function(t){var e=this.Ko;e!==t&&(this.Ko=t,this.g("linkDisconnected",e,t))}},linkValidation:{get:function(){return this.Ii},set:function(t){var e=this.Ii;e!==t&&(this.Ii=t,this.g("linkValidation",e,t))}},isLinkLabel:{get:function(){return null!==this.Kl}},labeledLink:{get:function(){return this.Kl},set:function(t){var e=this.Kl;if(e!==t){var i=this.diagram,n=this.data;if(null!==e){if(null!==e.nd&&(e.nd.remove(this),e.o()),null!==i&&null!==n&&!i.undoManager.isUndoingRedoing){var o=e.data,r=i.model;if(null!==o&&r.qj()){var s=r.ja(n);void 0!==s&&r.Oy(o,s)}}this.containingGroup=null}this.Kl=t,null!==t&&(Tc(t,this),null===i||null===n||i.undoManager.isUndoingRedoing||(o=t.data,i=i.model,null!==o&&i.qj()&&(n=i.ja(n),void 0!==n&&i.Dv(o,n))),this.containingGroup=t.containingGroup),wa(this),this.g("labeledLink",e,t)}}},port:{get:function(){return this.Jt("")}},ports:{get:function(){return null===this.tc&&uc(this),this.tc.iteratorValues}},isTreeExpanded:{get:function(){return 0!==(1&this.P)},set:function(t){var e=0!==(1&this.P);if(e!==t){this.P^=1;var i=this.diagram;if(this.g("isTreeExpanded",e,t),e=this.treeExpandedChanged,null!==e){var n=!0;null!==i&&(n=i.Z,i.Z=!0),e(this),null!==i&&(i.Z=n)}null!==i&&i.undoManager.isUndoingRedoing?this.Ob(t):t?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return 0!==(2&this.P)},set:function(t){var e=0!==(2&this.P);e!==t&&(this.P^=2,this.g("wasTreeExpanded",e,t))}},treeExpandedChanged:{get:function(){return this.nq},set:function(t){var e=this.nq;e!==t&&(this.nq=t,this.g("treeExpandedChanged",e,t))}},isTreeLeaf:{get:function(){return 0!==(4&this.P)},set:function(t){var e=0!==(4&this.P);e!==t&&(this.P^=4,this.g("isTreeLeaf",e,t))}}}),ec.prototype.expandTree=ec.prototype.expandTree,ec.prototype.collapseTree=ec.prototype.collapseTree,ec.prototype.findTreeParts=ec.prototype.hA,ec.prototype.findTreeChildrenNodes=ec.prototype.Wv,ec.prototype.findTreeChildrenLinks=ec.prototype.Hq,ec.prototype.findTreeLevel=ec.prototype.fA,ec.prototype.findTreeParentChain=ec.prototype.gA,ec.prototype.findTreeParentNode=ec.prototype.Fg,ec.prototype.findTreeParentLink=ec.prototype.jj,ec.prototype.findCommonTreeParent=ec.prototype.Uz,ec.prototype.findTreeRoot=ec.prototype.iA,ec.prototype.isInTreeOf=ec.prototype.zA,ec.prototype.findPort=ec.prototype.Jt,ec.prototype.findLinksTo=ec.prototype.Yz,ec.prototype.findLinksBetween=ec.prototype.Xz,ec.prototype.findNodesInto=ec.prototype.Tv,ec.prototype.findNodesOutOf=ec.prototype.Uv,ec.prototype.findNodesConnected=ec.prototype.Sv,ec.prototype.findLinksInto=ec.prototype.Hd,ec.prototype.findLinksOutOf=ec.prototype.Fq,ec.prototype.findExternalTreeLinksConnected=ec.prototype.py,ec.prototype.invalidateConnectedLinks=ec.prototype.sd,ec.prototype.invalidateLinkBundle=ec.prototype.xA;var mc=new U(ec,"SpreadingNone",10),vc=new U(ec,"SpreadingEvenly",11),xc=new U(ec,"SpreadingPacked",12);function bc(t){ec.call(this,t),this.P|=4608,this.Vo=new nt,this.Sl=new nt,this.Sa=this.eq=this.Ki=this.Wo=this.Uo=this.Za=null,this.kc=new zf,this.kc.group=this}function wc(t,e){if(t.Vo.add(e)){e instanceof bc&&t.Sl.add(e);var i=t.memberAdded;if(null!==i){var n=!0,o=t.diagram;null!==o&&(n=o.Z,o.Z=!0),i(t,e),null!==o&&(o.Z=n)}t.isVisible()&&t.isSubGraphExpanded||e.Ob(!1)}e instanceof Nc&&!t.computesBoundsIncludingLinks||(e=t.Sa,null===e&&(e=t),e.o())}function kc(t,e){if(t.Vo.remove(e)){e instanceof bc&&t.Sl.remove(e);var i=t.memberRemoved;if(null!==i){var n=!0,o=t.diagram;null!==o&&(n=o.Z,o.Z=!0),i(t,e),null!==o&&(o.Z=n)}t.isVisible()&&t.isSubGraphExpanded||e.Ob(!0)}e instanceof Nc&&!t.computesBoundsIncludingLinks||(e=t.Sa,null===e&&(e=t),e.o())}function Mc(t,e,i,n){for(var o=t.memberParts;o.next();){var r=o.value;if(r.Ob(!1),r instanceof bc&&r.isSubGraphExpanded&&(r.wasSubGraphExpanded=r.isSubGraphExpanded,Mc(r,e,i,n)),r instanceof ec)r.sd(e),i.jk(r,n);else if(r instanceof Nc)for(r=r.labelNodes;r.next();)r.value.sd(e)}t.isSubGraphExpanded=!1}function Sc(t,e,i,n){for(var o=t.memberParts;o.next();){var r=o.value;if(r.Ob(!0),r instanceof bc&&r.wasSubGraphExpanded&&(r.wasSubGraphExpanded=!1,Sc(r,e,i,n)),r instanceof ec)r.sd(e),i.lk(r,n);else if(r instanceof Nc)for(r=r.labelNodes;r.next();)r.value.sd(e)}t.isSubGraphExpanded=!0}function Pc(){ca.call(this),this.ib=Re,this.Np=new zt(NaN,NaN,NaN,NaN)}function Nc(){Lu.call(this,Uh.Link),this.Ga=8,this.We=null,this.Xe="",this.rf=this.fo=null,this.sf="",this.mq=null,this.Yk=tf,this.Hn=0,this.Jn=tf,this.Kn=NaN,this.ck=$c,this.Zp=.5,this.nd=null,this.Ab=(new et).freeze(),this.jf=this.ph=null,this.Yl=new zt,this.na=new We,this.I=this.u=this.Mf=this.Vf=null,this.l=[],this.vv=new pt,this.$r=this.Nx=this.Mx=null,this.Ru=NaN,this.O=null}function Cc(t){var e=t.fromNode,i=t.toNode,n=null;if(n=null!==e?null!==i?e.oy(i):e.containingGroup:null!==i?i.containingGroup:null,e=n,i=t.mi,i!==e){null!==i&&kc(i,t),t.mi=e,null!==e&&wc(e,t);var o=t.containingGroupChanged;if(null!==o){var r=!0,s=t.diagram;null!==s&&(r=s.Z,s.Z=!0),o(t,i,e),null!==s&&(s.Z=r)}!t.ud||t.Mx!==i&&t.Nx!==i||t.Ua()}if(t.isLabeledLink)for(t=t.labelNodes;t.next();)t.value.containingGroup=n}function Tc(t,e){null===t.nd&&(t.nd=new nt),t.nd.add(e),t.o()}function Ac(t,e,i){if(0!==e||0!==i)if(0===t.pointsCount)t.defaultFromPoint&&t.defaultFromPoint.copy().offset(e,i),t.defaultToPoint&&t.defaultToPoint.copy().offset(e,i);else{for(var n=t.ud,o=new et,r=t.Ab.iterator;r.next();){var s=r.value;o.add(new pt(s.x+e,s.y+i).freeze())}o.freeze(),r=t.Ab,t.Ab=o,s=t.diagram,isNaN(e)||isNaN(i)||null!==s&&s.animationManager.sc?t.o():(t.dg.h(t.dg.x+e,t.dg.y+i),t.la.h(t.la.x+e,t.la.y+i),wa(t)),n?Lc(t):(t.defaultFromPoint&&(t.defaultFromPoint=t.i(0)),t.defaultToPoint&&(t.defaultToPoint=t.i(t.pointsCount-1))),null!==s&&s.animationManager.sc&&(e=s.animationManager,t.jf=o,e.$l.add(t)),t.g("points",r,o)}}function Lc(t){0===t.Ab.count?t.ud=!1:(t.ud=!0,t.$r=null,t.Ru=NaN,t.defaultFromPoint=t.i(0),t.defaultToPoint=t.i(t.pointsCount-1),qc(t,!1))}function jc(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 Oc(t,e){var i=e.yp;return null===i&&(i=new Ff,i.port=e,i.node=e.part,e.yp=i),If(i,t)}function Dc(t){return t===ie||.5===t.x&&.5===t.y}function Fc(t){return.5===t.x&&.5===t.y?t:ae}function Bc(t){if(null===t.diagram||!t.isAvoiding||!os(t.diagram))return!1;var e=t.points.j,i=e.length;if(4>i)return!1;t=rs(t.diagram,!0,t.containingGroup,null);for(var n=1;n<i-2;n++){var o=e[n],r=e[n+1];if(!t.Ek(Math.min(o.x,r.x),Math.min(o.y,r.y),Math.abs(o.x-r.x),Math.abs(o.y-r.y)))return!0}return!1}function Ic(t,e,i,n,o,r,s){var a=e.zq,h=e.yq,l=kf(e,i,n),u=i,c=n;for(0===o?u+=a:90===o?c+=h:180===o?u-=a:c-=h,o!==s&&l>Lf&&kf(e,u,c)!==l-1&&(kf(e,i-a,n)===l-1?(o=180,u=i-a,c=n):kf(e,i+a,n)===l-1?(o=0,u=i+a,c=n):kf(e,i,n-h)===l-1?(o=270,u=i,c=n-h):kf(e,i,n+h)===l-1&&(o=90,u=i,c=n+h));l>Lf&&kf(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>Lf&&(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>Lf&&(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),kf(e,s,u)===l-1?Ic(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),kf(e,s,u)===l-1&&Ic(t,e,s,u,r,!1,r))),t.vf(i,n)}function Ec(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),_e.aa(t,0)?e:_e.aa(e,0)?t:Math.sqrt(t*t+e*e)))}function Rc(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,n=Ec(e.x,e.y,i,r),0===n)return e;o=2===o?.5*n:n,t=t.computeShortLength(!0),t>o&&(t=o),o=t*(r-e.y)/n,e.x+=t*(i-e.x)/n,e.y+=o}else{if(r=t.i(o-2),i=r.x-n.x,r=r.y-n.y,n=Ec(e.x,e.y,i,r),0===n)return e;o=2===o?.5*n:n,t=t.computeShortLength(!1),t>o&&(t=o),o=t*(e.y-r)/n,e.x-=t*(e.x-i)/n,e.y-=o}return e}function zc(t,e,i,n){for(var o=t.pointsCount,r=e;_e.aa(e.x,r.x)&&_e.aa(e.y,r.y);){if(i>=o)return o-1;r=t.i(i++)}if(!_e.aa(e.x,r.x)&&!_e.aa(e.y,r.y))return i-1;for(var s=r;_e.aa(e.x,r.x)&&_e.aa(r.x,s.x)&&(!n||(e.y>=r.y?r.y>=s.y:r.y<=s.y))||_e.aa(e.y,r.y)&&_e.aa(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 Vc(t,e,i,n,o,r,s){if(!s&&Xc(t)){s=t.computeJumpLength();var a=s/2,h=[],l=0;if(t.isVisible()&&(l=Gc(t,o,r,h)),0<l)if(_e.A(o.y,r.y))if(o.x<r.x)for(var u=0;u<l;){var c=Math.max(o.x,Math.min(h[u++]-a,r.x-s));e.lineTo(c+i,r.y+n);for(var f=c+i,d=Math.min(c+s,r.x);u<l;){if(c=h[u],!(c<d+s))break;u++,d=Math.min(c+a,r.x)}c=r.y-s+n,d+=i;var p=r.y+n;t.curve===nf?ku(e,d,p,!1):Su(e,f,c,d,c,d,p)}else for(--l;0<=l;){for(u=Math.min(o.x,Math.max(h[l--]+a,r.x+s)),e.lineTo(u+i,r.y+n),f=u+i,c=Math.max(u-s,r.x);0<=l;){if(u=h[l],!(u>c-s))break;l--,c=Math.max(u-a,r.x)}u=r.y-s+n,c+=i,d=r.y+n,t.curve===nf?ku(e,c,d,!1):Su(e,f,u,c,u,c,d)}else if(_e.A(o.x,r.x))if(o.y<r.y)for(u=0;u<l;){for(c=Math.max(o.y,Math.min(h[u++]-a,r.y-s)),e.lineTo(r.x+i,c+n),f=c+n,c=Math.min(c+s,r.y);u<l;){if(d=h[u],!(d<c+s))break;u++,c=Math.min(d+a,r.y)}d=r.x-s+i,p=r.x+i,c+=n,t.curve===nf?ku(e,p,c,!1):Su(e,d,f,d,c,p,c)}else for(--l;0<=l;){for(u=Math.min(o.y,Math.max(h[l--]+a,r.y+s)),e.lineTo(r.x+i,u+n),f=u+n,u=Math.max(u-s,r.y);0<=l;){if(c=h[l],!(c>u-s))break;l--,u=Math.max(c-a,r.y)}c=r.x-s+i,d=r.x+i,u+=n,t.curve===nf?ku(e,d,u,!1):Su(e,c,f,c,u,d,u)}}e.lineTo(r.x+i,r.y+n)}function Gc(t,e,i,n){var o=t.diagram;if(null===o||e.w(i))return 0;for(o=o.layers;o.next();){var r=o.value;if(null!==r&&r.visible){r=r.Ea.j;for(var s=r.length,a=0;a<s;a++){var h=r[a];if(h instanceof Nc){if(h===t)return 0<n.length&&n.sort((function(t,e){return t-e})),n.length;if(h.isVisible()&&Xc(h)){var l=h.routeBounds;l.s()&&t.routeBounds.Mc(l)&&!t.usesSamePort(h)&&(l=h.path,null!==l&&l.Gf()&&Yc(e,i,n,h))}}}}}return 0<n.length&&n.sort((function(t,e){return t-e})),n.length}function Yc(t,e,i,n){for(var o=_e.A(t.y,e.y),r=n.pointsCount,s=n.i(0),a=pt.alloc(),h=1;h<r;h++){var l=n.i(h);if(h<r-1){var u=n.i(h+1);if(s.y===l.y&&l.y===u.y){if(l.x>s.x&&u.x>=l.x||l.x<s.x&&u.x<=l.x)continue}else if(s.x===l.x&&l.x===u.x&&(l.y>s.y&&u.y>=l.y||l.y<s.y&&u.y<=l.y))continue}t:{u=t.x;var c=t.y,f=e.x,d=e.y,p=s.x;s=s.y;var g=l.x,y=l.y;if(_e.A(u,f)){if(!_e.A(c,d)&&_e.A(s,y)&&Math.min(c,d)<s&&Math.max(c,d)>s&&Math.min(p,g)<u&&Math.max(p,g)>u&&!_e.A(p,g)){a.x=u,a.y=s,u=!0;break t}}else if(_e.A(c,d)&&_e.A(p,g)&&Math.min(u,f)<p&&Math.max(u,f)>p&&Math.min(s,y)<c&&Math.max(s,y)>c&&!_e.A(s,y)){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 Xc(t){return t=t.curve,t===of||t===nf}function qc(t,e){(e||Xc(t))&&(e=t.diagram,null===e||e.animationManager.isTicking||e.Vg.contains(t)||0===t.Yl.width&&0===t.Yl.height||e.Vg.add(t,t.Yl.copy()))}function Uc(t,e,i){if(null!==e&&e.$m&&e.ud&&Xc(e)){var n=e.routeBounds;n.s()&&(t.routeBounds.Mc(n)||i.Mc(n))&&(t.usesSamePort(e)||e.dc())}}function Kc(t){var e=t.We;if(null!==e){var i=t.rf;if(null!==i&&isNaN(t.curviness)){for(var n=t.Xe,o=t.sf,r=t=null,s=e.$a.j,a=s.length,h=0;h<a;h++){var l=s[h];(l.We===e&&l.Xe===n&&l.rf===i&&l.sf===o||l.We===i&&l.Xe===o&&l.rf===e&&l.sf===n)&&(null===r?r=l:(null===t&&(t=[],t.push(r)),t.push(l)))}if(null!==t){for(r=nc(e,i,n,o),null===r&&(r=new xf(e,n,i,o),ic(e,r),ic(i,r)),r.links=t,e=0;e<t.length;e++)t[e].Mf=r;r.Dm()}}}}function Hc(t){var e=t.Mf;null!==e&&isNaN(t.curviness)&&(t.Mf=null,t=e.links.indexOf(t),0<=t&&(L(e.links,t),e.Dm()))}ec.className="Node",ec.SpreadingNone=mc,ec.SpreadingEvenly=vc,ec.SpreadingPacked=xc,f(bc,ec),bc.prototype.cloneProtected=function(t){ec.prototype.cloneProtected.call(this,t),this.P=-32769&this.P,null!==this.Za&&(t.Za=this.Za.copy()),t.Uo=this.Uo,t.Wo=this.Wo,t.Ki=this.Ki,t.eq=this.eq;var e=t.ym((function(t){return t instanceof Pc}));t.Sa=e instanceof Pc?e:null,null!==this.kc?(t.kc=this.kc.copy(),t.kc.group=t):(null!==t.kc&&(t.kc.group=null),t.kc=null)},i=bc.prototype,i.yf=function(t){ec.prototype.yf.call(this,t);var e=t.yk();for(t=t.memberParts;t.next();){var i=t.value;if(i.o(),i.B(8),i.nk(),i instanceof ec)i.sd(e);else if(i instanceof Nc)for(i=i.labelNodes;i.next();)i.value.sd(e)}},i.Sk=function(t,e,i,n,o,r,s){if(t===Ni&&"elements"===e){if(o instanceof Pc)null===this.Sa?this.Sa=o:this.Sa!==o&&w("Cannot insert a second Placeholder into the visual tree of a Group.");else if(o instanceof Uh){var a=o.ym((function(t){return t instanceof Pc}));a instanceof Pc&&(null===this.Sa?this.Sa=a:this.Sa!==a&&w("Cannot insert a second Placeholder into the visual tree of a Group."))}}else t===Ci&&"elements"===e&&null!==this.Sa&&(n===this.Sa||n instanceof Uh&&this.Sa.Gg(n))&&(this.Sa=null);ec.prototype.Sk.call(this,t,e,i,n,o,r,s)},i.Im=function(t,e){ec.prototype.Im.call(this,t,e),this.isClipping&&this.type!==Uh.Spot&&(t=this.resizeObject,t instanceof Uh&&(t=t.tb()),null===this.Za&&(this.Za=new zt),t.mj(this.Za),t instanceof Nl&&this.Za.Jc(-t.strokeWidth,-t.strokeWidth))},i.Ih=function(t,e,i,n){this.cf=this.Sa,ec.prototype.Ih.call(this,t,e,i,n)},i.Ta=function(){var t=this;t.isSubGraphExpanded&&this.memberParts.each((function(e){!t.computesBoundsIncludingLinks&&e instanceof Nc||e.Ta()})),ec.prototype.Ta.call(this)},i.rj=function(){if(!ec.prototype.rj.call(this))return!1;for(var t=this.memberParts;t.next();){var e=t.value;if(e instanceof ec){if(e.isVisible()&&Oa(e))return!1}else if(e instanceof Nc&&e.isVisible()&&Oa(e)&&e.fromNode!==this&&e.toNode!==this)return!1}return!0},i.uk=function(){if(0<this.Vo.count){var t=this.diagram;if(null!==t)for(var e=this.Vo.copy().iterator;e.next();)t.remove(e.value)}ec.prototype.uk.call(this)},bc.prototype.canAddMembers=function(t){var e=this.diagram;if(null===e)return!1;for(e=e.commandHandler,t=ua(t).iterator;t.next();)if(!e.isValidMember(this,t.value))return!1;return!0},bc.prototype.addMembers=function(t,e){var i=this.diagram;if(null===i)return!1;i=i.commandHandler;var n=!0;for(t=ua(t).iterator;t.next();){var o=t.value;!e||i.isValidMember(this,o)?o.containingGroup=this:n=!1}return n},bc.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var t=this.layer;return!(null!==t&&!t.allowUngroup)&&(t=t.diagram,!(null!==t&&!t.allowUngroup))},i=bc.prototype,i.sd=function(t){void 0===t&&(t=null);var e=0!==(65536&this.P);if(ec.prototype.sd.call(this,t),!e)for(0!==(65536&this.P)!==!0&&(this.P=65536^this.P),e=this.Rv();e.next();){var i=e.value;if(null===t||!t.contains(i)){var n=i.fromNode;null!==n&&n!==this&&n.Kd(this)&&!n.isVisible()?(rc(i.fromPort),rc(i.toPort),i.Ua()):(n=i.toNode,null!==n&&n!==this&&n.Kd(this)&&!n.isVisible()&&(rc(i.fromPort),rc(i.toPort),i.Ua()))}}},i.Rv=function(){var t=this.yk();t.add(this);for(var e=new nt,i=t.iterator;i.next();){var n=i.value;if(n instanceof ec)for(n=n.linksConnected;n.next();){var o=n.value;t.contains(o)||e.add(o)}}return e.iterator},i.Wz=function(){var t=this.yk();t.add(this);for(var e=new nt,i=t.iterator;i.next();){var n=i.value;if(n instanceof ec)for(n=n.linksConnected;n.next();){var o=n.value,r=o.fromNode;null===r||t.contains(r)&&r!==this||e.add(r),o=o.toNode,null===o||t.contains(o)&&o!==this||e.add(o)}}return e.iterator},i.Vz=function(){function t(e,i){null!==e&&(i.add(e),t(e.containingGroup,i))}var e=new nt;return t(this,e),e},i.yk=function(){var t=new nt;return Ju(t,this,!0,0,!0),t.remove(this),t},i.Ob=function(t){ec.prototype.Ob.call(this,t);for(var e=this.memberParts;e.next();)e.value.Ob(t)},bc.prototype.collapseSubGraph=function(){var t=this.diagram;if(null!==t&&!t.Le){t.Le=!0;var e=this.yk();Mc(this,e,t,this),t.Le=!1}},bc.prototype.expandSubGraph=function(){var t=this.diagram;if(null!==t&&!t.Le){t.Le=!0;var e=this.yk();Sc(this,e,t,this),t.Le=!1}},bc.prototype.move=function(t,e){void 0===e&&(e=!1);var i=e?this.location:this.position,n=i.x;i=i.y;var o=t.x,r=t.y;if(!(n===o||isNaN(n)&&isNaN(o))||!(i===r||isNaN(i)&&isNaN(r))){for(n=o-(isNaN(n)?0:n),i=r-(isNaN(i)?0:i),r=pt.alloc(),ec.prototype.move.call(this,t,e),t=new nt,e=this.yk().iterator;e.next();)o=e.value,o instanceof Nc&&(o.suspendsRouting&&t.add(o),o.ud||o.fromNode!==this&&o.toNode!==this)&&(o.suspendsRouting=!0);for(e.reset();e.next();)if(o=e.value,!(o.Ph()||o instanceof ec&&o.isLinkLabel)){var s=o.position,a=o.location;s.s()?(r.x=s.x+n,r.y=s.y+i,o.position=r):a.s()&&(r.x=a.x+n,r.y=a.y+i,o.location=r)}for(e.reset();e.next();)o=e.value,o instanceof Nc&&(o.suspendsRouting=t.contains(o),o.ud||o.fromNode!==this&&o.toNode!==this)&&(s=o.position,r.x=s.x+n,r.y=s.y+i,r.s()?o.move(r):o.Ua(),Bc(o)&&o.Ua());pt.free(r)}},d.Object.defineProperties(bc.prototype,{placeholder:{get:function(){return this.Sa}},computesBoundsAfterDrag:{get:function(){return 0!==(2048&this.P)},set:function(t){var e=0!==(2048&this.P);e!==t&&(this.P^=2048,this.g("computesBoundsAfterDrag",e,t))}},computesBoundsIncludingLinks:{get:function(){return 0!==(4096&this.P)},set:function(t){var e=0!==(4096&this.P);e!==t&&(this.P^=4096,this.g("computesBoundsIncludingLinks",e,t))}},computesBoundsIncludingLocation:{get:function(){return 0!==(8192&this.P)},set:function(t){var e=0!==(8192&this.P);e!==t&&(this.P^=8192,this.g("computesBoundsIncludingLocation",e,t))}},handlesDragDropForMembers:{get:function(){return 0!==(16384&this.P)},set:function(t){var e=0!==(16384&this.P);e!==t&&(this.P^=16384,this.g("handlesDragDropForMembers",e,t))}},memberParts:{get:function(){return this.Vo.iterator}},layout:{get:function(){return this.kc},set:function(t){var e=this.kc;if(e!==t){null!==e&&(e.diagram=null,e.group=null),this.kc=t;var i=this.diagram;null!==t&&(t.diagram=i,t.group=this),null!==i&&(i.Ng=!0),this.g("layout",e,t),null!==i&&i.Db()}}},memberAdded:{get:function(){return this.Uo},set:function(t){var e=this.Uo;e!==t&&(this.Uo=t,this.g("memberAdded",e,t))}},memberRemoved:{get:function(){return this.Wo},set:function(t){var e=this.Wo;e!==t&&(this.Wo=t,this.g("memberRemoved",e,t))}},memberValidation:{get:function(){return this.Ki},set:function(t){var e=this.Ki;e!==t&&(this.Ki=t,this.g("memberValidation",e,t))}},ungroupable:{get:function(){return 0!==(256&this.P)},set:function(t){var e=0!==(256&this.P);e!==t&&(this.P^=256,this.g("ungroupable",e,t))}},isSubGraphExpanded:{get:function(){return 0!==(512&this.P)},set:function(t){var e=0!==(512&this.P);if(e!==t){this.P^=512;var i=this.diagram;if(this.g("isSubGraphExpanded",e,t),e=this.subGraphExpandedChanged,null!==e){var n=!0;null!==i&&(n=i.Z,i.Z=!0),e(this),null!==i&&(i.Z=n)}null!==i&&i.undoManager.isUndoingRedoing?(null!==this.Sa&&this.Sa.o(),this.memberParts.each((function(t){t.updateAdornments()}))):t?this.expandSubGraph():this.collapseSubGraph()}}},wasSubGraphExpanded:{get:function(){return 0!==(1024&this.P)},set:function(t){var e=0!==(1024&this.P);e!==t&&(this.P^=1024,this.g("wasSubGraphExpanded",e,t))}},subGraphExpandedChanged:{get:function(){return this.eq},set:function(t){var e=this.eq;e!==t&&(this.eq=t,this.g("subGraphExpandedChanged",e,t))}},Rh:{get:function(){return 0!==(32768&this.P)},set:function(t){0!==(32768&this.P)!==t&&(this.P^=32768)}}}),bc.prototype.expandSubGraph=bc.prototype.expandSubGraph,bc.prototype.collapseSubGraph=bc.prototype.collapseSubGraph,bc.prototype.findSubGraphParts=bc.prototype.yk,bc.prototype.findContainingGroupChain=bc.prototype.Vz,bc.prototype.findExternalNodesConnected=bc.prototype.Wz,bc.prototype.findExternalLinksConnected=bc.prototype.Rv,bc.prototype.ensureBounds=bc.prototype.Ta,bc.className="Group",f(Pc,ca),Pc.prototype.cloneProtected=function(t){ca.prototype.cloneProtected.call(this,t),t.ib=this.ib.H(),t.Np=this.Np.copy()},Pc.prototype.Kh=function(t){if(null===this.background&&null===this.areaBackground)return!1;var e=this.naturalBounds;return _t(0,0,e.width,e.height,t.x,t.y)},Pc.prototype.Hm=function(){var t=this.part;if(null!==t&&(t instanceof bc||t instanceof Qu)||w("Placeholder is not inside a Group or Adornment."),t instanceof bc){var e=this.computeBorder(this.Np),i=this.minSize,n=this.rc;for(Vt(n,(isFinite(i.width)?Math.max(i.width,e.width):e.width)||0,(isFinite(i.height)?Math.max(i.height,e.height):e.height)||0),pa(this,0,0,n.width,n.height),n=t.memberParts,i=!1;n.next();)if(n.value.isVisible()){i=!0;break}n=t.diagram,!i||null===n||n.animationManager.ew(t)||isNaN(e.x)||isNaN(e.y)||(i=pt.alloc(),i.tj(e,t.locationSpot),i.w(t.location)||(t.location=new pt(i.x,i.y)),pt.free(i))}else{e=this.rc,i=this.ib,n=i.left+i.right;var o=i.top+i.bottom,r=t.adornedObject;t.angle=r.lj();var s=0;r instanceof Nl&&(s=r.strokeWidth);var a=r.Af(),h=r.naturalBounds,l=(h.width+s)*a;s=(h.height+s)*a,t.type!==Uh.Link&&(r=r.da("Selection"===t.category?ne:t.locationSpot,pt.alloc()),t.location=r,pt.free(r)),isNaN(l)||isNaN(s)?(t=t.adornedObject,l=t.da(ne,pt.alloc()),r=zt.allocAt(l.x,l.y,0,0),r.Oe(t.da(ce,l)),r.Oe(t.da(re,l)),r.Oe(t.da(le,l)),Vt(e,r.width+n||0,r.height+o||0),pa(this,-i.left,-i.top,e.width,e.height),pt.free(l),zt.free(r)):(Vt(e,l+n||0,s+o||0),pa(this,-i.left,-i.top,e.width,e.height))}},Pc.prototype.Ih=function(t,e,i,n){this.actualBounds.h(t,e,i,n)},Pc.prototype.computeBorder=function(t){var e=this.part,i=e.diagram;if(null!==i&&e instanceof bc&&!e.layer.isTemporary&&e.computesBoundsAfterDrag&&this.Np.s()){var n=i.toolManager.findTool("Dragging");if(n===i.currentTool&&(i=n.computeBorder(e,this.Np,t),null!==i))return i}i=zt.alloc(),n=this.computeMemberBounds(i);var o=this.ib;return e instanceof bc&&!e.isSubGraphExpanded?t.h(n.x-o.left,n.y-o.top,0,0):t.h(n.x-o.left,n.y-o.top,Math.max(n.width+o.left+o.right,0),Math.max(n.height+o.top+o.bottom,0)),zt.free(i),e instanceof bc&&e.computesBoundsIncludingLocation&&e.location.s()&&t.Oe(e.location),t},Pc.prototype.computeMemberBounds=function(t){if(!(this.part instanceof bc))return t.h(0,0,0,0),t;for(var e=this.part,i=1/0,n=1/0,o=-1/0,r=-1/0,s=e.memberParts;s.next();){var a=s.value;if(a.isVisible()){if(a instanceof Nc){if(!e.computesBoundsIncludingLinks)continue;if(La(a))continue;if(a.fromNode===e||a.toNode===e)continue}a=a.actualBounds,a.left<i&&(i=a.left),a.top<n&&(n=a.top),a.right>o&&(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},d.Object.defineProperties(Pc.prototype,{padding:{get:function(){return this.ib},set:function(t){"number"===typeof t&&(t=new Qt(t));var e=this.ib;e.w(t)||(this.ib=t=t.H(),this.g("padding",e,t),this.o())}}}),Pc.className="Placeholder",f(Nc,Lu),Nc.prototype.cloneProtected=function(t){Lu.prototype.cloneProtected.call(this,t),t.Ga=-113&this.Ga,t.Xe=this.Xe,t.fo=this.fo,t.sf=this.sf,t.mq=this.mq,t.Yk=this.Yk,t.Hn=this.Hn,t.Jn=this.Jn,t.Kn=this.Kn,t.ck=this.ck,t.Zp=this.Zp,null!==this.O&&(t.O=this.O.copy())},i=Nc.prototype,i.yf=function(t){Lu.prototype.yf.call(this,t),this.Xe=t.Xe,this.sf=t.sf,t.ph=null,t.Ua(),t.Mf=this.Mf;var e=t.fromPort;null!==e&&rc(e),t=t.toPort,null!==t&&rc(t)},i.jb=function(t){t.classType===Nc?2===(2&t.value)?this.routing=t:t===ef||t===nf||t===of?this.curve=t:t===rf||t===sf||t===af?this.adjusting=t:t!==$c&&t!==tf&&w("Unknown Link enum value for a Link property: "+t):Lu.prototype.jb.call(this,t)},i.Kc=function(){null===this.O&&(this.O=new Rf)},i.rj=function(){var t=this.fromNode;if(null!==t){var e=t.findVisibleNode();if(null!==e&&(t=e),Oa(t)||Yu(t))return!1}return t=this.toNode,null===t||(e=t.findVisibleNode(),null!==e&&(t=e),!Oa(t)&&!Yu(t))},i.Ew=function(){return!1},i.lu=function(){},i.Nc=function(){return!1},Nc.prototype.computeAngle=function(t,e,i){return Nc.computeAngle(e,i)},Nc.computeAngle=function(t,e){switch(t){default:case tf:t=0;break;case hf:t=e;break;case lf:t=e+90;break;case uf:t=e-90;break;case cf:t=e+180;break;case ff:t=_e.Tq(e),90<t&&270>t&&(t-=180);break;case df:t=_e.Tq(e+90),90<t&&270>t&&(t-=180);break;case pf:t=_e.Tq(e-90),90<t&&270>t&&(t-=180);break;case gf:if(t=_e.Tq(e),45<t&&135>t||225<t&&315>t)return 0;90<t&&270>t&&(t-=180)}return _e.Tq(t)},i=Nc.prototype,i.Oh=function(){var t=this.containingGroup;null!==t&&this.fromNode!==t&&this.toNode!==t&&t.computesBoundsIncludingLinks&&Lu.prototype.Oh.call(this)},i.Kq=function(t){var e=this.fromNode;return t===e?this.toNode:e},i.nA=function(t){var e=this.fromPort;return t===e?this.toPort:e},i.Mq=function(t){if(Lu.prototype.Mq.call(this,t),Xc(this)&&this.Oq(this.actualBounds),!t){t=this.We;var e=null;null!==t&&(e=this.fromPort,ac(t,this,e));var i=this.rf;if(null!==i){var n=this.toPort;i===t&&n===e||ac(i,this,n)}Kc(this)}},i.Nq=function(t){if(Lu.prototype.Nq.call(this,t),Xc(this)&&this.Oq(this.actualBounds),!t){t=this.We;var e=null;null!==t&&(e=this.fromPort,hc(t,this,e));var i=this.rf;if(null!==i){var n=this.toPort;i===t&&n===e||hc(i,this,n)}Hc(this)}},i.uk=function(){if(this.ud=!0,null!==this.nd){var t=this.diagram;if(null!==t)for(var e=this.nd.copy().iterator;e.next();)t.remove(e.value)}null!==this.data&&(t=this.diagram,null!==t&&t.partManager.removeDataForLink(this))},Nc.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var t=this.diagram;null!==t&&t.partManager.updateRelationshipsFromData(this)}},Nc.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?Lu.prototype.move.call(this,t,!1):(t=pt.allocAt(i.x+n,i.y+o),Lu.prototype.move.call(this,t,!1),pt.free(t)),Ac(this,n,o),t=this.labelNodes;t.next();)e=t.value,i=e.position,e.moveTo(i.x+n,i.y+o)},Nc.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var t=this.layer;return null===t||!!t.allowRelink&&(t=t.diagram,!(null!==t&&!t.allowRelink))},Nc.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var t=this.layer;return null===t||!!t.allowRelink&&(t=t.diagram,!(null!==t&&!t.allowRelink))},Nc.prototype.computeMidPoint=function(t){var e=this.pointsCount;if(0===e)return t.assign(Dt),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()===ef))return this.na.Xv(.5,t),t.add(this.i(0)),i=this.na.figures.first(),t.offset(-i.startX,-i.startY),t;if(this.computeCurve()===ef){if(3===e)return this.i(1);if(n=(e-1)/3|0,i=3*(n/2|0),1===n%2){n=this.i(i);var o=this.i(i+1),r=this.i(i+2);i=this.i(i+3),_e.yz(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;n<i/2&&r<e;){if(o=s[r],n+o>i/2)break;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},Nc.prototype.computeMidAngle=function(){var t=this.pointsCount;if(2>t)return NaN;if(2===t)return this.i(0).Pa(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===ef))return this.na.vy(.5);if(this.computeCurve()===ef&&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),_e.xz(t.x,t.y,e.x,e.y,n.x,n.y,i.x,i.y)}if(0<i&&i+1<t)return this.i(i-1).Pa(this.i(i+1))}e=this.flattenedLengths,n=this.flattenedTotalLength;var o,r=0;for(i=0;r<n/2&&i<t;){if(o=e[i],r+o>n/2)break;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(0<i&&i+2<t)return this.i(i-1).Pa(this.i(i+2))}else{if(1>Math.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.Pa(n)},i=Nc.prototype,i.i=function(t){return this.Ab.j[t]},i.Qc=function(t,e){this.Ab.Pc(t,e)},i.L=function(t,e,i){this.Ab.Pc(t,new pt(e,i))},i.wA=function(t,e){this.Ab.wb(t,e)},i.m=function(t,e,i){this.Ab.wb(t,new pt(e,i))},i.ce=function(t){this.Ab.add(t)},i.vf=function(t,e){this.Ab.add(new pt(t,e))},i.uw=function(t){this.Ab.cb(t)},i.pk=function(){this.Ab.clear()},i.Th=function(){null===this.ph&&(this.ph=this.Ab,this.Ab=this.Ab.copy())},i.xf=function(){if(null!==this.ph){for(var t=this.ph,e=this.Ab,i=1/0,n=1/0,o=t.j,r=o.length,s=0;s<r;s++){var a=o[s];i=Math.min(a.x,i),n=Math.min(a.y,n)}a=s=1/0;for(var h=e.j,l=h.length,u=0;u<l;u++){var c=h[u];s=Math.min(c.x,s),a=Math.min(c.y,a),c.freeze()}if(e.freeze(),l===r){for(r=0;r<l;r++)if(u=o[r],c=h[r],u.x-i!==c.x-s||u.y-n!==c.y-a){this.dc();break}}else this.dc();this.ph=null,i=this.diagram,null!==i&&i.animationManager.sc&&(i=i.animationManager,this.jf=e,i.$l.add(this)),Lc(this),this.g("points",t,e)}},i.yw=function(){null!==this.ph&&(this.Ab=this.ph,this.ph=null)},i.Ua=function(){if(!this.suspendsRouting){var t=this.diagram;if(t){if(t.Yt.contains(this)||t.undoManager.isUndoingRedoing)return;if(t=t.animationManager,t.isTicking&&!t.isAnimating)return;null!==this.jf&&!t.isTicking&&t.isAnimating&&(this.jf=null)}t=this.path,null!==t&&(this.ud=!1,this.o(),t.o())}},i.xj=function(){if(!this.ud&&!this.Ct){var t=!0;try{this.Ct=!0,this.Th(),t=this.computePoints()}catch(e){this.Ct=!1,this.yw()}finally{this.Ct=!1,t?this.xf():this.yw()}}},Nc.prototype.computePoints=function(){if(null===this.diagram)return!1;var t=this.fromNode,e=null;if(null===t?(_c||(_c=new ec,_c.desiredSize=kt,_c.Ta()),this.defaultFromPoint&&(_c.location=this.defaultFromPoint,_c.Ta(),e=t=_c)):e=this.fromPort,null!==e&&!t.isVisible()){var i=t.findVisibleNode();null!==i&&i!==t?(t=i,e=i.port):t=i}if(this.Mx=t,null===t||!t.location.s())return!1;for(;!(null===e||e.actualBounds.s()&&e.Gf());)e=e.panel;if(null===e)return!1;var n=this.toNode,o=null;if(null===n?(Wc||(Wc=new ec,Wc.desiredSize=kt,Wc.Ta()),this.defaultToPoint&&(Wc.location=this.defaultToPoint,Wc.Ta(),o=n=Wc)):o=this.toPort,null===o||n.isVisible()||(i=n.findVisibleNode(),null!==i&&i!==n?(n=i,o=i.port):n=i),this.Nx=n,null===n||!n.location.s())return!1;for(;!(null===o||o.actualBounds.s()&&o.Gf());)o=o.panel;if(null===o)return!1;var r=this.pointsCount,s=this.computeSpot(!0,e);i=this.computeSpot(!1,o);var a=Dc(s),h=Dc(i),l=e===o&&null!==e,u=this.isOrthogonal,c=this.curve===ef;this.Vf=!(!l||u)&&(c=!0);var f=this.computeAdjusting()===tf||l;if(!u&&!l&&a&&h){if(a=!1,!f&&3<=r&&(f=this.getLinkPoint(t,e,s,!0,!1,n,o),h=this.getLinkPoint(n,o,i,!1,!1,t,e),a=this.adjustPoints(0,f,r-1,h))&&(f=this.getLinkPoint(t,e,s,!0,!1,n,o),h=this.getLinkPoint(n,o,i,!1,!1,t,e),this.adjustPoints(0,f,r-1,h)),!a)if(this.pk(),c){r=this.getLinkPoint(t,e,s,!0,!1,n,o),f=this.getLinkPoint(n,o,i,!1,!1,t,e),a=f.x-r.x,h=f.y-r.y,l=this.computeCurviness(),c=u=0;var d=r.x+a/3,p=r.y+h/3,g=d,y=p;_e.A(h,0)?y=0<a?y-l:y+l:(u=-a/h,c=Math.sqrt(l*l/(u*u+1)),0>l&&(c=-c),g=(0>h?-1:1)*c+d,y=u*(g-d)+p),d=r.x+2*a/3,p=r.y+2*h/3;var m=d,v=p;_e.A(h,0)?v=0<a?v-l:v+l:(m=(0>h?-1:1)*c+d,v=u*(m-d)+p),this.pk(),this.ce(r),this.vf(g,y),this.vf(m,v),this.ce(f),this.Qc(0,this.getLinkPoint(t,e,s,!0,!1,n,o)),this.Qc(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(),t=n.x+f/2,e=n.y+i/2,r=t,a=e,_e.A(i,0)?a=0<f?a-s:a+s:(f=-f/i,r=Math.sqrt(s*s/(f*f+1)),0>s&&(r=-r),r=(0>i?-1:1)*r+t,a=f*(r-t)+e),this.ce(n),this.vf(r,a),this.ce(o)):(this.ce(n),this.ce(o),a=zt.alloc(),e.mj(a),h=a.$(o),f.mj(a),l=a.$(n),(h||l)&&(s=e.da(Fc(s),new pt),this.Qc(0,this.getLinkPointFromPoint(t,e,s,o,!0,s)),i=f.da(Fc(i),new pt),this.Qc(1,this.getLinkPointFromPoint(r,f,i,n,!1,i))),zt.free(a))}else{c=this.isAvoiding,f&&(u&&c||l)&&this.pk();var x=l?this.computeCurviness():0;c=this.getLinkPoint(t,e,s,!0,u,n,o),d=g=p=0,(u||!a||l)&&(y=this.computeEndSegmentLength(t,e,s,!0),d=this.getLinkDirection(t,e,c,s,!0,u,n,o),l&&(a||s.w(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&&(y+=Math.abs(x)*(u?1:2)),0===d?p=y:90===d?g=y:180===d?p=-y:270===d?g=-y:(p=y*Math.cos(d*Math.PI/180),g=y*Math.sin(d*Math.PI/180)),s.nc()&&l&&(y=e.da(ae,pt.alloc()),m=pt.allocAt(y.x+1e3*p,y.y+1e3*g),this.getLinkPointFromPoint(t,e,y,m,!0,c),pt.free(y),pt.free(m))),y=this.getLinkPoint(n,o,i,!1,u,t,e);var b=v=m=0;if(u||!h||l){var w=this.computeEndSegmentLength(n,o,i,!1);b=this.getLinkDirection(n,o,y,i,!1,u,t,e),l&&(h||s.w(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?m=w:90===b?v=w:180===b?m=-w:270===b?v=-w:(m=w*Math.cos(b*Math.PI/180),v=w*Math.sin(b*Math.PI/180)),i.nc()&&l&&(i=o.da(ae,pt.alloc()),s=pt.allocAt(i.x+1e3*m,i.y+1e3*v),this.getLinkPointFromPoint(n,o,i,s,!1,y),pt.free(i),pt.free(s))}i=c,(u||!a||l)&&(i=new pt(c.x+p,c.y+g)),s=y,(u||!h||l)&&(s=new pt(y.x+m,y.y+v)),!f&&!u&&a&&3<r&&this.adjustPoints(0,c,r-2,s)?this.Qc(r-1,y):!f&&!u&&h&&3<r&&this.adjustPoints(1,i,r-1,y)?this.Qc(0,c):!f&&(u?6<=r:4<r)&&this.adjustPoints(1,i,r-2,s)?(this.Qc(0,c),this.Qc(r-1,y)):(this.pk(),this.ce(c),(u||!a||l)&&this.ce(i),u&&this.addOrthoPoints(i,d,s,b,t,n),(u||!h||l)&&this.ce(s),this.ce(y))}return!0},Nc.prototype.getLinkPointFromPoint=function(t,e,i,n,o,r){if(void 0===r&&(r=new pt),null===t||null===e)return r.assign(i),r;if(t.isVisible()||(o=t.findVisibleNode(),null!==o&&o!==t&&(e=o.port)),t=null,o=e.panel,null===o||o.he()||(o=o.panel),null===o){o=n.x,n=n.y;var s=i.x;i=i.y}else{t=o.Fd,o=1/(t.m11*t.m22-t.m12*t.m21),s=t.m22*o;var a=-t.m12*o,h=-t.m21*o,l=t.m11*o,u=o*(t.m21*t.dy-t.m22*t.dx),c=o*(t.m12*t.dx-t.m11*t.dy);o=n.x*s+n.y*h+u,n=n.x*a+n.y*l+c,s=i.x*s+i.y*h+u,i=i.x*a+i.y*l+c}return e.zk(o,n,s,i,r),null!==t&&r.transform(t),r},Nc.prototype.getLinkPoint=function(t,e,i,n,o,r,s,a){if(void 0===a&&(a=new pt),i.kb()&&!Dc(i))return e.da(i,a),a;if(i.Oc()){var h=Oc(this,e);if(null!==h){if(a.assign(h.Qq),o&&this.routing===Qc){var l=Oc(this,s);if(null!==l&&h.wm<l.wm){h=pt.alloc(),l=pt.alloc();var u=new zt(e.da(ne,h),e.da(ce,l)),c=this.computeSpot(!n,s);t=this.getLinkPoint(r,s,c,!n,o,t,e,l),(i.Ef(de)||i.Ef(pe))&&t.y>=u.y&&t.y<=u.y+u.height?a.y=t.y:(i.Ef(fe)||i.Ef(ge))&&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.da(Fc(i),pt.alloc()),this.pointsCount>(o?6:2)?(s=n?this.i(1):this.i(this.pointsCount-2),o&&(s=jc(i,s.copy()))):(h=this.computeSpot(!n,s),r=pt.alloc(),s=s.da(Fc(h),r),o&&(s=jc(i,s)),pt.free(r)),this.getLinkPointFromPoint(t,e,i,s,n,a),pt.free(i),a},Nc.prototype.getLinkDirection=function(t,e,i,n,o,r,s,a){t:if(n.kb())var h=n.x>n.y?n.x>1-n.y?0:n.x<1-n.y?270:315:n.x<n.y?n.x>1-n.y?90:n.x<1-n.y?180:135:.5>n.x?225:.5<n.x?45:0;else{if(n.Oc()&&(h=Oc(this,e),null!==h))switch(h.Ac){case 1:h=270;break t;case 2:h=180;break t;default:case 4:h=0;break t;case 8:h=90;break t}h=e.da(ae,pt.alloc()),this.pointsCount>(r?6:2)?(a=o?this.i(1):this.i(this.pointsCount-2),a=r?jc(h,a.copy()):i):(i=pt.alloc(),a=a.da(ae,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.nc()&&s.Kd(t)&&(h+=180,360<=h&&(h-=360)),Dc(n)?h:(t=e.lj(),0===t||(45<=t&&135>t?h+=90:135<=t&&225>t?h+=180:225<=t&&315>t&&(h+=270),360<=h&&(h-=360)),h)},Nc.prototype.computeEndSegmentLength=function(t,e,i,n){return null!==e&&i.Oc()&&(t=Oc(this,e),null!==t)?t.Pv:(t=n?this.fromEndSegmentLength:this.toEndSegmentLength,null!==e&&isNaN(t)&&(t=n?e.fromEndSegmentLength:e.toEndSegmentLength),isNaN(t)&&(t=10),t)},Nc.prototype.computeSpot=function(t,e){return void 0===e&&(e=null),t?(t=e||this.fromPort,null===t?t=ae:(e=this.fromSpot,e.Mb()&&(e=t.fromSpot),t=e===Ce?ie:e)):(t=e||this.toPort,null===t?t=ae:(e=this.toSpot,e.Mb()&&(e=t.toSpot),t=e===Ce?ie:e)),t},Nc.prototype.computeOtherPoint=function(t,e){return this.computeAdjusting()!==tf&&4<this.pointsCount?this.computeMidPoint(new pt):(t=e.yp,t=null!==t?If(t,this):null,null!==t?t.Qq:e.da(ae))},Nc.prototype.computeShortLength=function(t){if(t){if(t=this.fromShortLength,isNaN(t)){var e=this.fromPort;null!==e&&(t=e.fromShortLength)}return isNaN(t)?0:t}return t=this.toShortLength,isNaN(t)&&(e=this.toPort,null!==e&&(t=e.toShortLength)),isNaN(t)?0:t},Nc.prototype.zf=function(t,e,i,n,o,r){if(!1===this.pickable)return!1;void 0===e&&(e=null),void 0===i&&(i=null);var s=r;if(void 0===r&&(s=Ke.alloc(),s.reset()),s.multiply(this.transform),this.Jh(t,s))return nl(this,e,i,o),void 0===r&&Ke.free(s),!0;if(this.Mc(t,s)){var a=!1;if(!this.isAtomic)for(var h=this.W.j,l=h.length;l--;){var u=h[l];if(u.visible||u===this.locationObject){var c=u.actualBounds,f=this.naturalBounds;if(!(c.x>f.width||c.y>f.height||0>c.x+c.width||0>c.y+c.height)){if(c=Ke.alloc(),c.set(s),u instanceof Uh)a=u.zf(t,e,i,n,o,c);else if(this.path===u){if(u instanceof Nl)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.Jh(d,p))a=!0;else{if(void 0===p&&(p=u.transform,d.Ge(u.actualBounds))){a=!0;break t}a=d.left,f=d.right;var g=d.top;d=d.bottom;var y=pt.alloc(),m=pt.alloc(),v=pt.alloc(),x=Ke.alloc();x.set(p),x.jw(u.transform),x.St(),m.x=f,m.y=g,m.transform(x),y.x=a,y.y=g,y.transform(x),p=!1,jl(u,y,m,v)?p=!0:(y.x=f,y.y=d,y.transform(x),jl(u,y,m,v)?p=!0:(m.x=a,m.y=d,m.transform(x),jl(u,y,m,v)?p=!0:(y.x=a,y.y=g,y.transform(x),jl(u,y,m,v)&&(p=!0)))),Ke.free(x),pt.free(y),pt.free(m),pt.free(v),a=p}}else a=u.Jh(a,c)}else a=ga(u,t,n,c);a&&(f=u,null!==e&&(f=e(u)),f&&(null===i||i(f))&&o.add(f)),Ke.free(c)}}}return void 0===r&&Ke.free(s),a||null!==this.background||null!==this.areaBackground}return void 0===r&&Ke.free(s),!1},Nc.prototype.computeCurve=function(){if(null===this.Vf){var t=this.fromPort,e=this.isOrthogonal;this.Vf=null!==t&&t===this.toPort&&!e}return this.Vf?ef:this.curve},Nc.prototype.computeCorner=function(){if(this.curve===ef)return 0;var t=this.corner;return(isNaN(t)||0>t)&&(t=10),t},Nc.prototype.findMidLabel=function(){for(var t=this.path,e=this.W.j,i=e.length,n=0;n<i;n++){var o=e[n];if(o!==t&&!o.isPanelMain&&(-1/0===o.segmentIndex||isNaN(o.segmentIndex)))return o}for(t=this.labelNodes;t.next();)if(e=t.value,-1/0===e.segmentIndex||isNaN(e.segmentIndex))return e;return null},Nc.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var t=mf;t=Math.max(t,this.computeThickness());var e=this.fromPort,i=this.toPort;if(null!==e&&null!==i){var n=this.findMidLabel();if(null!==n){var o=n.naturalBounds,r=n.margin,s=isNaN(o.width)?30:o.width*n.scale+r.left+r.right;o=isNaN(o.height)?14:o.height*n.scale+r.top+r.bottom,n=n.segmentOrientation,n===hf||n===ff||n===cf?t=Math.max(t,o):n===uf||n===pf||n===lf||n===df?t=Math.max(t,s):(e=e.da(ae).Pa(i.da(ae))/180*Math.PI,t=Math.max(t,Math.abs(Math.sin(e)*s)+Math.abs(Math.cos(e)*o)+1)),this.curve===ef&&(t*=1.333)}}return t},Nc.prototype.arrangeBundledLinks=function(t,e){if(e)for(e=0;e<t.length;e++){var i=t[e];i.computeAdjusting()===tf&&i.Ua()}},Nc.prototype.computeCurviness=function(){var t=this.curviness;if(isNaN(t)){t=yf;var e=this.Mf;if(null!==e){for(var i=j(),n=0,o=e.links,r=0;r<o.length;r++){var s=o[r].computeSpacing();i.push(s),n+=s}for(n=-n/2,r=0;r<o.length;r++){if(o[r]===this){t=n+i[r]/2;break}n+=i[r]}e.au===this.fromNode&&(t=-t),O(i)}}return t},Nc.prototype.computeThickness=function(){if(!this.isVisible())return 0;var t=this.path;return null!==t?Math.max(t.strokeWidth,1):1},Nc.prototype.hasCurviness=function(){return!isNaN(this.curviness)||null!==this.Mf},Nc.prototype.adjustPoints=function(t,e,i,n){var o=this.computeAdjusting();if(this.isOrthogonal){if(o===sf)return!1;o===af&&(o=rf)}switch(o){case sf:var r=this.i(t),s=this.i(i);if(!r.Qa(e)||!s.Qa(n)){o=r.x,r=r.y;var a=s.x-o,h=s.y-r,l=Math.sqrt(a*a+h*h);if(!_e.aa(l,0)){if(_e.aa(a,0))var u=0>h?-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),_e.aa(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.Qc(t,e),t+=1;t<i;t++)e=this.i(t),a=e.x-o,h=e.y-r,e=Math.sqrt(a*a+h*h),_e.aa(e,0)||(_e.aa(a,0)?h=0>h?-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.Qc(i,n)}}return!0;case af:if(r=this.i(t),c=this.i(i),!r.Qa(e)||!c.Qa(n)){o=r.x,r=r.y,s=c.x,c=c.y,l=(s-o)*(s-o)+(c-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.Qc(t,e),t+=1;t<i;t++){e=this.i(t);var g=e.x,y=e.y,m=.5;0!==l&&(m=((o-g)*(o-s)+(r-y)*(r-c))/l);var v=o+m*(s-o),x=r+m*(c-r);e=Math.sqrt((g-v)*(g-v)+(y-x)*(y-x)),y<p*(g-v)+x&&(e=-e),0<p&&(e=-e),g=a+m*(h-a),m=u+m*(f-u),0!==p?(e=g+e/d,this.L(t,e,m-(e-g)/p)):this.L(t,g,m+e)}this.Qc(i,n)}return!0;case rf:return this.isOrthogonal&&(o=this.i(t),r=this.i(t+1),s=this.i(t+2),a=r.x,u=r.y,c=a,l=u,_e.A(o.y,r.y)?_e.A(r.x,s.x)?u=e.y:_e.A(r.y,s.y)&&(a=e.x):_e.A(o.x,r.x)&&(_e.A(r.y,s.y)?a=e.x:_e.A(r.x,s.x)&&(u=e.y)),this.L(t+1,a,u),o=this.i(i),r=this.i(i-1),s=this.i(i-2),a=r.x,u=r.y,h=a,f=u,_e.A(o.y,r.y)?_e.A(r.x,s.x)?u=n.y:_e.A(r.y,s.y)&&(a=n.x):_e.A(o.x,r.x)&&(_e.A(r.y,s.y)?a=n.x:_e.A(r.x,s.x)&&(u=n.y)),this.L(i-1,a,u),Bc(this))?(this.L(t+1,c,l),this.L(i-1,h,f),i=!1):(this.Qc(t,e),this.Qc(i,n),i=!0),i;default:return!1}},Nc.prototype.addOrthoPoints=function(t,e,i,n,o,r){0>e?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.s()&&h.s()){if(a.Jc(vf,vf),h.Jc(vf,vf),a.Oe(t),h.Oe(i),0===e)if(i.x>t.x||270===n&&i.y<t.y&&h.right>t.x||90===n&&i.y>t.y&&h.right>t.x){var l=new pt(i.x,t.y),u=new pt(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.y<t.y||90===n&&i.y>t.y?(l.x=t.x<h.left?this.computeMidOrthoPosition(t.x,t.y,h.left,i.y,!1):t.x<h.right&&(270===n&&t.y<h.top||90===n&&t.y>h.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.x<h.left&&t.y>h.top&&t.y<h.bottom&&(l.x=t.x,l.y=t.y<i.y?Math.min(i.y,h.top):Math.max(i.y,h.bottom),u.y=l.y)}else l=new pt(t.x,i.y),u=new pt((t.x+i.x)/2,i.y),(180===n||90===n&&i.y<a.top||270===n&&i.y>a.bottom)&&(180===n&&(h.$(t)||a.$(i))?l.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):i.y<t.y&&(180===n||90===n)?l.y=this.computeMidOrthoPosition(t.x,a.top,i.x,Math.max(i.y,h.bottom),!0):i.y>t.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.bottom&&(i.x>=a.left&&i.x<=t.x||t.x<=h.right&&t.x>=i.x?90!==n&&270!==n||(l=new pt(Math.max((t.x+i.x)/2,t.x),t.y),u=new pt(l.x,i.y)):(l.y=270===n||(0===n||180===n)&&i.y<t.y?Math.min(i.y,0===n?a.top:Math.min(a.top,h.top)):Math.max(i.y,0===n?a.bottom:Math.max(a.bottom,h.bottom)),u.x=i.x,u.y=l.y));else 180===e?i.x<t.x||270===n&&i.y<t.y&&h.left<t.x||90===n&&i.y>t.y&&h.left<t.x?(l=new pt(i.x,t.y),u=new pt(i.x,(t.y+i.y)/2),0===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.y<t.y||90===n&&i.y>t.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.y<h.top||90===n&&t.y>h.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.y<h.bottom&&(l.x=t.x,l.y=t.y<i.y?Math.min(i.y,h.top):Math.max(i.y,h.bottom),u.y=l.y)):(l=new pt(t.x,i.y),u=new pt((t.x+i.x)/2,i.y),(0===n||90===n&&i.y<a.top||270===n&&i.y>a.bottom)&&(0===n&&(h.$(t)||a.$(i))?l.y=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!0):i.y<t.y&&(0===n||90===n)?l.y=this.computeMidOrthoPosition(t.x,a.top,i.x,Math.max(i.y,h.bottom),!0):i.y>t.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<a.bottom&&(i.x<=a.right&&i.x>=t.x||t.x>=h.left&&t.x<=i.x?90!==n&&270!==n||(l=new pt(Math.min((t.x+i.x)/2,t.x),t.y),u=new pt(l.x,i.y)):(l.y=270===n||(0===n||180===n)&&i.y<t.y?Math.min(i.y,180===n?a.top:Math.min(a.top,h.top)):Math.max(i.y,180===n?a.bottom:Math.max(a.bottom,h.bottom)),u.x=i.x,u.y=l.y))):90===e?i.y>t.y||180===n&&i.x<t.x&&h.bottom>t.y||0===n&&i.x>t.x&&h.bottom>t.y?(l=new pt(t.x,i.y),u=new pt((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.x<t.x||0===n&&i.x>t.x?(l.y=t.y<h.top?this.computeMidOrthoPosition(t.x,t.y,i.x,h.top,!0):t.y<h.bottom&&(180===n&&t.x<h.left||0===n&&t.x>h.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.y<h.top&&t.x>h.left&&t.x<h.right&&(l.x=t.x<i.x?Math.min(i.x,h.left):Math.max(i.x,h.right),l.y=t.y,u.x=l.x)):(l=new pt(i.x,t.y),u=new pt(i.x,(t.y+i.y)/2),(270===n||0===n&&i.x<a.left||180===n&&i.x>a.right)&&(270===n&&(h.$(t)||a.$(i))?l.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):i.x<t.x&&(270===n||0===n)?l.x=this.computeMidOrthoPosition(a.left,t.y,Math.max(i.x,h.right),i.y,!1):i.x>t.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.right&&(i.y>=a.top&&i.y<=t.y||t.y<=h.bottom&&t.y>=i.y?0!==n&&180!==n||(l=new pt(t.x,Math.max((t.y+i.y)/2,t.y)),u=new pt(i.x,l.y)):(l.x=180===n||(90===n||270===n)&&i.x<t.x?Math.min(i.x,90===n?a.left:Math.min(a.left,h.left)):Math.max(i.x,90===n?a.right:Math.max(a.right,h.right)),u.x=l.x,u.y=i.y))):i.y<t.y||180===n&&i.x<t.x&&h.top<t.y||0===n&&i.x>t.x&&h.top<t.y?(l=new pt(t.x,i.y),u=new pt((t.x+i.x)/2,i.y),90===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.x<t.x||0===n&&i.x>=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.x<h.left||0===n&&t.x>h.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.x<h.right&&(l.x=t.x<i.x?Math.min(i.x,h.left):Math.max(i.x,h.right),l.y=t.y,u.x=l.x)):(l=new pt(i.x,t.y),u=new pt(i.x,(t.y+i.y)/2),(90===n||0===n&&i.x<a.left||180===n&&i.x>a.right)&&(90===n&&(h.$(t)||a.$(i))?l.x=this.computeMidOrthoPosition(t.x,t.y,i.x,i.y,!1):i.x<t.x&&(90===n||0===n)?l.x=this.computeMidOrthoPosition(a.left,t.y,Math.max(i.x,h.right),i.y,!1):i.x>t.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<a.right&&(i.y<=a.bottom&&i.y>=t.y||t.y>=h.top&&t.y<=i.y?0!==n&&180!==n||(l=new pt(t.x,Math.min((t.y+i.y)/2,t.y)),u=new pt(i.x,l.y)):(l.x=180===n||(90===n||270===n)&&i.x<t.x?Math.min(i.x,270===n?a.left:Math.min(a.left,h.left)):Math.max(i.x,270===n?a.right:Math.max(a.right,h.right)),u.x=l.x,u.y=i.y)));var c=l,f=u,d=i;if(this.isAvoiding){var p=this.diagram;if(null===p||o===r||this.layer.isTemporary||!os(p)||a.$(d)&&!r.Kd(o)||h.$(t)&&!o.Kd(r))e=!1;else{var g=rs(p,!0,this.containingGroup,null);if(17!==this.segmentIndex&&g.Ek(Math.min(t.x,c.x),Math.min(t.y,c.y),Math.abs(t.x-c.x),Math.abs(t.y-c.y))&&g.Ek(Math.min(c.x,f.x),Math.min(c.y,f.y),Math.abs(c.x-f.x),Math.abs(c.y-f.y))&&g.Ek(Math.min(f.x,d.x),Math.min(f.y,d.y),Math.abs(f.x-d.x),Math.abs(f.y-d.y)))e=!1;else{o=t,r=d;var y=i=null;if(p.isVirtualized){p=g.bounds.copy(),p.Jc(-g.zq,-g.yq);var m=pt.alloc();wf(g,t.x,t.y)||(_e.Cf(p.x,p.y,p.x+p.width,p.y+p.height,t.x,t.y,c.x,c.y,m)?(i=t=m.copy(),e=m.Pa(c)):_e.Cf(p.x,p.y,p.x+p.width,p.y+p.height,c.x,c.y,f.x,f.y,m)?(i=t=m.copy(),e=m.Pa(f)):_e.Cf(p.x,p.y,p.x+p.width,p.y+p.height,f.x,f.y,d.x,d.y,m)&&(i=t=m.copy(),e=m.Pa(d))),wf(g,d.x,d.y)||(_e.Cf(p.x,p.y,p.x+p.width,p.y+p.height,d.x,d.y,f.x,f.y,m)?(y=d=m.copy(),n=f.Pa(m)):_e.Cf(p.x,p.y,p.x+p.width,p.y+p.height,f.x,f.y,c.x,c.y,m)?(y=d=m.copy(),n=c.Pa(m)):_e.Cf(p.x,p.y,p.x+p.width,p.y+p.height,c.x,c.y,t.x,t.y,m)&&(y=d=m.copy(),n=t.Pa(m))),pt.free(m)}a=a.copy().Rc(h),a.Jc(g.zq*g.Wy,g.yq*g.Wy),Cf(g,t,e,d,n,a,!0),h=kf(g,d.x,d.y),!g.abort&&h>=jf&&(Mf(g),a.Jc(g.zq*g.Gy,g.yq*g.Gy),Cf(g,t,e,d,n,a,!1),h=kf(g,d.x,d.y)),!g.abort&&h<jf&&kf(g,d.x,d.y)!==Af?(Ic(this,g,d.x,d.y,n,!0,s),a=this.i(2),4>this.pointsCount?(0===e||180===e?(a.x=t.x,a.y=d.y):(a.x=d.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?_e.A(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)):_e.A(a.y,s.y)?(Math.abs(t.y-a.y)<=g.yq/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||(_e.A(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)):_e.A(a.x,s.x)?(Math.abs(t.x-a.x)<=g.zq/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!==y&&(0===n||180===n?this.vf(r.x,y.y):this.vf(y.x,r.y)),e=!0):e=!1}}}else e=!1;e||(this.ce(l),this.ce(u))}},Nc.prototype.computeMidOrthoPosition=function(t,e,i,n,o){var r=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).Oc()||this.computeSpot(!1,this.toPort).Oc()||(r=this.computeCurviness()),o?(e+n)/2+r:(t+i)/2+r},Nc.prototype.Sz=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;s<this.pointsCount-1;s++){i=this.i(s+1);var a=xt(e,t,n.x,n.y,i.x,i.y);n=i,a<o&&(r=s,o=a)}return r},Nc.prototype.dc=function(){this.$m=!1,this.o()},Nc.prototype.Gk=function(t){if(!t){if(!1===this.ud)return;if(t=this.tb(),this.$m&&(null===t||null!==t.geometry))return}if(this.na=this.makeGeometry(),t=this.path,null!==t){t.na=this.na;for(var e=this.W.j,i=e.length,n=0;n<i;n++){var o=e[n];o!==t&&o.isPanelMain&&o instanceof Nl&&(o.na=this.na)}}},Nc.prototype.makeGeometry=function(){var t=this.na,e=this.pointsCount;if(2>e)return t.type=si,this.$m=!0,t;var i=!1,n=this.diagram;null!==n&&Xc(this)&&n.Vg.contains(this)&&(0!==this.Yl.width||0!==this.Yl.height)&&(i=!0);var o=this.i(0).copy(),r=o.copy();n=this.Ab.j;var s=this.computeCurve();if(s===ef&&3<=e&&!_e.aa(this.smoothness,0))if(3===e){var a=this.i(1);n=Math.min(o.x,a.x);var h=Math.min(o.y,a.y);a=this.i(2),n=Math.min(n,a.x),h=Math.min(h,a.y)}else{if(this.isOrthogonal)for(h=0;h<e;h++)a=n[h],r.x=Math.min(a.x,r.x),r.y=Math.min(a.y,r.y);else for(n=3;n<e;n+=3)n+3>=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;h<e;h++)a=n[h],r.x=Math.min(a.x,r.x),r.y=Math.min(a.y,r.y);n=r.x,h=r.y}if(n-=this.vv.x,h-=this.vv.y,o.x-=n,o.y-=h,2!==e||Xc(this)){if(t.type=li,a=Cu(t),0!==this.computeShortLength(!0)&&(o=Rc(this,o,!0,r)),ku(a,o.x,o.y,!1),s===ef&&3<=e&&!_e.aa(this.smoothness,0))if(3===e)i=this.i(1),e=i.x-n,i=i.y-h,o=this.i(2).copy(),o.x-=n,o.y-=h,0!==this.computeShortLength(!1)&&(o=Rc(this,o,!1,r)),Su(a,e,i,e,i,o.x,o.y);else if(this.isOrthogonal){r=new pt(n,h),o=this.i(1).copy(),s=new pt(n,h),e=new pt(n,h),i=this.i(0);for(var l,u=this.smoothness/3,c=1;c<this.pointsCount-1;c++){l=this.i(c);var f=i,d=l,p=this.i(zc(this,l,c,!1));if((!_e.aa(f.x,d.x)||!_e.aa(d.x,p.x))&&(!_e.aa(f.y,d.y)||!_e.aa(d.y,p.y))){var g=u;isNaN(g)&&(g=this.smoothness/3);var y=f.x;f=f.y;var m=d.x;d=d.y;var v=p.x;p=p.y;var x=g*Ec(y,f,m,d);g*=Ec(m,d,v,p),_e.aa(f,d)&&_e.aa(m,v)&&(m>y?p>d?(s.x=m-x,s.y=d-x,e.x=m+g,e.y=d+g):(s.x=m-x,s.y=d+x,e.x=m+g,e.y=d-g):p>d?(s.x=m+x,s.y=d-x,e.x=m-g,e.y=d+g):(s.x=m+x,s.y=d+x,e.x=m-g,e.y=d-g)),_e.aa(y,m)&&_e.aa(d,p)&&(d>f?(v>m?(s.x=m-x,s.y=d-x,e.x=m+g):(s.x=m+x,s.y=d-x,e.x=m-g),e.y=d+g):(v>m?(s.x=m-x,s.y=d+x,e.x=m+g):(s.x=m+x,s.y=d+x,e.x=m-g),e.y=d-g)),(_e.aa(y,m)&&_e.aa(m,v)||_e.aa(f,d)&&_e.aa(d,p))&&(y=.5*(y+v),f=.5*(f+p),s.x=y,s.y=f,e.x=y,e.y=f),(1===c||2===c&&_e.aa(i.x,this.i(0).x)&&_e.aa(i.y,this.i(0).y))&&(o.x=.5*(i.x+l.x),o.y=.5*(i.y+l.y)),Su(a,o.x-n,o.y-h,s.x-n,s.y-h,l.x-n,l.y-h),r.set(s),o.set(e),i=l}}r=i.x,i=i.y,o=this.i(this.pointsCount-1),0!==this.computeShortLength(!1)&&(o=Rc(this,o.copy(),!1,At)),r=.5*(r+o.x),i=.5*(i+o.y),Su(a,e.x-n,e.y-h,r-n,i-h,o.x-n,o.y-h)}else for(i=3;i<e;i+=3)r=this.i(i-2),i+3>=e&&(i=e-1),o=this.i(i-1),s=this.i(i),i===e-1&&0!==this.computeShortLength(!1)&&(s=Rc(this,s.copy(),!1,At)),Su(a,r.x-n,r.y-h,o.x-n,o.y-h,s.x-n,s.y-h);else{for(r=pt.alloc(),r.assign(this.i(0)),o=pt.alloc(),o.assign(r),s=this.computeCorner(),c=1,l=0;c<e;){if(c=zc(this,r,c,1<c),u=this.i(c),c>=e-1){if(r.w(u)){if(0===l)for(c=1;c<e;)o.assign(r),u=this.i(c++),Vc(this,a,-n,-h,r,u,i),r.assign(u)}else 0!==this.computeShortLength(!1)&&(u=Rc(this,u.copy(),!1,At)),Vc(this,a,-n,-h,r,u,i);break}if(l=zc(this,u,c+1,c<e-3),c=-n,y=-h,f=u,g=this.i(l),m=i,_e.A(r.y,f.y)&&_e.A(f.x,g.x))if(d=Math.min(s,Math.abs(f.x-o.x)/2),d=v=Math.min(d,Math.abs(g.y-f.y)/2),_e.A(d,0))Vc(this,a,c,y,r,f,m),r.assign(f);else{p=f.x,x=f.y;var b=p,w=x;p=f.x>r.x?f.x-d:f.x+d,w=g.y>f.y?f.y+v:f.y-v,Vc(this,a,c,y,r,new pt(p,x),m),Pu(a,f.x+c,f.y+y,b+c,w+y),r.h(b,w)}else _e.A(r.x,f.x)&&_e.A(f.y,g.y)?(d=Math.min(s,Math.abs(f.y-o.y)/2),d=v=Math.min(d,Math.abs(g.x-f.x)/2),_e.A(v,0)?(Vc(this,a,c,y,r,f,m),r.assign(f)):(p=f.x,x=f.y,b=p,w=x,x=f.y>r.y?f.y-d:f.y+d,b=g.x>f.x?f.x+v:f.x-v,Vc(this,a,c,y,r,new pt(p,x),m),Pu(a,f.x+c,f.y+y,b+c,w+y),r.h(b,w))):(Vc(this,a,c,y,r,f,m),r.assign(f));o.assign(u),c=l}pt.free(r)}Tu=a}else a=this.i(1).copy(),a.x-=n,a.y-=h,0!==this.computeShortLength(!0)&&(o=Rc(this,o,!0,r)),0!==this.computeShortLength(!1)&&(a=Rc(this,a,!1,r)),t.type=si,t.startX=o.x,t.startY=o.y,t.endX=a.x,t.endY=a.y;return this.$m=!0,t},Nc.prototype.computeJumpLength=function(){return 10},Nc.prototype.Oq=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;var r=!1;o=o.Ea.j;for(var s=o.length,a=0;a<s;a++){var h=o[a];h instanceof Nc&&(h===this?r=!0:r&&Uc(this,h,t))}}else if(n)for(r=o.Ea.j,o=r.length,s=0;s<o;s++)a=r[s],a instanceof Nc&&Uc(this,a,t)}}}},Nc.prototype.usesSamePort=function(t){var e=this.pointsCount,i=t.pointsCount;if(0<e&&0<i){var n=this.i(0),o=t.i(0);if(n.Qa(o))return!0;if(e=this.i(e-1),t=t.i(i-1),e.Qa(t)||n.Qa(t)||e.Qa(o))return!0}else if(this.fromNode===t.fromNode||this.toNode===t.toNode||this.fromNode===t.toNode||this.toNode===t.fromNode)return!0;return!1},Nc.prototype.isVisible=function(){if(!Lu.prototype.isVisible.call(this))return!1;var t=this.containingGroup,e=!0,i=this.diagram;if(null!==i&&(e=i.isTreePathToChildren),i=this.fromNode,null!==i){if(this.isTreeLink&&e&&!i.isTreeExpanded)return!1;if(i===t)return!0;for(var n=i;null!==n;){if(n.labeledLink===this)return!0;n=n.containingGroup}if(i=i.findVisibleNode(),null===i||i===t)return!1}if(i=this.toNode,null!==i){if(this.isTreeLink&&!e&&!i.isTreeExpanded)return!1;if(i===t)return!0;for(e=i;null!==e;){if(e.labeledLink===this)return!0;e=e.containingGroup}if(e=i.findVisibleNode(),null===e||e===t)return!1}return!0},Nc.prototype.Ob=function(t){if(Lu.prototype.Ob.call(this,t),null!==this.Mf&&this.Mf.Dm(),null!==this.nd)for(var e=this.nd.iterator;e.next();)e.value.Ob(t)},Nc.prototype.computeAdjusting=function(){return this.isAvoiding&&null!==this.diagram&&this.diagram.animationManager.defaultAnimation.isAnimating?rf:this.Yk},Nc.prototype.Ph=function(){return!0},d.Object.defineProperties(Nc.prototype,{fromNode:{get:function(){return this.We},set:function(t){var e=this.We;if(e!==t){var i=this.fromPort;null!==e&&(this.rf!==e&&hc(e,this,i),Hc(this),this.B(2)),this.We=t,null!==t&&this.Ob(t.isVisible()),this.Vf=null,this.Ua();var n=this.diagram;null!==n&&n.Z&&n.partManager.setFromNodeForLink(this,t,e);var o=this.fromPort,r=this.fromPortChanged;if(null!==r){var s=!0;null!==n&&(s=n.Z,n.Z=!0),r(this,i,o),null!==n&&(n.Z=s)}null!==t&&(this.rf!==t&&ac(t,this,o),Kc(this),this.B(1)),this.g("fromNode",e,t),Cc(this)}}},fromPortId:{get:function(){return this.Xe},set:function(t){var e=this.Xe;if(e!==t){var i=this.fromPort;null!==i&&rc(i),Hc(this),this.Xe=t;var n=this.fromPort;null!==n&&rc(n);var o=this.diagram;if(null!==o){var r=this.data,s=o.model;null!==r&&s.qj()&&s.Cw(r,t)}i!==n&&(this.Vf=null,this.Ua(),r=this.fromPortChanged,null!==r&&(s=!0,null!==o&&(s=o.Z,o.Z=!0),r(this,i,n),null!==o&&(o.Z=s))),Kc(this),this.g("fromPortId",e,t)}}},fromPort:{get:function(){var t=this.We;return null===t?null:t.Jt(this.Xe)}},fromPortChanged:{get:function(){return this.fo},set:function(t){var e=this.fo;e!==t&&(this.fo=t,this.g("fromPortChanged",e,t))}},toNode:{get:function(){return this.rf},set:function(t){var e=this.rf;if(e!==t){var i=this.toPort;null!==e&&(this.We!==e&&hc(e,this,i),Hc(this),this.B(2)),this.rf=t,null!==t&&this.Ob(t.isVisible()),this.Vf=null,this.Ua();var n=this.diagram;null!==n&&n.Z&&n.partManager.setToNodeForLink(this,t,e);var o=this.toPort,r=this.toPortChanged;if(null!==r){var s=!0;null!==n&&(s=n.Z,n.Z=!0),r(this,i,o),null!==n&&(n.Z=s)}null!==t&&(this.We!==t&&ac(t,this,o),Kc(this),this.B(1)),this.g("toNode",e,t),Cc(this)}}},toPortId:{get:function(){return this.sf},set:function(t){var e=this.sf;if(e!==t){var i=this.toPort;null!==i&&rc(i),Hc(this),this.sf=t;var n=this.toPort;null!==n&&rc(n);var o=this.diagram;if(null!==o){var r=this.data,s=o.model;null!==r&&s.qj()&&s.Hw(r,t)}i!==n&&(this.Vf=null,this.Ua(),r=this.toPortChanged,null!==r&&(s=!0,null!==o&&(s=o.Z,o.Z=!0),r(this,i,n),null!==o&&(o.Z=s))),Kc(this),this.g("toPortId",e,t)}}},toPort:{get:function(){var t=this.rf;return null===t?null:t.Jt(this.sf)}},toPortChanged:{get:function(){return this.mq},set:function(t){var e=this.mq;e!==t&&(this.mq=t,this.g("toPortChanged",e,t))}},fromSpot:{get:function(){return null!==this.O?this.O.bh:Ce},set:function(t){this.Kc();var e=this.O.bh;e.w(t)||(t=t.H(),this.O.bh=t,this.g("fromSpot",e,t),(e.Oc()||t.Oc())&&null!==this.fromNode&&rc(this.fromPort),this.Ua())}},fromEndSegmentLength:{get:function(){return null!==this.O?this.O.$g:NaN},set:function(t){this.Kc();var e=this.O.$g;e!==t&&(0>t&&M(t,">= 0",Nc,"fromEndSegmentLength"),this.O.$g=t,this.g("fromEndSegmentLength",e,t),this.Ua())}},fromShortLength:{get:function(){return null!==this.O?this.O.ah:NaN},set:function(t){this.Kc();var e=this.O.ah;e!==t&&(this.O.ah=t,this.dc(),this.g("fromShortLength",e,t))}},toSpot:{get:function(){return null!==this.O?this.O.Ch:Ce},set:function(t){this.Kc();var e=this.O.Ch;e.w(t)||(t=t.H(),this.O.Ch=t,this.g("toSpot",e,t),(e.Oc()||t.Oc())&&null!==this.toNode&&rc(this.toPort),this.Ua())}},toEndSegmentLength:{get:function(){return null!==this.O?this.O.Ah:NaN},set:function(t){this.Kc();var e=this.O.Ah;e!==t&&(0>t&&M(t,">= 0",Nc,"toEndSegmentLength"),this.O.Ah=t,this.g("toEndSegmentLength",e,t),this.Ua())}},toShortLength:{get:function(){return null!==this.O?this.O.Bh:NaN},set:function(t){this.Kc();var e=this.O.Bh;e!==t&&(this.O.Bh=t,this.dc(),this.g("toShortLength",e,t))}},isLabeledLink:{get:function(){return null!==this.nd&&0<this.nd.count}},labelNodes:{get:function(){return null===this.nd?J:this.nd.iterator}},relinkableFrom:{get:function(){return 0!==(1&this.Ga)},set:function(t){var e=0!==(1&this.Ga);e!==t&&(this.Ga^=1,this.g("relinkableFrom",e,t),this.Lb())}},relinkableTo:{get:function(){return 0!==(2&this.Ga)},set:function(t){var e=0!==(2&this.Ga);e!==t&&(this.Ga^=2,this.g("relinkableTo",e,t),this.Lb())}},resegmentable:{get:function(){return 0!==(4&this.Ga)},set:function(t){var e=0!==(4&this.Ga);e!==t&&(this.Ga^=4,this.g("resegmentable",e,t),this.Lb())}},isTreeLink:{get:function(){return 0!==(8&this.Ga)},set:function(t){var e=0!==(8&this.Ga);e!==t&&(this.Ga^=8,this.g("isTreeLink",e,t),null!==this.fromNode&&lc(this.fromNode),null!==this.toNode&&lc(this.toNode))}},path:{get:function(){var t=this.tb();return t instanceof Nl?t:null}},routeBounds:{get:function(){this.xj();var t=this.Yl,e=1/0,i=1/0,n=this.pointsCount;if(0===n)t.h(NaN,NaN,0,0);else{if(1===n)n=this.i(0),e=Math.min(n.x,e),i=Math.min(n.y,i),t.h(n.x,n.y,0,0);else if(2===n){n=this.i(0);var o=this.i(1);e=Math.min(n.x,o.x),i=Math.min(n.y,o.y),t.h(n.x,n.y,0,0),t.Oe(o)}else if(this.computeCurve()===ef&&3<=n&&!this.isOrthogonal)if(o=this.i(0),e=o.x,i=o.y,t.h(e,i,0,0),3===n){n=this.i(1),e=Math.min(n.x,e),i=Math.min(n.y,i);var r=this.i(2);e=Math.min(r.x,e),i=Math.min(r.y,i),_e.vm(o.x,o.y,n.x,n.y,n.x,n.y,r.x,r.y,.5,t)}else for(r=3;r<n;r+=3){var s=this.i(r-2);r+3>=n&&(r=n-1);var a=this.i(r-1),h=this.i(r);_e.vm(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.Oe(r),o=2;o<n;o++)r=this.i(o),e=Math.min(r.x,e),i=Math.min(r.y,i),t.Oe(r);this.vv.h(e-t.x,i-t.y)}return t}},midPoint:{get:function(){return this.xj(),this.computeMidPoint(new pt)}},midAngle:{get:function(){return this.xj(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(null===this.$r){this.ud||Lc(this);for(var t=this.$r=[],e=this.pointsCount,i=0;i<e-1;i++){var n=this.i(i),o=this.i(i+1);_e.aa(n.x,o.x)?(n=o.y-n.y,0>n&&(n=-n)):_e.aa(n.y,o.y)?(n=o.x-n.x,0>n&&(n=-n)):n=Math.sqrt(n.Ie(o)),t.push(n)}}return this.$r}},flattenedTotalLength:{get:function(){var t=this.Ru;if(isNaN(t)){for(var e=this.flattenedLengths,i=e.length,n=t=0;n<i;n++)t+=e[n];this.Ru=t}return t}},points:{get:function(){return this.Ab},set:function(t){var e=this.Ab;if(e!==t){var i=null;if(Array.isArray(t)){var n=0===t.length%2;if(n)for(var o=0;o<t.length;o++)if("number"!==typeof t[o]||isNaN(t[o])){n=!1;break}if(n)for(i=new et,n=0;n<t.length/2;n++)o=new pt(t[2*n],t[2*n+1]).freeze(),i.add(o);else{for(n=!0,o=0;o<t.length;o++){var r=t[o];if(!N(r)||"number"!==typeof r.x||isNaN(r.x)||"number"!==typeof r.y||isNaN(r.y)){n=!1;break}}if(n)for(i=new et,n=0;n<t.length;n++)o=t[n],i.add(new pt(o.x,o.y).freeze())}}else if(t instanceof et)for(i=t.copy(),t=i.iterator;t.next();)t.value.freeze();else w("Link.points value is not an instance of List or Array: "+t);i.freeze(),this.Ab=i,this.dc(),Lc(this),t=this.diagram,null!==t&&(t.pj||t.undoManager.isUndoingRedoing||t.Yt.add(this),t.animationManager.sc&&(t=t.animationManager,this.jf=i,t.$l.add(this))),this.g("points",e,i)}}},pointsCount:{get:function(){return this.Ab.count}},ud:{get:function(){return 0!==(16&this.Ga)},set:function(t){0!==(16&this.Ga)!==t&&(this.Ga^=16)}},suspendsRouting:{get:function(){return 0!==(32&this.Ga)},set:function(t){0!==(32&this.Ga)!==t&&(this.Ga^=32)}},Ct:{get:function(){return 0!==(64&this.Ga)},set:function(t){0!==(64&this.Ga)!==t&&(this.Ga^=64)}},defaultFromPoint:{get:function(){return this.u},set:function(t){this.u=t.copy()}},defaultToPoint:{get:function(){return this.I},set:function(t){this.I=t.copy()}},isOrthogonal:{get:function(){return 2===(2&this.ck.value)}},isAvoiding:{get:function(){return 4===(4&this.ck.value)}},$m:{get:function(){return 0!==(128&this.Ga)},set:function(t){0!==(128&this.Ga)!==t&&(this.Ga^=128)}},geometry:{get:function(){return this.$m||(this.xj(),this.na=this.makeGeometry()),this.na}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Dc(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var t=this.pointsCount;return 0===t?0:2>=t?t-1:this.isOrthogonal||!Dc(this.computeSpot(!1))?t-2:t-1}},adjusting:{get:function(){return this.Yk},set:function(t){var e=this.Yk;e!==t&&(this.Yk=t,this.g("adjusting",e,t))}},corner:{get:function(){return this.Hn},set:function(t){var e=this.Hn;e!==t&&(this.Hn=t,this.dc(),this.g("corner",e,t))}},curve:{get:function(){return this.Jn},set:function(t){var e=this.Jn;e!==t&&(this.Jn=t,this.Ua(),this.dc(),qc(this,e===nf||e===of||t===nf||t===of),this.g("curve",e,t))}},curviness:{get:function(){return this.Kn},set:function(t){var e=this.Kn;e!==t&&(this.Kn=t,this.Ua(),this.dc(),this.g("curviness",e,t))}},routing:{get:function(){return this.ck},set:function(t){var e=this.ck;e!==t&&(this.ck=t,this.Vf=null,this.Ua(),qc(this,2===(2&e.value)||2===(2&t.value)),this.g("routing",e,t))}},smoothness:{get:function(){return this.Zp},set:function(t){var e=this.Zp;e!==t&&(this.Zp=t,this.dc(),this.g("smoothness",e,t))}},key:{get:function(){var t=this.diagram;if(null!==t&&t.model.qj())return t.model.Wb(this.data)}}}),Nc.prototype.invalidateOtherJumpOvers=Nc.prototype.Oq,Nc.prototype.findClosestSegment=Nc.prototype.Sz,Nc.prototype.updateRoute=Nc.prototype.xj,Nc.prototype.invalidateRoute=Nc.prototype.Ua,Nc.prototype.rollbackRoute=Nc.prototype.yw,Nc.prototype.commitRoute=Nc.prototype.xf,Nc.prototype.startRoute=Nc.prototype.Th,Nc.prototype.clearPoints=Nc.prototype.pk,Nc.prototype.removePoint=Nc.prototype.uw,Nc.prototype.addPointAt=Nc.prototype.vf,Nc.prototype.addPoint=Nc.prototype.ce,Nc.prototype.insertPointAt=Nc.prototype.m,Nc.prototype.insertPoint=Nc.prototype.wA,Nc.prototype.setPointAt=Nc.prototype.L,Nc.prototype.setPoint=Nc.prototype.Qc,Nc.prototype.getPoint=Nc.prototype.i,Nc.prototype.getOtherPort=Nc.prototype.nA,Nc.prototype.getOtherNode=Nc.prototype.Kq;var _c=null,Wc=null,$c=new U(Nc,"Normal",1),Jc=new U(Nc,"Orthogonal",2),Zc=new U(Nc,"AvoidsNodes",6),Qc=new U(Nc,"AvoidsNodesStraight",7),tf=new U(Nc,"None",0),ef=new U(Nc,"Bezier",9),nf=new U(Nc,"JumpGap",10),of=new U(Nc,"JumpOver",11),rf=new U(Nc,"End",17),sf=new U(Nc,"Scale",18),af=new U(Nc,"Stretch",19),hf=new U(Nc,"OrientAlong",21),lf=new U(Nc,"OrientPlus90",22),uf=new U(Nc,"OrientMinus90",23),cf=new U(Nc,"OrientOpposite",24),ff=new U(Nc,"OrientUpright",25),df=new U(Nc,"OrientPlus90Upright",26),pf=new U(Nc,"OrientMinus90Upright",27),gf=new U(Nc,"OrientUpright45",28),yf=16,mf=14,vf=8;function xf(t,e,i,n){ot(this),this.se=this.hs=!1,this.au=t,this.My=e,this.lw=i,this.Ny=n,this.links=[]}function bf(){ot(this),this.Vy=this.group=null,this.Rt=!0,this.abort=!1,this.Bd=this.Ad=1,this.So=this.Ro=-1,this.gc=this.fc=8,this.Rb=null,this.$i=this.Zi=0,this.Wy=11,this.Gy=124}function wf(t,e,i){return t.Ad<=e&&e<=t.Ro&&t.Bd<=i&&i<=t.So}function kf(t,e,i){return wf(t,e,i)?(e-=t.Ad,e/=t.fc,i-=t.Bd,i/=t.gc,t.Rb[0|e][0|i]):Of}function Mf(t){if(null!==t.Rb)for(var e=0;e<=t.Zi;e++)for(var i=t.Rb[e],n=0;n<=t.$i;n++)i[n]>=Lf&&(i[n]=Of)}function Sf(t,e,i,n,o,r,s,a,h){if(!(e<r||e>s||i<a||i>h)){var l=0|e,u=0|i,c=t.Rb[l][u];if(c>=Lf&&c<jf)for(o?u+=n:l+=n,c+=1;r<=l&&l<=s&&a<=u&&u<=h&&!(c>=t.Rb[l][u]);)t.Rb[l][u]=c,c+=1,o?u+=n:l+=n;if(l=o?u:l,o)if(0<n)for(i+=n;i<l;i+=n)Sf(t,e,i,1,!o,r,s,a,h),Sf(t,e,i,-1,!o,r,s,a,h);else for(i+=n;i>l;i+=n)Sf(t,e,i,1,!o,r,s,a,h),Sf(t,e,i,-1,!o,r,s,a,h);else if(0<n)for(e+=n;e<l;e+=n)Sf(t,e,i,1,!o,r,s,a,h),Sf(t,e,i,-1,!o,r,s,a,h);else for(e+=n;e>l;e+=n)Sf(t,e,i,1,!o,r,s,a,h),Sf(t,e,i,-1,!o,r,s,a,h)}}function Pf(t,e,i,n,o,r,s,a,h){e|=0,i|=0;var l=Af,u=Lf;for(t.Rb[e][i]=u;l===Af&&e>r&&e<s&&i>a&&i<h;)u+=1,t.Rb[e][i]=u,o?i+=n:e+=n,l=t.Rb[e][i]}function Nf(t,e,i,n,o,r,s,a,h){e|=0,i|=0;var l=Af,u=jf;for(t.Rb[e][i]=u;l===Af&&e>r&&e<s&&i>a&&i<h;)t.Rb[e][i]=u,o?i+=n:e+=n,l=t.Rb[e][i]}function Cf(t,e,i,n,o,r,s){if(null!==t.Rb){t.abort=!1;var a=e.x,h=e.y;if(wf(t,a,h)){a-=t.Ad,a/=t.fc,h-=t.Bd,h/=t.gc;var l=n.x,u=n.y;if(wf(t,l,u))if(l-=t.Ad,l/=t.fc,u-=t.Bd,u/=t.gc,1>=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.Ad,c/=t.fc,n-=t.Bd,n/=t.gc,e-=t.Ad,e/=t.fc,f-=t.Bd,f/=t.gc,r=Math.max(0,Math.min(t.Zi,0|c)),e=Math.min(t.Zi,Math.max(0,0|e)),c=Math.max(0,Math.min(t.$i,0|n)),f=Math.min(t.$i,Math.max(0,0|f)),n=t.Rb,a|=0,h|=0,l|=0,u|=0;var d=0===i||90===i?1:-1;if(i=90===i||270===i,n[a][h]===Af?(Pf(t,a,h,d,i,r,e,c,f),Pf(t,a,h,1,!i,r,e,c,f),Pf(t,a,h,-1,!i,r,e,c,f)):Pf(t,a,h,d,i,a,h,a,h),n[l][u]===Af?(Nf(t,l,u,0===o||90===o?1:-1,90===o||270===o,r,e,c,f),Nf(t,l,u,1,!(90===o||270===o),r,e,c,f),Nf(t,l,u,-1,!(90===o||270===o),r,e,c,f)):Nf(t,l,u,d,i,l,u,l,u),i=j(),s&&Tf(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=Lf,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++:e<o?o--:l>s?s++:l<s&&s--,n[o][s]=t++,o!==e||s!==l;);else Sf(t,a,h,1,!1,r,e,c,f),Sf(t,a,h,-1,!1,r,e,c,f),Sf(t,a,h,1,!0,r,e,c,f),Sf(t,a,h,-1,!0,r,e,c,f);O(i)}}}}function Tf(t,e,i,n,o,r,s){for(var a=t.Rb,h=e,l=i;;){if(h===o&&l===r)return!0;var u=h,c=l;if(0===n){if(!(u<o))break;u++}else if(90===n){if(!(c<r))break;c++}else if(180===n){if(!(u>o))break;u--}else{if(!(c>r))break;c--}var f=a[u][c];if(0===f||f===Df)break;h=u,l=c}for(;;){if(u=n,c=h,f=l,0===n?f<r?(u=90,f++):f>r&&(u=270,f--):90===n?c<o?(u=0,c++):c>o&&(u=180,c--):180===n?f<r?(u=90,f++):f>r&&(u=270,f--):c<o?(u=0,c++):c>o&&(u=180,c--),c=a[c][f],u!==n&&0!==c&&c!==Df){if(s.push(h),s.push(l),Tf(t,h,l,u,o,r,s))return!0;s.pop(),s.pop()}if(a[h][l]=Df,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++}}}Nc.className="Link",Nc.Normal=$c,Nc.Orthogonal=Jc,Nc.AvoidsNodes=Zc,Nc.AvoidsNodesStraight=Qc,Nc.None=tf,Nc.Bezier=ef,Nc.JumpGap=nf,Nc.JumpOver=of,Nc.End=rf,Nc.Scale=sf,Nc.Stretch=af,Nc.OrientAlong=hf,Nc.OrientPlus90=lf,Nc.OrientMinus90=uf,Nc.OrientOpposite=cf,Nc.OrientUpright=ff,Nc.OrientPlus90Upright=df,Nc.OrientMinus90Upright=pf,Nc.OrientUpright45=gf,Nc.EndSegmentStep=8,Nc.CurvinessStart=yf,Nc.SpacingMin=mf,Nc.OrthoShortCut=vf,Nc.AvoidanceCell=8,Nc.AvoidanceLimit=999,xf.prototype.Dm=function(){if(!this.hs){var t=this.links;0<t.length&&(t=t[0].diagram,null!==t&&(t.Tu.add(this),this.se=t.undoManager.isUndoingRedoing))}this.hs=!0},xf.prototype.Vw=function(){if(this.hs){this.hs=!1;var t=this.links;if(0<t.length){var e=t[0],i=e.diagram;i=null===i||i.pj&&!this.se,this.se=!1,e.arrangeBundledLinks(t,i),1===t.length&&(e.Mf=null,t.length=0)}0===t.length&&(t=this.au,null!==this&&null!==t.Se&&t.Se.remove(this),t=this.lw,null!==this&&null!==t.Se&&t.Se.remove(this))}},xf.className="LinkBundle",bf.prototype.initialize=function(t){if(!(0>=t.width||0>=t.height)){var e=t.y,i=t.x+t.width,n=t.y+t.height;if(this.Ad=Math.floor((t.x-this.fc)/this.fc)*this.fc,this.Bd=Math.floor((e-this.gc)/this.gc)*this.gc,this.Ro=Math.ceil((i+2*this.fc)/this.fc)*this.fc,this.So=Math.ceil((n+2*this.gc)/this.gc)*this.gc,t=1+(0|Math.ceil((this.Ro-this.Ad)/this.fc)),e=1+(0|Math.ceil((this.So-this.Bd)/this.gc)),null===this.Rb||this.Zi<t-1||this.$i<e-1){for(i=[],n=0;n<=t;n++)i[n]=new Uint32Array(e);this.Rb=i,this.Zi=t-1,this.$i=e-1}if(t=Of,null!==this.Rb)for(e=0;e<=this.Zi;e++)if(i=this.Rb[e],i.fill)i.fill(t);else for(n=0;n<=this.$i;n++)i[n]=t}},bf.prototype.Ek=function(t,e,i,n){if(t>this.Ro||t+i<this.Ad||e>this.So||e+n<this.Bd)return!0;t=(t-this.Ad)/this.fc|0,e=(e-this.Bd)/this.gc|0,i=Math.max(0,i)/this.fc+1|0;var o=Math.max(0,n)/this.gc+1|0;if(0>t&&(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.Zi),i=0|Math.min(e+o-1,this.$i);t<=n;t++){o=this.Rb[t];for(var r=e;r<=i;r++)if(o[r]===Af)return!1}return!0},d.Object.defineProperties(bf.prototype,{bounds:{get:function(){return new zt(this.Ad,this.Bd,this.Ro-this.Ad,this.So-this.Bd)}},zq:{get:function(){return this.fc},set:function(t){0<t&&t!==this.fc&&(this.fc=t,this.initialize(this.bounds))}},yq:{get:function(){return this.gc},set:function(t){0<t&&t!==this.gc&&(this.gc=t,this.initialize(this.bounds))}}});var Af=0,Lf=1,jf=999999,Of=jf+1,Df=jf+2;function Ff(){ot(this),this.port=this.node=null,this.de=[],this.Sq=!1}function Bf(t,e,i,n){switch(e=e.offsetY,e){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(e){case 9:return 180<i?270:90;case 6:return 90<i&&270>=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 90<i&&i<=180+t?180:i>180+t&&i<=360-t?270:0;case 13:return 180<i&&i<=360-t?270:i>t&&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&&(i-=15,0>i&&(i+=360)),i>t&&i<180-t?90:i>=180-t&&i<=180+t?180:i>180+t&&i<360-t?270:0}function If(t,e){var i=t.de;if(0===i.length){t:if(!t.Sq){i=t.Sq,t.Sq=!0;var n=null,o=t.node,r=o instanceof bc?o:null;if(null===r||r.isSubGraphExpanded)var s=o.isTreeExpanded?o.findLinksConnected(t.port.portId):o.py();else{if(!r.actualBounds.s()){t.Sq=i;break t}n=r,s=n.Rv()}r=t.de.length=0;var a=t.port.da(ne,pt.alloc()),h=t.port.da(ce,pt.alloc());for(o=zt.allocAt(a.x,a.y,0,0),o.Oe(h),pt.free(a),pt.free(h),a=pt.allocAt(o.x+o.width/2,o.y+o.height/2),h=t.port.lj(),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.Kd(n),c=l.computeSpot(u,t.port);if(c.Oc()){var f=u?l.toPort:l.fromPort;if(null!==f&&(u=f.part,null!==u)){var d=u.findVisibleNode();null!==d&&d!==u&&(u=d,f=u.port),u=l.computeOtherPoint(u,f),f=a.Pa(f.da(ae)),f+=(a.Pa(u)-f)/360,f-=h,0>f?f+=360:360<=f&&(f-=360),c=Bf(o,c,f,l.isOrthogonal),0===c?(c=4,180<f&&(f-=360)):90===c?(c=8,270<f&&(f-=360)):180===c?c=2:(c=1,90>f&&(f+=360)),d=t.de[r],void 0===d?(d=new Ef(l,f,c),t.de[r]=d):(d.link=l,d.angle=f,d.Ac=c),d.ow.set(u),r++}}}}for(pt.free(a),t.de.sort(Ff.prototype.l),h=t.de.length,n=-1,r=a=0;r<h;r++)s=t.de[r],void 0!==s&&(s.Ac!==n&&(n=s.Ac,a=0),s.Lq=a,a++);for(n=-1,a=0,r=h-1;0<=r;r--)h=t.de[r],void 0!==h&&(h.Ac!==n&&(n=h.Ac,a=h.Lq+1),h.wm=a);if(r=t.de,c=t.port,n=t.node.portSpreading,a=pt.alloc(),h=pt.alloc(),s=pt.alloc(),l=pt.alloc(),c.da(ne,a),c.da(re,h),c.da(ce,s),c.da(le,l),d=f=u=c=0,n===xc)for(var p=0;p<r.length;p++){var g=r[p];if(null!==g){var y=g.link.computeThickness();switch(g.Ac){case 8:f+=y;break;case 2:d+=y;break;case 1:c+=y;break;default:case 4:u+=y}}}var m=p=0,v=1,x=g=0;for(y=0;y<r.length;y++){var b=r[y];if(null!==b){if(p!==b.Ac){switch(p=b.Ac,p){case 8:var w=s;m=l;break;case 2:w=l,m=a;break;case 1:w=a,m=h;break;default:case 4:w=h,m=s}switch(g=m.x-w.x,x=m.y-w.y,p){case 8:f>Math.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:case 4:u>Math.abs(x)?(v=Math.abs(x)/u,u=Math.abs(x)):v=1}m=0}var k=b.Qq;if(n===xc){switch(b=b.link.computeThickness(),b*=v,k.set(w),p){case 8:k.x=w.x+g/2+f/2-m-b/2;break;case 2:k.y=w.y+x/2+d/2-m-b/2;break;case 1:k.x=w.x+g/2-c/2+m+b/2;break;default:case 4:k.y=w.y+x/2-u/2+m+b/2}m+=b}else{var M=.5;n===vc&&(M=(b.Lq+1)/(b.wm+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.de,r=0;r<w.length;r++)n=w[r],null!==n&&(n.Pv=t.computeEndSegmentLength(n));t.Sq=i,zt.free(o)}i=t.de}for(t=0;t<i.length;t++)if(o=i[t],null!==o&&o.link===e)return o;return null}function Ef(t,e,i){this.link=t,this.angle=e,this.Ac=i,this.ow=new pt,this.wm=this.Lq=0,this.Qq=new pt,this.Pv=0}function Rf(){this.Ch=this.bh=Ce,this.Bh=this.ah=this.Ah=this.$g=NaN,this.kq=this.co=null,this.lq=this.eo=1/0}function zf(){ot(this),this.u=this.C=null,this.zi=this.xo=!0,this.Co=!1,this.nn=new pt(0,0).freeze(),this.zo=!0,this.vn=this.yo=null,this.Bo=!1,this.l=null,this.I=0,this.To=this.qq=null,this.wt=!1,this.yg=this.ek=null,this.lt=!1}function Vf(t,e,i,n,o,r,s,a){for(i=i.iterator;i.next();){var h=i.value;n&&!h.isTopLevel||null!==o&&!o(h)||!h.canLayout()||(r&&h instanceof ec?h.isLinkLabel||(h instanceof bc&&null===h.layout?Vf(t,e,h.memberParts,!1,o,r,s,a):(Gf(h),e.add(h))):s&&h instanceof Nc?e.add(h):!a||!h.Nc()||h instanceof ec||(Gf(h),e.add(h)))}}function Gf(t){var e=t.actualBounds;(0===e.width||0===e.height||isNaN(e.width)||isNaN(e.height))&&t.Ta()}function Yf(t,e){if(null!==t.workerStateChanged){var i={key:t.group?t.group.key:null};void 0!==e&&(i.time=e),null!==t.ek&&(i.running=Xf(t.ek)),null!==t.yg&&(i.waiting=Xf(t.yg)),t.workerStateChanged(i,t)}}function Xf(t){return{vertexes:t.vertexes.count,edges:t.edges.count}}function qf(t,e){var i=Uf(t);if(!i)throw Error("Unknown Layout class: "+t);if(e)for(var n in e)i[n]=e[n]}function Uf(t){var e=null;if("function"===typeof t){if(e=Wf.get(t),!e){var i=D(t);e=Wf.get(i),e||(e=new Zf,e.Lv=t,e.name=i,e.l=t.name,e.Cy=$f,Wf.set(i,e),Wf.set(t,e),Wf.set(t.name,e))}}else"string"===typeof t&&(e=Wf.get(t));return e}function Kf(t,e){t.wt=!0;var i=Uf(t.constructor),n=Hf(t,e,!0);n._GoJS="_GoJS",i.Pe.postMessage(n),i.Fm.set(st(t),t),t.ek=e}function Hf(t,e,i){t.onNetworkSerialization(1,i,e,null);var n={};t.serializeLayoutProperties(n,i);var o=[];e.vertexes.each((function(t){var e={};t.serializeVertexProperties(e,i),o.push(e)}));var r=[];return e.edges.each((function(t){var e={};t.serializeEdgeProperties(e,i),r.push(e)})),n={id:i?st(t):t.id,layout:D(t.constructor),p:n,jB:o,Qz:r},t.onNetworkSerialization(2,i,e,n),n}function _f(t,e,i){i&&(t.id=e.id);var n=t.diagram,o=t.createNetwork();t.onNetworkSerialization(3,i,o,e);var r=e.jB,s=new dt;r&&r.forEach((function(t){var e=null;null===t.key||null===n||i||(e=n.Cb(t.key)),null!==e?e=o.mk(e):(e=o.createVertex(),o.Bg(e)),i&&null!==t.key&&(e.data={Di:t.key}),s.set(t.id,e)}));var a=e.Qz,h=new dt;return a&&a.forEach((function(t){var e=null;null===t.key||null===n||i||(e=n.findLinkForKey(t.key));var r=o.createEdge();o.tm(r),r.link=e,i&&null!==t.key&&(r.data={Di:t.key}),h.set(t.id,r)})),r&&r.forEach((function(t){var e=s.get(t.id);e&&e.Cq(t,s,h,i)})),a&&a.forEach((function(t){var e=h.get(t.id);e&&e.deserializeEdgeProperties(t,s,h,i)})),t.deserializeLayoutProperties(e.p,s,h,i,o),t.onNetworkSerialization(4,i,o,e),o}bf.className="PositionArray",Ff.prototype.toString=function(){for(var t=this.de,e=this.node.toString()+" "+t.length.toString()+":",i=0;i<t.length;i++){var n=t[i];null!==n&&(e+="\n  "+n.toString())}return e},Ff.prototype.Dm=function(){this.de.length=0},Ff.prototype.l=function(t,e){return t===e?0:null===t?-1:null===e?1:t.Ac<e.Ac?-1:t.Ac>e.Ac?1:t.angle<e.angle?-1:t.angle>e.angle?1:0},Ff.prototype.computeEndSegmentLength=function(t){var e=t.link,i=e.computeEndSegmentLength(this.node,this.port,ie,e.fromPort===this.port),n=t.Lq;if(0>n)return i;var o=t.wm;if(1>=o||!e.isOrthogonal)return i;e=t.ow;var r=t.Qq;return 2!==t.Ac&&8!==t.Ac||(n=o-1-n),((t=2===t.Ac||4===t.Ac)?e.y<r.y:e.x<r.x)?i+8*n:(t?e.y===r.y:e.x===r.x)?i:i+8*(o-1-n)},Ff.className="Knot",Ef.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Ac.toString()+":"+this.Lq.toString()+"/"+this.wm.toString()+" "+this.Qq.toString()+" "+this.Pv.toString()+" "+this.ow.toString()},Ef.className="LinkInfo",Rf.prototype.copy=function(){var t=new Rf;return t.bh=this.bh.H(),t.Ch=this.Ch.H(),t.$g=this.$g,t.Ah=this.Ah,t.ah=this.ah,t.Bh=this.Bh,t.co=this.co,t.kq=this.kq,t.eo=this.eo,t.lq=this.lq,t},Rf.className="LinkSettings",zf.prototype.cloneProtected=function(t){t.xo=this.xo,t.zi=this.zi,t.Co=this.Co,t.nn.assign(this.nn),t.zo=this.zo,t.yo=this.yo,t.vn=this.vn,t.Bo=!0,t.To=this.To,t.qq=this.qq},zf.prototype.copy=function(){var t=new this.constructor;return this.cloneProtected(t),t},zf.prototype.serializeLayoutProperties=function(t){t.arrangementOrigin={x:this.arrangementOrigin.x,y:this.arrangementOrigin.y},t.isRouting=this.isRouting},zf.prototype.deserializeLayoutProperties=function(t){null!==t&&(this.arrangementOrigin=new pt(t.arrangementOrigin.x,t.arrangementOrigin.y),this.isRouting=t.isRouting)},zf.prototype.jb=function(){},zf.prototype.toString=function(){var t=D(this.constructor);return t+="(",null!==this.group&&(t+=" in "+this.group),null!==this.diagram&&(t+=" for "+this.diagram),t+")"},zf.prototype.B=function(){if(this.isValidLayout){var t=this.diagram;if(null!==t&&!t.undoManager.isUndoingRedoing){var e=t.animationManager;!e.isTicking&&(e.defaultAnimation.isAnimating&&e.Bc(),this.isOngoing&&t.pj||this.isInitial&&!t.pj)&&(this.isValidLayout=!1,t.Db())}}},zf.prototype.createNetwork=function(){return new Qf(this)},zf.prototype.makeNetwork=function(t){var e=this.createNetwork();return t instanceof Ko?(e.Ag(t.nodes,!0),e.Ag(t.links,!0)):t instanceof bc?e.Ag(t.memberParts):e.Ag(t.iterator),e},zf.prototype.updateParts=function(){if(this.isValidLayout=!0,!this.workerLayout()){var t=this.diagram;if(null===t&&null!==this.network)for(var e=this.network.vertexes.iterator;e.next();){var i=e.value.node;if(null!==i&&(t=i.diagram,null!==t))break}try{null!==t&&t.va("Layout"),this.commitLayout()}finally{null!==t&&t.Xa("Layout")}}},zf.prototype.commitLayout=function(){if(null!==this.network){for(var t=this.network.vertexes.iterator;t.next();)t.value.commit();if(this.isRouting)for(t=this.network.edges.iterator;t.next();)t.value.commit()}},zf.prototype.doLayout=function(t){var e=new nt;t instanceof Ko?(Vf(this,e,t.nodes,!0,this.Rh,!0,!1,!0),Vf(this,e,t.parts,!0,this.Rh,!0,!1,!0)):t instanceof bc?Vf(this,e,t.memberParts,!1,this.Rh,!0,!1,!0):e.addAll(t.iterator),0<e.count&&(t=this.diagram,null!==t&&t.va("Layout"),this.doMinimalNoNetworkLayout(e),null!==t&&t.Xa("Layout")),this.isValidLayout=!0},zf.prototype.doMinimalNoNetworkLayout=function(t){var e=Math.ceil(Math.sqrt(t.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var i=this.arrangementOrigin.x,n=i,o=this.arrangementOrigin.y,r=0,s=0;for(t=t.iterator;t.next();){var a=t.value;Gf(a);var h=a.measuredBounds,l=h.width;h=h.height,a.moveTo(n,o),a instanceof bc&&(a.Rh=!1),n+=Math.max(l,50)+20,s=Math.max(s,Math.max(h,50)),r>=e-1?(r=0,n=i,o+=s+20,s=0):r++}},zf.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 Nc)&&(Gf(a),this.Rh(a))){var h=a.measuredBounds,l=h.width;h=h.height,a.moveTo(i,n),a instanceof bc&&(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++}}},zf.prototype.Rh=function(t){return!(t.location.s()&&!(t instanceof bc&&t.Rh))},zf.prototype.nj=function(t,e){var i=this.boundsComputation;return null!==i?(e||(e=new zt),i(t,this,e)):e?(e.set(t.actualBounds),e):t.actualBounds},zf.prototype.$x=function(t){var e=new nt;return t instanceof Ko?(Vf(this,e,t.nodes,!0,null,!0,!0,!0),Vf(this,e,t.links,!0,null,!0,!0,!0),Vf(this,e,t.parts,!0,null,!0,!0,!0)):Vf(this,e,t instanceof bc?t.memberParts:t.iterator,!1,null,!0,!0,!0),e},zf.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),e=e.placeholder,null!==e&&(i=e.da(ne),(isNaN(i.x)||isNaN(i.y))&&i.set(t),t=e.padding,i.x+=t.left,i.y+=t.top),i}return t},zf.prototype.mayUseWorker=function(){return!!this.mayUseWorkerFunction&&this.mayUseWorkerFunction(this)},zf.prototype.workerLayout=function(){return!1},zf.prototype.zz=function(){var t=Uf(this.constructor);t&&(null!==t.Pe&&t.Pe.terminate(),t.Pe=null,t.Fm.iteratorValues.each((function(t){t.wt=!1,t.ek=null,t.yg=null,t.lt=!1,Yf(t)})),t.Fm.clear())},zf.prototype.Uw=function(){if("undefined"===typeof Worker||!Jf||"undefined"===typeof self||"undefined"!==typeof self.DedicatedWorkerGlobalScope)return!1;if(!this.mayUseWorker())return this.wt&&(this.lt=!0,this.yg=this.ek=null,Yf(this)),!1;var t=Uf(this.constructor);return null!==t&&(null===t.Pe&&(t.Pe=new Worker(Jf),t.Pe.onerror=function(t){t.preventDefault(),S("Worker Error at: "+t.filename+" "+t.lineno+" "+t.colno+"\n  "+t.message)},t.Pe.l=function(t){S("Worker serialization error: "+t)},t.Pe.onmessage=function(e){var i=e.data;if("_GoJS"===i._GoJS)if(i.version&&Ko.version&&i.version!==Ko.version)S("Failure: GoJS v"+Ko.version+"  Worker v"+i.version);else if(e=t.Fm.get(i.id)){if(t.Fm.remove(i.id),e.wt=!1,e.ek=null,e.lt)e.lt=!1,e.yg=null;else{var n=_f(e,i,!1);e.network=n,e.updateParts(),e.network=null,e.isValidLayout=!0}if(Yf(e,i.time),i=e.yg,null!==i)e.yg=null;else for(n=t.Fm.iteratorValues;n.next();){var o=n.value;if(i=o.yg,null!==i){o.yg=null;break}}null!==i&&Kf(e,i)}},t.Pe.postMessage({_GoJS:"_GoJS",url:t.Cy}),Array.isArray(t.scripts)&&t.scripts.forEach((function(e){t.Pe.postMessage({_GoJS:"_GoJS",url:e})})),t.Pe.postMessage({_GoJS:"_GoJS",version:-1})),null!==this.ek?this.yg=this.network:Kf(this,this.network),Yf(this),this.doMinimalNetworkLayout(),this.network=null,this.isValidLayout=!0)},zf.prototype.onNetworkSerialization=function(){},d.Object.defineProperties(zf.prototype,{diagram:{get:function(){return this.C},set:function(t){this.C=t}},group:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t,null!==t&&(this.C=t.diagram))}},isOngoing:{get:function(){return this.xo},set:function(t){this.xo!==t&&(this.xo=t)}},isInitial:{get:function(){return this.zi},set:function(t){this.zi=t,t||(this.Bo=!0)}},isViewportSized:{get:function(){return this.Co},set:function(t){this.Co!==t&&(this.Co=t)&&this.B()}},isRouting:{get:function(){return this.zo},set:function(t){this.zo!==t&&(this.zo=t)}},isRealtime:{get:function(){return this.yo},set:function(t){this.yo!==t&&(this.yo=t)}},isValidLayout:{get:function(){return this.Bo},set:function(t){this.Bo!==t&&(this.Bo=t,t||(t=this.diagram,null!==t&&(t.Ng=!0)))}},network:{get:function(){return this.l},set:function(t){this.l!==t&&(this.l=t,null!==t&&(t.layout=this))}},boundsComputation:{get:function(){return this.vn},set:function(t){this.vn!==t&&(this.vn=t,this.B())}},arrangementOrigin:{get:function(){return this.nn},set:function(t){this.nn.w(t)||(this.nn.assign(t),this.B())}},id:{get:function(){return this.I},set:function(t){this.I=t}},mayUseWorkerFunction:{get:function(){return this.To},set:function(t){this.To!==t&&(this.To=t)}},workerStateChanged:{get:function(){return this.qq},set:function(t){this.qq!==t&&(this.qq=t)}}}),zf.prototype.useWorker=zf.prototype.Uw,zf.declareWorkerLayout=qf,zf.prototype.cancelWorker=zf.prototype.zz,zf.prototype.collectParts=zf.prototype.$x,zf.prototype.getLayoutBounds=zf.prototype.nj,zf.prototype.invalidateLayout=zf.prototype.B;var Wf=new dt,$f="object"===typeof y.document&&y.document.currentScript?y.document.currentScript.src:"",Jf="undefined"!==typeof URL&&"function"===typeof URL.createObjectURL&&"function"===typeof Blob?URL.createObjectURL(new Blob(["self.onmessage=function(e){if(e.data.url){\nimportScripts(e.data.url);}}"],{type:"text/javascript"})):"";function Zf(){this.Lv=null,this.Cy=this.l=this.name="",this.scripts=[],this.Pe=null,this.Fm=new dt}function Qf(t){ot(this),this.kc=t,this.tf=new nt,this.le=new nt,this.bu=new dt,this.Xt=new dt}function td(t,e){if(null===e)return!1;var i=t.tf.remove(e);return i&&(e=e.node,null!==e&&t.bu.remove(e)),i}function ed(t,e){if(null!==e){t.le.add(e);var i=e.link;null!==i&&null===t.Eq(i)&&t.Xt.add(i,e),e.network=t}}function id(t,e){null!==e&&t.le.remove(e)&&(e=e.link,null!==e&&t.Xt.remove(e))}function nd(t){for(var e=j(),i=t.le.iterator;i.next();){var n=i.value;null!==n.fromVertex&&null!==n.toVertex||e.push(n)}for(i=e.length,n=0;n<i;n++)t.vk(e[n]);O(e)}function od(t,e,i){if(null!==i&&i.network!==e){td(t,i),e.Bg(i);for(var n=i.sourceEdges;n.next();){var o=n.value;o.network!==e&&(id(t,o),ed(e,o),od(t,e,o.fromVertex))}for(n=i.destinationEdges;n.next();)i=n.value,i.network!==e&&(id(t,i),ed(e,i),od(t,e,i.toVertex))}}function rd(t){ot(this),this.Tc=t,this.l=new zt(0,0,10,10).freeze(),this.u=new pt(5,5).freeze(),this.Mi=this.ob=null,this.td=new et,this.Gd=new et}function sd(t,e){return t=t.Mi,e=e.Mi,t?e?(t=t.text,e=e.text,t<e?-1:t>e?1:0):1:null!==e?-1:0}function ad(t){ot(this),this.Sc=t,this.ed=this.Yc=this.Nl=this.ob=null}function hd(){zf.call(this),this.isViewportSized=!0,this.rq=this.sq=NaN,this.Qg=new Bt(NaN,NaN).freeze(),this.lf=new Bt(10,10).freeze(),this.yb=cd,this.Eb=fd,this.bd=yd,this.Wc=ld}function ld(t,e){return t=t.text,e=e.text,t<e?-1:t>e?1:0}zf.className="Layout",zf.GoJSScriptURL=$f,zf.declareWorkerLayout=qf,"undefined"!==typeof self&&"undefined"!==typeof self.DedicatedWorkerGlobalScope&&"undefined"!==typeof self&&"undefined"!==typeof self.DedicatedWorkerGlobalScope&&(self.onmessage=function(t){if(t=t.data,"_GoJS"===t._GoJS)if(t.url)importScripts(t.url);else if(t.version)self.postMessage({_GoJS:"_GoJS",version:Ko.version},void 0);else{var e=performance.now(),i=null;t.layout&&(i=Uf(t.layout));var n=null;if(i&&i.Lv&&(n=new i.Lv),!n)throw Error("no registered Worker Layout: "+t.layout);n.network=_f(n,t,!0),n.workerLayout=function(){var t=Hf(n,n.network,!1);return t._GoJS="_GoJS",t.time=performance.now()-e,self.postMessage(t,void 0),!0},n.doLayout(new et)}}),Qf.prototype.clear=function(){if(this.tf)for(var t=this.tf.iterator;t.next();)t.value.clear();if(this.le)for(t=this.le.iterator;t.next();)t.value.clear();this.tf=new nt,this.le=new nt,this.bu=new dt,this.Xt=new dt},Qf.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.tf.count+" edges: "+this.le.count,1<t){for(var i=this.tf.iterator;i.next();)e+="\n    "+i.value.toString(t-1);for(i=this.le.iterator;i.next();)e+="\n    "+i.value.toString(t-1)}return e},Qf.prototype.createVertex=function(){return new rd(this)},Qf.prototype.createEdge=function(){return new ad(this)},Qf.prototype.Ag=function(t,e,i){if(null!==t){for(void 0===e&&(e=!1),void 0===i&&(i=null),null===i&&(i=function(t){if(t instanceof ec)return!t.isLinkLabel;if(t instanceof Nc){var e=t.fromNode;return null!==e&&!e.isLinkLabel&&(t=t.toNode,null!==t&&!t.isLinkLabel)}return!1}),t=t.iterator;t.next();){var n=t.value;if(n instanceof ec&&(!e||n.isTopLevel)&&n.canLayout()&&i(n))if(n instanceof bc&&null===n.layout)this.Ag(n.memberParts,!1);else if(null===this.kj(n)){var o=this.createVertex();o.node=n,this.Bg(o)}}for(t.reset();t.next();)if(n=t.value,n instanceof Nc&&(!e||n.isTopLevel)&&n.canLayout()&&i(n)&&null===this.Eq(n)){var r=n.fromNode;o=n.toNode,null!==r&&null!==o&&r!==o&&(r=this.findGroupVertex(r),o=this.findGroupVertex(o),null!==r&&null!==o&&this.Fk(r,o,n))}}},Qf.prototype.findGroupVertex=function(t){if(null===t)return null;var e=t.findVisibleNode();if(null===e)return null;if(t=this.kj(e),null!==t)return t;for(e=e.containingGroup;null!==e;){if(t=this.kj(e),null!==t)return t;e=e.containingGroup}return null},i=Qf.prototype,i.Bg=function(t){if(null!==t){this.tf.add(t);var e=t.node;null!==e&&this.bu.add(e,t),t.network=this}},i.mk=function(t){if(null===t)return null;var e=this.kj(t);return null===e&&(e=this.createVertex(),e.node=t,this.Bg(e)),e},i.Ov=function(t){if(null!==t&&td(this,t)){for(var e=t.td,i=e.count-1;0<=i;i--){var n=e.J(i);this.vk(n)}for(e=t.Gd,t=e.count-1;0<=t;t--)i=e.J(t),this.vk(i)}},i.Lz=function(t){null!==t&&(t=this.kj(t),null!==t&&this.Ov(t))},i.kj=function(t){return null===t?null:this.bu.G(t)},i.tm=function(t){if(null!==t){ed(this,t);var e=t.toVertex;null!==e&&e.Ev(t),e=t.fromVertex,null!==e&&e.Cv(t)}},i.oz=function(t){if(null===t)return null;var e=t.fromNode,i=t.toNode,n=this.Eq(t);return null===n?(n=this.createEdge(),n.link=t,null!==e&&(n.fromVertex=this.mk(e)),null!==i&&(n.toVertex=this.mk(i)),this.tm(n)):(n.fromVertex=null!==e?this.mk(e):null,n.toVertex=null!==i?this.mk(i):null),n},i.vk=function(t){if(null!==t){var e=t.toVertex;null!==e&&e.Nv(t),e=t.fromVertex,null!==e&&e.Mv(t),id(this,t)}},i.Kz=function(t){null!==t&&(t=this.Eq(t),null!==t&&this.vk(t))},i.Eq=function(t){return null===t?null:this.Xt.G(t)},i.Fk=function(t,e,i){if(null===t||null===e)return null;if(t.network===this&&e.network===this){var n=this.createEdge();return n.link=i,n.fromVertex=t,n.toVertex=e,this.tm(n),n}return null},i.Rm=function(t){if(null!==t){var e=t.fromVertex,i=t.toVertex;null!==e&&null!==i&&(e.Mv(t),i.Nv(t),t.Rm(),e.Ev(t),i.Cv(t))}},i.Bq=function(){for(var t=j(),e=this.le.iterator;e.next();){var i=e.value;i.fromVertex===i.toVertex&&t.push(i)}for(e=t.length,i=0;i<e;i++)this.vk(t[i]);O(t)},Qf.prototype.deleteArtificialVertexes=function(){for(var t=j(),e=this.tf.iterator;e.next();){var i=e.value;null===i.node&&null===i.data&&t.push(i)}for(i=t.length,e=0;e<i;e++)this.Ov(t[e]);for(e=j(),i=this.le.iterator;i.next();){var n=i.value;null===n.link&&null===n.data&&e.push(n)}for(i=e.length,n=0;n<i;n++)this.vk(e[n]);O(t),O(e)},Qf.prototype.Xy=function(t){void 0===t&&(t=!0),t&&(this.deleteArtificialVertexes(),nd(this),this.Bq()),t=new et;for(var e=!0;e;){e=!1;for(var i=this.tf.iterator;i.next();){var n=i.value;if(0<n.td.count||0<n.Gd.count){e=this.layout.createNetwork(),t.add(e),od(this,e,n),e=!0;break}}}return t.sort((function(t,e){return null===t||null===e||t===e?0:e.vertexes.count-t.vertexes.count})),t},Qf.prototype.Rz=function(){for(var t=new nt,e=this.tf.iterator;e.next();)t.add(e.value.node);for(e=this.le.iterator;e.next();)t.add(e.value.link);return t},d.Object.defineProperties(Qf.prototype,{layout:{get:function(){return this.kc},set:function(t){null!==t&&(this.kc=t)}},vertexes:{get:function(){return this.tf}},edges:{get:function(){return this.le}}}),Qf.prototype.findAllParts=Qf.prototype.Rz,Qf.prototype.splitIntoSubNetworks=Qf.prototype.Xy,Qf.prototype.deleteSelfEdges=Qf.prototype.Bq,Qf.prototype.reverseEdge=Qf.prototype.Rm,Qf.prototype.linkVertexes=Qf.prototype.Fk,Qf.prototype.findEdge=Qf.prototype.Eq,Qf.prototype.deleteLink=Qf.prototype.Kz,Qf.prototype.deleteEdge=Qf.prototype.vk,Qf.prototype.addLink=Qf.prototype.oz,Qf.prototype.addEdge=Qf.prototype.tm,Qf.prototype.findVertex=Qf.prototype.kj,Qf.prototype.deleteNode=Qf.prototype.Lz,Qf.prototype.deleteVertex=Qf.prototype.Ov,Qf.prototype.addNode=Qf.prototype.mk,Qf.prototype.addVertex=Qf.prototype.Bg,Qf.prototype.addParts=Qf.prototype.Ag,Qf.className="LayoutNetwork",rd.prototype.serializeVertexProperties=function(t){t.id=st(this),t.key=this.node?this.node.key:this.data?this.data.Di:void 0,void 0===t.key&&(t.key=null),t.x=this.bounds.x,t.y=this.bounds.y,t.kB=this.bounds.width,t.tA=this.bounds.height,t.fx=this.focus.x,t.fy=this.focus.y;var e=[];this.td.each((function(t){e.push(st(t))})),t.Uy=e;var i=[];this.Gd.each((function(t){i.push(st(t))})),t.jy=i},rd.prototype.Cq=function(t,e,i){if(null!==t){this.x=t.x,this.y=t.y,this.width=t.kB,this.height=t.tA,this.focusX=t.fx,this.focusY=t.fy;var n=this;t.Uy&&t.Uy.forEach((function(t){(t=i.get(t))&&n.td.add(t)})),t.jy&&t.jy.forEach((function(t){(t=i.get(t))&&n.Gd.add(t)}))}},rd.prototype.clear=function(){this.Mi=this.ob=null,this.td=new et,this.Gd=new et},rd.prototype.toString=function(t){void 0===t&&(t=0);var e="LayoutVertex#"+st(this);if(0<t&&(e+=null!==this.node?"("+this.node.toString()+")":"",1<t)){t="";for(var i=!0,n=this.td.iterator;n.next();){var o=n.value;i?i=!1:t+=",",t+=o.toString(0)}for(o="",i=!0,n=this.Gd.iterator;n.next();){var r=n.value;i?i=!1:o+=",",o+=r.toString(0)}e+=" sources: "+t+" destinations: "+o}return e},rd.prototype.commit=function(){var t=this.ob;if(null!==t){var e=this.bounds,i=t.bounds;N(i)?(i.x=e.x,i.y=e.y,i.width=e.width,i.height=e.height):t.bounds=e.copy()}else if(t=this.node,null!==t){if(e=this.bounds,!(t instanceof bc)){i=zt.alloc();var n=this.network.layout.nj(t,i),o=t.locationObject.da(ae);if(n.s()&&o.s())return t.moveTo(e.x+this.focusX-(o.x-n.x),e.y+this.focusY-(o.y-n.y)),void zt.free(i);zt.free(i)}t.moveTo(e.x,e.y)}},rd.prototype.Ev=function(t){null!==t&&(this.td.contains(t)||this.td.add(t))},rd.prototype.Nv=function(t){null!==t&&this.td.remove(t)},rd.prototype.Cv=function(t){null!==t&&(this.Gd.contains(t)||this.Gd.add(t))},rd.prototype.Mv=function(t){null!==t&&this.Gd.remove(t)},d.Object.defineProperties(rd.prototype,{sourceEdgesArrayAccess:{get:function(){return this.td._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.Gd._dataArray}},data:{get:function(){return this.ob},set:function(t){if(this.ob=t,null!==t&&t.bounds){var e=t.bounds;t=e.x;var i=e.y,n=e.width;e=e.height,this.u.h(n/2,e/2),this.l.h(t,i,n,e)}}},node:{get:function(){return this.Mi},set:function(t){if(this.Mi!==t){this.Mi=t,t.Ta();var e=this.network.layout,i=zt.alloc(),n=e.nj(t,i);e=n.x;var o=n.y,r=n.width;if(n=n.height,isNaN(e)&&(e=0),isNaN(o)&&(o=0),this.l.h(e,o,r,n),zt.free(i),!(t instanceof bc)&&(t=t.locationObject.da(ae),t.s()))return void this.u.h(t.x-e,t.y-o);this.u.h(r/2,n/2)}}},bounds:{get:function(){return this.l},set:function(t){this.l.w(t)||this.l.assign(t)}},focus:{get:function(){return this.u},set:function(t){this.u.w(t)||this.u.assign(t)}},centerX:{get:function(){return this.l.x+this.u.x},set:function(t){var e=this.l;e.x+this.u.x!==t&&(e.ea(),e.x=t-this.u.x,e.freeze())}},centerY:{get:function(){return this.l.y+this.u.y},set:function(t){var e=this.l;e.y+this.u.y!==t&&(e.ea(),e.y=t-this.u.y,e.freeze())}},focusX:{get:function(){return this.u.x},set:function(t){var e=this.u;e.x!==t&&(e.ea(),e.x=t,e.freeze())}},focusY:{get:function(){return this.u.y},set:function(t){var e=this.u;e.y!==t&&(e.ea(),e.y=t,e.freeze())}},x:{get:function(){return this.l.x},set:function(t){var e=this.l;e.x!==t&&(e.ea(),e.x=t,e.freeze())}},y:{get:function(){return this.l.y},set:function(t){var e=this.l;e.y!==t&&(e.ea(),e.y=t,e.freeze())}},width:{get:function(){return this.l.width},set:function(t){var e=this.l;e.width!==t&&(e.ea(),e.width=t,e.freeze())}},height:{get:function(){return this.l.height},set:function(t){var e=this.l;e.height!==t&&(e.ea(),e.height=t,e.freeze())}},network:{get:function(){return this.Tc},set:function(t){this.Tc=t}},sourceVertexes:{get:function(){for(var t=new nt,e=this.sourceEdges;e.next();)t.add(e.value.fromVertex);return t.iterator}},destinationVertexes:{get:function(){for(var t=new nt,e=this.destinationEdges;e.next();)t.add(e.value.toVertex);return t.iterator}},vertexes:{get:function(){for(var t=new nt,e=this.sourceEdges;e.next();)t.add(e.value.fromVertex);for(e=this.destinationEdges;e.next();)t.add(e.value.toVertex);return t.iterator}},sourceEdges:{get:function(){return this.td.iterator}},destinationEdges:{get:function(){return this.Gd.iterator}},edges:{get:function(){for(var t=new et,e=this.sourceEdges;e.next();)t.add(e.value);for(e=this.destinationEdges;e.next();)t.add(e.value);return t.iterator}},edgesCount:{get:function(){return this.td.count+this.Gd.count}}}),rd.prototype.deleteDestinationEdge=rd.prototype.Mv,rd.prototype.addDestinationEdge=rd.prototype.Cv,rd.prototype.deleteSourceEdge=rd.prototype.Nv,rd.prototype.addSourceEdge=rd.prototype.Ev,rd.className="LayoutVertex",rd.standardComparer=sd,rd.smartComparer=function(t,e){if(null!==t){if(null!==e){t=t.Mi;var i=e.Mi;if(null!==t){if(null!==i){for(e=t.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),t=i.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),i=0;i<e.length;i++)if(""!==t[i]&&void 0!==t[i]){var n=parseFloat(e[i]),o=parseFloat(t[i]);if(isNaN(n)){if(!isNaN(o))return 1;if(0!==e[i].localeCompare(t[i]))return e[i].localeCompare(t[i])}else{if(isNaN(o))return-1;if(0!==n-o)return n-o}}else if(""!==e[i])return 1;return""!==t[i]&&void 0!==t[i]?-1:0}return 1}return null!==i?-1:0}return 1}return null!==e?-1:0},ad.prototype.clear=function(){this.ed=this.Yc=this.Nl=this.ob=null},ad.prototype.serializeEdgeProperties=function(t){t.id=st(this),t.key=this.link?this.link.key:this.data?this.data.Di:void 0,void 0===t.key&&(t.key=null),t.from=this.fromVertex?st(this.fromVertex):null,t.fB=this.toVertex?st(this.toVertex):null},ad.prototype.deserializeEdgeProperties=function(t,e){if(null!==t){var i=e.get(t.from);i&&(this.fromVertex=i),(t=e.get(t.fB))&&(this.toVertex=t)}},ad.prototype.toString=function(t){void 0===t&&(t=0);var e="LayoutEdge#"+st(this);return 0<t&&(e+=null!==this.Nl?"("+this.Nl.toString()+")":"",1<t&&(e+=" "+(this.Yc?this.Yc.toString():"null")+" --\x3e "+(this.ed?this.ed.toString():"null"))),e},ad.prototype.Rm=function(){var t=this.Yc;this.Yc=this.ed,this.ed=t},ad.prototype.commit=function(){},ad.prototype.zy=function(t){return this.ed===t?this.Yc:this.Yc===t?this.ed:null},d.Object.defineProperties(ad.prototype,{network:{get:function(){return this.Sc},set:function(t){this.Sc=t}},data:{get:function(){return this.ob},set:function(t){this.ob!==t&&(this.ob=t)}},link:{get:function(){return this.Nl},set:function(t){this.Nl!==t&&(this.Nl=t)}},fromVertex:{get:function(){return this.Yc},set:function(t){this.Yc!==t&&(this.Yc=t)}},toVertex:{get:function(){return this.ed},set:function(t){this.ed!==t&&(this.ed=t)}}}),ad.prototype.getOtherVertex=ad.prototype.zy,ad.className="LayoutEdge",f(hd,zf),hd.prototype.cloneProtected=function(t){zf.prototype.cloneProtected.call(this,t),t.sq=this.sq,t.rq=this.rq,t.Qg.assign(this.Qg),t.lf.assign(this.lf),t.yb=this.yb,t.Eb=this.Eb,t.bd=this.bd,t.Wc=this.Wc},hd.prototype.jb=function(t){t.classType===hd?t===yd||t===md||t===pd||t===gd?this.sorting=t:t===fd||t===dd?this.arrangement=t:t===cd||t===ud?this.alignment=t:w("Unknown enum value: "+t):zf.prototype.jb.call(this,t)},hd.prototype.doLayout=function(t){this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var e=this.$x(t);t=this.diagram;for(var i=e.copy().iterator;i.next();){var n=i.value;if(!n.Ph()||null===n.fromNode&&null===n.toNode){if(n.Ta(),n instanceof bc)for(n=n.memberParts;n.next();)e.remove(n.value)}else e.remove(n)}var o=e.ma();if(0!==o.length){switch(this.sorting){case gd:o.reverse();break;case yd:o.sort(this.comparer);break;case md:o.sort(this.comparer),o.reverse()}var r=this.wrappingColumn;isNaN(r)&&(r=0);var s=this.wrappingWidth;switch(isNaN(s)&&null!==t?(e=t.padding,s=Math.max(t.viewportBounds.width-e.left-e.right,0)):s=Math.max(this.wrappingWidth,0),0>=r&&0>=s&&(r=1),e=this.spacing.width,isFinite(e)||(e=0),i=this.spacing.height,isFinite(i)||(i=0),null!==t&&t.va("Layout"),n=[],this.alignment){case ud:var a=e,h=i,l=zt.alloc(),u=Math.max(this.cellSize.width,1);if(!isFinite(u))for(var c=u=0;c<o.length;c++){var f=this.nj(o[c],l);u=Math.max(u,f.width)}if(u=Math.max(u+a,1),c=Math.max(this.cellSize.height,1),!isFinite(c))for(f=c=0;f<o.length;f++){var d=this.nj(o[f],l);c=Math.max(c,d.height)}c=Math.max(c+h,1),f=this.arrangement;for(var p=d=this.arrangementOrigin.x,g=this.arrangementOrigin.y,y=0,m=0,v=0;v<o.length;v++){var x=o[v],b=this.nj(x,l),w=Math.ceil((b.width+a)/u)*u,k=Math.ceil((b.height+h)/c)*c;switch(f){case dd:var M=Math.abs(p-b.width);break;default:M=p+b.width}switch((0<r&&y>r-1||0<s&&0<y&&M-d>s)&&(n.push(new zt(0,g,s+a,m)),y=0,p=d,g+=m,m=0),m=Math.max(m,k),f){case dd:b=-b.width;break;default:b=0}switch(x.moveTo(p+b,g),f){case dd:p-=w;break;default:p+=w}y++}n.push(new zt(0,g,s+a,m)),zt.free(l);break;case cd:for(h=s,u=r,c=e,f=i,s=zt.alloc(),d=Math.max(this.cellSize.width,1),r=g=l=0,a=pt.alloc(),p=0;p<o.length;p++)m=o[p],y=this.nj(m,s),m=m.Df(m.locationObject,m.locationSpot,a),l=Math.max(l,m.x),g=Math.max(g,y.width-m.x),r=Math.max(r,m.y);switch(p=this.arrangement,p){case dd:l+=c;break;default:g+=c}d=isFinite(d)?Math.max(d+c,1):Math.max(l+g,1);var S=m=this.arrangementOrigin.x;for(v=this.arrangementOrigin.y,g=0,h>=l&&(h-=l),l=x=0,w=Math.max(this.cellSize.height,1),b=r=0,k=!0,y=pt.alloc(),M=0;M<o.length;M++){var P=o[M],N=this.nj(P,s),C=P.Df(P.locationObject,P.locationSpot,a);if(0<g)switch(p){case dd:S=(S-m-(N.width-C.x))/d,S=_e.aa(Math.round(S),S)?Math.round(S):Math.floor(S),S=S*d+m;break;default:S=(S-m+C.x)/d,S=_e.aa(Math.round(S),S)?Math.round(S):Math.ceil(S),S=S*d+m}else switch(p){case dd:x=S+C.x+N.width;break;default:x=S-C.x}switch(p){case dd:var T=-(S+C.x)+x;break;default:T=S+N.width-C.x-x}if(0<u&&g>u-1||0<h&&0<g&&T>h){for(n.push(new zt(0,k?v-r:v,h+c,b+r+f)),S=0;S<g&&M!==g;S++){T=o[M-g+S];var A=T.Df(T.locationObject,T.locationSpot,y);T.moveTo(T.position.x,T.position.y+r-A.y)}b+=f,v=k?v+b:v+(b+r),g=b=r=0,S=m,k=!1}switch(S===m&&(l=p===dd?Math.max(l,N.width-C.x):Math.min(l,-C.x)),r=Math.max(r,C.y),b=Math.max(b,N.height-C.y),isFinite(w)&&(b=Math.max(b,Math.max(N.height,w)-C.y)),k?P.moveTo(S-C.x,v-C.y):P.moveTo(S-C.x,v),p){case dd:S-=C.x+c;break;default:S+=N.width-C.x+c}g++}if(n.push(new zt(0,v,h+c,(k?b:b+r)+f)),o.length!==g)for(h=0;h<g;h++)u=o[o.length-g+h],c=u.Df(u.locationObject,u.locationSpot,a),u.moveTo(u.position.x,u.position.y+r-c.y);if(pt.free(a),pt.free(y),p===dd)for(o=0;o<n.length;o++)r=n[o],r.width+=l,r.x-=l;else for(o=0;o<n.length;o++)r=n[o],r.x>l&&(r.width+=r.x-l,r.x=l);zt.free(s)}for(a=r=s=o=0;a<n.length;a++)h=n[a],o=Math.min(o,h.x),s=Math.min(s,h.y),r=Math.max(r,h.x+h.width);this.arrangement===dd?this.commitLayers(n,new pt(o+e/2-(r+o),s-i/2)):this.commitLayers(n,new pt(o-e/2,s-i/2)),null!==t&&t.Xa("Layout"),this.isValidLayout=!0}},hd.prototype.commitLayers=function(){},d.Object.defineProperties(hd.prototype,{wrappingWidth:{get:function(){return this.sq},set:function(t){this.sq!==t&&(0<t||isNaN(t))&&(this.sq=t,this.isViewportSized=isNaN(t),this.B())}},wrappingColumn:{get:function(){return this.rq},set:function(t){this.rq!==t&&(0<t||isNaN(t))&&(this.rq=t,this.B())}},cellSize:{get:function(){return this.Qg},set:function(t){this.Qg.w(t)||(this.Qg.assign(t),this.B())}},spacing:{get:function(){return this.lf},set:function(t){this.lf.w(t)||(this.lf.assign(t),this.B())}},alignment:{get:function(){return this.yb},set:function(t){this.yb===t||t!==cd&&t!==ud||(this.yb=t,this.B())}},arrangement:{get:function(){return this.Eb},set:function(t){this.Eb===t||t!==fd&&t!==dd||(this.Eb=t,this.B())}},sorting:{get:function(){return this.bd},set:function(t){this.bd===t||t!==pd&&t!==gd&&t!==yd&&t!==md||(this.bd=t,this.B())}},comparer:{get:function(){return this.Wc},set:function(t){this.Wc!==t&&(this.Wc=t,this.B())}}});var ud=new U(hd,"Position",0),cd=new U(hd,"Location",1),fd=new U(hd,"LeftToRight",2),dd=new U(hd,"RightToLeft",3),pd=new U(hd,"Forward",4),gd=new U(hd,"Reverse",5),yd=new U(hd,"Ascending",6),md=new U(hd,"Descending",7);function vd(){this.lp=new nt,this.No=new nt,this.Ea=new nt,this.Ue=new dt,this.Te=new dt,this.Qj=new dt,this.C=null,this.mr=!1}function xd(t,e,i){if(void 0!==e&&null!==e&&!t.diagram.undoManager.isUndoingRedoing&&!t.Ue.contains(e)){void 0===i&&(i=!0);t:{if(void 0!==e&&null!==e&&!t.C.undoManager.isUndoingRedoing&&!t.Ue.contains(e)){var n=t.Iq(e),o=bd(t,e,n);if(null!==o&&(ul(o),o=o.copy(),null!==o)){var r=t.diagram.skipsModelSourceBindings;t.diagram.skipsModelSourceBindings=!0,o.Nf=n,o.ob=e,t.mr&&(o.ih="Tool"),t.diagram.add(o),o.ob=null,o.data=e,t.diagram.skipsModelSourceBindings=r,n=o;break t}}n=null}null!==n&&i&&t.resolveReferencesForData(e)}}function bd(t,e,i){t=t.C;var n=t.model;return n.Dk()&&n.fw(e)?(e=t.groupTemplateMap.G(i),null===e&&(e=t.groupTemplateMap.G(""),null===e&&(Cd||(Cd=!0,S('No Group template found for category "'+i+'"'),S("  Using default group template")),e=t.Eu))):(e=t.nodeTemplateMap.G(i),null===e&&(e=t.nodeTemplateMap.G(""),null===e&&(Nd||(Nd=!0,S('No Node template found for category "'+i+'"'),S("  Using default node template")),e=t.Gu))),e}function wd(t,e,i){for(var n in i){var o=e[n],r=i[n];if(C(r)){if(!C(o)||o.length<r.length)return!1;for(var s=0;s<o.length;s++){var a=r[s];if(void 0!==a&&!kd(t,o[s],a))return!1}}else if(!kd(t,o,r))return!1}return!0}function kd(t,e,i){if("function"===typeof i){if(!i(e))return!1}else if(i instanceof RegExp){if(!e||!i.test(e.toString()))return!1}else if(N(e)&&N(i)){if(!wd(t,e,i))return!1}else if(e!==i)return!1;return!0}function Md(t,e){var i=e.Ci;if(C(i)){var n=t.Qj.G(i);if(null===n)n=[],n.push(e),t.Qj.add(i,n);else{for(t=0;t<n.length;t++)if(n[t]===e)return;n.push(e)}}}function Sd(t,e,i){Jh(e,(function(t){t=t.W.j;for(var e=t.length,n=0;n<e;n++)Wr(i,t[n])}));var n=e.Ci;if(C(n)){var o=t.Qj.G(n);if(null!==o)for(var r=0;r<o.length;r++)if(o[r]===e){o.splice(r,1),0===o.length&&t.Qj.remove(n);break}}}function Pd(t,e,i,n,o){if(null===e||o&&!e.canCopy())return null;if(n.contains(e))return n.G(e);var r=t.copyPartData(e,i);if(!(r instanceof Lu))return null;if(r.isSelected=!1,r.isHighlighted=!1,n.add(e,r),e instanceof ec){for(var s=e.linksConnected;s.next();){var a=s.value;if(a.fromNode===e){var h=n.G(a);null!==h&&(h.fromNode=r)}a.toNode===e&&(a=n.G(a),null!==a&&(a.toNode=r))}if(e instanceof bc&&r instanceof bc)for(e=e.memberParts;e.next();)s=Pd(t,e.value,i,n,o),s instanceof Nc||null===s||(s.containingGroup=r)}else if(e instanceof Nc&&r instanceof Nc)for(s=e.fromNode,null!==s&&(s=n.G(s),null!==s&&(r.fromNode=s)),s=e.toNode,null!==s&&(s=n.G(s),null!==s&&(r.toNode=s)),e=e.labelNodes;e.next();)s=Pd(t,e.value,i,n,o),null!==s&&s instanceof ec&&(s.labeledLink=r);return r}hd.className="GridLayout",hd.standardComparer=ld,hd.smartComparer=function(t,e){if(null!==t){if(null!==e){t=t.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=e.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/);for(var i=0;i<t.length;i++)if(""!==e[i]&&void 0!==e[i]){var n=parseFloat(t[i]),o=parseFloat(e[i]);if(isNaN(n)){if(!isNaN(o))return 1;if(0!==t[i].localeCompare(e[i]))return t[i].localeCompare(e[i])}else{if(isNaN(o))return-1;if(0!==n-o)return n-o}}else if(""!==t[i])return 1;return""!==e[i]&&void 0!==e[i]?-1:0}return 1}return null!==e?-1:0},hd.Position=ud,hd.Location=cd,hd.LeftToRight=fd,hd.RightToLeft=dd,hd.Forward=pd,hd.Reverse=gd,hd.Ascending=yd,hd.Descending=md,i=vd.prototype,i.clear=function(){this.lp.clear(),this.No.clear(),this.Ea.clear(),this.Ue.clear(),this.Te.clear(),this.Qj.clear()},i.ee=function(t){this.C=t},i.oj=function(t){if(t instanceof ec){if(this.lp.add(t),t instanceof bc){var e=t.containingGroup;null===e?this.C.Dh.add(t):e.Sl.add(t),e=t.layout,null!==e&&(e.diagram=this.C)}}else t instanceof Nc?this.No.add(t):t instanceof Qu||this.Ea.add(t);e=t.data,null===e||t instanceof Qu||(t instanceof Nc?this.Te.add(e,t):this.Ue.add(e,t))},i.Lc=function(t){if(t.nk(),t instanceof ec){if(this.lp.remove(t),t instanceof bc){var e=t.containingGroup;null===e?this.C.Dh.remove(t):e.Sl.remove(t),e=t.layout,null!==e&&(e.diagram=null)}}else t instanceof Nc?this.No.remove(t):t instanceof Qu||this.Ea.remove(t);e=t.data,null===e||t instanceof Qu||(t instanceof Nc?this.Te.remove(e):this.Ue.remove(e))},i.Md=function(){for(var t=this.C.nodeTemplateMap.iterator;t.next();){var e=t.value,i=t.key;(!e.Nc()||e instanceof bc)&&w('Invalid node template in Diagram.nodeTemplateMap: template for "'+i+'" must be a Node or a simple Part, not a Group or Link: '+e)}for(t=this.C.groupTemplateMap.iterator;t.next();)e=t.value,i=t.key,e instanceof bc||w('Invalid group template in Diagram.groupTemplateMap: template for "'+i+'" must be a Group, not a normal Node or Link: '+e);for(t=this.C.linkTemplateMap.iterator;t.next();)e=t.value,i=t.key,e instanceof Nc||w('Invalid link template in Diagram.linkTemplateMap: template for "'+i+'" must be a Link, not a normal Node or simple Part: '+e);for(t=j(),e=this.C.selection.iterator;e.next();)(i=e.value.data)&&t.push(i);for(e=j(),i=this.C.highlighteds.iterator;i.next();){var n=i.value.data;n&&e.push(n)}for(i=j(),n=this.nodes.iterator;n.next();){var o=n.value;null!==o.data&&(i.push(o.data),i.push(o.location))}for(n=this.links.iterator;n.next();)o=n.value,null!==o.data&&(i.push(o.data),i.push(o.location));for(n=this.parts.iterator;n.next();)o=n.value,null!==o.data&&(i.push(o.data),i.push(o.location));for(this.removeAllModeledParts(),this.addAllModeledParts(),n=0;n<t.length;n++)o=this.zc(t[n]),null!==o&&(o.isSelected=!0);for(n=0;n<e.length;n++)o=this.zc(e[n]),null!==o&&(o.isHighlighted=!0);for(n=0;n<i.length;n+=2)o=this.zc(i[n]),null!==o&&(o.location=i[n+1]);O(t),O(e),O(i)},vd.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},vd.prototype.addModeledParts=function(t,e){var i=this,n=this.diagram.model;t.forEach((function(t){n.ab(t)&&xd(i,t,!1)})),t.forEach((function(t){n.ab(t)&&i.resolveReferencesForData(t)})),!1!==e&&Jr(this.diagram,!1)},vd.prototype.insertLink=function(){return null},vd.prototype.resolveReferencesForData=function(){},vd.prototype.Iq=function(t){return this.C.model.Iq(t)},vd.prototype.getLinkCategoryForData=function(){return""},vd.prototype.setLinkCategoryForData=function(){},vd.prototype.setFromNodeForLink=function(){},vd.prototype.setToNodeForLink=function(){},vd.prototype.findLinkTemplateForCategory=function(t){var e=this.C.linkTemplateMap.G(t);return null===e&&(e=this.C.linkTemplateMap.G(""),null===e&&(Td||(Td=!0,S('No Link template found for category "'+t+'"'),S("  Using default link template")),e=this.C.Fu)),e},vd.prototype.removeAllModeledParts=function(){this.fu(this.diagram.model.nodeDataArray)},vd.prototype.fu=function(t){var e=this;t.forEach((function(t){e.$q(t)}))},vd.prototype.$q=function(t){t=this.zc(t),null!==t&&(Fr(this.diagram,t,!1),this.unresolveReferencesForPart(t))},vd.prototype.unresolveReferencesForPart=function(){},vd.prototype.removeDataForLink=function(){},vd.prototype.findPartForKey=function(t){return null===t||void 0===t?null:(t=this.C.model.Kb(t),null!==t?this.Ue.G(t):null)},vd.prototype.Cb=function(t){return null===t||void 0===t?null:(t=this.C.model.Kb(t),null===t?null:(t=this.Ue.G(t),t instanceof ec?t:null))},vd.prototype.findLinkForKey=function(){return null},i=vd.prototype,i.zc=function(t){if(null===t)return null;var e=this.Ue.G(t);return null!==e?e:e=this.Te.G(t)},i.gj=function(t){return null===t?null:(t=this.Ue.G(t),t instanceof ec?t:null)},i.yc=function(t){return null===t?null:this.Te.G(t)},i.It=function(t){for(var e=0;e<arguments.length;++e);e=new nt;for(var i=this.lp.iterator;i.next();){var n=i.value,o=n.data;if(null!==o)for(var r=0;r<arguments.length;r++){var s=arguments[r];if(N(s)&&wd(this,o,s)){e.add(n);break}}}return e.iterator},i.Ht=function(t){for(var e=0;e<arguments.length;++e);e=new nt;for(var i=this.No.iterator;i.next();){var n=i.value,o=n.data;if(null!==o)for(var r=0;r<arguments.length;r++){var s=arguments[r];if(N(s)&&wd(this,o,s)){e.add(n);break}}}return e.iterator},vd.prototype.doModelChanged=function(t){if(this.C){var e=this.C;if(t.model===e.model){var i=t.change;if(e.doModelChanged(t),e.Z){e.Z=!1;try{var n=t.modelChange;if(""!==n)if(i===Pi){if("nodeCategory"===n){var o=this.zc(t.object),r=t.newValue;null!==o&&"string"===typeof r&&(o.category=r)}else"nodeDataArray"===n&&(this.fu(t.oldValue),this.addModeledParts(t.newValue));e.isModified=!0}else if(i===Ni){var s=t.newValue;"nodeDataArray"===n&&N(s)&&xd(this,s),e.isModified=!0}else if(i===Ci){var a=t.oldValue;"nodeDataArray"===n&&N(a)&&this.$q(a),e.isModified=!0}else i===Si&&("SourceChanged"===n?null!==t.object?this.updateDataBindings(t.object,t.propertyName):(this.ir(),this.updateAllTargetBindings()):"ModelDisplaced"===n&&this.Md());else if(i===Pi){var h=t.propertyName,l=t.object;l===e.model?"nodeKeyProperty"!==h&&"nodeCategoryProperty"!==h||e.undoManager.isUndoingRedoing||this.Md():this.updateDataBindings(l,h),e.isModified=!0}else if(i===Ni||i===Ci){var u=t.change===Ni,c=u?t.newParam:t.oldParam,f=u?t.newValue:t.oldValue,d=this.Qj.G(t.object);if(Array.isArray(d))for(t=0;t<d.length;t++){var p=d[t];if(u)dl(p,f,c);else if(!(0>c)){var g=c+fl(p);p.Lc(g,!0),pl(p,g,c)}}e.isModified=!0}}finally{e.Z=!0}}}}},vd.prototype.updateAllTargetBindings=function(t){void 0===t&&(t="");for(var e=this.parts.iterator;e.next();)e.value.Da(t);for(e=this.nodes.iterator;e.next();)e.value.Da(t);for(e=this.links.iterator;e.next();)e.value.Da(t)},vd.prototype.ir=function(){for(var t=this.C.model,e=new nt,i=t.nodeDataArray,n=0;n<i.length;n++)e.add(i[n]);var o=[];for(this.nodes.each((function(t){null===t.data||e.contains(t.data)||o.push(t.data)})),this.parts.each((function(t){null===t.data||e.contains(t.data)||o.push(t.data)})),o.forEach((function(e){Qd(t,e,!1)})),n=0;n<i.length;n++){var r=i[n];null===this.zc(r)&&Zd(t,r,!1)}for(this.refreshDataBoundLinks(),i=this.parts.iterator;i.next();)i.value.updateRelationshipsFromData();for(i=this.nodes.iterator;i.next();)i.value.updateRelationshipsFromData();for(i=this.links.iterator;i.next();)i.value.updateRelationshipsFromData()},vd.prototype.refreshDataBoundLinks=function(){},vd.prototype.updateRelationshipsFromData=function(){},vd.prototype.updateDataBindings=function(t,e){if("string"===typeof e){var i=this.zc(t);if(null!==i)i.Da(e);else{i=null;for(var n=this.Qj.iterator;n.next();){for(var o=n.value,r=0;r<o.length;r++){var s=o[r].qy(t);null!==s&&(null===i&&(i=j()),i.push(s))}if(null!==i)break}if(null!==i){for(n=0;n<i.length;n++)i[n].Da(e);O(i)}}t===this.diagram.model.modelData&&this.updateAllTargetBindings(e)}},vd.prototype.tk=function(t,e,i){void 0===i&&(i=!1);var n=new dt;if(C(t))for(var o=0;o<t.length;o++)Pd(this,t[o],e,n,i);else for(t=t.iterator;t.next();)Pd(this,t.value,e,n,i);if(null!==e){i=e.model,t=e.toolManager.findTool("Dragging"),t=null!==t?t.dragOptions.dragsLink:e.kl.dragsLink,o=new nt;for(var r=new dt,s=n.iterator;s.next();){var a=s.value;if(a instanceof Nc)t||null!==a.fromNode&&null!==a.toNode||o.add(a);else if(a instanceof ec&&null!==a.data&&i.Em()){var h=a;a=s.key;var l=a.Fg();null!==l&&(l=n.G(l),null!==l?(i.fe(h.data,i.ja(l.data)),h=e.yc(h.data),a=a.jj(),null!==a&&null!==h&&r.add(a,h)):i.fe(h.data,void 0))}}if(0<o.count&&e.gu(o,!1),0<r.count)for(i=r.iterator;i.next();)n.add(i.key,i.value)}if(null!==e&&null!==this.C&&(e=e.model,i=e.afterCopyFunction,null!==i)){var u=new dt;n.each((function(t){null!==t.key.data&&u.add(t.key.data,t.value.data)})),i(u,e,this.C.model)}for(e=n.iterator;e.next();)e.value.Da();return n},vd.prototype.copyPartData=function(t,e){var i=null,n=t.data;if(null!==n&&null!==e){var o=e.model;t instanceof Nc||(n=o.copyNodeData(n),N(n)&&(o.uf(n),i=e.zc(n)))}else ul(t),i=t.copy(),null!==i&&(o=this.C,null!==e?e.add(i):null!==n&&null!==o&&null!==o.commandHandler&&o.commandHandler.copiesClipboardData&&(e=o.model,o=null,i instanceof Nc||(o=e.copyNodeData(n)),N(o)&&(i.data=o)));return i},d.Object.defineProperties(vd.prototype,{nodes:{get:function(){return this.lp}},links:{get:function(){return this.No}},parts:{get:function(){return this.Ea}},diagram:{get:function(){return this.C}},addsToTemporaryLayer:{get:function(){return this.mr},set:function(t){this.mr=t}}}),vd.prototype.updateAllRelationshipsFromData=vd.prototype.ir,vd.prototype.findLinksByExample=vd.prototype.Ht,vd.prototype.findNodesByExample=vd.prototype.It,vd.prototype.findLinkForData=vd.prototype.yc,vd.prototype.findNodeForData=vd.prototype.gj,vd.prototype.findPartForData=vd.prototype.zc,vd.prototype.findNodeForKey=vd.prototype.Cb,vd.prototype.removeModeledPart=vd.prototype.$q,vd.prototype.removeModeledParts=vd.prototype.fu,vd.prototype.rebuildParts=vd.prototype.Md;var Nd=!1,Cd=!1,Td=!1;function Ad(t){vd.apply(this,arguments)}function Ld(t,e){e.forEach((function(e){jd(t,e)})),Jr(t.diagram,!1)}function jd(t,e){if(void 0!==e&&null!==e&&!t.diagram.undoManager.isUndoingRedoing&&!t.Te.contains(e)){var i=t.getLinkCategoryForData(e),n=t.findLinkTemplateForCategory(i);if(null!==n){ul(n);var o=n.copy();if(null!==o){n=t.diagram.skipsModelSourceBindings,t.diagram.skipsModelSourceBindings=!0,o.Nf=i,o.ob=e,i=t.diagram.model;var r=bp(i,e,!0);""!==r&&(o.fromPortId=r),r=vp(i,e,!0),void 0!==r&&(r=t.Cb(r),r instanceof ec&&(o.fromNode=r)),r=bp(i,e,!1),""!==r&&(o.toPortId=r),r=vp(i,e,!1),void 0!==r&&(r=t.Cb(r),r instanceof ec&&(o.toNode=r)),i=i.Bf(e),Array.isArray(i)&&i.forEach((function(e){e=t.Cb(e),null!==e&&(e.labeledLink=o)})),t.mr&&(o.ih="Tool"),t.diagram.add(o),o.ob=null,o.data=e,t.diagram.skipsModelSourceBindings=n}}}}function Od(t,e){e.forEach((function(e){t.$q(e)}))}function Dd(){vd.apply(this,arguments),this.rh=null}function Fd(t,e,i){if(null!==e&&null!==i){var n=t.diagram.toolManager.findTool("Linking"),o=e,r=i;if(t.diagram.isTreePathToChildren){for(e=r.linksConnected;e.next();)if(e.value.toNode===r)return}else for(o=i,r=e,e=o.linksConnected;e.next();)if(e.value.fromNode===o)return;if((null===n||!fn(n,o,r,null,!0))&&(n=t.getLinkCategoryForData(i.data),e=t.findLinkTemplateForCategory(n),null!==e&&(ul(e),e=e.copy(),null!==e))){var s=t.diagram.skipsModelSourceBindings;t.diagram.skipsModelSourceBindings=!0,e.Nf=n,e.ob=i.data,e.fromNode=o,e.toNode=r,t.diagram.add(e),e.ob=null,e.data=i.data,t.diagram.skipsModelSourceBindings=s}}}function Bd(t){this.Oi=new nt,this.Li=new nt,this.tu=',\n  "insertedNodeKeys": ',this.lx=',\n  "modifiedNodeData": ',this.vu=',\n  "removedNodeKeys": ',this.Yh=null,ot(this),this.Ln=this.oa="",this.$f=!1,this.l={},this.Fc=[],this.Wa=new dt,this.Ni="key",this.il=this.Pl=null,this.Cn=this.Dn=!1,this.Fn=!0,this.kn=null,this.Yj="category",this.Tf=new dt,this.cv=new et,this.vg=!1,this.u=null,this.undoManager=new Ai,void 0!==t&&(this.nodeDataArray=t)}function Id(t,e,i,n,o,r){function s(t,i){a?(void 0===t.__gohashid&&r.push(t),n.set(t,i)):(t=at++,n.set(t,i),o.set(t,e))}if(!N(e))return e;r||(r=[]);var a=Object.isExtensible(e);if(n||(n=new dt),a){var h=n.get(e);if(h)return h}else for(o||(o=new dt),h=o.iterator;h.next();){var l=h.key;if(h.value===e&&(l=n.get(l)))return l}if(Array.isArray(e)){h=[],s(e,h);for(var u=0;u<e.length;u++)h.push(Id(t,e[u],!1,n,o,r))}else if(e instanceof pt||e instanceof Bt||e instanceof zt||e instanceof Qt||e instanceof Ge)h=e.copy(),s(e,h);else{if(e instanceof eh||e instanceof We||e instanceof U)return e;if(e instanceof et)h=(new et).addAll(Id(t,e.ma(),!1,n,o,r)),s(e,h);else if(e instanceof nt)h=(new nt).addAll(Id(t,e.ma(),!1,n,o,r)),s(e,h);else if(e instanceof dt)h=(new dt).addAll(Id(t,e.ma(),!1,n,o,r)),s(e,h);else if(e instanceof Date)h=new Date(e.getTime()),s(e,h);else if(e instanceof RegExp)h=new RegExp(e),s(e,h),h.lastIndex=e.lastIndex;else if("function"===typeof e.copy)h=e.copy(),s(e,h);else for(u in h={},s(e,h),e)"__gohashid"!==u&&(h[u]=Id(t,e[u],!1,n,o,r))}return i&&r.forEach((function(t){delete t.__gohashid})),h}function Ed(t){return',\n  "modelData": '+Hd(t,t.modelData)}function Rd(t,e){e=e.modelData,N(e)&&(t.Om(e),t.modelData=e)}function zd(t,e,i,n){if(e===i)return!0;if(typeof e!==typeof i||"function"===typeof e||"function"===typeof i)return!1;if(Array.isArray(e)&&Array.isArray(i)){if(n.G(e)===i)return!0;if(n.add(e,i),e.length!==i.length)return!1;for(var o=0;o<e.length;o++)if(!zd(t,e[o],i[o],n))return!1;return!0}if(N(e)&&N(i)){if(n.G(e)===i)return!0;for(var r in n.add(e,i),e){var s=e[r];if(!Ud(r,s)){var a=i[r];if(void 0===a||!zd(t,s,a,n))return!1}}for(o in i)if(r=i[o],!Ud(o,r)&&(s=e[o],void 0===s||!zd(t,s,r,n)))return!1;return!0}return!1}function Vd(t,e,i){t[i]!==e[i]&&w("Model.computeJsonDifference: Model."+i+' is not the same in both models: "'+t[i]+'" and "'+e[i]+'"')}function Gd(t,e){function i(t,e){if((e=e.part)&&(e=e.data,t!==e)){var i=n.get(t);null===i?(i=new nt,i.add(e),n.add(t,i)):i.add(e)}}var n=t.Yh;null===n&&(n=new dt,e.changes.each((function(t){if(null!==t.diagram){var e=t.change;e===Pi?(t=t.object.panel)&&(e=t.data)&&i(e,t):e!==Ni&&e!==Ci||(t=t.object,(e=t.itemArray)&&i(e,t))}})),t.Yh=n)}function Yd(t,e){for(var i=new nt,n=0;n<t.nodeDataArray.length;n++){var o=t.nodeDataArray[n];Xd(t,e,o,o,i)}return i}function Xd(t,e,i,n,o){if(Array.isArray(i))for(var r=0;r<i.length;r++){var s=i[r];if(s===e)return o.add(n),!0;if(Xd(t,e,s,n,o))return!0}else if(N(i)&&Object.getPrototypeOf(i)===Object.prototype)for(r in i){if(s=i[r],s===e)return o.add(n),!0;if(Xd(t,e,s,n,o))return!0}return!1}function qd(t,e,i){void 0===i&&(i=!1);var n=e.length;if(0>=n)return"[]";var o=new H;o.add("["),i&&1<n&&o.add("\n");for(var r=0;r<n;r++){var s=e[r];void 0!==s&&(0<r&&(o.add(","),i&&o.add("\n")),o.add(t.bn(s)))}return i&&1<n&&o.add("\n"),o.add("]"),o.toString()}function Ud(t,e){return void 0===e||"__gohashid"===t||"_"===t[0]||"function"===typeof e}function Kd(t){return isNaN(t)?"NaN":1/0===t?"9e9999":-1/0===t?"-9e9999":t}function Hd(t,e){var i=e;if(i instanceof pt)e={class:"go.Point",x:Kd(i.x),y:Kd(i.y)};else if(i instanceof Bt)e={class:"go.Size",width:Kd(i.width),height:Kd(i.height)};else if(i instanceof zt)e={class:"go.Rect",x:Kd(i.x),y:Kd(i.y),width:Kd(i.width),height:Kd(i.height)};else if(i instanceof Qt)e={class:"go.Margin",top:Kd(i.top),right:Kd(i.right),bottom:Kd(i.bottom),left:Kd(i.left)};else if(i instanceof Ge)e=i.kb()?{class:"go.Spot",x:Kd(i.x),y:Kd(i.y),offsetX:Kd(i.offsetX),offsetY:Kd(i.offsetY)}:{class:"go.Spot",enum:i.toString()};else if(i instanceof eh){if(e={class:"go.Brush",type:i.type.name},i.type===gh?e.color=i.color:i.type!==yh&&i.type!==mh||(e.start=i.start,e.end=i.end,i.type===mh&&(0!==i.startRadius&&(e.startRadius=Kd(i.startRadius)),isNaN(i.endRadius)||(e.endRadius=Kd(i.endRadius)))),null!==i.colorStops){var n={};for(i=i.colorStops.iterator;i.next();)n[i.key]=i.value;e.colorStops=n}}else i instanceof We?(e={class:"go.Geometry",type:i.type.name},0!==i.startX&&(e.startX=Kd(i.startX)),0!==i.startY&&(e.startY=Kd(i.startY)),0!==i.endX&&(e.endX=Kd(i.endX)),0!==i.endY&&(e.endY=Kd(i.endY)),i.spot1.w(ne)||(e.spot1=i.spot1),i.spot2.w(ce)||(e.spot2=i.spot2),i.type===li&&(e.path=Je(i))):i instanceof U&&(e={class:"go.EnumValue",classType:rp(t,i.classType),name:i.name});for(var o in n="{",i=!0,e){var r=ap(e,o);if(!Ud(o,r))if(i?i=!1:n+=",",n+=JSON.stringify(o)+":","points"===o&&r instanceof et){var s="[";for(r=r.iterator;r.next();){var a=r.value;1<s.length&&(s+=","),s+=t.bn(a.x),s+=",",s+=t.bn(a.y)}s+="]",n+=s}else n+=t.bn(r)}return n+"}"}function _d(t){return"number"===typeof t?t:"NaN"===t?NaN:"9e9999"===t?1/0:"-9e9999"===t?-1/0:parseFloat(t)}function Wd(t){if("object"!==typeof t)return t;var e=t["class"]||"";if("NaN"===e)return NaN;if("Date"===e)return new Date(t.value);if(0!==e.indexOf("go."))return t;e=e.substr(3);var i=t;if("Point"===e)i=new pt(_d(t.x),_d(t.y));else if("Size"===e)i=new Bt(_d(t.width),_d(t.height));else if("Rect"===e)i=new zt(_d(t.x),_d(t.y),_d(t.width),_d(t.height));else if("Margin"===e)i=new Qt(_d(t.top),_d(t.right),_d(t.bottom),_d(t.left));else if("Spot"===e)i="string"===typeof t["enum"]?Xe(t["enum"]):new Ge(_d(t.x),_d(t.y),_d(t.offsetX),_d(t.offsetY));else if("Brush"===e){if(i=new eh,i.type=K(eh,t.type),"string"===typeof t.color&&(i.color=t.color),t.start instanceof Ge&&(i.start=t.start),t.end instanceof Ge&&(i.end=t.end),"number"===typeof t.startRadius&&(i.startRadius=_d(t.startRadius)),"number"===typeof t.endRadius&&(i.endRadius=_d(t.endRadius)),t=t.colorStops,N(t))for(var n in t)i.addColorStop(parseFloat(n),t[n])}else"Geometry"===e?(i=null,i="string"===typeof t.path?Ze(t.path):new We,i.type=K(We,t.type),"number"===typeof t.startX&&(i.startX=_d(t.startX)),"number"===typeof t.startY&&(i.startY=_d(t.startY)),"number"===typeof t.endX&&(i.endX=_d(t.endX)),"number"===typeof t.endY&&(i.endY=_d(t.endY)),t.spot1 instanceof Ge&&(i.spot1=t.spot1),t.spot2 instanceof Ge&&(i.spot2=t.spot2)):"EnumValue"===e&&(n=t.classType,0===n.indexOf("go.")&&(n=n.substr(3)),n=sp(n),"function"===typeof n&&(i=K(n,t.name)));return i}function $d(t,e,i,n,o,r,s,a,h){void 0===a&&(a=null),void 0===h&&(h=null);var l=new Mi;l.model=t,l.change=i,l.modelChange=e,l.propertyName=n,l.object=o,l.oldValue=r,l.oldParam=a,l.newValue=s,l.newParam=h,t.zt(l)}function Jd(t){return"number"===typeof t||"string"===typeof t}function Zd(t,e,i){var n=t.ja(e);void 0!==n&&t.Wa.G(n)===e||(t.Zt(e),n=t.ja(e),void 0===n?w("Model.makeNodeDataKeyUnique failed on "+e+".  Data not added to Model."):(t.Wa.add(n,e),n=null,i&&(n=t.Fc.length,A(t.Fc,n,e)),$d(t,"nodeDataArray",Ni,"nodeDataArray",t,null,e,null,n),t.Qm(e),t.Pm(e)))}function Qd(t,e,i){var n=t.ja(e);if(void 0!==n&&t.Wa.remove(n),n=null,i){t:if(i=t.Fc,Array.isArray(i))n=i.indexOf(e);else{n=i.length;for(var o=0;o<n;o++)if(i[o]===e){n=o;break t}n=-1}if(0>n)return;L(t.Fc,n)}$d(t,"nodeDataArray",Ci,"nodeDataArray",t,e,null,n,null),t.hr(e)}function tp(t,e,i){if(void 0!==e){var n=t.Tf.G(e);null===n&&(n=new nt,t.Tf.add(e,n)),n.add(i)}}function ep(t,e,i){if(void 0!==e){var n=t.Tf.G(e);n instanceof nt&&(void 0===i||null===i?t.Tf.remove(e):(n.remove(i),0===n.count&&t.Tf.remove(e)))}}function ip(t,e){return void 0===e?null:(t=t.Tf.G(e),t instanceof nt?t:null)}function np(t,e,i){if(t.copiesArrays&&Array.isArray(e)){var n=[];for(i=0;i<e.length;i++){var o=np(t,e[i],t.copiesArrayObjects);n.push(o)}return ot(n),n}if(i&&N(e)){for(n in i=(i=e.constructor)?new i:{},o=t.copiesKey||"string"!==typeof t.nodeKeyProperty?null:t.nodeKeyProperty,e)if("__gohashid"===n)i.__gohashid=void 0;else if(n===o)i[o]=void 0;else{var r=ap(e,n),s=rp(t,r);"GraphObject"===s||"Diagram"===s||"Layer"===s||"RowColumnDefinition"===s||"AnimationManager"===s||"Tool"===s||"CommandHandler"===s||"Layout"===s||"InputEvent"===s||"DiagramEvent"===s||r instanceof Bd||r instanceof Ai||r instanceof Ti||r instanceof Mi||(r=np(t,r,!1)),hp(i,n,r)}return ot(i),i}return e instanceof pt||e instanceof Bt||e instanceof zt||e instanceof Ge||e instanceof Qt?e.copy():e}function op(){return new Bd}function rp(t,e){if("function"===typeof e){if(e.className)return e.className;if(e.name)return e.name}else if("object"===typeof e&&null!==e&&e.constructor)return rp(t,e.constructor);return typeof e}function sp(t){return up[t]?up[t]:void 0!==y.go&&y.go[t]?y.go[t]:null}function ap(t,e){if(!t||!e)return null;try{if("function"===typeof e)var i=e(t);else"function"===typeof t.getAttribute?(i=t.getAttribute(e),null===i&&(i=void 0)):i=t[e]}catch(n){}return i}function hp(t,e,i){if(t&&e)try{"function"===typeof e?e(t,i):"function"===typeof t.setAttribute?t.setAttribute(e,i):t[e]=i}catch(n){}}vd.className="PartManager",f(Ad,vd),Ad.prototype.addAllModeledParts=function(){var t=this.diagram.model;this.addModeledParts(t.nodeDataArray),Ld(this,t.linkDataArray)},Ad.prototype.addModeledParts=function(t){for(vd.prototype.addModeledParts.call(this,t,!1),t=this.links.iterator;t.next();)Cc(t.value);Jr(this.diagram,!1)},Ad.prototype.removeAllModeledParts=function(){var t=this.diagram.model;Od(this,t.linkDataArray),this.fu(t.nodeDataArray)},Ad.prototype.getLinkCategoryForData=function(t){return this.diagram.model.Lt(t)},Ad.prototype.setLinkCategoryForData=function(t,e){return this.diagram.model.cr(t,e)},Ad.prototype.setFromNodeForLink=function(t,e){var i=this.diagram.model;i.Bw(t.data,i.ja(null!==e?e.data:null))},Ad.prototype.setToNodeForLink=function(t,e){var i=this.diagram.model;i.Gw(t.data,i.ja(null!==e?e.data:null))},Ad.prototype.removeDataForLink=function(t){this.diagram.model.Mm(t.data)},Ad.prototype.findPartForKey=function(t){var e=vd.prototype.findPartForKey.call(this,t);return null===e&&(t=this.diagram.model.Dg(t),null!==t)?this.Te.G(t):e},Ad.prototype.findLinkForKey=function(t){return null===t||void 0===t?null:(t=this.diagram.model.Dg(t),null!==t?this.Te.G(t):null)},Ad.prototype.doModelChanged=function(t){var e=this;if(vd.prototype.doModelChanged.call(this,t),this.diagram){var i=this.diagram;if(t.model===i.model){var n=t.change;if(i.Z){i.Z=!1;try{var o=t.modelChange;if(""!==o){if(n===Pi){if("linkFromKey"===o){var r=this.yc(t.object);if(null!==r){var s=this.Cb(t.newValue);r.fromNode=s}}else if("linkToKey"===o){var a=this.yc(t.object);if(null!==a){var h=this.Cb(t.newValue);a.toNode=h}}else if("linkFromPortId"===o){var l=this.yc(t.object);if(null!==l){var u=t.newValue;"string"===typeof u&&(l.fromPortId=u)}}else if("linkToPortId"===o){var c=this.yc(t.object);if(null!==c){var f=t.newValue;"string"===typeof f&&(c.toPortId=f)}}else if("nodeGroupKey"===o){var d=this.zc(t.object);if(null!==d){var p=t.newValue;if(void 0!==p){var g=this.Cb(p);d.containingGroup=g instanceof bc?g:null}else d.containingGroup=null}}else if("linkLabelKeys"===o){var y=this.yc(t.object);if(null!==y){var m=t.oldValue,v=t.newValue;Array.isArray(m)&&m.forEach((function(t){0<=v.indexOf(t)||(t=e.Cb(t),null!==t&&(t.labeledLink=null))})),Array.isArray(v)&&v.forEach((function(t){t=e.Cb(t),null!==t&&(t.labeledLink=y)}))}}else if("linkCategory"===o){var x=this.yc(t.object),b=t.newValue;null!==x&&"string"===typeof b&&(x.category=b)}else"linkDataArray"===o&&(Od(this,t.oldValue),Ld(this,t.newValue));i.isModified=!0}else if(n===Ni){var w=t.newValue;if("linkDataArray"===o&&"object"===typeof w&&null!==w)jd(this,w);else if("linkLabelKeys"===o&&Jd(w)){var k=this.yc(t.object),M=this.Cb(w);null!==k&&null!==M&&(M.labeledLink=k)}i.isModified=!0}else if(n===Ci){var S=t.oldValue;if("linkDataArray"===o&&"object"===typeof S&&null!==S)this.$q(S);else if("linkLabelKeys"===o&&Jd(S)){var P=this.Cb(S);null!==P&&(P.labeledLink=null)}i.isModified=!0}}else if(n===Pi){var N=t.propertyName;t.object!==i.model||"linkFromKeyProperty"!==N&&"linkToKeyProperty"!==N&&"linkFromPortIdProperty"!==N&&"linkToPortIdProperty"!==N&&"linkLabelKeysProperty"!==N&&"nodeIsGroupProperty"!==N&&"nodeGroupKeyProperty"!==N&&"linkCategoryProperty"!==N||i.undoManager.isUndoingRedoing||this.Md(),i.isModified=!0}}finally{i.Z=!0}}}}},Ad.prototype.refreshDataBoundLinks=function(){var t=this,e=this.diagram.model,i=new nt,n=e.linkDataArray;n.forEach((function(t){i.add(t)}));var o=[];this.links.each((function(t){null===t.data||i.contains(t.data)||o.push(t.data)})),o.forEach((function(t){Mp(e,t,!1)})),n.forEach((function(i){null===t.yc(i)&&kp(e,i,!1)}))},Ad.prototype.updateRelationshipsFromData=function(t){var e=t.data;if(null!==e){var i=t.diagram;if(null!==i){var n=i.model;if(t instanceof Nc){var o=vp(n,e,!0);if(o=i.Cb(o),t.fromNode=o,o=vp(n,e,!1),o=i.Cb(o),t.toNode=o,e=n.Bf(e),0<e.length||0<t.labelNodes.count){if(1===e.length&&1===t.labelNodes.count){o=e[0];var r=t.labelNodes.first();if(n.ja(r.data)===o)return}o=(new nt).addAll(e);var s=new nt;t.labelNodes.each((function(t){null!==t.data&&(t=n.ja(t.data),void 0!==t&&s.add(t))})),e=s.copy(),e.Zq(o),o=o.copy(),o.Zq(s),(0<e.count||0<o.count)&&(e.each((function(e){e=i.Cb(e),null!==e&&e.labeledLink===t&&(e.labeledLink=null)})),o.each((function(e){e=i.Cb(e),null!==e&&e.labeledLink!==t&&(e.labeledLink=t)})))}}else!(t instanceof Qu)&&(e=n.Lh(e),e=i.findPartForKey(e),null===e||e instanceof bc)&&(t.containingGroup=e)}}},Ad.prototype.resolveReferencesForData=function(t){var e=this.diagram.model,i=e.ja(t);if(void 0!==i){var n=ip(e,i),o=this.zc(t);if(null!==n&&null!==o){n=n.iterator;for(var r={};n.next();){var s=n.value;e.ab(s)?o instanceof bc&&e.Lh(s)===i&&(s=this.zc(s),null!==s&&(s.containingGroup=o)):(r.link=this.yc(s),null!==r.link&&o instanceof ec&&(vp(e,s,!0)===i&&(r.link.fromNode=o),vp(e,s,!1)===i&&(r.link.toNode=o),s=e.Bf(s),Array.isArray(s)&&s.some(function(t){return function(e){return e===i&&(o.labeledLink=t.link,!0)}}(r)))),r={link:r.link}}ep(e,i)}t=e.Lh(t),void 0!==t&&(t=this.Cb(t),t instanceof bc&&(o.containingGroup=t))}},Ad.prototype.unresolveReferencesForPart=function(t){var e=this.diagram.model;if(t instanceof ec){var i=e.ja(t.data);if(void 0!==i){for(var n=t.linksConnected;n.next();)tp(e,i,n.value.data);if(t.isLinkLabel&&(n=t.labeledLink,null!==n&&tp(e,i,n.data)),t instanceof bc)for(t=t.memberParts;t.next();)n=t.value.data,e.ab(n)&&tp(e,i,n)}}},Ad.prototype.copyPartData=function(t,e){var i=vd.prototype.copyPartData.call(this,t,e);if(t instanceof Nc)if(t=t.data,null!==t&&null!==e){var n=e.model;t=n.Aq(t),"object"===typeof t&&null!==t&&(n.bj(t),i=e.yc(t))}else null!==i&&(e=this.diagram,null!==t&&null!==e&&null!==e.commandHandler&&e.commandHandler.copiesClipboardData&&(e=e.model.Aq(t),"object"===typeof e&&null!==e&&(i.data=e)));return i},Ad.prototype.insertLink=function(t,e,i,n){var o=this.diagram,r=o.model,s=o.toolManager.findTool("Linking"),a="";if(null!==t&&(null===e&&(e=t),a=e.portId,null===a&&(a="")),e="",null!==i&&(null===n&&(n=i),e=n.portId,null===e&&(e="")),n=s.archetypeLinkData,n instanceof Nc){if(ul(n),r=n.copy(),null!==r)return r.fromNode=t,r.fromPortId=a,r.toNode=i,r.toPortId=e,o.add(r),t=s.archetypeLabelNodeData,t instanceof ec&&(ul(t),t=t.copy(),null!==t&&(t.labeledLink=r,o.add(t))),r}else if(null!==n&&(n=r.Aq(n),"object"===typeof n&&null!==n))return null!==t&&xp(r,n,r.ja(t.data),!0),wp(r,n,a,!0),null!==i&&xp(r,n,r.ja(i.data),!1),wp(r,n,e,!1),r.bj(n),t=s.archetypeLabelNodeData,null===t||t instanceof ec||(t=r.copyNodeData(t),"object"===typeof t&&null!==t&&(r.uf(t),t=r.ja(t),void 0!==t&&r.Dv(n,t))),o.yc(n);return null},Ad.prototype.findLinkForKey=Ad.prototype.findLinkForKey,Ad.prototype.findPartForKey=Ad.prototype.findPartForKey,Ad.prototype.removeAllModeledParts=Ad.prototype.removeAllModeledParts,Ad.prototype.addModeledParts=Ad.prototype.addModeledParts,Ad.prototype.addAllModeledParts=Ad.prototype.addAllModeledParts,Ad.className="GraphLinksPartManager",f(Dd,vd),Dd.prototype.getLinkCategoryForData=function(t){return this.diagram.model.Ot(t)},Dd.prototype.setLinkCategoryForData=function(t,e){this.diagram.model.ku(t,e)},Dd.prototype.setFromNodeForLink=function(t,e,i){var n=this.diagram.model;if(void 0===i&&(i=null),e=null!==e?e.data:null,this.diagram.isTreePathToChildren)n.fe(t.data,n.ja(e));else{var o=this.rh;this.rh=t,null!==i&&n.fe(i.data,void 0),n.fe(e,n.ja(null!==t.toNode?t.toNode.data:null)),this.rh=o}},Dd.prototype.setToNodeForLink=function(t,e,i){var n=this.diagram.model;if(void 0===i&&(i=null),e=null!==e?e.data:null,this.diagram.isTreePathToChildren){var o=this.rh;this.rh=t,null!==i&&n.fe(i.data,void 0),n.fe(e,n.ja(null!==t.fromNode?t.fromNode.data:null)),this.rh=o}else n.fe(t.data,n.ja(e))},Dd.prototype.removeDataForLink=function(t){this.diagram.model.fe(t.data,void 0)},Dd.prototype.findLinkForKey=function(t){return null===t||void 0===t?null:(t=this.diagram.model.Kb(t),null!==t?this.Te.G(t):null)},Dd.prototype.doModelChanged=function(t){if(vd.prototype.doModelChanged.call(this,t),this.diagram){var e=this.diagram;if(t.model===e.model){var i=t.change;if(e.Z){e.Z=!1;try{var n=t.modelChange;if(""!==n){if(i===Pi){if("nodeParentKey"===n){var o=t.object,r=this.Cb(t.newValue),s=this.gj(o);if(null!==this.rh)null!==r&&(this.rh.data=o,this.rh.category=this.getLinkCategoryForData(o));else if(null!==s){var a=s.jj();null!==a?null===r?e.remove(a):e.isTreePathToChildren?a.fromNode=r:a.toNode=r:Fd(this,r,s)}}else if("parentLinkCategory"===n){var h=this.gj(t.object),l=t.newValue;if(null!==h&&"string"===typeof l){var u=h.jj();null!==u&&(u.category=l)}}e.isModified=!0}}else if(i===Pi){var c=t.propertyName;t.object===e.model&&"nodeParentKeyProperty"===c&&(e.undoManager.isUndoingRedoing||this.Md()),e.isModified=!0}}finally{e.Z=!0}}}}},Dd.prototype.updateRelationshipsFromData=function(t){var e=t.data;if(null!==e){var i=t.diagram;if(null!==i){var n=i.model;t instanceof ec&&(e=n.Mh(e),e=i.Cb(e),n=t.Fg(),e!==n&&(n=t.jj(),null!==e?null!==n?i.isTreePathToChildren?n.fromNode=e:n.toNode=e:Fd(this,e,t):null!==n&&Fr(i,n,!1)))}}},Dd.prototype.updateDataBindings=function(t,e){vd.prototype.updateDataBindings.call(this,t,e),"string"===typeof e&&null!==this.zc(t)&&(t=this.yc(t),null!==t&&t.Da(e))},Dd.prototype.resolveReferencesForData=function(t){var e=this.diagram.model,i=e.ja(t);if(void 0!==i){var n=ip(e,i),o=this.zc(t);if(null!==n&&null!==o){for(n=n.iterator;n.next();){var r=n.value;e.ab(r)&&o instanceof ec&&e.Mh(r)===i&&Fd(this,o,this.gj(r))}ep(e,i)}t=e.Mh(t),void 0!==t&&o instanceof ec&&(t=this.Cb(t),Fd(this,t,o))}},Dd.prototype.unresolveReferencesForPart=function(t){var e=this.diagram.model;if(t instanceof ec){var i=e.ja(t.data),n=this.yc(t.data);if(null!==n){n.isSelected=!1,n.isHighlighted=!1;var o=n.layer;if(null!==o){var r=o.Lc(-1,n,!1);0<=r&&this.diagram.Va(Ci,"parts",o,n,null,r,null),r=n.layerChanged,null!==r&&r(n,o,null)}}for(n=this.diagram.isTreePathToChildren,t=t.linksConnected;t.next();)o=t.value,o=(n?o.toNode:o.fromNode).data,e.ab(o)&&tp(e,i,o)}},Dd.prototype.insertLink=function(t,e,i){e=this.diagram.model;var n=t,o=i;return this.diagram.isTreePathToChildren||(n=i,o=t),null!==n&&null!==o?(e.fe(o.data,e.ja(n.data)),o.jj()):null},Dd.prototype.findLinkForKey=Dd.prototype.findLinkForKey,Dd.className="TreePartManager",Bd.prototype.cloneProtected=function(t){t.oa=this.oa,t.Ln=this.Ln,t.$f=this.$f,t.Ni=this.Ni,t.Pl=this.Pl,t.il=this.il,t.Dn=this.Dn,t.Cn=this.Cn,t.Fn=this.Fn,t.kn=this.kn,t.Yj=this.Yj},Bd.prototype.copy=function(){var t=new this.constructor;return this.cloneProtected(t),t},Bd.prototype.clear=function(){this.Fc=[],this.Wa.clear(),this.Tf.clear(),this.undoManager.clear()},Bd.prototype.toString=function(t){if(void 0===t&&(t=0),1<t)return this.fr();var e=(""!==this.name?this.name:"")+" Model";if(0<t){e+="\n node data:",t=this.nodeDataArray;for(var i=t.length,n=0;n<i;n++){var o=t[n];e+=" "+this.ja(o)+":"+F(o)}}return e},Bd.prototype.gB=function(t){t.change!==Si&&w("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+t.toString());var e=t.object;return t.isTransactionFinished&&e instanceof Ti?(Gd(this,e),t=this.Yw(e,"FinishedUndo"===t.propertyName),this.Yh=null,t):null},Bd.prototype.Yw=function(t,e){var i=this,n=!1,o=new nt,r=new nt,s=new nt,a=this.Yh;t.changes.each((function(t){t.model===i&&("nodeDataArray"===t.modelChange?t.change===Ni?o.add(t.newValue):t.change===Ci&&s.add(t.oldValue):i.ab(t.object)?r.add(t.object):t.change!==Pi||i.modelData!==t.object&&"modelData"!==t.propertyName?null!==t.object&&(a&&a.contains(t.object)?a.get(t.object).each((function(t){i.ab(t)&&r.add(t)})):t.object instanceof Bd||i.qj()&&i.xc(t.object)||Yd(i,t.object).each((function(t){r.add(t)}))):n=!0)}));var h=this.Li;h.clear(),o.each((function(t){h.add(i.ja(t)),e||r.add(t)}));var l=this.Oi;l.clear(),s.each((function(t){l.add(i.ja(t)),e&&r.add(t)})),t=i.cloneDeep(r.ma());var u=null;return n&&(null===u&&(u={}),u.modelData=this.cloneDeep(this.modelData)),0<h.count&&(null===u&&(u={}),e?u.removedNodeKeys=h.ma():u.insertedNodeKeys=h.ma()),0<t.length&&(null===u&&(u={}),u.modifiedNodeData=t),0<l.count&&(null===u&&(u={}),e?u.insertedNodeKeys=l.ma():u.removedNodeKeys=l.ma()),l.clear(),h.clear(),u},Bd.prototype.cloneDeep=function(t){return Id(this,t,!0)},i=Bd.prototype,i.Vk=function(){var t="";return""!==this.name&&(t+=',\n  "name": '+this.quote(this.name)),""!==this.dataFormat&&(t+=',\n  "dataFormat": '+this.quote(this.dataFormat)),this.isReadOnly&&(t+=',\n  "isReadOnly": '+this.isReadOnly),"key"!==this.nodeKeyProperty&&"string"===typeof this.nodeKeyProperty&&(t+=',\n  "nodeKeyProperty": '+this.quote(this.nodeKeyProperty)),this.copiesArrays&&(t+=',\n  "copiesArrays": true'),this.copiesArrayObjects&&(t+=',\n  "copiesArrayObjects": true'),this.copiesKey||(t+=',\n  "copiesKey": false'),"category"!==this.nodeCategoryProperty&&"string"===typeof this.nodeCategoryProperty&&(t+=',\n  "nodeCategoryProperty": '+this.quote(this.nodeCategoryProperty)),t},i.Xq=function(t){t.name&&(this.name=t.name),t.dataFormat&&(this.dataFormat=t.dataFormat),t.isReadOnly&&(this.isReadOnly=!0),t.nodeKeyProperty&&(this.nodeKeyProperty=t.nodeKeyProperty),t.copiesArrays&&(this.copiesArrays=!0),t.copiesArrayObjects&&(this.copiesArrayObjects=!0),!1===t.copiesKey&&(this.copiesKey=!1),t.nodeCategoryProperty&&(this.nodeCategoryProperty=t.nodeCategoryProperty)},i.Zw=function(){var t,e=this.modelData,i=!1;for(t in e)if(!Ud(t,e[t])){i=!0;break}return e="",i&&(e=Ed(this)),e+',\n  "nodeDataArray": '+qd(this,this.nodeDataArray,!0)},i.rw=function(t){Rd(this,t),t=t.nodeDataArray,C(t)&&(this.Om(t),this.nodeDataArray=t)},i.kr=function(t){Vd(this,t,"nodeKeyProperty");var e=this.Li;e.clear();var i=new nt,n=this.Oi;n.clear(),n.addAll(this.Wa.iteratorKeys);for(var o=new dt,r=t.nodeDataArray,s=r.length,a=0;a<s;a++){var h=r[a],l=t.ja(h);if(void 0!==l){n.remove(l);var u=this.Kb(l);null===u?(e.add(l),i.add(h)):zd(this,u,h,o)||i.add(h)}else this.Zt(h),l=this.ja(h),e.add(l),i.add(h)}return r="",zd(this,this.modelData,t.modelData,o)||(r+=Ed(this)),0<e.count&&(r+=this.tu+qd(this,e.ma(),!0)),0<i.count&&(r+=this.lx+qd(this,i.ma(),!0)),0<n.count&&(r+=this.vu+qd(this,n.ma(),!0)),n.clear(),e.clear(),r},i.Dz=function(t,e){return void 0===e&&(e=rp(this,this)),'{ "class": '+this.quote(e)+', "incremental": 1'+this.Vk()+this.kr(t)+"}"},i.Xw=function(t,e){var i=this,n=!1,o=new nt,r=new nt,s=new nt,a=this.Yh;t.changes.each((function(t){t.model===i&&("nodeDataArray"===t.modelChange?t.change===Ni?o.add(t.newValue):t.change===Ci&&s.add(t.oldValue):i.ab(t.object)?r.add(t.object):t.change!==Pi||i.modelData!==t.object&&"modelData"!==t.propertyName?null!==t.object&&(a&&a.contains(t.object)?a.get(t.object).each((function(t){i.ab(t)&&r.add(t)})):t.object instanceof Bd||i.qj()&&i.xc(t.object)||Yd(i,t.object).each((function(t){r.add(t)}))):n=!0)}));var h=this.Li;h.clear(),o.each((function(t){h.add(i.ja(t)),e||r.add(t)}));var l=this.Oi;return l.clear(),s.each((function(t){l.add(i.ja(t)),e&&r.add(t)})),t="",n&&(t+=Ed(this)),0<h.count&&(t+=(e?this.vu:this.tu)+qd(this,h.ma(),!0)),0<r.count&&(t+=this.lx+qd(this,r.ma(),!0)),0<l.count&&(t+=(e?this.tu:this.vu)+qd(this,l.ma(),!0)),l.clear(),h.clear(),t},i.Wq=function(t){(void 0!==t.name&&t.name!==this.name||void 0!==t.dataFormat&&t.dataFormat!==this.dataFormat||void 0!==t.isReadOnly&&t.isReadOnly!==this.isReadOnly||void 0!==t.nodeKeyProperty&&t.nodeKeyProperty!==this.nodeKeyProperty||void 0!==t.copiesArrays&&t.copiesArrays!==this.copiesArrays||void 0!==t.copiesArrayObjects&&t.copiesArrayObjects!==this.copiesArrayObjects||void 0!==t.copiesKey&&t.copiesKey!==this.copiesKey||void 0!==t.nodeCategoryProperty&&t.nodeCategoryProperty!==this.nodeCategoryProperty)&&w("applyIncrementalJson cannot change Model properties"),Rd(this,t);var e=t.insertedNodeKeys,i=t.modifiedNodeData,n=new dt;if(Array.isArray(i))for(var o=0;o<i.length;o++){var r=i[o],s=this.ja(r);void 0!==s&&null!==s&&n.set(s,r)}if(Array.isArray(e))for(o=e.length,r=0;r<o;r++){s=e[r];var a=this.Kb(s);null===a&&(a=(a=n.get(s))?a:this.copyNodeData({}),this.Vm(a,s),this.uf(a))}if(Array.isArray(i))for(e=i.length,n=0;n<e;n++)if(o=i[n],r=this.ja(o),r=this.Kb(r),null!==r){for(var h in o)"__gohashid"===h||h===this.nodeKeyProperty||this.Ck()&&h===this.nodeIsGroupProperty||this.setDataProperty(r,h,o[h]);this.Wm(o,r)}if(t=t.removedNodeKeys,Array.isArray(t))for(i=t.length,h=0;h<i;h++)e=this.Kb(t[h]),null!==e&&this.Nm(e)},i.Yy=function(t,e){t.change!==Si&&w("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+t.toString());var i=t.object;return t.isTransactionFinished&&i instanceof Ti?(void 0===e&&(e=rp(this,this)),Gd(this,i),t=this.Xw(i,"FinishedUndo"===t.propertyName),this.Yh=null,"2"===e?'{ "incremental": 2'+t+"}":'{ "class": '+this.quote(e)+', "incremental": 1'+this.Vk()+t+"}"):'{ "incremental": 0 }'},i.hB=function(t,e){return this.Yy(t,e)},i.fr=function(t){return void 0===t&&(t=rp(this,this)),'{ "class": '+this.quote(t)+this.Vk()+this.Zw()+"}"},i.toJSON=function(t){return this.fr(t)},i.Xx=function(t){var e=null;if("string"===typeof t)try{e=y.JSON.parse(t)}catch(n){}else"object"===typeof t?e=t:w("Unable to modify a Model from: "+t);var i=e.incremental;"number"!==typeof i&&w("Unable to apply non-incremental changes to Model: "+t),0!==i&&(this.va("applyIncrementalJson"),this.Wq(e),this.Xa("applyIncrementalJson"))},i.vz=function(t){return this.Xx(t)},Bd.constructGraphLinksModel=function(){return new Bd},i=Bd.prototype,i.Om=function(t){if(C(t))for(var e=t.length,i=0;i<e;i++){var n=t[i];if(N(n)){var o=i;n=this.Om(n),Array.isArray(t)?t[o]=n:w("Cannot replace an object in an HTMLCollection or NodeList at "+o)}}else if(N(t)){for(e in t)if(i=t[e],N(i)&&(i=this.Om(i),t[e]=i,"points"===e&&Array.isArray(i))){for(o=0===i.length%2,n=0;n<i.length;n++)if("number"!==typeof i[n]){o=!1;break}if(o){for(o=new et,n=0;n<i.length/2;n++)o.add(new pt(i[2*n],i[2*n+1]));o.freeze(),t[e]=o}}return Wd(t)}return t},i.quote=function(t){for(var e="",i=t.length,n=0;n<i;n++){var o=t[n];if('"'===o||"\\"===o)e+="\\"+o;else if("\b"===o)e+="\\b";else if("\f"===o)e+="\\f";else if("\n"===o)e+="\\n";else if("\r"===o)e+="\\r";else if("\t"===o)e+="\\t";else{var r=t.charCodeAt(n);e=16>r?e+"\\u000"+t.charCodeAt(n).toString(16):32>r?e+"\\u00"+t.charCodeAt(n).toString(16):8232===r?e+"\\u2028":8233===r?e+"\\u2029":e+o}}return'"'+e+'"'},i.bn=function(t){return void 0===t?"undefined":null===t?"null":!0===t?"true":!1===t?"false":"string"===typeof t?this.quote(t):"number"===typeof t?1/0===t?"9e9999":-1/0===t?"-9e9999":isNaN(t)?'{"class":"NaN"}':t.toString():t instanceof Date?'{"class":"Date", "value":"'+t.toJSON()+'"}':t instanceof Number?this.bn(t.valueOf()):C(t)?qd(this,t):N(t)?Hd(this,t):"function"===typeof t?"null":t.toString()},i.Hh=function(t){this.cv.add(t)},i.Tk=function(t){this.cv.remove(t)},i.zt=function(t){this.skipsUndoManager||this.undoManager.aw(t);for(var e=this.cv,i=e.length,n=0;n<i;n++)e.J(n)(t)},i.Va=function(t,e,i,n,o,r,s){$d(this,"",t,e,i,n,o,r,s)},i.g=function(t,e,i,n,o){$d(this,"",Pi,t,this,e,i,n,o)},i.du=function(t,e,i,n,o,r){$d(this,"",Pi,e,t,i,n,o,r)},Bd.prototype.changeState=function(t,e){if(null!==t&&t.model===this)if(t.change===Pi){var i=t.object,n=t.propertyName,o=t.G(e);n===this.nodeKeyProperty&&this.ab(i)&&(e=t.G(!e),void 0!==e&&this.Wa.remove(e),void 0!==o&&this.Wa.add(o,i)),hp(i,n,o)}else t.change===Ni?(i=t.newParam,"nodeDataArray"===t.modelChange?(t=t.newValue,N(t)&&"number"===typeof i&&(n=this.ja(t),e?(this.Fc[i]===t&&L(this.Fc,i),void 0!==n&&this.Wa.remove(n)):(this.Fc[i]!==t&&A(this.Fc,i,t),void 0!==n&&this.Wa.add(n,t)))):""===t.modelChange?((n=t.object)&&!C(n)&&t.propertyName&&(n=ap(t.object,t.propertyName)),C(n)&&"number"===typeof i&&(t=t.newValue,e?L(n,i):A(n,i,t))):w("unknown ChangedEvent.Insert modelChange: "+t.toString())):t.change===Ci?(i=t.oldParam,"nodeDataArray"===t.modelChange?(t=t.oldValue,N(t)&&"number"===typeof i&&(n=this.ja(t),e?(this.Fc[i]!==t&&A(this.Fc,i,t),void 0!==n&&this.Wa.add(n,t)):(this.Fc[i]===t&&L(this.Fc,i),void 0!==n&&this.Wa.remove(n)))):""===t.modelChange?((n=t.object)&&!C(n)&&t.propertyName&&(n=ap(t.object,t.propertyName)),C(n)&&"number"===typeof i&&(t=t.oldValue,e?A(n,i,t):L(n,i))):w("unknown ChangedEvent.Remove modelChange: "+t.toString())):t.change!==Si&&w("unknown ChangedEvent: "+t.toString())},Bd.prototype.va=function(t){return this.undoManager.va(t)},Bd.prototype.Xa=function(t){return this.undoManager.Xa(t)},Bd.prototype.If=function(){return this.undoManager.If()},Bd.prototype.commit=function(t,e){void 0===e&&(e="");var i=this.skipsUndoManager;null===e&&(this.skipsUndoManager=!0,e=""),this.undoManager.va(e);var n=!1;try{t(this),n=!0}finally{n?this.undoManager.Xa(e):this.undoManager.If(),this.skipsUndoManager=i}},i=Bd.prototype,i.Da=function(t,e){void 0===e&&(e=""),$d(this,"SourceChanged",Si,e,t,null,null)},i.ja=function(t){if(null!==t){var e=this.Ni;if(""!==e&&(e=ap(t,e),void 0!==e)){if(Jd(e))return e;w("Key value for node data "+t+" is not a number or a string: "+e)}}},i.Vm=function(t,e){if(null!==t){var i=this.Ni;if(""!==i)if(this.ab(t)){var n=ap(t,i);n!==e&&null===this.Kb(e)&&(hp(t,i,e),void 0!==n&&this.Wa.remove(n),this.Wa.add(e,t),$d(this,"nodeKey",Pi,i,t,n,e),"string"===typeof i&&this.Da(t,i),this.ar(n,e))}else hp(t,i,e)}},i.ab=function(t){var e=this.ja(t);return void 0!==e&&this.Wa.G(e)===t},i.Kb=function(t){return null===t&&w("Model.findNodeDataForKey:key must not be null"),void 0!==t&&Jd(t)?this.Wa.G(t):null},i.Zt=function(t){if(null!==t){var e=this.Ni;if(""!==e){var i=this.ja(t);if(void 0===i||this.Wa.contains(i)){var n=this.Pl;if(null!==n&&(i=n(this,t),void 0!==i&&null!==i&&!this.Wa.contains(i)))return void hp(t,e,i);if("string"===typeof i){for(n=2;this.Wa.contains(i+n);)n++;hp(t,e,i+n)}else if(void 0===i||"number"===typeof i){for(i=-this.Wa.count-1;this.Wa.contains(i);)i--;hp(t,e,i)}}}}},i.uf=function(t){null!==t&&(rt(t),this.ab(t)||Zd(this,t,!0))},i.qz=function(t){if(C(t))for(var e=t.length,i=0;i<e;i++)this.uf(t[i]);else for(t=t.iterator;t.next();)this.uf(t.value)},i.Nm=function(t){null!==t&&Qd(this,t,!0)},i.WA=function(t){if(C(t))for(var e=t.length,i=0;i<e;i++)this.Nm(t[i]);else for(t=t.iterator;t.next();)this.Nm(t.value)},i.KA=function(t){if(t!==this.nodeDataArray&&C(t)){var e=this.Oi;e.clear(),e.addAll(this.Wa.iteratorKeys);var i=this.Li;i.clear();for(var n=t.length,o=0;o<n;o++){var r=t[o],s=this.ja(r);if(void 0!==s){i.add(s);var a=this.Kb(s);a!==r&&(null!==a?(this.vq(a,r),this.Wm(r,a)):(r=this.cloneDeep(r),this.Vm(r,s),this.uf(r)))}else s=this.cloneDeep(r),this.uf(s),i.add(this.ja(s))}for(t=e.iterator;t.next();)n=t.value,i.contains(n)||(n=this.Kb(n))&&this.Nm(n);e.clear(),i.clear()}},i.ar=function(t,e){void 0!==e&&(t=ip(this,t),t instanceof nt&&this.Tf.add(e,t))},i.Sw=function(){},i.Qm=function(){},i.Pm=function(){},i.hr=function(){},i.Cz=function(t){void 0===t?this.Tf.clear():this.Tf.remove(t)},Bd.prototype.copyNodeData=function(t){if(null===t)return null;var e=this.il;return t=null!==e?e(t,this):np(this,t,!0),N(t)&&ot(t),t},Bd.prototype.setDataProperty=function(t,e,i){if(this.ab(t)){if(e===this.nodeKeyProperty)return void this.Vm(t,i);if(e===this.nodeCategoryProperty)return void this.Um(t,i)}else!lp&&t instanceof ca&&(lp=!0,S('Model.setDataProperty is modifying a GraphObject, "'+t.toString()+'"'),S("  Is that really your intent?"));var n=ap(t,e);n!==i&&(hp(t,e,i),this.du(t,e,n,i))},i=Bd.prototype,i.set=function(t,e,i){this.setDataProperty(t,e,i)},i.vq=function(t,e){if(e){var i,n=this.ab(t);for(i in e)"__gohashid"===i||n&&i===this.nodeKeyProperty||this.setDataProperty(t,i,e[i])}},i.mz=function(t,e){this.Pt(t,-1,e)},i.Pt=function(t,e,i){0>e&&(e=t.length),A(t,e,i),$d(this,"",Ni,"",t,null,i,null,e)},i.tw=function(t,e){void 0===e&&(e=-1),t===this.Fc&&w("Model.removeArrayItem should not be called on the Model.nodeDataArray"),-1===e&&(e=t.length-1);var i=t[e];L(t,e),$d(this,"",Ci,"",t,i,null,e,null)},i.Iq=function(t){if(null===t)return"";var e=this.Yj;return""===e?"":(e=ap(t,e),void 0===e?"":"string"===typeof e?e:(w("getCategoryForNodeData found a non-string category for "+t+": "+e),""))},i.Um=function(t,e){if(null!==t){var i=this.Yj;if(""!==i)if(this.ab(t)){var n=ap(t,i);void 0===n&&(n=""),n!==e&&(hp(t,i,e),$d(this,"nodeCategory",Pi,i,t,n,e))}else hp(t,i,e)}},i.Wm=function(t,e){this.Um(e,this.Iq(t))},i.Em=function(){return!1},i.Ck=function(){return!1},i.qj=function(){return!1},i.Ut=function(){return!1},i.Dk=function(){return!1},d.Object.defineProperties(Bd.prototype,{name:{get:function(){return this.oa},set:function(t){var e=this.oa;e!==t&&(this.oa=t,this.g("name",e,t))}},dataFormat:{get:function(){return this.Ln},set:function(t){var e=this.Ln;e!==t&&(this.Ln=t,this.g("dataFormat",e,t))}},isReadOnly:{get:function(){return this.$f},set:function(t){var e=this.$f;e!==t&&(this.$f=t,this.g("isReadOnly",e,t))}},modelData:{get:function(){return this.l},set:function(t){var e=this.l;e!==t&&(this.l=t,this.g("modelData",e,t),this.Da(t))}},undoManager:{get:function(){return this.u},set:function(t){var e=this.u;e!==t&&(null!==e&&e.Py(this),this.u=t,null!==t&&t.Vx(this))}},skipsUndoManager:{get:function(){return this.vg},set:function(t){this.vg=t}},nodeKeyProperty:{get:function(){return this.Ni},set:function(t){var e=this.Ni;e!==t&&(""===t&&w("Model.nodeKeyProperty may not be the empty string"),0<this.Wa.count&&w("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Ni=t,this.g("nodeKeyProperty",e,t))}},makeUniqueKeyFunction:{get:function(){return this.Pl},set:function(t){var e=this.Pl;e!==t&&(this.Pl=t,this.g("makeUniqueKeyFunction",e,t))}},nodeDataArray:{get:function(){return this.Fc},set:function(t){var e=this.Fc;if(e!==t){this.Wa.clear(),this.Sw();for(var i=t.length,n=0;n<i;n++){var o=t[n];if(!N(o))return void w("Model.nodeDataArray must only contain Objects, not: "+o);rt(o)}for(this.Fc=t,n=new et,o=0;o<i;o++){var r=t[o],s=this.ja(r);void 0===s||null!==this.Wa.G(s)?n.add(r):this.Wa.add(s,r)}for(n=n.iterator;n.next();)o=n.value,this.Zt(o),r=this.ja(o),void 0!==r&&this.Wa.add(r,o);for($d(this,"nodeDataArray",Pi,"nodeDataArray",this,e,t),e=0;e<i;e++)n=t[e],this.Qm(n),this.Pm(n);Array.isArray(t)||(this.isReadOnly=!0)}}},copyNodeDataFunction:{get:function(){return this.il},set:function(t){var e=this.il;e!==t&&(this.il=t,this.g("copyNodeDataFunction",e,t))}},copiesArrays:{get:function(){return this.Dn},set:function(t){var e=this.Dn;e!==t&&(this.Dn=t,this.g("copiesArrays",e,t))}},copiesArrayObjects:{get:function(){return this.Cn},set:function(t){var e=this.Cn;e!==t&&(this.Cn=t,this.g("copiesArrayObjects",e,t))}},copiesKey:{get:function(){return this.Fn},set:function(t){var e=this.Fn;e!==t&&(this.Fn=t,this.g("copiesKey",e,t))}},afterCopyFunction:{get:function(){return this.kn},set:function(t){var e=this.kn;e!==t&&(this.kn=t,this.g("afterCopyFunction",e,t))}},nodeCategoryProperty:{get:function(){return this.Yj},set:function(t){var e=this.Yj;e!==t&&(this.Yj=t,this.g("nodeCategoryProperty",e,t))}},type:{get:function(){return"Model"}}}),Bd.prototype.setCategoryForNodeData=Bd.prototype.Um,Bd.prototype.getCategoryForNodeData=Bd.prototype.Iq,Bd.prototype.removeArrayItem=Bd.prototype.tw,Bd.prototype.insertArrayItem=Bd.prototype.Pt,Bd.prototype.addArrayItem=Bd.prototype.mz,Bd.prototype.assignAllDataProperties=Bd.prototype.vq,Bd.prototype.set=Bd.prototype.set,Bd.prototype.clearUnresolvedReferences=Bd.prototype.Cz,Bd.prototype.mergeNodeDataArray=Bd.prototype.KA,Bd.prototype.removeNodeDataCollection=Bd.prototype.WA,Bd.prototype.removeNodeData=Bd.prototype.Nm,Bd.prototype.addNodeDataCollection=Bd.prototype.qz,Bd.prototype.addNodeData=Bd.prototype.uf,Bd.prototype.makeNodeDataKeyUnique=Bd.prototype.Zt,Bd.prototype.findNodeDataForKey=Bd.prototype.Kb,Bd.prototype.containsNodeData=Bd.prototype.ab,Bd.prototype.setKeyForNodeData=Bd.prototype.Vm,Bd.prototype.getKeyForNodeData=Bd.prototype.ja,Bd.prototype.updateTargetBindings=Bd.prototype.Da,Bd.prototype.commit=Bd.prototype.commit,Bd.prototype.rollbackTransaction=Bd.prototype.If,Bd.prototype.commitTransaction=Bd.prototype.Xa,Bd.prototype.startTransaction=Bd.prototype.va,Bd.prototype.raiseDataChanged=Bd.prototype.du,Bd.prototype.raiseChanged=Bd.prototype.g,Bd.prototype.raiseChangedEvent=Bd.prototype.Va,Bd.prototype.removeChangedListener=Bd.prototype.Tk,Bd.prototype.addChangedListener=Bd.prototype.Hh,Bd.prototype.writeJsonValue=Bd.prototype.bn,Bd.prototype.replaceJsonObjects=Bd.prototype.Om,Bd.prototype.applyIncrementalJSON=Bd.prototype.vz,Bd.prototype.applyIncrementalJson=Bd.prototype.Xx,Bd.prototype.toJSON=Bd.prototype.toJSON,Bd.prototype.toJson=Bd.prototype.fr,Bd.prototype.toIncrementalJSON=Bd.prototype.hB,Bd.prototype.toIncrementalJson=Bd.prototype.Yy,Bd.prototype.computeJsonDifference=Bd.prototype.Dz,Bd.prototype.toIncrementalData=Bd.prototype.gB,Bd.prototype.clear=Bd.prototype.clear;var lp=!1,up={};function cp(t,e,i){ot(this),this.v=!1,void 0===t&&(t=""),void 0===e&&(e=t),void 0===i&&(i=null),this.l=-1,this.pd=null,this.pm=t,this.om=this.hq=0,this.ht=null,this.Ao=!1,this.hm=e,this.Bn=i,this.Zo=pp,this.un=null,this.Ou=new nt}function fp(t,e,i){return t=t.sourceName,null===t||""===t?e:"/"===t?i.part:"."===t?i:".."===t?i.panel:e.bb(t)}Bd.className="Model",Bd.fromJSON=Bd.fromJson=function(t,e){void 0===e&&(e=null);var i=null;if("string"===typeof t)try{i=y.JSON.parse(t)}catch(r){}else"object"===typeof t?i=t:w("Unable to construct a Model from: "+t);if(null===e){t=null;var n=i["class"];if("string"===typeof n)try{var o=null;0===n.indexOf("go.")?(n=n.substr(3),o=sp(n)):(o=sp(n),null===o&&(o=y[n])),"function"===typeof o&&(t=new o)}catch(r){}null===t||t instanceof Bd?e=t:w("Unable to construct a Model of declared class: "+i["class"])}return null===e&&(e=Bd.constructGraphLinksModel()),e.Xq(i),e.rw(i),e},Bd.safePropertyValue=ap,Bd.safePropertySet=hp,up.Brush=eh,up.ChangedEvent=Mi,up.Geometry=We,up.Margin=Qt,up.Panel=Uh,up.Point=pt,up.Rect=zt,up.Size=Bt,up.Spot=Ge,up.Transaction=Ti,up.UndoManager=Ai,cp.prototype.copy=function(){var t=new cp;return t.pm=this.pm,t.hq=this.hq,t.om=this.om,t.ht=this.ht,t.Ao=this.Ao,t.hm=this.hm,t.Bn=this.Bn,t.Zo=this.Zo,t.un=this.un,t},i=cp.prototype,i.jb=function(t){t.classType===cp&&(this.mode=t)},i.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(-1!==this.wj?" "+this.wj:"")+" "+this.mode.name+")"},i.freeze=function(){return this.v=!0,this},i.ea=function(){return this.v=!1,this},i.Iy=function(t){return void 0===t&&(t=null),this.mode=gp,this.backConverter=t,this},i.Uq=function(t){return void 0===t&&(t=""),this.sourceName=t,this.isToModel=!1,this},i.MA=function(){return this.sourceName=null,this.isToModel=!0,this},i.Tw=function(t,e,i){var n=this.hm;if(void 0===i||""===n||n===i){i=this.pm;var o=this.Bn;if(null===o&&""===i)S("Binding error: target property is the empty string: "+this.toString());else{var r=e;if(""!==n&&(r=ap(e,n)),void 0!==r)if(null===o)""!==i&&hp(t,i,r);else try{if(""!==i){var s=o(r,t);hp(t,i,s)}else o(r,t)}catch(a){}}}},i.jr=function(t,e,i,n){if(this.Zo===gp){var o=this.pm;if(void 0===i||o===i){i=this.hm;var r=this.un,s=t;if(""!==o&&(s=ap(t,o)),void 0!==s&&!this.Ou.contains(t))try{this.Ou.add(t);var a=null!==n?n.diagram:null,h=null!==a?a.model:null;if(null===r){if(""!==i)null!==h?h.setDataProperty(e,i,s):hp(e,i,s);else if(null!==h&&null!==n&&0<=n.itemIndex&&null!==n.panel&&Array.isArray(n.panel.itemArray)){var l=n.itemIndex,u=n.panel.itemArray;h.tw(u,l),h.Pt(u,l,s)}}else try{if(""!==i){var c=r(s,e,h);null!==h?h.setDataProperty(e,i,c):hp(e,i,c)}else{var f=r(s,e,h);if(void 0!==f&&null!==h&&null!==n&&0<=n.itemIndex&&null!==n.panel&&Array.isArray(n.panel.itemArray)){var d=n.itemIndex,p=n.panel.itemArray;h.tw(p,d),h.Pt(p,d,f)}}}catch(g){}}finally{this.Ou.remove(t)}}}},d.Object.defineProperties(cp.prototype,{wj:{get:function(){return this.l},set:function(t){this.v&&k(this),this.l=t}},targetProperty:{get:function(){return this.pm},set:function(t){this.v&&k(this),this.pm=t}},sourceName:{get:function(){return this.ht},set:function(t){this.v&&k(this),this.ht=t,null!==t&&(this.Ao=!1)}},isToModel:{get:function(){return this.Ao},set:function(t){this.v&&k(this),this.Ao=t}},sourceProperty:{get:function(){return this.hm},set:function(t){this.v&&k(this),this.hm=t}},converter:{get:function(){return this.Bn},set:function(t){this.v&&k(this),this.Bn=t}},backConverter:{get:function(){return this.un},set:function(t){this.v&&k(this),this.un=t}},mode:{get:function(){return this.Zo},set:function(t){this.v&&k(this),this.Zo=t}}}),cp.prototype.updateSource=cp.prototype.jr,cp.prototype.updateTarget=cp.prototype.Tw,cp.prototype.ofModel=cp.prototype.MA,cp.prototype.ofObject=cp.prototype.Uq,cp.prototype.makeTwoWay=cp.prototype.Iy;var dp="Binding",pp=new U(cp,"OneWay",1),gp=new U(cp,"TwoWay",2);function yp(t,e){Bd.call(this),this.su=',\n  "insertedLinkKeys": ',this.kx=',\n  "modifiedLinkData": ',this.uu=',\n  "removedLinkKeys": ',this.$c=[],this.ag=new nt,this.gb=new dt,this.Hi="",this.Aj=this.hl=this.Ql=null,this.af="from",this.bf="to",this.Vj=this.Uj="",this.Tj="category",this.ae="",this.Ul="isGroup",this.ze="group",this.En=!1,void 0!==t&&(this.nodeDataArray=t),void 0!==e&&(this.linkDataArray=e)}function mp(t,e){for(var i=new nt,n=0;n<t.linkDataArray.length;n++){var o=t.linkDataArray[n];Xd(t,e,o,o,i)}return i}function vp(t,e,i){if(null!==e&&(t=i?t.af:t.bf,""!==t&&(t=ap(e,t),void 0!==t))){if(Jd(t))return t;w((i?"FromKey":"ToKey")+" value for link data "+e+" is not a number or a string: "+t)}}function xp(t,e,i,n){if(null===i&&(i=void 0),null!==e){var o=n?t.af:t.bf;if(""!==o)if(i=t.Gm(i),t.xc(e)){var r=ap(e,o);r!==i&&(ep(t,r,e),hp(e,o,i),null===t.Kb(i)&&tp(t,i,e),$d(t,n?"linkFromKey":"linkToKey",Pi,o,e,r,i),"string"===typeof o&&t.Da(e,o))}else hp(e,o,i)}}function bp(t,e,i){return null===e?"":(t=i?t.Uj:t.Vj,""===t?"":(e=ap(e,t),void 0===e?"":e))}function wp(t,e,i,n){if(null!==e){var o=n?t.Uj:t.Vj;if(""!==o)if(t.xc(e)){var r=ap(e,o);void 0===r&&(r=""),r!==i&&(hp(e,o,i),$d(t,n?"linkFromPortId":"linkToPortId",Pi,o,e,r,i),"string"===typeof o&&t.Da(e,o))}else hp(e,o,i)}}function kp(t,e,i){if(""!==t.linkKeyProperty){var n=t.Wb(e);if(void 0!==n&&t.gb.G(n)===e)return;if(t.Rq(e),n=t.Wb(e),void 0===n)return void w("GraphLinksModel.makeLinkDataKeyUnique failed on "+e+". Data not added to model.");t.gb.add(n,e)}t.ag.add(e),n=null,i&&(n=t.$c.length,t.$c.splice(n,0,e)),$d(t,"linkDataArray",Ni,"linkDataArray",t,null,e,null,n),Sp(t,e)}function Mp(t,e,i){t.ag.remove(e);var n=t.Wb(e);if(void 0!==n&&t.gb.remove(n),n=null,i){if(n=t.$c.indexOf(e),0>n)return;t.$c.splice(n,1)}if($d(t,"linkDataArray",Ci,"linkDataArray",t,e,null,n,null),i=vp(t,e,!0),ep(t,i,e),i=vp(t,e,!1),ep(t,i,e),n=t.Bf(e),Array.isArray(n))for(var o=n.length,r=0;r<o;r++)i=n[r],ep(t,i,e)}function Sp(t,e){var i=vp(t,e,!0);i=t.Gm(i),null===t.Kb(i)&&tp(t,i,e),i=vp(t,e,!1),i=t.Gm(i),null===t.Kb(i)&&tp(t,i,e);var n=t.Bf(e);if(Array.isArray(n))for(var o=n.length,r=0;r<o;r++)i=n[r],null===t.Kb(i)&&tp(t,i,e)}function Pp(t,e,i){t.cr(i,t.Lt(e)),t.Bw(i,t.xy(e)),t.Gw(i,t.Ay(e)),t.ju(i,t.Bf(e)),t.Cw(i,t.yy(e)),t.Hw(i,t.By(e))}cp.className="Binding",cp.parseEnum=function(t,e){return function(i){return i=K(t,i),null===i?e:i}},cp.toString=F,cp.OneWay=pp,cp.TwoWay=gp,f(yp,Bd),yp.constructGraphLinksModel=Bd.constructGraphLinksModel,yp.prototype.cloneProtected=function(t){Bd.prototype.cloneProtected.call(this,t),t.Hi=this.Hi,t.Ql=this.Ql,t.hl=this.hl,t.af=this.af,t.bf=this.bf,t.Uj=this.Uj,t.Vj=this.Vj,t.Tj=this.Tj,t.ae=this.ae,t.Ul=this.Ul,t.ze=this.ze,t.En=this.En},i=yp.prototype,i.clear=function(){Bd.prototype.clear.call(this),this.$c=[],this.gb.clear(),this.ag.clear()},i.toString=function(t){if(void 0===t&&(t=0),2<=t)return this.fr();var e=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<t){e+="\n node data:",t=this.nodeDataArray;var i,n=t.length;for(i=0;i<n;i++){var o=t[i];e+=" "+this.ja(o)+":"+F(o)}for(e+="\n link data:",t=this.linkDataArray,n=t.length,i=0;i<n;i++)o=t[i],e+=" "+vp(this,o,!0)+"--\x3e"+vp(this,o,!1)}return e},i.Yw=function(t,e){""===this.linkKeyProperty&&w("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var i=Bd.prototype.Yw.call(this,t,e),n=this,o=new nt,r=new nt,s=new nt,a=this.Yh;t.changes.each((function(t){t.model===n&&("linkDataArray"===t.modelChange?t.change===Ni?o.add(t.newValue):t.change===Ci&&s.add(t.oldValue):n.xc(t.object)?r.add(t.object):null!==t.object&&(null!==t.object&&a&&a.contains(t.object)?a.get(t.object).each((function(t){n.xc(t)&&r.add(t)})):t.object instanceof Bd||n.ab(t.object)||mp(n,t.object).each((function(t){r.add(t)}))))}));var h=this.Li;h.clear(),o.each((function(t){h.add(n.Wb(t)),e||r.add(t)}));var l=this.Oi;return l.clear(),s.each((function(t){l.add(n.Wb(t)),e&&r.add(t)})),t=n.cloneDeep(r.ma()),0<h.count&&(null===i&&(i={}),e?i.removedLinkKeys=h.ma():i.insertedLinkKeys=h.ma()),0<t.length&&(null===i&&(i={}),i.modifiedLinkData=t),0<l.count&&(null===i&&(i={}),e?i.insertedLinkKeys=l.ma():i.removedLinkKeys=l.ma()),l.clear(),h.clear(),i},i.Vk=function(){var t=Bd.prototype.Vk.call(this),e="";return"category"!==this.linkCategoryProperty&&"string"===typeof this.linkCategoryProperty&&(e+=',\n  "linkCategoryProperty": '+this.quote(this.linkCategoryProperty)),""!==this.linkKeyProperty&&"string"===typeof this.linkKeyProperty&&(e+=',\n  "linkKeyProperty": '+this.quote(this.linkKeyProperty)),"from"!==this.linkFromKeyProperty&&"string"===typeof this.linkFromKeyProperty&&(e+=',\n  "linkFromKeyProperty": '+this.quote(this.linkFromKeyProperty)),"to"!==this.linkToKeyProperty&&"string"===typeof this.linkToKeyProperty&&(e+=',\n  "linkToKeyProperty": '+this.quote(this.linkToKeyProperty)),""!==this.linkFromPortIdProperty&&"string"===typeof this.linkFromPortIdProperty&&(e+=',\n  "linkFromPortIdProperty": '+this.quote(this.linkFromPortIdProperty)),""!==this.linkToPortIdProperty&&"string"===typeof this.linkToPortIdProperty&&(e+=',\n  "linkToPortIdProperty": '+this.quote(this.linkToPortIdProperty)),""!==this.linkLabelKeysProperty&&"string"===typeof this.linkLabelKeysProperty&&(e+=',\n  "linkLabelKeysProperty": '+this.quote(this.linkLabelKeysProperty)),"isGroup"!==this.nodeIsGroupProperty&&"string"===typeof this.nodeIsGroupProperty&&(e+=',\n  "nodeIsGroupProperty": '+this.quote(this.nodeIsGroupProperty)),"group"!==this.nodeGroupKeyProperty&&"string"===typeof this.nodeGroupKeyProperty&&(e+=',\n  "nodeGroupKeyProperty": '+this.quote(this.nodeGroupKeyProperty)),t+e},i.Xq=function(t){Bd.prototype.Xq.call(this,t),t.linkKeyProperty&&(this.linkKeyProperty=t.linkKeyProperty),t.linkFromKeyProperty&&(this.linkFromKeyProperty=t.linkFromKeyProperty),t.linkToKeyProperty&&(this.linkToKeyProperty=t.linkToKeyProperty),t.linkFromPortIdProperty&&(this.linkFromPortIdProperty=t.linkFromPortIdProperty),t.linkToPortIdProperty&&(this.linkToPortIdProperty=t.linkToPortIdProperty),t.linkCategoryProperty&&(this.linkCategoryProperty=t.linkCategoryProperty),t.linkLabelKeysProperty&&(this.linkLabelKeysProperty=t.linkLabelKeysProperty),t.nodeIsGroupProperty&&(this.nodeIsGroupProperty=t.nodeIsGroupProperty),t.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=t.nodeGroupKeyProperty)},i.Zw=function(){var t=Bd.prototype.Zw.call(this),e=',\n  "linkDataArray": '+qd(this,this.linkDataArray,!0);return t+e},i.rw=function(t){Bd.prototype.rw.call(this,t),t=t.linkDataArray,Array.isArray(t)&&(this.Om(t),this.linkDataArray=t)},i.kr=function(t){if(!(t instanceof yp))return w("Model.computeJsonDifference: newmodel must be a GraphLinksModel"),"";""===this.linkKeyProperty&&w("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");var e=Bd.prototype.kr.call(this,t);Vd(this,t,"linkKeyProperty"),Vd(this,t,"linkFromKeyProperty"),Vd(this,t,"linkToKeyProperty"),Vd(this,t,"linkLabelKeysProperty"),Vd(this,t,"nodeIsGroupProperty"),Vd(this,t,"nodeGroupKeyProperty");var i=this.Li;i.clear();var n=new nt,o=this.Oi;o.clear(),o.addAll(this.gb.iteratorKeys);for(var r=new dt,s=t.linkDataArray,a=s.length,h=0;h<a;h++){var l=s[h],u=t.Wb(l);if(void 0!==u){o.remove(u);var c=this.Dg(u);null===c?(i.add(u),n.add(l)):zd(this,c,l,r)||n.add(l)}else this.Rq(l),u=this.Wb(l),i.add(u),n.add(l)}return t=e,0<i.count&&(t+=this.su+qd(this,i.ma(),!0)),0<n.count&&(t+=this.kx+qd(this,n.ma(),!0)),0<o.count&&(t+=this.uu+qd(this,o.ma(),!0)),o.clear(),i.clear(),t},i.Xw=function(t,e){""===this.linkKeyProperty&&w("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var i=Bd.prototype.Xw.call(this,t,e),n=this,o=new nt,r=new nt,s=new nt,a=this.Yh;t.changes.each((function(t){t.model===n&&("linkDataArray"===t.modelChange?t.change===Ni?o.add(t.newValue):t.change===Ci&&s.add(t.oldValue):n.xc(t.object)?r.add(t.object):null!==t.object&&(null!==t.object&&a&&a.contains(t.object)?a.get(t.object).each((function(t){n.xc(t)&&r.add(t)})):t.object instanceof Bd||n.ab(t.object)||mp(n,t.object).each((function(t){r.add(t)}))))}));var h=this.Li;h.clear(),o.each((function(t){h.add(n.Wb(t)),e||r.add(t)}));var l=this.Oi;return l.clear(),s.each((function(t){l.add(n.Wb(t)),e&&r.add(t)})),t=i,0<h.count&&(t+=(e?this.uu:this.su)+qd(this,h.ma(),!0)),0<r.count&&(t+=this.kx+qd(this,r.ma(),!0)),0<l.count&&(t+=(e?this.su:this.uu)+qd(this,l.ma(),!0)),l.clear(),h.clear(),t},i.Wq=function(t){(void 0!==t.linkCategoryProperty&&t.linkCategoryProperty!==this.linkCategoryProperty||void 0!==t.linkKeyProperty&&t.linkKeyProperty!==this.linkKeyProperty||void 0!==t.linkFromKeyProperty&&t.linkFromKeyProperty!==this.linkFromKeyProperty||void 0!==t.linkToKeyProperty&&t.linkToKeyProperty!==this.linkToKeyProperty||void 0!==t.linkFromPortIdProperty&&t.linkFromPortIdProperty!==this.linkFromPortIdProperty||void 0!==t.linkToPortIdProperty&&t.linkToPortIdProperty!==this.linkToPortIdProperty||void 0!==t.linkLabelKeysProperty&&t.linkLabelKeysProperty!==this.linkLabelKeysProperty||void 0!==t.nodeIsGroupProperty&&t.nodeIsGroupProperty!==this.nodeIsGroupProperty||void 0!==t.nodeGroupKeyProperty&&t.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&w("applyIncrementalJson cannot change Model properties"),Bd.prototype.Wq.call(this,t);var e=t.insertedLinkKeys;if(Array.isArray(e))for(var i=e.length,n=0;n<i;n++){var o=e[n],r=this.Dg(o);null===r&&(r=this.Aq({}),this.iu(r,o),this.bj(r))}if(e=t.modifiedLinkData,Array.isArray(e))for(i=e.length,n=0;n<i;n++)if(o=e[n],r=this.Wb(o),r=this.Dg(r),null!==r){for(var s in o)"__gohashid"!==s&&s!==this.linkKeyProperty&&this.setDataProperty(r,s,o[s]);Pp(this,o,r)}if(t=t.removedLinkKeys,Array.isArray(t))for(s=t.length,e=0;e<s;e++)i=this.Dg(t[e]),null!==i&&this.Mm(i)},yp.prototype.changeState=function(t,e){if(null!==t&&t.model===this){if(t.change===Pi){var i=t.object,n=t.propertyName;if(n===this.linkKeyProperty&&this.xc(i)){var o=t.G(e);return e=t.G(!e),void 0!==e&&this.gb.remove(e),void 0!==o&&this.gb.add(o,i),void hp(i,n,o)}}else if(t.change===Ni){if(i=t.newParam,"linkDataArray"===t.modelChange)return t=t.newValue,void(N(t)&&"number"===typeof i&&(n=this.Wb(t),e?(this.ag.remove(t),this.$c[i]===t&&this.$c.splice(i,1),void 0!==n&&this.gb.remove(n)):(this.ag.add(t),this.$c[i]!==t&&this.$c.splice(i,0,t),void 0!==n&&this.gb.add(n,t))));if("linkLabelKeys"===t.modelChange)return n=this.Bf(t.object),void(Array.isArray(n)&&"number"===typeof i&&(e?(i=n.indexOf(t.newValue),0<=i&&n.splice(i,1)):0>n.indexOf(t.newValue)&&n.splice(i,0,t.newValue)))}else if(t.change===Ci){if(i=t.oldParam,"linkDataArray"===t.modelChange)return t=t.oldValue,void(N(t)&&"number"===typeof i&&(n=this.Wb(t),e?(this.ag.add(t),this.$c[i]!==t&&this.$c.splice(i,0,t),void 0!==n&&this.gb.add(n,t)):(this.ag.remove(t),this.$c[i]===t&&this.$c.splice(i,1),void 0!==n&&this.gb.remove(n))));if("linkLabelKeys"===t.modelChange)return n=this.Bf(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))))}Bd.prototype.changeState.call(this,t,e)}},i=yp.prototype,i.Gm=function(t){if(void 0!==t){var e=this.Aj;if(null!==e){var i=this.Kb(t);null===i&&(i=this.copyNodeData(e),hp(i,this.nodeKeyProperty,t),this.uf(i))}return t}},i.xy=function(t){return vp(this,t,!0)},i.Bw=function(t,e){xp(this,t,e,!0)},i.Ay=function(t){return vp(this,t,!1)},i.Gw=function(t,e){xp(this,t,e,!1)},i.yy=function(t){return bp(this,t,!0)},i.Cw=function(t,e){wp(this,t,e,!0)},i.By=function(t){return bp(this,t,!1)},i.Hw=function(t,e){wp(this,t,e,!1)},i.Bf=function(t){if(null===t)return Np;var e=this.ae;return""===e?Np:(t=ap(t,e),void 0===t?Np:t)},i.ju=function(t,e){if(null!==t){var i=this.ae;if(""!==i)if(this.xc(t)){var n=ap(t,i);if(void 0===n&&(n=Np),n!==e){if(Array.isArray(n))for(var o=n.length,r=0;r<o;r++)ep(this,n[r],t);for(hp(t,i,e),o=e.length,r=0;r<o;r++){var s=e[r];null===this.Kb(s)&&tp(this,s,t)}$d(this,"linkLabelKeys",Pi,i,t,n,e),"string"===typeof i&&this.Da(t,i)}}else hp(t,i,e)}},i.Dv=function(t,e){if(null!==e&&void 0!==e&&null!==t){var i=this.ae;if(""!==i){var n=ap(t,i);if(void 0===n)i=[],i.push(e),this.ju(t,i);else if(Array.isArray(n)){var o=n.indexOf(e);0<=o||(o=n.length,n.push(e),this.xc(t)&&(null===this.Kb(e)&&tp(this,e,t),$d(this,"linkLabelKeys",Ni,i,t,null,e,null,o)))}else w(i+" property is not an Array; cannot addLabelKeyForLinkData: "+t)}}},i.Oy=function(t,e){if(null!==e&&void 0!==e&&null!==t){var i=this.ae;if(""!==i){var n=ap(t,i);if(Array.isArray(n)){var o=n.indexOf(e);0>o||(n.splice(o,1),this.xc(t)&&(ep(this,e,t),$d(this,"linkLabelKeys",Ci,i,t,e,null,o,null)))}else void 0!==n&&w(i+" property is not an Array; cannot removeLabelKeyforLinkData: "+t)}}},i.Wb=function(t){if(null!==t){var e=this.Hi;if(""!==e&&(e=ap(t,e),void 0!==e)){if(Jd(e))return e;w("Key value for link data "+t+" is not a number or a string: "+e)}}},i.iu=function(t,e){if(null!==t){var i=this.Hi;if(""!==i)if(this.xc(t)){var n=ap(t,i);n!==e&&null===this.Dg(e)&&(hp(t,i,e),void 0!==n&&this.gb.remove(n),this.gb.add(e,t),$d(this,"linkKey",Pi,i,t,n,e),"string"===typeof i&&this.Da(t,i))}else hp(t,i,e)}},i.Dg=function(t){return null===t&&w("GraphLinksModel.findLinkDataForKey:key must not be null"),void 0!==t&&Jd(t)?this.gb.G(t):null},i.Rq=function(t){if(null!==t){var e=this.Hi;if(""!==e){var i=this.Wb(t);if(void 0===i||this.gb.contains(i)){var n=this.Ql;if(null!==n&&(i=n(this,t),void 0!==i&&null!==i&&!this.gb.contains(i)))return void hp(t,e,i);if("string"===typeof i){for(n=2;this.gb.contains(i+n);)n++;hp(t,e,i+n)}else if(void 0===i||"number"===typeof i){for(i=-this.gb.count-1;this.gb.contains(i);)i--;hp(t,e,i)}}}}},i.xc=function(t){return null!==t&&this.ag.contains(t)},i.bj=function(t){null!==t&&(rt(t),this.xc(t)||kp(this,t,!0))},i.pz=function(t){if(Array.isArray(t))for(var e=t.length,i=0;i<e;i++)this.bj(t[i]);else for(t=t.iterator;t.next();)this.bj(t.value)},i.Mm=function(t){null!==t&&Mp(this,t,!0)},i.UA=function(t){if(Array.isArray(t))for(var e=t.length,i=0;i<e;i++)this.Mm(t[i]);else for(t=t.iterator;t.next();)this.Mm(t.value)},i.JA=function(t){if(""===this.linkKeyProperty&&w("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),t!==this.linkDataArray&&C(t)){var e=this.Oi;e.clear(),e.addAll(this.gb.iteratorKeys);var i=this.Li;i.clear();for(var n=t.length,o=0;o<n;o++){var r=t[o],s=this.Wb(r);if(void 0!==s){i.add(s);var a=this.Dg(s);a!==r&&(null!==a?(this.vq(a,r),Pp(this,r,a)):(r=this.cloneDeep(r),this.iu(r,s),this.bj(r)))}else s=this.cloneDeep(r),this.bj(s),i.add(this.Wb(s))}for(t=e.iterator;t.next();)n=t.value,i.contains(n)||(n=this.Dg(n))&&this.Mm(n);e.clear(),i.clear()}},i.Aq=function(t){if(null===t)return null;var e=this.hl;return t=null!==e?e(t,this):np(this,t,!0),N(t)&&(ot(t),""!==this.af&&hp(t,this.af,void 0),""!==this.bf&&hp(t,this.bf,void 0),""!==this.ae&&hp(t,this.ae,[])),t},i.fw=function(t){if(null===t)return!1;var e=this.Ul;return""!==e&&!!ap(t,e)},i.Lh=function(t){if(null!==t){var e=this.ze;if(""!==e&&(e=ap(t,e),void 0!==e)){if(Jd(e))return e;w("GroupKey value for node data "+t+" is not a number or a string: "+e)}}},i.dr=function(t,e){if(null===e&&(e=void 0),null!==t){var i=this.ze;if(""!==i)if(this.ab(t)){var n=ap(t,i);n!==e&&(ep(this,n,t),hp(t,i,e),null===this.Kb(e)&&tp(this,e,t),$d(this,"nodeGroupKey",Pi,i,t,n,e),"string"===typeof i&&this.Da(t,i))}else hp(t,i,e)}},yp.prototype.copyNodeData=function(t){return null===t?null:(t=Bd.prototype.copyNodeData.call(this,t),this.rk||""===this.ze||void 0===ap(t,this.ze)||hp(t,this.ze,void 0),t)},yp.prototype.setDataProperty=function(t,e,i){if(this.ab(t)){if(e===this.nodeKeyProperty)return void this.Vm(t,i);if(e===this.nodeCategoryProperty)return void this.Um(t,i);if(e===this.nodeGroupKeyProperty)return void this.dr(t,i)}else if(this.xc(t)){if(e===this.linkFromKeyProperty)return void xp(this,t,i,!0);if(e===this.linkToKeyProperty)return void xp(this,t,i,!1);if(e===this.linkFromPortIdProperty)return void wp(this,t,i,!0);if(e===this.linkToPortIdProperty)return void wp(this,t,i,!1);if(e===this.linkKeyProperty)return void this.iu(t,i);if(e===this.linkCategoryProperty)return void this.cr(t,i);if(e===this.linkLabelKeysProperty)return void this.ju(t,i)}var n=ap(t,e);n!==i&&(hp(t,e,i),this.du(t,e,n,i))},i=yp.prototype,i.vq=function(t,e){if(e){var i,n=this.ab(t),o=this.xc(t);for(i in e)"__gohashid"===i||n&&i===this.nodeKeyProperty||n&&i===this.nodeIsGroupProperty&&ap(t,i)===e[i]||o&&i===this.linkKeyProperty||this.setDataProperty(t,i,e[i])}},i.ar=function(t,e){Bd.prototype.ar.call(this,t,e);for(var i=this.Wa.iterator;i.next();)this.vw(i.value,t,e);for(i=this.ag.iterator;i.next();){var n=i.value,o=t,r=e;if(vp(this,n,!0)===o){var s=this.af;hp(n,s,r),$d(this,"linkFromKey",Pi,s,n,o,r),"string"===typeof s&&this.Da(n,s)}if(vp(this,n,!1)===o&&(s=this.bf,hp(n,s,r),$d(this,"linkToKey",Pi,s,n,o,r),"string"===typeof s&&this.Da(n,s)),s=this.Bf(n),Array.isArray(s))for(var a=s.length,h=this.ae,l=0;l<a;l++)s[l]===o&&(s[l]=r,$d(this,"linkLabelKeys",Ni,h,n,o,r,l,l))}},i.vw=function(t,e,i){if(this.Lh(t)===e){var n=this.ze;hp(t,n,i),$d(this,"nodeGroupKey",Pi,n,t,e,i),"string"===typeof n&&this.Da(t,n)}},i.Sw=function(){Bd.prototype.Sw.call(this);for(var t=this.linkDataArray,e=t.length,i=0;i<e;i++)Sp(this,t[i])},i.Qm=function(t){Bd.prototype.Qm.call(this,t),t=this.ja(t);var e=ip(this,t);if(null!==e){var i=j();for(e=e.iterator;e.next();){var n=e.value;if(this.ab(n)){if(this.Lh(n)===t){var o=this.ze;$d(this,"nodeGroupKey",Pi,o,n,t,t),"string"===typeof o&&this.Da(n,o),i.push(n)}}else if(vp(this,n,!0)===t&&(o=this.af,$d(this,"linkFromKey",Pi,o,n,t,t),"string"===typeof o&&this.Da(n,o),i.push(n)),vp(this,n,!1)===t&&(o=this.bf,$d(this,"linkToKey",Pi,o,n,t,t),"string"===typeof o&&this.Da(n,o),i.push(n)),o=this.Bf(n),Array.isArray(o))for(var r=o.length,s=this.ae,a=0;a<r;a++)o[a]===t&&($d(this,"linkLabelKeys",Ni,s,n,t,t,a,a),i.push(n))}for(e=0;e<i.length;e++)ep(this,t,i[e]);O(i)}},i.Pm=function(t){Bd.prototype.Pm.call(this,t);var e=this.Lh(t);null===this.Kb(e)&&tp(this,e,t)},i.hr=function(t){Bd.prototype.hr.call(this,t);var e=this.Lh(t);ep(this,e,t)},i.Lt=function(t){if(null===t)return"";var e=this.Tj;return""===e?"":(e=ap(t,e),void 0===e?"":"string"===typeof e?e:(w("getCategoryForLinkData found a non-string category for "+t+": "+e),""))},yp.prototype.getLinkCategoryForData=function(t){return this.Lt(t)},yp.prototype.cr=function(t,e){if(null!==t){var i=this.Tj;if(""!==i)if(this.xc(t)){var n=ap(t,i);void 0===n&&(n=""),n!==e&&(hp(t,i,e),$d(this,"linkCategory",Pi,i,t,n,e),"string"===typeof i&&this.Da(t,i))}else hp(t,i,e)}},yp.prototype.setLinkCategoryForData=function(t,e){this.cr(t,e)},i=yp.prototype,i.Wm=function(t,e){Bd.prototype.Wm.call(this,t,e),this.dr(e,this.Lh(t))},i.Ck=function(){return!0},i.qj=function(){return!0},i.Ut=function(){return!0},i.Dk=function(){return!0},d.Object.defineProperties(yp.prototype,{archetypeNodeData:{get:function(){return this.Aj},set:function(t){var e=this.Aj;e!==t&&(this.Aj=t,this.g("archetypeNodeData",e,t))}},linkFromKeyProperty:{get:function(){return this.af},set:function(t){var e=this.af;e!==t&&(this.af=t,this.g("linkFromKeyProperty",e,t))}},linkToKeyProperty:{get:function(){return this.bf},set:function(t){var e=this.bf;e!==t&&(this.bf=t,this.g("linkToKeyProperty",e,t))}},linkFromPortIdProperty:{get:function(){return this.Uj},set:function(t){var e=this.Uj;e!==t&&(this.Uj=t,this.g("linkFromPortIdProperty",e,t))}},linkToPortIdProperty:{get:function(){return this.Vj},set:function(t){var e=this.Vj;e!==t&&(this.Vj=t,this.g("linkToPortIdProperty",e,t))}},linkLabelKeysProperty:{get:function(){return this.ae},set:function(t){var e=this.ae;e!==t&&(this.ae=t,this.g("linkLabelKeysProperty",e,t))}},linkDataArray:{get:function(){return this.$c},set:function(t){var e=this.$c;if(e!==t){this.gb.clear();for(var i=t.length,n=0;n<i;n++){var o=t[n];if(!N(o))return void w("GraphLinksModel.linkDataArray must only contain Objects, not: "+o);rt(o)}if(this.$c=t,""!==this.linkKeyProperty){for(n=new et,o=0;o<i;o++){var r=t[o],s=this.Wb(r);void 0===s||null!==this.gb.G(s)?n.add(r):this.gb.add(s,r)}for(n=n.iterator;n.next();)o=n.value,this.Rq(o),r=this.Wb(o),void 0!==r&&this.gb.add(r,o)}for(n=new nt,o=0;o<i;o++)n.add(t[o]);for(this.ag=n,$d(this,"linkDataArray",Pi,"linkDataArray",this,e,t),e=0;e<i;e++)Sp(this,t[e])}}},linkKeyProperty:{get:function(){return this.Hi},set:function(t){var e=this.Hi;if(e!==t){this.Hi=t,this.gb.clear();for(var i=this.linkDataArray.length,n=0;n<i;n++){var o=this.linkDataArray[n],r=this.Wb(o);void 0===r&&(this.Rq(o),r=this.Wb(o)),void 0!==r&&this.gb.add(r,o)}this.g("linkKeyProperty",e,t)}}},makeUniqueLinkKeyFunction:{get:function(){return this.Ql},set:function(t){var e=this.Ql;e!==t&&(this.Ql=t,this.g("makeUniqueLinkKeyFunction",e,t))}},copyLinkDataFunction:{get:function(){return this.hl},set:function(t){var e=this.hl;e!==t&&(this.hl=t,this.g("copyLinkDataFunction",e,t))}},nodeIsGroupProperty:{get:function(){return this.Ul},set:function(t){var e=this.Ul;e!==t&&(this.Ul=t,this.g("nodeIsGroupProperty",e,t))}},nodeGroupKeyProperty:{get:function(){return this.ze},set:function(t){var e=this.ze;e!==t&&(this.ze=t,this.g("nodeGroupKeyProperty",e,t))}},rk:{get:function(){return this.En},set:function(t){this.En!==t&&(this.En=t)}},linkCategoryProperty:{get:function(){return this.Tj},set:function(t){var e=this.Tj;e!==t&&(this.Tj=t,this.g("linkCategoryProperty",e,t))}},type:{get:function(){return"GraphLinksModel"}}}),yp.prototype.setCategoryForLinkData=yp.prototype.cr,yp.prototype.getCategoryForLinkData=yp.prototype.Lt,yp.prototype.assignAllDataProperties=yp.prototype.vq,yp.prototype.setGroupKeyForNodeData=yp.prototype.dr,yp.prototype.getGroupKeyForNodeData=yp.prototype.Lh,yp.prototype.isGroupForNodeData=yp.prototype.fw,yp.prototype.copyLinkData=yp.prototype.Aq,yp.prototype.mergeLinkDataArray=yp.prototype.JA,yp.prototype.removeLinkDataCollection=yp.prototype.UA,yp.prototype.removeLinkData=yp.prototype.Mm,yp.prototype.addLinkDataCollection=yp.prototype.pz,yp.prototype.addLinkData=yp.prototype.bj,yp.prototype.containsLinkData=yp.prototype.xc,yp.prototype.makeLinkDataKeyUnique=yp.prototype.Rq,yp.prototype.findLinkDataForKey=yp.prototype.Dg,yp.prototype.setKeyForLinkData=yp.prototype.iu,yp.prototype.getKeyForLinkData=yp.prototype.Wb,yp.prototype.removeLabelKeyForLinkData=yp.prototype.Oy,yp.prototype.addLabelKeyForLinkData=yp.prototype.Dv,yp.prototype.setLabelKeysForLinkData=yp.prototype.ju,yp.prototype.getLabelKeysForLinkData=yp.prototype.Bf,yp.prototype.setToPortIdForLinkData=yp.prototype.Hw,yp.prototype.getToPortIdForLinkData=yp.prototype.By,yp.prototype.setFromPortIdForLinkData=yp.prototype.Cw,yp.prototype.getFromPortIdForLinkData=yp.prototype.yy,yp.prototype.setToKeyForLinkData=yp.prototype.Gw,yp.prototype.getToKeyForLinkData=yp.prototype.Ay,yp.prototype.setFromKeyForLinkData=yp.prototype.Bw,yp.prototype.getFromKeyForLinkData=yp.prototype.xy,yp.prototype.clear=yp.prototype.clear;var Np=Object.freeze([]);function Cp(t){Bd.call(this),this.Ae="parent",this.Gn=!1,this.$j="parentLinkCategory",void 0!==t&&(this.nodeDataArray=t)}function Tp(){zf.call(this),this.wx=this.Un=this.$b=0,this.Ur=360,this.vx=Gp,this.Ij=0,this.mx=new pt,this.Gr=this.be=0,this.ut=new ig,this.Bu=this.Zj=0,this.gz=600,this.Ap=NaN,this.pn=1,this.bq=0,this.mm=360,this.Eb=Gp,this.K=Up,this.bd=Qp,this.Wc=sd,this.lf=6,this.jp=tg}function Ap(t,e,i,n,o){var r=t.Ur,s=t.$b;t=t.be,n=n*Math.PI/180,i=i*Math.PI/180;for(var a=e.length,h=0;h<a;h++){var l=n+(o===Up?h*i/(360<=r?a:a-1):-h*i/a),u=e.J(h),c=s*Math.tan(l)/t;c=Math.sqrt((s*s+t*t*c*c)/(1+c*c)),u.centerX=c*Math.cos(l),u.centerY=c*Math.sin(l),u.actualAngle=180*l/Math.PI}}function Lp(t,e,i,n){var o=t.$b,r=t.be,s=t.Ij;i=i*Math.PI/180;for(var a=e.length,h=0;h<a;h++){var l=e.J(h),u=e.J(h===a-1?0:h+1),c=r*Math.sin(i);l.centerX=o*Math.cos(i),l.centerY=c,l.actualAngle=180*i/Math.PI,isNaN(l.diameter)&&rg(l,0),isNaN(u.diameter)&&rg(u,0),l=zp(t,o,r,n===Up?i:-i,(l.diameter+u.diameter)/2+s),i+=n===Up?l:-l}}function jp(t,e,i,n){var o=t.$b,r=t.be,s=t.Gr;i=i*Math.PI/180;for(var a=e.length,h=0;h<a;h++){var l=e.J(h);l.centerX=o*Math.cos(i),l.centerY=r*Math.sin(i),l.actualAngle=180*i/Math.PI,l=zp(t,o,r,n===Up?i:-i,s),i+=n===Up?l:-l}}function Op(t,e,i,n,o){var r=t.Ur;if(t.Zj=0,t.ut=new ig,360>i){for(r=n+(o===Up?r:-r);0>r;)r+=360;r%=360,180<r&&(r-=360),r*=Math.PI/180,t.Bu=r,Fp(t,e,i,n,o)}else Dp(t,e,i,n,o);t.ut.commit(e)}function Dp(t,e,i,n,o){var r=t.$b,s=t.Ij,a=t.Un,h=r*Math.cos(n*Math.PI/180),l=t.be*Math.sin(n*Math.PI/180),u=e.ma();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;c++){if(u[c].centerX=h,u[c].centerY=l,c>=u.length-1)break;Bp(t,h,l,u,c,o,r)||Ip(t,h,l,u,c,o,r),h=r.x,l=r.y}if(pt.free(r),t.Zj++,!(23<t.Zj)){h=u[0].centerX,l=u[0].centerY,r=u[u.length-1].centerX,c=u[u.length-1].centerY;var f=Math.abs(h-r)-((u[0].width+u[u.length-1].width)/2+s),d=Math.abs(l-c)-((u[0].height+u[u.length-1].height)/2+s);s=0,1>Math.abs(d)?Math.abs(h-r)<(u[0].width+u[u.length-1].width)/2&&(s=0):s=0<d?d:1>Math.abs(f)?0:f,h=Math.abs(r)>Math.abs(c)?0<r!==l>c:0<c!==h<r,(h=o===Up?h:!h)&&(s=-Math.abs(s),s=Math.min(s,-u[u.length-1].width),s=Math.min(s,-u[u.length-1].height)),t.ut.compare(s,u),1<Math.abs(s)&&(t.$b=8>t.Zj?t.$b-s/(2*Math.PI):5>u.length&&10<s?t.$b/2:t.$b-(0<s?1.7:-2.3),t.be=t.$b*a,Dp(t,e,i,n,o))}}}function Fp(t,e,i,n,o){for(var r=t.$b,s=t.be,a=t.Un,h=r*Math.cos(n*Math.PI/180),l=s*Math.sin(n*Math.PI/180),u=pt.alloc(),c=e.ma(),f=0;f<c.length;f++){if(c[f].centerX=h,c[f].centerY=l,f>=c.length-1)break;Bp(t,h,l,c,f,o,u)||Ip(t,h,l,c,f,o,u),h=u.x,l=u.y}if(pt.free(u),t.Zj++,!(23<t.Zj)){if(h=Math.atan2(l,h),h=o===Up?t.Bu-h:h-t.Bu,h=Math.abs(h)<Math.abs(h-2*Math.PI)?h:h-2*Math.PI,r=h*(r+s)/2,s=t.ut,Math.abs(r)<Math.abs(s.Am))for(s.Am=r,s.Wk=[],s.cn=[],h=0;h<c.length;h++)s.Wk[h]=c[h].bounds.x,s.cn[h]=c[h].bounds.y;1<Math.abs(r)&&(t.$b=8>t.Zj?t.$b-r/(2*Math.PI):t.$b-(0<r?1.7:-2.3),t.be=t.$b*a,Fp(t,e,i,n,o))}}function Bp(t,e,i,n,o,r,s){var a=t.$b,h=t.be,l=0;t=(n[o].width+n[o+1].width)/2+t.Ij;var u=!1;if(0<=i!==(r===Up)){if(r=e+t,r>a){if(r=e-t,r<-a)return s.x=r,s.y=l,!1;u=!0}}else if(r=e-t,r<-a){if(r=e+t,r>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 Ip(t,e,i,n,o,r,s){var a=t.$b,h=t.be,l=0;if(t=(n[o].height+n[o+1].height)/2+t.Ij,n=!1,0<=e!==(r===Up)){if(r=i-t,r<-h){if(r=i+t,r>h)return s.x=l,void(s.y=r);n=!0}}else if(r=i+t,r>h){if(r=i-t,r<-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 Ep(t,e,i,n,o){var r=t.gz;if(.001>Math.abs(t.Un-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 Rp(t,e,i,n,o){return e/(void 0!==n&&void 0!==o?Ep(t,1,i,n,o):Ep(t,1,i))}function zp(t,e,i,n,o){if(.001>Math.abs(t.Un-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,s>=o)return a*t}}function Vp(t){for(var e=[],i=0;i<t.length;i++)e.push(0);i=new et;for(var n=0;n<t.length;n++){var o=-1,r=-1;if(0===n)for(var s=0;s<t.length;s++){var a=t.J(s).edgesCount;a>o&&(o=a,r=s)}else for(s=0;s<t.length;s++)a=e[s],a>o&&(o=a,r=s);for(i.add(t.J(r)),e[r]=-1,r=t.J(r),s=r.sourceEdges;s.next();)o=t.indexOf(s.value.fromVertex),0>o||0<=e[o]&&e[o]++;for(r=r.destinationEdges;r.next();)o=t.indexOf(r.value.toVertex),0>o||0<=e[o]&&e[o]++}return i}yp.className="GraphLinksModel",up.GraphLinksModel=yp,Bd.constructGraphLinksModel=Bd.constructGraphLinksModel=function(){return new yp},Bd.initDiagramModel=op=function(){return new yp},f(Cp,Bd),Cp.constructGraphLinksModel=Bd.constructGraphLinksModel,Cp.prototype.cloneProtected=function(t){Bd.prototype.cloneProtected.call(this,t),t.Ae=this.Ae,t.Gn=this.Gn,t.$j=this.$j},i=Cp.prototype,i.toString=function(t){if(void 0===t&&(t=0),2<=t)return this.fr();var e=(""!==this.name?this.name:"")+" TreeModel";if(0<t){e+="\n node data:",t=this.nodeDataArray;for(var i=t.length,n=0;n<i;n++){var o=t[n];e+=" "+this.ja(o)+":"+F(o)}}return e},i.Vk=function(){var t=Bd.prototype.Vk.call(this),e="";return"parent"!==this.nodeParentKeyProperty&&"string"===typeof this.nodeParentKeyProperty&&(e+=',\n  "nodeParentKeyProperty": '+this.quote(this.nodeParentKeyProperty)),t+e},i.Xq=function(t){Bd.prototype.Xq.call(this,t),t.nodeParentKeyProperty&&(this.nodeParentKeyProperty=t.nodeParentKeyProperty)},i.kr=function(t){return Vd(this,t,"nodeParentKeyProperty"),Bd.prototype.kr.call(this,t)},i.Wq=function(t){void 0!==t.nodeParentKeyProperty&&t.nodeParentKeyProperty!==this.nodeParentKeyProperty&&w("applyIncrementalJson cannot change Model properties"),Bd.prototype.Wq.call(this,t)},i.Gm=function(t){return t},i.Mh=function(t){if(null!==t){var e=this.Ae;if(""!==e&&(e=ap(t,e),void 0!==e)){if(Jd(e))return e;w("ParentKey value for node data "+t+" is not a number or a string: "+e)}}},i.fe=function(t,e){if(null===e&&(e=void 0),null!==t){var i=this.Ae;if(""!==i)if(e=this.Gm(e),this.ab(t)){var n=ap(t,i);n!==e&&(ep(this,n,t),hp(t,i,e),null===this.Kb(e)&&tp(this,e,t),$d(this,"nodeParentKey",Pi,i,t,n,e),"string"===typeof i&&this.Da(t,i))}else hp(t,i,e)}},i.Ot=function(t){if(null===t)return"";var e=this.$j;return""===e?"":(e=ap(t,e),void 0===e?"":"string"===typeof e?e:(w("getParentLinkCategoryForNodeData found a non-string category for "+t+": "+e),""))},Cp.prototype.getLinkCategoryForData=function(t){return this.Ot(t)},Cp.prototype.ku=function(t,e){if(null!==t){var i=this.$j;if(""!==i)if(this.ab(t)){var n=ap(t,i);void 0===n&&(n=""),n!==e&&(hp(t,i,e),$d(this,"parentLinkCategory",Pi,i,t,n,e),"string"===typeof i&&this.Da(t,i))}else hp(t,i,e)}},Cp.prototype.setLinkCategoryForData=function(t,e){this.ku(t,e)},Cp.prototype.copyNodeData=function(t){return null===t?null:(t=Bd.prototype.copyNodeData.call(this,t),this.sk||""===this.Ae||void 0===ap(t,this.Ae)||hp(t,this.Ae,void 0),t)},Cp.prototype.setDataProperty=function(t,e,i){if(this.ab(t)){if(e===this.nodeKeyProperty)return void this.Vm(t,i);if(e===this.nodeCategoryProperty)return void this.Um(t,i);if(e===this.nodeParentKeyProperty)return void this.fe(t,i)}var n=ap(t,e);n!==i&&(hp(t,e,i),this.du(t,e,n,i))},i=Cp.prototype,i.ar=function(t,e){Bd.prototype.ar.call(this,t,e);for(var i=this.Wa.iterator;i.next();)this.vw(i.value,t,e)},i.vw=function(t,e,i){if(this.Mh(t)===e){var n=this.Ae;hp(t,n,i),$d(this,"nodeParentKey",Pi,n,t,e,i),"string"===typeof n&&this.Da(t,n)}},i.Qm=function(t){Bd.prototype.Qm.call(this,t),t=this.ja(t);var e=ip(this,t);if(null!==e){var i=j();for(e=e.iterator;e.next();){var n=e.value;if(this.ab(n)&&this.Mh(n)===t){var o=this.Ae;$d(this,"nodeParentKey",Pi,o,n,t,t),"string"===typeof o&&this.Da(n,o),i.push(n)}}for(e=0;e<i.length;e++)ep(this,t,i[e]);O(i)}},i.Pm=function(t){Bd.prototype.Pm.call(this,t);var e=this.Mh(t);e=this.Gm(e),null===this.Kb(e)&&tp(this,e,t)},i.hr=function(t){Bd.prototype.hr.call(this,t);var e=this.Mh(t);ep(this,e,t)},i.Wm=function(t,e){Bd.prototype.Wm.call(this,t,e),this.ku(e,this.Ot(t)),this.fe(e,this.Mh(t))},i.Em=function(){return!0},i.Ut=function(){return!0},d.Object.defineProperties(Cp.prototype,{nodeParentKeyProperty:{get:function(){return this.Ae},set:function(t){var e=this.Ae;e!==t&&(this.Ae=t,this.g("nodeParentKeyProperty",e,t))}},sk:{get:function(){return this.Gn},set:function(t){this.Gn!==t&&(this.Gn=t)}},parentLinkCategoryProperty:{get:function(){return this.$j},set:function(t){var e=this.$j;e!==t&&(this.$j=t,this.g("parentLinkCategoryProperty",e,t))}},linkCategoryProperty:{get:function(){return this.parentLinkCategoryProperty},set:function(t){this.parentLinkCategoryProperty=t}},type:{get:function(){return"TreeModel"}}}),Cp.prototype.setParentLinkCategoryForNodeData=Cp.prototype.ku,Cp.prototype.getParentLinkCategoryForNodeData=Cp.prototype.Ot,Cp.prototype.setParentKeyForNodeData=Cp.prototype.fe,Cp.prototype.getParentKeyForNodeData=Cp.prototype.Mh,Cp.className="TreeModel",up.TreeModel=Cp,f(Tp,zf),Tp.prototype.cloneProtected=function(t){zf.prototype.cloneProtected.call(this,t),t.Ap=this.Ap,t.pn=this.pn,t.bq=this.bq,t.mm=this.mm,t.Eb=this.Eb,t.K=this.K,t.bd=this.bd,t.Wc=this.Wc,t.lf=this.lf,t.jp=this.jp},Tp.prototype.jb=function(t){t.classType===Tp?t===Jp||t===Zp||t===Wp||t===$p||t===Qp?this.sorting=t:t===Hp||t===_p||t===Up||t===Kp?this.direction=t:t===Xp||t===Yp||t===Gp||t===qp?this.arrangement=t:t!==eg&&t!==tg||(this.nodeDiameterFormula=t):zf.prototype.jb.call(this,t)},Tp.prototype.createNetwork=function(){return new ng(this)},Tp.prototype.doLayout=function(t){if(null===this.network&&(this.network=this.makeNetwork(t)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),t=this.network.vertexes,1>=t.count)1===t.count&&(t=t.first(),t.centerX=0,t.centerY=0);else{var e=new et;e.addAll(t.iterator),t=new et;var i,n,o=new et,r=this.sort(e),s=this.Gr,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)||360<f||1>f)&&(f=360),e=this.spacing,isFinite(e)||(e=NaN),a===qp&&h===eg?a=Gp:a===qp&&h!==eg&&(a=this.arrangement),(this.direction===Hp||this.direction===_p)&&this.sorting!==Qp){for(h=0;!(h>=r.length);h+=2){if(t.add(r.J(h)),h+1>=r.length)break;o.add(r.J(h+1))}this.direction===Hp?(this.arrangement===qp&&t.reverse(),r=new et,r.addAll(t),r.addAll(o)):(this.arrangement===qp&&o.reverse(),r=new et,r.addAll(o),r.addAll(t))}h=r.length;for(var d=n=i=0;d<r.length;d++){var p=c+f*n*(this.direction===Up?1:-1)/h,g=r.J(d).diameter;isNaN(g)&&(g=rg(r.J(d),p)),360>f&&(0===d||d===r.length-1)&&(g/=2),i+=g,n++}if(isNaN(l)||a===qp){if(isNaN(e)&&(e=6),a!==Gp&&a!==qp){for(n=-1/0,s=0;s<h;s++)d=r.J(s),i=r.J(s===h-1?0:s+1),isNaN(d.diameter)&&rg(d,0),isNaN(i.diameter)&&rg(i,0),n=Math.max(n,(d.diameter+i.diameter)/2);s=n+e,l=a===Xp?(n+e)/(2*Math.PI/h):Rp(this,s*(360<=f?h:h-1),u,c*Math.PI/180,f*Math.PI/180)}else l=Rp(this,i+(360<=f?h:h-1)*(a!==qp?e:1.6*e),u,c*Math.PI/180,f*Math.PI/180);n=l*u}else if(n=l*u,d=Ep(this,l,n,c*Math.PI/180,f*Math.PI/180),isNaN(e))a!==Gp&&a!==qp||(e=(d-i)/(360<=f?h:h-1));else if(a===Gp||a===qp)d=(d-i)/(360<=f?h:h-1),d<e?(l=Rp(this,i+e*(360<=f?h:h-1),u,c*Math.PI/180,f*Math.PI/180),n=l*u):e=d;else{for(s=-1/0,i=0;i<h;i++)p=r.J(i),g=r.J(i===h-1?0:i+1),isNaN(p.diameter)&&rg(p,0),isNaN(g.diameter)&&rg(g,0),s=Math.max(s,(p.diameter+g.diameter)/2);s+=e,i=Rp(this,s*(360<=f?h:h-1),u,c*Math.PI/180,f*Math.PI/180),i>l?(l=i,n=l*u):s=d/(360<=f?h:h-1)}if(this.vx=a,this.$b=l,this.Un=u,this.wx=c,this.Ur=f,this.Ij=e,this.be=n,this.Gr=s,e=r,r=this.vx,a=this.$b,l=this.wx,u=this.Ur,c=this.Ij,f=this.be,h=this.Gr,this.direction!==Hp&&this.direction!==_p||r!==qp)if(this.direction===Hp||this.direction===_p){switch(s=0,r){case Yp:s=180*zp(this,a,f,l,h)/Math.PI;break;case Gp:h=e=0,s=t.first(),null!==s&&(e=rg(s,Math.PI/2)),s=o.first(),null!==s&&(h=rg(s,Math.PI/2)),s=180*zp(this,a,f,l,c+(e+h)/2)/Math.PI;break;case Xp:s=u/e.length}if(this.direction===Hp){switch(r){case Yp:jp(this,t,l,Kp);break;case Gp:Lp(this,t,l,Kp);break;case Xp:Ap(this,t,u/2,l,Kp)}switch(r){case Yp:jp(this,o,l+s,Up);break;case Gp:Lp(this,o,l+s,Up);break;case Xp:Ap(this,o,u/2,l+s,Up)}}else{switch(r){case Yp:jp(this,o,l,Kp);break;case Gp:Lp(this,o,l,Kp);break;case Xp:Ap(this,o,u/2,l,Kp)}switch(r){case Yp:jp(this,t,l+s,Up);break;case Gp:Lp(this,t,l+s,Up);break;case Xp:Ap(this,t,u/2,l+s,Up)}}}else switch(r){case Yp:jp(this,e,l,this.direction);break;case Gp:Lp(this,e,l,this.direction);break;case Xp:Ap(this,e,u,l,this.direction);break;case qp:Op(this,e,u,l,this.direction)}else Op(this,e,u,l-u/2,Up)}this.updateParts(),this.network=null,this.isValidLayout=!0},Tp.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},Tp.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.$b,i.y=this.arrangementOrigin.y+this.be);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.Ta(),t=this.group.position.copy(),i=this.group.location.copy(),e=e.ge(i.ge(t)),this.group.move(e),this.mx=e.ge(t))},Tp.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},Tp.prototype.sort=function(t){switch(this.sorting){case Wp:break;case $p:t.reverse();break;case Jp:t.sort(this.comparer);break;case Zp:t.sort(this.comparer),t.reverse();break;case Qp:return this.nw(Vp(t));default:w("Invalid sorting type.")}return t},Tp.prototype.nw=function(t){for(var e=[],i=0;i<t.length;i++){var n=t.J(i);e[i]=[];for(var o,r=n.destinationEdges;r.next();)o=t.indexOf(r.value.toVertex),o!==i&&0>e[i].indexOf(o)&&e[i].push(o);for(n=n.sourceEdges;n.next();)o=t.indexOf(n.value.fromVertex),o!==i&&0>e[i].indexOf(o)&&e[i].push(o)}for(r=[],i=0;i<e.length;i++)r[i]=0;i=[];var s=[],a=[];n=[],o=new et;for(var h=0,l=0;l<e.length;l++){var u=e[l].length;if(1===u)n.push(l);else if(0===u)o.add(t.J(l));else{if(0===h)i.push(l);else{for(var c=u=1/0,f=-1,d=[],p=0;p<i.length;p++)0>e[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;p<i.length;p++)d.push(p);for(p=0;p<d.length;p++){for(var g=d[p],y=e[l],m=0,v=0;v<s.length;v++){var x=r[s[v]],b=r[a[v]];if(x<b){var w=x;x=b}else w=b;if(w<g&&g<=x)for(b=0;b<y.length;b++){var k=y[b];0>i.indexOf(k)||w<r[k]&&r[k]<x||w===r[k]||x===r[k]||m++}else for(b=0;b<y.length;b++)k=y[b],0>i.indexOf(k)||w<r[k]&&r[k]<x&&w!==r[k]&&x!==r[k]&&m++}for(y=m,v=m=0;v<e[l].length;v++)w=i.indexOf(e[l][v]),0<=w&&(w=Math.abs(g-(w>=g?w+1:w)),m+=w<i.length+1-w?w:i.length+1-w);for(v=0;v<s.length;v++)w=r[s[v]],x=r[a[v]],w>=g&&w++,x>=g&&x++,w>x&&(b=x,x=w,w=b),x-w<(i.length+2)/2===(w<g&&g<=x)&&m++;(y<u||y===u&&m<c)&&(u=y,c=m,f=g)}for(i.splice(f,0,l),u=0;u<i.length;u++)r[i[u]]=u;for(u=0;u<e[l].length;u++)c=e[l][u],0<=i.indexOf(c)&&(s.push(l),a.push(c))}h++}}for(s=i.length;;){for(r=!0,a=0;a<n.length;a++)if(h=n[a],l=e[h][0],u=i.indexOf(l),0<=u){for(f=c=0;f<e[l].length;f++)d=i.indexOf(e[l][f]),0>d||d===u||(p=d>u?d-u:u-d,c+=d<u!==p>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<i.length;e++)o.add(t.J(i[e]));return o},d.Object.defineProperties(Tp.prototype,{radius:{get:function(){return this.Ap},set:function(t){this.Ap!==t&&(0<t||isNaN(t))&&(this.Ap=t,this.B())}},aspectRatio:{get:function(){return this.pn},set:function(t){this.pn!==t&&0<t&&(this.pn=t,this.B())}},startAngle:{get:function(){return this.bq},set:function(t){this.bq!==t&&(this.bq=t,this.B())}},sweepAngle:{get:function(){return this.mm},set:function(t){this.mm!==t&&(this.mm=0<t&&360>=t?t:360,this.B())}},arrangement:{get:function(){return this.Eb},set:function(t){this.Eb===t||t!==qp&&t!==Gp&&t!==Yp&&t!==Xp||(this.Eb=t,this.B())}},direction:{get:function(){return this.K},set:function(t){this.K===t||t!==Up&&t!==Kp&&t!==Hp&&t!==_p||(this.K=t,this.B())}},sorting:{get:function(){return this.bd},set:function(t){this.bd===t||t!==Wp&&t!==$p&&t!==Jp&&!Zp&&t!==Qp||(this.bd=t,this.B())}},comparer:{get:function(){return this.Wc},set:function(t){this.Wc!==t&&(this.Wc=t,this.B())}},spacing:{get:function(){return this.lf},set:function(t){this.lf!==t&&(this.lf=t,this.B())}},nodeDiameterFormula:{get:function(){return this.jp},set:function(t){this.jp===t||t!==tg&&t!==eg||(this.jp=t,this.B())}},actualXRadius:{get:function(){return this.$b}},actualYRadius:{get:function(){return this.be}},actualSpacing:{get:function(){return this.Ij}},actualCenter:{get:function(){return this.mx}}});var Gp=new U(Tp,"ConstantSpacing",0),Yp=new U(Tp,"ConstantDistance",1),Xp=new U(Tp,"ConstantAngle",2),qp=new U(Tp,"Packed",3),Up=new U(Tp,"Clockwise",4),Kp=new U(Tp,"Counterclockwise",5),Hp=new U(Tp,"BidirectionalLeft",6),_p=new U(Tp,"BidirectionalRight",7),Wp=new U(Tp,"Forwards",8),$p=new U(Tp,"Reverse",9),Jp=new U(Tp,"Ascending",10),Zp=new U(Tp,"Descending",11),Qp=new U(Tp,"Optimized",12),tg=new U(Tp,"Pythagorean",13),eg=new U(Tp,"Circular",14);function ig(){this.Am=-1/0,this.cn=this.Wk=null}function ng(t){Qf.call(this,t)}function og(t){rd.call(this,t),this.I=this.Gj=NaN}function rg(t,e){var i=t.network;if(null===i)return NaN;if(i=i.layout,null===i)return NaN;if(i.arrangement===qp)if(i.nodeDiameterFormula===eg)t.Gj=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.Gj=Math.min(t.height/i,t.width/e)}else t.Gj=i.nodeDiameterFormula===eg?Math.max(t.width,t.height):Math.sqrt(t.width*t.width+t.height*t.height);return t.Gj}function sg(t){ad.call(this,t)}function ag(){zf.call(this),this.Fh=null,this.Eo=0,this.Pd=new Bt(100,100).freeze(),this.on=!1,this.kf=!0,this.jd=!1,this.Rl=100,this.Xn=1,this.Xf=1e3,this.bp=10,this.Bp=Math,this.ol=.05,this.nl=50,this.ll=150,this.ml=0,this.On=10,this.Nn=5}function hg(t,e,i){if(lg(t,e)){var n=t.Xf;t.Xf*=1+1/(e+1);var o=ug(t,e),r=Math.max(0,Math.max(Math.min(t.network.vertexes.count,i*(e+1)/11),10));for(t.maxIterations+=r,hg(t,e+1,i),gg(t,r),cg(t,o),e=o.vertexes.ma(),e.sort((function(t,e){return null===t||null===e||t===e?0:e.Ld-t.Ld})),i=0;i<e.length;i++)fg(t,e[i]);t.Xf=n}}function lg(t,e){if(10<e||3>t.network.vertexes.count)return!1;for(t.Fh=t.network.vertexes.ma(),t=t.Fh,t.sort((function(t,e){return null===t||null===e||t===e?0:e.Ld-t.Ld})),e=t.length-1;0<=e&&1>=t[e].Ld;)e--;return 1<t.length-e}function ug(t,e){for(var i=t.network,n=new vg(t),o=0;o<t.Fh.length;o++){var r=t.Fh[o];if(!(1<r.Ld))break;n.Bg(r);var s=new mg;s.qu=r.Ld,s.ru=r.width,s.pu=r.height,s.$w=r.focus.x,s.ax=r.focus.y,null===r.Ne&&(r.Ne=new et),r.Ne.add(s),r.zw=r.Ne.count-1}for(r=i.edges.iterator;r.next();){var a=r.value;o=a.fromVertex,s=a.toVertex,o.network===n&&s.network===n?n.tm(a):o.network===n?(a=o.qk,null===a&&(a=new et,o.qk=a),a.add(s),o.Ld--,o.Sh+=s.Sh):s.network===n&&(a=s.qk,null===a&&(a=new et,s.qk=a),a.add(o),s.Ld--,s.Sh+=o.Sh)}for(o=n.edges.iterator;o.next();)r=o.value,r.length*=Math.max(1,_e.sqrt((r.fromVertex.Sh+r.toVertex.Sh)/(4*e+1)));for(e=n.vertexes.iterator;e.next();){o=e.value;var h=o.qk;if(null!==h&&0<h.count&&(s=o.Ne.J(o.Ne.count-1).qu-o.Ld,!(0>=s))){for(var l=a=0,u=h.count-s;u<h.count;u++){var c=h.J(u),f=null;for(r=c.edges.iterator;r.next();){var d=r.value;if(d.zy(c)===o){f=d;break}}null!==f&&(l+=f.length,a+=c.width*c.height)}r=o.centerX,h=o.centerY,u=o.width,c=o.height,f=o.focus,d=u*c,1>d&&(d=1),a=_e.sqrt((a+d+l*l*4/(s*s))/d),s=(a-1)*u/2,a=(a-1)*c/2,o.bounds=new zt(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}function cg(t,e){for(var i=t.network.vertexes.iterator;i.next();){var n=i.value;if(n.network=e,null!==n.Ne){var o=n.Ne.J(n.zw);n.Ld=o.qu;var r=o.$w,s=o.ax;n.bounds=new zt(n.centerX-r,n.centerY-s,o.ru,o.pu),n.focus=new pt(r,s),n.zw--}}for(i=t.network.edges.iterator;i.next();)i.value.network=e;t.network=e}function fg(t,e){var i=e.qk;if(null!==i&&0!==i.count){var n=e.centerX,o=e.centerY,r=e.width,s=e.height;null!==e.Ne&&0<e.Ne.count&&(s=e.Ne.J(0),r=s.ru,s=s.pu),r=_e.sqrt(r*r+s*s)/2;for(var a=!1,h=s=0,l=0,u=e.vertexes.iterator;u.next();){var c=u.value;1>=c.Ld?h++:(a=!0,l++,s+=Math.atan2(e.centerY-c.centerY,e.centerX-c.centerX))}if(0!==h)for(0<l&&(s/=l),l=e=0,e=a?2*Math.PI/(h+1):2*Math.PI/h,0===h%2&&(l=e/2),1<i.count&&i.sort((function(t,e){return null===t||null===e||t===e?0:e.width*e.height-t.width*t.height})),a=0===h%2?0:1,i=i.iterator;i.next();)if(h=i.value,!(1<h.Ld||t.isFixed(h))){for(u=null,c=h.edges.iterator;c.next();){u=c.value;break}c=h.width;var f=h.height;c=_e.sqrt(c*c+f*f)/2,u=r+u.length+c,c=s+(e*(a/2>>1)+l)*(0===a%2?1:-1),h.centerX=n+u*Math.cos(c),h.centerY=o+u*Math.sin(c),a++}}}function dg(t,e,i,n,o,r,s){var a=9e19,h=-1,l=0;t:for(;l<e;l++){var u=t[l],c=u.x-i,f=u.y-n;if(c=c*c+f*f,c<a){for(f=l-1;0<=f;f--)if(t[f].y>u.y&&t[f].x-u.x<o+s.width)continue t;for(f=l+1;f<e;f++)if(t[f].x>u.x&&t[f].y-u.y<r+s.height)continue t;h=l,a=c}}return h}function pg(t,e){var i=t.bounds,n=i.x;t=i.y;var o=i.width;i=i.height;var r=e.bounds,s=r.x;e=r.y;var a=r.width;return r=r.height,n+o<s?t>e+r?(i=n+o-s,t=t-e-r,_e.sqrt(i*i+t*t)):t+i<e?(n=n+o-s,t=t+i-e,_e.sqrt(n*n+t*t)):s-(n+o):n>s+a?t>e+r?(i=n-s-a,t=t-e-r,_e.sqrt(i*i+t*t)):t+i<e?(n=n-s-a,t=t+i-e,_e.sqrt(n*n+t*t)):n-(s+a):t>e+r?t-(e+r):t+i<e?e-(t+i):.1}function gg(t,e){for(t.Fh=null,e=t.Eo+e;t.Eo<e&&(t.Eo++,yg(t)););t.Fh=null}function yg(t){null===t.Fh&&(t.Fh=t.network.vertexes.ma());var e=t.Fh;if(0>=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;s<e.length;s++){var a=e[s];a.forceX=0,a.forceY=0;var h=a.centerX;a=a.centerY,n=Math.min(n,h),o=Math.max(o,h),i=Math.min(i,a),r=Math.max(r,a)}(o=o-n>r-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.Xf;var l=n=a=0;for(r=0;r<e.length;r++){s=e[r],n=s.bounds,a=s.focus,h=n.x+a.x;var u=n.y+a.y;n=s.charge*t.electricalFieldX(h,u),l=s.charge*t.electricalFieldY(h,u),n+=s.mass*t.gravitationalFieldX(h,u),l+=s.mass*t.gravitationalFieldY(h,u),s.forceX+=n,s.forceY+=l;for(var c=r+1;c<e.length;c++){var f=e[c];if(f!==s){n=f.bounds,a=f.focus,l=n.x+a.x;var d=n.y+a.y;if(h-l>i||l-h>i){if(o)break}else if(u-d>i||d-u>i){if(!o)break}else{var p=pg(s,f);1>p?(n=t.randomNumberGenerator,null===n&&(t.randomNumberGenerator=n=new wg),p=n.random(),a=n.random(),h>l?(n=Math.abs(f.bounds.right-s.bounds.x),n=(1+n)*p):h<l?(n=Math.abs(f.bounds.x-s.bounds.right),n=-(1+n)*p):(n=Math.max(f.width,s.width),n=(1+n)*p-n/2),u>d?(l=Math.abs(f.bounds.bottom-s.bounds.y),l=(1+l)*a):h<l?(l=Math.abs(f.bounds.y-s.bounds.bottom),l=-(1+l)*a):(l=Math.max(f.height,s.height),l=(1+l)*a-l/2)):(a=-s.charge*f.charge/(p*p),n=(l-h)/p*a,l=(d-u)/p*a),s.forceX+=n,s.forceY+=l,f.forceX-=n,f.forceY-=l}}}}for(o=t.network.edges.iterator;o.next();)a=o.value,i=a.fromVertex,r=a.toVertex,s=i.bounds,h=i.focus,n=s.x+h.x,s=s.y+h.y,u=r.bounds,c=r.focus,h=u.x+c.x,u=u.y+c.y,c=pg(i,r),1>c?(c=t.randomNumberGenerator,null===c&&(t.randomNumberGenerator=c=new wg),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):(a=a.stiffness*(c-a.length),n=(h-n)/c*a,l=(u-s)/c*a),i.forceX+=n,i.forceY+=l,r.forceX-=n,r.forceY-=l;for(o=n=0;o<e.length;o++)i=e[o],t.isFixed(i)?t.moveFixedVertex(i):n=Math.max(n,t.moveVertex(i)||0);return n>t.epsilonDistance*t.epsilonDistance}function mg(){this.ax=this.$w=this.pu=this.ru=this.qu=0}function vg(t){Qf.call(this,t)}function xg(t){rd.call(this,t),this.La=!1,this.eb=this.I=NaN,this.Sh=this.Ld=this.Ka=this.T=0,this.Ne=this.qk=null,this.zw=0}function bg(t){ad.call(this,t),this.l=this.u=NaN}function wg(){var t=0;void 0===t&&(t=42),this.seed=t,this.Zy=48271,this.az=2147483647,this.Q=44488.07041494893,this.bz=3399,this.$y=1/2147483647,this.random()}function kg(){zf.call(this),this.Zb=this.ue=25,this.K=0,this.jl=ey,this.Ml=oy,this.Bl=ay,this.Rj=4,this.Zk=cy,this.ng=15,this.kf=!0,this.Mo=4,this.Ca=this.Ji=this.sa=-1,this.pc=this.mh=0,this.Ia=this.yd=this.zd=this.$d=this.zb=null,this.oh=0,this.fp=this.Wj=null,this.Ec=0,this.gp=null,this.Vc=new pt,this.xe=[],this.xe.length=100}function Mg(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 Sg(t){null===t.Wj&&(t.Wj=[]);for(var e=0,i=t.network.vertexes.iterator;i.next();){var n=i.value;t.Wj[e]=n.layer,e++,t.Wj[e]=n.column,e++,t.Wj[e]=n.index,e++}return t.Wj}function Pg(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 Ng(t,e,i){var n=Qg(t,e),o=t.zb[e];(null===t.fp||t.fp.length<o*o)&&(t.fp=[]);for(var r=t.fp,s=0;s<o;s++){var a,h=0,l=n[s],u=l.near;if(null!==u&&u.layer===l.layer)if(l=u.index,l>s)for(var c=s+1;c<l;c++){var f=n[c];f.near===u&&f.wf===u.wf||h++}else for(c=s-1;c>l;c--)f=n[c],f.near===u&&f.wf===u.wf||h++;if(0<=i)for(l=n[s].sourceEdgesArrayAccess,u=0;u<l.length;u++){var d=l[u];if(d.valid&&d.fromVertex.layer!==e)for(f=d.fromVertex.index,c=d.portToPos,d=d.portFromPos,a=u+1;a<l.length;a++){var p=l[a];if(p.valid&&p.fromVertex.layer!==e){var g=p.fromVertex.index,y=p.portToPos;p=p.portFromPos,c<y&&(f>g||f===g&&d>p)&&h++,y<c&&(g>f||g===f&&p>d)&&h++}}}if(0>=i)for(l=n[s].destinationEdgesArrayAccess,u=0;u<l.length;u++)if(d=l[u],d.valid&&d.toVertex.layer!==e)for(f=d.toVertex.index,c=d.portToPos,d=d.portFromPos,a=u+1;a<l.length;a++)p=l[a],p.valid&&p.toVertex.layer!==e&&(g=p.toVertex.index,y=p.portToPos,p=p.portFromPos,d<p&&(f>g||f===g&&c>y)&&h++,p<d&&(g>f||g===f&&y>c)&&h++);for(r[s*o+s]=h,l=s+1;l<o;l++){var m=0,v=0;if(0<=i){h=n[s].sourceEdgesArrayAccess;var x=n[l].sourceEdgesArrayAccess;for(u=0;u<h.length;u++)if(d=h[u],d.valid&&d.fromVertex.layer!==e)for(f=d.fromVertex.index,d=d.portFromPos,a=0;a<x.length;a++)p=x[a],p.valid&&p.fromVertex.layer!==e&&(g=p.fromVertex.index,p=p.portFromPos,(f<g||f===g&&d<p)&&v++,(g<f||g===f&&p<d)&&m++)}if(0>=i)for(h=n[s].destinationEdgesArrayAccess,x=n[l].destinationEdgesArrayAccess,u=0;u<h.length;u++)if(d=h[u],d.valid&&d.toVertex.layer!==e)for(f=d.toVertex.index,c=d.portToPos,a=0;a<x.length;a++)p=x[a],p.valid&&p.toVertex.layer!==e&&(g=p.toVertex.index,y=p.portToPos,(f<g||f===g&&c<y)&&v++,(g<f||g===f&&y<c)&&m++);r[s*o+l]=m,r[l*o+s]=v}}return ty(t,e,n),r}function Cg(t){for(var e=0,i=0;i<=t.sa;i++){for(var n=t,o=i,r=Qg(n,o),s=n.zb[o],a=0,h=0;h<s;h++){var l=r[h].destinationEdgesArrayAccess;if(null!==l)for(var u=0;u<l.length;u++){var c=l[u];if(c.valid&&c.toVertex.layer!==o){var f=c.fromVertex.column+c.portFromColOffset,d=c.toVertex.column+c.portToColOffset;a+=(Math.abs(f-d)+1)*Mg(c)}}}ty(n,o,r),e+=a}return e}function Tg(t,e,i){for(var n=Qg(t,e),o=t.zb[e],r=[],s=0;s<o;s++){var a=n[s],h=null;0>=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<h.length;f++){a=h[f];var d=a.fromVertex;a.valid&&!a.rev&&d.layer!==e&&(u+=d.column,c++)}if(null!==l)for(h=0;h<l.length;h++)a=l[h],f=a.toVertex,a.valid&&!a.rev&&f.layer!==e&&(u+=f.column,c++);r[s]=0===c?-1:u/c}return ty(t,e,n),r}function Ag(t,e,i){for(var n=Qg(t,e),o=t.zb[e],r=[],s=0;s<o;s++){var a=n[s],h=null;0>=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<h.length;f++){a=h[f];var d=a.fromVertex;a.valid&&!a.rev&&d.layer!==e&&(c[u]=d.column+a.portFromColOffset,u++)}if(null!==l)for(h=0;h<l.length;h++)a=l[h],f=a.toVertex,a.valid&&!a.rev&&f.layer!==e&&(c[u]=f.column+a.portToColOffset,u++);0===u?r[s]=-1:(c.sort((function(t,e){return t-e})),l=u>>1,r[s]=0!==(1&u)?c[l]:c[l-1]+c[l]>>1)}return ty(t,e,n),r}function Lg(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;a=t.linkMinLength(a),l===a&&Lg(t,h,i,n,o,r)}if(r)for(s=e.sourceEdges;s.next();)a=s.value,h=a.fromVertex,l=h.layer-e.layer,a=t.linkMinLength(a),l===a&&Lg(t,h,i,n,o,r)}}function jg(t,e,i,n,o,r){if(e.component===n){if(e.component=i,o)for(var s=e.destinationEdges;s.next();)jg(t,s.value.toVertex,i,n,o,r);if(r)for(e=e.sourceEdges;e.next();)jg(t,e.value.fromVertex,i,n,o,r)}}function Og(t){for(t=t.vertexes.iterator;t.next();){var e=t.value;if(e.valid)return e}return null}function Dg(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 Fg(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 Bg(t,e){e.Cg=t.oh,t.oh++;for(var i=e.destinationEdges;i.next();){var n=i.value,o=n.toVertex;-1===o.Cg&&(n.forest=!0,Bg(t,o))}e.finish=t.oh,t.oh++}function Ig(t){for(var e=t.network.vertexes.iterator;e.next();){var i=Eg(t,e.value);t.sa=Math.max(i,t.sa)}}function Eg(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,Eg(t,r)+o)}e.layer=i}else i=e.layer;return i}function Rg(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,Rg(t,r)+o)}e.layer=i}else i=e.layer;return i}function zg(t,e){if(!e.valid){e.valid=!0;for(var i=e.destinationEdges;i.next();)zg(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;r<o;r++){var s=n[r],a=s.fromVertex,h=s.toVertex;s=t.linkMinLength(s),a.layer-h.layer>s&&Lg(t,a,0,-1,!0,!1)}for(Lg(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;d<o;d++){var p=f[d],g=p.fromVertex;u+=1,1!==g.component&&(r+=1,g=g.layer-l.layer,p=t.linkMinLength(p),n=Math.min(n,g-p))}for(f=l.destinationEdgesArrayAccess,o=f.length,d=0;d<o;d++)p=f[d].toVertex,--u,1!==p.component?--r:c=!0;(null===h||u<a)&&!c&&(h=l,a=u)}}if(0<r){for(i.reset();i.next();)o=i.value,1===o.component&&(o.layer+=n);e.component=0}else h.component=0}for(i=t.network.vertexes.iterator;i.next();)i.value.component=-1;for(Lg(t,e,1,-1,!0,!1);0!==e.component;){for(n=0,o=1/0,r=0,a=null,h=t.network.vertexes.iterator;h.next();)if(s=h.value,1===s.component){for(l=0,u=!1,f=s.sourceEdgesArrayAccess,c=f.length,d=0;d<c;d++)p=f[d].fromVertex,l+=1,1!==p.component?n+=1:u=!0;for(f=s.destinationEdgesArrayAccess,c=f.length,d=0;d<c;d++)p=f[d],g=p.toVertex,--l,1!==g.component&&(--n,g=s.layer-g.layer,p=t.linkMinLength(p),o=Math.min(o,g-p));(null===a||l>r)&&!u&&(a=s,r=l)}if(0>n){for(i.reset();i.next();)n=i.value,1===n.component&&(n.layer-=o);e.component=0}else a.component=0}}}function Vg(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 Gg(t,e){var i=e.layer;for(e.index=t.zb[i],t.zb[i]++,e=e.destinationEdgesArrayAccess,i=!0;i;){i=!1;for(var n=0;n<e.length-1;n++){var o=e[n],r=e[n+1];o.portFromColOffset>r.portFromColOffset&&(i=!0,e[n]=r,e[n+1]=o)}}for(i=0;i<e.length;i++)n=e[i],n.valid&&(n=n.toVertex,-1===n.index&&Gg(t,n))}function Yg(t,e){var i=e.layer;e.index=t.zb[i],t.zb[i]++,e=e.sourceEdgesArrayAccess;for(var n=!0;n;)for(n=!1,i=0;i<e.length-1;i++){var o=e[i],r=e[i+1];o.portToColOffset>r.portToColOffset&&(n=!0,e[i]=r,e[i+1]=o)}for(i=0;i<e.length;i++)n=e[i],n.valid&&(n=n.fromVertex,-1===n.index&&Yg(t,n))}function Xg(t,e,i){var n=Qg(t,e),o=t.zb[e],r=Ag(t,e,i),s=Tg(t,e,i);for(i=0;i<o;i++)-1===s[i]&&(s[i]=n[i].column),-1===r[i]&&(r[i]=n[i].column);for(var a,h=!0;h;)for(h=!1,i=0;i<o-1;i++)(r[i+1]<r[i]||r[i+1]===r[i]&&s[i+1]<s[i])&&(h=!0,a=r[i],r[i]=r[i+1],r[i+1]=a,a=s[i],s[i]=s[i+1],s[i+1]=a,a=n[i],n[i]=n[i+1],n[i+1]=a);for(i=r=0;i<o;i++)a=n[i],a.index=i,r+=t.nodeMinColumnSpace(a,!0),a.column=r,r+=1,r+=t.nodeMinColumnSpace(a,!1);ty(t,e,n)}function qg(t,e,i){var n,o=Qg(t,e),r=t.zb[e];i=Ng(t,e,i);var s=[];for(n=0;n<r;n++)s[n]=-1;var a=[];for(n=0;n<r;n++)a[n]=-1;for(var h=!1,l=!0;l;)for(l=!1,n=0;n<r-1;n++){var u=i[o[n].index*r+o[n+1].index],c=i[o[n+1].index*r+o[n].index],f=0,d=0,p=o[n].column,g=o[n+1].column,y=t.nodeMinColumnSpace(o[n],!0),m=t.nodeMinColumnSpace(o[n],!1),v=t.nodeMinColumnSpace(o[n+1],!0),x=t.nodeMinColumnSpace(o[n+1],!1);y=p-y+v,m=g-m+x;var b=o[n].sourceEdges.iterator;for(b.reset();b.next();)if(v=b.value,x=v.fromVertex,v.valid&&x.layer===e){for(v=0;o[v]!==x;)v++;v<n&&(f+=2*(n-v),d+=2*(n+1-v)),v===n+1&&(f+=1),v>n+1&&(f+=4*(v-n),d+=4*(v-(n+1)))}for(b=o[n].destinationEdges.iterator,b.reset();b.next();)if(v=b.value,x=v.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,b.reset();b.next();)if(v=b.value,x=v.fromVertex,v.valid&&x.layer===e){for(v=0;o[v]!==x;)v++;v<n&&(f+=2*(n+1-v),d+=2*(n-v)),v===n&&(d+=1),v>n+1&&(f+=4*(v-(n+1)),d+=4*(v-n))}for(b=o[n+1].destinationEdges.iterator,b.reset();b.next();)if(v=b.value,x=v.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-m)),-1!==w&&(x+=Math.abs(w-p),v+=Math.abs(w-m)),-1!==k&&(x+=Math.abs(k-g),v+=Math.abs(k-y)),-1!==M&&(x+=Math.abs(M-g),v+=Math.abs(M-y)),(d<f-.5||d===f&&c<u-.5||d===f&&c===u&&v<x-.5)&&(l=h=!0,o[n].column=m,o[n+1].column=y,u=o[n],o[n]=o[n+1],o[n+1]=u)}for(n=0;n<r;n++)o[n].index=n;return ty(t,e,o),h}function Ug(t,e,i){for(var n=!1;Kg(t,e,i);)n=!0;return n}function Kg(t,e,i){var n,o=Qg(t,e),r=t.zb[e],s=Tg(t,e,-1);if(0<i)for(n=0;n<r;n++)s[n]=-1;var a=Tg(t,e,1);if(0>i)for(n=0;n<r;n++)a[n]=-1;for(var h=!1,l=!0;l;)for(l=!1,n=0;n<r;n++){var u=o[n].column,c=t.nodeMinColumnSpace(o[n],!0),f=t.nodeMinColumnSpace(o[n],!1),d=0;d=0>n-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 y=o[n].sourceEdges.iterator;y.next();){var m=y.value,v=m.fromVertex;if(m.valid&&v.layer!==e){var x=Mg(m),b=m.portFromColOffset;m=m.portToColOffset,v=v.column,f+=(Math.abs(u+m-(v+b))+1)*x,p+=(Math.abs(d+m-(v+b))+1)*x,g+=(Math.abs(c+m-(v+b))+1)*x}}if(0<=i)for(y=o[n].destinationEdges.iterator;y.next();)m=y.value,v=m.toVertex,m.valid&&v.layer!==e&&(x=Mg(m),b=m.portFromColOffset,m=m.portToColOffset,v=v.column,f+=(Math.abs(u+b-(v+m))+1)*x,p+=(Math.abs(d+b-(v+m))+1)*x,g+=(Math.abs(c+b-(v+m))+1)*x);m=b=x=0,y=s[o[n].index],v=a[o[n].index],-1!==y&&(x+=Math.abs(y-u),b+=Math.abs(y-d),m+=Math.abs(y-c)),-1!==v&&(x+=Math.abs(v-u),b+=Math.abs(v-d),m+=Math.abs(v-c)),p<f||p===f&&b<x?(l=h=!0,o[n].column=d):(g<f||g===f&&m<x)&&(l=h=!0,o[n].column=c)}return ty(t,e,o),t.normalize(),h}function Hg(t,e,i){var n=Qg(t,e),o=t.zb[e],r=Ag(t,e,i),s=[];for(i=0;i<o;i++)s[i]=r[i];for(r=!0;r;)for(r=!1,i=0;i<o;i++){var a=n[i].column,h=t.nodeMinColumnSpace(n[i],!0),l=t.nodeMinColumnSpace(n[i],!1),u=0;if(-1===s[i])if(0===i&&i===o-1)u=a;else if(0===i){var c=n[i+1].column;u=c-a===l+t.nodeMinColumnSpace(n[i+1],!0)?a-1:a}else i===o-1?(c=n[i-1].column,u=a-c===h+t.nodeMinColumnSpace(n[i-1],!1)?a+1:a):(c=n[i-1].column,h=c+t.nodeMinColumnSpace(n[i-1],!1)+h+1,c=n[i+1].column,l=c-t.nodeMinColumnSpace(n[i+1],!0)-l-1,u=(h+l)/2|0);else 0===i&&i===o-1?u=s[i]:0===i?(c=n[i+1].column,l=c-t.nodeMinColumnSpace(n[i+1],!0)-l-1,u=Math.min(s[i],l)):i===o-1?(c=n[i-1].column,h=c+t.nodeMinColumnSpace(n[i-1],!1)+h+1,u=Math.max(s[i],h)):(c=n[i-1].column,h=c+t.nodeMinColumnSpace(n[i-1],!1)+h+1,c=n[i+1].column,l=c-t.nodeMinColumnSpace(n[i+1],!0)-l-1,h<s[i]&&s[i]<l?u=s[i]:h>=s[i]?u=h:l<=s[i]&&(u=l));u!==a&&(r=!0,n[i].column=u)}ty(t,e,n),t.normalize()}function _g(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,i.column>e&&(--i.column,t=!0);return t}function Wg(t,e){var i,n=e+1,o=[],r=[];for(i=0;i<=t.sa;i++)o[i]=!1,r[i]=!1;for(var s=t.network.vertexes.iterator;s.next();){i=s.value;var a=i.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.sa;i++)a=a&&!(o[i]&&r[i]);if(a)for(s.reset();s.next();)t=s.value,t.column>e&&(--t.column,n=!0);return n}function $g(t,e){for(var i=0;i<=t.Ca;i++)for(;_g(t,i););for(t.normalize(),i=0;i<t.Ca;i++)for(;Wg(t,i););var n;if(t.normalize(),0<e)for(i=0;i<=t.Ca;i++){var o=Sg(t),r=Cg(t);for(n=r+1;r<n;){n=r,Jg(t,i,1);var s=Cg(t);s>r?Pg(t,o):s<r&&(r=s,o=Sg(t))}}if(0>e)for(i=t.Ca;0<=i;i--)for(o=Sg(t),r=Cg(t),n=r+1;r<n;)n=r,Jg(t,i,-1),s=Cg(t),s>r?Pg(t,o):s<r&&(r=s,o=Sg(t));t.normalize()}function Jg(t,e,i){t.Ec=0;for(var n=t.network.vertexes.iterator;n.next();)n.value.component=-1;if(0<i)for(n.reset();n.next();){var o=n.value;o.column-t.nodeMinColumnSpace(o,!0)<=e&&(o.component=t.Ec)}if(0>i)for(n.reset();n.next();)o=n.value,o.column+t.nodeMinColumnSpace(o,!1)>=e&&(o.component=t.Ec);for(t.Ec++,n.reset();n.next();)e=n.value,-1===e.component&&(jg(t,e,t.Ec,-1,!0,!0),t.Ec++);var r;for(e=[],r=0;r<t.Ec*t.Ec;r++)e[r]=!1;for(o=[],r=0;r<(t.sa+1)*(t.Ca+1);r++)o[r]=-1;for(n.reset();n.next();){r=n.value;for(var s=r.layer,a=Math.max(0,r.column-t.nodeMinColumnSpace(r,!0)),h=Math.min(t.Ca,r.column+t.nodeMinColumnSpace(r,!1));a<=h;a++)o[s*(t.Ca+1)+a]=r.component}for(r=0;r<=t.sa;r++){if(0<i)for(s=0;s<t.Ca;s++)-1!==o[r*(t.Ca+1)+s]&&-1!==o[r*(t.Ca+1)+s+1]&&o[r*(t.Ca+1)+s]!==o[r*(t.Ca+1)+s+1]&&(e[o[r*(t.Ca+1)+s]*t.Ec+o[r*(t.Ca+1)+s+1]]=!0);if(0>i)for(s=t.Ca;0<s;s--)-1!==o[r*(t.Ca+1)+s]&&-1!==o[r*(t.Ca+1)+s-1]&&o[r*(t.Ca+1)+s]!==o[r*(t.Ca+1)+s-1]&&(e[o[r*(t.Ca+1)+s]*t.Ec+o[r*(t.Ca+1)+s-1]]=!0)}for(o=[],r=0;r<t.Ec;r++)o[r]=!0;for(s=[],s.push(0);0!==s.length;)if(h=s[s.length-1],s.pop(),o[h])for(o[h]=!1,r=0;r<t.Ec;r++)e[h*t.Ec+r]&&s.splice(0,0,r);if(0<i)for(n.reset();n.next();)t=n.value,o[t.component]&&--t.column;if(0>i)for(n.reset();n.next();)i=n.value,o[i.component]&&(i.column+=1)}function Zg(t,e){return 270===t.K?e?Oe:Be:90===t.K?e?Be:Oe:180===t.K?e?De:Fe:e?Fe:De}function Qg(t,e){var i=t.zb[e];if(i>=t.xe.length){for(var n=[],o=0;o<t.xe.length;o++)n[o]=t.xe[o];t.xe=n}for(void 0===t.xe[i]||null===t.xe[i]?n=[]:(n=t.xe[i],t.xe[i]=null),t=t.gp[e],e=0;e<t.length;e++)i=t[e],n[i.index]=i;return n}function ty(t,e,i){t.xe[t.zb[e]]=i}Tp.className="CircularLayout",Tp.ConstantSpacing=Gp,Tp.ConstantDistance=Yp,Tp.ConstantAngle=Xp,Tp.Packed=qp,Tp.Clockwise=Up,Tp.Counterclockwise=Kp,Tp.BidirectionalLeft=Hp,Tp.BidirectionalRight=_p,Tp.Forwards=Wp,Tp.Reverse=$p,Tp.Ascending=Jp,Tp.Descending=Zp,Tp.Optimized=Qp,Tp.Pythagorean=tg,Tp.Circular=eg,ig.prototype.compare=function(t,e){if(0<t&&0>this.Am||Math.abs(t)<Math.abs(this.Am)&&!(0>t&&0<this.Am))for(this.Am=t,this.Wk=[],this.cn=[],t=0;t<e.length;t++)this.Wk[t]=e[t].bounds.x,this.cn[t]=e[t].bounds.y},ig.prototype.commit=function(t){if(null!==this.Wk&&null!==this.cn)for(var e=0;e<this.Wk.length;e++){var i=t.J(e);i.x=this.Wk[e],i.y=this.cn[e]}},ig.className="VertexArrangement",f(ng,Qf),ng.prototype.createVertex=function(){return new og(this)},ng.prototype.createEdge=function(){return new sg(this)},ng.className="CircularNetwork",f(og,rd),d.Object.defineProperties(og.prototype,{diameter:{get:function(){return this.Gj},set:function(t){this.Gj!==t&&(this.Gj=t)}},actualAngle:{get:function(){return this.I},set:function(t){this.I!==t&&(this.I=t)}}}),og.className="CircularVertex",f(sg,ad),sg.className="CircularEdge",f(ag,zf),ag.prototype.cloneProtected=function(t){zf.prototype.cloneProtected.call(this,t),t.Pd.assign(this.Pd),t.on=this.on,t.kf=this.kf,t.jd=this.jd,t.Rl=this.Rl,t.Xn=this.Xn,t.Xf=this.Xf,t.bp=this.bp,t.Bp=this.Bp,t.ol=this.ol,t.nl=this.nl,t.ll=this.ll,t.ml=this.ml,t.On=this.On,t.Nn=this.Nn},ag.prototype.serializeLayoutProperties=function(t,e){zf.prototype.serializeLayoutProperties.call(this,t,e),t.arrangementSpacing={width:this.arrangementSpacing.width,height:this.arrangementSpacing.height},t.arrangesToOrigin=this.arrangesToOrigin,t.setsPortSpots=this.setsPortSpots,t.comments=this.comments,t.maxIterations=this.maxIterations,t.epsilonDistance=this.epsilonDistance,t.infinityDistance=this.infinityDistance,t.moveLimit=this.moveLimit,t.defaultSpringStiffness=this.defaultSpringStiffness,t.defaultSpringLength=this.defaultSpringLength,t.defaultElectricalCharge=this.defaultElectricalCharge,t.defaultGravitationalMass=this.defaultGravitationalMass,t.defaultCommentSpringLength=this.defaultCommentSpringLength,t.defaultCommentElectricalCharge=this.defaultCommentElectricalCharge},ag.prototype.deserializeLayoutProperties=function(t,e,i,n,o){zf.prototype.deserializeLayoutProperties.call(this,t,e,i,n,o),this.arrangementSpacing=new Bt(t.arrangementSpacing.width,t.arrangementSpacing.height),this.arrangesToOrigin=t.arrangesToOrigin,this.setsPortSpots=t.setsPortSpots,this.comments=t.comments,this.maxIterations=t.maxIterations,this.epsilonDistance=t.epsilonDistance,this.infinityDistance=t.infinityDistance,this.moveLimit=t.moveLimit,this.defaultSpringStiffness=t.defaultSpringStiffness,this.defaultSpringLength=t.defaultSpringLength,this.defaultElectricalCharge=t.defaultElectricalCharge,this.defaultGravitationalMass=t.defaultGravitationalMass,this.defaultCommentSpringLength=t.defaultCommentSpringLength,this.defaultCommentElectricalCharge=t.defaultCommentElectricalCharge},ag.prototype.createNetwork=function(){return new vg(this)},ag.prototype.doLayout=function(t){if(null===this.network&&(this.network=this.makeNetwork(t)),!this.Uw()){if(t=this.maxIterations,0<this.network.vertexes.count){this.network.Bq();for(var e=this.network.vertexes.iterator;e.next();){var i=e.value;i.charge=this.electricalCharge(i),i.mass=this.gravitationalMass(i)}for(e=this.network.edges.iterator;e.next();)i=e.value,i.stiffness=this.springStiffness(i),i.length=this.springLength(i);if(this.Fv(),this.Eo=0,this.needsClusterLayout()){e=this.network,i=e.Xy();for(var n=i.iterator;n.next();){this.network=n.value;for(var o=this.network.vertexes.iterator;o.next();){var r=o.value;r.Ld=r.vertexes.count,r.Sh=1,r.qk=null,r.Ne=null}hg(this,0,t)}this.network=e;var s=n=i.iterator;n=this.arrangementSpacing;var a=s.count,h=!0;r=o=0;for(var l=j(),u=0;u<a+e.vertexes.count+2;u++)l[u]=null;a=0,s.reset();for(var c=zt.alloc();s.next();)if(u=s.value,this.computeBounds(u,c),h)h=!1,o=c.x+c.width/2,r=c.y+c.height/2,l[0]=new pt(c.x+c.width+n.width,c.y),l[1]=new pt(c.x,c.y+c.height+n.height),a=2;else{var f=dg(l,a,o,r,c.width,c.height,n),d=l[f],p=new pt(d.x+c.width+n.width,d.y),g=new pt(d.x,d.y+c.height+n.height);for(f+1<a&&l.splice(f+1,0,null),l[f]=p,l[f+1]=g,a++,f=d.x-c.x,d=d.y-c.y,u=u.vertexes.iterator;u.next();)p=u.value,p.centerX+=f,p.centerY+=d}for(zt.free(c),u=e.vertexes.iterator;u.next();)s=u.value,f=s.bounds,2>a?(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):(h=dg(l,a,o,r,f.width,f.height,n),c=l[h],d=new pt(c.x+f.width+n.width,c.y),f=new pt(c.x,c.y+f.height+n.height),h+1<a&&l.splice(h+1,0,null),l[h]=d,l[h+1]=f,a++,s.centerX=c.x+s.width/2,s.centerY=c.y+s.height/2);for(O(l),n=i.iterator;n.next();){for(i=n.value,o=i.vertexes.iterator;o.next();)e.Bg(o.value);for(i=i.edges.iterator;i.next();)e.tm(i.value)}}gg(this,t),this.updateParts()}this.Rl=t,this.network=null,this.isValidLayout=!0}},ag.prototype.needsClusterLayout=function(){if(3>this.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.Mc(i)&&(t++,2<t))return!0;if(10<e)break;e++}return!1},ag.prototype.computeBounds=function(t,e){var i=!0;for(t=t.vertexes.iterator;t.next();){var n=t.value;i?(i=!1,e.set(n.bounds)):e.Rc(n.bounds)}return e},ag.prototype.Fv=function(){if(this.comments)for(var t=this.network.vertexes.iterator;t.next();)this.addComments(t.value)},ag.prototype.addComments=function(t){var e=t.node;if(null!==e)for(e=e.Sv();e.next();){var i=e.value;if("Comment"===i.category&&i.isVisible()){var n=this.network.kj(i);null===n&&(n=this.network.mk(i)),n.charge=this.defaultCommentElectricalCharge,i=null;for(var o=n.destinationEdges;o.next();){var r=o.value;if(r.toVertex===t){i=r;break}}if(null===i)for(o=n.sourceEdges;o.next();)if(r=o.value,r.fromVertex===t){i=r;break}null===i&&(i=this.network.Fk(t,n,null)),i.length=this.defaultCommentSpringLength}}},ag.prototype.moveVertex=function(t){var e=t.forceX,i=t.forceY,n=this.moveLimit;return e<-n?e=-n:e>n&&(e=n),i<-n?i=-n:i>n&&(i=n),t.centerX+=e,t.centerY+=i,e*e+i*i},ag.prototype.moveFixedVertex=function(){},ag.prototype.commitLayout=function(){this.Dw(),this.commitNodes(),this.isRouting&&this.commitLinks()},ag.prototype.Dw=function(){if(this.setsPortSpots)for(var t=this.network.edges.iterator;t.next();){var e=t.value.link;null!==e&&(e.fromSpot=Ce,e.toSpot=Ce)}},ag.prototype.commitNodes=function(){var t=0,e=0;if(this.arrangesToOrigin){var i=zt.alloc();this.computeBounds(this.network,i),e=this.arrangementOrigin,t=e.x-i.x,e=e.y-i.y,zt.free(i)}i=zt.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()}zt.free(i)},ag.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},ag.prototype.springStiffness=function(t){return t=t.stiffness,isNaN(t)?this.ol:t},ag.prototype.springLength=function(t){return t=t.length,isNaN(t)?this.nl:t},ag.prototype.electricalCharge=function(t){return t=t.charge,isNaN(t)?this.ll:t},ag.prototype.electricalFieldX=function(){return 0},ag.prototype.electricalFieldY=function(){return 0},ag.prototype.gravitationalMass=function(t){return t=t.mass,isNaN(t)?this.ml:t},ag.prototype.gravitationalFieldX=function(){return 0},ag.prototype.gravitationalFieldY=function(){return 0},ag.prototype.isFixed=function(t){return t.isFixed},d.Object.defineProperties(ag.prototype,{currentIteration:{get:function(){return this.Eo}},arrangementSpacing:{get:function(){return this.Pd},set:function(t){this.Pd.w(t)||(this.Pd.assign(t),this.B())}},arrangesToOrigin:{get:function(){return this.on},set:function(t){this.on!==t&&(this.on=t,this.B())}},setsPortSpots:{get:function(){return this.kf},set:function(t){this.kf!==t&&(this.kf=t,this.B())}},comments:{get:function(){return this.jd},set:function(t){this.jd!==t&&(this.jd=t,this.B())}},maxIterations:{get:function(){return this.Rl},set:function(t){this.Rl!==t&&0<=t&&(this.Rl=t,this.B())}},epsilonDistance:{get:function(){return this.Xn},set:function(t){this.Xn!==t&&0<t&&(this.Xn=t,this.B())}},infinityDistance:{get:function(){return this.Xf},set:function(t){this.Xf!==t&&1<t&&(this.Xf=t,this.B())}},moveLimit:{get:function(){return this.bp},set:function(t){this.bp!==t&&1<t&&(this.bp=t,this.B())}},randomNumberGenerator:{get:function(){return this.Bp},set:function(t){this.Bp!==t&&(null!==t&&"function"!==typeof t.random&&w('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+t),this.Bp=t)}},defaultSpringStiffness:{get:function(){return this.ol},set:function(t){this.ol!==t&&(this.ol=t,this.B())}},defaultSpringLength:{get:function(){return this.nl},set:function(t){this.nl!==t&&(this.nl=t,this.B())}},defaultElectricalCharge:{get:function(){return this.ll},set:function(t){this.ll!==t&&(this.ll=t,this.B())}},defaultGravitationalMass:{get:function(){return this.ml},set:function(t){this.ml!==t&&(this.ml=t,this.B())}},defaultCommentSpringLength:{get:function(){return this.On},set:function(t){this.On!==t&&(this.On=t,this.B())}},defaultCommentElectricalCharge:{get:function(){return this.Nn},set:function(t){this.Nn!==t&&(this.Nn=t,this.B())}}}),ag.className="ForceDirectedLayout",mg.className="ForceDirectedSubnet",f(vg,Qf),vg.prototype.createVertex=function(){return new xg(this)},vg.prototype.createEdge=function(){return new bg(this)},vg.className="ForceDirectedNetwork",f(xg,rd),xg.prototype.serializeVertexProperties=function(t,e){rd.prototype.serializeVertexProperties.call(this,t,e),t.isFixed=this.isFixed,t.charge=this.charge,t.mass=this.mass},xg.prototype.Cq=function(t,e,i,n){rd.prototype.Cq.call(this,t,e,i,n),this.isFixed=t.isFixed,this.charge=t.charge,this.mass=t.mass},d.Object.defineProperties(xg.prototype,{isFixed:{get:function(){return this.La},set:function(t){this.La!==t&&(this.La=t)}},charge:{get:function(){return this.I},set:function(t){this.I!==t&&(this.I=t)}},mass:{get:function(){return this.eb},set:function(t){this.eb!==t&&(this.eb=t)}},forceX:{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t)}},forceY:{get:function(){return this.Ka},set:function(t){this.Ka!==t&&(this.Ka=t)}}}),xg.className="ForceDirectedVertex",f(bg,ad),bg.prototype.serializeEdgeProperties=function(t,e){ad.prototype.serializeEdgeProperties.call(this,t,e),t.stiffness=this.stiffness,t.length=this.length},bg.prototype.deserializeEdgeProperties=function(t,e,i,n){ad.prototype.deserializeEdgeProperties.call(this,t,e,i,n),this.stiffness=t.stiffness,this.length=t.length},d.Object.defineProperties(bg.prototype,{stiffness:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},length:{get:function(){return this.l},set:function(t){this.l!==t&&(this.l=t)}}}),bg.className="ForceDirectedEdge",wg.prototype.random=function(){var t=this.seed%this.Q*this.Zy-this.seed/this.Q*this.bz;return this.seed=0<t?t:t+this.az,this.seed*this.$y},wg.className="RandomNumberGenerator",f(kg,zf),kg.prototype.cloneProtected=function(t){zf.prototype.cloneProtected.call(this,t),t.ue=this.ue,t.Zb=this.Zb,t.K=this.K,t.jl=this.jl,t.Ml=this.Ml,t.Bl=this.Bl,t.Rj=this.Rj,t.Zk=this.Zk,t.ng=this.ng,t.kf=this.kf,t.Mo=this.Mo},kg.prototype.serializeLayoutProperties=function(t,e){zf.prototype.serializeLayoutProperties.call(this,t,e),t.layerSpacing=this.layerSpacing,t.columnSpacing=this.columnSpacing,t.direction=this.direction,t.cycleRemoveOption=this.cycleRemoveOption.name,t.layeringOption=this.layeringOption.name,t.initializeOption=this.initializeOption.name,t.iterations=this.iterations,t.aggressiveOption=this.aggressiveOption.name,t.packOption=this.packOption,t.setsPortSpots=this.setsPortSpots,t.linkSpacing=this.linkSpacing,t.sa=this.sa,t.Ji=this.Ji,t.Ca=this.Ca,t.mh=this.mh,t.pc=this.pc,t.zb=this.zb,t.oh=this.oh,t.Ec=this.Ec,t.Vc={x:this.Vc.x,y:this.Vc.y}},kg.prototype.deserializeLayoutProperties=function(t,e,i,n,o){zf.prototype.deserializeLayoutProperties.call(this,t,e,i,n,o),this.layerSpacing=t.layerSpacing,this.columnSpacing=t.columnSpacing,this.direction=t.direction,this.cycleRemoveOption=K(kg,t.cycleRemoveOption),this.layeringOption=K(kg,t.layeringOption),this.initializeOption=K(kg,t.initializeOption),this.iterations=t.iterations,this.aggressiveOption=K(kg,t.aggressiveOption),this.packOption=t.packOption,this.setsPortSpots=t.setsPortSpots,this.linkSpacing=t.linkSpacing,this.sa=t.sa,this.Ji=t.Ji,this.Ca=t.Ca,this.mh=t.mh,this.pc=t.pc,this.zb=t.zb,this.oh=t.oh,this.Ec=t.Ec,this.Vc=new pt(this.Vc.x,this.Vc.y),o&&!n&&o.edges.each((function(t){if(!t.link&&t.fromVertex&&t.toVertex&&(null===t.fromVertex.node||null===t.toVertex.node)){for(var e=t.fromVertex;null!==e&&null===e.node&&0<e.td.count;){var i=e.td.J(0);if(i.link){t.link=i.link;break}e=i.fromVertex}if(!t.link){for(i=t.toVertex;null!==i&&null===i.node&&0<i.Gd.count;){var n=i.Gd.J(0);if(n.link){t.link=n.link;break}i=n.toVertex}if(!t.link)for(i=i.td.iterator;i.next();)if(n=i.value,n.link&&n.fromVertex===e){t.link=n.link;break}}}}))},kg.prototype.jb=function(t){t.classType===kg?0===t.name.indexOf("Aggressive")?this.aggressiveOption=t:0===t.name.indexOf("Cycle")?this.cycleRemoveOption=t:0===t.name.indexOf("Init")?this.initializeOption=t:0===t.name.indexOf("Layer")?this.layeringOption=t:w("Unknown enum value: "+t):zf.prototype.jb.call(this,t)},kg.prototype.createNetwork=function(){return new gy(this)},kg.prototype.doLayout=function(t){for(null===this.network&&(this.network=this.makeNetwork(t)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.Ji=-1,this.pc=this.mh=0,this.gp=this.fp=this.Wj=null,t=0;t<this.xe.length;t++)this.xe[t]=null;if(0<this.network.vertexes.count){if(this.network.Bq(),this.Uw())return;for(this.cycleRemoveOption!==ny&&this.removeCycles(),t=this.network.vertexes.iterator;t.next();)t.value.layer=-1;for(this.sa=-1,this.assignLayers(),t.reset();t.next();)this.sa=Math.max(this.sa,t.value.layer);this.cycleRemoveOption===ny&&this.removeCycles(),t=this.network;for(var e=[],i=t.edges.iterator;i.next();){var n=i.value;n.valid=!1,e.push(n)}for(i=0;i<e.length;i++){n=e[i];var o=n.fromVertex,r=n.toVertex;if(!(n.valid||(null===o.node&&null===o.data||null===r.node&&null===r.data)&&o.layer===r.layer)){var s=0,a=0,h=0,l=0;if(null!==n.link){if(a=n.link,null===a)continue;var u=o.node;if(s=r.node,null===u||null===s)continue;var c=a.fromNode;h=a.toNode;var f=a.fromPort;if(a=a.toPort,n.rev){l=c;var d=f;c=h,f=a,h=l,a=d}var p=o.focus;l=r.focus;var g=n.rev?r.bounds:o.bounds;d=pt.alloc(),u!==c?g.s()&&c.isVisible()?c.actualBounds.s()?(c.Df(f,ae,d),d.x+=c.actualBounds.x-g.x,d.y+=c.actualBounds.y-g.y):(c.Df(f,ae,d),d.s()||d.assign(p)):d.assign(p):g.s()?(c.Df(f,ae,d),d.s()||d.assign(p)):d.assign(p),c=n.rev?o.bounds:r.bounds,u=pt.alloc(),s!==h?c.s()&&h.isVisible()?h.actualBounds.s()?(h.Df(a,ae,u),u.x+=h.actualBounds.x-c.x,u.y+=h.actualBounds.y-c.y):(h.Df(a,ae,u),u.s()||u.assign(l)):u.assign(l):c.s()?(h.Df(a,ae,u),u.s()||u.assign(l)):u.assign(l),90===this.K||270===this.K?(s=Math.round((d.x-p.x)/this.Zb),h=d.x,a=Math.round((u.x-l.x)/this.Zb),l=u.x):(s=Math.round((d.y-p.y)/this.Zb),h=d.y,a=Math.round((u.y-l.y)/this.Zb),l=u.y),pt.free(d),pt.free(u),n.portFromColOffset=s,n.portFromPos=h,n.portToColOffset=a,n.portToPos=l}else n.portFromColOffset=0,n.portFromPos=0,n.portToColOffset=0,n.portToPos=0;if(d=o.layer,u=r.layer,c=0,g=n.link,null!==g){var y=g.fromPort,m=g.toPort;if(null!==y&&null!==m){var v=g.fromNode;if(f=g.toNode,null!==v&&null!==f){var x=Zg(this,!0),b=Zg(this,!1),w=this.setsPortSpots?x:g.computeSpot(!0,y);p=this.setsPortSpots?b:g.computeSpot(!1,m);var k=g.isOrthogonal;w.Oc()&&w.Ef(b)&&p.Oc()&&p.Ef(x)?c=0:(x=g.getLinkPoint(v,y,w,!0,k,f,m,pt.alloc()),b=g.getLinkDirection(v,y,x,w,!0,k,f,m),pt.free(x),w.Vt()||b!==Vg(this,n,!0)?this.setsPortSpots&&null!==v&&1===v.ports.count&&n.rev&&(c+=1):c+=1,w=g.getLinkPoint(f,m,p,!1,k,v,y,pt.alloc()),g=g.getLinkDirection(f,m,w,p,!1,k,v,y),pt.free(w),p.Vt()||g!==Vg(this,n,!1)?this.setsPortSpots&&null!==f&&1===f.ports.count&&n.rev&&(c+=2):c+=2)}}}if(f=c,c=1===f||3===f,(f=2===f||3===f)&&(p=t.createVertex(),p.node=null,p.wf=1,p.layer=d,p.near=o,t.Bg(p),o=t.Fk(o,p,n.link),o.valid=!1,o.rev=n.rev,o.portFromColOffset=s,o.portToColOffset=0,o.portFromPos=h,o.portToPos=0,o=p),g=1,c&&g--,d-u>g&&0<d){for(n.valid=!1,p=t.createVertex(),p.node=null,p.wf=2,p.layer=d-1,t.Bg(p),o=t.Fk(o,p,n.link),o.valid=!0,o.rev=n.rev,o.portFromColOffset=f?0:s,o.portToColOffset=0,o.portFromPos=f?0:h,o.portToPos=0,o=p,d--;d-u>g&&0<d;)p=t.createVertex(),p.node=null,p.wf=3,p.layer=d-1,t.Bg(p),o=t.Fk(o,p,n.link),o.valid=!0,o.rev=n.rev,o.portFromColOffset=0,o.portToColOffset=0,o.portFromPos=0,o.portToPos=0,o=p,d--;o=t.Fk(p,r,n.link),o.valid=!c,c&&(p.near=r),o.rev=n.rev,o.portFromColOffset=0,o.portToColOffset=a,o.portFromPos=0,o.portToPos=l}else n.valid=!0}}for(t=this.zb=[],e=0;e<=this.sa;e++)t[e]=0;for(e=this.network.vertexes.iterator;e.next();)e.value.index=-1;for(this.initializeIndices(),this.Ji=-1,i=this.pc=this.mh=0;i<=this.sa;i++)t[i]>t[this.pc]&&(this.Ji=t[i]-1,this.pc=i),t[i]<t[this.mh]&&(this.mh=i);for(this.gp=[],i=0;i<t.length;i++)this.gp[i]=[];for(e.reset();e.next();)t=e.value,this.gp[t.layer][t.index]=t;for(this.Ca=-1,t=0;t<=this.sa;t++){for(e=Qg(this,t),i=0,n=this.zb[t],r=0;r<n;r++)o=e[r],i+=this.nodeMinColumnSpace(o,!0),o.column=i,i+=1,i+=this.nodeMinColumnSpace(o,!1);this.Ca=Math.max(this.Ca,i-1),ty(this,t,e)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},kg.prototype.linkMinLength=function(){return 1},kg.prototype.nodeMinLayerSpace=function(t,e){return null===t.node&&null===t.data?0:90===this.K||270===this.K?e?t.focus.y+10:t.bounds.height-t.focus.y+10:e?t.focus.x+10:t.bounds.width-t.focus.x+10},kg.prototype.nodeMinColumnSpace=function(t,e){if(null===t.node&&null===t.data)return 0;var i=e?t.Nk:t.Mk;return null!==i?i:(i=this.K,90===i||270===i?e?t.Nk=t.focus.x/this.Zb+1|0:t.Mk=(t.bounds.width-t.focus.x)/this.Zb+1|0:e?t.Nk=t.focus.y/this.Zb+1|0:t.Mk=(t.bounds.height-t.focus.y)/this.Zb+1|0)},kg.prototype.countCrossings=function(){for(var t=0,e=0;e<=this.sa;e++)for(var i=Ng(this,e,1),n=this.zb[e],o=0;o<n;o++)for(var r=o;r<n;r++)t+=i[o*n+r];return t},kg.prototype.normalize=function(){var t=1/0;this.Ca=-1;for(var e=this.network.vertexes.iterator;e.next();){var i=e.value;t=Math.min(t,i.column-this.nodeMinColumnSpace(i,!0)),this.Ca=Math.max(this.Ca,i.column+this.nodeMinColumnSpace(i,!1))}for(e.reset();e.next();)e.value.column-=t;this.Ca-=t},kg.prototype.removeCycles=function(){for(var t=this.network.edges.iterator;t.next();)t.value.rev=!1;switch(this.jl){default:case iy:t=this.network;var e=0,i=t.vertexes.count-1,n=[];n.length=i+1;for(var o=t.vertexes.iterator;o.next();)o.value.valid=!0;for(;null!==Og(t);){for(o=Dg(t);null!==o;)n[i]=o,i--,o.valid=!1,o=Dg(t);for(o=Fg(t);null!==o;)n[e]=o,e++,o.valid=!1,o=Fg(t);o=null;for(var r=0,s=this.network.vertexes.iterator;s.next();){var a=s.value;if(a.valid){for(var h=0,l=a.destinationEdges;l.next();)l.value.toVertex.valid&&h++;l=0;for(var u=a.sourceEdges;u.next();)u.value.fromVertex.valid&&l++;(null===o||r<h-l)&&(o=a,r=h-l)}}null!==o&&(n[e]=o,e++,o.valid=!1)}for(e=0;e<t.vertexes.count;e++)n[e].index=e;for(n=t.edges.iterator;n.next();)e=n.value,e.fromVertex.index>e.toVertex.index&&(t.Rm(e),e.rev=!0);break;case ey:for(n=this.network.vertexes.iterator;n.next();)t=n.value,t.Cg=-1,t.finish=-1;for(t=this.network.edges.iterator;t.next();)t.value.forest=!1;for(this.oh=0,n.reset();n.next();)e=n.value,0===e.sourceEdges.count&&Bg(this,e);for(n.reset();n.next();)e=n.value,-1===e.Cg&&Bg(this,e);for(t.reset();t.next();)n=t.value,n.forest||(e=n.fromVertex,i=e.finish,o=n.toVertex,r=o.finish,o.Cg<e.Cg&&i<r&&(this.network.Rm(n),n.rev=!0));break;case ny:for(t=this.network,e=t.vertexes.iterator,n=1/0;e.next();)n=Math.min(n,e.value.layer);if(1/0>n){if(0>n)for(e.reset();e.next();)e.value.layer-=n;for(n=[],e.reset();e.next();)i=e.value,o=n[i.layer],void 0===o?n[i.layer]=[i]:o.push(i);for(i=e=0;i<n.length;i++)if(o=n[i],o&&0!==o.length){if(0<i)for(r=0;r<o.length;r++)o[r].layer-=e}else e++;for(n=t.edges.iterator;n.next();)e=n.value,e.fromVertex.layer<e.toVertex.layer&&(t.Rm(e),e.rev=!0)}}},kg.prototype.assignLayers=function(){switch(this.Ml){case ry:Ig(this);break;case sy:for(var t,e=this.network.vertexes.iterator;e.next();)t=Rg(this,e.value),this.sa=Math.max(t,this.sa);for(e.reset();e.next();)t=e.value,t.layer=this.sa-t.layer;break;default:case oy:for(Ig(this),e=this.network.vertexes.iterator;e.next();)e.value.valid=!1;for(e.reset();e.next();)t=e.value,0===t.sourceEdges.count&&zg(this,t);for(t=1/0,e.reset();e.next();)t=Math.min(t,e.value.layer);for(this.sa=-1,e.reset();e.next();){var i=e.value;i.layer-=t,this.sa=Math.max(this.sa,i.layer)}}},kg.prototype.initializeIndices=function(){switch(this.Bl){default:case ly:for(var t=this.network.vertexes.iterator;t.next();){var e=t.value,i=e.layer;e.index=this.zb[i],this.zb[i]++}break;case ay:for(t=this.network.vertexes.iterator,e=this.sa;0<=e;e--)for(t.reset();t.next();)i=t.value,i.layer===e&&-1===i.index&&Gg(this,i);break;case hy:for(t=this.network.vertexes.iterator,e=0;e<=this.sa;e++)for(t.reset();t.next();)i=t.value,i.layer===e&&-1===i.index&&Yg(this,i)}},kg.prototype.reduceCrossings=function(){var t,e,i,n,o,r=this.countCrossings(),s=Sg(this);for(t=0;t<this.Rj;t++){for(e=0;e<=this.sa;e++)Xg(this,e,1),qg(this,e,1);var a=this.countCrossings();for(a<r&&(r=a,s=Sg(this)),e=this.sa;0<=e;e--)Xg(this,e,-1),qg(this,e,-1);a=this.countCrossings(),a<r&&(r=a,s=Sg(this))}for(Pg(this,s),t=0;t<this.Rj;t++){for(e=0;e<=this.sa;e++)Xg(this,e,0),qg(this,e,0);for(a=this.countCrossings(),a<r&&(r=a,s=Sg(this)),e=this.sa;0<=e;e--)Xg(this,e,0),qg(this,e,0);a=this.countCrossings(),a<r&&(r=a,s=Sg(this))}switch(Pg(this,s),this.Zk){case uy:break;case fy:for(o=r+1;(e=this.countCrossings())<o;)for(o=e,t=this.sa;0<=t;t--)for(n=0;n<=t;n++){for(i=!0;i;)for(i=!1,e=t;e>=n;e--)i=qg(this,e,-1)||i;for(a=this.countCrossings(),a>=r?Pg(this,s):(r=a,s=Sg(this)),i=!0;i;)for(i=!1,e=t;e>=n;e--)i=qg(this,e,1)||i;for(a=this.countCrossings(),a>=r?Pg(this,s):(r=a,s=Sg(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=qg(this,e,1)||i;for(a>=r?Pg(this,s):(r=a,s=Sg(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=qg(this,e,-1)||i;for(a>=r?Pg(this,s):(r=a,s=Sg(this)),i=!0;i;)for(i=!1,e=t;e>=n;e--)i=qg(this,e,0)||i;for(a>=r?Pg(this,s):(r=a,s=Sg(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=qg(this,e,0)||i;a>=r?Pg(this,s):(r=a,s=Sg(this))}break;default:case cy:for(t=this.sa,n=0,o=r+1;(e=this.countCrossings())<o;){for(o=e,i=!0;i;)for(i=!1,e=t;e>=n;e--)i=qg(this,e,-1)||i;for(a=this.countCrossings(),a>=r?Pg(this,s):(r=a,s=Sg(this)),i=!0;i;)for(i=!1,e=t;e>=n;e--)i=qg(this,e,1)||i;for(a=this.countCrossings(),a>=r?Pg(this,s):(r=a,s=Sg(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=qg(this,e,1)||i;for(a>=r?Pg(this,s):(r=a,s=Sg(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=qg(this,e,-1)||i;for(a>=r?Pg(this,s):(r=a,s=Sg(this)),i=!0;i;)for(i=!1,e=t;e>=n;e--)i=qg(this,e,0)||i;for(a>=r?Pg(this,s):(r=a,s=Sg(this)),i=!0;i;)for(i=!1,e=n;e<=t;e++)i=qg(this,e,0)||i;a>=r?Pg(this,s):(r=a,s=Sg(this))}}Pg(this,s)},kg.prototype.straightenAndPack=function(){var t=0!==(1&this.ng),e=0!==(this.ng&dy);if(1e3<this.network.edges.count&&e&&(t=!1),t){var i=[];for(e=0;e<=this.sa;e++)i[e]=0;for(var n,o=this.network.vertexes.iterator;o.next();){var r=o.value;e=r.layer,n=r.column,r=this.nodeMinColumnSpace(r,!1),i[e]=Math.max(i[e],n+r)}for(o.reset();o.next();)r=o.value,e=r.layer,n=r.column,r.column=(8*(this.Ca-i[e])>>1)+8*n;this.Ca*=8}if(0!==(2&this.ng))for(i=!0;i;){for(i=!1,e=this.pc+1;e<=this.sa;e++)i=Ug(this,e,1)||i;for(e=this.pc-1;0<=e;e--)i=Ug(this,e,-1)||i;i=Ug(this,this.pc,0)||i}if(0!==(4&this.ng)){for(e=this.pc+1;e<=this.sa;e++)Hg(this,e,1);for(e=this.pc-1;0<=e;e--)Hg(this,e,-1);Hg(this,this.pc,0)}if(t&&($g(this,-1),$g(this,1)),0!==(2&this.ng))for(i=!0;i;){for(i=!1,i=Ug(this,this.pc,0)||i,e=this.pc+1;e<=this.sa;e++)i=Ug(this,e,0)||i;for(e=this.pc-1;0<=e;e--)i=Ug(this,e,0)||i}},kg.prototype.commitLayout=function(){if(this.setsPortSpots)for(var t=Zg(this,!0),e=Zg(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.Iv(),this.isRouting&&this.commitLinks()},kg.prototype.commitNodes=function(){this.$d=[],this.zd=[],this.yd=[],this.Ia=[];for(var t=0;t<=this.sa;t++)this.$d[t]=0,this.zd[t]=0,this.yd[t]=0,this.Ia[t]=0;for(t=this.network.vertexes.iterator;t.next();){var e=t.value,i=e.layer;this.$d[i]=Math.max(this.$d[i],this.nodeMinLayerSpace(e,!0)),this.zd[i]=Math.max(this.zd[i],this.nodeMinLayerSpace(e,!1))}e=0,i=this.ue;for(var n=0;n<=this.sa;n++){var o=i;0>=this.$d[n]+this.zd[n]&&(o=0),0<n&&(e+=o/2),90===this.K||0===this.K?(e+=this.zd[n],this.yd[n]=e,e+=this.$d[n]):(e+=this.$d[n],this.yd[n]=e,e+=this.zd[n]),n<this.sa&&(e+=o/2),this.Ia[n]=e}for(i=e,e=this.arrangementOrigin,n=0;n<=this.sa;n++)270===this.K?this.yd[n]=e.y+this.yd[n]:90===this.K?(this.yd[n]=e.y+i-this.yd[n],this.Ia[n]=i-this.Ia[n]):180===this.K?this.yd[n]=e.x+this.yd[n]:(this.yd[n]=e.x+i-this.yd[n],this.Ia[n]=i-this.Ia[n]);for(t.reset(),i=n=1/0;t.next();){o=t.value;var r=o.layer,s=0|o.column;if(270===this.K||90===this.K){var a=e.x+this.Zb*s;r=this.yd[r]}else a=this.yd[r],r=e.y+this.Zb*s;o.centerX=a,o.centerY=r,n=Math.min(o.x,n),i=Math.min(o.y,i)}for(n=e.x-n,e=e.y-i,this.Vc=new pt(n,e),t.reset();t.next();)i=t.value,i.x+=n,i.y+=e,i.commit()},kg.prototype.Iv=function(){for(var t=0,e=this.ue,i=0;i<=this.sa;i++)t+=this.$d[i],t+=this.zd[i];t+=this.sa*e,e=[],i=this.Zb*this.Ca;for(var n=this.maxLayer;0<=n;n--)270===this.K?0===n?e.push(new zt(0,0,i,Math.abs(this.Ia[0]))):e.push(new zt(0,this.Ia[n-1],i,Math.abs(this.Ia[n-1]-this.Ia[n]))):90===this.K?0===n?e.push(new zt(0,this.Ia[0],i,Math.abs(this.Ia[0]-t))):e.push(new zt(0,this.Ia[n],i,Math.abs(this.Ia[n-1]-this.Ia[n]))):180===this.K?0===n?e.push(new zt(0,0,Math.abs(this.Ia[0]),i)):e.push(new zt(this.Ia[n-1],0,Math.abs(this.Ia[n-1]-this.Ia[n]),i)):0===n?e.push(new zt(this.Ia[0],0,Math.abs(this.Ia[0]-t),i)):e.push(new zt(this.Ia[n],0,Math.abs(this.Ia[n-1]-this.Ia[n]),i));this.commitLayers(e,this.Vc)},kg.prototype.commitLayers=function(){},kg.prototype.commitLinks=function(){for(var t,e=this.network.edges.iterator;e.next();)t=e.value.link,null!==t&&(t.Th(),t.pk(),t.xf());for(e.reset();e.next();)t=e.value.link,null!==t&&t.xj();for(e.reset();e.next();){var i=e.value;if(t=i.link,null!==t){t.Th();var n=t,o=n.fromNode,r=n.toNode,s=n.fromPort,a=n.toPort;if(null!==o){var h=o.findVisibleNode();null!==h&&h!==o&&(o=h,s=h.port)}null!==r&&(h=r.findVisibleNode(),null!==h&&h!==r&&(r=h,a=h.port));var l=t.computeSpot(!0,s);h=t.computeSpot(!1,a);var u=i.fromVertex,c=i.toVertex;if(i.valid){if(t.curve===ef&&4===t.pointsCount)if(u.column===c.column)i=t.getLinkPoint(o,s,l,!0,!1,r,a),s=t.getLinkPoint(r,a,h,!1,!1,o,s),i.s()||i.set(o.actualBounds.center),s.s()||s.set(r.actualBounds.center),t.pk(),t.vf(i.x,i.y),t.vf((2*i.x+s.x)/3,(2*i.y+s.y)/3),t.vf((i.x+2*s.x)/3,(i.y+2*s.y)/3),t.vf(s.x,s.y);else{var f=!1,d=!1;if(null!==s&&l===ie&&(f=!0),null!==a&&h===ie&&(d=!0),f||d){var p=t.i(0).x;i=t.i(0).y,u=t.i(3).x,n=t.i(3).y,f&&(90===this.K||270===this.K?(f=p,c=(i+n)/2):(f=(p+u)/2,c=i),t.L(1,f,c),l=t.getLinkPoint(o,s,l,!0,!1,r,a),l.s()||l.set(o.actualBounds.center),t.L(0,l.x,l.y)),d&&(90===this.K||270===this.K?(l=u,i=(i+n)/2):(l=(p+u)/2,i=n),t.L(2,l,i),o=t.getLinkPoint(r,a,h,!1,!1,o,s),o.s()||o.set(r.actualBounds.center),t.L(3,o.x,o.y))}}t.xf()}else if(u.layer===c.layer)t.xf();else{if(f=d=!1,p=t.firstPickIndex+1,t.isOrthogonal){f=!0;var g=t.pointsCount;4<g&&t.points.removeRange(2,g-3)}else if(t.curve===ef)d=!0,g=t.pointsCount,4<g&&t.points.removeRange(2,g-3),4===g&&(p=2);else{g=t.pointsCount;var y=l===ie,m=h===ie;2<g&&y&&m?t.points.removeRange(1,g-2):3<g&&y&&!m?t.points.removeRange(1,g-3):3<g&&!y&&m?t.points.removeRange(2,g-2):4<g&&!y&&!m&&t.points.removeRange(2,g-3)}if(i.rev){for(;null!==c&&u!==c;){var v=g=null;for(y=c.sourceEdges.iterator;y.next()&&(m=y.value,m.link!==i.link||(g=m.fromVertex,v=m.toVertex,null!==g.node)););if(g!==u){y=t.i(p-1).x,m=t.i(p-1).y;var x=g.centerX,b=g.centerY;if(f)180===this.K||0===this.K?p===t.firstPickIndex+1?(t.m(p++,y,m),t.m(p++,y,b)):(null!==v?v.centerY:m)!==b&&(v=this.Ia[g.layer-1]+this.Vc.x,t.m(p++,v,m),t.m(p++,v,b)):p===t.firstPickIndex+1?(t.m(p++,y,m),t.m(p++,x,m)):(null!==v?v.centerX:y)!==x&&(v=this.Ia[g.layer-1]+this.Vc.y,t.m(p++,y,v),t.m(p++,x,v));else if(p===t.firstPickIndex+1){v=Math.max(10,this.$d[c.layer]);var w=Math.max(10,this.zd[c.layer]);if(d)180===this.K?x<=c.bounds.x?(c=c.bounds.x,t.m(p++,c-v,b),t.m(p++,c,b),t.m(p++,c+w,b)):(t.m(p++,x-v,b),t.m(p++,x,b),t.m(p++,x+w,b)):90===this.K?b>=c.bounds.bottom?(c=c.bounds.y+c.bounds.height,t.m(p++,x,c+w),t.m(p++,x,c),t.m(p++,x,c-v)):(t.m(p++,x,b+w),t.m(p++,x,b),t.m(p++,x,b-v)):270===this.K?b<=c.bounds.y?(c=c.bounds.y,t.m(p++,x,c-v),t.m(p++,x,c),t.m(p++,x,c+w)):(t.m(p++,x,b-v),t.m(p++,x,b),t.m(p++,x,b+w)):0===this.K&&(x>=c.bounds.right?(c=c.bounds.x+c.bounds.width,t.m(p++,c+w,b),t.m(p++,c,b),t.m(p++,c-v,b)):(t.m(p++,x+w,b),t.m(p++,x,b),t.m(p++,x-v,b)));else{t.m(p++,y,m);var k=0;180===this.K||0===this.K?((180===this.K?x>=c.bounds.right:x<=c.bounds.x)&&(k=(0===this.K?-v:w)/2),t.m(p++,y+k,b)):((270===this.K?b>=c.bounds.bottom:b<=c.bounds.y)&&(k=(90===this.K?-v:w)/2),t.m(p++,x,m+k)),t.m(p++,x,b)}}else v=Math.max(10,this.$d[g.layer]),w=Math.max(10,this.zd[g.layer]),180===this.K?(d&&t.m(p++,x-v,b),t.m(p++,x,b),d&&t.m(p++,x+w,b)):90===this.K?(d&&t.m(p++,x,b+w),t.m(p++,x,b),d&&t.m(p++,x,b-v)):270===this.K?(d&&t.m(p++,x,b-v),t.m(p++,x,b),d&&t.m(p++,x,b+w)):(d&&t.m(p++,x+w,b),t.m(p++,x,b),d&&t.m(p++,x-v,b))}c=g}(null===a||l!==ie||f)&&(y=t.i(p-1).x,m=t.i(p-1).y,x=t.i(p).x,b=t.i(p).y,f?(c=this.zd[u.layer],180===this.K||0===this.K?(f=m,f>=u.bounds.y&&f<=u.bounds.bottom&&(180===this.K?x>=u.bounds.x:x<=u.bounds.right)&&(c=u.centerX+(180===this.K?-c:c),f=f<u.bounds.y+u.bounds.height/2?u.bounds.y-this.Zb/2:u.bounds.bottom+this.Zb/2,t.m(p++,c,m),t.m(p++,c,f)),t.m(p++,x,f)):(f=y,f>=u.bounds.x&&f<=u.bounds.right&&(270===this.K?b>=u.bounds.y:b<=u.bounds.bottom)&&(c=u.centerY+(270===this.K?-c:c),f=f<u.bounds.x+u.bounds.width/2?u.bounds.x-this.Zb/2:u.bounds.right+this.Zb/2,t.m(p++,y,c),t.m(p++,f,c)),t.m(p++,f,b)),t.m(p++,x,b)):d?(v=Math.max(10,this.$d[u.layer]),w=Math.max(10,this.zd[u.layer]),180===this.K&&x>=u.bounds.x?(c=u.bounds.x+u.bounds.width,t.L(p-2,c,m),t.L(p-1,c+w,m)):90===this.K&&b<=u.bounds.bottom?(c=u.bounds.y,t.L(p-2,y,c),t.L(p-1,y,c-v)):270===this.K&&b>=u.bounds.y?(c=u.bounds.y+u.bounds.height,t.L(p-2,y,c),t.L(p-1,y,c+w)):0===this.K&&x<=u.bounds.right&&(c=u.bounds.x,t.L(p-2,c,m),t.L(p-1,c-v,m))):(v=Math.max(10,this.$d[u.layer]),w=Math.max(10,this.zd[u.layer]),f=0,180===this.K||0===this.K?((180===this.K?x<=u.bounds.x:x>=u.bounds.right)&&(f=(0===this.K?w:-v)/2),t.m(p++,x+f,m)):((270===this.K?b<=u.bounds.y:b>=u.bounds.bottom)&&(f=(90===this.K?w:-v)/2),t.m(p++,y,b+f)),t.m(p++,x,b)))}else{for(;null!==u&&u!==c;){for(v=g=null,u=u.destinationEdges.iterator;u.next()&&(y=u.value,y.link!==i.link||(g=y.toVertex,v=y.fromVertex,null!==v.node&&(v=null),null!==g.node)););g!==c&&(y=t.i(p-1).x,m=t.i(p-1).y,x=g.centerX,b=g.centerY,f?180===this.K||0===this.K?(null!==v?v.centerY:m)!==b&&(v=this.Ia[g.layer]+this.Vc.x,p===t.firstPickIndex+1&&(v=0===this.K?Math.max(v,y):Math.min(v,y)),t.m(p++,v,m),t.m(p++,v,b)):(null!==v?v.centerX:y)!==x&&(v=this.Ia[g.layer]+this.Vc.y,p===t.firstPickIndex+1&&(v=90===this.K?Math.max(v,m):Math.min(v,m)),t.m(p++,y,v),t.m(p++,x,v)):(v=Math.max(10,this.$d[g.layer]),w=Math.max(10,this.zd[g.layer]),180===this.K?(t.m(p++,x+w,b),d&&t.m(p++,x,b),t.m(p++,x-v,b)):90===this.K?(t.m(p++,x,b-v),d&&t.m(p++,x,b),t.m(p++,x,b+w)):270===this.K?(t.m(p++,x,b+w),d&&t.m(p++,x,b),t.m(p++,x,b-v)):(t.m(p++,x-v,b),d&&t.m(p++,x,b),t.m(p++,x+w,b)))),u=g}f&&(y=t.i(p-1).x,m=t.i(p-1).y,x=t.i(p).x,b=t.i(p).y,180===this.K||0===this.K?m!==b&&(v=0===this.K?Math.min(Math.max((x+y)/2,this.Ia[c.layer]+this.Vc.x),x):Math.max(Math.min((x+y)/2,this.Ia[c.layer]+this.Vc.x),x),t.m(p++,v,m),t.m(p++,v,b)):y!==x&&(v=90===this.K?Math.min(Math.max((b+m)/2,this.Ia[c.layer]+this.Vc.y),b):Math.max(Math.min((b+m)/2,this.Ia[c.layer]+this.Vc.y),b),t.m(p++,y,v),t.m(p++,x,v)))}null!==n&&d&&(null!==s&&(l===ie&&(l=t.i(0),n=t.i(2),l.w(n)||t.L(1,(l.x+n.x)/2,(l.y+n.y)/2)),l=t.getLinkPoint(o,s,ie,!0,!1,r,a),l.s()||l.set(o.actualBounds.center),t.L(0,l.x,l.y)),null!==a&&(h===ie&&(h=t.i(t.pointsCount-1),l=t.i(t.pointsCount-3),h.w(l)||t.L(t.pointsCount-2,(h.x+l.x)/2,(h.y+l.y)/2)),o=t.getLinkPoint(r,a,ie,!1,!1,o,s),o.s()||o.set(r.actualBounds.center),t.L(t.pointsCount-1,o.x,o.y))),t.xf(),i.commit()}}}this.avoidOrthogonalOverlaps()},kg.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var t=new et,e=this.network.edges.iterator;e.next();){var i=e.value.link;null!==i&&i.isOrthogonal&&!t.contains(i)&&t.add(i)}if(0<t.count)if(90===this.K||270===this.K){for(e=0,i=[],t=t.iterator;t.next();){var n=t.value;if(null!==n&&n.isOrthogonal)for(var o=2;o<n.pointsCount-3;o++){var r=n.i(o),s=n.i(o+1);if(this.A(r.y,s.y)&&!this.A(r.x,s.x)){var a=new py;a.layer=Math.floor(r.y/2);var h=n.i(0),l=n.i(n.pointsCount-1);if(a.first=h.x*h.x+h.y,a.Xb=l.x*l.x+l.y,a.fd=Math.min(r.x,s.x),a.vc=Math.max(r.x,s.x),a.index=o,a.link=n,o+2<n.pointsCount){h=n.i(o-1),l=n.i(o+2);var u=0;h.y<r.y?u=l.y<r.y?3:r.x<s.x?2:1:h.y>r.y&&(u=l.y>r.y?0:s.x<r.x?2:1),a.l=u}i.push(a)}}}if(1<i.length)for(i.sort(this.Ry),t=0;t<i.length;){for(r=i[t].layer,n=t+1;n<i.length&&i[n].layer===r;)n++;if(1<n-t)for(r=t;r<n;){for(s=i[r].vc,o=t+1;o<n&&i[o].fd<s;)s=Math.max(s,i[o].vc),o++;if(s=o-r,1<s){for(this.uj(i,this.hu,r,r+s),u=1,a=i[r].Xb,h=r;h<o;h++)l=i[h],l.Xb!==a&&(u++,a=l.Xb);this.uj(i,this.Qy,r,r+s);var c=1;for(a=i[r].first,h=r;h<o;h++)l=i[h],l.first!==a&&(c++,a=l.first);for(h=!0,l=c,u<c?(h=!1,l=u,a=i[r].Xb,this.uj(i,this.hu,r,r+s)):a=i[r].first,u=0,c=r;c<o;c++){var f=i[c];(h?f.first:f.Xb)!==a&&(u++,a=h?f.first:f.Xb);var d=f.link;r=d.i(f.index),s=d.i(f.index+1);var p=this.linkSpacing*(u-(l-1)/2);e++,d.Th(),d.L(f.index,r.x,r.y+p),d.L(f.index+1,s.x,s.y+p),d.xf()}}r=o}t=n}}else{for(e=0,i=[],t=t.iterator;t.next();)if(n=t.value,null!==n&&n.isOrthogonal)for(o=2;o<n.pointsCount-3;o++)r=n.i(o),s=n.i(o+1),this.A(r.x,s.x)&&!this.A(r.y,s.y)&&(a=new py,a.layer=Math.floor(r.x/2),h=n.i(0),l=n.i(n.pointsCount-1),a.first=h.x+h.y*h.y,a.Xb=l.x+l.y*l.y,a.fd=Math.min(r.y,s.y),a.vc=Math.max(r.y,s.y),a.index=o,a.link=n,o+2<n.pointsCount&&(h=n.i(o-1),l=n.i(o+2),u=0,h.x<r.x?u=l.x<r.x?3:r.y<s.y?2:1:h.x>r.x&&(u=l.x>r.x?0:s.y<r.y?2:1),a.l=u),i.push(a));if(1<i.length)for(i.sort(this.Ry),t=0;t<i.length;){for(r=i[t].layer,n=t+1;n<i.length&&i[n].layer===r;)n++;if(1<n-t)for(r=t;r<n;){for(s=i[r].vc,o=t+1;o<n&&i[o].fd<s;)s=Math.max(s,i[o].vc),o++;if(s=o-r,1<s){for(this.uj(i,this.hu,r,r+s),u=1,a=i[r].Xb,h=r;h<o;h++)l=i[h],l.Xb!==a&&(u++,a=l.Xb);for(this.uj(i,this.Qy,r,r+s),c=1,a=i[r].first,h=r;h<o;h++)l=i[h],l.first!==a&&(c++,a=l.first);for(h=!0,l=c,u<c?(h=!1,l=u,a=i[r].Xb,this.uj(i,this.hu,r,r+s)):a=i[r].first,u=0,c=r;c<o;c++)f=i[c],(h?f.first:f.Xb)!==a&&(u++,a=h?f.first:f.Xb),d=f.link,r=d.i(f.index),s=d.i(f.index+1),p=this.linkSpacing*(u-(l-1)/2),e++,d.Th(),d.L(f.index,r.x+p,r.y),d.L(f.index+1,s.x+p,s.y),d.xf()}r=o}t=n}}}},i=kg.prototype,i.Ry=function(t,e){return t instanceof py&&e instanceof py&&t!==e?t.layer<e.layer?-1:t.layer>e.layer?1:t.fd<e.fd?-1:t.fd>e.fd?1:t.vc<e.vc?-1:t.vc>e.vc?1:0:0},i.Qy=function(t,e){return t instanceof py&&e instanceof py&&t!==e?t.first<e.first?-1:t.first>e.first||t.l<e.l?1:t.l>e.l||t.fd<e.fd?-1:t.fd>e.fd?1:t.vc<e.vc?-1:t.vc>e.vc?1:0:0},i.hu=function(t,e){return t instanceof py&&e instanceof py&&t!==e?t.Xb<e.Xb?-1:t.Xb>e.Xb||t.l<e.l?1:t.l>e.l||t.fd<e.fd?-1:t.fd>e.fd?1:t.vc<e.vc?-1:t.vc>e.vc?1:0:0},i.A=function(t,e){return t-=e,-1<t&&1>t},i.uj=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)n=t[i],o=t[i+1],0<e(n,o)&&(t[i]=o,t[i+1]=n);else if(0===i)if(n>=o)t.sort(e);else for(i=t.slice(0,n),i.sort(e),e=0;e<n;e++)t[e]=i[e];else if(n>=o)for(n=t.slice(i),n.sort(e),e=i;e<o;e++)t[e]=n[e-i];else for(o=t.slice(i,n),o.sort(e),e=i;e<n;e++)t[e]=o[e-i]},d.Object.defineProperties(kg.prototype,{layerSpacing:{get:function(){return this.ue},set:function(t){this.ue!==t&&0<=t&&(this.ue=t,this.B())}},columnSpacing:{get:function(){return this.Zb},set:function(t){this.Zb!==t&&0<t&&(this.Zb=t,this.B())}},direction:{get:function(){return this.K},set:function(t){this.K!==t&&(0===t||90===t||180===t||270===t?(this.K=t,this.B()):w("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.jl},set:function(t){this.jl===t||t!==iy&&t!==ey&&t!==ny||(this.jl=t,this.B())}},layeringOption:{get:function(){return this.Ml},set:function(t){this.Ml===t||t!==oy&&t!==ry&&t!==sy||(this.Ml=t,this.B())}},initializeOption:{get:function(){return this.Bl},set:function(t){this.Bl===t||t!==ay&&t!==hy&&t!==ly||(this.Bl=t,this.B())}},iterations:{get:function(){return this.Rj},set:function(t){this.Rj!==t&&0<=t&&(this.Rj=t,this.B())}},aggressiveOption:{get:function(){return this.Zk},set:function(t){this.Zk===t||t!==uy&&t!==cy&&t!==fy||(this.Zk=t,this.B())}},packOption:{get:function(){return this.ng},set:function(t){this.ng!==t&&0<=t&&8>t&&(this.ng=t,this.B())}},setsPortSpots:{get:function(){return this.kf},set:function(t){this.kf!==t&&(this.kf=t,this.B())}},linkSpacing:{get:function(){return this.Mo},set:function(t){this.Mo!==t&&0<=t&&(this.Mo=t,this.B())}},maxLayer:{get:function(){return this.sa}},maxIndex:{get:function(){return this.Ji}},maxColumn:{get:function(){return this.Ca}},minIndexLayer:{get:function(){return this.mh}},maxIndexLayer:{get:function(){return this.pc}}});var ey=new U(kg,"CycleDepthFirst",0),iy=new U(kg,"CycleGreedy",1),ny=new U(kg,"CycleFromLayers",2),oy=new U(kg,"LayerOptimalLinkLength",0),ry=new U(kg,"LayerLongestPathSink",1),sy=new U(kg,"LayerLongestPathSource",2),ay=new U(kg,"InitDepthFirstOut",0),hy=new U(kg,"InitDepthFirstIn",1),ly=new U(kg,"InitNaive",2),uy=new U(kg,"AggressiveNone",0),cy=new U(kg,"AggressiveLess",1),fy=new U(kg,"AggressiveMore",2),dy=8;function py(){this.index=this.vc=this.fd=this.Xb=this.first=this.layer=0,this.link=null,this.l=0}function gy(t){Qf.call(this,t)}function yy(t){rd.call(this,t),this.Ra=this.Rg=this.Fi=-1,this.I=NaN,this.T=null,this.valid=!1,this.finish=this.Cg=NaN,this.wf=0,this.Mk=this.Nk=null}function my(t){ad.call(this,t),this.l=this.La=this.eb=!1,this.Ka=this.I=NaN,this.T=this.u=0}function vy(){zf.call(this),this.Jb=new nt,this.vp=$y,this.kd=Jy,this.oq=dm,this.ts=bm,this.nx=[],this.jd=!0,this.Eb=mm,this.Pd=new Bt(10,10).freeze();var t=new Mm(this);this.U=new Sm(t),this.V=new Sm(t),this.uv=[]}function xy(t){var e=new nt;for(t=t.iterator;t.next();){var i=t.value;i.initialized||e.add(i)}return e}function by(t,e){var i=999999,n=null;for(e=e.iterator;e.next();){var o=e.value;switch(t.kd){case Jy:o.sourceEdges.count<i&&(i=o.sourceEdges.count,n=o);break;case Zy:o.destinationEdges.count<i&&(i=o.destinationEdges.count,n=o);break;default:w("Unhandled path value "+t.kd.toString())}}return n}function wy(t,e){if(null!==e){switch(t.kd){case Jy:if(0<e.destinationEdges.count){for(var i=new et,n=e.destinationVertexes;n.next();){var o=n.value;ky(t,e,o)&&i.add(o)}0<i.count&&(e.children=i.ma())}break;case Zy:if(0<e.sourceEdges.count){for(i=new et,n=e.sourceVertexes;n.next();)o=n.value,ky(t,e,o)&&i.add(o);0<i.count&&(e.children=i.ma())}break;default:w("Unhandled path value"+t.kd.toString())}for(i=e.children,n=i.length,o=0;o<n;o++){var r=i[o];r.initialized=!0,r.level=e.level+1,r.parent=e,t.Jb.remove(r)}for(e=0;e<n;e++)wy(t,i[e])}}function ky(t,e,i){if(i.initialized){if(null===e)var n=!1;else{for(n=e.parent;null!==n&&n!==i;)n=n.parent;n=n===i}if(n||i.level>e.level)return!1;t.removeChild(i.parent,i)}return!0}function My(t,e){if(null!==e){t.initializeTreeVertexValues(e),e.alignment===hm&&t.sortTreeVertexChildren(e);for(var i=0,n=e.childrenCount,o=0,r=e.children,s=r.length,a=0;a<s;a++){var h=r[a];My(t,h),i+=h.descendantCount+1,n=Math.max(n,h.maxChildrenCount),o=Math.max(o,h.maxGenerationCount)}e.descendantCount=i,e.maxChildrenCount=n,e.maxGenerationCount=0<n?o+1:0}}function Sy(t,e){switch(t.oq){default:case dm:return null!==e.parent?e.parent:t.U;case ym:return null===e.parent?t.U:null===e.parent.parent?t.V:e.parent;case gm:return null!==e.parent?null!==e.parent.parent?e.parent.parent:t.V:t.U;case pm:var i=!0;if(0===e.childrenCount)i=!1;else for(var n=e.children,o=n.length,r=0;r<o;r++)if(0<n[r].childrenCount){i=!1;break}return i&&null!==e.parent?t.V:null!==e.parent?e.parent:t.U}}function Py(t,e){if(null!==e){t.assignTreeVertexValues(e),e=e.children;for(var i=e.length,n=0;n<i;n++)Py(t,e[n])}}function Ny(t,e){if(null!==e){e.alignment!==hm&&t.sortTreeVertexChildren(e),e=e.children;for(var i=e.length,n=0;n<i;n++)Ny(t,e[n])}}function Cy(t){return t===am||t===hm||t===lm||t===um}function Ty(t){return t===am||t===hm}function Ay(t){var e=t.parent;if(null!==e){var i=e.alignment;if(Cy(i)){if(Ty(i)){for(e=e.children,i=0;i<e.length&&t!==e[i];)i++;return 0===i%2}if(i===lm)return!0}}return!1}function Ly(t,e){if(0===e.childrenCount){var i=!1,n=0;null!==e.parent&&(n=e.parent.angle,i=e.parent.alignment,i=Cy(i));var o=Ay(e);e.S.h(0,0),e.ua.h(e.width,e.height),null===e.parent||null===e.comments||(180!==n&&270!==n||i)&&!o?e.fa.h(0,0):180===n&&!i||(90===n||270===n)&&o?e.fa.h(e.width-2*e.focus.x,0):e.fa.h(0,e.height-2*e.focus.y)}else{n=Hy(e),i=90===n||270===n;var r=0;o=e.children;for(var s=o.length,a=0;a<s;a++){var h=o[a];r=Math.max(r,i?h.ua.width:h.ua.height)}var l=e.alignment,u=l===rm,c=l===sm;a=Cy(l);var f=Math.max(0,e.breadthLimit);h=_y(e);var d=e.nodeSpacing,p=Wy(e),g=u||c?0:p/2,y=e.rowSpacing,m=0;(u||c||e.Sm||e.Tm&&1===e.maxGenerationCount)&&(m=Math.max(0,e.rowIndent)),u=e.width;var v=e.height,x=0,b=0,k=0,M=0,S=0,P=0,N=0,C=0,T=0;if(a&&!Ty(l)&&135<n&&o.reverse(),Ty(l))if(1<s)for(var A=0;A<s;A++){var L=o[A],j=L.ua;0===A%2&&A!==s-1&&(T=Math.max(T,(i?j.width:j.height)+Dy(L)-d))}else 1===s&&(T=i?o[0].ua.width:o[0].ua.height);if(a)switch(l){case am:case hm:b=135>n?jy(e,o,T,x,b):Oy(e,o,T,x,b),T=b.x,x=b.width,b=b.height;break;case lm:for(t=0;t<s;t++)f=o[t],g=f.ua,k=0===N?0:y,i?(f.S.h(r-g.width,S+k),x=Math.max(x,g.width),b=Math.max(b,S+k+g.height),S+=k+g.height):(f.S.h(M+k,r-g.height),x=Math.max(x,M+k+g.width),b=Math.max(b,g.height),M+=k+g.width),N++;break;case um:for(r=0;r<s;r++)t=o[r],f=t.ua,g=0===N?0:y,i?(t.S.h(d/2+e.focus.x,S+g),x=Math.max(x,f.width),b=Math.max(b,S+g+f.height),S+=g+f.height):(t.S.h(M+g,d/2+e.focus.y),x=Math.max(x,M+g+f.width),b=Math.max(b,f.height),M+=g+f.width),N++}else for(A=0;A<s;A++){if(L=o[A],j=L.ua,i){0<f&&0<N&&M+d+j.width>f&&(M<r&&Ry(e,l,r-M,0,C,A-1),P++,N=0,C=A,k=b,M=0,S=135<n?-b-y:b+y);var O=0===N?g:d;Vy(t,L,0,S),L.S.h(M+O,S),x=Math.max(x,M+O+j.width),b=Math.max(b,k+(0===P?0:y)+j.height),M+=O+j.width}else 0<f&&0<N&&S+d+j.height>f&&(S<r&&Ry(e,l,0,r-S,C,A-1),P++,N=0,C=A,k=x,S=0,M=135<n?-x-y:x+y),O=0===N?g:d,Vy(t,L,M,0),L.S.h(M,S+O),b=Math.max(b,S+O+j.height),x=Math.max(x,k+(0===P?0:y)+j.width),S+=O+j.height;N++}switch(0<P&&(i?(b+=Math.max(0,h),M<x&&Ry(e,l,x-M,0,C,s-1),0<m&&(c||zy(e,m,0,0,s-1),x+=m)):(x+=Math.max(0,h),S<b&&Ry(e,l,0,b-S,C,s-1),0<m&&(c||zy(e,0,m,0,s-1),b+=m))),m=c=0,l){case nm:i?c+=x/2-e.focus.x-p/2:m+=b/2-e.focus.y-p/2;break;case om:0<P?i?c+=x/2-e.focus.x-p/2:m+=b/2-e.focus.y-p/2:i?(l=o[0].S.x+o[0].fa.x,c+=l+(o[s-1].S.x+o[s-1].fa.x+2*o[s-1].focus.x-l)/2-e.focus.x-p/2):(l=o[0].S.y+o[0].fa.y,m+=l+(o[s-1].S.y+o[s-1].fa.y+2*o[s-1].focus.y-l)/2-e.focus.y-p/2);break;case rm:i?(c-=p,x+=p):(m-=p,b+=p);break;case sm:i?(c+=x-e.width+p,x+=p):(m+=b-e.height+p,b+=p);break;case am:case hm:i?c+=1<s?T+d/2-e.focus.x:o[0].focus.x-e.focus.x+o[0].fa.x:m+=1<s?T+d/2-e.focus.y:o[0].focus.y-e.focus.y+o[0].fa.y;break;case lm:i?c+=x+d/2-e.focus.x:m+=b+d/2-e.focus.y;break;case um:break;default:w("Unhandled alignment value "+l.toString())}for(p=0;p<s;p++)l=o[p],i?l.S.h(l.S.x+l.fa.x-c,l.S.y+(135<n?(a?-b:-l.ua.height)+l.fa.y-h:v+h+l.fa.y)):l.S.h(l.S.x+(135<n?(a?-x:-l.ua.width)+l.fa.x-h:u+h+l.fa.x),l.S.y+l.fa.y-m);i?(x=By(e,x,c),0>c&&(c=0),135<n&&(m+=b+h),b=Math.max(Math.max(b,v),b+v+h)):(135<n&&(c+=x+h),x=Math.max(Math.max(x,u),x+u+h),b=Iy(e,b,m),0>m&&(m=0)),e.fa.h(c,m),e.ua.h(x,b)}}function jy(t,e,i,n,o){var r=e.length;if(0===r)return new zt(i,0,n,o);if(1===r)return t=e[0],n=t.ua.width,o=t.ua.height,new zt(i,0,n,o);for(var s=t.nodeSpacing,a=t.rowSpacing,h=90===Hy(t),l=0,u=0,c=0,f=0;f<r;f++)if(!(0!==f%2||1<r&&f===r-1)){var d=e[f],p=d.ua,g=0===l?0:a;if(h){var y=Dy(d)-s;d.S.h(i-(p.width+y),c+g),n=Math.max(n,p.width+y),o=Math.max(o,c+g+p.height),c+=g+p.height}else y=Dy(d)-s,d.S.h(u+g,i-(p.height+y)),o=Math.max(o,p.height+y),n=Math.max(n,u+g+p.width),u+=g+p.width;l++}for(l=0,d=u,f=c,h?(u=i+s,c=0):(u=0,c=i+s),p=0;p<r;p++)if(0!==p%2){g=e[p],y=g.ua;var m=0===l?0:a;if(h){var v=Dy(g)-s;g.S.h(u+v,c+m),n=Math.max(n,u+y.width+v),o=Math.max(o,c+m+y.height),c+=m+y.height}else v=Dy(g)-s,g.S.h(u+m,c+v),n=Math.max(n,u+m+y.width),o=Math.max(o,c+y.height+v),u+=m+y.width;l++}return 1<r&&1===r%2&&(e=e[r-1],r=e.ua,a=null===e.parent?0:e.parent.rowSpacing,h?(e.S.h(i+s/2-e.focus.x-e.fa.x,o+a),h=i+s/2-e.focus.x-e.fa.x,n=Math.max(n,h+r.width),0>h&&(n-=h),o=Math.max(o,Math.max(f,c)+a+r.height),0>e.S.x&&(i=Fy(t,e.S.x,!1,i,s))):(e.S.h(n+a,i+s/2-e.focus.y-e.fa.y),n=Math.max(n,Math.max(d,u)+a+r.width),c=i+s/2-e.focus.y-e.fa.y,o=Math.max(o,c+r.height),0>c&&(o-=c),0>e.S.y&&(i=Fy(t,e.S.y,!0,i,s)))),new zt(i,0,n,o)}function Oy(t,e,i,n,o){var r=e.length;if(0===r)return new zt(i,0,n,o);if(1===r)return e=e[0],n=e.ua.width,o=e.ua.height,new zt(i,0,n,o);for(var s=t.nodeSpacing,a=t.rowSpacing,h=270===Hy(t),l=0,u=0,c=0,f=0;f<r;f++)if(!(0!==f%2||1<r&&f===r-1)){var d=e[f],p=d.ua,g=0===l?0:a;if(h){var y=Dy(d)-s;c-=g+p.height,d.S.h(i-(p.width+y),c),n=Math.max(n,p.width+y),o=Math.max(o,Math.abs(c))}else y=Dy(d)-s,u-=g+p.width,d.S.h(u,i-(p.height+y)),o=Math.max(o,p.height+y),n=Math.max(n,Math.abs(u));l++}for(l=0,d=u,f=c,h?(u=i+s,c=0):(u=0,c=i+s),p=0;p<r;p++)if(0!==p%2){g=e[p],y=g.ua;var m=0===l?0:a;if(h){var v=Dy(g)-s;c-=m+y.height,g.S.h(u+v,c),n=Math.max(n,u+y.width+v),o=Math.max(o,Math.abs(c))}else v=Dy(g)-s,u-=m+y.width,g.S.h(u,c+v),o=Math.max(o,c+y.height+v),n=Math.max(n,Math.abs(u));l++}for(1<r&&1===r%2&&(a=e[r-1],l=a.ua,p=null===a.parent?0:a.parent.rowSpacing,h?(a.S.h(i+s/2-a.focus.x-a.fa.x,-o-l.height-p),u=i+s/2-a.focus.x-a.fa.x,n=Math.max(n,u+l.width),0>u&&(n-=u),o=Math.max(o,Math.abs(Math.min(f,c))+p+l.height),0>a.S.x&&(i=Fy(t,a.S.x,!1,i,s))):(a.S.h(-n-l.width-p,i+s/2-a.focus.y-a.fa.y),n=Math.max(n,Math.abs(Math.min(d,u))+p+l.width),c=i+s/2-a.focus.y-a.fa.y,o=Math.max(o,c+l.height),0>c&&(o-=c),0>a.S.y&&(i=Fy(t,a.S.y,!0,i,s)))),t=0;t<r;t++)s=e[t],h?s.S.h(s.S.x,s.S.y+o):s.S.h(s.S.x+n,s.S.y);return new zt(i,0,n,o)}function Dy(t){return null===t.parent?0:t.parent.nodeSpacing}function Fy(t,e,i,n,o){t=t.children;for(var r=t.length,s=0;s<r;s++)i?t[s].S.h(t[s].S.x,t[s].S.y-e):t[s].S.h(t[s].S.x-e,t[s].S.y);return e=t[r-1],Math.max(n,i?e.fa.y+e.focus.y-o/2:e.fa.x+e.focus.x-o/2)}function By(t,e,i){switch(t.alignment){case om:case nm:return i+t.width>e&&(e=i+t.width),0>i&&(e-=i),e;case rm:return t.width>e?t.width:e;case sm:return 2*t.focus.x>e?t.width:e+t.width-2*t.focus.x;case am:case hm:return Math.max(t.width,Math.max(e,i+t.width)-Math.min(0,i));case lm:return t.width-t.focus.x+t.nodeSpacing/2+e;case um:return Math.max(t.width,t.focus.x+t.nodeSpacing/2+e);default:return e}}function Iy(t,e,i){switch(t.alignment){case om:case nm:return i+t.height>e&&(e=i+t.height),0>i&&(e-=i),e;case rm:return t.height>e?t.height:e;case sm:return 2*t.focus.y>e?t.height:e+t.height-2*t.focus.y;case am:case hm:return Math.max(t.height,Math.max(e,i+t.height)-Math.min(0,i));case lm:return t.height-t.focus.y+t.nodeSpacing/2+e;case um:return Math.max(t.height,t.focus.y+t.nodeSpacing/2+e);default:return e}}function Ey(t,e,i){switch(t){case nm:e/=2,i/=2;break;case om:e/=2,i/=2;break;case rm:i=e=0;break;case sm:break;default:w("Unhandled alignment value "+t.toString())}return new pt(e,i)}function Ry(t,e,i,n,o,r){e=Ey(e,i,n),zy(t,e.x,e.y,o,r)}function zy(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 Vy(t,e,i,n){var o=e.parent;switch(t.kd){case Jy:for(t=e.sourceEdges;t.next();)e=t.value,e.fromVertex===o&&e.relativePoint.h(i,n);break;case Zy:for(t=e.destinationEdges;t.next();)e=t.value,e.toVertex===o&&e.relativePoint.h(i,n);break;default:w("Unhandled path value "+t.kd.toString())}}function Gy(t,e,i){for(var n=0;n<t.length;n++){var o=t[n];o.x+=e,o.y+=i}}function Yy(t,e,i,n,o,r,s,a){var h=Hy(e),l=90===h||270===h,u=e.nodeSpacing;e=n;var c=o;n=r;var f=s,d=i.Pq,p=i.br;s=i.ua;var g=l?Math.max(f,s.height):Math.max(n,s.width);if(null!==d&&h===Hy(i)||(d=Xy(t,2),p=Xy(t,2),l?(d[0].h(0,0),d[1].h(0,s.height),p[0].h(s.width,0),p[1].h(p[0].x,d[1].y)):(d[0].h(0,0),d[1].h(s.width,0),p[0].h(0,s.height),p[1].h(d[1].x,p[0].y))),l){if(f=9999999,!(null===c||2>c.length||null===d||2>d.length))for(o=i=0;i<c.length&&o<d.length;){r=c[i];var y=d[o];h=y.x,l=y.y,h+=n;var m=r;i+1<c.length&&(m=c[i+1]);var v=y;y=v.x,v=v.y,o+1<d.length&&(v=d[o+1],y=v.x,v=v.y,y+=n);var x=f;r.y===l?x=h-r.x:r.y>l&&r.y<v?x=h+(r.y-l)/(v-l)*(y-h)-r.x:l>r.y&&l<m.y&&(x=h-(r.x+(l-r.y)/(m.y-r.y)*(m.x-r.x))),x<f&&(f=x),m.y<=r.y?i++:v<=l?o++:(m.y<=v&&i++,v<=m.y&&o++)}if(f=n-f,f+=u,i=d,o=f,null===e||2>e.length||null===i||2>i.length)n=null;else{for(u=Xy(t,e.length+i.length),n=r=h=0;r<i.length&&i[r].y<e[0].y;)l=i[r++],u[n++].h(l.x+o,l.y);for(;h<e.length;)l=e[h++],u[n++].h(l.x,l.y);for(h=e[e.length-1].y;r<i.length&&i[r].y<=h;)r++;for(;r<i.length&&i[r].y>h;)l=i[r++],u[n++].h(l.x+o,l.y);for(i=Xy(t,n),h=0;h<n;h++)i[h].assign(u[h]);qy(t,u),n=i}if(r=p,h=f,null===c||2>c.length||null===r||2>r.length)o=null;else{for(u=Xy(t,c.length+r.length),o=l=i=0;i<c.length&&c[i].y<r[0].y;)m=c[i++],u[o++].h(m.x,m.y);for(;l<r.length;)m=r[l++],u[o++].h(m.x+h,m.y);for(r=r[r.length-1].y;i<c.length&&c[i].y<=r;)i++;for(;i<c.length&&c[i].y>r;)h=c[i++],u[o++].h(h.x,h.y);for(r=Xy(t,o),i=0;i<o;i++)r[i].assign(u[i]);qy(t,u),o=r}return r=Math.max(0,f)+s.width,s=g,qy(t,e),qy(t,d),qy(t,c),qy(t,p),a[0]=n,a[1]=o,new zt(f,0,r,s)}if(n=9999999,!(null===c||2>c.length||null===d||2>d.length))for(o=i=0;i<c.length&&o<d.length;)r=c[i],y=d[o],h=y.x,l=y.y,l+=f,m=r,i+1<c.length&&(m=c[i+1]),v=y,y=v.x,v=v.y,o+1<d.length&&(v=d[o+1],y=v.x,v=v.y,v+=f),x=n,r.x===h?x=l-r.y:r.x>h&&r.x<y?x=l+(r.x-h)/(y-h)*(v-l)-r.y:h>r.x&&h<m.x&&(x=l-(r.y+(h-r.x)/(m.x-r.x)*(m.y-r.y))),x<n&&(n=x),m.x<=r.x?i++:y<=h?o++:(m.x<=y&&i++,y<=m.x&&o++);if(f-=n,f+=u,i=d,o=f,null===e||2>e.length||null===i||2>i.length)n=null;else{for(u=Xy(t,e.length+i.length),n=r=h=0;r<i.length&&i[r].x<e[0].x;)l=i[r++],u[n++].h(l.x,l.y+o);for(;h<e.length;)l=e[h++],u[n++].h(l.x,l.y);for(h=e[e.length-1].x;r<i.length&&i[r].x<=h;)r++;for(;r<i.length&&i[r].x>h;)l=i[r++],u[n++].h(l.x,l.y+o);for(i=Xy(t,n),h=0;h<n;h++)i[h].assign(u[h]);qy(t,u),n=i}if(r=p,h=f,null===c||2>c.length||null===r||2>r.length)o=null;else{for(u=Xy(t,c.length+r.length),o=l=i=0;i<c.length&&c[i].x<r[0].x;)m=c[i++],u[o++].h(m.x,m.y);for(;l<r.length;)m=r[l++],u[o++].h(m.x,m.y+h);for(r=r[r.length-1].x;i<c.length&&c[i].x<=r;)i++;for(;i<c.length&&c[i].x>r;)h=c[i++],u[o++].h(h.x,h.y);for(r=Xy(t,o),i=0;i<o;i++)r[i].assign(u[i]);qy(t,u),o=r}return r=g,s=Math.max(0,f)+s.height,qy(t,e),qy(t,d),qy(t,c),qy(t,p),a[0]=n,a[1]=o,new zt(f,0,r,s)}function Xy(t,e){if(t=t.uv[e],void 0!==t&&(t=t.pop(),void 0!==t))return t;t=[];for(var i=0;i<e;i++)t[i]=new pt;return t}function qy(t,e){var i=e.length,n=t.uv[i];void 0===n&&(n=[],t.uv[i]=n),n.push(e)}function Uy(t,e,i,n){if(null!==e){e.x=i,e.y=n,e=e.children;for(var o=e.length,r=0;r<o;r++){var s=e[r];Uy(t,s,i+s.S.x,n+s.S.y)}}}function Ky(t,e){if(null!==e){t.setPortSpots(e),e=e.children;for(var i=e.length,n=0;n<i;n++)Ky(t,e[n])}}function Hy(t){return t=t.angle,45>=t?0:135>=t?90:225>=t?180:315>=t?270:0}function _y(t){var e=Hy(t);e=90===e||270===e;var i=t.layerSpacing;if(0<t.layerSpacingParentOverlap){var n=Math.min(1,t.layerSpacingParentOverlap);i-=e?t.height*n:t.width*n}return i<(e?-t.height:-t.width)&&(i=e?-t.height:-t.width),i}function Wy(t){var e=Hy(t),i=t.nodeIndent;if(0<t.nodeIndentPastParent){var n=Math.min(1,t.nodeIndentPastParent);i+=90===e||270===e?t.width*n:t.height*n}return Math.max(0,i)}kg.className="LayeredDigraphLayout",kg.CycleDepthFirst=ey,kg.CycleGreedy=iy,kg.CycleFromLayers=ny,kg.LayerOptimalLinkLength=oy,kg.LayerLongestPathSink=ry,kg.LayerLongestPathSource=sy,kg.InitDepthFirstOut=ay,kg.InitDepthFirstIn=hy,kg.InitNaive=ly,kg.AggressiveNone=uy,kg.AggressiveLess=cy,kg.AggressiveMore=fy,kg.PackNone=0,kg.PackExpand=1,kg.PackStraighten=2,kg.PackMedian=4,kg.PackAll=15,py.className="SegInfo",f(gy,Qf),gy.prototype.createVertex=function(){return new yy(this)},gy.prototype.createEdge=function(){return new my(this)},gy.className="LayeredDigraphNetwork",f(yy,rd),yy.prototype.serializeVertexProperties=function(t,e){rd.prototype.serializeVertexProperties.call(this,t,e),t.layer=this.layer,t.column=this.column,t.index=this.index,t.component=this.component,t.near=this.near?st(this.near):null,t.valid=this.valid,t.Cg=this.Cg,t.finish=this.finish,t.wf=this.wf,t.Nk=this.Nk,t.Mk=this.Mk},yy.prototype.Cq=function(t,e,i,n){rd.prototype.Cq.call(this,t,e,i,n),this.layer=t.layer,this.column=t.column,this.index=t.index,this.component=t.component,(e=e.get(t.near))&&(this.near=e),this.valid=t.valid,this.Cg=t.Cg,this.finish=t.finish,this.wf=t.wf,this.Nk=t.Nk,this.Mk=t.Mk},d.Object.defineProperties(yy.prototype,{layer:{get:function(){return this.Fi},set:function(t){this.Fi!==t&&(this.Fi=t)}},column:{get:function(){return this.Rg},set:function(t){this.Rg!==t&&(this.Rg=t)}},index:{get:function(){return this.Ra},set:function(t){this.Ra!==t&&(this.Ra=t)}},component:{get:function(){return this.I},set:function(t){this.I!==t&&(this.I=t)}},near:{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t)}}}),yy.className="LayeredDigraphVertex",f(my,ad),my.prototype.serializeEdgeProperties=function(t,e){ad.prototype.serializeEdgeProperties.call(this,t,e),t.valid=this.valid,t.rev=this.rev,t.forest=this.forest,t.portFromPos=this.portFromPos,t.portToPos=this.portToPos,t.portFromColOffset=this.portFromColOffset,t.portToColOffset=this.portToColOffset},my.prototype.deserializeEdgeProperties=function(t,e,i,n){ad.prototype.deserializeEdgeProperties.call(this,t,e,i,n),this.valid=t.valid,this.rev=t.rev,this.forest=t.forest,this.portFromPos=t.portFromPos,this.portToPos=t.portToPos,this.portFromColOffset=t.portFromColOffset,this.portToColOffset=t.portToColOffset},d.Object.defineProperties(my.prototype,{fromVertex:{get:function(){return this.Yc},set:function(t){this.Yc!==t&&(this.Yc=t)}},toVertex:{get:function(){return this.ed},set:function(t){this.ed!==t&&(this.ed=t)}},valid:{get:function(){return this.eb},set:function(t){this.eb!==t&&(this.eb=t)}},rev:{get:function(){return this.La},set:function(t){this.La!==t&&(this.La=t)}},forest:{get:function(){return this.l},set:function(t){this.l!==t&&(this.l=t)}},portFromPos:{get:function(){return this.I},set:function(t){this.I!==t&&(this.I=t)}},portToPos:{get:function(){return this.Ka},set:function(t){this.Ka!==t&&(this.Ka=t)}},portFromColOffset:{get:function(){return this.u},set:function(t){this.u!==t&&(this.u=t)}},portToColOffset:{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t)}}}),my.className="LayeredDigraphEdge",f(vy,zf),vy.prototype.cloneProtected=function(t){zf.prototype.cloneProtected.call(this,t),t.vp=this.vp,t.oq=this.oq,t.ts=this.ts,t.jd=this.jd,t.Eb=this.Eb,t.Pd.assign(this.Pd),t.U.copyInheritedPropertiesFrom(this.U),t.V.copyInheritedPropertiesFrom(this.V)},vy.prototype.jb=function(t){t.classType===vy?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):zf.prototype.jb.call(this,t)},vy.prototype.createNetwork=function(){return new Mm(this)},vy.prototype.makeNetwork=function(t){function e(t){if(t instanceof ec)return!t.isLinkLabel&&"Comment"!==t.category;if(t instanceof Nc){var e=t.fromNode;return null!==e&&!e.isLinkLabel&&"Comment"!==e.category&&(t=t.toNode,null!==t&&!t.isLinkLabel&&"Comment"!==t.category)}return!1}var i=this.createNetwork();return t instanceof Ko?(i.Ag(t.nodes,!0,e),i.Ag(t.links,!0,e)):t instanceof bc?i.Ag(t.memberParts,!1,e):i.Ag(t.iterator,!1,e),i},vy.prototype.doLayout=function(t){null===this.network&&(this.network=this.makeNetwork(t)),this.arrangement!==xm&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var e=this.diagram;if(null===e&&t instanceof Ko&&(e=t),this.path===$y&&null!==e?this.kd=e.isTreePathToChildren?Jy:Zy:this.kd=this.path===$y?Jy:this.path,0<this.network.vertexes.count){for(this.network.Bq(),t=this.network.vertexes.iterator;t.next();)e=t.value,e.initialized=!1,e.level=0,e.parent=null,e.children=[];if(0<this.Jb.count){for(t=new nt,e=this.Jb.iterator;e.next();){var i=e.value;i instanceof ec?(i=this.network.kj(i),null!==i&&t.add(i)):i instanceof Sm&&t.add(i)}this.Jb=t}for(0===this.Jb.count&&this.findRoots(),t=this.Jb.copy().iterator;t.next();)e=t.value,e.initialized||(e.initialized=!0,wy(this,e));for(e=this.network.vertexes,t=null;t=xy(e),0<t.count;)e=by(this,t),null!==e&&this.Jb.add(e),e.initialized=!0,wy(this,e),e=t;for(t=this.Jb.iterator;t.next();)e=t.value,e instanceof Sm&&My(this,e);for(t=this.Jb.iterator;t.next();)e=t.value,e instanceof Sm&&Py(this,e);for(t=this.Jb.iterator;t.next();)e=t.value,e instanceof Sm&&Ny(this,e);if(this.Fv(),this.layerStyle===km){for(t=[],e=this.network.vertexes.iterator;e.next();){i=e.value;var n=i.parent;null===n&&(n=i),n=0===n.angle||180===n.angle;var o=t[i.level];void 0===o&&(o=0),t[i.level]=Math.max(o,n?i.width:i.height)}for(e=0;e<t.length;e++)void 0===t[e]&&(t[e]=0);for(this.nx=t,e=this.network.vertexes.iterator;e.next();)i=e.value,n=i.parent,null===n&&(n=i),0===n.angle||180===n.angle?(180===n.angle&&(i.focusX+=t[i.level]-i.width),i.width=t[i.level]):(270===n.angle&&(i.focusY+=t[i.level]-i.height),i.height=t[i.level])}else if(this.layerStyle===wm)for(t=this.network.vertexes.iterator;t.next();){for(e=t.value,i=0===e.angle||180===e.angle,n=-1,o=0;o<e.children.length;o++){var r=e.children[o];n=Math.max(n,i?r.width:r.height)}if(0<=n)for(o=0;o<e.children.length;o++)r=e.children[o],i?(180===e.angle&&(r.focusX+=n-r.width),r.width=n):(270===e.angle&&(r.focusY+=n-r.height),r.height=n)}for(t=this.Jb.iterator;t.next();)e=t.value,e instanceof Sm&&this.layoutTree(e);this.arrangeTrees(),this.updateParts()}this.network=null,this.Jb=new nt,this.isValidLayout=!0},vy.prototype.findRoots=function(){for(var t=this.network.vertexes,e=t.iterator;e.next();){var i=e.value;switch(this.kd){case Jy:0===i.sourceEdges.count&&this.Jb.add(i);break;case Zy:0===i.destinationEdges.count&&this.Jb.add(i);break;default:w("Unhandled path value "+this.kd.toString())}}0===this.Jb.count&&(t=by(this,t),null!==t&&this.Jb.add(t))},vy.prototype.removeChild=function(t,e){if(null!==t&&null!==e){for(var i=t.children,n=0,o=0;o<i.length;o++)i[o]===e&&n++;if(0<n){n=Array(i.length-n);for(var r=o=0;r<i.length;r++)i[r]!==e&&(n[o++]=i[r]);t.children=n}}},vy.prototype.initializeTreeVertexValues=function(t){if(t.copyInheritedPropertiesFrom(Sy(this,t)),null!==t.parent&&t.parent.alignment===hm){for(var e=t.angle,i=t.parent.children,n=0;n<i.length&&t!==i[n];)n++;0===n%2?n!==i.length-1&&(e=90===e?180:180===e?270:270===e?180:270):e=90===e?0:180===e?90:270===e?0:90,t.angle=e}t.initialized=!0},vy.prototype.assignTreeVertexValues=function(){},vy.prototype.sortTreeVertexChildren=function(t){switch(t.sorting){case Qy:break;case tm:t.children.reverse();break;case em:t.children.sort(t.comparer);break;case im:t.children.sort(t.comparer),t.children.reverse();break;default:w("Unhandled sorting value "+t.sorting.toString())}},vy.prototype.Fv=function(){if(this.comments)for(var t=this.network.vertexes.iterator;t.next();)this.addComments(t.value)},vy.prototype.addComments=function(t){var e=t.angle,i=t.parent,n=0,o=!1;null!==i&&(n=i.angle,o=i.alignment,o=Cy(o)),e=90===e||270===e,n=90===n||270===n,i=0===t.childrenCount;var r=0,s=0,a=0,h=t.commentSpacing;if(null!==t.node)for(var l=t.node.Sv();l.next();){var u=l.value;"Comment"===u.category&&u.canLayout()&&(null===t.comments&&(t.comments=[]),t.comments.push(u),u.Ta(),u=u.measuredBounds,e&&!i||!o&&!n&&i||o&&n&&i?(r=Math.max(r,u.width),s+=u.height+Math.abs(a)):(r+=u.width+Math.abs(a),s=Math.max(s,u.height)),a=h)}null!==t.comments&&(e&&!i||!o&&!n&&i||o&&n&&i?(r+=Math.abs(t.commentMargin),s=Math.max(0,s-t.height)):(s+=Math.abs(t.commentMargin),r=Math.max(0,r-t.width)),o=zt.allocAt(0,0,t.bounds.width+r,t.bounds.height+s),t.bounds=o,zt.free(o))},vy.prototype.layoutComments=function(t){if(null!==t.comments){var e=t.node.measuredBounds,i=t.parent,n=t.angle,o=0,r=!1;null!==i&&(o=i.angle,r=i.alignment,r=Cy(r)),n=90===n||270===n,i=90===o||270===o;for(var s=0===t.childrenCount,a=Ay(t),h=0,l=t.comments,u=l.length,c=pt.alloc(),f=0;f<u;f++){var d=l[f],p=d.measuredBounds;if(n&&!s||!r&&!i&&s||r&&i&&s){if(135<o&&!r||i&&a)if(0<=t.commentMargin)for(c.h(t.bounds.x-t.commentMargin-p.width,t.bounds.y+h),d.move(c),d=d.Hd();d.next();){var g=d.value;g.fromSpot=De,g.toSpot=Fe}else for(c.h(t.bounds.x+2*t.focus.x-t.commentMargin,t.bounds.y+h),d.move(c),d=d.Hd();d.next();)g=d.value,g.fromSpot=Fe,g.toSpot=De;else if(0<=t.commentMargin)for(c.h(t.bounds.x+2*t.focus.x+t.commentMargin,t.bounds.y+h),d.move(c),d=d.Hd();d.next();)g=d.value,g.fromSpot=Fe,g.toSpot=De;else for(c.h(t.bounds.x+t.commentMargin-p.width,t.bounds.y+h),d.move(c),d=d.Hd();d.next();)g=d.value,g.fromSpot=De,g.toSpot=Fe;h=0<=t.commentSpacing?h+(p.height+t.commentSpacing):h+(t.commentSpacing-p.height)}else{if(135<o&&!r||!i&&a)if(0<=t.commentMargin)for(c.h(t.bounds.x+h,t.bounds.y-t.commentMargin-p.height),d.move(c),d=d.Hd();d.next();)g=d.value,g.fromSpot=Oe,g.toSpot=Be;else for(c.h(t.bounds.x+h,t.bounds.y+2*t.focus.y-t.commentMargin),d.move(c),d=d.Hd();d.next();)g=d.value,g.fromSpot=Be,g.toSpot=Oe;else if(0<=t.commentMargin)for(c.h(t.bounds.x+h,t.bounds.y+2*t.focus.y+t.commentMargin),d.move(c),d=d.Hd();d.next();)g=d.value,g.fromSpot=Be,g.toSpot=Oe;else for(c.h(t.bounds.x+h,t.bounds.y+t.commentMargin-p.height),d.move(c),d=d.Hd();d.next();)g=d.value,g.fromSpot=Oe,g.toSpot=Be;h=0<=t.commentSpacing?h+(p.width+t.commentSpacing):h+(t.commentSpacing-p.width)}}if(pt.free(c),e=h-t.commentSpacing-(n?e.height:e.width),this.kd===Jy)for(t=t.destinationEdges;t.next();)o=t.value.link,null===o||o.isAvoiding||(o.fromEndSegmentLength=0<e?e:NaN);else for(t=t.sourceEdges;t.next();)o=t.value.link,null===o||o.isAvoiding||(o.toEndSegmentLength=0<e?e:NaN)}},vy.prototype.layoutTree=function(t){if(null!==t){for(var e=t.children,i=e.length,n=0;n<i;n++)this.layoutTree(e[n]);switch(t.compaction){case cm:Ly(this,t);break;case fm:if(t.alignment===hm)Ly(this,t);else if(0===t.childrenCount)n=t.parent,i=!1,e=0,null!==n&&(e=n.angle,i=n.alignment,i=Cy(i)),n=Ay(t),t.S.h(0,0),t.ua.h(t.width,t.height),null===t.parent||null===t.comments||(180!==e&&270!==e||i)&&!n?t.fa.h(0,0):180===e&&!i||(90===e||270===e)&&n?t.fa.h(t.width-2*t.focus.x,0):t.fa.h(0,t.height-2*t.focus.y),t.Pq=null,t.br=null;else{var o=Hy(t);e=90===o||270===o;var r=0,s=t.children,a=s.length;for(i=0;i<a;i++)n=s[i],r=Math.max(r,e?n.ua.width:n.ua.height);var h=t.alignment,l=h===sm,u=Cy(h),c=Math.max(0,t.breadthLimit);i=_y(t);var f=t.nodeSpacing,d=Wy(t),p=t.rowSpacing,g=0;(h===rm||l||t.Sm||t.Tm&&1===t.maxGenerationCount)&&(g=Math.max(0,t.rowIndent)),n=t.width;var y=t.height,m=0,v=0,x=0,b=null,k=null,M=0,S=0,P=0,N=0,C=0,T=0,A=0,L=0;if(u&&!Ty(h)&&135<o&&s.reverse(),Ty(h))if(1<a)for(var D=0;D<a;D++)0===D%2&&D!==a-1&&(L=Math.max(L,e?s[D].ua.width:s[D].ua.height));else 1===a&&(L=e?s[0].ua.width:s[0].ua.height);if(u){switch(h){case am:v=135>o?jy(t,s,L,m,v):Oy(t,s,L,m,v),L=v.x,m=v.width,v=v.height;break;case lm:for(b=0;b<a;b++)k=s[b],c=k.ua,x=0===T?0:p,e?(k.S.h(r-c.width,N+x),m=Math.max(m,c.width),v=Math.max(v,N+x+c.height),N+=x+c.height):(k.S.h(P+x,r-c.height),m=Math.max(m,P+x+c.width),v=Math.max(v,c.height),P+=x+c.width),T++;break;case um:for(b=0;b<a;b++)k=s[b],r=k.ua,c=0===T?0:p,e?(k.S.h(f/2+t.focus.x,N+c),m=Math.max(m,r.width),v=Math.max(v,N+c+r.height),N+=c+r.height):(k.S.h(P+c,f/2+t.focus.y),m=Math.max(m,P+c+r.width),v=Math.max(v,r.height),P+=c+r.width),T++}b=Xy(this,2),k=Xy(this,2),e?(b[0].h(0,0),b[1].h(0,v),k[0].h(m,0)):(b[0].h(0,0),b[1].h(m,0),k[0].h(0,v)),k[1].h(m,v)}else for(D=0;D<a;D++){var F=s[D],B=F.ua;if(e){0<c&&0<T&&P+f+B.width>c&&(P<r&&Ry(t,h,r-P,0,A,D-1),C++,T=0,A=D,x=v,P=0,N=135<o?-v-p:v+p),Vy(this,F,0,N);var I=0;if(0===T)b=F.Pq,k=F.br,M=B.width,S=B.height,(null===b||null===k||o!==Hy(F))&&(b=Xy(this,2),k=Xy(this,2),b[0].h(0,0),b[1].h(0,S),k[0].h(M,0),k[1].h(M,S));else{var E=j();S=Yy(this,t,F,b,k,M,S,E),I=S.x,b=E[0],k=E[1],M=S.width,S=S.height,O(E),P<B.width&&0>I&&(zy(t,-I,0,A,D-1),Gy(b,-I,0),Gy(k,-I,0),I=0)}F.S.h(I,N),m=Math.max(m,M),v=Math.max(v,x+(0===C?0:p)+B.height),P=M}else 0<c&&0<T&&N+f+B.height>c&&(N<r&&Ry(t,h,0,r-N,A,D-1),C++,T=0,A=D,x=m,N=0,P=135<o?-m-p:m+p),Vy(this,F,P,0),I=0,0===T?(b=F.Pq,k=F.br,M=B.width,S=B.height,(null===b||null===k||o!==Hy(F))&&(b=Xy(this,2),k=Xy(this,2),b[0].h(0,0),b[1].h(M,0),k[0].h(0,S),k[1].h(M,S))):(E=j(),S=Yy(this,t,F,b,k,M,S,E),I=S.x,b=E[0],k=E[1],M=S.width,S=S.height,O(E),N<B.height&&0>I&&(zy(t,0,-I,A,D-1),Gy(b,0,-I),Gy(k,0,-I),I=0)),F.S.h(P,I),v=Math.max(v,S),m=Math.max(m,x+(0===C?0:p)+B.width),N=S;T++}switch(0<C&&(e?(v+=Math.max(0,i),P<m&&Ry(t,h,m-P,0,A,a-1),0<g&&(l||zy(t,g,0,0,a-1),m+=g)):(m+=Math.max(0,i),N<v&&Ry(t,h,0,v-N,A,a-1),0<g&&(l||zy(t,0,g,0,a-1),v+=g))),g=l=0,h){case nm:e?l+=m/2-t.focus.x-d/2:g+=v/2-t.focus.y-d/2;break;case om:0<C?e?l+=m/2-t.focus.x-d/2:g+=v/2-t.focus.y-d/2:e?(L=s[0].S.x+s[0].fa.x,l+=L+(s[a-1].S.x+s[a-1].fa.x+2*s[a-1].focus.x-L)/2-t.focus.x-d/2):(L=s[0].S.y+s[0].fa.y,g+=L+(s[a-1].S.y+s[a-1].fa.y+2*s[a-1].focus.y-L)/2-t.focus.y-d/2);break;case rm:e?(l-=d,m+=d):(g-=d,v+=d);break;case sm:e?(l+=m-t.width+d,m+=d):(g+=v-t.height+d,v+=d);break;case am:e?l+=1<a?L+f/2-t.focus.x:s[0].focus.x-t.focus.x+s[0].fa.x:g+=1<a?L+f/2-t.focus.y:s[0].focus.y-t.focus.y+s[0].fa.y;break;case lm:e?l+=m+f/2-t.focus.x:g+=v+f/2-t.focus.y;break;case um:break;default:w("Unhandled alignment value "+h.toString())}for(d=0;d<a;d++)L=s[d],e?L.S.h(L.S.x+L.fa.x-l,L.S.y+(135<o?(u?-v:-L.ua.height)+L.fa.y-i:y+i+L.fa.y)):L.S.h(L.S.x+(135<o?(u?-m:-L.ua.width)+L.fa.x-i:n+i+L.fa.x),L.S.y+L.fa.y-g);if(a=s=0,u?e?(m=By(t,m,l),0>l&&(l=0),135<o&&(g+=v+i),v+=y+i,h===um&&(s+=f/2+t.focus.x),a+=y+i):(135<o&&(l+=m+i),m+=n+i,v=Iy(t,v,g),0>g&&(g=0),h===um&&(a+=f/2+t.focus.y),s+=n+i):e?(null===t.comments?n>m&&(m=Ey(h,n-m,0),s=m.x,a=m.y,m=n,l=0):m=By(t,m,l),0>l&&(s-=l,l=0),135<o&&(g+=v+i),v=Math.max(Math.max(v,y),v+y+i),a+=y+i):(135<o&&(l+=m+i),m=Math.max(Math.max(m,n),m+n+i),null===t.comments?y>v&&(v=Ey(h,0,y-v),s=v.x,a=v.y,v=y,g=0):v=Iy(t,v,g),0>g&&(a-=g,g=0),s+=n+i),0<C)o=Xy(this,4),C=Xy(this,4),e?(o[2].h(0,y+i),o[3].h(o[2].x,v),C[2].h(m,o[2].y),C[3].h(C[2].x,o[3].y)):(o[2].h(n+i,0),o[3].h(m,o[2].y),C[2].h(o[2].x,v),C[3].h(o[3].x,C[2].y));else{for(o=Xy(this,b.length+2),C=Xy(this,k.length+2),h=0;h<b.length;h++)u=b[h],o[h+2].h(u.x+s,u.y+a);for(h=0;h<k.length;h++)u=k[h],C[h+2].h(u.x+s,u.y+a)}e?(o[0].h(l,0),o[1].h(o[0].x,y),o[2].y<o[1].y&&(o[2].x>o[0].x?o[2].assign(o[1]):o[1].assign(o[2])),o[3].y<o[2].y&&(o[3].x>o[0].x?o[3].assign(o[2]):o[2].assign(o[3])),C[0].h(l+n,0),C[1].h(C[0].x,y),C[2].y<C[1].y&&(C[2].x<C[0].x?C[2].assign(C[1]):C[1].assign(C[2])),C[3].y<C[2].y&&(C[3].x<C[0].x?C[3].assign(C[2]):C[2].assign(C[3])),o[2].y-=i/2,C[2].y-=i/2):(o[0].h(0,g),o[1].h(n,o[0].y),o[2].x<o[1].x&&(o[2].y>o[0].y?o[2].assign(o[1]):o[1].assign(o[2])),o[3].x<o[2].x&&(o[3].y>o[0].y?o[3].assign(o[2]):o[2].assign(o[3])),C[0].h(0,g+y),C[1].h(n,C[0].y),C[2].x<C[1].x&&(C[2].y<C[0].y?C[2].assign(C[1]):C[1].assign(C[2])),C[3].x<C[2].x&&(C[3].y<C[0].y?C[3].assign(C[2]):C[2].assign(C[3])),o[2].x-=i/2,C[2].x-=i/2),qy(this,b),qy(this,k),t.Pq=o,t.br=C,t.fa.h(l,g),t.ua.h(m,v)}break;default:w("Unhandled compaction value "+t.compaction.toString())}}},vy.prototype.arrangeTrees=function(){if(this.Eb===xm)for(var t=this.Jb.iterator;t.next();){var e=t.value;if(e instanceof Sm){var i=e.node;if(null!==i){var n=i.position;i=n.x,n=n.y,isFinite(i)||(i=0),isFinite(n)||(n=0),Uy(this,e,i,n)}}}else{for(t=[],e=this.Jb.iterator;e.next();)i=e.value,i instanceof Sm&&t.push(i);switch(this.sorting){case Qy:break;case tm:t.reverse();break;case em:t.sort(this.comparer);break;case im:t.sort(this.comparer),t.reverse();break;default:w("Unhandled sorting value "+this.sorting.toString())}for(i=this.arrangementOrigin,e=i.x,i=i.y,n=0;n<t.length;n++){var o=t[n];switch(Uy(this,o,e+o.fa.x,i+o.fa.y),this.Eb){case mm:i+=o.ua.height+this.Pd.height;break;case vm:e+=o.ua.width+this.Pd.width;break;default:w("Unhandled arrangement value "+this.Eb.toString())}}}},vy.prototype.commitLayout=function(){this.Dw(),this.commitNodes(),this.Iv(),this.isRouting&&this.commitLinks()},vy.prototype.commitNodes=function(){for(var t=this.network.vertexes.iterator;t.next();)t.value.commit();for(t.reset();t.next();)this.layoutComments(t.value)},vy.prototype.Iv=function(){if(this.layerStyle===km){for(var t=this.nx,e=[],i=null,n=this.network.vertexes.iterator;n.next();){var o=n.value;null===i?i=o.bounds.copy():i.Rc(o.bounds);var r=e[o.level];r=void 0===r?_y(o):Math.max(r,_y(o)),e[o.level]=r}for(n=0;n<e.length;n++)void 0===e[n]&&(e[n]=0);if(90===this.angle||270===this.angle?(i.Jc(this.nodeSpacing/2,this.layerSpacing),n=new pt(-this.nodeSpacing/2,-this.layerSpacing/2)):(i.Jc(this.layerSpacing,this.nodeSpacing/2),n=new pt(-this.layerSpacing/2,-this.nodeSpacing/2)),o=[],i=90===this.angle||270===this.angle?i.width:i.height,r=0,180===this.angle||270===this.angle)for(var s=0;s<t.length;s++)r+=t[s]+e[s];for(s=0;s<t.length;s++){var a=t[s]+e[s];270===this.angle?(r-=a,o.push(new zt(0,r,i,a))):90===this.angle?(o.push(new zt(0,r,i,a)),r+=a):180===this.angle?(r-=a,o.push(new zt(r,0,a,i))):(o.push(new zt(r,0,a,i)),r+=a)}this.commitLayers(o,n)}},vy.prototype.commitLayers=function(){},vy.prototype.commitLinks=function(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()},vy.prototype.Dw=function(){for(var t=this.Jb.iterator;t.next();){var e=t.value;e instanceof Sm&&Ky(this,e)}},vy.prototype.setPortSpots=function(t){var e=t.alignment;if(Cy(e)){var i=this.kd===Jy,n=Hy(t);switch(n){case 0:var o=Fe;break;case 90:o=Be;break;case 180:o=De;break;default:o=Oe}var r=t.children,s=r.length;switch(e){case am:case hm:for(e=0;e<s;e++){var a=r[e];if(a=(i?a.sourceEdges:a.destinationEdges).first(),null!==a&&(a=a.link,null!==a)){var h=90===n||270===n?De:Oe;if(1===s||e===s-1&&1===s%2)switch(n){case 0:h=De;break;case 90:h=Oe;break;case 180:h=Fe;break;default:h=Be}else 0===e%2&&(h=90===n||270===n?Fe:Be);i?(t.setsPortSpot&&(a.fromSpot=o),t.setsChildPortSpot&&(a.toSpot=h)):(t.setsPortSpot&&(a.fromSpot=h),t.setsChildPortSpot&&(a.toSpot=o))}}break;case lm:for(n=90===n||270===n?Fe:Be,r=i?t.destinationEdges:t.sourceEdges;r.next();)s=r.value.link,null!==s&&(i?(t.setsPortSpot&&(s.fromSpot=o),t.setsChildPortSpot&&(s.toSpot=n)):(t.setsPortSpot&&(s.fromSpot=n),t.setsChildPortSpot&&(s.toSpot=o)));break;case um:for(n=90===n||270===n?De:Oe,r=i?t.destinationEdges:t.sourceEdges;r.next();)s=r.value.link,null!==s&&(i?(t.setsPortSpot&&(s.fromSpot=o),t.setsChildPortSpot&&(s.toSpot=n)):(t.setsPortSpot&&(s.fromSpot=n),t.setsChildPortSpot&&(s.toSpot=o)))}}else if(i=Hy(t),this.kd===Jy){for(o=t.destinationEdges;o.next();)if(n=o.value.link,null!==n){if(t.setsPortSpot)if(t.portSpot.Mb())switch(i){case 0:n.fromSpot=Fe;break;case 90:n.fromSpot=Be;break;case 180:n.fromSpot=De;break;default:n.fromSpot=Oe}else n.fromSpot=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.Mb())switch(i){case 0:n.toSpot=De;break;case 90:n.toSpot=Oe;break;case 180:n.toSpot=Fe;break;default:n.toSpot=Be}else n.toSpot=t.childPortSpot}}else for(o=t.sourceEdges;o.next();)if(n=o.value.link,null!==n){if(t.setsPortSpot)if(t.portSpot.Mb())switch(i){case 0:n.toSpot=Fe;break;case 90:n.toSpot=Be;break;case 180:n.toSpot=De;break;default:n.toSpot=Oe}else n.toSpot=t.portSpot;if(t.setsChildPortSpot)if(t.childPortSpot.Mb())switch(i){case 0:n.fromSpot=De;break;case 90:n.fromSpot=Oe;break;case 180:n.fromSpot=Fe;break;default:n.fromSpot=Be}else n.fromSpot=t.childPortSpot}},d.Object.defineProperties(vy.prototype,{roots:{get:function(){return this.Jb},set:function(t){this.Jb!==t&&(this.Jb=t,this.B())}},path:{get:function(){return this.vp},set:function(t){this.vp!==t&&(this.vp=t,this.B())}},treeStyle:{get:function(){return this.oq},set:function(t){this.Eb===t||t!==dm&&t!==gm&&t!==pm&&t!==ym||(this.oq=t,this.B())}},layerStyle:{get:function(){return this.ts},set:function(t){this.Eb===t||t!==bm&&t!==wm&&t!==km||(this.ts=t,this.B())}},comments:{get:function(){return this.jd},set:function(t){this.jd!==t&&(this.jd=t,this.B())}},arrangement:{get:function(){return this.Eb},set:function(t){this.Eb===t||t!==mm&&t!==vm&&t!==xm||(this.Eb=t,this.B())}},arrangementSpacing:{get:function(){return this.Pd},set:function(t){this.Pd.w(t)||(this.Pd.assign(t),this.B())}},rootDefaults:{get:function(){return this.U},set:function(t){this.U!==t&&(this.U=t,this.B())}},alternateDefaults:{get:function(){return this.V},set:function(t){this.V!==t&&(this.V=t,this.B())}},sorting:{get:function(){return this.U.sorting},set:function(t){this.U.sorting===t||t!==Qy&&t!==tm&&t!==em&&!im||(this.U.sorting=t,this.B())}},comparer:{get:function(){return this.U.comparer},set:function(t){this.U.comparer!==t&&(this.U.comparer=t,this.B())}},angle:{get:function(){return this.U.angle},set:function(t){this.U.angle!==t&&(0===t||90===t||180===t||270===t?(this.U.angle=t,this.B()):w("TreeLayout.angle must be 0, 90, 180, or 270"))}},alignment:{get:function(){return this.U.alignment},set:function(t){this.U.alignment!==t&&(this.U.alignment=t,this.B())}},nodeIndent:{get:function(){return this.U.nodeIndent},set:function(t){this.U.nodeIndent!==t&&0<=t&&(this.U.nodeIndent=t,this.B())}},nodeIndentPastParent:{get:function(){return this.U.nodeIndentPastParent},set:function(t){this.U.nodeIndentPastParent!==t&&0<=t&&1>=t&&(this.U.nodeIndentPastParent=t,this.B())}},nodeSpacing:{get:function(){return this.U.nodeSpacing},set:function(t){this.U.nodeSpacing!==t&&(this.U.nodeSpacing=t,this.B())}},layerSpacing:{get:function(){return this.U.layerSpacing},set:function(t){this.U.layerSpacing!==t&&(this.U.layerSpacing=t,this.B())}},layerSpacingParentOverlap:{get:function(){return this.U.layerSpacingParentOverlap},set:function(t){this.U.layerSpacingParentOverlap!==t&&0<=t&&1>=t&&(this.U.layerSpacingParentOverlap=t,this.B())}},compaction:{get:function(){return this.U.compaction},set:function(t){this.U.compaction===t||t!==cm&&t!==fm||(this.U.compaction=t,this.B())}},breadthLimit:{get:function(){return this.U.breadthLimit},set:function(t){this.U.breadthLimit!==t&&0<=t&&(this.U.breadthLimit=t,this.B())}},rowSpacing:{get:function(){return this.U.rowSpacing},set:function(t){this.U.rowSpacing!==t&&(this.U.rowSpacing=t,this.B())}},rowIndent:{get:function(){return this.U.rowIndent},set:function(t){this.U.rowIndent!==t&&0<=t&&(this.U.rowIndent=t,this.B())}},commentSpacing:{get:function(){return this.U.commentSpacing},set:function(t){this.U.commentSpacing!==t&&(this.U.commentSpacing=t,this.B())}},commentMargin:{get:function(){return this.U.commentMargin},set:function(t){this.U.commentMargin!==t&&(this.U.commentMargin=t,this.B())}},setsPortSpot:{get:function(){return this.U.setsPortSpot},set:function(t){this.U.setsPortSpot!==t&&(this.U.setsPortSpot=t,this.B())}},portSpot:{get:function(){return this.U.portSpot},set:function(t){this.U.portSpot.w(t)||(this.U.portSpot=t,this.B())}},setsChildPortSpot:{get:function(){return this.U.setsChildPortSpot},set:function(t){this.U.setsChildPortSpot!==t&&(this.U.setsChildPortSpot=t,this.B())}},childPortSpot:{get:function(){return this.U.childPortSpot},set:function(t){this.U.childPortSpot.w(t)||(this.U.childPortSpot=t,this.B())}},alternateSorting:{get:function(){return this.V.sorting},set:function(t){this.V.sorting===t||t!==Qy&&t!==tm&&t!==em&&!im||(this.V.sorting=t,this.B())}},alternateComparer:{get:function(){return this.V.comparer},set:function(t){this.V.comparer!==t&&(this.V.comparer=t,this.B())}},alternateAngle:{get:function(){return this.V.angle},set:function(t){this.V.angle===t||0!==t&&90!==t&&180!==t&&270!==t||(this.V.angle=t,this.B())}},alternateAlignment:{get:function(){return this.V.alignment},set:function(t){this.V.alignment!==t&&(this.V.alignment=t,this.B())}},alternateNodeIndent:{get:function(){return this.V.nodeIndent},set:function(t){this.V.nodeIndent!==t&&0<=t&&(this.V.nodeIndent=t,this.B())}},alternateNodeIndentPastParent:{get:function(){return this.V.nodeIndentPastParent},set:function(t){this.V.nodeIndentPastParent!==t&&0<=t&&1>=t&&(this.V.nodeIndentPastParent=t,this.B())}},alternateNodeSpacing:{get:function(){return this.V.nodeSpacing},set:function(t){this.V.nodeSpacing!==t&&(this.V.nodeSpacing=t,this.B())}},alternateLayerSpacing:{get:function(){return this.V.layerSpacing},set:function(t){this.V.layerSpacing!==t&&(this.V.layerSpacing=t,this.B())}},alternateLayerSpacingParentOverlap:{get:function(){return this.V.layerSpacingParentOverlap},set:function(t){this.V.layerSpacingParentOverlap!==t&&0<=t&&1>=t&&(this.V.layerSpacingParentOverlap=t,this.B())}},alternateCompaction:{get:function(){return this.V.compaction},set:function(t){this.V.compaction===t||t!==cm&&t!==fm||(this.V.compaction=t,this.B())}},alternateBreadthLimit:{get:function(){return this.V.breadthLimit},set:function(t){this.V.breadthLimit!==t&&0<=t&&(this.V.breadthLimit=t,this.B())}},alternateRowSpacing:{get:function(){return this.V.rowSpacing},set:function(t){this.V.rowSpacing!==t&&(this.V.rowSpacing=t,this.B())}},alternateRowIndent:{get:function(){return this.V.rowIndent},set:function(t){this.V.rowIndent!==t&&0<=t&&(this.V.rowIndent=t,this.B())}},alternateCommentSpacing:{get:function(){return this.V.commentSpacing},set:function(t){this.V.commentSpacing!==t&&(this.V.commentSpacing=t,this.B())}},alternateCommentMargin:{get:function(){return this.V.commentMargin},set:function(t){this.V.commentMargin!==t&&(this.V.commentMargin=t,this.B())}},alternateSetsPortSpot:{get:function(){return this.V.setsPortSpot},set:function(t){this.V.setsPortSpot!==t&&(this.V.setsPortSpot=t,this.B())}},alternatePortSpot:{get:function(){return this.V.portSpot},set:function(t){this.V.portSpot.w(t)||(this.V.portSpot=t,this.B())}},alternateSetsChildPortSpot:{get:function(){return this.V.setsChildPortSpot},set:function(t){this.V.setsChildPortSpot!==t&&(this.V.setsChildPortSpot=t,this.B())}},alternateChildPortSpot:{get:function(){return this.V.childPortSpot},set:function(t){this.V.childPortSpot.w(t)||(this.V.childPortSpot=t,this.B())}}});var $y=new U(vy,"PathDefault",-1),Jy=new U(vy,"PathDestination",0),Zy=new U(vy,"PathSource",1),Qy=new U(vy,"SortingForwards",10),tm=new U(vy,"SortingReverse",11),em=new U(vy,"SortingAscending",12),im=new U(vy,"SortingDescending",13),nm=new U(vy,"AlignmentCenterSubtrees",20),om=new U(vy,"AlignmentCenterChildren",21),rm=new U(vy,"AlignmentStart",22),sm=new U(vy,"AlignmentEnd",23),am=new U(vy,"AlignmentBus",24),hm=new U(vy,"AlignmentBusBranching",25),lm=new U(vy,"AlignmentTopLeftBus",26),um=new U(vy,"AlignmentBottomRightBus",27),cm=new U(vy,"CompactionNone",30),fm=new U(vy,"CompactionBlock",31),dm=new U(vy,"StyleLayered",40),pm=new U(vy,"StyleLastParents",41),gm=new U(vy,"StyleAlternating",42),ym=new U(vy,"StyleRootOnly",43),mm=new U(vy,"ArrangementVertical",50),vm=new U(vy,"ArrangementHorizontal",51),xm=new U(vy,"ArrangementFixedRoots",52),bm=new U(vy,"LayerIndividual",60),wm=new U(vy,"LayerSiblings",61),km=new U(vy,"LayerUniform",62);function Mm(t){Qf.call(this,t)}function Sm(t){rd.call(this,t),this.Ka=!1,this.Cc=null,this.I=[],this.Sc=this.eb=this.T=this.La=0,this.jd=null,this.S=new pt(0,0),this.ua=new Bt(0,0),this.fa=new pt(0,0),this.Tm=this.Sm=this.ZA=!1,this.br=this.Pq=null,this.bd=Qy,this.Wc=sd,this.Yb=0,this.yb=om,this.Ds=this.Cs=0,this.Es=20,this.ue=50,this.ss=0,this.Er=fm,this.wr=0,this.Rs=25,this.Dr=this.Qs=10,this.Cr=20,this.dt=!0,this.Ms=Ce,this.ct=!0,this.zr=Ce}function Pm(t){ad.call(this,t),this.lv=new pt(0,0)}vy.className="TreeLayout",vy.PathDefault=$y,vy.PathDestination=Jy,vy.PathSource=Zy,vy.SortingForwards=Qy,vy.SortingReverse=tm,vy.SortingAscending=em,vy.SortingDescending=im,vy.AlignmentCenterSubtrees=nm,vy.AlignmentCenterChildren=om,vy.AlignmentStart=rm,vy.AlignmentEnd=sm,vy.AlignmentBus=am,vy.AlignmentBusBranching=hm,vy.AlignmentTopLeftBus=lm,vy.AlignmentBottomRightBus=um,vy.CompactionNone=cm,vy.CompactionBlock=fm,vy.StyleLayered=dm,vy.StyleLastParents=pm,vy.StyleAlternating=gm,vy.StyleRootOnly=ym,vy.ArrangementVertical=mm,vy.ArrangementHorizontal=vm,vy.ArrangementFixedRoots=xm,vy.LayerIndividual=bm,vy.LayerSiblings=wm,vy.LayerUniform=km,f(Mm,Qf),Mm.prototype.createVertex=function(){return new Sm(this)},Mm.prototype.createEdge=function(){return new Pm(this)},Mm.className="TreeNetwork",f(Sm,rd),Sm.prototype.copyInheritedPropertiesFrom=function(t){null!==t&&(this.bd=t.sorting,this.Wc=t.comparer,this.Yb=t.angle,this.yb=t.alignment,this.Cs=t.nodeIndent,this.Ds=t.nodeIndentPastParent,this.Es=t.nodeSpacing,this.ue=t.layerSpacing,this.ss=t.layerSpacingParentOverlap,this.Er=t.compaction,this.wr=t.breadthLimit,this.Rs=t.rowSpacing,this.Qs=t.rowIndent,this.Dr=t.commentSpacing,this.Cr=t.commentMargin,this.dt=t.setsPortSpot,this.Ms=t.portSpot,this.ct=t.setsChildPortSpot,this.zr=t.childPortSpot)},d.Object.defineProperties(Sm.prototype,{initialized:{get:function(){return this.Ka},set:function(t){this.Ka!==t&&(this.Ka=t)}},parent:{get:function(){return this.Cc},set:function(t){this.Cc!==t&&(this.Cc=t)}},children:{get:function(){return this.I},set:function(t){if(this.I!==t){if(null!==t)for(var e=t.length,i=0;i<e;i++);this.I=t}}},level:{get:function(){return this.La},set:function(t){this.La!==t&&(this.La=t)}},descendantCount:{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t)}},maxChildrenCount:{get:function(){return this.eb},set:function(t){this.eb!==t&&(this.eb=t)}},maxGenerationCount:{get:function(){return this.Sc},set:function(t){this.Sc!==t&&(this.Sc=t)}},comments:{get:function(){return this.jd},set:function(t){if(this.jd!==t){if(null!==t)for(var e=t.length,i=0;i<e;i++);this.jd=t}}},sorting:{get:function(){return this.bd},set:function(t){this.bd!==t&&(this.bd=t)}},comparer:{get:function(){return this.Wc},set:function(t){this.Wc!==t&&(this.Wc=t)}},angle:{get:function(){return this.Yb},set:function(t){this.Yb!==t&&(this.Yb=t)}},alignment:{get:function(){return this.yb},set:function(t){this.yb!==t&&(this.yb=t)}},nodeIndent:{get:function(){return this.Cs},set:function(t){this.Cs!==t&&(this.Cs=t)}},nodeIndentPastParent:{get:function(){return this.Ds},set:function(t){this.Ds!==t&&(this.Ds=t)}},nodeSpacing:{get:function(){return this.Es},set:function(t){this.Es!==t&&(this.Es=t)}},layerSpacing:{get:function(){return this.ue},set:function(t){this.ue!==t&&(this.ue=t)}},layerSpacingParentOverlap:{get:function(){return this.ss},set:function(t){this.ss!==t&&(this.ss=t)}},compaction:{get:function(){return this.Er},set:function(t){this.Er!==t&&(this.Er=t)}},breadthLimit:{get:function(){return this.wr},set:function(t){this.wr!==t&&(this.wr=t)}},rowSpacing:{get:function(){return this.Rs},set:function(t){this.Rs!==t&&(this.Rs=t)}},rowIndent:{get:function(){return this.Qs},set:function(t){this.Qs!==t&&(this.Qs=t)}},commentSpacing:{get:function(){return this.Dr},set:function(t){this.Dr!==t&&(this.Dr=t)}},commentMargin:{get:function(){return this.Cr},set:function(t){this.Cr!==t&&(this.Cr=t)}},setsPortSpot:{get:function(){return this.dt},set:function(t){this.dt!==t&&(this.dt=t)}},portSpot:{get:function(){return this.Ms},set:function(t){this.Ms.w(t)||(this.Ms=t)}},setsChildPortSpot:{get:function(){return this.ct},set:function(t){this.ct!==t&&(this.ct=t)}},childPortSpot:{get:function(){return this.zr},set:function(t){this.zr.w(t)||(this.zr=t)}},childrenCount:{get:function(){return this.children.length}},relativePosition:{get:function(){return this.S},set:function(t){this.S.set(t)}},subtreeSize:{get:function(){return this.ua},set:function(t){this.ua.set(t)}},subtreeOffset:{get:function(){return this.fa},set:function(t){this.fa.set(t)}}}),Sm.className="TreeVertex",f(Pm,ad),Pm.prototype.commit=function(){var t=this.link;if(null!==t&&!t.isAvoiding){var e=this.network.layout,i=null,n=null;switch(e.kd){case Jy:i=this.fromVertex,n=this.toVertex;break;case Zy:i=this.toVertex,n=this.fromVertex;break;default:w("Unhandled path value "+e.kd.toString())}if(null!==i&&null!==n)if(e=this.lv,0!==e.x||0!==e.y||i.ZA){n=i.bounds;var o=Hy(i),r=_y(i),s=i.rowSpacing;t.xj();var a,h=t.curve===ef,l=t.isOrthogonal;if(t.Th(),l||h){for(a=2;4<t.pointsCount;)t.uw(2);var u=t.i(1),c=t.i(2)}else{for(a=1;3<t.pointsCount;)t.uw(1);u=t.i(0),c=t.i(t.pointsCount-1)}var f=t.i(t.pointsCount-1);0===o?(i.alignment===sm?(o=n.bottom+e.y,0===e.y&&u.y>f.y+i.rowIndent&&(o=Math.min(o,Math.max(u.y,o-Wy(i))))):i.alignment===rm?(o=n.top+e.y,0===e.y&&u.y<f.y-i.rowIndent&&(o=Math.max(o,Math.min(u.y,o+Wy(i))))):o=i.Sm||i.Tm&&1===i.maxGenerationCount?n.top-i.fa.y+e.y:n.y+n.height/2+e.y,h?(t.m(a,u.x,o),a++,t.m(a,n.right+r,o),a++,t.m(a,n.right+r+(e.x-s)/3,o),a++,t.m(a,n.right+r+2*(e.x-s)/3,o),a++,t.m(a,n.right+r+(e.x-s),o),a++,t.m(a,c.x,o)):(l&&(t.m(a,n.right+r/2,u.y),a++),t.m(a,n.right+r/2,o),a++,t.m(a,n.right+r+e.x-(l?s/2:s),o),a++,l&&t.m(a,t.i(a-1).x,c.y))):90===o?(i.alignment===sm?(o=n.right+e.x,0===e.x&&u.x>f.x+i.rowIndent&&(o=Math.min(o,Math.max(u.x,o-Wy(i))))):i.alignment===rm?(o=n.left+e.x,0===e.x&&u.x<f.x-i.rowIndent&&(o=Math.max(o,Math.min(u.x,o+Wy(i))))):o=i.Sm||i.Tm&&1===i.maxGenerationCount?n.left-i.fa.x+e.x:n.x+n.width/2+e.x,h?(t.m(a,o,u.y),a++,t.m(a,o,n.bottom+r),a++,t.m(a,o,n.bottom+r+(e.y-s)/3),a++,t.m(a,o,n.bottom+r+2*(e.y-s)/3),a++,t.m(a,o,n.bottom+r+(e.y-s)),a++,t.m(a,o,c.y)):(l&&(t.m(a,u.x,n.bottom+r/2),a++),t.m(a,o,n.bottom+r/2),a++,t.m(a,o,n.bottom+r+e.y-(l?s/2:s)),a++,l&&t.m(a,c.x,t.i(a-1).y))):180===o?(i.alignment===sm?(o=n.bottom+e.y,0===e.y&&u.y>f.y+i.rowIndent&&(o=Math.min(o,Math.max(u.y,o-Wy(i))))):i.alignment===rm?(o=n.top+e.y,0===e.y&&u.y<f.y-i.rowIndent&&(o=Math.max(o,Math.min(u.y,o+Wy(i))))):o=i.Sm||i.Tm&&1===i.maxGenerationCount?n.top-i.fa.y+e.y:n.y+n.height/2+e.y,h?(t.m(a,u.x,o),a++,t.m(a,n.left-r,o),a++,t.m(a,n.left-r+(e.x+s)/3,o),a++,t.m(a,n.left-r+2*(e.x+s)/3,o),a++,t.m(a,n.left-r+(e.x+s),o),a++,t.m(a,c.x,o)):(l&&(t.m(a,n.left-r/2,u.y),a++),t.m(a,n.left-r/2,o),a++,t.m(a,n.left-r+e.x+(l?s/2:s),o),a++,l&&t.m(a,t.i(a-1).x,c.y))):270===o?(i.alignment===sm?(o=n.right+e.x,0===e.x&&u.x>f.x+i.rowIndent&&(o=Math.min(o,Math.max(u.x,o-Wy(i))))):i.alignment===rm?(o=n.left+e.x,0===e.x&&u.x<f.x-i.rowIndent&&(o=Math.max(o,Math.min(u.x,o+Wy(i))))):o=i.Sm||i.Tm&&1===i.maxGenerationCount?n.left-i.fa.x+e.x:n.x+n.width/2+e.x,h?(t.m(a,o,u.y),a++,t.m(a,o,n.top-r),a++,t.m(a,o,n.top-r+(e.y+s)/3),a++,t.m(a,o,n.top-r+2*(e.y+s)/3),a++,t.m(a,o,n.top-r+(e.y+s)),a++,t.m(a,o,c.y)):(l&&(t.m(a,u.x,n.top-r/2),a++),t.m(a,o,n.top-r/2),a++,t.m(a,o,n.top-r+e.y+(l?s/2:s)),a++,l&&t.m(a,c.x,t.i(a-1).y))):w("Invalid angle "+o),t.xf()}else t=this.link,r=Hy(i),r!==Hy(n)&&(s=_y(i),h=i.bounds,i=n.bounds,0===r&&i.left-h.right<s+1||90===r&&i.top-h.bottom<s+1||180===r&&h.left-i.right<s+1||270===r&&h.top-i.bottom<s+1||(t.xj(),i=t.curve===ef,e=t.isOrthogonal,n=Cy(this.fromVertex.alignment),t.Th(),0===r?(r=h.right+s/2,i?4===t.pointsCount&&(i=t.i(3).y,t.L(1,r-20,t.i(1).y),t.m(2,r-20,i),t.m(3,r,i),t.m(4,r+20,i),t.L(5,t.i(5).x,i)):e?n?t.L(3,t.i(2).x,t.i(4).y):6===t.pointsCount&&(t.L(2,r,t.i(2).y),t.L(3,r,t.i(3).y)):4===t.pointsCount?t.m(2,r,t.i(2).y):3===t.pointsCount?t.L(1,r,t.i(2).y):2===t.pointsCount&&t.m(1,r,t.i(1).y)):90===r?(r=h.bottom+s/2,i?4===t.pointsCount&&(i=t.i(3).x,t.L(1,t.i(1).x,r-20),t.m(2,i,r-20),t.m(3,i,r),t.m(4,i,r+20),t.L(5,i,t.i(5).y)):e?n?t.L(3,t.i(2).x,t.i(4).y):6===t.pointsCount&&(t.L(2,t.i(2).x,r),t.L(3,t.i(3).x,r)):4===t.pointsCount?t.m(2,t.i(2).x,r):3===t.pointsCount?t.L(1,t.i(2).x,r):2===t.pointsCount&&t.m(1,t.i(1).x,r)):180===r?(r=h.left-s/2,i?4===t.pointsCount&&(i=t.i(3).y,t.L(1,r+20,t.i(1).y),t.m(2,r+20,i),t.m(3,r,i),t.m(4,r-20,i),t.L(5,t.i(5).x,i)):e?n?t.L(3,t.i(2).x,t.i(4).y):6===t.pointsCount&&(t.L(2,r,t.i(2).y),t.L(3,r,t.i(3).y)):4===t.pointsCount?t.m(2,r,t.i(2).y):3===t.pointsCount?t.L(1,r,t.i(2).y):2===t.pointsCount&&t.m(1,r,t.i(1).y)):270===r&&(r=h.top-s/2,i?4===t.pointsCount&&(i=t.i(3).x,t.L(1,t.i(1).x,r+20),t.m(2,i,r+20),t.m(3,i,r),t.m(4,i,r-20),t.L(5,i,t.i(5).y)):e?n?t.L(3,t.i(2).x,t.i(4).y):6===t.pointsCount&&(t.L(2,t.i(2).x,r),t.L(3,t.i(3).x,r)):4===t.pointsCount?t.m(2,t.i(2).x,r):3===t.pointsCount?t.L(1,t.i(2).x,r):2===t.pointsCount&&t.m(1,t.i(1).x,r)),t.xf()))}},d.Object.defineProperties(Pm.prototype,{fromVertex:{get:function(){return this.Yc},set:function(t){this.Yc!==t&&(this.Yc=t)}},toVertex:{get:function(){return this.ed},set:function(t){this.ed!==t&&(this.ed=t)}},relativePoint:{get:function(){return this.lv},set:function(t){this.lv.set(t)}}}),Pm.className="TreeEdge",Di.prototype.initializeStandardTools=function(){this.Ya("Action",new Ln,this.mouseDownTools),this.Ya("Relinking",new xn,this.mouseDownTools),this.Ya("LinkReshaping",new wn,this.mouseDownTools),this.Ya("Rotating",new Tn,this.mouseDownTools),this.Ya("Resizing",new Cn,this.mouseDownTools),this.Ya("Linking",new gn,this.mouseMoveTools),this.Ya("Dragging",new Gi,this.mouseMoveTools),this.Ya("DragSelecting",new On,this.mouseMoveTools),this.Ya("Panning",new Dn,this.mouseMoveTools),this.Ya("ContextMenu",new In,this.mouseUpTools),this.Ya("TextEditing",new Kn,this.mouseUpTools),this.Ya("ClickCreating",new jn,this.mouseUpTools),this.Ya("ClickSelecting",new An,this.mouseUpTools)},ml("Horizontal",new Oh),ml("Spot",new Fh),ml("Table",new Ih),ml("Viewbox",new zh),ml("TableRow",new Eh),ml("TableColumn",new Rh),ml("Graduated",new qh),ml("Grid",new Vh),ds.add("GraphLinksModel",Ad),ds.add("TreeModel",Dd),qf(ag,null),qf(kg,null);var Nm=y.go,Cm={get licenseKey(){return Ko.licenseKey},set licenseKey(t){Ko.licenseKey=t},get version(){return Ko.version},Group:bc,EnumValue:U,List:et,Set:nt,Map:dt,Point:pt,Size:Bt,Rect:zt,Margin:Qt,Spot:Ge,Geometry:We,PathFigure:ci,PathSegment:fi,InputEvent:wi,DiagramEvent:ki,ChangedEvent:Mi,Model:Bd,GraphLinksModel:yp,TreeModel:Cp,Binding:cp,Transaction:Ti,UndoManager:Ai,CommandHandler:ha,Tool:ji,DraggingTool:Gi,DraggingInfo:Ys,DraggingOptions:ea,LinkingBaseTool:un,LinkingTool:gn,RelinkingTool:xn,LinkReshapingTool:wn,ResizingTool:Cn,RotatingTool:Tn,ClickSelectingTool:An,ActionTool:Ln,ClickCreatingTool:jn,HTMLInfo:Fn,ContextMenuTool:In,DragSelectingTool:On,PanningTool:Dn,TextEditingTool:Kn,ToolManager:Di,Animation:To,AnimationManager:lo,AnimationTrigger:Eo,Layer:Yo,Diagram:Ko,Palette:ia,Overview:oa,Brush:eh,GraphObject:ca,Panel:Uh,RowColumnDefinition:wl,Shape:Nl,TextBlock:Il,TextBlockMetrics:uu,Picture:cu,Part:Lu,Adornment:Qu,Node:ec,Link:Nc,Placeholder:Pc,Layout:zf,LayoutNetwork:Qf,LayoutVertex:rd,LayoutEdge:ad,GridLayout:hd,PanelLayout:Lh,CircularLayout:Tp,CircularNetwork:ng,CircularVertex:og,CircularEdge:sg,ForceDirectedLayout:ag,ForceDirectedNetwork:vg,ForceDirectedVertex:xg,ForceDirectedEdge:bg,LayeredDigraphLayout:kg,LayeredDigraphNetwork:gy,LayeredDigraphVertex:yy,LayeredDigraphEdge:my,TreeLayout:vy,TreeNetwork:Mm,TreeVertex:Sm,TreeEdge:Pm};"object"===typeof Nm&&Nm.version&&w("WARNING: a `go` object on the root object is already defined.  "+("Debug"in Nm?"debug ":"")+"version: "+Nm.version+", replaced with version: "+Cm.version),Ko.prototype.go=Cm,y.go=Cm,("undefined"===typeof y||"undefined"===typeof y.module||"object"!==typeof y.module.exports)&&y.define&&"function"===typeof y.define&&y.define.amd&&y.define(Cm),"object"===typeof t.exports&&(t.exports="undefined"!==typeof e?e.go:self.go)})()}).call(this,i("c8ba"))},7156:function(t,e,i){var n=i("1626"),o=i("861d"),r=i("d2bb");t.exports=function(t,e,i){var s,a;return r&&n(s=e.constructor)&&s!==i&&o(a=s.prototype)&&a!==i.prototype&&r(t,a),t}},7418:function(t,e){e.f=Object.getOwnPropertySymbols},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,i){var n=i("da84"),o=i("1d80"),r=n.Object;t.exports=function(t){return r(o(t))}},"7c73":function(t,e,i){var n,o=i("825a"),r=i("37e8"),s=i("7839"),a=i("d012"),h=i("1be4"),l=i("cc12"),u=i("f772"),c=">",f="<",d="prototype",p="script",g=u("IE_PROTO"),y=function(){},m=function(t){return f+p+c+t+f+"/"+p+c},v=function(t){t.write(m("")),t.close();var e=t.parentWindow.Object;return t=null,e},x=function(){var t,e=l("iframe"),i="java"+p+":";return e.style.display="none",h.appendChild(e),e.src=String(i),t=e.contentWindow.document,t.open(),t.write(m("document.F=Object")),t.close(),t.F},b=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}b="undefined"!=typeof document?document.domain&&n?v(n):x():v(n);var t=s.length;while(t--)delete b[d][s[t]];return b()};a[g]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(y[d]=o(t),i=new y,y[d]=null,i[g]=t):i=b(),void 0===e?i:r(i,e)}},"7dd0":function(t,e,i){"use strict";var n=i("23e7"),o=i("c65b"),r=i("c430"),s=i("5e77"),a=i("1626"),h=i("9ed3"),l=i("e163"),u=i("d2bb"),c=i("d44e"),f=i("9112"),d=i("6eeb"),p=i("b622"),g=i("3f8c"),y=i("ae93"),m=s.PROPER,v=s.CONFIGURABLE,x=y.IteratorPrototype,b=y.BUGGY_SAFARI_ITERATORS,w=p("iterator"),k="keys",M="values",S="entries",P=function(){return this};t.exports=function(t,e,i,s,p,y,N){h(i,e,s);var C,T,A,L=function(t){if(t===p&&B)return B;if(!b&&t in D)return D[t];switch(t){case k:return function(){return new i(this,t)};case M:return function(){return new i(this,t)};case S:return function(){return new i(this,t)}}return function(){return new i(this)}},j=e+" Iterator",O=!1,D=t.prototype,F=D[w]||D["@@iterator"]||p&&D[p],B=!b&&F||L(p),I="Array"==e&&D.entries||F;if(I&&(C=l(I.call(new t)),C!==Object.prototype&&C.next&&(r||l(C)===x||(u?u(C,x):a(C[w])||d(C,w,P)),c(C,j,!0,!0),r&&(g[j]=P))),m&&p==M&&F&&F.name!==M&&(!r&&v?f(D,"name",M):(O=!0,B=function(){return o(F,this)})),p)if(T={values:L(M),keys:y?B:L(k),entries:L(S)},N)for(A in T)(b||O||!(A in D))&&d(D,A,T[A]);else n({target:e,proto:!0,forced:b||O},T);return r&&!N||D[w]===B||d(D,w,B,{name:p}),g[e]=B,T}},"7f9a":function(t,e,i){var n=i("da84"),o=i("1626"),r=i("8925"),s=n.WeakMap;t.exports=o(s)&&/native code/.test(r(s))},"825a":function(t,e,i){var n=i("da84"),o=i("861d"),r=n.String,s=n.TypeError;t.exports=function(t){if(o(t))return t;throw s(r(t)+" is not an object")}},"83ab":function(t,e,i){var n=i("d039");t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"861d":function(t,e,i){var n=i("1626");t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},8925:function(t,e,i){var n=i("e330"),o=i("1626"),r=i("c6cd"),s=n(Function.toString);o(r.inspectSource)||(r.inspectSource=function(t){return s(t)}),t.exports=r.inspectSource},"90e3":function(t,e,i){var n=i("e330"),o=0,r=Math.random(),s=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+s(++o+r,36)}},9112:function(t,e,i){var n=i("83ab"),o=i("9bf2"),r=i("5c6c");t.exports=n?function(t,e,i){return o.f(t,e,r(1,i))}:function(t,e,i){return t[e]=i,t}},9263:function(t,e,i){"use strict";var n=i("c65b"),o=i("e330"),r=i("577e"),s=i("ad6d"),a=i("9f7f"),h=i("5692"),l=i("7c73"),u=i("69f3").get,c=i("fce3"),f=i("107c"),d=h("native-string-replace",String.prototype.replace),p=RegExp.prototype.exec,g=p,y=o("".charAt),m=o("".indexOf),v=o("".replace),x=o("".slice),b=function(){var t=/a/,e=/b*/g;return n(p,t,"a"),n(p,e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),w=a.UNSUPPORTED_Y||a.BROKEN_CARET,k=void 0!==/()??/.exec("")[1],M=b||k||w||c||f;M&&(g=function(t){var e,i,o,a,h,c,f,M=this,S=u(M),P=r(t),N=S.raw;if(N)return N.lastIndex=M.lastIndex,e=n(g,N,P),M.lastIndex=N.lastIndex,e;var C=S.groups,T=w&&M.sticky,A=n(s,M),L=M.source,j=0,O=P;if(T&&(A=v(A,"y",""),-1===m(A,"g")&&(A+="g"),O=x(P,M.lastIndex),M.lastIndex>0&&(!M.multiline||M.multiline&&"\n"!==y(P,M.lastIndex-1))&&(L="(?: "+L+")",O=" "+O,j++),i=new RegExp("^(?:"+L+")",A)),k&&(i=new RegExp("^"+L+"$(?!\\s)",A)),b&&(o=M.lastIndex),a=n(p,T?i:M,O),T?a?(a.input=x(a.input,j),a[0]=x(a[0],j),a.index=M.lastIndex,M.lastIndex+=a[0].length):M.lastIndex=0:b&&a&&(M.lastIndex=M.global?a.index+a[0].length:o),k&&a&&a.length>1&&n(d,a[0],i,(function(){for(h=1;h<arguments.length-2;h++)void 0===arguments[h]&&(a[h]=void 0)})),a&&C)for(a.groups=c=l(null),h=0;h<C.length;h++)f=C[h],c[f[0]]=a[f[1]];return a}),t.exports=g},"94ca":function(t,e,i){var n=i("d039"),o=i("1626"),r=/#|\.prototype\./,s=function(t,e){var i=h[a(t)];return i==u||i!=l&&(o(e)?n(e):!!e)},a=s.normalize=function(t){return String(t).replace(r,".").toLowerCase()},h=s.data={},l=s.NATIVE="N",u=s.POLYFILL="P";t.exports=s},"9a1f":function(t,e,i){var n=i("da84"),o=i("c65b"),r=i("59ed"),s=i("825a"),a=i("0d51"),h=i("35a1"),l=n.TypeError;t.exports=function(t,e){var i=arguments.length<2?h(t):e;if(r(i))return s(o(i,t));throw l(a(t)+" is not iterable")}},"9bf2":function(t,e,i){var n=i("da84"),o=i("83ab"),r=i("0cfb"),s=i("825a"),a=i("a04b"),h=n.TypeError,l=Object.defineProperty;e.f=o?l:function(t,e,i){if(s(t),e=a(e),s(i),r)try{return l(t,e,i)}catch(n){}if("get"in i||"set"in i)throw h("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},"9ed3":function(t,e,i){"use strict";var n=i("ae93").IteratorPrototype,o=i("7c73"),r=i("5c6c"),s=i("d44e"),a=i("3f8c"),h=function(){return this};t.exports=function(t,e,i){var l=e+" Iterator";return t.prototype=o(n,{next:r(1,i)}),s(t,l,!1,!0),a[l]=h,t}},"9f7f":function(t,e,i){var n=i("d039"),o=i("da84"),r=o.RegExp;e.UNSUPPORTED_Y=n((function(){var t=r("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=n((function(){var t=r("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},a04b:function(t,e,i){var n=i("c04e"),o=i("d9b5");t.exports=function(t){var e=n(t,"string");return o(e)?e:e+""}},a4b4:function(t,e,i){var n=i("342f");t.exports=/web0s(?!.*chrome)/i.test(n)},a79d:function(t,e,i){"use strict";var n=i("23e7"),o=i("c430"),r=i("fea9"),s=i("d039"),a=i("d066"),h=i("1626"),l=i("4840"),u=i("cdf9"),c=i("6eeb"),f=!!r&&s((function(){r.prototype["finally"].call({then:function(){}},(function(){}))}));if(n({target:"Promise",proto:!0,real:!0,forced:f},{finally:function(t){var e=l(this,a("Promise")),i=h(t);return this.then(i?function(i){return u(e,t()).then((function(){return i}))}:t,i?function(i){return u(e,t()).then((function(){throw i}))}:t)}}),!o&&h(r)){var d=a("Promise").prototype["finally"];r.prototype["finally"]!==d&&c(r.prototype,"finally",d,{unsafe:!0})}},ac1f:function(t,e,i){"use strict";var n=i("23e7"),o=i("9263");n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},ad6d:function(t,e,i){"use strict";var n=i("825a");t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},ae93:function(t,e,i){"use strict";var n,o,r,s=i("d039"),a=i("1626"),h=i("7c73"),l=i("e163"),u=i("6eeb"),c=i("b622"),f=i("c430"),d=c("iterator"),p=!1;[].keys&&(r=[].keys(),"next"in r?(o=l(l(r)),o!==Object.prototype&&(n=o)):p=!0);var g=void 0==n||s((function(){var t={};return n[d].call(t)!==t}));g?n={}:f&&(n=h(n)),a(n[d])||u(n,d,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}},b575:function(t,e,i){var n,o,r,s,a,h,l,u,c=i("da84"),f=i("0366"),d=i("06cf").f,p=i("2cf4").set,g=i("1cdc"),y=i("d4c3"),m=i("a4b4"),v=i("605d"),x=c.MutationObserver||c.WebKitMutationObserver,b=c.document,w=c.process,k=c.Promise,M=d(c,"queueMicrotask"),S=M&&M.value;S||(n=function(){var t,e;v&&(t=w.domain)&&t.exit();while(o){e=o.fn,o=o.next;try{e()}catch(i){throw o?s():r=void 0,i}}r=void 0,t&&t.enter()},g||v||m||!x||!b?!y&&k&&k.resolve?(l=k.resolve(void 0),l.constructor=k,u=f(l.then,l),s=function(){u(n)}):v?s=function(){w.nextTick(n)}:(p=f(p,c),s=function(){p(n)}):(a=!0,h=b.createTextNode(""),new x(n).observe(h,{characterData:!0}),s=function(){h.data=a=!a})),t.exports=S||function(t){var e={fn:t,next:void 0};r&&(r.next=e),o||(o=e,s()),r=e}},b622:function(t,e,i){var n=i("da84"),o=i("5692"),r=i("1a2d"),s=i("90e3"),a=i("4930"),h=i("fdbf"),l=o("wks"),u=n.Symbol,c=u&&u["for"],f=h?u:u&&u.withoutSetter||s;t.exports=function(t){if(!r(l,t)||!a&&"string"!=typeof l[t]){var e="Symbol."+t;a&&r(u,t)?l[t]=u[t]:l[t]=h&&c?c(e):f(e)}return l[t]}},c04e:function(t,e,i){var n=i("da84"),o=i("c65b"),r=i("861d"),s=i("d9b5"),a=i("dc4a"),h=i("485a"),l=i("b622"),u=n.TypeError,c=l("toPrimitive");t.exports=function(t,e){if(!r(t)||s(t))return t;var i,n=a(t,c);if(n){if(void 0===e&&(e="default"),i=o(n,t,e),!r(i)||s(i))return i;throw u("Can't convert object to primitive value")}return void 0===e&&(e="number"),h(t,e)}},c430:function(t,e){t.exports=!1},c607:function(t,e,i){var n=i("da84"),o=i("83ab"),r=i("fce3"),s=i("c6b6"),a=i("9bf2").f,h=i("69f3").get,l=RegExp.prototype,u=n.TypeError;o&&r&&a(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!h(this).dotAll;throw u("Incompatible receiver, RegExp required")}}})},c65b:function(t,e){var i=Function.prototype.call;t.exports=i.bind?i.bind(i):function(){return i.apply(i,arguments)}},c6b6:function(t,e,i){var n=i("e330"),o=n({}.toString),r=n("".slice);t.exports=function(t){return r(o(t),8,-1)}},c6cd:function(t,e,i){var n=i("da84"),o=i("ce4e"),r="__core-js_shared__",s=n[r]||o(r,{});t.exports=s},c8ba:function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(n){"object"===typeof window&&(i=window)}t.exports=i},ca84:function(t,e,i){var n=i("e330"),o=i("1a2d"),r=i("fc6a"),s=i("4d64").indexOf,a=i("d012"),h=n([].push);t.exports=function(t,e){var i,n=r(t),l=0,u=[];for(i in n)!o(a,i)&&o(n,i)&&h(u,i);while(e.length>l)o(n,i=e[l++])&&(~s(u,i)||h(u,i));return u}},cc12:function(t,e,i){var n=i("da84"),o=i("861d"),r=n.document,s=o(r)&&o(r.createElement);t.exports=function(t){return s?r.createElement(t):{}}},cca6:function(t,e,i){var n=i("23e7"),o=i("60da");n({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},cdf9:function(t,e,i){var n=i("825a"),o=i("861d"),r=i("f069");t.exports=function(t,e){if(n(t),o(e)&&e.constructor===t)return e;var i=r.f(t),s=i.resolve;return s(e),i.promise}},ce4e:function(t,e,i){var n=i("da84"),o=Object.defineProperty;t.exports=function(t,e){try{o(n,t,{value:e,configurable:!0,writable:!0})}catch(i){n[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,i){var n=i("da84"),o=i("1626"),r=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?r(n[t]):n[t]&&n[t][e]}},d1e7:function(t,e,i){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,r=o&&!n.call({1:2},1);e.f=r?function(t){var e=o(this,t);return!!e&&e.enumerable}:n},d2bb:function(t,e,i){var n=i("e330"),o=i("825a"),r=i("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{t=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(i,[]),e=i instanceof Array}catch(s){}return function(i,n){return o(i),r(n),e?t(i,n):i.__proto__=n,i}}():void 0)},d44e:function(t,e,i){var n=i("9bf2").f,o=i("1a2d"),r=i("b622"),s=r("toStringTag");t.exports=function(t,e,i){t&&!o(t=i?t:t.prototype,s)&&n(t,s,{configurable:!0,value:e})}},d4c3:function(t,e,i){var n=i("342f"),o=i("da84");t.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==o.Pebble},d9b5:function(t,e,i){var n=i("da84"),o=i("d066"),r=i("1626"),s=i("3a9b"),a=i("fdbf"),h=n.Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return r(e)&&s(e.prototype,h(t))}},da84:function(t,e,i){(function(e){var i=function(t){return t&&t.Math==Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,i("c8ba"))},dc4a:function(t,e,i){var n=i("59ed");t.exports=function(t,e){var i=t[e];return null==i?void 0:n(i)}},df75:function(t,e,i){var n=i("ca84"),o=i("7839");t.exports=Object.keys||function(t){return n(t,o)}},e163:function(t,e,i){var n=i("da84"),o=i("1a2d"),r=i("1626"),s=i("7b0b"),a=i("f772"),h=i("e177"),l=a("IE_PROTO"),u=n.Object,c=u.prototype;t.exports=h?u.getPrototypeOf:function(t){var e=s(t);if(o(e,l))return e[l];var i=e.constructor;return r(i)&&e instanceof i?i.prototype:e instanceof u?c:null}},e177:function(t,e,i){var n=i("d039");t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e260:function(t,e,i){"use strict";var n=i("fc6a"),o=i("44d2"),r=i("3f8c"),s=i("69f3"),a=i("7dd0"),h="Array Iterator",l=s.set,u=s.getterFor(h);t.exports=a(Array,"Array",(function(t,e){l(this,{type:h,target:n(t),index:0,kind:e})}),(function(){var t=u(this),e=t.target,i=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),r.Arguments=r.Array,o("keys"),o("values"),o("entries")},e2cc:function(t,e,i){var n=i("6eeb");t.exports=function(t,e,i){for(var o in e)n(t,o,e[o],i);return t}},e330:function(t,e){var i=Function.prototype,n=i.bind,o=i.call,r=n&&n.bind(o);t.exports=n?function(t){return t&&r(o,t)}:function(t){return t&&function(){return o.apply(t,arguments)}}},e667:function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},e6cf:function(t,e,i){"use strict";var n,o,r,s,a=i("23e7"),h=i("c430"),l=i("da84"),u=i("d066"),c=i("c65b"),f=i("fea9"),d=i("6eeb"),p=i("e2cc"),g=i("d2bb"),y=i("d44e"),m=i("2626"),v=i("59ed"),x=i("1626"),b=i("861d"),w=i("19aa"),k=i("8925"),M=i("2266"),S=i("1c7e"),P=i("4840"),N=i("2cf4").set,C=i("b575"),T=i("cdf9"),A=i("44de"),L=i("f069"),j=i("e667"),O=i("69f3"),D=i("94ca"),F=i("b622"),B=i("6069"),I=i("605d"),E=i("2d00"),R=F("species"),z="Promise",V=O.get,G=O.set,Y=O.getterFor(z),X=f&&f.prototype,q=f,U=X,K=l.TypeError,H=l.document,_=l.process,W=L.f,$=W,J=!!(H&&H.createEvent&&l.dispatchEvent),Z=x(l.PromiseRejectionEvent),Q="unhandledrejection",tt="rejectionhandled",et=0,it=1,nt=2,ot=1,rt=2,st=!1,at=D(z,(function(){var t=k(q),e=t!==String(q);if(!e&&66===E)return!0;if(h&&!U["finally"])return!0;if(E>=51&&/native code/.test(t))return!1;var i=new q((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))},o=i.constructor={};return o[R]=n,st=i.then((function(){}))instanceof n,!st||!e&&B&&!Z})),ht=at||!S((function(t){q.all(t)["catch"]((function(){}))})),lt=function(t){var e;return!(!b(t)||!x(e=t.then))&&e},ut=function(t,e){if(!t.notified){t.notified=!0;var i=t.reactions;C((function(){var n=t.value,o=t.state==it,r=0;while(i.length>r){var s,a,h,l=i[r++],u=o?l.ok:l.fail,f=l.resolve,d=l.reject,p=l.domain;try{u?(o||(t.rejection===rt&&pt(t),t.rejection=ot),!0===u?s=n:(p&&p.enter(),s=u(n),p&&(p.exit(),h=!0)),s===l.promise?d(K("Promise-chain cycle")):(a=lt(s))?c(a,s,f,d):f(s)):d(n)}catch(g){p&&!h&&p.exit(),d(g)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&ft(t)}))}},ct=function(t,e,i){var n,o;J?(n=H.createEvent("Event"),n.promise=e,n.reason=i,n.initEvent(t,!1,!0),l.dispatchEvent(n)):n={promise:e,reason:i},!Z&&(o=l["on"+t])?o(n):t===Q&&A("Unhandled promise rejection",i)},ft=function(t){c(N,l,(function(){var e,i=t.facade,n=t.value,o=dt(t);if(o&&(e=j((function(){I?_.emit("unhandledRejection",n,i):ct(Q,i,n)})),t.rejection=I||dt(t)?rt:ot,e.error))throw e.value}))},dt=function(t){return t.rejection!==ot&&!t.parent},pt=function(t){c(N,l,(function(){var e=t.facade;I?_.emit("rejectionHandled",e):ct(tt,e,t.value)}))},gt=function(t,e,i){return function(n){t(e,n,i)}},yt=function(t,e,i){t.done||(t.done=!0,i&&(t=i),t.value=e,t.state=nt,ut(t,!0))},mt=function(t,e,i){if(!t.done){t.done=!0,i&&(t=i);try{if(t.facade===e)throw K("Promise can't be resolved itself");var n=lt(e);n?C((function(){var i={done:!1};try{c(n,e,gt(mt,i,t),gt(yt,i,t))}catch(o){yt(i,o,t)}})):(t.value=e,t.state=it,ut(t,!1))}catch(o){yt({done:!1},o,t)}}};if(at&&(q=function(t){w(this,U),v(t),c(n,this);var e=V(this);try{t(gt(mt,e),gt(yt,e))}catch(i){yt(e,i)}},U=q.prototype,n=function(t){G(this,{type:z,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:et,value:void 0})},n.prototype=p(U,{then:function(t,e){var i=Y(this),n=i.reactions,o=W(P(this,q));return o.ok=!x(t)||t,o.fail=x(e)&&e,o.domain=I?_.domain:void 0,i.parent=!0,n[n.length]=o,i.state!=et&&ut(i,!1),o.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new n,e=V(t);this.promise=t,this.resolve=gt(mt,e),this.reject=gt(yt,e)},L.f=W=function(t){return t===q||t===r?new o(t):$(t)},!h&&x(f)&&X!==Object.prototype)){s=X.then,st||(d(X,"then",(function(t,e){var i=this;return new q((function(t,e){c(s,i,t,e)})).then(t,e)}),{unsafe:!0}),d(X,"catch",U["catch"],{unsafe:!0}));try{delete X.constructor}catch(vt){}g&&g(X,U)}a({global:!0,wrap:!0,forced:at},{Promise:q}),y(q,z,!1,!0),m(z),r=u(z),a({target:z,stat:!0,forced:at},{reject:function(t){var e=W(this);return c(e.reject,void 0,t),e.promise}}),a({target:z,stat:!0,forced:h||at},{resolve:function(t){return T(h&&this===r?q:this,t)}}),a({target:z,stat:!0,forced:ht},{all:function(t){var e=this,i=W(e),n=i.resolve,o=i.reject,r=j((function(){var i=v(e.resolve),r=[],s=0,a=1;M(t,(function(t){var h=s++,l=!1;a++,c(i,e,t).then((function(t){l||(l=!0,r[h]=t,--a||n(r))}),o)})),--a||n(r)}));return r.error&&o(r.value),i.promise},race:function(t){var e=this,i=W(e),n=i.reject,o=j((function(){var o=v(e.resolve);M(t,(function(t){c(o,e,t).then(i.resolve,n)}))}));return o.error&&n(o.value),i.promise}})},e893:function(t,e,i){var n=i("1a2d"),o=i("56ef"),r=i("06cf"),s=i("9bf2");t.exports=function(t,e){for(var i=o(e),a=s.f,h=r.f,l=0;l<i.length;l++){var u=i[l];n(t,u)||a(t,u,h(e,u))}}},e95a:function(t,e,i){var n=i("b622"),o=i("3f8c"),r=n("iterator"),s=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||s[r]===t)}},f069:function(t,e,i){"use strict";var n=i("59ed"),o=function(t){var e,i;this.promise=new t((function(t,n){if(void 0!==e||void 0!==i)throw TypeError("Bad Promise constructor");e=t,i=n})),this.resolve=n(e),this.reject=n(i)};t.exports.f=function(t){return new o(t)}},f36a:function(t,e,i){var n=i("e330");t.exports=n([].slice)},f5df:function(t,e,i){var n=i("da84"),o=i("00ee"),r=i("1626"),s=i("c6b6"),a=i("b622"),h=a("toStringTag"),l=n.Object,u="Arguments"==s(function(){return arguments}()),c=function(t,e){try{return t[e]}catch(i){}};t.exports=o?s:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=c(e=l(t),h))?i:u?s(e):"Object"==(n=s(e))&&r(e.callee)?"Arguments":n}},f772:function(t,e,i){var n=i("5692"),o=i("90e3"),r=n("keys");t.exports=function(t){return r[t]||(r[t]=o(t))}},fc6a:function(t,e,i){var n=i("44ad"),o=i("1d80");t.exports=function(t){return n(o(t))}},fce3:function(t,e,i){var n=i("d039"),o=i("da84"),r=o.RegExp;t.exports=n((function(){var t=r(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},fdbf:function(t,e,i){var n=i("4930");t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fea9:function(t,e,i){var n=i("da84");t.exports=n.Promise}}]);
//# sourceMappingURL=chunk-vendors.80f2064b.js.map