diff --git a/public/family/images/gravemarkers/GHB8-GB6.lossless.webp b/public/family/images/gravemarkers/GHB8-GB6.lossless.webp new file mode 100644 index 0000000..f7bf676 Binary files /dev/null and b/public/family/images/gravemarkers/GHB8-GB6.lossless.webp differ diff --git a/public/family/images/gravemarkers/GHB8-GB6.lossy.webp b/public/family/images/gravemarkers/GHB8-GB6.lossy.webp new file mode 100644 index 0000000..23c54fc Binary files /dev/null and b/public/family/images/gravemarkers/GHB8-GB6.lossy.webp differ diff --git a/public/family/js/family.js b/public/family/js/family.js index c14af41..6dd8d16 100644 --- a/public/family/js/family.js +++ b/public/family/js/family.js @@ -5345,8 +5345,10 @@ for (const [key, svg] of Object.entries(isDark ? DARK_MARKERS : LIGHT_MARKERS)) }, 'GHB8-J1B': { // Lola Lina headshot: 'GHB8-J1B.signed.webp', + gravemarker: 'GHB8-GB6.lossy.webp', }, 'GHB8-GB6': { // Sotero Maramba + gravemarker: 'GHB8-GB6.lossy.webp', stories: `
Hunt For Train Robbers

Sotero was once the Chief of Railroad Police for the Philippine National Railrod (PNR). While assigned there, armed bandits ambushed one of the train sets and netted more than $40,000 (P80,000).

@@ -5356,6 +5358,9 @@ for (const [key, svg] of Object.entries(isDark ? DARK_MARKERS : LIGHT_MARKERS)) ` }, + 'GHBD-9LY': { // Lola Cresencia + gravemarker: 'GHB8-GB6.lossy.webp', + }, 'LLQS-641' : { // Miguel Maramba stories: `
Siblings
diff --git a/public/family/js/family.min.js b/public/family/js/family.min.js index 5e49b5e..687db30 100644 --- a/public/family/js/family.min.js +++ b/public/family/js/family.min.js @@ -1,19 +1,19 @@ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Manipulator=e()}(this,function(){"use strict";function n(t){return"true"===t||"false"!==t&&(t===Number(t).toString()?Number(t):""===t||"null"===t?null:t)}function s(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}return{setDataAttribute(t,e,i){t.setAttribute("data-bs-"+s(e),i)},removeDataAttribute(t,e){t.removeAttribute("data-bs-"+s(e))},getDataAttributes(i){if(!i)return{};const s={};return Object.keys(i.dataset).filter(t=>t.startsWith("bs")).forEach(t=>{let e=t.replace(/^bs/,"");e=e.charAt(0).toLowerCase()+e.slice(1,e.length),s[e]=n(i.dataset[t])}),s},getDataAttribute(t,e){return n(t.getAttribute("data-bs-"+s(e)))},offset(t){t=t.getBoundingClientRect();return{top:t.top+document.body.scrollTop,left:t.left+document.body.scrollLeft}},position(t){return{top:t.offsetTop,left:t.offsetLeft}}}}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Data=e()}(this,function(){"use strict";const s=new Map;return{set(t,e,i){s.has(t)||s.set(t,new Map);t=s.get(t);t.has(e)||0===t.size?t.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(t.keys())[0]}.`)},get(t,e){return s.has(t)&&s.get(t).get(e)||null},remove(t,e){var i;s.has(t)&&((i=s.get(t)).delete(e),0===i.size)&&s.delete(t)}}}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).SelectorEngine=e()}(this,function(){"use strict";return{find(t,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,t))},findOne(t,e=document.documentElement){return Element.prototype.querySelector.call(e,t)},children(t,e){return[].concat(...t.children).filter(t=>t.matches(e))},parents(t,e){var i=[];let s=t.parentNode;for(;s&&s.nodeType===Node.ELEMENT_NODE&&3!==s.nodeType;)s.matches(e)&&i.push(s),s=s.parentNode;return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]}}}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).EventHandler=e()}(this,function(){"use strict";const f=/[^.]*(?=\..*)\.|.*/,e=/\..*/,u=/::\d+$/,i={};let s=1;const n={mouseenter:"mouseover",mouseleave:"mouseout"},p=/^(mouseenter|mouseleave)/i,c=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function v(t,e){return e&&e+"::"+s++||t.uidEvent||s++}function y(t){var e=v(t);return t.uidEvent=e,i[e]=i[e]||{},i[e]}function b(i,s,n=null){var a=Object.keys(i);for(let t=0,e=a.length;tfunction(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)},s?s=a(s):i=a(i)),x(e,i,s)),(h=b(l=(l=y(t))[o]||(l[o]={}),r,a?i:null))?h.oneOff=h.oneOff&&n:(h=v(r,e.replace(f,"")),(e=a?(c=t,g=i,m=s,function i(s){var n=c.querySelectorAll(g);for(let e=s["target"];e&&e!==this;e=e.parentNode)for(let t=n.length;t--;)if(n[t]===e)return s.delegateTarget=e,i.oneOff&&w.off(c,s.type,g,m),m.apply(e,[s]);return null}):(u=t,d=i,function t(e){return e.delegateTarget=u,t.oneOff&&w.off(u,e.type,d),d.apply(u,[e])})).delegationSelector=a?i:null,e.originalHandler=r,e.oneOff=n,l[e.uidEvent=h]=e,t.addEventListener(o,e,a)))}function d(t,e,i,s,n){s=b(e[i],s,n);s&&(t.removeEventListener(i,s,Boolean(n)),delete e[i][s.uidEvent])}function g(t){return t=t.replace(e,""),n[t]||t}const w={on(t,e,i,s){a(t,e,i,s,!1)},one(t,e,i,s){a(t,e,i,s,!0)},off(r,o,t,e){if("string"==typeof o&&r){const[i,s,n]=x(o,t,e),a=n!==o,l=y(r);e=o.startsWith(".");if(void 0!==s)return l&&l[n]?void d(r,l,n,s,i?t:null):void 0;e&&Object.keys(l).forEach(t=>{{var e=r,i=l,s=t,n=o.slice(1);const a=i[s]||{};Object.keys(a).forEach(t=>{t.includes(n)&&(t=a[t],d(e,i,s,t.originalHandler,t.delegationSelector))})}});const h=l[n]||{};Object.keys(h).forEach(t=>{var e=t.replace(u,"");a&&!o.includes(e)||(e=h[t],d(r,l,n,e.originalHandler,e.delegationSelector))})}},trigger(t,e,i){if("string"!=typeof e||!t)return null;var s=(s=window.jQuery)&&!document.body.hasAttribute("data-bs-no-jquery")?s:null,n=g(e),a=e!==n,r=c.has(n);let o,l=!0,h=!0,u=!1,d=null;return a&&s&&(o=s.Event(e,i),s(t).trigger(o),l=!o.isPropagationStopped(),h=!o.isImmediatePropagationStopped(),u=o.isDefaultPrevented()),r?(d=document.createEvent("HTMLEvents")).initEvent(n,l,!0):d=new CustomEvent(e,{bubbles:l,cancelable:!0}),void 0!==i&&Object.keys(i).forEach(t=>{Object.defineProperty(d,t,{get(){return i[t]}})}),u&&d.preventDefault(),h&&t.dispatchEvent(d),d.defaultPrevented&&void 0!==o&&o.preventDefault(),d}};return w}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("./dom/data.js"),require("./dom/selector-engine.js"),require("./dom/event-handler.js")):"function"==typeof define&&define.amd?define(["./dom/data","./dom/selector-engine","./dom/event-handler"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).Base=e(t.Data,t.SelectorEngine,t.EventHandler)}(this,function(t,e,i){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=s(t),a=s(e),r=s(i);const o=1e3,l="transitionend",h=t=>{"function"==typeof t&&t()},u=(i,s,t=!0)=>{if(t){t=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);var t=Number.parseFloat(e),s=Number.parseFloat(i);return t||s?(e=e.split(",")[0],i=i.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(i))*o):0})(s)+5;let e=!1;const n=({target:t})=>{t===s&&(e=!0,s.removeEventListener(l,n),h(i))};s.addEventListener(l,n),setTimeout(()=>{e||s.dispatchEvent(new Event(l))},t)}else h(i)};return class{constructor(t){var e,i;(t=(i=e=t)&&"object"==typeof i&&void 0!==(i=void 0!==i.jquery?i[0]:i).nodeType?e.jquery?e[0]:e:"string"==typeof e&&0{this[t]=null})}_queueCallback(t,e,i=!0){u(t,e,i)}static getInstance(t){return n.default.get(t,this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.0.2"}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}static get DATA_KEY(){return"bs."+this.NAME}static get EVENT_KEY(){return"."+this.DATA_KEY}}}),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("./dom/selector-engine.js"),require("./dom/manipulator.js"),require("./dom/event-handler.js"),require("./base-component.js")):"function"==typeof define&&define.amd?define(["./dom/selector-engine","./dom/manipulator","./dom/event-handler","./base-component"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).Offcanvas=e(t.SelectorEngine,t.Manipulator,t.EventHandler,t.Base)}(this,function(t,e,i,s){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=n(t),r=n(e),o=n(i);const l=1e3,h="transitionend",u=t=>!(!t||"object"!=typeof t)&&void 0!==(t=void 0!==t.jquery?t[0]:t).nodeType,d=(s,n,a)=>{Object.keys(a).forEach(t=>{var e=a[t],i=n[t],i=i&&u(i)?"element":null==(i=i)?""+i:{}.toString.call(i).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(e).test(i))throw new TypeError(s.toUpperCase()+`: Option "${t}" provided type "${i}" but expected type "${e}".`)})},c=[];const g=t=>{"function"==typeof t&&t()},m=(i,s,t=!0)=>{if(t){t=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);var t=Number.parseFloat(e),s=Number.parseFloat(i);return t||s?(e=e.split(",")[0],i=i.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(i))*l):0})(s)+5;let e=!1;const n=({target:t})=>{t===s&&(e=!0,s.removeEventListener(h,n),g(i))};s.addEventListener(h,n),setTimeout(()=>{e||s.dispatchEvent(new Event(h))},t)}else g(i)},f=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",p=".sticky-top";class v{constructor(){this._element=document.body}getWidth(){var t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,"paddingRight",t=>t+e),this._setElementAttributes(f,"paddingRight",t=>t+e),this._setElementAttributes(p,"marginRight",t=>t-e)}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,i,s){const n=this.getWidth();this._applyManipulationCallback(t,t=>{var e;t!==this._element&&window.innerWidth>t.clientWidth+n||(this._saveInitialAttribute(t,i),e=window.getComputedStyle(t)[i],t.style[i]=s(Number.parseFloat(e))+"px")})}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,"paddingRight"),this._resetElementAttributes(f,"paddingRight"),this._resetElementAttributes(p,"marginRight")}_saveInitialAttribute(t,e){var i=t.style[e];i&&r.default.setDataAttribute(t,e,i)}_resetElementAttributes(t,i){this._applyManipulationCallback(t,t=>{var e=r.default.getDataAttribute(t,i);void 0===e?t.style.removeProperty(i):(r.default.removeDataAttribute(t,i),t.style[i]=e)})}_applyManipulationCallback(t,e){u(t)?e(t):a.default.find(t,this._element).forEach(e)}isOverflowing(){return 0{g(t)})):g(t)}hide(t){this._config.isVisible?(this._getElement().classList.remove("show"),this._emulateAnimation(()=>{this.dispose(),g(t)})):g(t)}_getElement(){var t;return this._element||((t=document.createElement("div")).className="offcanvas-backdrop",this._config.isAnimated&&t.classList.add("fade"),this._element=t),this._element}_getConfig(t){var e;return(t={...y,..."object"==typeof t?t:{}}).rootElement=(e=t.rootElement,u(e)?e.jquery?e[0]:e:"string"==typeof e&&0{g(this._config.clickCallback)}),this._isAppended=!0)}dispose(){this._isAppended&&(o.default.off(this._element,w),this._element.remove(),this._isAppended=!1)}_emulateAnimation(t){m(t,this._getElement(),this._config.isAnimated)}}const P="offcanvas";t=".bs.offcanvas";const k={backdrop:!0,keyboard:!0,scroll:!1},S={backdrop:"boolean",keyboard:"boolean",scroll:"boolean"},M=".offcanvas.show",C="hidden"+t,N="focusin"+t;var L;class D extends n(s).default{constructor(t,e){super(t),this._config=this._getConfig(e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._addEventListeners()}static get NAME(){return P}static get Default(){return k}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||o.default.trigger(this._element,"show.bs.offcanvas",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._element.style.visibility="visible",this._backdrop.show(),this._config.scroll||((new v).hide(),this._enforceFocusOnElement(this._element)),this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add("show"),this._queueCallback(()=>{o.default.trigger(this._element,"shown.bs.offcanvas",{relatedTarget:t})},this._element,!0))}hide(){this._isShown&&!o.default.trigger(this._element,"hide.bs.offcanvas").defaultPrevented&&(o.default.off(document,N),this._element.blur(),this._isShown=!1,this._element.classList.remove("show"),this._backdrop.hide(),this._queueCallback(()=>{this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._element.style.visibility="hidden",this._config.scroll||(new v).reset(),o.default.trigger(this._element,C)},this._element,!0))}dispose(){this._backdrop.dispose(),super.dispose(),o.default.off(document,N)}_getConfig(t){return t={...k,...r.default.getDataAttributes(this._element),..."object"==typeof t?t:{}},d(P,t,S),t}_initializeBackDrop(){return new A({isVisible:this._config.backdrop,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:()=>this.hide()})}_enforceFocusOnElement(e){o.default.off(document,N),o.default.on(document,N,t=>{document===t.target||e===t.target||e.contains(t.target)||e.focus()}),e.focus()}_addEventListeners(){o.default.on(this._element,"click.dismiss.bs.offcanvas",'[data-bs-dismiss="offcanvas"]',()=>this.hide()),o.default.on(this._element,"keydown.dismiss.bs.offcanvas",t=>{this._config.keyboard&&"Escape"===t.key&&this.hide()})}static jQueryInterface(e){return this.each(function(){var t=D.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}return o.default.on(document,"click.bs.offcanvas.data-api",'[data-bs-toggle="offcanvas"]',function(t){var e=(t=>{t=(e=>{let i=e.getAttribute("data-bs-target");if(!i||"#"===i){let t=e.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t="#"+t.split("#")[1]),i=t&&"#"!==t?t.trim():null}return i})(t);return t?document.querySelector(t):null})(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),!(t=this)||t.nodeType!==Node.ELEMENT_NODE||t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled"))||(o.default.one(e,C,()=>{var t;t=this,u(t)&&0!==t.getClientRects().length&&"visible"===getComputedStyle(t).getPropertyValue("visibility")&&this.focus()}),(t=a.default.findOne(M))&&t!==e&&D.getInstance(t).hide(),D.getOrCreateInstance(e).toggle(this))}),o.default.on(window,"load.bs.offcanvas.data-api",()=>a.default.find(M).forEach(t=>D.getOrCreateInstance(t).show())),L=D,e=()=>{const t=(e=window.jQuery)&&!document.body.hasAttribute("data-bs-no-jquery")?e:null;var e;if(t){const i=L.NAME,s=t.fn[i];t.fn[i]=L.jQueryInterface,t.fn[i].Constructor=L,t.fn[i].noConflict=()=>(t.fn[i]=s,L.jQueryInterface)}},"loading"===document.readyState?(c.length||document.addEventListener("DOMContentLoaded",()=>{c.forEach(t=>t())}),c.push(e)):e(),D}),function(){const v="object"==typeof globalThis&&globalThis||"object"==typeof global&&global.global===global&&global||"object"==typeof self&&self.self===self&&self||{},Ht=(void 0===v.requestAnimationFrame&&(void 0===v.setImmediate?v.requestAnimationFrame=t=>v.setTimeout(t,0):v.requestAnimationFrame=v.setImmediate),{boundsInfoEnabled:!1,drawLocationsEnabled:!1,drawClipEnabled:!1,drawLinkpointsEnabled:!1,nodeInspector:!1,handleMessages:!1,drawFrames:!1,defaultDiagram:null,trace:function(t){v.console&&v.console.log(t)},drawDiagramBounds(t,e,i,s){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(s.left,s.top+20),t.lineTo(s.left,s.top),t.lineTo(s.left+20,s.top),t.moveTo(s.right,s.bottom-20),t.lineTo(s.right,s.bottom),t.lineTo(s.right-20,s.bottom),t.stroke(),t.fillText("DB: "+Math.round(s.x)+", "+Math.round(s.y)+", "+Math.round(s.width)+", "+Math.round(s.height),s.left,s.top-5)},attachReadonlyWarnings:function(t){for(const n in t)if("licenseKey"!==n){var i=t[n];if(void 0!==i.prototype){const a=Object.getOwnPropertyNames(i.prototype);for(let e=0;e{a=-1,n||i.apply(t,e)},s),n&&!a&&i.apply(t,e)}}static Xh(t,e){return v.setTimeout(t,e)}static Gg(t){v.clearTimeout(t)}static hn(t){return v.document.createElement(t)}static n(t){throw new Error(t)}static O(t,e){let i="The object is frozen, so its properties cannot be set: "+t.toString();void 0!==e&&(i+=" to value: "+e),Kt.n(i)}static s(e,i,s,n){if(!(e instanceof i)){let t=Kt.hu(s);void 0!==n&&(t+="."+n),Kt.Bi(e,i,t)}}static t(e,i,s,n){if(typeof e!==i){let t=Kt.hu(s);void 0!==n&&(t+="."+n),Kt.Bi(e,i,t)}}static r(e,i,s){if("number"!=typeof e||!isFinite(e)){let t=Kt.hu(i);void 0!==s&&(t+="."+s),Kt.n(t+" must be a real number type, and not NaN or Infinity: "+e)}}static it(t,e,i){t in e||Kt.n(t+" is not a valid value in enumeration: "+i)}static Bi(t,e,i,s){e=" value is not an instance of "+Kt.hu(e)+": ";let n=Kt.hu(i);void 0!==s&&(n+="."+s),"string"==typeof t&&(t='"'+t+'"'),Kt.n(n+e+t)}static G(t,e,i,s){let n=Kt.hu(i);void 0!==s&&(n+="."+s),Kt.n(n+" is not in the range "+e+": "+t)}static Ke(t){Kt.n("Collection was modified during iteration: "+t.toString()+` Perhaps you should iterate over a copy of the collection, - or you could collect items to be removed from the collection after the iteration.`)}static gr(t,e){Kt.n("No property to set for this enum value: "+e+" on "+t.toString())}static ft(t){v.console&&v.console.log(t)}static Mt(t){return"object"==typeof t&&null!==t}static Hg(t,e,i){Array.isArray(t)||Kt.Bi(t,"Array",e,i)}static au(t,e,i){Array.isArray(t)?e>=t.length?t.push(i):t.splice(e,0,i):Kt.n("Cannot insert an object into an HTMLCollection or NodeList: "+i+" at "+e)}static rf(t,e){Array.isArray(t)?e>=t.length?t.pop():t.splice(e,1):Kt.n("Cannot remove an object from an HTMLCollection or NodeList at "+e)}static Ik=[];static ct(){var t=Kt.Ik.pop();return void 0===t?[]:t}static ot(t){t.length=0,Kt.Ik.push(t)}static tE=Object.freeze([]);static hu(t){return null===t?"*":"string"==typeof t?t:"function"==typeof t?t.name:""}static an(t){return"function"==typeof t?t.className||t.name:Kt.Mt(t)&&t.constructor?Kt.an(t.constructor):typeof t}static Yh(t,e){return null!=e&&""!==e&&(Kt.Mt(t)&&e in t||t[e])?t[e]:null}static toString(t){let e=t;return Kt.Mt(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()}static yw(t,e){if(t.hasOwnProperty(e))return!0;let i=Object.getPrototypeOf(t);for(;i&&i!==Function;){if(i.hasOwnProperty(e))return!0;var s=i.iE;if(s&&s[e])return!0;i=Object.getPrototypeOf(i)}return!1}static DD(e){var i=[];let s=0;for(s=0;s<256;s++)i[s]=s;let n=0,a=0;for(s=0;s<256;s++)n=(n+i[s]+119)%256,a=i[s],i[s]=i[n],i[n]=a;s=0;let r="";for(let t=n=0;t>4)+i.charAt(15&t)]=String.fromCharCode(t);e.length%2&&(e="0"+e);var n=[];let a=0;for(let t=0;t=e.length)&&Kt.G(t,"0 <= i < length",O,"elt:i"),e[t]}get(t){return this.elt(t)}setElt(t,e){Ht,Kt.r(t,O,"setElt:i");var i=this.h;(t<0||t>=i.length)&&Kt.G(t,"0 <= i < length",O,"setElt:i"),this.f&&Kt.O(this,t),i[t]=e}set(t,e){this.setElt(t,e)}first(){var t=this.h;return 0===t.length?null:t[0]}last(){var t=this.h,e=t.length;return 0= 0",O,"insertAt:i"),this.f&&Kt.O(this,t);var i=this.h;t>=i.length?i.push(e):i.splice(t,0,e),this.Ue()}remove(t){if(null===t)return!1;this.f&&Kt.O(this,t);var e=this.h,t=e.indexOf(t);return-1!==t&&(t===e.length-1?e.pop():e.splice(t,1),this.Ue(),!0)}delete(t){return this.remove(t)}removeAt(t){Ht,Kt.r(t,O,"removeAt:i");var e=this.h;(t<0||t>=e.length)&&Kt.G(t,"0 <= i < length",O,"removeAt:i"),this.f&&Kt.O(this,t),t===e.length-1?e.pop():e.splice(t,1),this.Ue()}removeRange(i,s){Ht,Kt.r(i,O,"removeRange:from"),Kt.r(s,O,"removeRange:to");var n=this.h,a=n.length;if(i<0)i=0;else if(a<=i)return this;if(!(s<0||(s=a<=s?a-1:s)i.add(e(t))),i.iterator}filter(e){const i=new O;return this.Lo.k.forEach(t=>{e(t)&&i.add(t)}),i.iterator}get count(){return this.Lo.count}kl(){this.key=null,this.value=null,this.ri=null}toString(){return"SetIterator"}}class N{f;k;constructor(t){this.f=!1,this.k=new Set,void 0!==t&&this.addAll(t)}[Symbol.iterator](){return this.k.values()}values(){return this.k.values()}w(){return this.f=!0,this}ut(){return this.f=!1,this}toString(){return"Set()#"+N.ps(this)}add(t){return null===t||this.k.add(t),this}addAll(e){if(null!==e)if(Array.isArray(e)){var i=e.length;for(let t=0;te.add(t)),e}toArray(){return Array.from(this.k)}toList(){const e=new O;return this.k.forEach(t=>e.add(t)),e}get count(){return this.k.size}get size(){return this.k.size}get iterator(){return this.k.size<=0?o.instance:new g(this)}entries(){return this.k.entries()}keys(){return this.k.keys()}forEach(t,e){return this.k.forEach(t,e)}static fu=1;static ji(t){t.__gohashid=N.fu++}static ps(t){return t.__gohashid}}class f{et;ri;constructor(t){this.et=t,this.ri=t.k.keys()}[Symbol.iterator](){return this.et.k.keys()}key;value;get iterator(){return this}reset(){var t=this.et;this.ri=t.k.keys()}next(){var t=this.ri.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return 0===this.et.k.size?null:(this.ri=this.et.k.keys(),this.ri.next().value)}any(t){for(const e of this.et.k)if(t(e[0]))return!0;return!1}all(t){for(const e of this.et.k)if(!t(e[0]))return!1;return!0}each(t){for(const e of this.et.k)t(e[0]);return this}map(t){var e=this.et,i=new O;for(const s of e.k)i.add(t(s[0]));return i.iterator}filter(t){var e=this.et,i=new O;for(const n of e.k){var s=n[0];t(s)&&i.add(s)}return i.iterator}get count(){return this.et.size}kl(){this.key=null,this.value=null,this.ri=null}toString(){return"MapKeySetIterator"}}class p extends N{et;constructor(t){super(),N.ji(this),this.f=!0,this.et=t}[Symbol.iterator](){return this.k.keys()}values(){return this.k.keys()}w(){return this}ut(){return this}toString(){return"MapKeySet("+this.et.toString()+")"}add(t){Kt.n("This Set is read-only: "+this.toString())}has(t){return this.et.contains(t)}contains(t){return this.has(t)}delete(t){Kt.n("This Set is read-only: "+this.toString())}remove(t){return this.delete(t)}clear(){Kt.n("This Set is read-only: "+this.toString())}first(){return 0===this.et.k.size?null:this.et.k.keys().next().value}any(t){for(const e of this.et.k)if(t(e[0]))return!0;return!1}all(t){for(const e of this.et.k)if(!t(e[0]))return!1;return!0}each(t){for(const e of this.et.k)t(e[0]);return this}map(t){var e=new N;for(const i of this.et.k)e.add(t(i[0]));return e}filter(t){var e=new N;for(const s of this.et.k){var i=s[0];t(i)&&e.add(i)}return e}copy(){return new p(this.et)}toSet(){var t=new N;for(const e of this.et.k)t.add(e[0]);return t}toArray(){var t=this.et.k,e=new Array(t.size);let i=0;for(const s of t)e[i]=s[0],i++;return e}toList(){var t=new O;for(const e of this.et.k)t.add(e[0]);return t}get count(){return this.et.size}get size(){return this.et.size}get iterator(){return this.et.size<=0?o.instance:new f(this.et)}}class x{et;ri;constructor(t){this.et=t,this.ri=t.k.values()}[Symbol.iterator](){return this.et.k.values()}key;value;get iterator(){return this}reset(){var t=this.et;this.ri=t.k.values()}next(){var t=this.ri.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return 0===this.et.k.size?null:(this.ri=this.et.k.values(),this.ri.next().value)}any(t){for(const e of this.et.k)if(t(e[1]))return!0;return!1}all(t){for(const e of this.et.k)if(!t(e[1]))return!1;return!0}each(t){for(const e of this.et.k)t(e[1]);return this}map(t){var e=this.et,i=new O;for(const s of e.k)i.add(t(s[1]));return i.iterator}filter(t){var e=this.et,i=new O;for(const n of e.k){var s=n[1];t(s)&&i.add(s)}return i.iterator}get count(){return this.et.size}kl(){this.key=null,this.value=null,this.ri=null}toString(){return"MapValueSetIterator"}}class T{constructor(t,e){this.key=t,this.value=e}toString(){return"{"+this.key+":"+this.value+"}"}key;value}class w{et;ri;constructor(t){this.et=t,this.ri=t.k.entries()}[Symbol.iterator](){return this.et.k.entries()}key;value;get iterator(){return this}reset(){var t=this.et;this.ri=t.k.entries()}next(){var t=this.ri.next();return t.done?(this.key=null,this.value=null,!1):(this.key=t.value[0],this.value=t.value[1],!0)}hasNext(){return this.next()}first(){if(0===this.et.k.size)return null;this.ri=this.et.k.entries();var t=this.ri.next().value;return this.key=t[0],this.value=t[1],new T(t[0],t[1])}any(t){return this.et.any(t)}all(t){return this.et.all(t)}each(t){return this.et.each(t),this}map(i){const s=new O;let n=null;return this.et.k.forEach((t,e)=>{null===n?n=new T(e,t):(n.key=e,n.value=t),s.add(i(n))}),s.iterator}filter(i){const s=new O;let n=null;return this.et.k.forEach((t,e)=>{null===n?n=new T(e,t):(n.key=e,n.value=t),i(n)&&(s.add(n),n=null)}),s.iterator}get count(){return this.et.size}kl(){this.key=null,this.value=null,this.ri=null}toString(){return"MapIterator"}}class L{f;k;constructor(t){N.ji(this),this.f=!1,this.k=new Map,void 0!==t&&this.addAll(t)}[Symbol.iterator](){return this.k.entries()}entries(){return this.k.entries()}w(){return this.f=!0,this}ut(){return this.f=!1,this}toString(){return"Map()#"+N.ps(this)}set(t,e){return this.f&&Kt.O(this,t),this.k.set(t,e),this}add(t,e){return this.set(t,e)}addAll(e){if(null!==e)if(this.f&&Kt.O(this),Array.isArray(e)){var i=e.length;for(let t=0;tt.x.toFixed(e)+" "+t.y.toFixed(e)}toString(){return"Point("+this.x+","+this.y+")"}equals(t){return t instanceof _&&this.S===t.x&&this.P===t.y}equalTo(t,e){return this.S===t&&this.P===e}equalsApprox(t){return z.p(this.S,t.x)&&z.p(this.P,t.y)}add(t){return Ht,Kt.s(t,_,_,"add:p"),this.st(),this.S+=t.x,this.P+=t.y,this}subtract(t){return Ht,Kt.s(t,_,_,"subtract:p"),this.st(),this.S-=t.x,this.P-=t.y,this}offset(t,e){return Ht,Kt.r(t,_,"offset:dx"),Kt.r(e,_,"offset:dy"),this.st(),this.S+=t,this.P+=e,this}rotate(i){if(Ht,Kt.r(i,_,"rotate:angle"),this.st(),0!==i){var s=this.S,n=this.P;if(0!==s||0!==n){let t=0,e=0;360<=i?i-=360:i<0&&(i+=360),e=90===i?(t=0,1):180===i?(t=-1,0):270===i?(t=0,-1):(i=i*Math.PI/180,t=Math.cos(i),Math.sin(i)),this.S=t*s-e*n,this.P=e*s+t*n}}return this}scale(t,e){return Ht,Kt.r(t,_,"scale:sx"),Kt.r(e,_,"scale:sy"),this.st(),this.S*=t,this.P*=e,this}distanceSquaredPoint(t){Ht,Kt.s(t,_,_,"distanceSquaredPoint:p");var e=t.x-this.S,t=t.y-this.P;return e*e+t*t}distanceSquared(t,e){Ht,Kt.r(t,_,"distanceSquared:px"),Kt.r(e,_,"distanceSquared:py");t-=this.S,e-=this.P;return t*t+e*e}normalize(){Ht,this.st();var t=this.S,e=this.P,i=Math.sqrt(t*t+e*e);return 0= 0",Yt,"setTo:w"),e<0&&Kt.G(e,">= 0",Yt,"setTo:h"),this.st(),this.J=t,this.Z=e,this}set(t){return Ht,Kt.s(t,Yt,Yt,"set:s"),this.st(),this.J=t.J,this.Z=t.Z,this}copy(){var t=new Yt;return t.J=this.J,t.Z=this.Z,t}rt(){return this.f=!0,Object.freeze(this),this}L(){return this.f||Object.isFrozen(this)?this:this.copy().w()}w(){return this.f=!0,this}ut(){return Object.isFrozen(this)&&Kt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Ht,this.f){let t="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),Kt.n(t)}}static parse(s){if("string"!=typeof s)return new Yt;{var n=s.split(" ");let t=0,e=0;for(;""===n[t];)t++;s=n[t++];s&&(e=parseFloat(s));let i=0;for(;""===n[t];)t++;return(s=n[t++])&&(i=parseFloat(s)),new Yt(e,i)}}static stringify(t){return Ht,Kt.s(t,Yt),t.width.toString()+" "+t.height.toString()}static stringifyFixed(e){return Kt.t(e,"number",Yt,"stringifyFixed:digits"),t=>t.width.toFixed(e)+" "+t.height.toFixed(e)}toString(){return"Size("+this.width+","+this.height+")"}equals(t){return t instanceof Yt&&this.J===t.width&&this.Z===t.height}equalTo(t,e){return this.J===t&&this.Z===e}equalsApprox(t){return z.p(this.J,t.width)&&z.p(this.Z,t.height)}inflate(t,e){Ht,Kt.r(t,Yt,"inflate:w"),Kt.r(e,Yt,"inflate:h");t=this.width+t,this.J=0<=t?t:0,t=this.height+e;return this.Z=0<=t?t:0,this}get width(){return this.J}set width(t){Ht,Kt.t(t,"number",Yt,"width"),this.st(t),t<0&&Kt.G(t,">= 0",Yt,"width"),this.J=t}get height(){return this.Z}set height(t){Ht,Kt.t(t,"number",Yt,"height"),this.st(t),t<0&&Kt.G(t,">= 0",Yt,"height"),this.Z=t}isReal(){return isFinite(this.width)&&isFinite(this.height)}static lf=new Yt(0,0).rt();static Bk=new Yt(1,1).rt();static nC=new Yt(6,6).rt();static du=new Yt(8,8).rt();static oC=new Yt(10,10).rt();static zk=new Yt(1/0,1/0).rt();static xw=new Yt(NaN,NaN).rt();static rC=[];static a(){var t=Yt.rC.pop();return void 0===t?new Yt:t}static o(t){Yt.rC.push(t)}}class Q{S;P;J;Z;f;constructor(t,e,i,s){var n,a,r,o;void 0===t?(this.S=0,this.P=0,this.J=0,this.Z=0):"number"==typeof t&&"number"==typeof e&&"number"==typeof i&&(0<=i||isNaN(i))&&"number"==typeof s&&(0<=s||isNaN(s))?(this.S=t,this.P=e,this.J=i,this.Z=s):t instanceof _?(n=t.x,a=t.y,e instanceof _?(r=e.x,o=e.y,this.S=Math.min(n,r),this.P=Math.min(a,o),this.J=Math.abs(n-r),this.Z=Math.abs(a-o)):e instanceof Yt?(this.S=n,this.P=a,this.J=e.width,this.Z=e.height):Kt.n("Incorrect second argument supplied to Rect constructor "+e)):Kt.n("Invalid arguments to Rect constructor: "+t+", "+e+", "+i+", "+s),this.f=!1}c(t){return this.S=t.S,this.P=t.P,this.J=t.J,this.Z=t.Z,this}e(t,e,i,s){return this.S=t,this.P=e,this.J=i,this.Z=s,this}Do(t,e){return this.J=t,this.Z=e,this}setTo(t,e,i,s){return Ht,Kt.t(t,"number",Q,"setTo:x"),Kt.t(e,"number",Q,"setTo:y"),Kt.t(i,"number",Q,"setTo:w"),Kt.t(s,"number",Q,"setTo:h"),i<0&&Kt.G(i,">= 0",Q,"setTo:w"),s<0&&Kt.G(s,">= 0",Q,"setTo:h"),this.st(),this.S=t,this.P=e,this.J=i,this.Z=s,this}set(t){return Ht,Kt.s(t,Q,Q,"set:r"),this.st(),this.S=t.S,this.P=t.P,this.J=t.J,this.Z=t.Z,this}setPoint(t){return Ht,Kt.s(t,_,Q,"setPoint:p"),this.st(),this.S=t.x,this.P=t.y,this}setSize(t){return Ht,Kt.s(t,Yt,Q,"setSize:s"),this.st(),this.J=t.width,this.Z=t.height,this}copy(){var t=new Q;return t.S=this.S,t.P=this.P,t.J=this.J,t.Z=this.Z,t}rt(){return this.f=!0,Object.freeze(this),this}L(){return this.f||Object.isFrozen(this)?this:this.copy().w()}w(){return this.f=!0,this}ut(){return Object.isFrozen(this)&&Kt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Ht,this.f){let t="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),Kt.n(t)}}static parse(a){if("string"!=typeof a)return new Q;{var r=a.split(" ");let t=0,e=0;for(;""===r[t];)t++;a=r[t++];a&&(e=parseFloat(a));let i=0;for(;""===r[t];)t++;(a=r[t++])&&(i=parseFloat(a));let s=0;for(;""===r[t];)t++;(a=r[t++])&&(s=parseFloat(a));let n=0;for(;""===r[t];)t++;return(a=r[t++])&&(n=parseFloat(a)),new Q(e,i,s,n)}}static stringify(t){return Ht,Kt.s(t,Q),t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString()}static stringifyFixed(e){return Kt.t(e,"number",Q,"stringifyFixed:digits"),t=>t.x.toFixed(e)+" "+t.y.toFixed(e)+" "+t.width.toFixed(e)+" "+t.height.toFixed(e)}toString(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"}equals(t){return t instanceof Q&&this.S===t.x&&this.P===t.y&&this.J===t.width&&this.Z===t.height}equalTo(t,e,i,s){return this.S===t&&this.P===e&&this.J===i&&this.Z===s}equalsApprox(t){return z.p(this.S,t.x)&&z.p(this.P,t.y)&&z.p(this.J,t.width)&&z.p(this.Z,t.height)}equalsApproxTo(t,e,i,s){return z.p(this.S,t)&&z.p(this.P,e)&&z.p(this.J,i)&&z.p(this.Z,s)}equalsApproxClose(t){return z.q(this.S,t.x)&&z.q(this.P,t.y)&&z.q(this.J,t.width)&&z.q(this.Z,t.height)}containsPoint(t){return Ht,Kt.s(t,_,Q,"containsPoint:p"),this.S<=t.x&&this.S+this.J>=t.x&&this.P<=t.y&&this.P+this.Z>=t.y}containsRect(t){return Ht,Kt.s(t,Q,Q,"containsRect:r"),this.S<=t.x&&t.x+t.width<=this.S+this.J&&this.P<=t.y&&t.y+t.height<=this.P+this.Z}contains(t,e,i,s){return Ht,Kt.r(t,Q,"contains:x"),Kt.r(e,Q,"contains:y"),void 0===i?i=0:Kt.r(i,Q,"contains:w"),void 0===s?s=0:Kt.r(s,Q,"contains:h"),(i<0||s<0)&&Kt.n("Rect.contains:Width and height cannot be negative"),this.S<=t&&t+i<=this.S+this.J&&this.P<=e&&e+s<=this.P+this.Z}offset(t,e){return Ht,Kt.r(t,Q,"offset:dx"),Kt.r(e,Q,"offset:dy"),this.st(),this.S+=t,this.P+=e,this}inflate(t,e){return Ht,Kt.r(t,Q,"inflate:w"),Kt.r(e,Q,"inflate:h"),this.bw(e,t,e,t)}addMargin(t){return Ht,Kt.s(t,I,Q,"addMargin:m"),this.bw(t.top,t.right,t.bottom,t.left)}subtractMargin(t){return Ht,Kt.s(t,I,Q,"subtractMargin:m"),this.bw(-t.top,-t.right,-t.bottom,-t.left)}grow(t,e,i,s){return Ht,Kt.r(t,Q,"grow:t"),Kt.r(e,Q,"grow:r"),Kt.r(i,Q,"grow:b"),Kt.r(s,Q,"grow:l"),this.bw(t,e,i,s)}bw(t,e,i,s){Ht,this.st();var n=this.J,n=(e+s<=-n?(this.S+=n/2,this.J=0):(this.S-=s,this.J+=e+s),this.Z);return t+i<=-n?(this.P+=n/2,this.Z=0):(this.P-=t,this.Z+=t+i),this}intersectRect(t){return Ht,Kt.s(t,Q,Q,"intersectRect:r"),this.lC(t.x,t.y,t.width,t.height)}intersect(t,e,i,s){return(Ht,Kt.r(t,Q,"intersect:x"),Kt.r(e,Q,"intersect:y"),Kt.r(i,Q,"intersect:w"),Kt.r(s,Q,"intersect:h"),i<0||s<0)&&Kt.n("Rect.intersect:Width and height cannot be negative"),this.lC(t,e,i,s)}lC(t,e,i,s){Ht,this.st();var n=Math.max(this.S,t),a=Math.max(this.P,e),t=Math.min(this.S+this.J,t+i),i=Math.min(this.P+this.Z,e+s);return this.S=n,this.P=a,this.J=Math.max(0,t-n),this.Z=Math.max(0,i-a),this}intersectsRect(t){return Ht,Kt.s(t,Q,Q,"intersectsRect:r"),this.intersects(t.x,t.y,t.width,t.height)}intersects(t,e,i,s){(Ht,Kt.r(t,Q,"intersects:x"),Kt.r(e,Q,"intersects:y"),Kt.r(t,Q,"intersects:w"),Kt.r(e,Q,"intersects:h"),i<0||s<0)&&Kt.n("Rect.intersects:Width and height cannot be negative");var n=this.J,a=this.S;return!(n!==1/0&&i!==1/0&&(n+=a,i+=t,isNaN(i)||isNaN(n)||i= 0",Q,"width"),this.J=t}get height(){return this.Z}set height(t){Ht,Kt.t(t,"number",Q,"height"),this.st(t),t<0&&Kt.G(t,">= 0",Q,"height"),this.Z=t}get left(){return this.S}set left(t){Ht,Kt.t(t,"number",Q,"left"),this.st(t),this.S=t}get top(){return this.P}set top(t){Ht,Kt.t(t,"number",Q,"top"),this.st(t),this.P=t}get right(){return this.S+this.J}set right(t){Ht,Kt.r(t,Q,"right"),this.st(t),this.S+=t-(this.S+this.J)}get bottom(){return this.P+this.Z}set bottom(t){Ht,Kt.r(t,Q,"top"),this.st(t),this.P+=t-(this.P+this.Z)}get position(){return new _(this.S,this.P)}set position(t){Ht,Kt.s(t,_,Q,"position"),this.st(t),this.S=t.x,this.P=t.y}get size(){return new Yt(this.J,this.Z)}set size(t){Ht,Kt.s(t,Yt,Q,"size"),this.st(t),this.J=t.width,this.Z=t.height}get center(){return new _(this.S+this.J/2,this.P+this.Z/2)}set center(t){Ht,Kt.s(t,_,Q,"center"),this.st(t),this.S=t.x-this.J/2,this.P=t.y-this.Z/2}get centerX(){return this.S+this.J/2}set centerX(t){Ht,Kt.r(t,Q,"centerX"),this.st(t),this.S=t-this.J/2}get centerY(){return this.P+this.Z/2}set centerY(t){Ht,Kt.r(t,Q,"centerY"),this.st(t),this.P=t-this.Z/2}isReal(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)}isEmpty(){return 0===this.width&&0===this.height}static Xk=new Q(0,0,0,0).rt();static RD=new Q(NaN,NaN,NaN,NaN).rt();static Yk=[];static a(){var t=Q.Yk.pop();return void 0===t?new Q:t}static H(t,e,i,s){var n=Q.Yk.pop();return void 0===n?new Q(t,e,i,s):n.e(t,e,i,s)}static o(t){Q.Yk.push(t)}}class I{fn;cn;un;dn;f;constructor(t,e,i,s){void 0===t?(this.fn=0,this.cn=0,this.un=0,this.dn=0):void 0===e?(this.top=s=i=e=t,this.right=e,this.bottom=i,this.left=s):void 0===i?(s=e,this.top=i=t,this.right=e,this.bottom=i,this.left=s):void 0!==s?(this.top=t,this.right=e,this.bottom=i,this.left=s):Kt.n("Invalid arguments to Margin constructor: "+t+", "+e+", "+i+", "+s),this.f=!1}c(t){return this.fn=t.fn,this.cn=t.cn,this.un=t.un,this.dn=t.dn,this}setTo(t,e,i,s){return Ht,Kt.t(t,"number",I,"setTo:t"),Kt.t(e,"number",I,"setTo:r"),Kt.t(i,"number",I,"setTo:b"),Kt.t(s,"number",I,"setTo:l"),this.st(),this.fn=t,this.cn=e,this.un=i,this.dn=s,this}set(t){return Ht,Kt.s(t,I,I,"assign:m"),this.st(),this.fn=t.fn,this.cn=t.cn,this.un=t.un,this.dn=t.dn,this}copy(){var t=new I;return t.fn=this.fn,t.cn=this.cn,t.un=this.un,t.dn=this.dn,t}rt(){return this.f=!0,Object.freeze(this),this}L(){return this.f||Object.isFrozen(this)?this:this.copy().w()}w(){return this.f=!0,this}ut(){return Object.isFrozen(this)&&Kt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Ht,this.f){let t="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),Kt.n(t)}}static parse(a){if("string"!=typeof a)return new I;{var r=a.split(" ");let t=0,e=NaN;for(;""===r[t];)t++;a=r[t++];if(a&&(e=parseFloat(a)),isNaN(e))return new I;let i=NaN;for(;""===r[t];)t++;if((a=r[t++])&&(i=parseFloat(a)),isNaN(i))return new I(e);let s=NaN;for(;""===r[t];)t++;if((a=r[t++])&&(s=parseFloat(a)),isNaN(s))return new I(e,i);let n=NaN;for(;""===r[t];)t++;return(a=r[t++])&&(n=parseFloat(a)),isNaN(n)?new I(e,i):new I(e,i,s,n)}}static stringify(t){return Ht,Kt.s(t,I),t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}static stringifyFixed(e){return Kt.t(e,"number",I,"stringifyFixed:digits"),t=>t.top.toFixed(e)+" "+t.right.toFixed(e)+" "+t.bottom.toFixed(e)+" "+t.left.toFixed(e)}toString(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"}equals(t){return t instanceof I&&this.fn===t.top&&this.cn===t.right&&this.un===t.bottom&&this.dn===t.left}equalTo(t,e,i,s){return this.fn===t&&this.cn===e&&this.un===i&&this.dn===s}equalsApprox(t){return z.p(this.fn,t.top)&&z.p(this.cn,t.right)&&z.p(this.un,t.bottom)&&z.p(this.dn,t.left)}get top(){return this.fn}set top(t){Ht,Kt.r(t,I,"top"),this.st(t),this.fn=t}get right(){return this.cn}set right(t){Ht,Kt.r(t,I,"right"),this.st(t),this.cn=t}get bottom(){return this.un}set bottom(t){Ht,Kt.r(t,I,"bottom"),this.st(t),this.un=t}get left(){return this.dn}set left(t){Ht,Kt.r(t,I,"left"),this.st(t),this.dn=t}isReal(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)}static qg=new I(0,0,0,0).rt();static aC=new I(2,2,2,2).rt();static fC=[];static a(){var t=I.fC.pop();return void 0===t?new I:t}static o(t){I.fC.push(t)}}class Z{S;P;Vs;Bs;f;constructor(t,e,i,s){void 0===t?(this.S=0,this.P=0,this.Vs=0,this.Bs=0):(void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.offsetX=i,this.offsetY=s),this.f=!1}c(t){return this.S=t.S,this.P=t.P,this.Vs=t.Vs,this.Bs=t.Bs,this}setTo(t,e,i,s){return Ht,this.kw(t,"setTo:x"),this.kw(e,"setTo:y"),this.Sw(i,"setTo:offx"),this.Sw(s,"setTo:offy"),this.st(),this.S=t,this.P=e,this.Vs=i,this.Bs=s,this}set(t){return Ht,Kt.s(t,Z,Z,"set:s"),this.st(),this.S=t.S,this.P=t.P,this.Vs=t.Vs,this.Bs=t.Bs,this}copy(){var t=new Z;return t.S=this.S,t.P=this.P,t.Vs=this.Vs,t.Bs=this.Bs,t}rt(){return this.f=!0,Object.freeze(this),this}L(){return this.f||Object.isFrozen(this)?this:this.copy().w()}w(){return this.f=!0,this}ut(){return Object.isFrozen(this)&&Kt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Ht,this.f){let t="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),Kt.n(t)}}He(t){return this.S=NaN,this.P=NaN,this.Vs=t,this}kw(t,e){(isNaN(t)||1t.x.toFixed(e)+" "+t.y.toFixed(e)+" "+t.offsetX.toFixed(e)+" "+t.offsetY.toFixed(e)}toString(){return this.isSpot()?0===this.Vs&&0===this.Bs?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.equals(Z.None)?"None":this.equals(Z.TopLeft)?"TopLeft":this.equals(Z.TopCenter)?"Top":this.equals(Z.TopRight)?"TopRight":this.equals(Z.LeftCenter)?"Left":this.equals(Z.Center)?"Center":this.equals(Z.RightCenter)?"Right":this.equals(Z.BottomLeft)?"BottomLeft":this.equals(Z.BottomCenter)?"Bottom":this.equals(Z.BottomRight)?"BottomRight":this.equals(Z.TopSide)?"TopSide":this.equals(Z.LeftSide)?"LeftSide":this.equals(Z.RightSide)?"RightSide":this.equals(Z.BottomSide)?"BottomSide":this.equals(Z.TopBottomSides)?"TopBottomSides":this.equals(Z.LeftRightSides)?"LeftRightSides":this.equals(Z.TopLeftSides)?"TopLeftSides":this.equals(Z.TopRightSides)?"TopRightSides":this.equals(Z.BottomLeftSides)?"BottomLeftSides":this.equals(Z.BottomRightSides)?"BottomRightSides":this.equals(Z.NotTopSide)?"NotTopSide":this.equals(Z.NotLeftSide)?"NotLeftSide":this.equals(Z.NotRightSide)?"NotRightSide":this.equals(Z.NotBottomSide)?"NotBottomSide":this.equals(Z.AllSides)?"AllSides":this.equals(Z.Default)?"Default":"None"}equals(t){return t instanceof Z&&(this.S===t.x||isNaN(this.S)&&isNaN(t.x))&&(this.P===t.y||isNaN(this.P)&&isNaN(t.y))&&this.Vs===t.offsetX&&this.Bs===t.offsetY}opposite(){return new Z(.5-(this.S-.5),.5-(this.P-.5),-this.Vs,-this.Bs)}includesSide(t){if(!this.isSide())return!1;if(!t.isSide())if(t.equals(Z.Left))t=Z.LeftSide;else if(t.equals(Z.Right))t=Z.RightSide;else if(t.equals(Z.Top))t=Z.TopSide;else{if(!t.equals(Z.Bottom))return!1;t=Z.BottomSide}var e=this.Bs,t=t.offsetY;return(e&t)===t}get x(){return this.S}set x(t){Ht,this.kw(t,"x"),this.st(t),this.S=t}get y(){return this.P}set y(t){Ht,this.kw(t,"y"),this.st(t),this.P=t}get offsetX(){return this.Vs}set offsetX(t){Ht,this.Sw(t,"offsetX"),this.st(t),this.Vs=t}get offsetY(){return this.Bs}set offsetY(t){Ht,this.Sw(t,"offsetY"),this.st(t),this.Bs=t}isSpot(){return!isNaN(this.x)&&!isNaN(this.y)}isNoSpot(){return isNaN(this.x)||isNaN(this.y)}isSide(){return isNaN(this.x)&&isNaN(this.y)&&1===this.offsetX&&0!==this.offsetY}isNone(){return isNaN(this.x)&&isNaN(this.y)&&0===this.offsetX&&0===this.offsetY}isDefault(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY}static None=new Z(0,0,0,0).He(0).rt();static Default=new Z(0,0,-1,0).He(-1).rt();static TopLeft=new Z(0,0,0,0).rt();static TopCenter=new Z(.5,0,0,0).rt();static TopRight=new Z(1,0,0,0).rt();static LeftCenter=new Z(0,.5,0,0).rt();static Center=new Z(.5,.5,0,0).rt();static RightCenter=new Z(1,.5,0,0).rt();static BottomLeft=new Z(0,1,0,0).rt();static BottomCenter=new Z(.5,1,0,0).rt();static BottomRight=new Z(1,1,0,0).rt();static MiddleTop=Z.TopCenter;static MiddleLeft=Z.LeftCenter;static MiddleRight=Z.RightCenter;static MiddleBottom=Z.BottomCenter;static Top=Z.TopCenter;static Left=Z.LeftCenter;static Right=Z.RightCenter;static Bottom=Z.BottomCenter;static TopSide=new Z(0,0,1,1).He(1).rt();static LeftSide=new Z(0,0,1,2).He(1).rt();static RightSide=new Z(0,0,1,4).He(1).rt();static BottomSide=new Z(0,0,1,8).He(1).rt();static TopBottomSides=new Z(0,0,1,9).He(1).rt();static LeftRightSides=new Z(0,0,1,6).He(1).rt();static TopLeftSides=new Z(0,0,1,3).He(1).rt();static TopRightSides=new Z(0,0,1,5).He(1).rt();static BottomLeftSides=new Z(0,0,1,10).He(1).rt();static BottomRightSides=new Z(0,0,1,12).He(1).rt();static NotTopSide=new Z(0,0,1,14).He(1).rt();static NotLeftSide=new Z(0,0,1,13).He(1).rt();static NotRightSide=new Z(0,0,1,11).He(1).rt();static NotBottomSide=new Z(0,0,1,7).He(1).rt();static AllSides=new Z(0,0,1,15).He(1).rt();static Kk=new Z(.156,.156).rt();static Uk=new Z(.844,.844).rt();static cC=[];static a(){var t=Z.cC.pop();return void 0===t?new Z:t}static o(t){Z.cC.push(t)}}class V{m11;m12;m21;m22;dx;dy;constructor(){this.m11=1,this.m12=0,this.m21=0,this.m22=1,this.dx=0,this.dy=0}set(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}setTo(t,e,i,s,n,a){return this.m11=t,this.m12=e,this.m21=i,this.m22=s,this.dx=n,this.dy=a,this}copy(){var t=new V;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}toString(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}equals(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}Gk(){return 0===this.dx&&0===this.dy&&1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22}ti(){return this.m11=1,this.m12=0,this.m21=0,this.m22=1,this.dx=0,this.dy=0,this}hf(t){var e=this.m11*t.m11+this.m21*t.m12,i=this.m12*t.m11+this.m22*t.m12,s=this.m11*t.m21+this.m21*t.m22,n=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=s,this.m22=n,this}uC(t){var e=1/(t.m11*t.m22-t.m12*t.m21),i=t.m22*e,s=-t.m12*e,n=-t.m21*e,a=t.m11*e,r=e*(t.m21*t.dy-t.m22*t.dx),e=e*(t.m12*t.dx-t.m11*t.dy),t=this.m11*i+this.m21*s,i=this.m12*i+this.m22*s,s=this.m11*n+this.m21*a,n=this.m12*n+this.m22*a;return this.dx=this.m11*r+this.m21*e+this.dx,this.dy=this.m12*r+this.m22*e+this.dy,this.m11=t,this.m12=i,this.m21=s,this.m22=n,this}Mw(){var t=1/(this.m11*this.m22-this.m12*this.m21),e=this.m22*t,i=-this.m12*t,s=-this.m21*t,n=this.m11*t,a=t*(this.m21*this.dy-this.m22*this.dx),t=t*(this.m12*this.dx-this.m11*this.dy);return this.m11=e,this.m12=i,this.m21=s,this.m22=n,this.dx=a,this.dy=t,this}ys(i,s,n){if(360<=i?i-=360:i<0&&(i+=360),0!==i){this.se(s,n);let t=0,e=0;e=90===i?(t=0,1):180===i?(t=-1,0):270===i?(t=0,-1):(i=i*Math.PI/180,t=Math.cos(i),Math.sin(i));var i=this.m11*t+this.m21*e,a=this.m12*t+this.m22*e,r=this.m11*-e+this.m21*t,o=this.m12*-e+this.m22*t;this.m11=i,this.m12=a,this.m21=r,this.m22=o,this.se(-s,-n)}return this}se(t,e){return this.dx+=this.m11*t+this.m21*e,this.dy+=this.m12*t+this.m22*e,this}v(t,e){return void 0===e&&(e=t),this.m11*=t,this.m12*=t,this.m21*=e,this.m22*=e,this}ID(){if(1===this.m11&&0===this.m12)return 0;let t=180*Math.atan2(this.m12,this.m11)/Math.PI;return t<0&&(t+=360),t}Pt(t){var e=t.x,i=t.y;return t.e(e*this.m11+i*this.m21+this.dx,e*this.m12+i*this.m22+this.dy)}rs(t){var e=1/(this.m11*this.m22-this.m12*this.m21),i=this.m22*e,s=-this.m12*e,n=-this.m21*e,a=this.m11*e,r=e*(this.m21*this.dy-this.m22*this.dx),e=e*(this.m12*this.dx-this.m11*this.dy),o=t.x,l=t.y;return t.e(o*i+l*n+r,o*s+l*a+e)}Pw(t){var e=1/(this.m11*this.m22-this.m12*this.m21),i=this.m22*e,s=-this.m12*e,n=-this.m21*e,a=this.m11*e,r=e*(this.m21*this.dy-this.m22*this.dx),e=e*(this.m12*this.dx-this.m11*this.dy),o=1.25*t.x,l=1.2*t.y;return t.e(o*i+l*n+r,o*s+l*a+e)}Nw(t){var e=t.x,i=t.y,s=e+t.width,n=i+t.height,a=this.m11,r=this.m12,o=this.m21,l=this.m22,h=this.dx,u=this.dy,d=e*a+i*o+h,c=e*r+i*l+u,g=s*a+i*o+h,i=s*r+i*l+u,m=e*a+n*o+h,e=e*r+n*l+u,a=s*a+n*o+h,o=s*r+n*l+u,h=d,s=c,r=c,n=Math.min(d,g),h=Math.max(h,g),s=Math.min(s,i),r=Math.max(r,i);return n=Math.min(n,m),h=Math.max(h,m),s=Math.min(s,e),r=Math.max(r,e),n=Math.min(n,a),h=Math.max(h,a),s=Math.min(s,o),r=Math.max(r,o),t.e(n,s,h-n,r-s),t}static dC=[];static a(){var t=V.dC.pop();return void 0===t?new V:t}static o(t){V.dC.push(t)}static Hk="54a702f3e53909c447824c6706603faf4c"}const z={OD:"7da71ca0ad381e90",Gn:(Math.sqrt(2)-1)/3*4,gC:null,Cw:t=>{if(t<=0)return 0;let e=z.gC;if(null===e){e=[];for(let t=0;t<=2e3;t++)e[t]=Math.sqrt(t);z.gC=e}var i;return t<1?(i=1/t)<=2e3?1/e[0|i]:Math.sqrt(t):t<=2e3?e[0|t]:Math.sqrt(t)},p:(t,e)=>{t-=e;return t<.5&&-.5{t-=e;return t<5e-8&&-5e-8{n<=0&&(n=1e-6);let o=0,l=0,h=0,u=0;if(o=t{var c,g,m,f,p,v;return z.zi(t,e,r,o,d,i,s)&&z.zi(t,e,r,o,d,n,a)?z.zi(t,e,r,o,d,h,u):(p=((m=((c=(t+i)/2)+(i=(i+n)/2))/2)+(n=(i+(i=(n+r)/2))/2))/2,v=((f=((g=(e+s)/2)+(s=(s+a)/2))/2)+(a=(s+(s=(a+o)/2))/2))/2,z.Aw(t,e,c,g,m,f,p,v,l,h,u,d)||z.Aw(p,v,n,a,i,s,r,o,l,h,u,d))},mC:(t,e,i,s,n,a,r,o,l)=>{var h=(i+n)/2,u=(s+a)/2;return l.e((((t+i)/2+h)/2+(h+(n+r)/2)/2)/2,(((e+s)/2+u)/2+(u+(a+o)/2)/2)/2),l},ED:(t,e,i,s,n,a,r,o)=>{var l=(i+n)/2,h=(s+a)/2,t=((t+i)/2+l)/2,i=((e+s)/2+h)/2,e=(l+(n+r)/2)/2,s=(h+(a+o)/2)/2;return _.direction(t,i,e,s)},gu:(t,e,i,s,n,a,r,o,l,h)=>{var u,d,c,g,m,f;return z.zi(t,e,r,o,l,i,s)&&z.zi(t,e,r,o,l,n,a)?(h.unionNoCheck(t,e,0,0),h.unionNoCheck(r,o,0,0)):(m=((c=((u=(t+i)/2)+(i=(i+n)/2))/2)+(n=(i+(i=(n+r)/2))/2))/2,f=((g=((d=(e+s)/2)+(s=(s+a)/2))/2)+(a=(s+(s=(a+o)/2))/2))/2,z.gu(t,e,u,d,c,g,m,f,l,h),z.gu(m,f,n,a,i,s,r,o,l,h)),h},Hn:(t,e,i,s,n,a,r,o,l,h)=>{var u,d,c,g,m,f;return z.zi(t,e,r,o,l,i,s)&&z.zi(t,e,r,o,l,n,a)?(0===h.length&&(h.push(t),h.push(e)),h.push(r),h.push(o)):(m=((c=((u=(t+i)/2)+(i=(i+n)/2))/2)+(n=(i+(i=(n+r)/2))/2))/2,f=((g=((d=(e+s)/2)+(s=(s+a)/2))/2)+(a=(s+(s=(a+o)/2))/2))/2,z.Hn(t,e,u,d,c,g,m,f,l,h),z.Hn(m,f,n,a,i,s,r,o,l,h)),h},vk:(t,e,i,s,n,a,r,o,l,h)=>{var u,d,c,g;return z.zi(t,e,n,a,h,i,s)?z.zi(t,e,n,a,h,o,l):(c=((u=(t+i)/2)+(i=(i+n)/2))/2,g=((d=(e+s)/2)+(s=(s+a)/2))/2,z.vk(t,e,u,d,c,g,r,o,l,h)||z.vk(c,g,i,s,n,a,r,o,l,h))},eE:(t,e,i,s,n,a,r)=>{return r.e(((t+i)/2+(i+n)/2)/2,((e+s)/2+(s+a)/2)/2),r},qk:(t,e,i,s,n,a,r,o)=>{var l,h,u,d;return z.zi(t,e,n,a,r,i,s)?(o.unionNoCheck(t,e,0,0),o.unionNoCheck(n,a,0,0)):(u=((l=(t+i)/2)+(i=(i+n)/2))/2,d=((h=(e+s)/2)+(s=(s+a)/2))/2,z.qk(t,e,l,h,u,d,r,o),z.qk(u,d,i,s,n,a,r,o)),o},Wg:(t,e,i,s,n,a,r,o)=>{var l,h,u,d;return z.zi(t,e,n,a,r,i,s)?(0===o.length&&(o.push(t),o.push(e)),o.push(n),o.push(a)):(u=((l=(t+i)/2)+(i=(i+n)/2))/2,d=((h=(e+s)/2)+(s=(s+a)/2))/2,z.Wg(t,e,l,h,u,d,r,o),z.Wg(u,d,i,s,n,a,r,o)),o},jg:(n,a,r,o,l,h,u,d,c,g,m,f,p,v)=>{if(z.zi(n,a,u,d,p,r,o)&&z.zi(n,a,u,d,p,l,h))return!!z.uu(n,a,u,d,c,g,m,f)&&0!=(y=(n-u)*(g-f)-(a-d)*(c-m))&&(v.e(((n*d-a*u)*(c-m)-(n-u)*(c*f-g*m))/y,((n*d-a*u)*(g-f)-(a-d)*(c*f-g*m))/y),!0);{var y=(n+r)/2,b=(a+o)/2,r=(r+l)/2,o=(o+h)/2,l=(l+u)/2,h=(h+d)/2,x=(y+r)/2,w=(b+o)/2,r=(r+l)/2,o=(o+h)/2,A=(x+r)/2,P=(w+o)/2;let t=1/0,e=!1,i=0,s=0;return z.jg(n,a,y,b,x,w,A,P,c,g,m,f,p,v)&&(n=(v.x-c)*(v.x-c)+(v.y-g)*(v.y-g)){let g=0;if(z.zi(i,s,r,o,c,t,e)&&z.zi(i,s,r,o,c,n,a)){var m=(i-r)*(h-d)-(s-o)*(l-u);if(0==m)return g;var f=((i*o-s*r)*(l-u)-(i-r)*(l*d-h*u))/m,p=((i*o-s*r)*(h-d)-(s-o)*(l*d-h*u))/m;if(u<=f)return g;let t=0,e=0;if((ue)return g}else if(e=ie)return g;0{if(z.q(i,n)){let t=0,e=0;e=se?(l.e(i,e),!1):(l.e(i,h),!0)}if(z.q(s,a)){let t=0,e=0;e=ie?(l.e(e,s),!1):(l.e(h,s),!0)}return(h=((i-r)*(i-n)+(s-o)*(s-a))/((n-i)*(n-i)+(a-s)*(a-s)))<-5e-6?(l.e(i,s),!1):1.000005{if(z.p(i,n)&&z.p(s,a))return h.e(i,s),!1;if(z.q(r,t))return z.q(i,n)?(z.Sl(i,s,n,a,r,o,h),!1):(u=(a-s)/(n-i)*(r-i)+s,z.Sl(i,s,n,a,r,u,h));var u=(l-o)/(t-r);if(z.q(i,n)){l=u*(i-r)+o;let t=0,e=0;return e=se?(h.e(i,e),!1):(h.e(i,l),!0)}t=(a-s)/(n-i);if(z.q(u,t))return z.Sl(i,s,n,a,r,o,h),!1;l=(t*i-u*r+o-s)/(t-u);if(z.q(t,0)){let t=0,e=0;return e=ie?(h.e(e,s),!1):(h.e(l,s),!0)}return r=t*(l-i)+s,z.Sl(i,s,n,a,l,r,h)},sE:(t,e,i,s,n)=>z.vn(i.x,i.y,s.x,s.y,t.x,t.y,e.x,e.y,n),nE:(s,n,t,e,i,a,r,o,l,h)=>{let u=1/0;function d(t,e){var i=(t-s)*(t-s)+(e-n)*(e-n);i{let h=1e21,u=t,d=e;var c;return z.vn(t,e,t,s,n,a,r,o,l)&&(c=(l.x-n)*(l.x-n)+(l.y-a)*(l.y-a))z.hC(t.x,t.y,t.width,t.height,e.x,e.y,i.x,i.y),hC:(t,e,i,s,n,a,r,o)=>{var l=t,h=t+i,u=e,d=e+s;if(n===r){let t=0,e=0;return e=a=u}if(a!==o)return!!(Q.contains(t,e,i,s,n,a)||Q.contains(t,e,i,s,r,o)||z.uu(l,u,h,u,n,a,r,o)||z.uu(h,u,h,d,n,a,r,o)||z.uu(h,d,l,d,n,a,r,o)||z.uu(l,d,l,u,n,a,r,o));{let t=0,e=0;return e=n=l}},uu:(t,e,i,s,n,a,r,o)=>t===i&&e===s&&n===r&&a===o?t===n&&e===a:z.cu(t,e,i,s,n,a)*z.cu(t,e,i,s,r,o)<=0&&z.cu(n,a,r,o,t,e)*z.cu(n,a,r,o,i,s)<=0,cu:(t,e,i,s,n,a)=>{i-=t,s-=e;let r=n-t,o=a-e,l=r*s-o*i;return l=0===l&&0<(l=r*i+o*s)&&(r-=i,o-=s,(l=r*i+o*s)<0)?0:l},Zg:t=>(t<0&&(t+=360),360<=t&&(t-=360),t),pC:(t,e,i,s,n,a)=>{var r=Math.PI,o=(a||(s*=r/180,n*=r/180),n{var a=(i-e)/2,r=t*Math.cos(a),o=t*Math.sin(a),l=r,h=-o,u=l*l+h*h,d=u+l*r+h*o,u=4/3*(Math.sqrt(2*u*d)-d)/(l*o-h*r),d=l-u*h,o=h+u*l,r=d,h=-o,u=a+e,l=Math.cos(u),a=Math.sin(u);return[s+t*Math.cos(e),n+t*Math.sin(e),s+d*l-o*a,n+d*a+o*l,s+r*l-h*a,n+r*a+h*l,s+t*Math.cos(i),n+t*Math.sin(i)]},vg:(t,e,i,s,n,a,r)=>{i=Math.floor((t-i)/n)*n+i,s=Math.floor((e-s)/a)*a+s;let o=i,l=(i+n-t{let i=Math.max(t,e),s=Math.min(t,e),n,a=1;for(;n=i%s,a=s,i=s,0<(s=n););return a},BD:(t,e,i,s)=>{var n=i<0,a=s<0;let r,o=0,l=0,h=void(l=t{let h=0;if(0t.toString(e)}ci(t){t in P?this.type=t:Kt.gr(this,t)}toString(i){void 0===i&&(i=-1);var t,s,n=t=>0===t?"0":t.toFixed(i);let a;switch(this.type){case 1:return i<0?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+n(this.startX)+" "+n(this.startY)+"L"+n(this.endX)+" "+n(this.endY);case 2:return(a=new Q(this.startX,this.startY,0,0)).union(this.endX,this.endY,0,0),i<0?"M"+a.x.toString()+" "+a.y.toString()+"H"+a.right.toString()+"V"+a.bottom.toString()+"H"+a.left.toString()+"z":"M"+n(a.x)+" "+n(a.y)+"H"+n(a.right)+"V"+n(a.bottom)+"H"+n(a.left)+"z";case 3:return(a=new Q(this.startX,this.startY,0,0)).union(this.endX,this.endY,0,0),i<0?(s=a.left.toString()+" "+(a.y+a.height/2).toString(),t=a.right.toString()+" "+(a.y+a.height/2).toString(),"M"+s+"A"+(a.width/2).toString()+" "+(a.height/2).toString()+" 0 0 1 "+t+"A"+(a.width/2).toString()+" "+(a.height/2).toString()+" 0 0 1 "+s):(t=n(a.left)+" "+n(a.y+a.height/2),s=n(a.right)+" "+n(a.y+a.height/2),"M"+t+"A"+n(a.width/2)+" "+n(a.height/2)+" 0 0 1 "+s+"A"+n(a.width/2)+" "+n(a.height/2)+" 0 0 1 "+t);case 4:let e="";var r=this.figures.h,o=r.length;for(let t=0;t=x-1||null!==n[s+1].match(C)||(g=!1)}function f(){return s++,n[s]}function p(t){let e=parseFloat(f()),i=parseFloat(f());l===l.toLowerCase()&&(e=c.x+e,i=c.y+i),t.e(e,i)}function v(){return p(c),c}function y(){return p(d),d}function b(){var t=h.toLowerCase();return"c"===t||"s"===t||"q"===t||"t"===t?new _(2*c.x-d.x,2*c.y-d.y):new _(c.x,c.y)}const x=n.length,w=Be.xC(null);let A=!1,P=!1,k=!1,S=!0,M=null;const C=new RegExp("["+W.im+"]");for(;!(s>=x-1);)if(h=l,""!==(l=f())){let t=!(g=!0);switch(l.toUpperCase()){case"X":S=!0,A=!1,P=!1;break;case"M":for(M=v(),null===w.Ai||!0===S?(w.yu(M.x,M.y,A,!1,!P,k),S=!1):w.XD(M.x,M.y),u.c(c);!m();)M=v(),w.xr(M.x,M.y);break;case"L":for(;!m();)M=v(),w.xr(M.x,M.y);g&&(t=!0);break;case"H":for(;!m();)c.e((l===l.toLowerCase()?c.x:0)+parseFloat(f()),c.y),w.xr(c.x,c.y);break;case"V":for(;!m();)c.e(c.x,(l===l.toLowerCase()?c.y:0)+parseFloat(f())),w.xr(c.x,c.y);g&&(t=!0);break;case"C":for(;!m();){var N=new _,L=(p(N),y()),D=v();w.br(N.x,N.y,L.x,L.y,D.x,D.y)}g&&(t=!0);break;case"S":for(;!m();){var T=b(),B=y(),V=v();w.br(T.x,T.y,B.x,B.y,V.x,V.y)}g&&(t=!0);break;case"Q":for(;!m();){var z=y(),q=v();w.Dw(z.x,z.y,q.x,q.y)}g&&(t=!0);break;case"T":for(;!m();){var F=b(),E=(d.c(F),v());w.Dw(F.x,F.y,E.x,E.y),d.c(E)}g&&(t=!0);break;case"B":for(;!m();){var G=parseFloat(f()),j=parseFloat(f());let t=parseFloat(f()),e=parseFloat(f());var H=parseFloat(f());let i=H,s=!1;m()||(i=parseFloat(f()),m())||(s=0!==parseFloat(f())),l===l.toLowerCase()&&(t+=c.x,e+=c.y),w.YD(G,j,t,e,H,i,s)}g&&(t=!0);break;case"A":for(;!m();){var K=Math.abs(parseFloat(f())),Y=Math.abs(parseFloat(f())),X=parseFloat(f());let t=!1,e=!1,i=0,s=0;var R=f();s=(i=1===R.length?(t=!!parseFloat(R),e=!!parseFloat(f()),parseFloat(f())):2===R.length?(t=!!parseFloat(R[0]),e=!!parseFloat(R[1]),parseFloat(f())):(t=!!parseFloat(R[0]),e=!!parseFloat(R[1]),parseFloat(R.slice(2))),parseFloat(f())),l===l.toLowerCase()&&(i=c.x+i,s=c.y+s),c.e(i,s),w.KD(K,Y,X,t,e,i,s)}g&&(t=!0);break;case"Z":w.UD(),c.c(u);break;case"F":{let t="",e=1;for(;n[s+e];){if("0"===n[s+e])k=!0;else if(null===n[s+e].match(/[Uu]/)&&null!==n[s+e].match(C)){t=n[s+e];break}e++}t.match(/[Mm]/)?A=!0:w.GD();break}case"U":{let t="",e=1;for(;n[s+e];){if(null!==n[s+e].match(/[Ff]/));else if(null!==n[s+e].match(C)){t=n[s+e];break}e++}t.match(/[Mm]/)?P=!0:w.HD(!1);break}default:"0"!==l&&"1"!==l&&Kt.ft("Unknown geometry command: "+l)}if(t){Kt.ft(`Bad geometry command: ${l}, next token: ${f()}, + or you could collect items to be removed from the collection after the iteration.`)}static gr(t,e){Kt.n("No property to set for this enum value: "+e+" on "+t.toString())}static ft(t){v.console&&v.console.log(t)}static Mt(t){return"object"==typeof t&&null!==t}static Hg(t,e,i){Array.isArray(t)||Kt.Bi(t,"Array",e,i)}static au(t,e,i){Array.isArray(t)?e>=t.length?t.push(i):t.splice(e,0,i):Kt.n("Cannot insert an object into an HTMLCollection or NodeList: "+i+" at "+e)}static rf(t,e){Array.isArray(t)?e>=t.length?t.pop():t.splice(e,1):Kt.n("Cannot remove an object from an HTMLCollection or NodeList at "+e)}static Ik=[];static ct(){var t=Kt.Ik.pop();return void 0===t?[]:t}static ot(t){t.length=0,Kt.Ik.push(t)}static tE=Object.freeze([]);static hu(t){return null===t?"*":"string"==typeof t?t:"function"==typeof t?t.name:""}static an(t){return"function"==typeof t?t.className||t.name:Kt.Mt(t)&&t.constructor?Kt.an(t.constructor):typeof t}static Yh(t,e){return null!=e&&""!==e&&(Kt.Mt(t)&&e in t||t[e])?t[e]:null}static toString(t){let e=t;return Kt.Mt(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()}static yw(t,e){if(t.hasOwnProperty(e))return!0;let i=Object.getPrototypeOf(t);for(;i&&i!==Function;){if(i.hasOwnProperty(e))return!0;var s=i.iE;if(s&&s[e])return!0;i=Object.getPrototypeOf(i)}return!1}static DD(e){var i=[];let s=0;for(s=0;s<256;s++)i[s]=s;let n=0,a=0;for(s=0;s<256;s++)n=(n+i[s]+119)%256,a=i[s],i[s]=i[n],i[n]=a;s=0;let r="";for(let t=n=0;t>4)+i.charAt(15&t)]=String.fromCharCode(t);e.length%2&&(e="0"+e);var n=[];let a=0;for(let t=0;t=e.length)&&Kt.G(t,"0 <= i < length",O,"elt:i"),e[t]}get(t){return this.elt(t)}setElt(t,e){Ht,Kt.r(t,O,"setElt:i");var i=this.h;(t<0||t>=i.length)&&Kt.G(t,"0 <= i < length",O,"setElt:i"),this.f&&Kt.O(this,t),i[t]=e}set(t,e){this.setElt(t,e)}first(){var t=this.h;return 0===t.length?null:t[0]}last(){var t=this.h,e=t.length;return 0= 0",O,"insertAt:i"),this.f&&Kt.O(this,t);var i=this.h;t>=i.length?i.push(e):i.splice(t,0,e),this.Ue()}remove(t){if(null===t)return!1;this.f&&Kt.O(this,t);var e=this.h,t=e.indexOf(t);return-1!==t&&(t===e.length-1?e.pop():e.splice(t,1),this.Ue(),!0)}delete(t){return this.remove(t)}removeAt(t){Ht,Kt.r(t,O,"removeAt:i");var e=this.h;(t<0||t>=e.length)&&Kt.G(t,"0 <= i < length",O,"removeAt:i"),this.f&&Kt.O(this,t),t===e.length-1?e.pop():e.splice(t,1),this.Ue()}removeRange(i,s){Ht,Kt.r(i,O,"removeRange:from"),Kt.r(s,O,"removeRange:to");var n=this.h,a=n.length;if(i<0)i=0;else if(a<=i)return this;if(!(s<0||(s=a<=s?a-1:s)i.add(e(t))),i.iterator}filter(e){const i=new O;return this.Lo.k.forEach(t=>{e(t)&&i.add(t)}),i.iterator}get count(){return this.Lo.count}kl(){this.key=null,this.value=null,this.ri=null}toString(){return"SetIterator"}}class N{f;k;constructor(t){this.f=!1,this.k=new Set,void 0!==t&&this.addAll(t)}[Symbol.iterator](){return this.k.values()}values(){return this.k.values()}w(){return this.f=!0,this}ut(){return this.f=!1,this}toString(){return"Set()#"+N.ps(this)}add(t){return null===t||this.k.add(t),this}addAll(e){if(null!==e)if(Array.isArray(e)){var i=e.length;for(let t=0;te.add(t)),e}toArray(){return Array.from(this.k)}toList(){const e=new O;return this.k.forEach(t=>e.add(t)),e}get count(){return this.k.size}get size(){return this.k.size}get iterator(){return this.k.size<=0?o.instance:new g(this)}entries(){return this.k.entries()}keys(){return this.k.keys()}forEach(t,e){return this.k.forEach(t,e)}static fu=1;static ji(t){t.__gohashid=N.fu++}static ps(t){return t.__gohashid}}class f{et;ri;constructor(t){this.et=t,this.ri=t.k.keys()}[Symbol.iterator](){return this.et.k.keys()}key;value;get iterator(){return this}reset(){var t=this.et;this.ri=t.k.keys()}next(){var t=this.ri.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return 0===this.et.k.size?null:(this.ri=this.et.k.keys(),this.ri.next().value)}any(t){for(const e of this.et.k)if(t(e[0]))return!0;return!1}all(t){for(const e of this.et.k)if(!t(e[0]))return!1;return!0}each(t){for(const e of this.et.k)t(e[0]);return this}map(t){var e=this.et,i=new O;for(const s of e.k)i.add(t(s[0]));return i.iterator}filter(t){var e=this.et,i=new O;for(const n of e.k){var s=n[0];t(s)&&i.add(s)}return i.iterator}get count(){return this.et.size}kl(){this.key=null,this.value=null,this.ri=null}toString(){return"MapKeySetIterator"}}class p extends N{et;constructor(t){super(),N.ji(this),this.f=!0,this.et=t}[Symbol.iterator](){return this.k.keys()}values(){return this.k.keys()}w(){return this}ut(){return this}toString(){return"MapKeySet("+this.et.toString()+")"}add(t){Kt.n("This Set is read-only: "+this.toString())}has(t){return this.et.contains(t)}contains(t){return this.has(t)}delete(t){Kt.n("This Set is read-only: "+this.toString())}remove(t){return this.delete(t)}clear(){Kt.n("This Set is read-only: "+this.toString())}first(){return 0===this.et.k.size?null:this.et.k.keys().next().value}any(t){for(const e of this.et.k)if(t(e[0]))return!0;return!1}all(t){for(const e of this.et.k)if(!t(e[0]))return!1;return!0}each(t){for(const e of this.et.k)t(e[0]);return this}map(t){var e=new N;for(const i of this.et.k)e.add(t(i[0]));return e}filter(t){var e=new N;for(const s of this.et.k){var i=s[0];t(i)&&e.add(i)}return e}copy(){return new p(this.et)}toSet(){var t=new N;for(const e of this.et.k)t.add(e[0]);return t}toArray(){var t=this.et.k,e=new Array(t.size);let i=0;for(const s of t)e[i]=s[0],i++;return e}toList(){var t=new O;for(const e of this.et.k)t.add(e[0]);return t}get count(){return this.et.size}get size(){return this.et.size}get iterator(){return this.et.size<=0?o.instance:new f(this.et)}}class x{et;ri;constructor(t){this.et=t,this.ri=t.k.values()}[Symbol.iterator](){return this.et.k.values()}key;value;get iterator(){return this}reset(){var t=this.et;this.ri=t.k.values()}next(){var t=this.ri.next();return this.value=t.value,this.key=t.value,!t.done}hasNext(){return this.next()}first(){return 0===this.et.k.size?null:(this.ri=this.et.k.values(),this.ri.next().value)}any(t){for(const e of this.et.k)if(t(e[1]))return!0;return!1}all(t){for(const e of this.et.k)if(!t(e[1]))return!1;return!0}each(t){for(const e of this.et.k)t(e[1]);return this}map(t){var e=this.et,i=new O;for(const s of e.k)i.add(t(s[1]));return i.iterator}filter(t){var e=this.et,i=new O;for(const n of e.k){var s=n[1];t(s)&&i.add(s)}return i.iterator}get count(){return this.et.size}kl(){this.key=null,this.value=null,this.ri=null}toString(){return"MapValueSetIterator"}}class T{constructor(t,e){this.key=t,this.value=e}toString(){return"{"+this.key+":"+this.value+"}"}key;value}class w{et;ri;constructor(t){this.et=t,this.ri=t.k.entries()}[Symbol.iterator](){return this.et.k.entries()}key;value;get iterator(){return this}reset(){var t=this.et;this.ri=t.k.entries()}next(){var t=this.ri.next();return t.done?(this.key=null,this.value=null,!1):(this.key=t.value[0],this.value=t.value[1],!0)}hasNext(){return this.next()}first(){if(0===this.et.k.size)return null;this.ri=this.et.k.entries();var t=this.ri.next().value;return this.key=t[0],this.value=t[1],new T(t[0],t[1])}any(t){return this.et.any(t)}all(t){return this.et.all(t)}each(t){return this.et.each(t),this}map(i){const s=new O;let n=null;return this.et.k.forEach((t,e)=>{null===n?n=new T(e,t):(n.key=e,n.value=t),s.add(i(n))}),s.iterator}filter(i){const s=new O;let n=null;return this.et.k.forEach((t,e)=>{null===n?n=new T(e,t):(n.key=e,n.value=t),i(n)&&(s.add(n),n=null)}),s.iterator}get count(){return this.et.size}kl(){this.key=null,this.value=null,this.ri=null}toString(){return"MapIterator"}}class L{f;k;constructor(t){N.ji(this),this.f=!1,this.k=new Map,void 0!==t&&this.addAll(t)}[Symbol.iterator](){return this.k.entries()}entries(){return this.k.entries()}w(){return this.f=!0,this}ut(){return this.f=!1,this}toString(){return"Map()#"+N.ps(this)}set(t,e){return this.f&&Kt.O(this,t),this.k.set(t,e),this}add(t,e){return this.set(t,e)}addAll(e){if(null!==e)if(this.f&&Kt.O(this),Array.isArray(e)){var i=e.length;for(let t=0;tt.x.toFixed(e)+" "+t.y.toFixed(e)}toString(){return"Point("+this.x+","+this.y+")"}equals(t){return t instanceof _&&this.S===t.x&&this.P===t.y}equalTo(t,e){return this.S===t&&this.P===e}equalsApprox(t){return z.p(this.S,t.x)&&z.p(this.P,t.y)}add(t){return Ht,Kt.s(t,_,_,"add:p"),this.st(),this.S+=t.x,this.P+=t.y,this}subtract(t){return Ht,Kt.s(t,_,_,"subtract:p"),this.st(),this.S-=t.x,this.P-=t.y,this}offset(t,e){return Ht,Kt.r(t,_,"offset:dx"),Kt.r(e,_,"offset:dy"),this.st(),this.S+=t,this.P+=e,this}rotate(i){if(Ht,Kt.r(i,_,"rotate:angle"),this.st(),0!==i){var s=this.S,n=this.P;if(0!==s||0!==n){let t=0,e=0;360<=i?i-=360:i<0&&(i+=360),e=90===i?(t=0,1):180===i?(t=-1,0):270===i?(t=0,-1):(i=i*Math.PI/180,t=Math.cos(i),Math.sin(i)),this.S=t*s-e*n,this.P=e*s+t*n}}return this}scale(t,e){return Ht,Kt.r(t,_,"scale:sx"),Kt.r(e,_,"scale:sy"),this.st(),this.S*=t,this.P*=e,this}distanceSquaredPoint(t){Ht,Kt.s(t,_,_,"distanceSquaredPoint:p");var e=t.x-this.S,t=t.y-this.P;return e*e+t*t}distanceSquared(t,e){Ht,Kt.r(t,_,"distanceSquared:px"),Kt.r(e,_,"distanceSquared:py");t-=this.S,e-=this.P;return t*t+e*e}normalize(){Ht,this.st();var t=this.S,e=this.P,i=Math.sqrt(t*t+e*e);return 0= 0",Yt,"setTo:w"),e<0&&Kt.G(e,">= 0",Yt,"setTo:h"),this.st(),this.J=t,this.Z=e,this}set(t){return Ht,Kt.s(t,Yt,Yt,"set:s"),this.st(),this.J=t.J,this.Z=t.Z,this}copy(){var t=new Yt;return t.J=this.J,t.Z=this.Z,t}rt(){return this.f=!0,Object.freeze(this),this}L(){return this.f||Object.isFrozen(this)?this:this.copy().w()}w(){return this.f=!0,this}ut(){return Object.isFrozen(this)&&Kt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Ht,this.f){let t="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),Kt.n(t)}}static parse(s){if("string"!=typeof s)return new Yt;{var n=s.split(" ");let t=0,e=0;for(;""===n[t];)t++;s=n[t++];s&&(e=parseFloat(s));let i=0;for(;""===n[t];)t++;return(s=n[t++])&&(i=parseFloat(s)),new Yt(e,i)}}static stringify(t){return Ht,Kt.s(t,Yt),t.width.toString()+" "+t.height.toString()}static stringifyFixed(e){return Kt.t(e,"number",Yt,"stringifyFixed:digits"),t=>t.width.toFixed(e)+" "+t.height.toFixed(e)}toString(){return"Size("+this.width+","+this.height+")"}equals(t){return t instanceof Yt&&this.J===t.width&&this.Z===t.height}equalTo(t,e){return this.J===t&&this.Z===e}equalsApprox(t){return z.p(this.J,t.width)&&z.p(this.Z,t.height)}inflate(t,e){Ht,Kt.r(t,Yt,"inflate:w"),Kt.r(e,Yt,"inflate:h");t=this.width+t,this.J=0<=t?t:0,t=this.height+e;return this.Z=0<=t?t:0,this}get width(){return this.J}set width(t){Ht,Kt.t(t,"number",Yt,"width"),this.st(t),t<0&&Kt.G(t,">= 0",Yt,"width"),this.J=t}get height(){return this.Z}set height(t){Ht,Kt.t(t,"number",Yt,"height"),this.st(t),t<0&&Kt.G(t,">= 0",Yt,"height"),this.Z=t}isReal(){return isFinite(this.width)&&isFinite(this.height)}static lf=new Yt(0,0).rt();static Bk=new Yt(1,1).rt();static nC=new Yt(6,6).rt();static du=new Yt(8,8).rt();static oC=new Yt(10,10).rt();static zk=new Yt(1/0,1/0).rt();static xw=new Yt(NaN,NaN).rt();static rC=[];static a(){var t=Yt.rC.pop();return void 0===t?new Yt:t}static o(t){Yt.rC.push(t)}}class Q{S;P;J;Z;f;constructor(t,e,i,s){var n,a,r,o;void 0===t?(this.S=0,this.P=0,this.J=0,this.Z=0):"number"==typeof t&&"number"==typeof e&&"number"==typeof i&&(0<=i||isNaN(i))&&"number"==typeof s&&(0<=s||isNaN(s))?(this.S=t,this.P=e,this.J=i,this.Z=s):t instanceof _?(n=t.x,a=t.y,e instanceof _?(r=e.x,o=e.y,this.S=Math.min(n,r),this.P=Math.min(a,o),this.J=Math.abs(n-r),this.Z=Math.abs(a-o)):e instanceof Yt?(this.S=n,this.P=a,this.J=e.width,this.Z=e.height):Kt.n("Incorrect second argument supplied to Rect constructor "+e)):Kt.n("Invalid arguments to Rect constructor: "+t+", "+e+", "+i+", "+s),this.f=!1}c(t){return this.S=t.S,this.P=t.P,this.J=t.J,this.Z=t.Z,this}e(t,e,i,s){return this.S=t,this.P=e,this.J=i,this.Z=s,this}Do(t,e){return this.J=t,this.Z=e,this}setTo(t,e,i,s){return Ht,Kt.t(t,"number",Q,"setTo:x"),Kt.t(e,"number",Q,"setTo:y"),Kt.t(i,"number",Q,"setTo:w"),Kt.t(s,"number",Q,"setTo:h"),i<0&&Kt.G(i,">= 0",Q,"setTo:w"),s<0&&Kt.G(s,">= 0",Q,"setTo:h"),this.st(),this.S=t,this.P=e,this.J=i,this.Z=s,this}set(t){return Ht,Kt.s(t,Q,Q,"set:r"),this.st(),this.S=t.S,this.P=t.P,this.J=t.J,this.Z=t.Z,this}setPoint(t){return Ht,Kt.s(t,_,Q,"setPoint:p"),this.st(),this.S=t.x,this.P=t.y,this}setSize(t){return Ht,Kt.s(t,Yt,Q,"setSize:s"),this.st(),this.J=t.width,this.Z=t.height,this}copy(){var t=new Q;return t.S=this.S,t.P=this.P,t.J=this.J,t.Z=this.Z,t}rt(){return this.f=!0,Object.freeze(this),this}L(){return this.f||Object.isFrozen(this)?this:this.copy().w()}w(){return this.f=!0,this}ut(){return Object.isFrozen(this)&&Kt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Ht,this.f){let t="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),Kt.n(t)}}static parse(a){if("string"!=typeof a)return new Q;{var r=a.split(" ");let t=0,e=0;for(;""===r[t];)t++;a=r[t++];a&&(e=parseFloat(a));let i=0;for(;""===r[t];)t++;(a=r[t++])&&(i=parseFloat(a));let s=0;for(;""===r[t];)t++;(a=r[t++])&&(s=parseFloat(a));let n=0;for(;""===r[t];)t++;return(a=r[t++])&&(n=parseFloat(a)),new Q(e,i,s,n)}}static stringify(t){return Ht,Kt.s(t,Q),t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString()}static stringifyFixed(e){return Kt.t(e,"number",Q,"stringifyFixed:digits"),t=>t.x.toFixed(e)+" "+t.y.toFixed(e)+" "+t.width.toFixed(e)+" "+t.height.toFixed(e)}toString(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"}equals(t){return t instanceof Q&&this.S===t.x&&this.P===t.y&&this.J===t.width&&this.Z===t.height}equalTo(t,e,i,s){return this.S===t&&this.P===e&&this.J===i&&this.Z===s}equalsApprox(t){return z.p(this.S,t.x)&&z.p(this.P,t.y)&&z.p(this.J,t.width)&&z.p(this.Z,t.height)}equalsApproxTo(t,e,i,s){return z.p(this.S,t)&&z.p(this.P,e)&&z.p(this.J,i)&&z.p(this.Z,s)}equalsApproxClose(t){return z.q(this.S,t.x)&&z.q(this.P,t.y)&&z.q(this.J,t.width)&&z.q(this.Z,t.height)}containsPoint(t){return Ht,Kt.s(t,_,Q,"containsPoint:p"),this.S<=t.x&&this.S+this.J>=t.x&&this.P<=t.y&&this.P+this.Z>=t.y}containsRect(t){return Ht,Kt.s(t,Q,Q,"containsRect:r"),this.S<=t.x&&t.x+t.width<=this.S+this.J&&this.P<=t.y&&t.y+t.height<=this.P+this.Z}contains(t,e,i,s){return Ht,Kt.r(t,Q,"contains:x"),Kt.r(e,Q,"contains:y"),void 0===i?i=0:Kt.r(i,Q,"contains:w"),void 0===s?s=0:Kt.r(s,Q,"contains:h"),(i<0||s<0)&&Kt.n("Rect.contains:Width and height cannot be negative"),this.S<=t&&t+i<=this.S+this.J&&this.P<=e&&e+s<=this.P+this.Z}offset(t,e){return Ht,Kt.r(t,Q,"offset:dx"),Kt.r(e,Q,"offset:dy"),this.st(),this.S+=t,this.P+=e,this}inflate(t,e){return Ht,Kt.r(t,Q,"inflate:w"),Kt.r(e,Q,"inflate:h"),this.bw(e,t,e,t)}addMargin(t){return Ht,Kt.s(t,I,Q,"addMargin:m"),this.bw(t.top,t.right,t.bottom,t.left)}subtractMargin(t){return Ht,Kt.s(t,I,Q,"subtractMargin:m"),this.bw(-t.top,-t.right,-t.bottom,-t.left)}grow(t,e,i,s){return Ht,Kt.r(t,Q,"grow:t"),Kt.r(e,Q,"grow:r"),Kt.r(i,Q,"grow:b"),Kt.r(s,Q,"grow:l"),this.bw(t,e,i,s)}bw(t,e,i,s){Ht,this.st();var n=this.J,n=(e+s<=-n?(this.S+=n/2,this.J=0):(this.S-=s,this.J+=e+s),this.Z);return t+i<=-n?(this.P+=n/2,this.Z=0):(this.P-=t,this.Z+=t+i),this}intersectRect(t){return Ht,Kt.s(t,Q,Q,"intersectRect:r"),this.lC(t.x,t.y,t.width,t.height)}intersect(t,e,i,s){return(Ht,Kt.r(t,Q,"intersect:x"),Kt.r(e,Q,"intersect:y"),Kt.r(i,Q,"intersect:w"),Kt.r(s,Q,"intersect:h"),i<0||s<0)&&Kt.n("Rect.intersect:Width and height cannot be negative"),this.lC(t,e,i,s)}lC(t,e,i,s){Ht,this.st();var n=Math.max(this.S,t),a=Math.max(this.P,e),t=Math.min(this.S+this.J,t+i),i=Math.min(this.P+this.Z,e+s);return this.S=n,this.P=a,this.J=Math.max(0,t-n),this.Z=Math.max(0,i-a),this}intersectsRect(t){return Ht,Kt.s(t,Q,Q,"intersectsRect:r"),this.intersects(t.x,t.y,t.width,t.height)}intersects(t,e,i,s){(Ht,Kt.r(t,Q,"intersects:x"),Kt.r(e,Q,"intersects:y"),Kt.r(t,Q,"intersects:w"),Kt.r(e,Q,"intersects:h"),i<0||s<0)&&Kt.n("Rect.intersects:Width and height cannot be negative");var n=this.J,a=this.S;return!(n!==1/0&&i!==1/0&&(n+=a,i+=t,isNaN(i)||isNaN(n)||i= 0",Q,"width"),this.J=t}get height(){return this.Z}set height(t){Ht,Kt.t(t,"number",Q,"height"),this.st(t),t<0&&Kt.G(t,">= 0",Q,"height"),this.Z=t}get left(){return this.S}set left(t){Ht,Kt.t(t,"number",Q,"left"),this.st(t),this.S=t}get top(){return this.P}set top(t){Ht,Kt.t(t,"number",Q,"top"),this.st(t),this.P=t}get right(){return this.S+this.J}set right(t){Ht,Kt.r(t,Q,"right"),this.st(t),this.S+=t-(this.S+this.J)}get bottom(){return this.P+this.Z}set bottom(t){Ht,Kt.r(t,Q,"top"),this.st(t),this.P+=t-(this.P+this.Z)}get position(){return new _(this.S,this.P)}set position(t){Ht,Kt.s(t,_,Q,"position"),this.st(t),this.S=t.x,this.P=t.y}get size(){return new Yt(this.J,this.Z)}set size(t){Ht,Kt.s(t,Yt,Q,"size"),this.st(t),this.J=t.width,this.Z=t.height}get center(){return new _(this.S+this.J/2,this.P+this.Z/2)}set center(t){Ht,Kt.s(t,_,Q,"center"),this.st(t),this.S=t.x-this.J/2,this.P=t.y-this.Z/2}get centerX(){return this.S+this.J/2}set centerX(t){Ht,Kt.r(t,Q,"centerX"),this.st(t),this.S=t-this.J/2}get centerY(){return this.P+this.Z/2}set centerY(t){Ht,Kt.r(t,Q,"centerY"),this.st(t),this.P=t-this.Z/2}isReal(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)}isEmpty(){return 0===this.width&&0===this.height}static Xk=new Q(0,0,0,0).rt();static RD=new Q(NaN,NaN,NaN,NaN).rt();static Yk=[];static a(){var t=Q.Yk.pop();return void 0===t?new Q:t}static H(t,e,i,s){var n=Q.Yk.pop();return void 0===n?new Q(t,e,i,s):n.e(t,e,i,s)}static o(t){Q.Yk.push(t)}}class I{fn;cn;un;dn;f;constructor(t,e,i,s){void 0===t?(this.fn=0,this.cn=0,this.un=0,this.dn=0):void 0===e?(this.top=s=i=e=t,this.right=e,this.bottom=i,this.left=s):void 0===i?(s=e,this.top=i=t,this.right=e,this.bottom=i,this.left=s):void 0!==s?(this.top=t,this.right=e,this.bottom=i,this.left=s):Kt.n("Invalid arguments to Margin constructor: "+t+", "+e+", "+i+", "+s),this.f=!1}c(t){return this.fn=t.fn,this.cn=t.cn,this.un=t.un,this.dn=t.dn,this}setTo(t,e,i,s){return Ht,Kt.t(t,"number",I,"setTo:t"),Kt.t(e,"number",I,"setTo:r"),Kt.t(i,"number",I,"setTo:b"),Kt.t(s,"number",I,"setTo:l"),this.st(),this.fn=t,this.cn=e,this.un=i,this.dn=s,this}set(t){return Ht,Kt.s(t,I,I,"assign:m"),this.st(),this.fn=t.fn,this.cn=t.cn,this.un=t.un,this.dn=t.dn,this}copy(){var t=new I;return t.fn=this.fn,t.cn=this.cn,t.un=this.un,t.dn=this.dn,t}rt(){return this.f=!0,Object.freeze(this),this}L(){return this.f||Object.isFrozen(this)?this:this.copy().w()}w(){return this.f=!0,this}ut(){return Object.isFrozen(this)&&Kt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Ht,this.f){let t="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),Kt.n(t)}}static parse(a){if("string"!=typeof a)return new I;{var r=a.split(" ");let t=0,e=NaN;for(;""===r[t];)t++;a=r[t++];if(a&&(e=parseFloat(a)),isNaN(e))return new I;let i=NaN;for(;""===r[t];)t++;if((a=r[t++])&&(i=parseFloat(a)),isNaN(i))return new I(e);let s=NaN;for(;""===r[t];)t++;if((a=r[t++])&&(s=parseFloat(a)),isNaN(s))return new I(e,i);let n=NaN;for(;""===r[t];)t++;return(a=r[t++])&&(n=parseFloat(a)),isNaN(n)?new I(e,i):new I(e,i,s,n)}}static stringify(t){return Ht,Kt.s(t,I),t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}static stringifyFixed(e){return Kt.t(e,"number",I,"stringifyFixed:digits"),t=>t.top.toFixed(e)+" "+t.right.toFixed(e)+" "+t.bottom.toFixed(e)+" "+t.left.toFixed(e)}toString(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"}equals(t){return t instanceof I&&this.fn===t.top&&this.cn===t.right&&this.un===t.bottom&&this.dn===t.left}equalTo(t,e,i,s){return this.fn===t&&this.cn===e&&this.un===i&&this.dn===s}equalsApprox(t){return z.p(this.fn,t.top)&&z.p(this.cn,t.right)&&z.p(this.un,t.bottom)&&z.p(this.dn,t.left)}get top(){return this.fn}set top(t){Ht,Kt.r(t,I,"top"),this.st(t),this.fn=t}get right(){return this.cn}set right(t){Ht,Kt.r(t,I,"right"),this.st(t),this.cn=t}get bottom(){return this.un}set bottom(t){Ht,Kt.r(t,I,"bottom"),this.st(t),this.un=t}get left(){return this.dn}set left(t){Ht,Kt.r(t,I,"left"),this.st(t),this.dn=t}isReal(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)}static qg=new I(0,0,0,0).rt();static aC=new I(2,2,2,2).rt();static fC=[];static a(){var t=I.fC.pop();return void 0===t?new I:t}static o(t){I.fC.push(t)}}class Z{S;P;Vs;Bs;f;constructor(t,e,i,s){void 0===t?(this.S=0,this.P=0,this.Vs=0,this.Bs=0):(void 0===e&&(e=0),void 0===i&&(i=0),void 0===s&&(s=0),this.x=t,this.y=e,this.offsetX=i,this.offsetY=s),this.f=!1}c(t){return this.S=t.S,this.P=t.P,this.Vs=t.Vs,this.Bs=t.Bs,this}setTo(t,e,i,s){return Ht,this.kw(t,"setTo:x"),this.kw(e,"setTo:y"),this.Sw(i,"setTo:offx"),this.Sw(s,"setTo:offy"),this.st(),this.S=t,this.P=e,this.Vs=i,this.Bs=s,this}set(t){return Ht,Kt.s(t,Z,Z,"set:s"),this.st(),this.S=t.S,this.P=t.P,this.Vs=t.Vs,this.Bs=t.Bs,this}copy(){var t=new Z;return t.S=this.S,t.P=this.P,t.Vs=this.Vs,t.Bs=this.Bs,t}rt(){return this.f=!0,Object.freeze(this),this}L(){return this.f||Object.isFrozen(this)?this:this.copy().w()}w(){return this.f=!0,this}ut(){return Object.isFrozen(this)&&Kt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Ht,this.f){let t="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),Kt.n(t)}}He(t){return this.S=NaN,this.P=NaN,this.Vs=t,this}kw(t,e){(isNaN(t)||1t.x.toFixed(e)+" "+t.y.toFixed(e)+" "+t.offsetX.toFixed(e)+" "+t.offsetY.toFixed(e)}toString(){return this.isSpot()?0===this.Vs&&0===this.Bs?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.equals(Z.None)?"None":this.equals(Z.TopLeft)?"TopLeft":this.equals(Z.TopCenter)?"Top":this.equals(Z.TopRight)?"TopRight":this.equals(Z.LeftCenter)?"Left":this.equals(Z.Center)?"Center":this.equals(Z.RightCenter)?"Right":this.equals(Z.BottomLeft)?"BottomLeft":this.equals(Z.BottomCenter)?"Bottom":this.equals(Z.BottomRight)?"BottomRight":this.equals(Z.TopSide)?"TopSide":this.equals(Z.LeftSide)?"LeftSide":this.equals(Z.RightSide)?"RightSide":this.equals(Z.BottomSide)?"BottomSide":this.equals(Z.TopBottomSides)?"TopBottomSides":this.equals(Z.LeftRightSides)?"LeftRightSides":this.equals(Z.TopLeftSides)?"TopLeftSides":this.equals(Z.TopRightSides)?"TopRightSides":this.equals(Z.BottomLeftSides)?"BottomLeftSides":this.equals(Z.BottomRightSides)?"BottomRightSides":this.equals(Z.NotTopSide)?"NotTopSide":this.equals(Z.NotLeftSide)?"NotLeftSide":this.equals(Z.NotRightSide)?"NotRightSide":this.equals(Z.NotBottomSide)?"NotBottomSide":this.equals(Z.AllSides)?"AllSides":this.equals(Z.Default)?"Default":"None"}equals(t){return t instanceof Z&&(this.S===t.x||isNaN(this.S)&&isNaN(t.x))&&(this.P===t.y||isNaN(this.P)&&isNaN(t.y))&&this.Vs===t.offsetX&&this.Bs===t.offsetY}opposite(){return new Z(.5-(this.S-.5),.5-(this.P-.5),-this.Vs,-this.Bs)}includesSide(t){if(!this.isSide())return!1;if(!t.isSide())if(t.equals(Z.Left))t=Z.LeftSide;else if(t.equals(Z.Right))t=Z.RightSide;else if(t.equals(Z.Top))t=Z.TopSide;else{if(!t.equals(Z.Bottom))return!1;t=Z.BottomSide}var e=this.Bs,t=t.offsetY;return(e&t)===t}get x(){return this.S}set x(t){Ht,this.kw(t,"x"),this.st(t),this.S=t}get y(){return this.P}set y(t){Ht,this.kw(t,"y"),this.st(t),this.P=t}get offsetX(){return this.Vs}set offsetX(t){Ht,this.Sw(t,"offsetX"),this.st(t),this.Vs=t}get offsetY(){return this.Bs}set offsetY(t){Ht,this.Sw(t,"offsetY"),this.st(t),this.Bs=t}isSpot(){return!isNaN(this.x)&&!isNaN(this.y)}isNoSpot(){return isNaN(this.x)||isNaN(this.y)}isSide(){return isNaN(this.x)&&isNaN(this.y)&&1===this.offsetX&&0!==this.offsetY}isNone(){return isNaN(this.x)&&isNaN(this.y)&&0===this.offsetX&&0===this.offsetY}isDefault(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY}static None=new Z(0,0,0,0).He(0).rt();static Default=new Z(0,0,-1,0).He(-1).rt();static TopLeft=new Z(0,0,0,0).rt();static TopCenter=new Z(.5,0,0,0).rt();static TopRight=new Z(1,0,0,0).rt();static LeftCenter=new Z(0,.5,0,0).rt();static Center=new Z(.5,.5,0,0).rt();static RightCenter=new Z(1,.5,0,0).rt();static BottomLeft=new Z(0,1,0,0).rt();static BottomCenter=new Z(.5,1,0,0).rt();static BottomRight=new Z(1,1,0,0).rt();static MiddleTop=Z.TopCenter;static MiddleLeft=Z.LeftCenter;static MiddleRight=Z.RightCenter;static MiddleBottom=Z.BottomCenter;static Top=Z.TopCenter;static Left=Z.LeftCenter;static Right=Z.RightCenter;static Bottom=Z.BottomCenter;static TopSide=new Z(0,0,1,1).He(1).rt();static LeftSide=new Z(0,0,1,2).He(1).rt();static RightSide=new Z(0,0,1,4).He(1).rt();static BottomSide=new Z(0,0,1,8).He(1).rt();static TopBottomSides=new Z(0,0,1,9).He(1).rt();static LeftRightSides=new Z(0,0,1,6).He(1).rt();static TopLeftSides=new Z(0,0,1,3).He(1).rt();static TopRightSides=new Z(0,0,1,5).He(1).rt();static BottomLeftSides=new Z(0,0,1,10).He(1).rt();static BottomRightSides=new Z(0,0,1,12).He(1).rt();static NotTopSide=new Z(0,0,1,14).He(1).rt();static NotLeftSide=new Z(0,0,1,13).He(1).rt();static NotRightSide=new Z(0,0,1,11).He(1).rt();static NotBottomSide=new Z(0,0,1,7).He(1).rt();static AllSides=new Z(0,0,1,15).He(1).rt();static Kk=new Z(.156,.156).rt();static Uk=new Z(.844,.844).rt();static cC=[];static a(){var t=Z.cC.pop();return void 0===t?new Z:t}static o(t){Z.cC.push(t)}}class V{m11;m12;m21;m22;dx;dy;constructor(){this.m11=1,this.m12=0,this.m21=0,this.m22=1,this.dx=0,this.dy=0}set(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}setTo(t,e,i,s,n,a){return this.m11=t,this.m12=e,this.m21=i,this.m22=s,this.dx=n,this.dy=a,this}copy(){var t=new V;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}toString(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"}equals(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}Gk(){return 0===this.dx&&0===this.dy&&1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22}ti(){return this.m11=1,this.m12=0,this.m21=0,this.m22=1,this.dx=0,this.dy=0,this}hf(t){var e=this.m11*t.m11+this.m21*t.m12,i=this.m12*t.m11+this.m22*t.m12,s=this.m11*t.m21+this.m21*t.m22,n=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=s,this.m22=n,this}uC(t){var e=1/(t.m11*t.m22-t.m12*t.m21),i=t.m22*e,s=-t.m12*e,n=-t.m21*e,a=t.m11*e,r=e*(t.m21*t.dy-t.m22*t.dx),e=e*(t.m12*t.dx-t.m11*t.dy),t=this.m11*i+this.m21*s,i=this.m12*i+this.m22*s,s=this.m11*n+this.m21*a,n=this.m12*n+this.m22*a;return this.dx=this.m11*r+this.m21*e+this.dx,this.dy=this.m12*r+this.m22*e+this.dy,this.m11=t,this.m12=i,this.m21=s,this.m22=n,this}Mw(){var t=1/(this.m11*this.m22-this.m12*this.m21),e=this.m22*t,i=-this.m12*t,s=-this.m21*t,n=this.m11*t,a=t*(this.m21*this.dy-this.m22*this.dx),t=t*(this.m12*this.dx-this.m11*this.dy);return this.m11=e,this.m12=i,this.m21=s,this.m22=n,this.dx=a,this.dy=t,this}ys(i,s,n){if(360<=i?i-=360:i<0&&(i+=360),0!==i){this.se(s,n);let t=0,e=0;e=90===i?(t=0,1):180===i?(t=-1,0):270===i?(t=0,-1):(i=i*Math.PI/180,t=Math.cos(i),Math.sin(i));var i=this.m11*t+this.m21*e,a=this.m12*t+this.m22*e,r=this.m11*-e+this.m21*t,o=this.m12*-e+this.m22*t;this.m11=i,this.m12=a,this.m21=r,this.m22=o,this.se(-s,-n)}return this}se(t,e){return this.dx+=this.m11*t+this.m21*e,this.dy+=this.m12*t+this.m22*e,this}v(t,e){return void 0===e&&(e=t),this.m11*=t,this.m12*=t,this.m21*=e,this.m22*=e,this}ID(){if(1===this.m11&&0===this.m12)return 0;let t=180*Math.atan2(this.m12,this.m11)/Math.PI;return t<0&&(t+=360),t}Pt(t){var e=t.x,i=t.y;return t.e(e*this.m11+i*this.m21+this.dx,e*this.m12+i*this.m22+this.dy)}rs(t){var e=1/(this.m11*this.m22-this.m12*this.m21),i=this.m22*e,s=-this.m12*e,n=-this.m21*e,a=this.m11*e,r=e*(this.m21*this.dy-this.m22*this.dx),e=e*(this.m12*this.dx-this.m11*this.dy),o=t.x,l=t.y;return t.e(o*i+l*n+r,o*s+l*a+e)}Pw(t){var e=1/(this.m11*this.m22-this.m12*this.m21),i=this.m22*e,s=-this.m12*e,n=-this.m21*e,a=this.m11*e,r=e*(this.m21*this.dy-this.m22*this.dx),e=e*(this.m12*this.dx-this.m11*this.dy),o=1.25*t.x,l=1.2*t.y;return t.e(o*i+l*n+r,o*s+l*a+e)}Nw(t){var e=t.x,i=t.y,s=e+t.width,n=i+t.height,a=this.m11,r=this.m12,o=this.m21,l=this.m22,h=this.dx,u=this.dy,d=e*a+i*o+h,c=e*r+i*l+u,g=s*a+i*o+h,i=s*r+i*l+u,m=e*a+n*o+h,e=e*r+n*l+u,a=s*a+n*o+h,o=s*r+n*l+u,h=d,s=c,r=c,n=Math.min(d,g),h=Math.max(h,g),s=Math.min(s,i),r=Math.max(r,i);return n=Math.min(n,m),h=Math.max(h,m),s=Math.min(s,e),r=Math.max(r,e),n=Math.min(n,a),h=Math.max(h,a),s=Math.min(s,o),r=Math.max(r,o),t.e(n,s,h-n,r-s),t}static dC=[];static a(){var t=V.dC.pop();return void 0===t?new V:t}static o(t){V.dC.push(t)}static Hk="54a702f3e53909c447824c6706603faf4c"}const z={OD:"7da71ca0ad381e90",Gn:(Math.sqrt(2)-1)/3*4,gC:null,Cw:t=>{if(t<=0)return 0;let e=z.gC;if(null===e){e=[];for(let t=0;t<=2e3;t++)e[t]=Math.sqrt(t);z.gC=e}var i;return t<1?(i=1/t)<=2e3?1/e[0|i]:Math.sqrt(t):t<=2e3?e[0|t]:Math.sqrt(t)},p:(t,e)=>{t-=e;return t<.5&&-.5{t-=e;return t<5e-8&&-5e-8{n<=0&&(n=1e-6);let o=0,l=0,h=0,u=0;if(o=t{var c,g,m,f,p,v;return z.zi(t,e,r,o,d,i,s)&&z.zi(t,e,r,o,d,n,a)?z.zi(t,e,r,o,d,h,u):(p=((m=((c=(t+i)/2)+(i=(i+n)/2))/2)+(n=(i+(i=(n+r)/2))/2))/2,v=((f=((g=(e+s)/2)+(s=(s+a)/2))/2)+(a=(s+(s=(a+o)/2))/2))/2,z.Aw(t,e,c,g,m,f,p,v,l,h,u,d)||z.Aw(p,v,n,a,i,s,r,o,l,h,u,d))},mC:(t,e,i,s,n,a,r,o,l)=>{var h=(i+n)/2,u=(s+a)/2;return l.e((((t+i)/2+h)/2+(h+(n+r)/2)/2)/2,(((e+s)/2+u)/2+(u+(a+o)/2)/2)/2),l},ED:(t,e,i,s,n,a,r,o)=>{var l=(i+n)/2,h=(s+a)/2,t=((t+i)/2+l)/2,i=((e+s)/2+h)/2,e=(l+(n+r)/2)/2,s=(h+(a+o)/2)/2;return _.direction(t,i,e,s)},gu:(t,e,i,s,n,a,r,o,l,h)=>{var u,d,c,g,m,f;return z.zi(t,e,r,o,l,i,s)&&z.zi(t,e,r,o,l,n,a)?(h.unionNoCheck(t,e,0,0),h.unionNoCheck(r,o,0,0)):(m=((c=((u=(t+i)/2)+(i=(i+n)/2))/2)+(n=(i+(i=(n+r)/2))/2))/2,f=((g=((d=(e+s)/2)+(s=(s+a)/2))/2)+(a=(s+(s=(a+o)/2))/2))/2,z.gu(t,e,u,d,c,g,m,f,l,h),z.gu(m,f,n,a,i,s,r,o,l,h)),h},Hn:(t,e,i,s,n,a,r,o,l,h)=>{var u,d,c,g,m,f;return z.zi(t,e,r,o,l,i,s)&&z.zi(t,e,r,o,l,n,a)?(0===h.length&&(h.push(t),h.push(e)),h.push(r),h.push(o)):(m=((c=((u=(t+i)/2)+(i=(i+n)/2))/2)+(n=(i+(i=(n+r)/2))/2))/2,f=((g=((d=(e+s)/2)+(s=(s+a)/2))/2)+(a=(s+(s=(a+o)/2))/2))/2,z.Hn(t,e,u,d,c,g,m,f,l,h),z.Hn(m,f,n,a,i,s,r,o,l,h)),h},vk:(t,e,i,s,n,a,r,o,l,h)=>{var u,d,c,g;return z.zi(t,e,n,a,h,i,s)?z.zi(t,e,n,a,h,o,l):(c=((u=(t+i)/2)+(i=(i+n)/2))/2,g=((d=(e+s)/2)+(s=(s+a)/2))/2,z.vk(t,e,u,d,c,g,r,o,l,h)||z.vk(c,g,i,s,n,a,r,o,l,h))},eE:(t,e,i,s,n,a,r)=>{return r.e(((t+i)/2+(i+n)/2)/2,((e+s)/2+(s+a)/2)/2),r},qk:(t,e,i,s,n,a,r,o)=>{var l,h,u,d;return z.zi(t,e,n,a,r,i,s)?(o.unionNoCheck(t,e,0,0),o.unionNoCheck(n,a,0,0)):(u=((l=(t+i)/2)+(i=(i+n)/2))/2,d=((h=(e+s)/2)+(s=(s+a)/2))/2,z.qk(t,e,l,h,u,d,r,o),z.qk(u,d,i,s,n,a,r,o)),o},Wg:(t,e,i,s,n,a,r,o)=>{var l,h,u,d;return z.zi(t,e,n,a,r,i,s)?(0===o.length&&(o.push(t),o.push(e)),o.push(n),o.push(a)):(u=((l=(t+i)/2)+(i=(i+n)/2))/2,d=((h=(e+s)/2)+(s=(s+a)/2))/2,z.Wg(t,e,l,h,u,d,r,o),z.Wg(u,d,i,s,n,a,r,o)),o},jg:(n,a,r,o,l,h,u,d,c,g,m,f,p,v)=>{if(z.zi(n,a,u,d,p,r,o)&&z.zi(n,a,u,d,p,l,h))return!!z.uu(n,a,u,d,c,g,m,f)&&0!=(y=(n-u)*(g-f)-(a-d)*(c-m))&&(v.e(((n*d-a*u)*(c-m)-(n-u)*(c*f-g*m))/y,((n*d-a*u)*(g-f)-(a-d)*(c*f-g*m))/y),!0);{var y=(n+r)/2,b=(a+o)/2,r=(r+l)/2,o=(o+h)/2,l=(l+u)/2,h=(h+d)/2,x=(y+r)/2,w=(b+o)/2,r=(r+l)/2,o=(o+h)/2,A=(x+r)/2,P=(w+o)/2;let t=1/0,e=!1,i=0,s=0;return z.jg(n,a,y,b,x,w,A,P,c,g,m,f,p,v)&&(n=(v.x-c)*(v.x-c)+(v.y-g)*(v.y-g)){let g=0;if(z.zi(i,s,r,o,c,t,e)&&z.zi(i,s,r,o,c,n,a)){var m=(i-r)*(h-d)-(s-o)*(l-u);if(0==m)return g;var f=((i*o-s*r)*(l-u)-(i-r)*(l*d-h*u))/m,p=((i*o-s*r)*(h-d)-(s-o)*(l*d-h*u))/m;if(u<=f)return g;let t=0,e=0;if((ue)return g}else if(e=ie)return g;0{if(z.q(i,n)){let t=0,e=0;e=se?(l.e(i,e),!1):(l.e(i,h),!0)}if(z.q(s,a)){let t=0,e=0;e=ie?(l.e(e,s),!1):(l.e(h,s),!0)}return(h=((i-r)*(i-n)+(s-o)*(s-a))/((n-i)*(n-i)+(a-s)*(a-s)))<-5e-6?(l.e(i,s),!1):1.000005{if(z.p(i,n)&&z.p(s,a))return h.e(i,s),!1;if(z.q(r,t))return z.q(i,n)?(z.Sl(i,s,n,a,r,o,h),!1):(u=(a-s)/(n-i)*(r-i)+s,z.Sl(i,s,n,a,r,u,h));var u=(l-o)/(t-r);if(z.q(i,n)){l=u*(i-r)+o;let t=0,e=0;return e=se?(h.e(i,e),!1):(h.e(i,l),!0)}t=(a-s)/(n-i);if(z.q(u,t))return z.Sl(i,s,n,a,r,o,h),!1;l=(t*i-u*r+o-s)/(t-u);if(z.q(t,0)){let t=0,e=0;return e=ie?(h.e(e,s),!1):(h.e(l,s),!0)}return r=t*(l-i)+s,z.Sl(i,s,n,a,l,r,h)},sE:(t,e,i,s,n)=>z.vn(i.x,i.y,s.x,s.y,t.x,t.y,e.x,e.y,n),nE:(s,n,t,e,i,a,r,o,l,h)=>{let u=1/0;function d(t,e){var i=(t-s)*(t-s)+(e-n)*(e-n);i{let h=1e21,u=t,d=e;var c;return z.vn(t,e,t,s,n,a,r,o,l)&&(c=(l.x-n)*(l.x-n)+(l.y-a)*(l.y-a))z.hC(t.x,t.y,t.width,t.height,e.x,e.y,i.x,i.y),hC:(t,e,i,s,n,a,r,o)=>{var l=t,h=t+i,u=e,d=e+s;if(n===r){let t=0,e=0;return e=a=u}if(a!==o)return!!(Q.contains(t,e,i,s,n,a)||Q.contains(t,e,i,s,r,o)||z.uu(l,u,h,u,n,a,r,o)||z.uu(h,u,h,d,n,a,r,o)||z.uu(h,d,l,d,n,a,r,o)||z.uu(l,d,l,u,n,a,r,o));{let t=0,e=0;return e=n=l}},uu:(t,e,i,s,n,a,r,o)=>t===i&&e===s&&n===r&&a===o?t===n&&e===a:z.cu(t,e,i,s,n,a)*z.cu(t,e,i,s,r,o)<=0&&z.cu(n,a,r,o,t,e)*z.cu(n,a,r,o,i,s)<=0,cu:(t,e,i,s,n,a)=>{i-=t,s-=e;let r=n-t,o=a-e,l=r*s-o*i;return l=0===l&&0<(l=r*i+o*s)&&(r-=i,o-=s,(l=r*i+o*s)<0)?0:l},Zg:t=>(t<0&&(t+=360),360<=t&&(t-=360),t),pC:(t,e,i,s,n,a)=>{var r=Math.PI,o=(a||(s*=r/180,n*=r/180),n{var a=(i-e)/2,r=t*Math.cos(a),o=t*Math.sin(a),l=r,h=-o,u=l*l+h*h,d=u+l*r+h*o,u=4/3*(Math.sqrt(2*u*d)-d)/(l*o-h*r),d=l-u*h,o=h+u*l,r=d,h=-o,u=a+e,l=Math.cos(u),a=Math.sin(u);return[s+t*Math.cos(e),n+t*Math.sin(e),s+d*l-o*a,n+d*a+o*l,s+r*l-h*a,n+r*a+h*l,s+t*Math.cos(i),n+t*Math.sin(i)]},vg:(t,e,i,s,n,a,r)=>{i=Math.floor((t-i)/n)*n+i,s=Math.floor((e-s)/a)*a+s;let o=i,l=(i+n-t{let i=Math.max(t,e),s=Math.min(t,e),n,a=1;for(;n=i%s,a=s,i=s,0<(s=n););return a},BD:(t,e,i,s)=>{var n=i<0,a=s<0;let r,o=0,l=0,h=void(l=t{let h=0;if(0t.toString(e)}ci(t){t in P?this.type=t:Kt.gr(this,t)}toString(i){void 0===i&&(i=-1);var t,s,n=t=>0===t?"0":t.toFixed(i);let a;switch(this.type){case 1:return i<0?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+n(this.startX)+" "+n(this.startY)+"L"+n(this.endX)+" "+n(this.endY);case 2:return(a=new Q(this.startX,this.startY,0,0)).union(this.endX,this.endY,0,0),i<0?"M"+a.x.toString()+" "+a.y.toString()+"H"+a.right.toString()+"V"+a.bottom.toString()+"H"+a.left.toString()+"z":"M"+n(a.x)+" "+n(a.y)+"H"+n(a.right)+"V"+n(a.bottom)+"H"+n(a.left)+"z";case 3:return(a=new Q(this.startX,this.startY,0,0)).union(this.endX,this.endY,0,0),i<0?(s=a.left.toString()+" "+(a.y+a.height/2).toString(),t=a.right.toString()+" "+(a.y+a.height/2).toString(),"M"+s+"A"+(a.width/2).toString()+" "+(a.height/2).toString()+" 0 0 1 "+t+"A"+(a.width/2).toString()+" "+(a.height/2).toString()+" 0 0 1 "+s):(t=n(a.left)+" "+n(a.y+a.height/2),s=n(a.right)+" "+n(a.y+a.height/2),"M"+t+"A"+n(a.width/2)+" "+n(a.height/2)+" 0 0 1 "+s+"A"+n(a.width/2)+" "+n(a.height/2)+" 0 0 1 "+t);case 4:let e="";var r=this.figures.h,o=r.length;for(let t=0;t=x-1||null!==n[s+1].match(C)||(g=!1)}function f(){return s++,n[s]}function p(t){let e=parseFloat(f()),i=parseFloat(f());l===l.toLowerCase()&&(e=c.x+e,i=c.y+i),t.e(e,i)}function v(){return p(c),c}function y(){return p(d),d}function b(){var t=h.toLowerCase();return"c"===t||"s"===t||"q"===t||"t"===t?new _(2*c.x-d.x,2*c.y-d.y):new _(c.x,c.y)}const x=n.length,w=Be.xC(null);let A=!1,P=!1,k=!1,S=!0,M=null;const C=new RegExp("["+W.im+"]");for(;!(s>=x-1);)if(h=l,""!==(l=f())){let t=!(g=!0);switch(l.toUpperCase()){case"X":S=!0,A=!1,P=!1;break;case"M":for(M=v(),null===w.Ai||!0===S?(w.yu(M.x,M.y,A,!1,!P,k),S=!1):w.XD(M.x,M.y),u.c(c);!m();)M=v(),w.xr(M.x,M.y);break;case"L":for(;!m();)M=v(),w.xr(M.x,M.y);g&&(t=!0);break;case"H":for(;!m();)c.e((l===l.toLowerCase()?c.x:0)+parseFloat(f()),c.y),w.xr(c.x,c.y);break;case"V":for(;!m();)c.e(c.x,(l===l.toLowerCase()?c.y:0)+parseFloat(f())),w.xr(c.x,c.y);g&&(t=!0);break;case"C":for(;!m();){var N=new _,L=(p(N),y()),D=v();w.br(N.x,N.y,L.x,L.y,D.x,D.y)}g&&(t=!0);break;case"S":for(;!m();){var T=b(),B=y(),V=v();w.br(T.x,T.y,B.x,B.y,V.x,V.y)}g&&(t=!0);break;case"Q":for(;!m();){var z=y(),G=v();w.Dw(z.x,z.y,G.x,G.y)}g&&(t=!0);break;case"T":for(;!m();){var F=b(),E=(d.c(F),v());w.Dw(F.x,F.y,E.x,E.y),d.c(E)}g&&(t=!0);break;case"B":for(;!m();){var q=parseFloat(f()),j=parseFloat(f());let t=parseFloat(f()),e=parseFloat(f());var H=parseFloat(f());let i=H,s=!1;m()||(i=parseFloat(f()),m())||(s=0!==parseFloat(f())),l===l.toLowerCase()&&(t+=c.x,e+=c.y),w.YD(q,j,t,e,H,i,s)}g&&(t=!0);break;case"A":for(;!m();){var K=Math.abs(parseFloat(f())),Y=Math.abs(parseFloat(f())),X=parseFloat(f());let t=!1,e=!1,i=0,s=0;var R=f();s=(i=1===R.length?(t=!!parseFloat(R),e=!!parseFloat(f()),parseFloat(f())):2===R.length?(t=!!parseFloat(R[0]),e=!!parseFloat(R[1]),parseFloat(f())):(t=!!parseFloat(R[0]),e=!!parseFloat(R[1]),parseFloat(R.slice(2))),parseFloat(f())),l===l.toLowerCase()&&(i=c.x+i,s=c.y+s),c.e(i,s),w.KD(K,Y,X,t,e,i,s)}g&&(t=!0);break;case"Z":w.UD(),c.c(u);break;case"F":{let t="",e=1;for(;n[s+e];){if("0"===n[s+e])k=!0;else if(null===n[s+e].match(/[Uu]/)&&null!==n[s+e].match(C)){t=n[s+e];break}e++}t.match(/[Mm]/)?A=!0:w.GD();break}case"U":{let t="",e=1;for(;n[s+e];){if(null!==n[s+e].match(/[Ff]/));else if(null!==n[s+e].match(C)){t=n[s+e];break}e++}t.match(/[Mm]/)?P=!0:w.HD(!1);break}default:"0"!==l&&"1"!==l&&Kt.ft("Unknown geometry command: "+l)}if(t){Kt.ft(`Bad geometry command: ${l}, next token: ${f()}, string: `+e);break}}i=w.em;if(Be.bC(w),t)for(var U=i.figures.iterator;U.next();)U.value.isFilled=!0;return i}static kC(e,i){var s=e.length,n=_.a();for(let t=0;t=o)return u=o-i,u=0===f?0:u/f,d=(m=n[e])[2*t],c=m[2*t+1],g=m[2*t+2],m=m[2*t+3],s.e(d+(g-d)*u,c+(m-c)*u),s;i+=f}}}return s}getAngleAlongPath(t){if(t<0?t=0:1=a)return h=(c=i[e])[2*t],u=c[2*t+1],d=c[2*t+2],c=c[2*t+3],Math.abs(d-h)<1&&Math.abs(c-u)<1?0:Math.abs(d-h)<1?0<=c-u?90:270:Math.abs(c-u)<1?0<=d-h?0:180:180*Math.atan2(c-u,d-h)/Math.PI;r+=g}}return NaN}getPointAndAngleAlongPath(t,n){if(t<0?t=0:1=o){var d=o-s,d=0===u?0:d/u,c=a[i],g=c[2*e],m=c[2*e+1],f=c[2*e+2],c=c[2*e+3];n[0]=g+(f-g)*d,n[1]=m+(c-m)*d;let t;return t=Math.abs(f-g)<1&&Math.abs(c-m)<1?0:Math.abs(f-g)<1?0<=c-m?90:270:Math.abs(c-m)<1?0<=f-g?0:180:180*Math.atan2(c-m,f-g)/Math.PI,n[2]=t,n}s+=u}}}return n}getFractionForPoint(r){if(1===this.type){var i=this.startX,s=this.startY,n=this.endX,a=this.endY;if(i===n&&s===a)return 0;{var o=r.x,l=r.y;let t=0,e=0;return i===n?(e=s=e?e===s?0:1:Math.abs(l-s)/(e-t)):s===a?(e=i=e?e===i?0:1:Math.abs(o-i)/(e-t)):(b=(n-i)*(n-i)+(a-s)*(a-s),x=_.a(),z.Sl(i,s,n,a,o,l,x),n=x.x,a=x.y,_.o(x),Math.sqrt(((n-i)*(n-i)+(a-s)*(a-s))/b))}}if(2!==this.type){var h=this.flattenedSegments,u=this.flattenedLengths,o=this.flattenedTotalLength,d=_.a();let e=1/0,i=0,s=0;var c=h.length;let n=0,a=0;for(let t=0;t0===t?"0":t.toFixed(e))(this.startX)+" "+t(this.startY);var t,s=this.segments.h,n=s.length;for(let t=0;t0===t?"0":t.toFixed(e);let i="";switch(this.type){case 1:i=e<0?"M"+this.endX.toString()+" "+this.endY.toString():"M"+t(this.endX)+" "+t(this.endY);break;case 2:i=e<0?"L"+this.endX.toString()+" "+this.endY.toString():"L"+t(this.endX)+" "+t(this.endY);break;case 3:i=e<0?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+t(this.point1X)+" "+t(this.point1Y)+" "+t(this.point2X)+" "+t(this.point2Y)+" "+t(this.endX)+" "+t(this.endY);break;case 4:i=e<0?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+t(this.point1X)+" "+t(this.point1Y)+" "+t(this.endX)+" "+t(this.endY);break;case 5:i=e<0?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+" "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+t(this.startAngle)+" "+t(this.sweepAngle)+" "+t(this.centerX)+" "+t(this.centerY)+" "+t(this.radiusX)+" "+t(this.radiusY);break;case 6:i=e<0?"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"+t(this.radiusX)+" "+t(this.radiusY)+" "+t(this.xAxisRotation)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+t(this.endX)+" "+t(this.endY);break;default:i=M[this.type]}return i+(this.isClosed?"z":"")}static Move=1;static Line=2;static Bezier=3;static QuadraticBezier=4;static Arc=5;static SvgArc=6;get f(){return 0!=(1&this.l)}set f(t){t?this.l|=1:this.l&=-2}get Nt(){return 0!=(2&this.l)}set Nt(t){t?this.l|=2:this.l&=-3}w(){return this.f=!0,this}ut(){return this.f=!1,this}close(){return this.isClosed=!0,this}Fo(e){if(null===this.Xs||!1!==e.Nt){e=this.radiusX;let t=this.radiusY;if(void 0===t&&(t=e),0===e||0===t)this.Xs=[];else{var i,s=this.gn,n=this.Pl,a=z.pC(0,0,eMath.sqrt(t*t+e*e),x=(t,e,i,s)=>(t*i+e*s)/(b(t,e)*b(i,s)),w=(t,e,i,s)=>(t*se?t:e),r=t>e?1:t/e,d=t>e?e/t:1,o=z.pC(0,0,h,A,A+a,!0),c=V.a();c.ti(),c.se(v,y),c.ys(this.gn,0,0),c.v(r,d),W.kC(o,c),V.o(c),this.Xs=o}return this.Xs}get isClosed(){return 0!=(8&this.l)}set isClosed(t){this.isClosed!==t&&(t?this.l|=8:this.l&=-9,this.Nt=!0)}get type(){return this.nt}set type(t){Ht,Kt.it(t,M,"SegmentType"),this.f&&Kt.O(this,t),this.nt=t,this.Nt=!0}get endX(){return this.ne}set endX(t){Ht,Kt.r(t,A,"endX"),this.f&&Kt.O(this,t),this.ne=t,this.Nt=!0}get endY(){return this.oe}set endY(t){Ht,Kt.r(t,A,"endY"),this.f&&Kt.O(this,t),this.oe=t,this.Nt=!0}get point1X(){return this.gn}set point1X(t){Ht,Kt.r(t,A,"point1X"),this.f&&Kt.O(this,t),this.gn=t,this.Nt=!0}get point1Y(){return this.Pl}set point1Y(t){Ht,Kt.r(t,A,"point1Y"),this.f&&Kt.O(this,t),this.Pl=t,this.Nt=!0}get point2X(){return this.Nl}set point2X(t){Ht,Kt.r(t,A,"point2X"),this.f&&Kt.O(this,t),this.Nl=t,this.Nt=!0}get point2Y(){return this.kr}set point2Y(t){Ht,Kt.r(t,A,"point2Y"),this.f&&Kt.O(this,t),this.kr=t,this.Nt=!0}get centerX(){return this.gn}set centerX(t){Ht,Kt.r(t,A,"centerX"),this.f&&Kt.O(this,t),this.gn=t,this.Nt=!0}get centerY(){return this.Pl}set centerY(t){Ht,Kt.r(t,A,"centerY"),this.f&&Kt.O(this,t),this.Pl=t,this.Nt=!0}get radiusX(){return this.Nl}set radiusX(t){Ht,Kt.r(t,A,"radiusX"),t<0&&Kt.G(t,">= zero",A,"radiusX"),this.f&&Kt.O(this,t),this.Nl=t,this.Nt=!0}get radiusY(){return this.kr}set radiusY(t){Ht,Kt.r(t,A,"radiusY"),t<0&&Kt.G(t,">= zero",A,"radiusY"),this.f&&Kt.O(this,t),this.kr=t,this.Nt=!0}get startAngle(){return this.ne}set startAngle(t){Ht,Kt.r(t,A,"startAngle"),this.f&&Kt.O(this,t),(t%=360)<0&&(t+=360),this.ne=t,this.Nt=!0}get sweepAngle(){return this.oe}set sweepAngle(t){Ht,Kt.r(t,A,"sweepAngle"),this.f&&Kt.O(this,t),this.oe=t=(t=360=e;t--){var s=i.elt(t);null!==s&&s.undo(),i.ut(),i.removeAt(t)}i.w()}optimize(){if(this.isComplete){var i=this.changes,s=(i.ut(),new L);for(let e=0;ee&&i.setElt(e,r),e++)}for(;i.length>e;)i.pop();i.w()}}get changes(){return this.AC}get name(){return this.Tt}set name(t){this.Tt=t}get isComplete(){return this.$k}set isComplete(t){this.$k=t}}class U{Ew;Xi;LC;Ys;Qk;km;Zn;Vw;_k;pn;yf;Bw;Ks;zw;Xw;Sm;Yw;constructor(t){this.Ew=new N,this.Xi=!1,this.LC=(new O).w(),this.Ys=-1,this.Qk=999,this.Ks=!1,this.km=null,this.Zn=0,this.Vw=!1,Ht,this.Vw=!0,this._k=23,this.pn=(new O).w(),this.yf=new O,this.Bw=!0,this.zw=!1,this.Xw=!1,this.Sm=!1,this.Yw=!1,t&&Object.assign(this,t)}toString(e){let i="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength,s=(i+="[",this.nestedTransactionNames.count);for(let t=0;t=a&&(null!==(r=o.elt(0))&&r.clear(),o.removeAt(0),this.Ys--)),0===a||0!==o.count&&o.get(o.count-1)===n||(o.add(n),this.Ys++),o.w(),t=n),this.Cl||this.i("CommittedTransaction",s,t);else{this.Ks=!0;try{this.isEnabled&&null!==t&&(t.isComplete=!0,t.undo())}finally{this.Cl||this.i("RolledBackTransaction",s,t),this.Ks=!1}null!==t&&t.clear()}return this.km=null,this.Kw&&this.clear(),this.Kw=!1,!(this.Uw=!1)}this.isEnabled&&!i&&null!==t&&t.jD(e)}return!1}discardHistoryAfterIndex(){if(!this.isUndoingRedoing&&this.canRedo()){var e=this.history;e.ut();for(let t=e.count-1;t>this.historyIndex;t--){var i=e.elt(t);null!==i&&i.clear(),e.removeAt(t),this.Sm=!0}e.w()}}oE(t){this.Zn+=t,this.Zn<0&&(this.Zn=0)}canUndo(){var t;return!(!this.isEnabled||0!t.layer.isTemporary:e);return s.targetObject=t,this.JD(t,s,i),s.handled}JD(i,s,n){if(s.handled=!1,null===i||i.isEnabledObject()){let e=0,t=(s.left?e=1!==s.clickCount&&2===s.clickCount?2:1:s.right&&1===s.clickCount&&(e=3),"ObjectSingleClicked");if(null!==i){switch(e){case 1:t="ObjectSingleClicked";break;case 2:t="ObjectDoubleClicked";break;case 3:t="ObjectContextClicked"}0!==e&&n.V(t,i)}else{switch(e){case 1:t="BackgroundSingleClicked";break;case 2:t="BackgroundDoubleClicked";break;case 3:t="BackgroundContextClicked"}0!==e&&n.V(t)}if(null!==i)for(;null!==i;){let t=null;switch(e){case 1:t=i.click;break;case 2:t=i.doubleClick||i.click;break;case 3:t=i.contextClick}if(null!==t&&(t(s,i),s.handled))break;i=i.panel}else{let t=null;switch(e){case 1:t=n.click;break;case 2:t=n.doubleClick||n.click;break;case 3:t=n.contextClick}null!==t&&t(s)}}}standardMouseOver(){var n=this.diagram,a=n.lastInput;if(!0!==n.animationManager.Mi){var t=n.skipsUndoManager;n.skipsUndoManager=!0;let i=n.viewportBounds.containsPoint(a.documentPoint)?n.findObjectAt(a.documentPoint,null,null):null,s=(!a.event||"pointercancel"!==a.event.type&&"pointerout"!==a.event.type||(i=null),!1);if((a.targetObject=i)!==n.wf){let t=n.wf;var e=t;for(n.wf=i,this.doCurrentObjectChanged(t,i),a.handled=!1;null!==t;){var r=t.mouseLeave;if(null!==r&&(i===t||null!==i&&i.isContainedBy(t)||(r(a,t,i),s=!0,a.handled)))break;t=t.panel}for(t=e,a.handled=!1;null!==i;){var o=i.mouseEnter;if(null!==o&&(t===i||null!==t&&t.isContainedBy(i)||(o(a,i,t),s=!0,a.handled)))break;i=i.panel}i=n.wf}if(null!==i){let t=i,e="";for(;null!==t&&""===(e=t.cursor);)t=t.panel;for(n.currentCursor=e,a.handled=!1,t=i;null!==t;){var l=t.mouseOver;if(null!==l&&(l(a,t),s=!0,a.handled))break;t=t.panel}}else{this.doUpdateCursor(null);e=n.mouseOver;null!==e&&(e(a),s=!0)}s&&n.requestUpdate(),n.skipsUndoManager=t}}doUpdateCursor(t){var e=this.diagram;e&&(e.currentCursor="")}doCurrentObjectChanged(t,e){}standardMouseWheel(){var s=this.diagram,n=s.lastInput;let a=n.delta;if(0!==a&&s.documentBounds.isReal()){var r=s.commandHandler,o=s.toolManager.mouseWheelBehavior;if(null!==r&&(2===o&&!n.shift||1===o&&n.control))(0i.doWaitAfter(s),t)}cancelWaitAfter(){-1!==this.Mm&&Kt.Gg(this.Mm),this.Mm=-1}doWaitAfter(t){}findToolHandleAt(t,e){t=this.diagram.findObjectAt(t,t=>{for(;null!==t&&!(t.panel instanceof K);)t=t.panel;return t});return null!==t&&t.part.category===e?t:null}isBeyondDragSize(t,e){var i=this.diagram,s=(void 0===t&&(t=i.firstInput.viewPoint),void 0===e&&(e=i.lastInput.viewPoint),i.toolManager.dragSize);let n=s.width,a=s.height;return i.firstInput.isTouchEvent&&(n+=6,a+=6),Math.abs(e.x-t.x)>n||Math.abs(e.y-t.y)>a}get name(){return this.Tt}set name(t){Kt.t(t,"string",J,"name"),this.Tt=t}get isEnabled(){return this.Xi}set isEnabled(t){Kt.t(t,"boolean",J,"isEnabled"),this.Xi=t}get isActive(){return this.tS}set isActive(t){Kt.t(t,"boolean",J,"isActive"),this.tS=t}get transactionResult(){return this.iS}set transactionResult(t){null!==t&&Kt.t(t,"string",J,"transactionResult"),this.iS=t}}(t={})[t.Scroll=1]="Scroll",t[t.Zoom=2]="Zoom",t[t.None=3]="None";var $=t,it=((t={})[t.Zoom=1]="Zoom",t[t.Cancel=2]="Cancel",t[t.None=3]="None",t);class st extends J{FC;RC;IC;nS;oS;rS;lS;hS;aS;fS;Nm;Gh;constructor(t){super(),this.name="ToolManager",this.FC=new O,this.RC=new O,this.IC=new O,this.nS=850,this.oS=850,this.rS=new Yt(2,2).rt(),this.lS=5e3,this.hS=1,this.aS=1,this.fS=null,this.Nm=null,this.Gh=-1,t&&Object.assign(this,t)}static WheelScroll=1;static WheelZoom=2;static WheelNone=3;static GestureZoom=1;static GestureCancel=2;static GestureNone=3;get mouseWheelBehavior(){return this.hS}set mouseWheelBehavior(t){Kt.it(t,$,"WheelMode"),this.hS=t}get gestureBehavior(){return this.aS}set gestureBehavior(t){Kt.it(t,it,"GestureMode"),this.aS=t}initializeStandardTools(){}updateAdornments(t){var e,i=this.currentToolTip;i instanceof K&&this.Nm===t&&(e=i.adornedObject,(null!==t?e.part===t:null===e)?this.showToolTip(i,e):this.hideToolTip())}doMouseDown(){var e=this.diagram,t=e.lastInput;if(t.isTouchEvent&&2===this.gestureBehavior&&(t.bubbles=!1),t.isMultiTouch){if(this.cancelWaitAfter(),3===this.gestureBehavior)return void(t.bubbles=!0);if(2===this.gestureBehavior)return;if(e.currentTool.canStartMultiTouch())return void e.currentTool.standardPinchZoomStart()}var i=e.undoManager,s=(Ht,i.bu&&0!==i.transactionLevel&&Kt.ft("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero"),this.mouseDownTools.length);for(let t=0;tn.hideToolTip(),s)}}positionToolTip(t,e){var i,s,n,a;t.hasPlaceholder()||(t=t,s=(i=this.diagram).lastInput.documentPoint.copy(),n=t.measuredBounds,a=i.viewportBounds,i.lastInput.isTouchEvent&&(s.x-=n.width),s.x+n.width>a.right&&(s.x-=n.width+5/i.scale),s.xa.bottom?s.y-=n.height+5/i.scale:s.y+=20/i.scale,s.yn&&(n=o),l>a&&(a=l)))}return i===1/0?e.e(0,0,0,0):e.e(i,s,n-i,a-s),e}AS(t){if(null===this.copiedParts){var e=this.diagram;if(!(t&&(e.isReadOnly||e.isModelReadOnly)||null===this.draggedParts)){for(var i=e.undoManager,i=(i.isEnabled&&i.isInTransaction?null!==i.currentTransaction&&0!this.tF(t))}doUpdateCursor(t){var e=this.diagram;null!==t&&this.Su===t||(!this.diagram.currentTool.isActive||this.mayCopy()?e.currentCursor=this.copyCursor:this.mayMove()?e.currentCursor=this.moveCursor:this.mayDragOut()&&(e.currentCursor=this.nodropCursor))}VC(e,i){let s=!1,n=this.Sr.length;var a=0s.findValidLinkablePort(t,e)),a=_.a();let r=1/0,o=null;for(var l=n.iterator;l.next();){var h,u=l.value;null!==u.part&&(h=u.getDocumentPoint(Z.Center,a),(h=t.distanceSquaredPoint(h))t.wn=!1)}if(this.doDropOnto(t,i),this.isActive||null!==d.St){for(var l=Q.a(),h=e.selection.iterator;h.next();){var u=h.value;u instanceof D&&this.eF(e,u,l)}Q.o(l)}}}iF(t,e){var i=this.diagram,e=e.part;!i.handlesDragDropForTopLevelParts||!e.isTopLevel||e instanceof X||null!==(e=i.mouseDrop)&&e(t)}eF(e,i,s){if(i.canAvoid()){let t=!1;s=i.getAvoidableRect(s),e.viewportBounds.containsRect(s)&&(t=!0);var n=this.copiedParts||this.draggedParts,e=e.IS(s,t=>t.part,t=>t instanceof Y,!0,t=>t instanceof Y,t);if(0!==e.count)for(var a=e.iterator;a.next();){var r=a.value;n.contains(r)&&n.contains(i)||!r.isMemberOf(i)&&r.isAvoiding&&r.invalidateRoute()}}}doDropOnto(t,e){}doMouseMove(){var t,e;this.isActive&&(e=(t=this.diagram).lastInput,this.simulatedMouseMove(e.event,e.documentPoint,e.targetDiagram)||null!==this.currentPart&&null!==this.draggedParts&&(this.mayCopy()?(this.AS(!1),t.qw(this.copiedParts),this.kf(this.copiedParts,!1),t.Lm(this.copiedParts)):this.mayMove()?(this.Ll(),this.kf(this.draggedParts,!0)):this.mayDragOut()?(this.AS(!1),this.kf(this.copiedParts,!1)):this.Ll(),this.TS(t.lastInput.documentPoint)))}doMouseUp(){if(this.isActive){var e=this.diagram,i=e.lastInput;if(!this.simulatedMouseUp(i.event,i.documentPoint,i.targetDiagram)){let t=!1;var s,i=this.mayCopy();i&&null!==this.copiedParts?(this.Ll(),this.AS(!0),e.qw(this.copiedParts),this.kf(this.copiedParts,!1),e.Lm(this.copiedParts),null!==this.copiedParts&&(e.V("ChangingSelection",e.selection),e.clearSelection(!0),this.copiedParts.iteratorKeys.each(t=>{t.isSelected=!0}))):(t=!0,this.Ll(),this.mayMove()&&(this.kf(this.draggedParts,!0),this.TS(e.lastInput.documentPoint))),this.ku=!0,this.KC(e.lastInput.documentPoint),this.isActive&&(s=(i?this.copiedParts:this.draggedParts).toKeySet(),this.copiedParts=null,t&&this.sF(),e.invalidateDocumentBounds(),e.Lm(this.draggedParts),this.transactionResult=i?"Copy":"Move",e.V(i?"SelectionCopied":"SelectionMoved",s)),this.stopTool(),i&&e.V("ChangedSelection",e.selection)}}}simulatedMouseMove(e,i,s){if(null===d.St)return!1;var t=d.St.diagram,n=(s instanceof q||(s=null),d.vh);if(s!==n&&(null!==n&&n!==t&&(n.stopAutoScroll(),d.St.isDragOutStarted=!1,null!==(n=n.toolManager.findTool("Dragging")))&&n.doSimulatedDragLeave(),null!==(d.vh=s)&&s!==t&&(d.St.BC(),null!==(n=s.toolManager.findTool("Dragging")))&&(n.UC(),n.doSimulatedDragEnter()),this.doUpdateCursor(null)),null===s||s===t||!s.allowDrop||s.isReadOnly||!s.allowInsert)return!1;n=s.toolManager.findTool("Dragging");if(null!==n){let t=i;null!==e&&(void 0!==e.targetTouches&&(0{t.isSelected=!0,s.add(t)})),this.KC(t.lastInput.documentPoint),t.invalidateDocumentBounds(),null!==this.copiedParts&&(this.transactionResult="ExternalCopy"),this.copiedParts=null,t.doFocus(),t.V("ExternalObjectsDropped",s,i),this.stopTransaction(),t.V("ChangedSelection",t.selection)}t.animationManager.Nu=!1}GC(t,e,i){if(null===this.copiedParts){var s=this.diagram;if(!s.isReadOnly&&!s.isModelReadOnly){s.skipsUndoManager=!e,s.partManager.addsToTemporaryLayer=!e,this.startPoint=i.documentPoint;for(var n=s.copyParts(t,s,!0),e=Q.a(),a=(this._D(t,e),e.x+e.width/2),r=e.y+e.height/2,o=(Q.o(e),this.Cm),l=new L,h=_.a(),u=t.iterator;u.next();){var d,c=u.value;c instanceof Y&&c.canCopy()&&null!==(d=n.getValue(c))&&(d.points=c.points,d.Mr(o.x-a,o.y-r),d.wn=!0,l.add(d,this.Us()))}for(var g=t.iterator;g.next();){var m,f=g.value;f.De()&&f.canCopy()&&null!==(m=n.getValue(f))&&(f=f.location,h.e(o.x-(a-f.x),o.y-(r-f.y)),m.location=h,m.ensureBounds(),l.add(m,this.Us(h)))}_.o(h),this.copiedParts=l,this.MS(l.toKeySet()),null!==this.draggedLink&&(s=(i=this.draggedLink).routeBounds,i.Mr(this.startPoint.x-(s.x+s.width/2),this.startPoint.y-(s.y+s.height/2))),this.doUpdateCursor(null)}}}$D(){this.isDragOutStarted=!0,this.ku=!1,d.St=this,d.vh=this.diagram,this.doSimulatedDragOut()}doSimulatedDragOut(){var t=this.diagram;t.Am=!1,this.mayCopy()||this.mayMove()?t.currentCursor="":t.currentCursor=this.nodropCursor,this.Su=null}computeMove(t,e,i,s){var n=this.diagram;return null!==n?n.computeMove(t,e,this.dragOptions,s):new _}static Ww=new O;static St=null;static vh=null}st.prototype.doCancel=function(){null!==d.St&&d.St.doCancel(),J.prototype.doCancel.call(this)};class nt extends J{OS;ES;Dl;VS;BS;qh;zS;Wh;XS;YS;KS;US;GS;HS;HC;vS;Fl;qS;constructor(){super(),this.OS=100,this.ES=!1,this.Dl="pointer",this.VS=new Y({layerName:"Tool"}).add(new G({isPanelMain:!0,stroke:"blue"}).theme("stroke","tempLink"),new G({toArrow:"Standard",fill:"blue",stroke:"blue"}).theme("fill","tempLink").theme("stroke","tempLink")).ui(),this.qh=new G("Rectangle",{portId:"",fill:null,stroke:"magenta",strokeWidth:2,desiredSize:Yt.Bk}).theme("stroke","tempPort"),this.BS=new D({selectable:!1,layerName:"Tool"}).add(this.qh).ui(),this.Wh=new G("Rectangle",{portId:"",fill:null,stroke:"magenta",strokeWidth:2,desiredSize:Yt.Bk}).theme("stroke","tempPort"),this.zS=new D({selectable:!1,layerName:"Tool"}).add(this.Wh).ui(),this.XS=null,this.YS=null,this.KS=null,this.US=null,this.GS=null,this.HS=!0,this.HC=new L,this.vS=null,this.Fl=null,this.qS=null}doStop(){this.diagram.stopAutoScroll(),this.originalLink=null,this.originalFromNode=null,this.originalFromPort=null,this.originalToNode=null,this.originalToPort=null,this.validPortsCache.clear(),this.targetPort=null}get portGravity(){return this.OS}set portGravity(t){Kt.t(t,"number",nt,"portGravity"),0<=t&&(this.OS=t)}get isUnconnectedLinkValid(){return this.ES}set isUnconnectedLinkValid(t){Kt.t(t,"boolean",nt,"isUnconnectedLinkValid"),this.ES=t}get linkingCursor(){return this.Dl}set linkingCursor(t){this.Dl=t}get temporaryLink(){return this.VS}set temporaryLink(t){Kt.s(t,Y,nt,"temporaryLink"),t.ui(),this.VS=t}get temporaryFromNode(){return this.BS}set temporaryFromNode(t){Kt.s(t,D,nt,"temporaryFromNode"),t.ui(),(this.BS=t)&&(this.qh=t.port)}get temporaryFromPort(){return this.qh}set temporaryFromPort(t){var e,i;Kt.s(t,y,nt,"temporaryFromPort"),null!==this.qh&&null!==(e=this.qh.panel)&&(i=e.F.indexOf(this.qh),e.removeAt(i),e.insertAt(i,t)),this.qh=t}get temporaryToNode(){return this.zS}set temporaryToNode(t){Kt.s(t,D,nt,"temporaryToNode"),t.ui(),(this.zS=t)&&(this.Wh=t.port)}get temporaryToPort(){return this.Wh}set temporaryToPort(t){var e,i;Kt.s(t,y,nt,"temporaryToPort"),null!==this.Wh&&null!==(e=this.Wh.panel)&&(i=e.F.indexOf(this.Wh),e.removeAt(i),e.insertAt(i,t)),this.Wh=t}get originalLink(){return this.XS}set originalLink(t){null!==t&&Kt.s(t,Y,nt,"originalLink"),this.XS=t}get originalFromNode(){return this.YS}set originalFromNode(t){null!==t&&Kt.s(t,D,nt,"originalFromNode"),this.YS=t}get originalFromPort(){return this.KS}set originalFromPort(t){null!==t&&Kt.s(t,y,nt,"originalFromPort"),this.KS=t}get originalToNode(){return this.US}set originalToNode(t){null!==t&&Kt.s(t,D,nt,"originalToNode"),this.US=t}get originalToPort(){return this.GS}set originalToPort(t){null!==t&&Kt.s(t,y,nt,"originalToPort"),this.GS=t}get isForwards(){return this.HS}set isForwards(t){this.HS=t}get validPortsCache(){return this.HC}get targetPort(){return this.vS}set targetPort(t){null!==t&&Kt.s(t,y,nt,"targetPort"),this.vS=t}copyPortProperties(t,e,i,s,n){var a,r;null!==t&&null!==e&&null!==i&&null!==s&&(r=e.getDocumentScale(),(a=Yt.a()).width=e.naturalBounds.width*r,a.height=e.naturalBounds.height*r,s.desiredSize=a,Yt.o(a),n?(s.toSpot=e.toSpot,s.toEndSegmentLength=e.toEndSegmentLength):(s.fromSpot=e.fromSpot,s.fromEndSegmentLength=e.fromEndSegmentLength),i.locationSpot=Z.Center,r=_.a(),i.location=e.getDocumentPoint(Z.Center,r),_.o(r),s.angle=e.getDocumentAngle(),null!==this.portTargeted)&&this.portTargeted(t,e,i,s,n)}setNoTargetPortProperties(t,e,i){null!==e&&(e.desiredSize=Yt.Bk,e.fromSpot=Z.None,e.toSpot=Z.None),null!==t&&(t.location=this.diagram.lastInput.documentPoint),null!==this.portTargeted&&this.portTargeted(null,null,t,e,i)}doMouseDown(){this.isActive&&this.doMouseMove()}doMouseMove(){var t,e;this.isActive&&(t=this.diagram,this.targetPort=this.findTargetPort(this.isForwards),null!==this.targetPort&&this.targetPort.part instanceof D?(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)):this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1),t.allowHorizontalScroll||t.allowVerticalScroll)&&t.doAutoScroll(t.lastInput.viewPoint)}findValidLinkablePort(t,e){if(null!==t){var i=t.part;if(i instanceof D)for(;null!==t;){var s=e?t.toLinkable:t.fromLinkable;if(!0===s&&(null!==t.portId||t instanceof D)&&(e?this.isValidTo(i,t):this.isValidFrom(i,t)))return t;if(!1===s)return null;t=t.panel}}return null}findTargetPort(e){var t=this.diagram,i=t.lastInput.documentPoint;let s=this.portGravity;s<=0&&(s=.1);const n=this,a=t.findObjectsNear(i,s,t=>n.findValidLinkablePort(t,e),null,!0);let r=1/0,o=null;for(var l=a.iterator;l.next();){var h,u,d,c=l.value,g=c.part;g instanceof D&&(u=c.getDocumentPoint(Z.Center,_.a()),d=i.x-u.x,h=i.y-u.y,_.o(u),(u=d*d+h*h)=s)return!1}return!0}isValidTo(e,i){if(null===e||null===i)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==e.layer&&!e.layer.allowLink||!0!==i.toLinkable))return!1;var s=i.toMaxLinks;if(s<1/0){if(null!==this.originalLink&&e===this.originalToNode&&i===this.originalToPort)return!0;let t=i.portId;if(null===t&&(t=""),e.findLinksInto(t).count>=s)return!1}return!0}isInSameNode(t,e){return null!==t&&null!==e&&(t===e||(t=t.part,e=e.part,null!==t&&t===e))}isLinked(i,s){if(null!==i&&null!==s){var n=i.part;if(n instanceof D){let e=i.portId;null===e&&(e="");i=s.part;if(i instanceof D){let t=s.portId;null===t&&(t="");for(var a=i.findLinksInto(t);a.next();){var r=a.value;if(r.fromNode===n&&r.fromPortId===e)return!0}}}}return!1}isValidLink(t,e,i,s){if(!this.isValidFrom(t,e)||!this.isValidTo(i,s)||null!==e&&null!==s&&((!e.fromLinkableSelfNode||!s.toLinkableSelfNode)&&this.isInSameNode(e,s)||(!e.fromLinkableDuplicates||!s.toLinkableDuplicates)&&this.isLinked(e,s))||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;let n;return!(null!==t&&null!==(n=t.linkValidation)&&!n(t,e,i,s,this.originalLink)||null!==i&&null!==(n=i.linkValidation)&&!n(t,e,i,s,this.originalLink))&&(null===(n=this.linkValidation)||n(t,e,i,s,this.originalLink))}isLabelDependentOnLink(t,e){var i,s;return null!==t&&null!==(i=t.labeledLink)&&(i===e||((s=new N).add(t),this.WS(i,e,s)))}WS(t,e,i){var s;return t===e||!(null===(s=t.fromNode)||!s.isLinkLabel||(i.add(s),!this.WS(s.labeledLink,e,i)))||!(null===(s=t.toNode)||!s.isLinkLabel||(i.add(s),!this.WS(s.labeledLink,e,i)))}isValidCycle(t,e,i){if(void 0===i&&(i=null),null===t||null===e)return this.isUnconnectedLinkValid;var s=this.diagram.validCycle;if(1===s)return!0;if(5===s){var n=i||this.temporaryLink;if(null!==n&&!n.isTreeLink)return!0;for(var a=e.linksConnected;a.next();){var r=a.value;if(r!==i&&r.isTreeLink&&r.toNode===e)return!1}}else{if(6!==s)return 2===s?!this.nF(t,e,i):3===s?!this.Cu(t,e,i,!1):4!==s||!this.oF(t,e,i);n=i||this.temporaryLink;if(null!==n&&!n.isTreeLink)return!0;for(var o=t.linksConnected;o.next();){var l=o.value;if(l!==i&&l.isTreeLink&&l.fromNode===t)return!1}}return!this.Cu(t,e,i,!0)}Cu(t,e,i,s){if(t===e)return!0;if(null!==t&&null!==e)for(var n=t.linksConnected;n.next();){var a=n.value;if(a!==i&&(!s||a.isTreeLink)&&a.toNode===t){a=a.fromNode;if(a!==t&&this.Cu(a,e,i,s))return!0}}return!1}nF(t,e,i){var s;return t===e||((s=new N).add(e),this.vC(s,t,e,i))}vC(t,e,i,s){if(e===i)return!0;if(null!==e&&null!==i&&!t.contains(e)){t.add(e);for(var n=e.linksConnected;n.next();){var a=n.value;if(a!==s&&a.toNode===e){a=a.fromNode;if(a!==e&&this.vC(t,a,i,s))return!0}}}return!1}oF(t,e,i){var s;return t===e||((s=new N).add(e),this.qC(s,t,e,i))}qC(t,e,i,s){if(e===i)return!0;if(null!==e&&null!==i&&!t.contains(e)){t.add(e);for(var n=e.linksConnected;n.next();){var a=n.value;if(a!==s){var r=a.fromNode,a=a.toNode,a=r===e?a:r;if(a!==e&&this.qC(t,a,i,s))return!0}}}return!1}get linkValidation(){return this.Fl}set linkValidation(t){null!==t&&Kt.t(t,"function",nt,"linkValidation"),this.Fl=t}get portTargeted(){return this.qS}set portTargeted(t){null!==t&&Kt.t(t,"function",nt,"portTargeted"),this.qS=t}}(t={})[t.Either=1]="Either",t[t.ForwardsOnly=2]="ForwardsOnly",t[t.BackwardsOnly=3]="BackwardsOnly";var at=t;class rt extends nt{jS;JS;C;ZS;constructor(t){super(),this.name="Linking",this.jS={},this.JS=null,this.C=1,this.ZS=null,t&&Object.assign(this,t)}static Either=1;static ForwardsOnly=2;static BackwardsOnly=3;get archetypeLinkData(){return this.jS}set archetypeLinkData(t){null!==t&&Kt.t(t,"object",rt,"archetypeLinkData"),t instanceof y&&Kt.s(t,Y,rt,"archetypeLinkData"),this.jS=t}get archetypeLabelNodeData(){return this.JS}set archetypeLabelNodeData(t){null!==t&&Kt.t(t,"object",rt,"archetypeLabelNodeData"),t instanceof y&&Kt.s(t,D,rt,"archetypeLabelNodeData"),this.JS=t}get direction(){return this.C}set direction(t){Kt.it(t,at,"LinkingDirection"),this.C=t}get startObject(){return this.ZS}set startObject(t){null!==t&&Kt.s(t,y,rt,"startObject"),this.ZS=t}canStart(){var t;return!(!this.isEnabled||(t=this.diagram).isReadOnly||t.isModelReadOnly||!t.allowLink||!t.model.jw()||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize()||null===this.findLinkablePort())}findLinkablePort(){var t=this.diagram;let e=this.startObject;if(null!==(e=null===e?t.findObjectAt(t.firstInput.documentPoint,null,null):e)){t=e.part;if(t instanceof D){var i=this.direction;if(1===i||2===i){var s=this.findValidLinkablePort(e,!1);if(null!==s)return this.isForwards=!0,s;if(this.startObject===t){s=t.port;if(this.findValidLinkablePort(s,!1))return this.isForwards=!0,s}}if(1===i||3===i){s=this.findValidLinkablePort(e,!0);if(null!==s)return this.isForwards=!1,s;if(this.startObject===t){i=t.port;if(this.findValidLinkablePort(i,!0))return this.isForwards=!1,i}}}}return null}doActivate(){var t,e=this.diagram,i=this.findLinkablePort();null===i?this.stopTool():(this.startTransaction(this.name),e.isMouseCaptured=!0,e.currentCursor=this.linkingCursor,this.isForwards?(null!==this.temporaryToNode&&(this.temporaryToNode.location=e.lastInput.documentPoint),this.originalFromPort=i,(t=this.originalFromPort.part)instanceof D&&(this.originalFromNode=t),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(null!==this.temporaryFromNode&&(this.temporaryFromNode.location=e.lastInput.documentPoint),this.originalToPort=i,(t=this.originalToPort.part)instanceof D&&(this.originalToNode=t),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),e.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.ensureBounds(),e.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.ensureBounds(),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.invalidateRoute(),e.add(this.temporaryLink)),this.isActive=!0)}doDeactivate(){this.isActive=!1;var t=this.diagram;t.remove(this.temporaryLink),t.remove(this.temporaryFromNode),t.remove(this.temporaryToNode),t.isMouseCaptured=!1,t.currentCursor="",this.stopTransaction()}doStop(){super.doStop(),this.startObject=null}doMouseUp(){if(this.isActive){var a=this.diagram;let t=this.transactionResult=null,e=null,i=null,s=null,n=null;try{this.targetPort=this.findTargetPort(this.isForwards);var r,o=this.targetPort;null!==o?(r=o.part)instanceof D&&(this.isForwards?(null!==this.originalFromNode&&(t=this.originalFromNode,e=this.originalFromPort),i=r,s=o):(t=r,e=o,null!==this.originalToNode&&(i=this.originalToNode,s=this.originalToPort))):this.isForwards?null!==this.originalFromNode&&this.isUnconnectedLinkValid&&(t=this.originalFromNode,e=this.originalFromPort):null!==this.originalToNode&&this.isUnconnectedLinkValid&&(i=this.originalToNode,s=this.originalToPort),null!==t||null!==i?null!==(n=this.insertLink(t,e,i,s))?(null===o&&(this.isForwards?n.defaultToPoint=a.lastInput.documentPoint:n.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.V("ChangingSelection",a.selection),a.clearSelection(!0),n.isSelected=!0),this.transactionResult=this.name,a.V("LinkDrawn",n)):this.doNoLink(t,e,i,s):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),n&&a.allowSelect&&a.V("ChangedSelection",a.selection)}}}isNewTreeLink(){var t,e=this.archetypeLinkData;return null===e||(e instanceof Y?e.isTreeLink:null===(t=this.diagram)||(e=t.partManager.getLinkCategoryForData(e),null===(t=t.partManager.findLinkTemplateForCategory(e)))||t.isTreeLink)}insertLink(t,e,i,s){return this.diagram.partManager.insertLink(t,e,i,s)}doNoLink(t,e,i,s){}}class ot extends nt{$S;QS;ws;_S;constructor(t){super(),this.name="Relinking",this.$S=new G("Diamond",{desiredSize:Yt.du,fill:"lightblue",stroke:"dodgerblue",cursor:this.linkingCursor,segmentIndex:0}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.QS=new G("Diamond",{desiredSize:Yt.du,fill:"lightblue",stroke:"dodgerblue",cursor:this.linkingCursor,segmentIndex:-1}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.ws=null,this._S=new Q,t&&Object.assign(this,t)}updateAdornments(i){if(null!==i&&i instanceof Y){let t="RelinkFrom",e=null;var s;i.isSelected&&!this.diagram.isReadOnly&&null!==(s=i.selectionObject)&&i.canRelinkFrom()&&i.actualBounds.isReal()&&i.isVisible()&&s.actualBounds.isReal()&&s.isVisibleObject()&&null===(e=i.findAdornment(t))&&(e=this.makeAdornment(s,!1),i.addAdornment(t,e)),null===e&&i.removeAdornment(t),t="RelinkTo",e=null,i.isSelected&&!this.diagram.isReadOnly&&null!==(s=i.selectionObject)&&i.canRelinkTo()&&i.actualBounds.isReal()&&i.isVisible()&&s.actualBounds.isReal()&&s.isVisibleObject()&&(null===(e=i.findAdornment(t))?(e=this.makeAdornment(s,!0),i.addAdornment(t,e)):e.u()),null===e&&i.removeAdornment(t)}}makeAdornment(t,e){var i=new K,e=(i.type=Xt.Link,e?this.toHandleArchetype:this.fromHandleArchetype);return null!==e&&i.add(e.copy().Tm()),i.adornedObject=t,i}get fromHandleArchetype(){return this.$S}set fromHandleArchetype(t){null!==t&&Kt.s(t,y,ot,"fromHandleArchetype"),this.$S=t}get toHandleArchetype(){return this.QS}set toHandleArchetype(t){null!==t&&Kt.s(t,y,ot,"toHandleArchetype"),this.QS=t}get handle(){return this.ws}set handle(t){if(null!==t&&(Kt.s(t,y,ot,"handle"),!(t.part instanceof K)))throw new Error("new handle is not in an Adornment: "+t);this.ws=t}canStart(){if(!this.isEnabled)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowRelink||!t.model.jw()||!t.lastInput.left)return!1;let e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkFrom");return null!==(e=null===e?this.findToolHandleAt(t.firstInput.documentPoint,"RelinkTo"):e)}doActivate(){var e=this.diagram;if(null===this.originalLink){let t=this.handle;if(null===(t=null===t&&null===(t=this.findToolHandleAt(e.firstInput.documentPoint,"RelinkFrom"))?this.findToolHandleAt(e.firstInput.documentPoint,"RelinkTo"):t))return;var i=t.part;if(!(i instanceof K&&i.adornedPart instanceof Y))return;this.handle=t,this.isForwards=null===i||"RelinkTo"===i.category,this.originalLink=i.adornedPart}this.startTransaction(this.name),e.isMouseCaptured=!0,e.currentCursor=this.linkingCursor,this.originalFromPort=this.originalLink.fromPort,this.originalFromNode=this.originalLink.fromNode,this.originalToPort=this.originalLink.toPort,this.originalToNode=this.originalLink.toNode,this._S.set(this.originalLink.actualBounds),null!==this.originalLink&&0t.firstPickIndex+1&&et.width&&(t.width=e.width),!isNaN(e.height)&&e.height>t.height&&(t.height=e.height),t}computeMaxSize(){var t=this.adornedObject.maxSize.copy(),e=this.maxSize;return!isNaN(e.width)&&e.widtht-i&&(e=(Math.floor(e/t)+1)*t)),360<=e?e-=360:e<0&&(e+=360),e}get snapAngleMultiple(){return this.hM}set snapAngleMultiple(t){Kt.t(t,"number",ut,"snapAngleMultiple"),this.hM=t}get snapAngleEpsilon(){return this.aM}set snapAngleEpsilon(t){Kt.t(t,"number",ut,"snapAngleEpsilon"),this.aM=t}get originalAngle(){return this.fM}get rotationPoint(){return this.Rm}set rotationPoint(t){this.Rm=t.copy()}get handleAngle(){return this.cM}set handleAngle(t){Kt.t(t,"number",ut,"handleAngle"),this.cM=t}get handleDistance(){return this.uM}set handleDistance(t){Kt.t(t,"number",ut,"handleDistance"),this.uM=t}}class dt extends J{constructor(t){super(),this.name="ClickSelecting",t&&Object.assign(this,t)}canStart(){return!(!this.isEnabled||this.isBeyondDragSize())}doMouseUp(){this.isActive&&(this.standardMouseSelect(),this.standardMouseClick()||this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()}}class ct extends J{Pf;constructor(t){super(),this.name="Action",this.Pf=null,t&&Object.assign(this,t)}canStart(){var t,e,i;return!(!this.isEnabled||(e=(t=this.diagram).lastInput,null===(i=t.findObjectAt(e.documentPoint,t=>{for(;null!==t.panel;){if(t.isActionable)return t;t=t.panel}return t})))||!i.isActionable||(this.Pf=i,t.wf=t.findObjectAt(e.documentPoint,null,null),0))}doMouseDown(){var t,e;this.isActive?(t=this.diagram.lastInput,null!==(e=this.Pf)&&null!==(t.targetObject=e).actionDown&&e.actionDown(t,e)):this.canStart()&&this.doActivate()}doMouseMove(){var t,e;this.isActive&&(t=this.diagram.lastInput,null!==(e=this.Pf))&&null!==(t.targetObject=e).actionMove&&e.actionMove(t,e)}doMouseUp(){if(this.isActive){const t=this.diagram.lastInput,e=this.Pf;if(null===e)return;null!==(t.targetObject=e).actionUp&&e.actionUp(t,e),this.standardMouseClick(t=>{for(;null!==t.panel;){if(t.isActionable&&t===e)return t;t=t.panel}return t},t=>t===e)}this.stopTool()}doCancel(){var t=this.diagram.lastInput,e=this.Pf;null!==e&&(null!==(t.targetObject=e).actionCancel&&e.actionCancel(t,e),this.stopTool())}doStop(){this.Pf=null}}class gt extends J{Ol;dM;Sf;gM;constructor(t){super(),this.name="ClickCreating",this.Ol=null,this.dM=!0,this.Sf=!1,this.gM=new _(0,0),t&&Object.assign(this,t)}canStart(){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.gM=t.lastInput.viewPoint.copy()),2!==t.lastInput.clickCount||this.isBeyondDragSize(this.gM))return!1}else if(1!==t.lastInput.clickCount)return!1;return!(t.currentTool!==this&&null!==t.findPartAt(t.lastInput.documentPoint,!0))}doMouseUp(){var t=this.diagram;this.isActive&&this.insertPart(t.lastInput.documentPoint),this.stopTool()}insertPart(t){var e,i,s=this.diagram,n=this.archetypeNodeData;if(null===n)return null;let a=null;try{s.V("ChangingSelection",s.selection),this.startTransaction(this.name),n instanceof H?n.De()&&(n.ui(),null!==(a=n.copy()))&&s.add(a):null!==n&&(e=s.model.copyNodeData(n),Kt.Mt(e))&&(s.model.addNodeData(e),a=s.findPartForData(e)),null!==a&&(i=_.H(t.x,t.y),this.isGridSnapEnabled&&this.diagram.mM(a,t,i),a.location=i,s.allowSelect&&(s.clearSelection(!0),a.isSelected=!0),_.o(i)),s.invalidateDocumentBounds(),this.transactionResult=this.name,s.V("PartCreated",a)}finally{this.stopTransaction(),s.V("ChangedSelection",s.selection)}return a}get archetypeNodeData(){return this.Ol}set archetypeNodeData(t){null!==t&&Kt.t(t,"object",gt,"archetypeNodeData"),this.Ol=t}get isDoubleClick(){return this.dM}set isDoubleClick(t){Kt.t(t,"boolean",gt,"isDoubleClick"),this.dM=t}get isGridSnapEnabled(){return this.Sf}set isGridSnapEnabled(t){Kt.t(t,"boolean",gt,"isGridSnapEnabled"),this.Sf=t}}class mt extends J{Hh;pM;El;constructor(t){super(),this.name="DragSelecting",this.Hh=175,this.pM=!1,this.El=new H({layerName:"Tool",selectable:!1}).add(new G("Rectangle",{name:"SHAPE",fill:null,stroke:"magenta"}).theme("stroke","dragSelect")).ui(),t&&Object.assign(this,t)}canStart(){var t,e;return!!this.isEnabled&&!!(t=this.diagram).allowSelect&&!(!(e=t.lastInput).left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.timestamp-t.firstInput.timestamp{var t=e.diagram;null!==t&&t.Ti(v.document,"scroll",e.yM,!1),e.stopTool()},t&&Object.assign(this,t)}canStart(){var t;return!!this.isEnabled&&!(!(t=this.diagram).allowHorizontalScroll&&!t.allowVerticalScroll||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize())}doActivate(){var t=this.diagram;this.Ro?(t.lastInput.bubbles=!0,t.Ht(v.document,"scroll",this.yM,!1)):(t.currentCursor="move",t.isMouseCaptured=!0,this._w.c(t.position)),this.isActive=!0}doDeactivate(){var t=this.diagram;t.currentCursor="",t.isMouseCaptured=!1,this.isActive=!1}doCancel(){var t=this.diagram;t.position=this._w,t.isMouseCaptured=!1,this.stopTool()}doMouseMove(){this.jC()}doMouseUp(){this.jC(),this.stopTool()}jC(){var i=this.diagram;if(this.isActive&&i)if(this.Ro)i.lastInput.bubbles=!0;else{var s=i.position,n=i.firstInput.documentPoint,a=i.lastInput.documentPoint;let t=s.x+n.x-a.x,e=s.y+n.y-a.y;i.allowHorizontalScroll||(t=s.x),i.allowVerticalScroll||(e=s.y),i.position=this.WC.e(t,e)}}get bubbles(){return this.Ro}set bubbles(t){Kt.t(t,"boolean",ft,"bubbles"),this.Ro=t}get originalPosition(){return this._w}}class pt{tx;ix;wM;xM;constructor(t){this.tx=null,this.ix=null,this.wM=null,this.xM=null,t&&Object.assign(this,t)}get mainElement(){return this.wM}set mainElement(t){null!==t&&Kt.s(t,HTMLElement,pt,"mainElement"),this.wM=t}get show(){return this.tx}set show(t){this.tx!==t&&(null!==t&&Kt.t(t,"function",pt,"show"),this.tx=t)}get hide(){return this.ix}set hide(t){this.ix!==t&&(null!==t&&Kt.t(t,"function",pt,"hide"),this.ix=t)}get valueFunction(){return this.xM}set valueFunction(t){this.xM=t}}class vt{di;Im;Cf;constructor(t,e,i){this.di=t,this.Im=e,this.Cf=i}}class yt extends J{bM;ex;kM;SM;sx;nx;ox;constructor(t){super(),this.name="ContextMenu",this.bM=null,this.ex=null,this.kM=null,this.SM=new _,this.sx=null,this.ox=!1;const e=this;this.nx=()=>e.stopTool(),t&&Object.assign(this,t)}lF(){var t=new pt;t.show=(t,e,i)=>i.showDefaultContextMenu(),t.hide=(t,e)=>e.hideDefaultContextMenu(),yt.Au=t;const e=this;this.nx=()=>e.stopTool();var t=Kt.hn("div"),i=Kt.hn("div"),s=(t.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;",Kt.hn("style")),s=(v.document.getElementsByTagName("head")[0].appendChild(s),s.sheet.insertRule(".goCXul { list-style: none; }",0),s.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),s.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),this.diagram);null!==s&&(s.Ht(t,"contextmenu",yt.jh,!1),s.Ht(t,"selectstart",yt.jh,!1),s.Ht(i,"contextmenu",yt.jh,!1)),t.className="goCXforeground",i.className="goCXbackground",v.document.body&&(v.document.body.appendChild(t),v.document.body.appendChild(i)),yt.Om=t,yt.Em=i,yt.MM=!0}static Au=null;static MM=!1;static Em=null;static Om=null;static jh(t){return t.preventDefault(),!1}canStart(){var t;return!(!this.isEnabled||(t=this.diagram,this.isBeyondDragSize())||!t.lastInput.right||1!t.layer.isTemporary))){let t=s;for(;null!==t;){if(null!==t.contextMenu)return t;t=t.panel}if(e.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return s.part}else if(null!==e.contextMenu)return e;return null}doActivate(){}doMouseDown(){var t;super.doMouseDown(),this.isActive&&this.currentContextMenu instanceof K&&null!==(t=this.diagram.toolManager.findTool("Action"))&&t.canStart()&&(t.doActivate(),t.doMouseDown(),t.doDeactivate()),this.diagram.toolManager.mouseDownTools.contains(this)&&this.doContextClick()}doMouseUp(){var t;this.isActive&&this.currentContextMenu instanceof K&&null!==(t=this.diagram.toolManager.findTool("Action"))&&t.canStart()&&(t.doActivate(),t.doCancel(),t.doDeactivate()),this.doContextClick()}doContextClick(){var e=this.diagram;if(this.isActive){var i=this.currentContextMenu;if(null!==i){let t=null;i instanceof pt||null!==(t=e.findObjectAt(e.lastInput.documentPoint,null,null))&&t.isContainedBy(i)&&this.standardMouseClick(null,null),this.maybeStopTool(t)}}else this.canStart()&&(this.openMenu(!0),this.isActive||this.stopTool())}maybeStopTool(t){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this).doMouseUp()}openMenu(t,e){var i;void 0===e&&(e=null),this.ox||(this.ox=!0,t&&this.standardMouseSelect(),t=this.standardMouseClick(),this.ox=!1,t)||(this.isActive=!0,t=yt.Au,null!==(e=null===e?this.findObjectWithContextMenu():e)?null!==(i=e.contextMenu)?(this.currentObject=e instanceof y?e:null,this.showContextMenu(i,this.currentObject)):null!==t&&this.showContextMenu(t,this.currentObject):null!==t&&this.showContextMenu(t,null),this.currentContextMenu instanceof K&&!this.currentContextMenu.visible&&this.stopTool())}doMouseMove(){var t=this.diagram.toolManager.findTool("Action");null!==t&&t.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()}showContextMenu(t,e){Ht,t instanceof K||t instanceof pt||Kt.n("showContextMenu:contextMenu must be an Adornment or HTMLInfo."),null!==e&&Kt.s(e,y,yt,"showContextMenu:obj");var i,s,n=this.diagram;t!==this.currentContextMenu&&this.hideContextMenu(),t instanceof K?((i=t).layerName="Tool",i.selectable=!1,i.scale=1/n.scale,i.category=this.name,i.hasPlaceholder()&&(i.placeholder.scale=n.scale),null!==(s=i.diagram)&&s!==n&&s.remove(i),n.add(i),null!==e?i.adornedObject=e:i.data=n.model,i.ensureBounds(),this.positionContextMenu(i,e)):t instanceof pt&&t.show(e,n,this),this.currentContextMenu=t}positionContextMenu(t,e){var i,s,n,a;t.hasPlaceholder()||(t=t,s=(i=this.diagram).lastInput.documentPoint.copy(),n=t.measuredBounds,a=i.viewportBounds,i.lastInput.isTouchEvent&&(s.x-=n.width),s.x+n.width>a.right&&(s.x-=n.width+5/i.scale),s.xa.bottom&&(s.y-=n.height+5/i.scale),s.yt.commandHandler.copySelection(),t=>t.commandHandler.canCopySelection())),t.add(new vt("Cut",t=>t.commandHandler.cutSelection(),t=>t.commandHandler.canCutSelection())),t.add(new vt("Delete",t=>t.commandHandler.deleteSelection(),t=>t.commandHandler.canDeleteSelection())),t.add(new vt("Paste",t=>t.commandHandler.pasteSelection(e.mouseDownPoint),t=>t.commandHandler.canPasteSelection(e.mouseDownPoint))),t.add(new vt("Select All",t=>t.commandHandler.selectAll(),t=>t.commandHandler.canSelectAll())),t.add(new vt("Undo",t=>t.commandHandler.undo(),t=>t.commandHandler.canUndo())),t.add(new vt("Redo",t=>t.commandHandler.redo(),t=>t.commandHandler.canRedo())),t.add(new vt("Scroll To Part",t=>t.commandHandler.scrollToPart(),t=>t.commandHandler.canScrollToPart())),t.add(new vt("Zoom To Fit",t=>t.commandHandler.zoomToFit(),t=>t.commandHandler.canZoomToFit())),t.add(new vt("Reset Zoom",t=>t.commandHandler.resetZoom(),t=>t.commandHandler.canResetZoom())),t.add(new vt("Group Selection",t=>t.commandHandler.groupSelection(),t=>t.commandHandler.canGroupSelection())),t.add(new vt("Ungroup Selection",t=>t.commandHandler.ungroupSelection(),t=>t.commandHandler.canUngroupSelection())),t.add(new vt("Edit Text",t=>t.commandHandler.editTextBlock(),t=>t.commandHandler.canEditTextBlock())),t}showDefaultContextMenu(){const e=this.diagram,i=(null===this.sx&&(this.sx=this.hF()),yt.Om.innerHTML="",yt.Em.addEventListener("pointerdown",this.nx,!1),this),t=Kt.hn("ul");t.className="goCXul",yt.Om.appendChild(t),t.innerHTML="";for(var s=this.sx.iterator;s.next();){var n=s.value,a=n.Im,r=n.Cf;"function"!=typeof a||"function"==typeof r&&!r(e)||((a=Kt.hn("li")).className="goCXli",(r=Kt.hn("a")).className="goCXa",r.href="#",r.Im=n.Im,r.addEventListener("pointerdown",function(t){return this.Im(e),i.stopTool(),t.preventDefault(),!1},!1),r.textContent=n.di,a.appendChild(r),t.appendChild(a))}yt.Om.style.display="block",yt.Em.style.display="block"}hideDefaultContextMenu(){var t;null!==this.currentContextMenu&&this.currentContextMenu===yt.Au&&(yt.Om.style.display="none",yt.Em.style.display="none",null!==(t=this.diagram)&&t.Ti(yt.Em,"pointerdown",this.nx,!1),this.currentContextMenu=null)}get currentContextMenu(){return this.bM}set currentContextMenu(t){Ht,null===t||(t instanceof K||t instanceof pt)||Kt.n("ContextMenuTool.currentContextMenu must be an Adornment or HTMLInfo."),this.bM=t,this.ex=t instanceof K?t.adornedPart:null}get defaultTouchContextMenu(){return!1===yt.MM&&null===yt.Au&&q.isUsingDOM()&&this.lF(),yt.Au}set defaultTouchContextMenu(t){Ht,null===t||(t instanceof K||t instanceof pt)||Kt.n("ContextMenuTool.defaultTouchContextMenu must be an Adornment or HTMLInfo."),null===t&&(yt.MM=!0),yt.Au=t}get currentObject(){return this.kM}set currentObject(t){null!==t&&Kt.s(t,y,yt,"currentObject"),this.kM=t}get mouseDownPoint(){return this.SM}}(bt={})[bt.LostFocus=1]="LostFocus",bt[bt.MouseDown=2]="MouseDown",bt[bt.Tab=3]="Tab",bt[bt.Enter=4]="Enter";(e={})[e.SingleClick=1]="SingleClick",e[e.SingleClickSelected=2]="SingleClickSelected",e[e.DoubleClick=3]="DoubleClick";var bt,xt=e,wt=((e={})[e.None=1]="None",e[e.Active=2]="Active",e[e.Editing=3]="Editing",e[e.Validating=4]="Validating",e[e.Invalid=5]="Invalid",e[e.Validated=6]="Validated",e);class At extends J{Fe;PM;NM;Vl;jt;CM;AM;LM;rx;lx;constructor(t){super(),this.name="TextEditing",this.Fe=new j,this.PM=null,this.NM=2,this.Vl=null,this.jt=1,this.CM=1,this.AM=!0,this.LM=null,this.rx=new pt,this.lx=null,this.aF(this.rx),t&&Object.assign(this,t)}static LostFocus=1;static MouseDown=2;static Tab=3;static Enter=4;static SingleClick=1;static SingleClickSelected=2;static DoubleClick=3;static StateNone=1;static StateActive=2;static StateEditing=3;static StateValidating=4;static StateInvalid=5;static StateValidated=6;aF(t){if(q.isUsingDOM()){const u=Kt.hn("textarea"),s=(this.lx=u,this);u.addEventListener("input",function(t){var e,i;null!==s.textBlock&&(e=s.measureTemporaryTextBlock(this.value),i=this.textScale,this.style.width=20+Math.max(s.textBlock.measuredBounds.width,e.measuredBounds.width)*i+"px",this.rows=Math.max(s.textBlock.lineCount,e.lineCount))},!1),u.addEventListener("keydown",function(t){var e;t.isComposing||null===s.textBlock||("Enter"===(e=t.key)?(!1===s.textBlock.isMultiline&&t.preventDefault(),s.acceptText(4)):"Tab"===e?(s.acceptText(3),t.preventDefault()):"Escape"===e&&(s.doCancel(),null!==s.diagram)&&s.diagram.doFocus())},!1),u.addEventListener("focus",function(t){s.fF(t)},!1),u.addEventListener("blur",function(t){s.cF(t)},!1),t.valueFunction=()=>u.value,t.mainElement=u,t.show=(e,i,s)=>{if(e instanceof j&&s instanceof At)if(5===s.state)u.style.border="3px solid red",u.focus();else{var n=e.getDocumentPoint(Z.Center),a=i.position,r=i.scale;let t=e.getDocumentScale()*r;t{t.div.removeChild(u)}}}get textBlock(){return this.PM}set textBlock(t){null!==t&&Kt.s(t,j,At,"textBlock"),this.PM=t}get currentTextEditor(){return this.LM}set currentTextEditor(t){this.LM=t}get defaultTextEditor(){return this.rx}set defaultTextEditor(t){Ht,t instanceof pt||Kt.n("TextEditingTool.defaultTextEditor must be an HTMLInfo."),this.rx=t}get starting(){return this.NM}set starting(t){Kt.it(t,xt,"TextEditingStarting"),this.NM=t}canStart(){var t,e;return!!this.isEnabled&&!(null===(t=this.diagram)||t.isReadOnly||At.Af&&At.Af!==this&&(At.Af.acceptText(2),At.Af)&&At.Af!==this||!t.lastInput.left||this.isBeyondDragSize()||(e=t.lastInput.documentPoint,!(null!==(e=t.findObjectAt(e))&&e instanceof j&&e.editable&&e.part.canEdit()))||null===(e=e.part)||2===this.starting&&!e.isSelected||3===this.starting&&t.lastInput.clickCount<2)}doStart(){null!==(At.Af=this).textBlock&&this.doActivate()}doActivate(){if(!this.isActive){var i=this.diagram;if(null!==i){let e=this.textBlock;if(null!==(e=null===e?i.findObjectAt(i.lastInput.documentPoint):e)&&e instanceof j&&null!==(this.textBlock=e).part){i.animationManager.stopAnimation(),this.isActive=!0,this.jt=2;let t=this.defaultTextEditor;null!==e.textEditor&&(t=e.textEditor),this.Fe=this.textBlock.copy();var s=new Q(this.textBlock.getDocumentPoint(Z.TopLeft),this.textBlock.getDocumentPoint(Z.BottomRight));i.scrollToRect(s),t.show(e,i,this),this.currentTextEditor=t}}}}doCancel(){this.stopTool()}doMouseUp(){this.canStart()&&this.doActivate()}doMouseDown(){this.isActive&&this.acceptText(2)}acceptText(t){switch(t){case 2:6===this.jt?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():2!==this.jt&&5!==this.jt&&3!==this.jt||(this.jt=4,this.JC());break;case 1:case 4:case 3:4===t&&!0===this.textBlock.isMultiline||2!==this.jt&&5!==this.jt&&3!==this.jt||(this.jt=4,this.JC())}}JC(){var e=this.textBlock,i=this.diagram,s=this.currentTextEditor;if(null!==e&&null!==s){var n=e.text;let t="";(null!==s.valueFunction&&(t=s.valueFunction()),this.isValidText(e,n,t))?(this.startTransaction(this.name),this.jt=6,this.transactionResult=this.name,e.text=t,this.doSuccess(n,t),null!==i&&i.V("TextEdited",e,n),this.stopTransaction(),this.stopTool(),null!==i&&i.doFocus()):(this.jt=5,this.doError(n,t))}}doError(t,e){var i=this.textBlock,t=(null!==i.errorFunction&&i.errorFunction(this,t,e),this.currentTextEditor);t&&t.show(i,this.diagram,this)}doSuccess(t,e){var i=this.textBlock;null!==i.textEdited&&i.textEdited(i,t,e)}doDeactivate(){var t=this.diagram;null!==t&&(this.jt=1,null!==this.currentTextEditor&&this.currentTextEditor.hide(t,this),this.textBlock=null,this.isActive=!1)}doStop(){At.Af=null}fF(t){var e;null!==this.currentTextEditor&&1!==this.state&&(e=this.lx,2===this.jt&&(this.jt=3),"function"==typeof e.select)&&this.selectsTextOnActivate&&(e.select(),e.setSelectionRange(0,9999))}cF(t){var e;null!==this.currentTextEditor&&1!==this.state&&("function"==typeof(e=this.lx).focus&&e.focus(),"function"==typeof e.select)&&this.selectsTextOnActivate&&(e.select(),e.setSelectionRange(0,9999))}isValidText(t,e,i){Kt.s(t,j,At,"isValidText:textblock");var s=this.textValidation;return!(null!==s&&!s(t,e,i)||null!==(s=t.textValidation)&&!s(t,e,i))}get textValidation(){return this.Vl}set textValidation(t){null!==t&&Kt.t(t,"function",At,"textValidation"),this.Vl=t}get minimumEditorScale(){return this.CM}set minimumEditorScale(t){null!==t&&Kt.t(t,"number",At,"minimumEditorScale"),this.CM=t}get selectsTextOnActivate(){return this.AM}set selectsTextOnActivate(t){null!==t&&Kt.t(t,"boolean",At,"selectsTextOnActivate"),this.AM=t}get state(){return this.jt}set state(t){this.jt!==t&&(Kt.it(t,wt,"TextEditingState"),this.jt=t)}measureTemporaryTextBlock(t){var e=this.Fe;return e.text=t,e.wt(this.textBlock.Bl,1/0),e}static Af=null}(e={})[e.Default=1]="Default",e[e.AnimateLocations=2]="AnimateLocations",e[e.None=3]="None";var Pt=e;class kt{b;Di;Xi;Lr;$n;Eo;TM;DM;Vm;Mi;Lf;xn;Bm;Jh;hx;zm;ax;Tf;Nu;Xm;constructor(t){this.b=q.Pm(),this.Di=!1,this.Vm=!1,this.Mi=!1,this.Lf=!1,this.ax=!0,this.Tf=1,this.Nu=!1,this.Xi=!0,this.Lr=!0,this.Eo=600,this.TM=!1,this.DM=!1,this.$n=new N,this.xn=new St,this.Bm=new St,(this.xn.bs=this).Jh=new N,this.hx=new N,this.zm=new N,this.Xm=new N,t&&Object.assign(this,t)}Vo(t){this.b=t}lE(){return this.b}canStart(t){return!0}zl(t){return!(!this.Xi||!this.canStart(t)||(this.$n.add(t),this.defaultAnimation.isAnimating&&this.stopAnimation(),this.b.Fi(),this.Mi=!0,0))}getBundleAnimation(){return this.Bm}FM(){if(this.Xi&&(0{!1===n.Mi||e.Di||(i.getRenderingHint("temporaryPixelRatio")&&i.vw(),i.RM(),n.Mi=!1,e.start(),e.Di&&(n.Lu(),i.invalidateDocumentBounds(),e.ZC(0),i.Pr(!0),n.Tu(),i.V("AnimationStarting",n)))})}}}IM(){return this.$n.contains("Trigger")&&1===this.$n.count}$C(t,e,i,s){this.isTicking||this.IM()||t instanceof Y&&(null!==t.fromNode||null!==t.toNode)||this.xn.add(t,"position",e,i,s)}ux(t){return this.xn.ux(t)}OM(t){return this.xn.OM(t)}uF(t){const i=this.Jh,s=this;function n(){if(0n()))}gF(t){this.zm.add(t)}mF(){for(var t=this.Jh.iterator;t.next();)t.value.Df=!1}Lu(){var t;this.Vm||(t=this.b,this.TM=t.skipsUndoManager,this.DM=t.xe,t.skipsUndoManager=!0,t.xe=!0,this.Vm=!0)}Tu(){var t=this.b;t.skipsUndoManager=this.TM,t.xe=this.DM,this.Vm=!1}stopAnimation(t){var e=this.xn;if(!0===this.Mi&&(this.Mi=!1,this.Lf=!1,this.$n.clear(),e.pF())&&this.b.requestUpdate(),this.Di){if(e.Du(!0),e.cx(null),!0===t){var i=this.Jh.toArray();for(let t=0;t{t.isAnimating||t.runCount!==1/0||t.start()})}get duration(){return this.Eo}set duration(t){Kt.t(t,"number",kt,"duration"),t<1&&Kt.G(t,">= 1",kt,"duration"),this.Eo=t}get isAnimating(){return this.Di}get isTicking(){return this.Vm}get isInitial(){return this.Lr}set isInitial(t){Kt.t(t,"boolean",kt,"isInitial"),this.Lr=t}get defaultAnimation(){return this.xn}get activeAnimations(){return this.Jh}get initialAnimationStyle(){return this.Tf}set initialAnimationStyle(t){Ht,Kt.it(t,Pt,"AnimationStyle"),this.Tf=t}static gx=new L;static defineAnimationEffect(t,e){kt.gx.add(t,e)}static BM(t,e,i,s,n){let a=(t=null===t?[0,0,0,0]:t)[0],r=t[1];var o=t[2],t=t[3];let l=(e=null===e?[0,0,0,0]:e)[0],h=e[1];var u=e[2],e=e[3],d=(0===o||100===o?(a=l,r=h):0!==u&&100!==u||(l=a,h=r),180a?a+=360:l+=360),n(i,a,l-a,s)%360);return"hsla("+d+", "+n(i,r,h-r,s)+"%, "+n(i,o,u-o,s)+"%, "+n(i,t,e-t,s)+")"}static{var t=kt.gx,e=(t,e,i,s,n,a)=>{t.position=new _(s(n,e.x,i.x-e.x,a),s(n,e.y,i.y-e.y,a))};t.add("position:diagram",e),t.add("position",e),t.add("position:part",(t,e,i,s,n,a)=>{n{n{n{var r=t.actualBounds,i=i.actualBounds,o=i.x+i.width/2-r.width/2,i=i.y+i.height/2-r.height/2;n{t.desiredSize=new Q(s(n,e.width,i.width-e.width,a),s(n,e.height,i.height-e.height,a))}),t.add("width",(t,e,i,s,n,a)=>{t.width=s(n,e,i-e,a)}),t.add("height",(t,e,i,s,n,a)=>{t.height=s(n,e,i-e,a)}),t.add("fill",(t,e,i,s,n,a)=>{t.fill=kt.BM(e,i,n,a,s)}),t.add("stroke",(t,e,i,s,n,a)=>{t.stroke=kt.BM(e,i,n,a,s)}),t.add("strokeWidth",(t,e,i,s,n,a)=>{t.strokeWidth=s(n,e,i-e,a)}),t.add("strokeDashOffset",(t,e,i,s,n,a)=>{t.strokeDashOffset=s(n,e,i-e,a)}),t.add("background",(t,e,i,s,n,a)=>{t.background=kt.BM(e,i,n,a,s)}),t.add("opacity",(t,e,i,s,n,a)=>{t.opacity=s(n,e,i-e,a)}),t.add("scale",(t,e,i,s,n,a)=>{t.scale=s(n,e,i-e,a)}),t.add("angle",(t,e,i,s,n,a)=>{t.angle=s(n,e,i-e,a)})}static Default=1;static AnimateLocations=2;static None=3}class St{mx;Ym;Di;Fu;Eo;Ss;eA;If;we;px;li;Qn;Ru;Of;yx;wx;Df;zM;xx;bs;b;XM;YM;KM;constructor(t){this.b=null,this.bs=null,this.zM=null,this.xx=null,this.XM=!1,this.Di=!1,this.Df=!1,this.li=0,this.Qn=0,this.mx=St.EaseInOutQuad,this.Ym=St.EaseInOutQuad,this.Ru=!1,this.Of=!1,this.yx=1,this.wx=0,this.Eo=NaN,this.Ss=NaN,this.YM=0,this.Fu=null,this.eA=_.To,this.we=new L,this.px=new L,this.If=new N,this.KM=1,t&&Object.assign(this,t)}suspend(){this.Df=!0}advanceTo(t,e){e&&(this.Df=!1),this.Ru&&t>=this.Ss&&(this.Of=!0,t-=this.Ss),this.YM=t,this.QC(!0),this.bs.Lu(),this.b.Pr(),this.bs.Tu(),this.b.redraw()}cx(t){if(this.px.clear(),this.Of=!1,this.wx=0,this.Ss=NaN,0{t.data=null,e.add(t)}),t.Tu(),this.Di=!0,this.li=+new Date,this.Qn=this.li+this.Ss,t.uF(this))}return this}addTemporaryPart(t,e){return t.De()&&((Ht,void 0===e&&Kt.n("addTemporaryPart: Required Diagram argument missing"),t.diagram===e&&Kt.n("addTemporaryPart: Part already in Diagram, did you mean to pass in a copy?"),null!==this.b)&&this.b!==e&&Kt.n("addTemporaryPart: A different Diagram is already associated with this Animation: "+this.b.toString()),this.If.add(t),this.b=e),this}add(t,e,i,s,n){if(null===this.b&&(t instanceof q?this.b=t:t instanceof y&&null!==t.diagram&&(this.b=t.diagram)),t instanceof H){if(!t.isAnimated)return this;"position"===e&&(e="position:part")}return this.EM(t,e,i,s,n),this}EM(t,e,i,s,n){var a=this.we;let r,o,l;if("fill"!==(e=t instanceof q&&"position"===e?"position:diagram":e)&&"stroke"!==e&&"background"!==e||(m.Bo(i),m.UM(),i=[m.Yi.n0,m.Yi.n1,m.Yi.n2,m.Yi.n3],m.Bo(s),m.UM(),s=[m.Yi.n0,m.Yi.n1,m.Yi.n2,m.Yi.n3]),a.contains(t))r=a.getValue(t),o=r.li,l=r.ks,void 0===o[e]&&(o[e]=this.Iu(i)),l[e]=this.Iu(s);else{if("position"===e&&i.equalsApprox(s))return;o={},l={},o[e]=this.Iu(i),l[e]=this.Iu(s),r=new Mt(o,l,n),a.add(t,r)}s=o[e];s instanceof _&&!s.isReal()&&s.c(this.eA),n&&0===e.indexOf("position:")&&t instanceof H?r.bx.location=this.Iu(t.location):n&&(r.bx[e]=this.Iu(i))}Iu(t){return t instanceof _||t instanceof Yt?t.copy():t}yF(t){var e=this.we;e.contains(t)&&(e.getValue(t).kx=!0)}ux(t){return!!this.Di&&null!==(t=this.we.getValue(t))&&t.kx}OM(t){return!!this.Di&&null!==(t=this.we.getValue(t))&&!!(t.li.position||t.li["position:part"]||t.li.location)}dF(){if(0this.Qn?this.Ss:s-this.li;e&&((t=this.YM)this.Qn&&(this.Ru&&!this.Of?(this.li=+new Date,this.Qn=this.li+this.Ss,this.Of=!0):this.Du(!1))}}}ZC(t){for(var e=this.Ss,i=this.we.iterator,s=this.Of;i.next();){var n=i.key;if(!(n instanceof y&&null===n.diagram)){var a=i.value,r=s?a.ks:a.li,o=s?a.li:a.ks,l=kt.gx;for(const h in o)"position"===h&&(o["position:placeholder"]||o["position:nodeCollapse"])||null!==l.get(h)&&l.get(h)(n,r[h],o[h],this.Ym,t,e,this)}}}stop(){return this.Di&&this.Du(!0),this}Du(t){if(null!==this.xx&&this.xx.wF(this.zM),this.Di){for(var e=this.b,i=this.bs,s=(i.Lf=!1,this.Di=!1,this.Df=!1,i.Lu(),this.we),n=this.If.iterator;n.next();)e.remove(n.value);for(var a=this.Ru,r=s.iterator,o=kt.gx;r.next();){var l=r.key,h=r.value,u=a?h.ks:h.li,d=a?h.li:h.ks,c=h.bx;for(const m in d)if(null!==o.get(m)){let t=m;!h.Sx||"position:nodeCollapse"!==t&&"position:placeholder"!==t||(t="position"),o.get(t)(l,u[m],(void 0!==c[m]?c:h.Sx?u:d)[m],this.Ym,this.Ss,this.Ss,this)}h.Sx&&void 0!==c.location&&l instanceof H&&(l.location=c.location),h.kx&&l instanceof H&&l.Ki(!1)}this.wx++;s=!t&&this.yx>this.wx;if(s||this!==i.Bm&&this!==i.defaultAnimation||this.we.clear(),e.Mx.clear(),e.NS(!1),e.invalidateDocumentBounds(),e.T(),e.Pr(!0),i.defaultAnimation===this){for(var g=i.Xm.iterator;g.next();)g.value.xF();i.Xm.clear()}e.Pr(!0),this.isViewportUnconstrained&&(e.scrollMode=this.KM),i.Tu(),s?(this.Of=!1,this.start()):(this.cx(null),i.Du(this),this.Fu&&this.Fu(this),e.requestUpdate())}}Ff(t,e){var i,s,n=e.actualBounds;let a=null;null!==(a=e instanceof X?e.placeholder:a)&&a.visible?(i=a.getDocumentPoint(Z.TopLeft),s=a.padding,i.x+=s.left,i.y+=s.top,this.add(t,"position",i,t.position,!1)):this.add(t,"position",new _(n.x+n.width/2,n.y+n.height/2),t.position,!1),this.add(t,"scale",.01,t.scale,!1),t instanceof X&&this.bF(t,e)}bF(t,e){for(var i=t.memberParts;i.next();){var s=i.value;s instanceof D&&this.Ff(s,e)}}Rf(e,i){if(e.isVisible()){let t=null;var s,n;null!==(t=i instanceof X?i.placeholder:t)&&t.visible?(s=t.getDocumentPoint(Z.TopLeft),n=t.padding,s.x+=n.left,s.y+=n.top,this.add(e,"position:placeholder",e.position,s,!0)):this.add(e,"position:nodeCollapse",e.position,i,!0),this.add(e,"scale",e.scale,.01,!0),this.yF(e),e instanceof X&&this.kF(e,i)}}kF(t,e){for(var i=t.memberParts;i.next();){var s=i.value;s instanceof D&&this.Rf(s,e)}}get duration(){return this.Eo}set duration(t){Kt.t(t,"number",St,"duration"),t<1&&Kt.G(t,">= 1",St,"duration"),this.Eo=t}get reversible(){return this.Ru}set reversible(t){this.Ru=t}get runCount(){return this.yx}set runCount(t){0i*t/s+e;static EaseInOutQuad=(t,e,i,s)=>(t/=s/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e;static EaseInQuad=(t,e,i,s)=>i*(t/=s)*t+e;static EaseOutQuad=(t,e,i,s)=>-i*(t/=s)*(t-2)+e;static EaseInExpo=(t,e,i,s)=>0===t?e:i*Math.pow(2,10*(t/s-1))+e;static EaseOutExpo=(t,e,i,s)=>t===s?e+i:i*(1-Math.pow(2,-10*t/s))+e}class Mt{li;ks;bx;Sx;kx;constructor(t,e,i){this.li=t,this.ks=e,this.bx={},this.Sx=i,this.kx=!1}}(e={})[e.Default=1]="Default",e[e.Immediate=2]="Immediate",e[e.Bundled=3]="Bundled";var Ct=e;class Nt{Te;mn;Ou;Ef;constructor(t,e,i){i&&(Ht,Kt.it(i,Ct,"TriggerStart")),this.Te=null,this.mn=t,this.Ou=i||1,this.Ef=null,void 0!==e&&(this.Ef=e,void 0===i)&&(this.Ou=2)}copy(){var t,e=new Nt(this.mn),i=(e.Ou=this.Ou,this.Ef);return null!==i&&(t={},void 0!==i.duration&&(t.duration=i.duration),void 0!==i.finished&&(t.finished=i.finished),void 0!==i.easing&&(t.easing=i.easing),e.Ef=t),e}get propertyName(){return this.mn}set propertyName(t){this.mn=t}get animationSettings(){return this.Ef}set animationSettings(t){this.Ef=t}SF(t){var e=this.Ef;null!==e&&(e.duration&&(t.duration=e.duration),e.finished&&(t.finished=e.finished),e.easing)&&(t.easing=e.easing)}get startCondition(){return this.Ou}set startCondition(t){Ht,Kt.it(t,Ct,"TriggerStart"),this.Ou=t}static Default=1;static Immediate=2;static Bundled=3}class Lt{b;Tt;_t;Fr;Xl;Yl;Kl;Ul;Gl;Hl;vl;ql;Wl;jl;Jl;Zl;Cf;$l;Px;Km;Eu;It;constructor(t){N.ji(this),this.b=null,this.It=new O,this.Tt="",this._t=1,this.Fr=!1,this.Xl=!0,this.Yl=!0,this.Kl=!0,this.Ul=!0,this.Gl=!0,this.Hl=!0,this.vl=!0,this.ql=!0,this.Wl=!0,this.jl=!0,this.Jl=!0,this.Zl=!0,this.Cf=!0,this.$l=!0,this.Px=!0,this.Km=!1,this.Eu=[],t&&Object.assign(this,t)}MF(){var e=this.It;for(let t=0;ta.Hm||l.height*r>a.Hm?n.Ji(s,a):this.AF(s,n),i&&(s.restore(),s.clearContextCache(!0))}}AF(t,e){var i,s=e.actualBounds,n=e.naturalBounds;0===s.width||0===s.height||isNaN(s.x)||isNaN(s.y)||!e.isVisible()||(i=e.D,null===e.background&&(e.bn(t,"rgba(0,0,0,0.3)",!0,!1,n,s),t.fillRect(s.x,s.y,s.width,s.height)),null===e.background)||(t.transform(i.m11,i.m12,i.m21,i.m22,i.dx,i.dy),e.bn(t,e.background,!0,!1,n,s),t.fillRect(0,0,n.width/2,n.height/2),i.Gk())||(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)))}CF(e,i,s,t){var n=2/t,a=4/t;for(let t=0;t=s.count)t=s.count;else if(s.elt(t)===e)return-1;s.insertAt(t,e),e.vm(i);s=this.diagram;return null!==s&&(i?s.T():s.Qh(e)),this.Nx(t,e),t}re(t,e,i){if(!i&&e.layer!==this&&null!==e.layer)return e.layer.re(t,e,i);var s=this.It;if(t<0||t>=s.length){if((t=s.indexOf(e))<0)return-1}else if(s.elt(t)!==e&&(t=s.indexOf(e))<0)return-1;e.qm(i),s.removeAt(t);s=this.diagram;return null!==s&&(i?s.T():s.re(e)),e.GM(null),t}Nx(t,e){t=this.LF(t,e),e instanceof X&&this.TF(t,e),null!==e.svg&&e.svg.remove()}LF(n,a){var r=a.zOrder;if(!isNaN(r)){var o=this.It,l=o.count;if(!(l<=1)){if((n=n<0?o.indexOf(a):n)<0)return-1;let t=n-1,e=NaN;for(;0<=t&&(e=o.elt(t).zOrder,isNaN(e));)t--;let i=n+1,s=NaN;for(;ir)for(;;){if(-1===t||e<=r)return++t===n?n:(o.removeAt(n),o.insertAt(t,a),t);for(e=NaN;0<=--t&&(e=o.elt(t).zOrder,isNaN(e)););}else if(!isNaN(s)&&s=r)return--i===n?n:(o.removeAt(n),o.insertAt(i,a),i);for(s=NaN;++i{s.Ti(v.document,"DOMContentLoaded",n,!1),s.setRTL()};null!==v.document.body?this.setRTL():s.Ht(v.document,"DOMContentLoaded",n,!1)}this.Uf=null,q.xP("Model",ei);const i=this;return this.sP=t=>i.partManager.doModelDataChanged(t),this.nP=t=>i.partManager.doModelChanged(t),this.g1=null,this.m1=null,this.dA(),this.model=b.initDiagramModel(),this.C1=null,this.themeManager=new ji,this.Xo=!0,this.gA(),this.layout=new Ue,this.Xo=!1,this.BF=null,this.zF=null,this.XF=null,this.w1=null,this.YF=null,this.KF=null,this.UF=null,this.oa=null,this.fA=null,this.nh=null,this.ra=null,this.la=null,this.ha=null,this.aa=null,this.Pu=()=>{},this.jh=null,this.vu=!1,this.Hf=new Ft(this),void 0!==t&&("string"==typeof t||v.Element&&t instanceof Element?this.bP(t):e=t),e&&this.setProperties(e),this.$t=!1,this.requestUpdate(),this}ZD(){return null!==this.xt}get renderer(){return this.Yf}set renderer(e){if(!(this instanceof Vt)){var e=(e=""===e?"default":e).toLowerCase(),t=this.Yf;if(e!==t){let t=null;"default"===(this.Yf=e)||"canvas"===e?(null!==(t=this.ih.get("svg"))&&t.Bt.remove(),this.xt&&(this.ai=this.xt.gi)):"svg"===e?(this.ih.contains("svg")?t=this.ih.get("svg"):(t=new Zt(this,v.document),this.addRenderer("svg",t)),null!==this.div&&this.div.appendChild(t.Bt),this.ai=t.gi,this.xt&&(this.xt.gi.setTransform(this.Gi,0,0,this.Gi,0,0),this.xt.gi.clearRect(0,0,this.Ct,this.At))):"debug"!==e||this.ih.contains("SVG")||(t=new Zt(this,v.document),this.addRenderer("SVG",t),t.Bt.style.backgroundColor="whitesmoke",null!==this.div&&this.div.after(t.Bt)),this.$t||this.redraw()}}}dA(){this.vf=new O,this.setupRouters(),this.bs=new kt,this.bs.Vo(this),this.wi=17,this.WM=!1,this.ju=!1,this.Cx="default",this.Jt=new O,this.ih=new L,this.Yf="default",this.resetRenderingHints(),this.GF(),this._t=1,this.lt=new _(NaN,NaN).w(),this.fx=new _(NaN,NaN),this.v=1,this.s0=1,this.Ax=new _(NaN,NaN).w(),this.Lx=NaN,this.Tx=1e-4,this.Dx=100,this.D=new V,this.Fx=new _(NaN,NaN).w(),this.Rx=new Q(NaN,NaN,NaN,NaN).w(),this.Vf=new I(0,0,0,0).w(),this.Zh=1,this.Ix=!1,this.Ox=null,this.Ex=null,this.Ql=1,this.Bf=Z.Default,this.Ir=1,this.Wm=Z.Default,this.Vx=Z.None,this.Bx=Z.None,this.qe=!0,this.Xu=!1,this._n=new Set,this.Or=new N,this._h=new N,this.zo=!1,this.sh=new L,this.qu=!0,this.jm=250,this.zf=-1,this.Jm=new I(16,16,16,16).w(),this.Tr=!1,this.Xf=!1,this.Yu=!0,this.e0=new C,(this.e0.diagram=this).jr=new C,(this.jr.diagram=this).ia=new C,(this.ia.diagram=this).Er=null,this.to=null,this.Hw=!1,this.HF(),this.Zr=new N,this.zx=!0,this.Xx=1,this.ZM=!1,this.Yx=1,this.Kx="auto",this.Zm="auto",this.Vr=null,this.Br=null,this.zr=null,this.Xr=null,this.Yr=null,this.Kr=null,this.Ux=null,this.Ur=null,this.Gx=!1,this.Gr=null,this.Hr=null,this.vr=null,this.qr=null,this.Hx=!1,this.d1={},this.na=[null,null],this.Xo=!1,this.iP=!1,this.vx=!1,this.qx=!1,this.eP=!0,this.Ps=!1,this.sa=!1,this.oP=!0,this.Ys=-2,this.eh=new L,this.Wu=new O,this.Yo=!1,this.Xi=!0,this.Wx=!0,this.Xl=!0,this.Yl=!0,this.jx=!1,this.Jx=!0,this.Kl=!0,this.Ul=!0,this.Gl=!0,this.Zx=!0,this.Hl=!0,this.vl=!0,this.ql=!0,this.Wl=!0,this.jl=!0,this.Jl=!0,this.Zl=!0,this.$x=!0,this.Qx=!0,this.rP=!1,this.Gf=!1,this.Ku=!0,this.Uu=!0,this._x=!0,this.t1=!0,this.i1=16,this.e1=16,this.$m=!1,this.s1=!1,this.o1=0,this.l1=0,this.ei=new I(5).w(),this.lP=(new N).w(),this.h1=999999999,this.hP=(new N).w(),this.ea=!0,this.Gu=!0,this.Kf=!0,this.kn=!1,this.io=!1,this.Jr=!0,this.Al=!1,this.eo=!1,this.hA=new N,this.uP=new N,this._l=null,this.aP=new Yt(8,8),this.fP=999,this.eS=1,this.sS=0,this.Ui={scale:1,position:new _,bounds:new Q,canvasSize:new Yt,newCanvasSize:new Yt,isScroll:!1},this.Ui.canvasSize=this.Ui.canvasSize,this.Ui.newCanvasSize=this.Ui.newCanvasSize,this.Ui.isScroll=!1,this.a1=new Q(NaN,NaN,NaN,NaN).w(),this.Hu=new Yt(NaN,NaN).w(),this.Qm=new Q(NaN,NaN,NaN,NaN).w(),this.f1=!1,this.vF(),this.ls=null,this.t0=!1,this.wf=null,this.partManager=new ei,this.toolManager=new st,this.toolManager.initializeStandardTools(),this.defaultTool=this.toolManager,this.currentTool=this.defaultTool,this.S1=null,this.M1=new Ot,this.P1=null,this.N1=null,this.k1=!1,this.Mu=!1,this.commandHandler=new qt,this.a0=null,this.f0=_.Ek,this.wP=!1,this.Gi=1,this.Tl=null,this.Hm=1,this.l0=0,this.yP=[0,0,0,0,0],this.h0=0,this.o0=1,this.dP=0,this.gP=new _,this.aA=500,this.i0=new _,this.r0=!1}static mA=void 0!==v.document;static isUsingDOM(){return q.mA}static useDOM(t){q.mA=!!t&&void 0!==v.document}static he=new WeakMap;clear(){this.animationManager.stopAnimation(),this.model.clear(),q.pA(),this.yA(!1),this.Wu.clear(),this.wA(),this._l=null,this.invalidateDocumentBounds(),this.ensureBounds(),this.T()}yA(t){this.animationManager.stopAnimation(!0),this.lP=(new N).w(),this.hP=(new N).w();var e=this.skipsUndoManager,i=null!==this.Li&&void 0!==this.Li;i&&(this.skipsUndoManager=!0);let s=null;null!==this.ls&&null!==(s=this.ls.part)&&this.remove(s);var n=[],a=this.Jt.length;if(t){for(let t=0;tt?new I(t/2):1.5)),this.c1=this._m,this.u1=new K(Xt.Link).add(new G({isPanelMain:!0,fill:null,stroke:"dodgerblue",strokeWidth:3}).theme("stroke","selection").theme("strokeWidth","selection"))}setRTL(t){let e=void 0===t?this.div:t;null===e&&(e=v.document.body);t=Kt.hn("div");t.dir="rtl",t.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",t.textContent="A",e.appendChild(t);let i="reverse";0t.cancelWaitAfter()),e.mouseMoveTools.each(t=>t.cancelWaitAfter()),e.mouseUpTools.each(t=>t.cancelWaitAfter())),e.cancelWaitAfter(),this.currentTool.doCancel(),this.xt=null,this.Ti(v,"resize",this.w1,!1),this.Ti(v,"wheel",this.oa,!0),q.Pm()===this&&q.uA(null)):null===this.nh&&(this.eo=!1),(this.Ot=null)!==t?((e=q.he.get(t))&&(e.div=null),this.bP(t),this.Pu(),this.themeManager&&this.themeManager.qF()):this.themeManager&&this.themeManager.WF())}setupRouters(){this.vf.push(new Ki)}bP(t){const a=this;if(q.isUsingDOM()){null==t&&Kt.n("Diagram setup requires an argument DIV."),null!==a.Ot&&Kt.n("Diagram has already completed setup."),"string"==typeof t?a.Ot=v.document.getElementById(t):t instanceof HTMLDivElement?a.Ot=t:Kt.n("No DIV or DIV id supplied: "+t),null===a.Ot&&Kt.n("Invalid DIV id; could not get element with id: "+t);t=q.he.get(a.Ot);if(t&&t!==this&&Kt.n("Invalid div id; div already has a Diagram associated with it."),!a.Uf&&v.ResizeObserver){const s=v.ResizeObserver,n=Kt.Rk(()=>a.requestUpdate(),250,!1);a.Uf=new s(()=>n()),a.Uf.observe(a.Ot)}"static"===v.getComputedStyle(a.Ot,null).position&&(a.Ot.style.position="relative");a.Ot.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)",a.Ot.innerHTML="",q.he.set(a.Ot,a),(a.Ot.goDiagram=a).Ot.go=v.go;var t=new $t(a),e=(void 0!==t.style&&(t.style.position="absolute",t.style.top="0px",t.style.left="0px","rtl"===v.getComputedStyle(a.Ot,null).getPropertyValue("direction")&&(a.ju=!0),t.style.zIndex="2",t.style.userSelect="none",t.style.MozUserSelect="none",t.style.touchAction="none",t.style.letterSpacing="normal !important",t.style.wordSpacing="normal !important",t.style.lang="unknown"),a.xt=t,a.ai=t.gi,a.ai);a.Gi=a.computePixelRatio(),a.viewSize.isReal()||(a.Ct=a.Ot.clientWidth||1,a.At=a.Ot.clientHeight||1),a.xA(a.Ct,a.At);const r=a;a.Ot.insertBefore(t.Bt,a.Ot.firstChild);var i,t=new $t(null),t=(t.width=1,t.height=1,a.EF=t,a.VF=t.gi,q.isUsingDOM()&&(t=Kt.hn("div"),i=Kt.hn("div"),t.style.position="absolute",t.style.overflow="auto",t.style.width=a.Ct+"px",t.style.height=a.At+"px",t.style.zIndex="1",i.style.position="absolute",i.style.width="1px",i.style.height="1px",a.Ot.appendChild(t),t.appendChild(i),t.onscroll=q.jF,t.addEventListener("pointerdown",q.JF),t.b=a,t.ZF=!0,t.$F=!0,a.g1=t,a.m1=i),a.Pu=Kt.Rk(()=>{a.Tl=null,a.T()},300,!1),a.w1=Kt.Rk(()=>{a.RM()},250,!1),a.jh=t=>(t.preventDefault(),!1),a.oa=i=>{if(r.isEnabled){var s=r.qf(i,!0);s.bubbles=!0;let t=0,e=0;void(s.delta=0)!==i.deltaX?(0!==i.deltaX&&(t=0Math.abs(i.deltaY)?-t:-e):void 0!==i.wheelDeltaX?(0!==i.wheelDeltaX&&(t=0Math.abs(i.wheelDeltaY)?-t:-e):void 0!==i.wheelDelta&&0!==i.wheelDelta&&(s.delta=0{r.isEnabled&&(a.Gf=!1,r.qf(t,!0),(t=r.currentTool).cancelWaitAfter(),t.standardMouseOver())},a.nh=e=>{if(r.isEnabled){a.Gf=!0;var i=r.d1,i=(void 0===i[e.pointerId]&&(i[e.pointerId]=e),r.na);let t=!1;if(null===i[0]||i[0].pointerId!==e.pointerId&&i[0].pointerType===e.pointerType)if(null!==i[1]&&i[1].pointerId===e.pointerId)i[1]=e,t=!0;else if(null===i[0])i[0]=e;else{if(null!==i[1])return void e.preventDefault();i[1]=e,t=!0}else i[0]=e;var i="touch"===e.pointerType||"pen"===e.pointerType,s=(i&&(r.Hw=!1,r.r0=!0),r.QF(e,e,t)),n=r.gP,i=i?25:10;e.timeStamp-r.dPi||Math.abs(n.y-e.screenY)>i)?r.o0++:r.o0=1,s.clickCount=r.o0,r.dP=e.timeStamp,r.gP.setTo(e.screenX,e.screenY),r.doMouseDown(),1===e.button?e.preventDefault():r.fa(s,e)}},a.ra=t=>{if(r.isEnabled){a.Gf=!0;var e=r.na;if(null===e[0]||e[0].pointerId!==t.pointerId&&e[0].pointerType===t.pointerType){if(null!==e[1]&&e[1].pointerId===t.pointerId)return void(e[1]=t);if(null!==e[0])return}e[0]=t,e[0].pointerId===t.pointerId&&(e=r._F(t,t,null!==e[1]),r.doMouseMove(),r.fa(e,t))}},a.la=e=>{if(r.isEnabled){a.Gf=!0;var i="touch"===e.pointerType||"pen"===e.pointerType,s=r.d1;if(i&&r.Hw)delete s[e.pointerId],e.preventDefault();else{s=r.na;if(null===s[0]||s[0].pointerId!==e.pointerId&&s[0].pointerType===e.pointerType)return null!==s[1]&&s[1].pointerId===e.pointerId?void(s[1]=null):void 0;s[0]=null;s=r.kP(e,!1,!0,!1,!0,!1);let t=v.document.elementFromPoint(e.clientX,e.clientY)||null;null!==(t=null!==t&&void 0!==t.shadowRoot&&null!==t.shadowRoot?t.shadowRoot.elementFromPoint(e.clientX,e.clientY):t)&&t.b instanceof q&&t.b!==r&&t.b.u0(e,s),null===t&&(t=e.target),r.u0(e,s),s.clickCount=r.o0,s.targetDiagram=r.SP(e,t),s.targetObject=null,r.doMouseUp(),r.fa(s,e),i&&(r.r0=!1)}}},a.ha=t=>{var e;r.isEnabled&&(a.Gf=!1,(e=r.d1)[t.pointerId]&&delete e[t.pointerId],null!==(e=r.na)[0]&&e[0].pointerId===t.pointerId&&(e[0]=null),null!==e[1]&&e[1].pointerId===t.pointerId&&(e[1]=null),"touch"!==t.pointerType)&&"pen"!==t.pointerType&&((e=r.currentTool).cancelWaitAfter(),e.standardMouseOver())},a.aa=t=>{var e=r.na;null!==e[0]&&e[0].pointerId===t.pointerId?(e[0]=null,r.r0=!1):null!==e[1]&&e[1].pointerId===t.pointerId&&(e[1]=null)},e);a.p1=t.Y[Kt.Os("7eba17a4ca3b1a8346")][Kt.Os("78a118b7")](t.Y,q.Ju,4,4),e.clearContextCache(!0),a.tR(),"svg"===this.Yf&&(i=this.ih.get("svg"),this.Ot.appendChild(i.Bt),this.ai=i.gi)}}addEventListener(t,e,i,s){t.addEventListener(e,i,{capture:s,passive:!1})}Ht(t,e,i,s){t.addEventListener(e,i,{capture:s,passive:!1})}removeEventListener(t,e,i,s){t.removeEventListener(e,i,{capture:s})}Ti(t,e,i,s){t.removeEventListener(e,i,{capture:s})}tR(){var t=this;let e=this.xt.Bt;e instanceof HTMLCanvasElement||(e=t.div),this.Ht(e,"pointerdown",t.nh,!1),this.Ht(e,"pointermove",t.ra,!1),this.Ht(e,"pointerup",t.la,!1),this.Ht(e,"pointerout",t.ha,!1),this.Ht(e,"pointercancel",t.aa,!1),this.Ht(e,"pointerenter",t.iR,!1),this.Ht(e,"pointerleave",t.eR,!1),this.Ht(e,"wheel",t.oa,!1),this.Ht(e,"keydown",t.sR,!1),this.Ht(e,"keyup",t.nR,!1),this.Ht(e,"blur",t.oR,!1),this.Ht(e,"focus",t.rR,!1),this.Ht(e,"selectstart",t=>(t.preventDefault(),!1),!1),this.Ht(e,"contextmenu",t=>(t.preventDefault(),!1),!1),this.Ht(v,"resize",t.w1,!1)}vw(){30e?e:l)this.maxScale?this.maxScale:l:3===t?(l=0,l=(l=(l=(l=re?e:l)this.maxScale?this.maxScale:l):this.scale}zoomToFit(){var t=this.Zh;this.Zh=1,this.scale=this.Zu(2),1!==t&&(this.Hs(!1),this.MP(this.documentBounds,this.Ct/this.v,this.At/this.v,this.Bf,!1)),this.Zh=t}zoomToRect(e,i){void 0===i&&(i=2);var s,n,a=e.width,r=e.height;if(!(0===a||0===r||isNaN(a)&&isNaN(r))){let t=1;2!==i&&3!==i||(t=isNaN(a)?this.viewportBounds.height*this.scale/r:isNaN(r)?this.viewportBounds.width*this.scale/a:(s=this.Ct,n=this.At,3===i?s/at.width&&(o=t.x+(s.x*t.width+s.offsetX)-(s.x*e-s.offsetX)),i>t.height)&&(l=t.y+(s.y*t.height+s.offsetY)-(s.y*i-s.offsetY)),a=this.Vf,n=e-t.width,et.left?o=t.left:ot.top?l=t.top:lt.part,t=>t.canSelect());if(e instanceof H)return e}else{e=this.DS(t,t=>t.part);if(e instanceof H)return e}return null}findObjectAt(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null),this.Fi();for(var s=this.Jt.iteratorBackwards;s.next();){var n=s.value;if(n.visible){n=n.findObjectAt(t,e,i);if(null!==n)return n}}return null}DS(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null),this.Fi();for(var s=this.Jt.iteratorBackwards;s.next();){var n=s.value;if(n.visible&&!n.isTemporary){n=n.findObjectAt(t,e,i);if(null!==n)return n}}return null}findPartsAt(t,e,i){return this.aR(t,t=>t.part,(e=void 0===e?!0:e)?t=>t instanceof H&&t.canSelect():null,i)}aR(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=null),s instanceof O||s instanceof N||(s=new N),this.Fi();for(var n=this.Jt.iteratorBackwards;n.next();){var a=n.value;a.visible&&!a.isTemporary&&a.findObjectsAt(t,e,i,s)}return s}findObjectsAt(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=null),s instanceof O||s instanceof N||(s=new N),this.Fi();for(var n=this.Jt.iteratorBackwards;n.next();){var a=n.value;a.visible&&a.findObjectsAt(t,e,i,s)}return s}findPartsIn(t,e,i,s){return void 0===i&&(i=!0),this.fR(t,null,t=>t instanceof H&&(!i||t.canSelect()),e=void 0===e?!1:e,s)}findObjectsIn(t,e,i,s,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===s&&(s=!1),n instanceof O||n instanceof N||(n=new N),this.Fi();for(var a=this.Jt.iteratorBackwards;a.next();){var r=a.value;r.visible&&r.findObjectsIn(t,e,i,s,n)}return n}IS(t,e,i,s,n,a){for(var r=new N,o=(this.Fi(),this.Jt.iteratorBackwards);o.next();){var l=o.value;l.visible&&l.IS(t,e,i,s,r,n,a)}return r}fR(t,e,i,s,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===s&&(s=!1),n instanceof O||n instanceof N||(n=new N),this.Fi();for(var a=this.Jt.iteratorBackwards;a.next();){var r=a.value;r.visible&&!r.isTemporary&&r.findObjectsIn(t,e,i,s,n)}return n}findPartsNear(t,e,i,s,n){return void 0===s&&(s=!0),this.cR(t,e,null,t=>t instanceof H&&(!s||t.canSelect()),i=void 0===i?!0:i,n)}findObjectsNear(t,e,i,s,n,a){void 0===i&&(i=null),void 0===s&&(s=null),!1!==(n=void 0===n?!0:n)&&!0!==n&&((n instanceof O||n instanceof N)&&(a=n),n=!0),a instanceof O||a instanceof N||(a=new N),this.Fi();for(var r=this.Jt.iteratorBackwards;r.next();){var o=r.value;o.visible&&o.findObjectsNear(t,e,i,s,n,a)}return a}cR(t,e,i,s,n,a){void 0===i&&(i=null),void 0===s&&(s=null),!1!==(n=void 0===n?!0:n)&&!0!==n&&((n instanceof O||n instanceof N)&&(a=n),n=!0),a instanceof O||a instanceof N||(a=new N),this.Fi();for(var r=this.Jt.iteratorBackwards;r.next();){var o=r.value;o.visible&&!o.isTemporary&&o.findObjectsNear(t,e,i,s,n,a)}return a}acceptEvent(t){return this.qf(t,t instanceof MouseEvent)}qf(t,e){var i=this.jr;this.jr=this.ia,(this.ia=i).diagram=this,i.event=t,e?this.u0(t,i):(i.viewPoint=this.jr.viewPoint,i.documentPoint=this.jr.documentPoint);let s=0;e=t;return e.ctrlKey&&(s+=1),e.altKey&&(s+=2),e.shiftKey&&(s+=4),e.metaKey&&(s+=8),i.modifiers=s,i.button=e.button,void 0!==e.buttons&&(i.buttons=e.buttons),Kt.dr&&0===e.button&&e.ctrlKey&&(i.button=2),i.down=!1,i.up=!1,i.clickCount=1,i.delta=0,i.handled=!1,i.bubbles=!1,i.timestamp=t.timeStamp,i.isMultiTouch=!1,i.targetDiagram=this.SP(t,t.target),i.targetObject=null,i}SP(t,e){if(null===e)return null;e=q.he.get(e);if(e)return e;let i=t.path;return(i=i||"function"!=typeof t.composedPath?i:t.composedPath())&&i[0]&&q.he.has(i[0])?q.he.get(i[0]):null}QF(t,e,i){var s=this.kP(t,!0,!1,!1,!0,i);return this.u0(e,s),s.targetDiagram=this.SP(t,t.target),s.targetObject=null,i||s.clone(this.e0),s}_F(t,e,i){i=this.kP(t,!1,!1,!1,!1,i);let s=v.document.elementFromPoint(e.clientX,e.clientY)||null,n=this,a=t;return(s=null!==s&&void 0!==s.shadowRoot&&null!==s.shadowRoot?s.shadowRoot.elementFromPoint(e.clientX,e.clientY):s)&&q.he.get(s)&&(a=e,n=q.he.get(s)),i.targetDiagram=n,this.u0(a,i),i.targetObject=null,i}kP(t,e,i,s,n,a){var r=this.jr;this.jr=this.ia,(this.ia=r).diagram=this,r.clickCount=1;let o=r.delta=0;return t.ctrlKey&&(o+=1),t.altKey&&(o+=2),t.shiftKey&&(o+=4),t.metaKey&&(o+=8),r.modifiers=o,r.event=t,r.timestamp=t.timeStamp,r.button=(i?this.firstInput:t).button,r.buttons=t.buttons,Kt.dr&&0===t.button&&t.ctrlKey&&(r.button=2),r.down=e,r.up=i,r.handled=s,r.bubbles=n,r.isMultiTouch=a,r}fa(t,e){return t.bubbles?(Ht,Ht.handleMessages&&Kt.ft("NOT handled "+e.type+" "+t.toString()),!0):(Ht,Ht.handleMessages&&Kt.ft("handled "+e.type+" "+this.currentTool.name+" "+t.toString()),void 0!==e.stopPropagation&&e.stopPropagation(),!1!==e.cancelable&&e.preventDefault(),!(e.cancelBubble=!0))}sR(t){var e,i=q.he.get(this);return!!i.isEnabled&&((e=i.qf(t,!1)).key=t.key,e.code=t.code,e.down=!0,i.doKeyDown(),i.fa(e,t))}nR(t){var e,i=q.he.get(this);return!!i.isEnabled&&((e=i.qf(t,!1)).key=t.key,e.code=t.code,e.up=!0,i.doKeyUp(),i.fa(e,t))}iR(t){var e,i=q.he.get(this);return!!i.isEnabled&&(e=i.qf(t,!0),null!==i.mouseEnter&&i.mouseEnter(e),i.currentTool.standardMouseOver(),i.fa(e,t))}eR(t){var e,i=q.he.get(this);return!!i.isEnabled&&(e=i.qf(t,!0),null!==i.mouseLeave&&i.mouseLeave(e),i.fa(e,t))}getMouse(t){var e,i=this.xt;return null===i?new _(0,0):(i=i.getBoundingClientRect(),e=(t.clientX-i.left)*(this.Ct/i.width),t=(t.clientY-i.top)*(this.At/i.height),null!==this.D?new _(e,t).Ge(this.D):new _(e,t))}u0(t,e){var i=this.xt;let s=0,n=0;null!==i&&(i=i.getBoundingClientRect(),s=(t.clientX-i.left)*(this.Ct/i.width),n=(t.clientY-i.top)*(this.At/i.height)),e.viewPoint.e(s,n),null!==this.D?(t=_.H(s,n),this.D.rs(t),e.documentPoint.c(t),_.o(t)):e.documentPoint.e(s,n)}NC(t,e,i){let s;null!==this.na[0]&&(s=this.na[e],null!==(e=this.xt))&&(e=e.getBoundingClientRect(),i.e((s.clientX-e.left)*(this.Ct/e.width),(s.clientY-e.top)*(this.At/e.height)))}invalidateDocumentBounds(){this.ea||(this.ea=!0,this.requestUpdate(!1))}uR(){this.Ps||this.Fi(),this.ensureBounds()}redraw(){this.$t||this.Ps||(this.T(),this.maybeUpdate())}isUpdateRequested(){return this.Tr}delayInitialization(t){void 0===t&&(t=null);const e=this.animationManager,i=e.isEnabled,s=(e.stopAnimation(),e.isEnabled=!1,this.Pr(),this.eo=!1,this.fx=new _(NaN,NaN),e.isEnabled=i,this.Ps=!0,this);null!==t&&Kt.Xh(()=>{s.Ps=!1,e.zl("Model"),t(s)},1)}requestUpdate(t){if(void 0===t&&(t=!1),!(!0===this.Tr||this.$t||!1===t&&this.Ps)){this.Tr=!0;const e=this;v.requestAnimationFrame(()=>{e.Tr&&e.maybeUpdate()})}}maybeUpdate(){this.Yu&&!this.Tr||(this.Yu&&(this.Yu=!1),this.Pr())}PP(t,e){!this.Gu||this.$t||this.animationManager.defaultAnimation.isAnimating||this.kA()||(t&&this.Fi(),e&&this.Hs(!1))}Pr(n){if(!this.Ps&&(this.Tr=!1,null!==this.Ot||this.Hu.isReal())){this.Ps=!0;var a=this.animationManager,r=this.Wu;if(!a.isAnimating&&0!==r.length){var o=r.h,l=o.length;for(let t=0;tt.NP()),r.clear());let t=!1,e=!1;a.defaultAnimation.isAnimating&&(e=!0,t=this.skipsUndoManager,this.skipsUndoManager=!0),a.Mi||this.RM(),n||this.PP(!1,!0),null!==this.ls&&(this.ls.visible&&!this.t0&&(this._r(),this.t0=!0),!this.ls.visible)&&this.t0&&(this.t0=!1);var r=!this.undoManager.isUndoingRedoing&&(this.Al||0!==this.vf.count&&0!==this.Or.size),u=!this.eo||this.Jr;this.Fi(!0);let i=!1,s=((u||r)&&(this.eo?this.CP(!this.Xf,r):(this.startTransaction("Initial Layout"),!1===a.isEnabled&&a.stopAnimation(),this.CP(!1,r)),i=u),this.Xf=!1,this.Al=!1,this.Fi(),this.vx||this.uR(),n||this.PP(!0,!1),!1);i?((r=Q.a()).c(this.viewportBounds),this.eo||(this.eo=!0,s=!0,this.skipsUndoManager||(this.undoManager.Kw=!0),this.undoManager.Uw=!0,this.dR()),this.gR(),this.Fi(!1),n||this.PP(!0,!0),Q.o(r)):a.Lf&&a.ax&&(1!==this.Ir?this.scale=this.Zu(this.Ir):1!==this.Ql?this.scale=this.Zu(this.Ql):(u=this.initialScale,isFinite(u)&&0{t instanceof X&&t.PA(!1)})}}MA(t,e){for(const i of t)!i.De()||i instanceof X||(i.tl()?(i.wt(1/0,1/0),i.vt()):e&&e.add(i));for(const s of t)if(s instanceof X){if(!s.isVisible())continue;this.L1(s)}}NP(t,e){this.MA(t,e);for(const s of t){var i;s instanceof Y&&(i=s).isVisible()&&(i.tl()?(i.wt(1/0,1/0),i.vt()):e.add(i))}for(const n of t)n instanceof K&&n.isVisible()&&(n.tl()?(n.wt(1/0,1/0),n.vt()):e.add(n))}g0(t){var e=t instanceof q,i=e?t.links:t.memberParts,s=this._n;if(e)this.Fi(!0);else{for(;i.next();){var n=i.value;!s.has(n)||!n.De()||n instanceof X||n.tl()&&(n.wt(1/0,1/0),n.vt())}for(i.reset();i.next();){var a=i.value;s.has(a)&&a instanceof X&&a.isVisible()&&this.L1(a)}i.reset()}for(;i.next();){var r=i.value;r instanceof Y&&s.has(r)&&r.isVisible()&&r.tl()&&(r.wt(1/0,1/0),r.vt())}}L1(t){for(var e=Kt.ct(),i=Kt.ct(),s=t.memberParts;s.next();){var n=s.value;n.isVisible()&&(n instanceof X?(n.Ko()||n.hs()||n.rh())&&this.L1(n):n instanceof Y?(n.fromNode===t||n.toNode===t?i:e).push(n):(n.wt(1/0,1/0),n.vt()))}let a=e.length;for(let t=0;tt.Bu())}else for(let t=0;tv&&(g=b.left,m=b.right),c.height>y&&(f=b.top,p=b.bottom)):(g=b.left,m=b.right,f=b.top,p=b.bottom),c.width+g+m),x=c.height+f+p,w=this.scale,z=w,A=o/wC+1&&(t=Math.max((M-C)*w+this.Ct,t)),v+a+1D+1&&(t=Math.max((c-D)*w+this.At,t)),y+r+1C+1&&(t=Math.max((M-C)*w+this.Ct,t)),v+1D+1&&(t=Math.max((c-D)*w+e,t)),y+1C+1&&(R=this.position.x*w)),this.ju)switch(this.Cx){case"negative":R=-(u.scrollWidth-R-u.clientWidth);break;case"reverse":R=u.scrollWidth-R-u.clientWidth}return u.scrollLeft=R,this.hasVerticalScrollbar&&this.allowVerticalScroll&&(y+1D+1&&(u.scrollTop=this.position.y*w)),o=this.Ct,l=this.At,u.style.width=o+(this.io?this.wi:0)+"px",u.style.height=l+(this.kn?this.wi:0)+"px",e===o&&i===l&&!this.animationManager.Mi||(A=Q.H(h,O,I,V),this.onViewportBoundsChanged(A,this.viewportBounds,z,n),Q.o(A),!1)}add(e){Kt.s(e,H,q,"add:part");var i=e.diagram;if(i!==this){null!==i&&Kt.n("Cannot add part "+e.toString()+" to "+this.toString()+". It is already a part of "+i.toString());let t=this.findLayer(e.layerName);null===(t=null===t?this.findLayer(""):t)&&Kt.n('Cannot add a Part when unable find a Layer named "'+e.layerName+'" and there is no default Layer'),e.layer!==t&&(0<=(i=t.Qh(99999999,e,e.diagram===this))&&this.raiseChangedEvent(3,"parts",t,null,e,null,i),t.isTemporary||this.invalidateDocumentBounds(),e.invalidateLayout(1),null!==(i=e.layerChanged))&&i(e,null,t)}}Qh(t){this.partManager.Qh(t);const e=this;t.il(t=>e.CA(t)),t.data||t.Uo(),t.hasPlaceholder()&&t.u(),null!==t.data&&t.il(t=>e.partManager.LP(t,null)),!0!==t.hs()&&!0!==t.rh()||this.d0(t),t.AA(!0,this),t.LA()?(t.actualBounds.isReal()&&this.T(t.$h(t.actualBounds)),this.invalidateDocumentBounds()):t.isVisible()&&t.actualBounds.isReal()&&this.T(t.$h(t.actualBounds)),this.requestUpdate()}re(t){t.clearAdornments(),this.partManager.re(t);const e=this;null!==t.data&&t.il(t=>e.partManager.TP(t,e)),this._n.delete(t),t instanceof Y&&this.Or.delete(t),t.LA()?(t.actualBounds.isReal()&&this.T(t.$h(t.actualBounds)),this.invalidateDocumentBounds()):t.isVisible()&&t.actualBounds.isReal()&&this.T(t.$h(t.actualBounds)),this.requestUpdate()}remove(t){Kt.s(t,H,q,"remove:part"),this.DP(t,!0)}DP(t,e){var i=t.layer;null!==i&&i.diagram===this&&(t.isSelected=!1,t.isHighlighted=!1,t.invalidateLayout(2),e&&t.Wf(),0<=(e=i.re(-1,t,!1))&&this.raiseChangedEvent(4,"parts",i,t,null,e,null),null!==(e=t.layerChanged))&&e(t,i,null)}removeParts(e,i){if(void 0===i&&(i=!1),Array.isArray(e)){var s=e.length;for(let t=0;tthis.maxScale&&(s=this.maxScale),_.H(this.lt.x+t/i-t/s,this.lt.y+e/i-e/s));this.position=r,_.o(r),this.v=s,this.$r(),this.$t=!1,this.onViewportBoundsChanged(a,this.viewportBounds,i,!1),this.Hs(!1),n.iA(i,this.v),this.T()}}hR(){var e=this.Jt.h;for(let t=0;t{t.isAvoiding&&t.actualBounds.intersectsRect(e)&&t.invalidateRoute()}))}_r(t){var e,i,s,n=this.ls;null!==n&&n.visible&&null!==n.layer&&(t=void 0!==t?t:this.a1).isReal()&&(s=t.width,e=t.height,n.scale=1,n.angle=0,n.layer.isViewportAligned?(n.width=s*this.scale,n.height=e*this.scale,n.part.alignment=Z.TopLeft):(null===n.Pi&&(n.Pi=new ye),(i=n.Pi.jf).isReal()&&(n.width=s+2*i.width,n.height=e+2*i.height,s=_.a(),z.vg(t.x,t.y,0,0,i.width,i.height,s),s.offset(-i.width,-i.height),n.part.location=s,_.o(s))))}clearSelection(t){void 0===t&&(t=!1);var e=this.selection;if(0!==e.count){t||this.V("ChangingSelection",e);var i=e.toArray(),s=i.length;for(let t=0;t= 0",q,"scrollHorizontalLineChange"),this.i1=t,this.i("scrollHorizontalLineChange",e,t))}get scrollVerticalLineChange(){return this.e1}set scrollVerticalLineChange(t){var e=this.e1;e!==t&&(Kt.t(t,"number",q,"scrollVerticalLineChange"),t<0&&Kt.G(t,">= 0",q,"scrollVerticalLineChange"),this.e1=t,this.i("scrollVerticalLineChange",e,t))}get lastInput(){return this.ia}set lastInput(t){Ht,Kt.s(t,C,q,"lastInput"),this.ia=t}get previousInput(){return this.jr}set previousInput(t){Ht,Kt.s(t,C,q,"previousInput"),this.jr=t}get firstInput(){return this.e0}set firstInput(t){Ht,Kt.s(t,C,q,"firstInput"),this.e0=t}get currentCursor(){return this.Kx}set currentCursor(t){var e,i,s;""===t&&(t=this.Zm),this.Kx!==t&&(Kt.t(t,"string",q,"currentCursor"),e=this.xt,i=this.Ot,null!==e)&&null!==i&&(this.Kx=t,s=e.style.cursor,e.style.cursor=t,i.style.cursor=t,e.style.cursor===s)&&(e.style.cursor="-webkit-"+t,i.style.cursor="-webkit-"+t,e.style.cursor===s)&&(e.style.cursor="-moz-"+t,i.style.cursor="-moz-"+t,e.style.cursor===s)&&(e.style.cursor=t,i.style.cursor=t)}get defaultCursor(){return this.Zm}set defaultCursor(t){var e=this.Zm;e!==(t=""===t?"auto":t)&&(Kt.t(t,"string",q,"defaultCursor"),this.Zm=t,this.i("defaultCursor",e,t))}get click(){return this.Vr}set click(t){var e=this.Vr;e!==t&&(null!==t&&Kt.t(t,"function",q,"click"),this.Vr=t,this.i("click",e,t))}get doubleClick(){return this.Br}set doubleClick(t){var e=this.Br;e!==t&&(null!==t&&Kt.t(t,"function",q,"doubleClick"),this.Br=t,this.i("doubleClick",e,t))}get contextClick(){return this.zr}set contextClick(t){var e=this.zr;e!==t&&(null!==t&&Kt.t(t,"function",q,"contextClick"),this.zr=t,this.i("contextClick",e,t))}get mouseOver(){return this.Xr}set mouseOver(t){var e=this.Xr;e!==t&&(null!==t&&Kt.t(t,"function",q,"mouseOver"),this.Xr=t,this.i("mouseOver",e,t))}get mouseHover(){return this.Yr}set mouseHover(t){var e=this.Yr;e!==t&&(null!==t&&Kt.t(t,"function",q,"mouseHover"),this.Yr=t,this.i("mouseHover",e,t))}get mouseHold(){return this.Kr}set mouseHold(t){var e=this.Kr;e!==t&&(null!==t&&Kt.t(t,"function",q,"mouseHold"),this.Kr=t,this.i("mouseHold",e,t))}get mouseDragOver(){return this.Ux}set mouseDragOver(t){var e=this.Ux;e!==t&&(null!==t&&Kt.t(t,"function",q,"mouseDragOver"),this.Ux=t,this.i("mouseDragOver",e,t))}get mouseDrop(){return this.Ur}set mouseDrop(t){var e=this.Ur;e!==t&&(Ht,null!==t&&Kt.t(t,"function",q,"mouseDrop"),this.Ur=t,this.i("mouseDrop",e,t))}get handlesDragDropForTopLevelParts(){return this.Gx}set handlesDragDropForTopLevelParts(t){var e=this.Gx;e!==t&&(Kt.t(t,"boolean",q,"handlesDragDropForTopLevelParts"),this.Gx=t,this.i("handlesDragDropForTopLevelParts",e,t))}get mouseEnter(){return this.Gr}set mouseEnter(t){var e=this.Gr;e!==t&&(null!==t&&Kt.t(t,"function",q,"mouseEnter"),this.Gr=t,this.i("mouseEnter",e,t))}get mouseLeave(){return this.Hr}set mouseLeave(t){var e=this.Hr;e!==t&&(null!==t&&Kt.t(t,"function",q,"mouseLeave"),this.Hr=t,this.i("mouseLeave",e,t))}get toolTip(){return this.vr}set toolTip(t){var e=this.vr;e!==t&&(Ht,null===t||(t instanceof K||t instanceof pt)||Kt.n("Diagram.toolTip must be an Adornment or HTMLInfo."),this.vr=t,this.i("toolTip",e,t))}get contextMenu(){return this.qr}set contextMenu(t){var e=this.qr;e!==t&&(Ht,t instanceof K||t instanceof pt||Kt.n("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.qr=t,this.i("contextMenu",e,t))}get commandHandler(){return this.tP}set commandHandler(t){this.tP!==t&&(this.tP=t).Vo(this)}get toolManager(){return this.$M}set toolManager(t){this.$M!==t&&(Kt.s(t,st,q,"toolManager"),(this.$M=t).diagram=this)}get defaultTool(){return this.QM}set defaultTool(t){var e=this.QM;e!==t&&(Kt.s(t,J,q,"defaultTool"),((this.QM=t).diagram=this).currentTool===e)&&(this.currentTool=t)}get currentTool(){return this._M}set currentTool(t){var e=this._M;e&&(e.isActive&&e.doDeactivate(),e.cancelWaitAfter(),e.doStop()),null!==(t=null===t?this.defaultTool:t)&&(Kt.s(t,J,q,"currentTool"),(this._M=t).diagram=this,t.doStart())}get selection(){return this.lP}get maxSelectionCount(){return this.h1}set maxSelectionCount(t){var e=this.h1;if(e!==t)if(Kt.t(t,"number",q,"maxSelectionCount"),0<=t&&!isNaN(t)){if(this.h1=t,this.i("maxSelectionCount",e,t),!this.undoManager.isUndoingRedoing){var i=this.selection.count-t;if(0= 0",q,"maxSelectionCount")}get nodeSelectionAdornmentTemplate(){return this._m}set nodeSelectionAdornmentTemplate(t){var e=this._m;e!==t&&(Kt.s(t,K,q,"nodeSelectionAdornmentTemplate"),this._m=t,this.i("nodeSelectionAdornmentTemplate",e,t))}get groupSelectionAdornmentTemplate(){return this.c1}set groupSelectionAdornmentTemplate(t){var e=this.c1;e!==t&&(Kt.s(t,K,q,"groupSelectionAdornmentTemplate"),this.c1=t,this.i("groupSelectionAdornmentTemplate",e,t))}get linkSelectionAdornmentTemplate(){return this.u1}set linkSelectionAdornmentTemplate(t){var e=this.u1;e!==t&&(Kt.s(t,K,q,"linkSelectionAdornmentTemplate"),this.u1=t,this.i("linkSelectionAdornmentTemplate",e,t))}get highlighteds(){return this.hP}get isModified(){var t=this.undoManager;return t.isEnabled?null!==t.currentTransaction||this.vu&&this.Ys!==t.historyIndex:this.vu}set isModified(t){var e;this.vu!==t&&(Kt.t(t,"boolean",q,"isModified"),this.vu=t,e=this.undoManager,!t&&e.isEnabled&&(this.Ys=e.historyIndex),t||this.VA())}VA(){var t=this.isModified;this.oP!==t&&(this.oP=t,this.V("Modified"))}get model(){return this.Li}set model(e){const i=this.Li;if(i!==e){Kt.s(e,b,q,"model"),this.currentTool.doCancel(),i&&i.undoManager!==e.undoManager&&i.undoManager.isInTransaction&&Kt.n("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.stopAnimation(!0);var s=this.yA(!0),t=(this.eo=!1,this.Yu=!0,this.Ys=-2,this.Tr=!1,this.$t);this.$t=!0,this.animationManager.zl("Model"),i&&(null!==this.to&&this.to.each(t=>i.removeChangedListener(t)),i.removeChangedListener(this.nP)),this.Li=e,this.partManager=this.wR(this.Li.type),this.initializePartManager(this.partManager);for(let t=0;te.addChangedListener(t)),this.$t=t,this.invalidateDocumentBounds(),this.$t||this.T(),i&&e.undoManager.copyProperties(i.undoManager)}}get themeManager(){return this.C1}set themeManager(t){var e=this.C1;e!==t&&(Kt.s(t,ji,b,"themeManager"),null!==e&&e.removeDiagram(this),null!==(this.C1=t))&&t.addDiagram(this)}initializePartManager(t){}static xP(t,e){q.cA.add(t,e)}static get licenseKey(){return q.IP.last()}static set licenseKey(t){q.IP.add(t.replace(/\s/g,""))}static get version(){return q.xR}static IP=new O;static xR="3.0.2";wR(t){t=q.cA.get(t);return new(null!==t?t:ei)}get W(){return this.eP}set W(t){this.eP=t}get Mx(){return this.hA}bR(t){if(t.model===this.model){var e,i=t.change,s=t.propertyName;if(1===i&&"S"===s[0])if("StartingFirstTransaction"===s){const r=this,o=this.toolManager;o.mouseDownTools.each(t=>t.diagram=r),o.mouseMoveTools.each(t=>t.diagram=r),o.mouseUpTools.each(t=>t.diagram=r),this.routers.each(t=>t.diagram=r),this.Ps||this.eo||(this.Xf=!0,!this.Yu)||(this.Tr=!0)}else"StartingUndo"===s||"StartingRedo"===s?(e=this.animationManager,this.skipsUndoManager||(e.defaultAnimation.isAnimating&&e.stopAnimation(),e.getBundleAnimation().isAnimating&&e.getBundleAnimation().stop()),this.V("ChangingSelection",this.selection)):"StartedTransaction"===s&&(e=this.animationManager).defaultAnimation.isAnimating&&!this.skipsUndoManager&&e.stopAnimation();else if(this.W){this.W=!1;try{if(""===t.modelChange&&1===i){"FinishedUndo"!==s&&"FinishedRedo"!==s||(this.V("ChangedSelection",this.selection),this.Fi());var n=this.animationManager,a=("RolledBackTransaction"===s&&n.stopAnimation(),this.yR(),this.Xf=!0,this.maybeUpdate(),0!==this.undoManager.transactionLevel&&1!==this.undoManager.transactionLevel||n.FM(),"CommittedTransaction"===s&&this.undoManager.isJustDiscarded&&(this.Ys=Math.min(this.Ys,this.undoManager.historyIndex-1)),"CommittedTransaction"!==s&&"RolledBackTransaction"!==s||!this.undoManager.Uw||setTimeout(()=>{this.isModified=!1},1),t.isTransactionFinished);if(a&&(this.VA(),this.Mx.clear(),this.animationManager.mF()),!this.Hx&&a&&this.lastInput.targetDiagram){this.Hx=!0;const l=this;Kt.Xh(()=>{l.currentTool.standardMouseOver(),l.Hx=!1},10)}}}finally{this.W=!0}}}}get xe(){return this.iP}set xe(t){this.iP=t}get Am(){return this.vx}set Am(t){this.vx=t}CA(t){for(const e of t.F.h)e instanceof Le&&this.OP(e)}OP(e){var t=e.element;if(null!==t&&t instanceof HTMLImageElement&&(t.as instanceof N&&t.as.add(this),e.kR(),t.w0)){var i=t.getAttribute("src")||"",s=this.eh.getValue(i);if(null===s){Le.BA(e,t);t=[];t.push(e),this.eh.add(i,t)}else{for(let t=0;tthis.scale&&(this.scale=t)):Kt.G(t,"> 0",q,"minScale"))}get maxScale(){return this.Dx}set maxScale(t){Kt.r(t,q,"maxScale");var e=this.Dx;e!==t&&(0 0",q,"maxScale"))}get zoomPoint(){return this.Fx}set zoomPoint(t){this.Fx.equals(t)||(Kt.s(t,_,q,"zoomPoint"),t=t.L(),this.Fx=t)}get contentAlignment(){return this.Bf}set contentAlignment(t){var e=this.Bf;e.equals(t)||(Kt.s(t,Z,q,"contentAlignment"),t=t.L(),this.Bf=t,this.i("contentAlignment",e,t),this.Hs(!1))}get initialContentAlignment(){return this.Wm}set initialContentAlignment(t){var e=this.Wm;e.equals(t)||(Kt.s(t,Z,q,"initialContentAlignment"),t=t.L(),this.Wm=t,this.i("initialContentAlignment",e,t))}get padding(){return this.ei}set padding(t){"number"==typeof t?t=new I(t):Kt.s(t,I,q,"padding");var e=this.ei;e.equals(t)||(t=t.L(),this.ei=t,this.invalidateDocumentBounds(),this.i("padding",e,t))}get partManager(){return this.cP}set partManager(t){var e=this.cP;e!==t&&(Kt.s(t,ei,q,"partManager"),null!==t.diagram&&Kt.n("Cannot share PartManagers between Diagrams: "+t.toString()),e&&e.Vo(null),(this.cP=t).Vo(this))}get nodes(){return this.partManager.nodes.iterator}get links(){return this.partManager.links.iterator}get parts(){return this.partManager.parts.iterator}findTopLevelNodesAndLinks(){for(var t=new N,e=this.nodes;e.next();){var i=e.value;i.isTopLevel&&t.add(i)}for(var s=this.links;s.next();){var n=s.value;n.isTopLevel&&t.add(n)}return t.iterator}findTopLevelGroups(){return this.Zr.iterator}get routers(){return this.vf}doLinkRouting(e){this.zo=!0;var i=this.vf.h;for(let t=0;t{var t;-1===e.zf||(e.stopAutoScroll(),null===e.lastInput.event)||(t=e.computeAutoScrollPosition(e.i0)).equalsApprox(e.position)||(e.position=t,e.lastInput.documentPoint=e.transformViewToDoc(e.i0),e.doMouseMove(),e.ea=!0,t=Q.a(),e.computeBounds(t),t.unionRect(e.documentBounds),e.zA(t),Q.o(t),e.qe=!0,e.maybeUpdate(),e.HA())},t)}}stopAutoScroll(){-1!==this.zf&&(Kt.Gg(this.zf),this.zf=-1)}computeAutoScrollPosition(t){let e=this.position;var i,s,n,a,r=this.Jm;return r.top<=0&&r.left<=0&&r.right<=0&&r.bottom<=0||(s=this.viewportBounds,i=this.scale,s=Q.H(0,0,s.width*i,s.height*i),n=_.H(0,0),t.x>=s.x&&t.xs.x+s.width-r.right&&this.allowHorizontalScroll&&(a=Math.max(this.scrollHorizontalLineChange,1),n.x+=a|=0,t.x>s.x+s.width-r.right/2&&(n.x+=a),t.x>s.x+s.width-r.right/4)&&(n.x+=4*a),t.y>=s.y&&t.ys.y+s.height-r.bottom&&this.allowVerticalScroll&&(a=Math.max(this.scrollVerticalLineChange,1),n.y+=a|=0,t.y>s.y+s.height-r.bottom/2&&(n.y+=a),t.y>s.y+s.height-r.bottom/4)&&(n.y+=4*a),n.equalsApprox(_.To)||(e=new _(e.x+n.x/i,e.y+n.y/i)),Q.o(s),_.o(n)),e}makeSvg(t){this.ih.contains("SVG")||this.addRenderer("SVG",new Zt(this,v.document));const i=new Zt(this,v.document,!0),s=this;return this.qA(function(t,e){return t=null!==(t=s.vA(t,"SVG",i))?t.svg:null,"function"==typeof e?(e(t),null):t},t=void 0===t?{}:t)}makeSVG(t){return this.makeSvg(t)}addRenderer(t,e){this.ih.add(t,e)}removeRenderer(t){this.ih.remove(t)}cacheGroupExternalLinks(t){(this.wP=t)||this.nodes.each(t=>{t instanceof X&&(t.b0=null)})}qA(e,i){const s=i.callback;let n=!0;const a=this.eh.iterator;for(;a.next();)if(!a.value[0].Sn){n=!1;break}if("function"!=typeof s||n)return e(i,s,this);const r=this;function o(){var t=+new Date;for(n=!0,a.reset();a.next();)if(!a.value[0].Sn){n=!1;break}n||t-h>l?e(i,s,r):v.requestAnimationFrame(o)}const l=i.callbackTimeout||300,h=+new Date;return v.requestAnimationFrame(()=>o()),null}makeImage(t){return q.isUsingDOM()?((t=void 0===t?{}:t).returnType="Image",this.makeImageData(t)):null}makeImageData(t){return this.qA(this.NR,t=void 0===t?{}:t)}static img="image";NR(e,i,t){var s=t.vA(e,"canvas",null);if(null===s)return null;var n=s.Y.canvas;let a=null;if(null!==n){let t=e.returnType;switch(t=void 0===t?"string":t.toLowerCase()){case q.img+"data":a=s.getImageData(0,0,n.width,n.height);break;case q.img:var r=(e.document||document).createElement("img");r.src=n.toDataURL(e.type,e.details),a=r;break;case"blob":r=n;return"function"!=typeof i&&(a="",Kt.n('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.')),"function"==typeof r.toBlob?(r.toBlob(i,e.type,e.details),"toBlob"):(i(null),null);default:a=n.toDataURL(e.type,e.details)}}return"function"==typeof i?(i(a),null):a}static WA=!1;vA(t,i,e){if(this.animationManager.stopAnimation(),this.maybeUpdate(),null===this.xt)return null;"object"!=typeof t&&Kt.n("properties argument must be an Object.");let s=!1,n=t.size||null,a=t.scale||null,r=(void 0!==t.scale&&isNaN(t.scale)&&(a="NaN"),t.maxSize);void 0===t.maxSize&&(s=!0,r="SVG"===i?new Yt(1/0,1/0):new Yt(2e3,2e3));var o=t.position||null;let l=t.parts||null,h=(Array.isArray(l)&&(l=new O(l)),void 0===t.padding?1:t.padding);var u=t.background||null;let d=t.omitTemporary;void 0===d&&(d=!0);var c=t.document||document,g=t.elementFinished||null;let m=t.showTemporary,f=(void 0===m&&(m=!d),t.showGrid);void 0===f&&(f=m),null!==n&&isNaN(n.width)&&isNaN(n.height)&&(n=null),"number"==typeof h?h=new I(h):h instanceof I||Kt.n("MakeImage padding must be a Margin or a number."),h.left=Math.max(h.left,0),h.right=Math.max(h.right,0),h.top=Math.max(h.top,0),h.bottom=Math.max(h.bottom,0),this.ai.clearContextCache(!0);var t=new $t(null,c,void 0,!0),p=t.gi;if(!(n||a||l||o))return t.width=this.Ct+Math.ceil(h.left+h.right),t.height=this.At+Math.ceil(h.top+h.bottom),"SVG"===i?null===e?null:(e.resize(t.width,t.height,t.width,t.height),e.ga=c,e.$u=g,this.T1(e.gi,h,new Yt(t.width,t.height),this.v,this.lt,l,u,m,f),e.gi):(this.qu=!1,this.T1(p,h,new Yt(t.width,t.height),this.v,this.lt,l,u,m,f),this.qu=!0,t.gi);var v=this.s0,y=this.documentBounds.copy();if(y.subtractMargin(this.ei),m){var b=this.Jt.h,x=b.length;for(let t=0;tv?(a=v,E=y.width,y):(E=r.width,r)).height:(E=y.width*a,y.height*a):(a=v,E=y.width,y.height),null!==h?(E+=D,R+=T):h=new I(0),null!==r){let t=r.width,e=r.height;"SVG"!==i&&s&&!q.WA&&(Ht,E>t||R>e)&&(Kt.ft("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(E)+"x"+Math.ceil(R)+" vs 2000x2000) Consider increasing the max size."),q.WA=!0),isNaN(t)&&(t=2e3),isNaN(e)&&(e=2e3),isFinite(t)&&(E=Math.min(E,t)),isFinite(e)&&(R=Math.min(R,e))}return t.width=Math.ceil(E),t.height=Math.ceil(R),"SVG"===i?null===e?null:(e.resize(t.width,t.height,t.width,t.height),e.ga=c,e.$u=g,this.T1(e.gi,h,new Yt(Math.ceil(E),Math.ceil(R)),a,S,l,u,m,f),e.gi):(this.qu=!1,this.T1(p,h,new Yt(Math.ceil(E),Math.ceil(R)),a,S,l,u,m,f),this.qu=!0,t.gi)}static Ju=null;static jA="5da73c80a36555d4038e4972187c3cae51fd22";static ww=!1;static Hk=()=>{if(void 0===q.jA[5]&&(V.prototype.rs=V.prototype.Pw),q.isUsingDOM()){var t=v.document.createElement("canvas"),e=t.getContext("2d"),i=Kt.Os("7ca11abfd022028846"),s=(e[i]=Kt.Os("398c3597c01238"),"7ca11abfd7330390"),n=[q.jA,Kt.ww+"4ae6247590da4bb21c324ba3a84e385776",V.Hk+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",z.za];for(let t=1;t<5;t++)e[Kt.Os(s)](Kt.Os(n[t-1]),10,15*t+0);e[i]=Kt.Os("39f046ebb36e4b");for(let t=1;t<5;t++)e[Kt.Os(s)](Kt.Os(n[t-1]),10,15*t+0);4===n.length&&"5"===n[0][0]&&"7"===n[3][0]||(V.prototype.rs=V.prototype.Pw),q.Ju=t}}}class Ft{JA;ZA;UP;Ie;constructor(t){this.JA=null,this.ZA="63ad05bbe23a1786468a4c741b6d2",this.UP="@onz",this.ZA===this._tk?(this.UP=!0,this.Ie=this.UP):this.Ie=null}CR(t,e){let i="f";var s=v[Kt.Os("76a715b2f73f148a")][Kt.Os("72ba13b5")]||"",n=Kt.Os;if(this.Ie=!0,q.isUsingDOM())if(q[n("76a115b6ed251eaf4692")])for(var a=q.IP.iterator;a.next();){var r=n(a.value).split(n("39e9"));if(r.length<6)return;var o=n(r[1]).split(".");if("7da71ca0"!==r[4])return;var l=n(Kt[n("6cae19")]).split(".");if(o[0]>l[0]||o[0]===l[0]&&o[1]>=l[1]){var o="73a612b6fb191d",l=v[n("74a900bae4370f8b51")][n("6fbb13a1c2311e8a57")].toLowerCase(),h=l[n(o)](n("3aad1ab6e022098b4dc4")),u=n(r[2]);if(-1h),!this.Ie))return;l=u;if("#"===l[0]){o=v.document.createElement("div");let t=r[0].replace(/[A-Za-z]/g,"");for(;t.length<4;)t+="9";var h=t,c=(t=t.substring(t.length-4),""),u=["Header","Background","Display","Feedback"],c=(c+=["gsh","gsf"][parseInt(t.substring(0,1),10)%2])+u[parseInt(t.substring(0,1),10)%4];if(o[n("79a417a0f0181a8946")]=c,v.document[n("78a712aa")]){v.document[n("78a712aa")][n("7bb806b6ed32388c4a875b")](o);r=v.getComputedStyle(o).getPropertyValue(n("78a704b7e62456904c9b12701b6532a8")),u=v.getComputedStyle(o).getPropertyValue(n("75b817b0ea2202"));if(v.document[n("78a712aa")][n("68ad1bbcf533388c4a875b")](o),r){o=v[n("77a902b0eb1b1e804a8a")];if(u==="0."+parseInt(h,10)%100||-1!==r.indexOf(parseInt(l[1]+l[2],16))&&-1!==r.indexOf(parseInt(l[3]+l[4],16)))return void(this.Ie=!1);if(o&&o(n("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches){c="."+c;for(let t=0;t{var t,e,i=this.observed;null!==i&&(t=i.viewportBounds,e=this.lastInput.documentPoint,i.position=new _(e.x-t.width/2,e.y-t.height/2))},this.vP=t=>{this.invalidateDocumentBounds(),this.S0()},this.qP=t=>{null!==this.observed&&(this.invalidateDocumentBounds(),this.T())},this.B1=t=>{this.updateDelay<1?this.T():this.k0||(this.k0=!0,setTimeout(()=>this.redraw(),this.updateDelay))},this.WP=t=>{null!==this.observed&&this.S0()},this.autoScale=2,this.$t=!1,e&&Object.assign(this,e),this}setupRouters(){}computePixelRatio(){return 1}redraw(){this.k0&&1<=this.updateDelay&&(this.k0=!1,this.AR()),super.redraw()}Ji(){if(null===this.Ot&&Kt.n("No div specified"),null===this.xt&&Kt.n("No canvas specified"),!(this.xt instanceof Zt)&&(this.box.qM(),this.qe)){var t=this.observed;if(null!==t&&!t.animationManager.defaultAnimation.isAnimating&&t.Uh){this.m0();var t=this.xt,e=this.ai,i=(e.clearContextCache(!0),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.updateDelay<1?this.QA():null!==this.Zf&&(e.drawImage(this.Zf.Bt,0,0),(t=this.D).ti(),1!==this.scale&&t.v(this.scale),0===this.position.x&&0===this.position.y||t.se(-this.position.x,-this.position.y),e.scale(this.Gi,this.Gi),e.transform(t.m11,t.m12,t.m21,t.m22,t.dx,t.dy),e.commitTransform()),this.Jt.h),s=i.length;for(let t=0;tt.canDelete())}t.removeParts(e,!0),t.V("SelectionDeleted",e)}finally{t.commitTransaction("Delete"),t.V("ChangedSelection",t.selection),t.currentCursor=""}}canDeleteSelection(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowDelete||0===t.selection.count)}copySelection(){for(var t=this.diagram,e=new N,i=t.selection.iterator;i.next();){var s=i.value;H.ah(e,s,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,t=>t.canCopy())}this.copyToClipboard(e)}canCopySelection(){var t=this.diagram;return!(!t.allowCopy||!t.allowClipboard||0===t.selection.count)}cutSelection(){this.copySelection(),this.deleteSelection()}canCutSelection(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowCopy||!t.allowDelete||!t.allowClipboard||0===t.selection.count)}copyToClipboard(s){var n=this.diagram;let a=null;if(null===s)q.pA();else{var r=n.model;let t=!1,e=!1,i=null;try{r.Qu()&&(t=r.copiesParentKeyOfNodeData,r.copiesParentKeyOfNodeData=this.copiesParentKey),(r.bf()||r._u())&&(e=r.copiesGroupKeyOfNodeData,r.copiesGroupKeyOfNodeData=this.copiesGroupKey),i=n.copyParts(s,null,!0)}finally{r.Qu()&&(r.copiesParentKeyOfNodeData=t),(r.bf()||r._u())&&(r.copiesGroupKeyOfNodeData=e),(a=new O).addAll(i.iteratorValues),q.c0=a,q.A1=n.model.dataFormat}}n.V("ClipboardChanged",a)}pasteFromClipboard(){var s=new N,n=q.c0;if(null!==n){var a=this.diagram;if(q.A1===a.model.dataFormat){var r=a.model;let t=!1,e=!1,i=null;try{r.Qu()&&(t=r.copiesParentKeyOfNodeData,r.copiesParentKeyOfNodeData=this.copiesParentKey),(r.bf()||r._u())&&(e=r.copiesGroupKeyOfNodeData,r.copiesGroupKeyOfNodeData=this.copiesGroupKey),i=a.copyParts(n,a,!1)}finally{r.Qu()&&(r.copiesParentKeyOfNodeData=t),(r.bf()||r._u())&&(r.copiesGroupKeyOfNodeData=e);for(var o=i.iterator;o.next();){var l=o.value,h=o.key;l.location.isReal()||(h.location.isReal()?l.location=h.location:!l.position.isReal()&&h.position.isReal()&&(l.position=h.position)),s.add(l)}}}}return s}pasteSelection(t){void 0===t&&(t=null);var e=this.diagram;try{e.currentCursor="wait",e.V("ChangingSelection",e.selection),e.startTransaction("Paste");for(var i,s,n=this.pasteFromClipboard(),a=(0e.maxScale||(e.scale=t)}canDecreaseZoom(t){void 0===t&&(t=1/this.zoomFactor),Kt.r(t,qt,"canDecreaseZoom:factor");var e=this.diagram;return 1===e.autoScale&&!((t=e.scale*t)e.maxScale)&&e.allowZoom}increaseZoom(t){void 0===t&&(t=this.zoomFactor),Kt.r(t,qt,"increaseZoom:factor");var e=this.diagram;1!==e.autoScale||(t=e.scale*t)e.maxScale||(e.scale=t)}canIncreaseZoom(t){void 0===t&&(t=this.zoomFactor),Kt.r(t,qt,"canIncreaseZoom:factor");var e=this.diagram;return 1===e.autoScale&&!((t=e.scale*t)e.maxScale)&&e.allowZoom}resetZoom(t){void 0===t&&(t=this.defaultScale),Kt.r(t,qt,"resetZoom:newscale");var e=this.diagram;te.maxScale||(e.scale=t)}canResetZoom(t){void 0===t&&(t=this.defaultScale),Kt.r(t,qt,"canResetZoom:newscale");var e=this.diagram;return!(te.maxScale)&&e.allowZoom}zoomToFit(){var t=this.diagram,e=t.animationManager,i=(e.stopAnimation(),t.redraw(),t.position),s=t.scale;e.zl("Zoom To Fit"),this.isZoomToFitRestoreEnabled&&s===this.X1&&!isNaN(this.z1)&&t.documentBounds.equals(this.Y1)?(t.scale=this.z1,t.position=this.s2,this.X1=NaN,this.Y1=Q.Xk):(this.z1=s,this.s2=i.copy(),t.zoomToFit(),this.X1=t.scale,this.Y1=t.documentBounds.copy()),e.FM()}canZoomToFit(){return this.diagram.allowZoom}scrollToPart(t){null!==(t=void 0===t?null:t)&&Kt.s(t,H,qt,"part");const e=this.diagram;if(e.ensureBounds(),null===t){try{null!==this.Ho&&(this.Ho.next()?t=this.Ho.value:this.Ho=null)}catch{this.Ho=null}null===t&&(0{e.startTransaction();let t=a.pop();for(;0{Kt.Xh(r,(s.isEnabled?s.duration:0)+n)};e.addDiagramListener("LayoutCompleted",o),r()}}else{var i=e.position.copy();e.centerRect(t.actualBounds),i.equalsApprox(e.position)&&s.stopAnimation()}}}$f(t,e){var i;return t.isVisible()||(t instanceof K?this.$f(t.adornedPart,e):t instanceof Y?(null!==(i=t.fromNode)&&this.$f(i,e),null!==(i=t.toNode)&&this.$f(i,e)):(t instanceof D&&(null!==(i=t.labeledLink)&&this.$f(i,e),null!==(i=t.findTreeParentNode()))&&(i.isTreeExpanded||i.wasTreeExpanded||e.push(i),this.$f(i,e)),null!==(i=t.containingGroup)&&(i.isSubGraphExpanded||i.wasSubGraphExpanded||e.push(i),this.$f(i,e)))),e}canScrollToPart(t){return(null===(t=void 0===t?null:t)||t instanceof H)&&(0!==(t=this.diagram).selection.count||0!==t.highlighteds.count)&&t.allowHorizontalScroll&&t.allowVerticalScroll}collapseTree(t){void 0===t&&(t=null);var e=this.diagram,i="Collapse Tree";try{e.startTransaction(i),e.animationManager.zl(i);var s=new O;if(null!==t&&t.isTreeExpanded)t.collapseTree(),s.add(t);else if(null===t)for(var n=e.selection.iterator;n.next();){var a=n.value;a instanceof D&&a.isTreeExpanded&&(a.collapseTree(),s.add(a))}e.V("TreeCollapsed",s)}finally{e.commitTransaction(i)}}canCollapseTree(t){void 0===t&&(t=null);var e=this.diagram;if(!e.isReadOnly)if(null!==t){if(!(t instanceof D&&t.isTreeExpanded))return!1;if(0{t instanceof Y||t instanceof H&&i.push(t)});else for(var e=t.iterator;e.next();){var s=e.value;s instanceof Y||s instanceof H&&i.push(s)}var n=new N,a=i.length;for(let t=0;tt instanceof j&&t.editable)}null!==e&&(i.currentTool=null,t.textBlock=e,i.currentTool=t)}}canEditTextBlock(t){void 0===t&&(t=null);var e=this.diagram;if(!e.isReadOnly&&!e.isModelReadOnly&&e.allowTextEdit&&null!==e.toolManager.findTool("TextEditing"))if(null!==t){if(!(t instanceof j))return!1;var i=t.part;if(null!==i&&i.canEdit())return!0}else for(var s=e.selection.iterator;s.next();){var n=s.value;if(n.canEdit()&&null!==(t=n.findInVisualTree(t=>t instanceof j&&t.editable)))return!0}return!1}showContextMenu(e){var i=this.diagram,s=i.toolManager.findTool("ContextMenu");if(null!==s){void 0===e&&(e=0{null!==t.data&&t.f2()&&t.updateTargetBindings(i)})}}}}wF(t){this.od.remove(t)}Uo(){if(null!==this.diagram&&null===this.findBindingPanel()&&null!==this.Ii)for(var t=this.Ii.iterator;t.next();){var i=t.value;if(i.isToTheme){let t=null;var s=i.sourceName;i.isToObject&&(t=this.tL(s));let e=this;var n=i.targetId;-1!==n&&null===(e=this.M0(n))||("/"===s?t=e.part:"."===s?t=e:".."===s&&(t=e.panel),i.updateTarget(e,t))}}}Sa(e,i){var s=this.findBindingPanel();if(null!==s)for(var n=this.Ii.iterator;n.next();){var a,r=n.value;let t=null;if(r.isToObject){if(null===(t=r.iL(s,this)))continue;r.updateSource(this,t,i,null)}else if(r.isToModel){var o=e.diagram;null===o||o.xe||r.updateSource(this,o.model.modelData,i,s)}else if(!r.isToTheme){o=s.data;if(null===o)continue;var l=e.diagram;null===l||l.xe||r.updateSource(this,o,i,s)}t===this&&(l=r.targetId,null!==(a=s.M0(l)))&&r.updateTarget(a,t,i)}}M0(t){return this.so===t?this:null}tL(t){let e;return""===t||"/"===t||"."===t||".."===t?e=this:null===(e=this.part.findObject(t))&&(Ht,Kt.ft("Binding error: missing GraphObject named "+t+" in "+this.part.toString())),e}get so(){return null!==this.g?this.g.so:-1}set so(t){this.so!==t&&(null===this.g&&(this.g=new _t),this.g.so=t)}get Ii(){return null!==this.g?this.g.Ii:null}set Ii(t){this.Ii!==t&&(null===this.g&&(this.g=new _t),this.g.Ii=t)}get no(){return null!==this.g?this.g.no:null}set no(t){this.no!==t&&(null===this.g&&(this.g=new _t),this.g.no=t)}raiseChanged(t,e,i){this.raiseChangedEvent(2,t,this,e,i)}i(t,e,i){this.raiseChangedEvent(2,t,this,e,i)}oo(t,e,i,s){var n,a=this.ce;a.e(t,e,i,s),1===this.v&&0===this.qt||(null===this.Ni&&(this.Ni=new V),(n=this.Ni).ti(),this.P0(n,t,e,i,s),n.Nw(a))}eL(t,e,i){return!1!==this.pickable&&(i.hf(this.D),e?this.intersectsRect(t,i):this.containedInRect(t,i))}sL(t,e,i){var s;return!1!==this.pickable&&(s=this.naturalBounds,e=t.distanceSquaredPoint(e),i?_.distanceLineSegmentSquared(t.x,t.y,0,0,0,s.height)<=e||_.distanceLineSegmentSquared(t.x,t.y,0,s.height,s.width,s.height)<=e||_.distanceLineSegmentSquared(t.x,t.y,s.width,s.height,s.width,0)<=e||_.distanceLineSegmentSquared(t.x,t.y,s.width,0,0,0)<=e:t.distanceSquared(0,0)<=e&&t.distanceSquared(0,s.height)<=e&&t.distanceSquared(s.width,0)<=e&&t.distanceSquared(s.width,s.height)<=e)}Mn(){return!0}containsPoint(t){Ht,Kt.s(t,_,y,"containsPoint:p");var e=_.a(),i=(e.c(t),this.D.Pt(e),this.actualBounds);if(!i.isReal())return _.o(e),!1;var s=this.diagram;if(null!==s&&s.r0){var n=s.getInputOption("extraTouchThreshold"),a=s.getInputOption("extraTouchArea"),r=a/2,o=this.naturalBounds,s=this.getDocumentScale()*s.scale,l=1/s;if(o.width*sr.width&&l.widthr.height&&l.heighte.height||this.bi>e.width)&&(r=!0)}r?this.l|=256:this.l&=-257,this.Ri.isReal()||Kt.n("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ri.toString()),this.ad(t,this.Ri),this.ro(!1),Q.o(t)}gh(t,e,i,s){}commonArrange(e,i,s,n){if(this.Ri.e(e,i,s,n),!this.desiredSize.isReal()){var e=this.ce,i=this.ol,a=i.right+i.left,i=i.top+i.bottom,r=e.width+a,o=e.height+i;s+=a,n+=i;let t=this.qs(!0);switch(t=r===s&&o===n?0:t){case 0:(sd.width+d.x||d.x>c.width+c.x)return 1!==o&&(r.globalAlpha=n),void(""!==this.filter&&(r.filter=a));r.save(),r.beginPath(),r.rect(t,e,i,s),r.clip()}if(u){if(!h.isVisible())return 1!==o&&(r.globalAlpha=n),void(""!==this.filter&&(r.filter=a));e&&(g=h.shadowOffset,r.shadowsSet(g.x*i.scale*this.scale*i.Gi,g.y*i.scale*this.scale*i.Gi,h.shadowBlur),r.shadowsOn(),r.shadowColor=h.shadowColor)}c=this.naturalBounds;r.transform(s.m11,s.m12,s.m21,s.m22,s.dx,s.dy),this.oL(e,r,u,l),null!==this.Ft&&(r.commitTransform(),this.G1(r,c,d)),this.rL(e,r,u,l),this.ph(r,i),this.lL(e,r,u),t&&(r.restore(),r.clearContextCache(this instanceof Xt)),s.Gk()||(g=1/(s.m11*s.m22-s.m12*s.m21),r.transform(s.m22*g,-s.m12*g,-s.m21*g,s.m11*g,g*(s.m21*s.dy-s.m22*s.dx),g*(s.m12*s.dx-s.m11*s.dy)))}}1!==o&&(r.globalAlpha=n),""!==this.filter&&(r.filter=a)}}}oL(t,e,i,s){t&&!0===this.shadowVisible?e.shadowsOn():t&&!1===this.shadowVisible&&e.shadowsOff(),t&&this.H1(s)&&null===this.shadowVisible&&e.shadowsOff()}rL(t,e,i,s){t&&(null!==this.Ft||this.H1(s))?(this.v1(!0),null===this.shadowVisible&&e.shadowsOff()):this.v1(!1)}lL(t,e,i){t&&!0===this.u2()&&e.shadowsOn(),i&&t&&e.shadowsOff()}IR(t,e,i){var s=this.part;let n=!1;s&&t.getRenderingHint("drawShadows")&&(n=s.isShadowed),e.clipInsteadOfFill&&(n=!1),this.Ws()&&n&&e.shadowsOn(),n&&!0===this.shadowVisible?e.shadowsOn():n&&!1===this.shadowVisible&&e.shadowsOff();s=this.panel;return n&&this.H1(s)&&null===this.shadowVisible&&e.shadowsOff(),e.hl&&(t=t.computePixelRatio(),t=`drop-shadow(${e.shadowOffsetX/t}px ${e.shadowOffsetY/t}px ${e.shadowBlur/t/2}px ${e.shadowColor})`,null!==this.background)&&i.Ft.setAttributeNS(null,"filter",t),n&&(null!==this.Ft||this.H1(s))?(this.v1(!0),null===this.shadowVisible&&e.shadowsOff()):this.v1(!1),n}OR(t,e,i,s){i.hl&&(e=e.computePixelRatio(),e=`drop-shadow(${i.shadowOffsetX/e}px ${i.shadowOffsetY/e}px ${i.shadowBlur/e/2}px ${i.shadowColor})`,this.d2(t,e)),s&&!0===this.u2()&&i.shadowsOn(),this.Ws()&&i.shadowsOff()}H1(t){return null!==t&&((t=t.ll()?t.panel:t).u2()||(t.type===Xt.Auto||t.type===Xt.Spot)&&t.findMainElement()!==this)}d2(t,e){}G1(t,e,i){var s=this.K1(),n=e.x,a=e.y,r=e.width+s,o=e.height+s;this.bn(t,this.Ft,!0,!1,e,i),this.Ft instanceof m&&3===this.Ft.type?(t.beginPath(),t.rect(n-s/2,a-s/2,r,o),t.fillContext(this.Ft,!1,null)):t.fillRect(n-s/2,a-s/2,r,o)}hL(t,e){let i=t.ER(this);if(-1!==i)if(0===i)t.svg.Ft?t.svg.Ft.after(e):t.type===Xt.Table?null!==(s=0!==(s=t.svg.getElementsByClassName("gojs-ts")).length?s[0]:null)&&s.after(e):t.svg.prepend(e);else{for(;0!==i&&!t.elt(i-1).isVisibleObject();)i--;var s;0===i?t.svg.prepend(e):null!==(s=t.elt(i-1).svg)?s.after(e):t.svg.appendChild(e)}}FR(t,e){var i,s,n,a,r,o,l;return t instanceof Jt&&(!this.visible||0===this.opacity||this.Ws()&&!this.isVisible()?null!==this.svg&&null!==this.svg.parentNode&&this.svg.remove():(i=this.panel,r=this.fd(t),this.sc(t,e,r)?(this.aL(this.svg),null!==this.svg.parentElement?this.Ws()&&(t.lastDrawnPart=this.svg):this.Ws()?(null!==t.lastDrawnPart?t.lastDrawnPart.after(this.svg):t.diagramGroup.prepend(this.svg),t.lastDrawnPart=this.svg):i&&this.hL(i,this.svg)):(this.Ws()&&this.isShadowed&&(a=this.shadowOffset,t.shadowsSet(a.x*e.scale*this.scale*e.Gi,a.y*e.scale*this.scale*e.Gi,this.shadowBlur),t.shadowsOn(),t.shadowColor=this.shadowColor),this instanceof j&&(t.font=this.font),t.currentElement=null,a=this.D,l=this instanceof Xt,o=this instanceof Xt&&this.ll(),s=this.svg,!0===this.N0()&&this.U1(),n=this.Ri,t.setCurrentTransform(1,0,0,1,0,0),t.outerGroup=!1,r&&(t.outerGroup=!0,l&&o?(t.newGroup(1,0,0,1,0,0),this.svg=t.lastCreatedElement):l?(t.newGroup(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),this.svg=t.lastCreatedElement):t.newGroup(1,0,0,1,0,0)),r=this.naturalBounds,l||t.setCurrentTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),null!==this.background&&(l?(o&&t.setCurrentTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),this.G1(t,r,n),o&&t.setCurrentTransform(1,0,0,1,0,0)):(t.setCurrentTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),this.G1(t,r,n)),t.currentElement.Ft=t.lastCreatedElement,t.currentElement.prepend(t.lastCreatedElement)),o=this.IR(e,t,t.currentElement),this.ph(t,e),l&&t.endGroup(),t.outerGroup&&t.endGroup(),a=t.surface.$u,r=l?this.svg:t.currentElement,l||null===s||r===s||s.parentNode!==this.panel.svg?(this.svg=r,null!==a&&null===r&&t.dummyGroup(),null!==r&&(this.T0(t,i,n,r),this.OR(r,e,t,o),1!==(l=this.Ws()?this.opacity*t.globalAlpha:this.opacity)&&r.setAttributeNS(null,"opacity",l.toString()),""!==this.filter&&r.setAttributeNS(null,"filter",this.filter),this.Ws()?(null!==s&&r!==s&&s.parentNode===t.diagramGroup?(null!==(e=s.getAttribute("filter"))&&r.setAttribute("filter",e),s.replaceWith(r)):t.lastDrawnPart?t.lastDrawnPart.after(r):t.diagramGroup.prepend(r),t.lastDrawnPart=r):null!==i&&this.hL(i,r),null!==a&&a(this,r),this.aL(r))):(null!==(o=this.svg.getAttribute("filter"))&&r.setAttribute("filter",o),this.svg.replaceWith(r),null!==(this.svg=r)&&this.T0(t,i,n,r),this.fL(t,s)))),!0)}aL(t){var e=this,t=t.dataset;e instanceof y&&(null!==e.portId&&(t.portId=e.portId),e instanceof Xt)&&(isNaN(e.itemIndex)||(t.itemIndex=e.itemIndex.toString()),e instanceof H)&&(t.className=Kt.an(e),void 0!==e.key&&(t.key=e.key.toString()),e instanceof Y)&&(null!==e.fromNode&&void 0!==e.fromNode.key&&(t.fromKey=e.fromNode.key.toString()),""!==e.fromPortId&&(t.fromPortId=e.fromPortId),null!==e.toNode&&void 0!==e.toNode.key&&(t.toKey=e.toNode.key.toString()),""!==e.toPortId)&&(t.toPortId=e.toPortId)}T0(a,r,o,l){let t=0!=(256&this.l);if(t=a.clipInsteadOfFill?!1:t){r=r.Mn()?r.naturalBounds:r.actualBounds;let t=Math.max(o.x,r.x),e=Math.max(o.y,r.y),i=Math.min(o.right,r.right)-t,s=Math.min(o.bottom,r.bottom)-e;var h,u,o=this.hi,r=(null!==o&&(t=o.x,e=o.y,i=o.width,s=o.height),l.getAttribute("clip-path"));let n=null;null===(n=null!==r?a.svg.getElementById(r.split("#")[1].slice(0,-1)):n)?(o="CLIP"+N.fu++,r=a.makeElement("clipPath",{id:o}),h=a.makeElement("rect",{x:t,y:e,width:i,height:s}),this instanceof Xt&&(u=this.D.copy().Mw(),h.setAttribute("transform",`matrix(${u.m11}, ${u.m12}, ${u.m21}, ${u.m22}, ${u.dx}, ${u.dy})`)),r.appendChild(h),a.svg.appendChild(r),l.setAttributeNS(null,"clip-path","url(#"+o+")")):((u=n.firstElementChild).setAttribute("x",t.toString()),u.setAttribute("y",e.toString()),u.setAttribute("width",i.toString()),u.setAttribute("height",s.toString()))}else l.removeAttributeNS(null,"clip-path"),this.fL(a,l)}fL(t,e){e=e.getAttribute("clip-path");null!==e&&null!==(t=t.svg.getElementById(e.split("#")[1].slice(0,-1)))&&t.remove()}VR(){if(null!==this.svg){var t=this.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),e=this.svg.ownerDocument;if(null!==t)for(const s of t){var i=e.getElementById(s.split("#")[1].slice(0,-1));null!==i&&i.remove()}this.svg.remove()}}RR(t,e){var i=this.Ri,s=this.Hi,n=this.Ft;null!==n&&t.commitTransform(),null!==n&&(this.bn(t,n,!0,!1,s,i),n instanceof m&&3===n.type?(t.beginPath(),t.rect(i.x,i.y,i.width,i.height),t.fillContext(n,!1,null)):t.fillRect(i.x,i.y,i.width,i.height)),this.ph(t,e)}ph(t,e){}g2(){this.fs(!0)}sc(t,e,i){var s=this.svg;if(this.BR())return this.g2(),this.fs(!1),null!==s&&(null!==(a=this.svg.getAttribute("clip-path"))&&null!==(r=t.svg.getElementById(a.split("#")[1].slice(0,-1))))&&r.remove(),!1;if(null===s)return!1;if(!this.visible)return s.remove(),!1;if("g"!==s.nodeName&&i||"g"===s.nodeName&&!i)return!1;var n=this.D,a=this instanceof Xt,r=this instanceof Xt&&this.ll();if(!a||!r)if(this instanceof Le){a=this.q1;t.setCurrentTransform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),null!==a&&t.amendImageTransform(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]),(i?s.lastElementChild:s).setAttributeNS(null,"transform",t.getCurrentTransform())}else if(!i||this instanceof Xt)s.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")");else if(this instanceof G){var o=s.getElementsByTagName("path");for(let t=0;td&&(o=d);let t=Math.sqrt(o*o/(1+u*u));i+=t=h<0?-t:t,s+=u*t,g?e.lineTo(i,s):e.moveTo(i,s),d-=o,g=!g}}bn(h,u,d,c,g,m){let f=1,p=1;if("string"==typeof u)d?h.fillStyle=u:h.strokeStyle=u;else if(1===u.type)d?h.fillStyle=u.color:h.strokeStyle=u.color;else{let l;var v=this.K1(),g=(f=g.width,p=g.height,c?(f=m.width,p=m.height):d||(f+=v,p+=v),h instanceof te);if(g&&u.Pn&&(4===u.type||u.nc===f&&u.W1===p))l=u.Pn;else{let t,e,i,s,n=0,a=0,r=0,o=0;if(c?(r=m.x,o=m.y):d||(r-=v/2,o-=v/2),t=u.start.x*f+u.start.offsetX+r,e=u.start.y*p+u.start.offsetY+o,i=u.end.x*f+u.end.offsetX+r,s=u.end.y*p+u.end.offsetY+o,2===u.type)l=h.createLinearGradient(t,e,i,s);else if(3===u.type)a=isNaN(u.endRadius)?Math.max(f,p)/2:u.endRadius,isNaN(u.startRadius)?(n=0,a=Math.max(f,p)/2):n=u.startRadius,l=h.createRadialGradient(t,e,n,i,s,a);else if(4===u.type)try{l=h.createPattern(u.pattern,"repeat")}catch{l=null}else Kt.Bi(u.type,"Brush type");if(4!==u.type){c=u.colorStops;if(null!==c)for(var y=c.iterator;y.next();)l.addColorStop(y.key,y.value)}if(g&&(null!==(u.Pn=l)&&(u.nc=f,u.W1=p),null===l)&&4===u.type&&-1!==u.nc){u.nc=-1;const b=this.diagram;null!==b&&-1===u.nc&&Kt.Xh(()=>{b.redraw()},600)}}d?h.fillStyle=l:h.strokeStyle=l}}isContainedBy(t){return t instanceof Xt&&this.zR(this,t)}zR(e,i){if(e!==i&&null!==i){let t=e.panel;for(;null!==t;){if(t===i)return!0;t=t.panel}}return!1}isVisibleObject(){var t;return!!this.visible&&(null===(t=this.panel)||t.isVisibleObject())}isEnabledObject(){let t=this instanceof Xt?this:this.panel;for(;null!==t&&t.isEnabled;)t=t.panel;return null===t}get enabledChanged(){return null!==this.g?this.g.D0:null}set enabledChanged(t){var e=this.enabledChanged;e!==t&&(null!==t&&Kt.t(t,"function",y,"enabledChanged"),this.Zt(),this.g.D0=t,this.i("enabledChanged",e,t))}U1(){if(!0===this.j1()){var t=this.nl;if(t.ti(),!this.Ri.isReal()||!this.ce.isReal())return void this.cd(!1);t.se(this.Ri.x-this.ce.x,this.Ri.y-this.ce.y),1===this.scale&&0===this.angle||(e=this.naturalBounds,this.P0(t,e.x,e.y,e.width,e.height)),this.cd(!1),this.Ma(!0)}var e;!0===this.N0()&&(null===(t=this.panel)?(this.ch.set(this.nl),this.Qf=this.scale):null!==t.Ms&&((e=this.ch).ti(),t.Mn()?e.hf(t.ch):null!==t.panel&&e.hf(t.panel.ch),e.hf(this.nl),this.Qf=this.scale*t.Qf),this.Ma(!1))}P0(t,e,i,s,n){var a;1!==this.v&&t.v(this.v),0!==this.qt&&((a=_.a()).setSpot(e,i,s,n,Z.Center),t.ys(this.qt,a.x,a.y),_.o(a))}u(t){var e;this.Ko()||(void 0===t&&(t=!1),this.ae(!0),this.ro(!0),null===(e=this.panel))||t||e.u()}oc(){this.Ko()||(this.ae(!0),this.ro(!0))}rc(t){var e;this.hs()||(e=this.panel,t||null===e||e.u(),this.ro(!0))}hd(){!1===this.j1()&&(this.cd(!0),this.Ma(!0))}m2(){this.Ma(!0)}T(){var t=this.part;null!==t&&t.T()}qs(t){var e=this.stretch,i=this.panel;return null!==i&&i.type===Xt.Table?this.F0(i.getRowDefinition(this.row),i.getColumnDefinition(this.column),t):null!==i&&i.type===Xt.Auto&&i.findMainElement()===this?this.Wo(2,t):1===e?null!==i?i.type===Xt.Spot&&i.findMainElement()===this?this.Wo(2,t):1===(i=i.defaultStretch)?this.Wo(0,t):this.Wo(i,t):this.Wo(0,t):this.Wo(e,t)}F0(t,e,i){var s=this.stretch;if(1!==s)return this.Wo(s,i);let n=null,a=null;switch(t.stretch){case 1:case 5:break;case 4:case 2:a=!0}switch(e.stretch){case 1:case 4:break;case 5:case 2:n=!0}s=this.panel.defaultStretch;return null===n&&(n=5===s||2===s),null===a&&(a=4===s||2===s),!0===n&&!0===a?this.Wo(2,i):!0===n?this.Wo(5,i):!0===a?this.Wo(4,i):this.Wo(0,i)}Wo(t,e){if(!e){if(0===t)return 0;e=this.desiredSize;if(e.isReal())return 0;var i=!isNaN(e.width),e=!isNaN(e.height),s=this.angle;if(i)if(90!==s&&270!==s){if(5===t)return 0;if(2===t)return 4}else{if(4===t)return 0;if(2===t)return 5}if(e)if(90!==s&&270!==s){if(4===t)return 0;if(2===t)return 5}else{if(5===t)return 0;if(2===t)return 4}}return t}get segmentOrientation(){return null!==this.Ut?this.Ut.R0:0}set segmentOrientation(t){var e=this.segmentOrientation;e!==t&&(Ht,Kt.it(t,jt,"Orientation"),null===this.Ut&&(this.Ut=new Ye),this.Ut.R0=t,this.u(),this.i("segmentOrientation",e,t),0===t)&&(this.angle=0)}XR(){this.segmentOrientation=21}get segmentIndex(){return null!==this.Ut?this.Ut.I0:-1/0}set segmentIndex(t){Ht,Kt.t(t,"number",y,"segmentIndex"),t=Math.round(t);var e=this.segmentIndex;e!==t&&(null===this.Ut&&(this.Ut=new Ye),this.Ut.I0=t,this.u(),this.i("segmentIndex",e,t))}get segmentFraction(){return null!==this.Ut?this.Ut.O0:0}set segmentFraction(t){Ht,Kt.t(t,"number",y,"segmentFraction"),isNaN(t)||t<0?t=0:1= 0",y,"column"),this.vo=t,this.u(),this.i("column",e,t),null!==this.svg)&&this.svg.remove()}get columnSpan(){return null!==this.g?this.g.B0:1}set columnSpan(t){Ht,Kt.t(t,"number",y,"columnSpan"),t=Math.round(t);var e=this.columnSpan;e!==t&&(t<1&&Kt.G(t,">= 1",y,"columnSpan"),this.Zt(),this.g.B0=t,this.u(),this.i("columnSpan",e,t))}get row(){return this.ed}set row(t){Ht,Kt.r(t,y,"row"),t=Math.round(t);var e=this.ed;e!==t&&(t<0&&Kt.G(t,">= 0",y,"row"),this.ed=t,this.u(),this.i("row",e,t),null!==this.svg)&&this.svg.remove()}get rowSpan(){return null!==this.g?this.g.z0:1}set rowSpan(t){Ht,Kt.t(t,"number",y,"rowSpan"),t=Math.round(t);var e=this.rowSpan;e!==t&&(t<1&&Kt.G(t,">= 1",y,"rowSpan"),this.Zt(),this.g.z0=t,this.u(),this.i("rowSpan",e,t))}get spanAllocation(){return null!==this.g?this.g.X0:null}set spanAllocation(t){var e=this.spanAllocation;e!==t&&(null!==t&&Kt.t(t,"function",y,"spanAllocation"),this.Zt(),this.g.X0=t,this.u(),this.i("spanAllocation",e,t))}get alignmentFocus(){return this._f}set alignmentFocus(t){var e=this._f;e.equals(t)||(Ht,Kt.s(t,Z,y,"alignmentFocus"),Ht,!t.isNoSpot()||t.isDefault()||t.isNone()&&this instanceof D||Kt.n("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+t),t=t.L(),this._f=t,this.u(),this.i("alignmentFocus",e,t))}get portId(){return this.td}set portId(t){var e,i=this.td;i!==t&&(Ht,null!==t&&Kt.t(t,"string",y,"portId"),null===(e=this.part)||e instanceof D||Kt.n("Cannot set portID on a Link: "+t),e=e,null!==i&&null!==e&&e.k2(this),null!==(this.td=t)&&null!==e&&(e.Nn=!0,e.uL(this)),this.i("portId",i,t))}Na(){var t,e=this.part;e instanceof D&&(null!==this.portId||this===e.port)&&null!==(t=e.diagram)&&!t.undoManager.isUndoingRedoing&&e.nL(this)}cL(){var t=this.diagram;null===t||t.undoManager.isUndoingRedoing||(this instanceof Xt?this instanceof D?this.invalidateConnectedLinks():this.walkVisualTreeFrom(this,t=>{t.Na()}):this.Na())}get toSpot(){return null!==this.$?this.$.ya:Z.None}set toSpot(t){var e=this.toSpot;e.equals(t)||(Ht,Kt.s(t,Z,y,"toSpot"),t=t.L(),this.je(),this.$.ya=t,this.i("toSpot",e,t),this.Na())}get toEndSegmentLength(){return null!==this.$?this.$.xa:10}set toEndSegmentLength(t){var e=this.toEndSegmentLength;e!==t&&(Ht,Kt.t(t,"number",y,"toEndSegmentLength"),t<0&&Kt.G(t,">= 0",y,"toEndSegmentLength"),this.je(),this.$.xa=t,this.i("toEndSegmentLength",e,t),this.Na())}get toShortLength(){return null!==this.$?this.$.ka:0}set toShortLength(t){var e=this.toShortLength;e!==t&&(Ht,Kt.t(t,"number",y,"toShortLength"),this.je(),this.$.ka=t,this.i("toShortLength",e,t),this.Na())}get toLinkable(){return null!==this.$?this.$.Y0:null}set toLinkable(t){var e=this.toLinkable;e!==t&&(Ht,null!==t&&Kt.t(t,"boolean",y,"toLinkable"),this.je(),this.$.Y0=t,this.i("toLinkable",e,t))}get toMaxLinks(){return null!==this.$?this.$.K0:1/0}set toMaxLinks(t){var e=this.toMaxLinks;e!==t&&(Ht,Kt.t(t,"number",y,"toMaxLinks"),t<0&&Kt.G(t,">= 0",y,"toMaxLinks"),this.je(),this.$.K0=t,this.i("toMaxLinks",e,t))}get fromSpot(){return null!==this.$?this.$.pa:Z.None}set fromSpot(t){var e=this.fromSpot;e.equals(t)||(Ht,Kt.s(t,Z,y,"fromSpot"),t=t.L(),this.je(),this.$.pa=t,this.i("fromSpot",e,t),this.Na())}get fromEndSegmentLength(){return null!==this.$?this.$.wa:10}set fromEndSegmentLength(t){var e=this.fromEndSegmentLength;e!==t&&(Ht,Kt.t(t,"number",y,"fromEndSegmentLength"),t<0&&Kt.G(t,">= 0",y,"fromEndSegmentLength"),this.je(),this.$.wa=t,this.i("fromEndSegmentLength",e,t),this.Na())}get fromShortLength(){return null!==this.$?this.$.ba:0}set fromShortLength(t){var e=this.fromShortLength;e!==t&&(Ht,Kt.t(t,"number",y,"fromShortLength"),this.je(),this.$.ba=t,this.i("fromShortLength",e,t),this.Na())}get fromLinkable(){return null!==this.$?this.$.U0:null}set fromLinkable(t){var e=this.fromLinkable;e!==t&&(Ht,null!==t&&Kt.t(t,"boolean",y,"fromLinkable"),this.je(),this.$.U0=t,this.i("fromLinkable",e,t))}get fromMaxLinks(){return null!==this.$?this.$.G0:1/0}set fromMaxLinks(t){var e=this.fromMaxLinks;e!==t&&(Ht,Kt.t(t,"number",y,"fromMaxLinks"),t<0&&Kt.G(t,">= 0",y,"fromMaxLinks"),this.je(),this.$.G0=t,this.i("fromMaxLinks",e,t))}get cursor(){return null!==this.g?this.g.Dl:""}set cursor(t){var e=this.cursor;e!==t&&(Kt.t(t,"string",y,"cursor"),this.Zt(),this.g.Dl=t,this.i("cursor",e,t))}get click(){return null!==this.g?this.g.Vr:null}set click(t){var e=this.click;e!==t&&(null!==t&&Kt.t(t,"function",y,"click"),this.Zt(),this.g.Vr=t,this.i("click",e,t))}get doubleClick(){return null!==this.g?this.g.Br:null}set doubleClick(t){var e=this.doubleClick;e!==t&&(null!==t&&Kt.t(t,"function",y,"doubleClick"),this.Zt(),this.g.Br=t,this.i("doubleClick",e,t))}get contextClick(){return null!==this.g?this.g.zr:null}set contextClick(t){var e=this.contextClick;e!==t&&(null!==t&&Kt.t(t,"function",y,"contextClick"),this.Zt(),this.g.zr=t,this.i("contextClick",e,t))}get mouseEnter(){return null!==this.g?this.g.Gr:null}set mouseEnter(t){var e=this.mouseEnter;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseEnter"),this.Zt(),this.g.Gr=t,this.i("mouseEnter",e,t))}get mouseLeave(){return null!==this.g?this.g.Hr:null}set mouseLeave(t){var e=this.mouseLeave;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseLeave"),this.Zt(),this.g.Hr=t,this.i("mouseLeave",e,t))}get mouseOver(){return null!==this.g?this.g.Xr:null}set mouseOver(t){var e=this.mouseOver;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseOver"),this.Zt(),this.g.Xr=t,this.i("mouseOver",e,t))}get mouseHover(){return null!==this.g?this.g.Yr:null}set mouseHover(t){var e=this.mouseHover;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseHover"),this.Zt(),this.g.Yr=t,this.i("mouseHover",e,t))}get mouseHold(){return null!==this.g?this.g.Kr:null}set mouseHold(t){var e=this.mouseHold;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseHold"),this.Zt(),this.g.Kr=t,this.i("mouseHold",e,t))}get mouseDragEnter(){return null!==this.g?this.g.H0:null}set mouseDragEnter(t){var e=this.mouseDragEnter;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseDragEnter"),this.Zt(),this.g.H0=t,this.i("mouseDragEnter",e,t))}get mouseDragLeave(){return null!==this.g?this.g.v0:null}set mouseDragLeave(t){var e=this.mouseDragLeave;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseDragLeave"),this.Zt(),this.g.v0=t,this.i("mouseDragLeave",e,t))}get mouseDrop(){return null!==this.g?this.g.Ur:null}set mouseDrop(t){var e=this.mouseDrop;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseDrop"),this.Zt(),this.g.Ur=t,this.i("mouseDrop",e,t))}get actionDown(){return null!==this.g?this.g.q0:null}set actionDown(t){var e=this.actionDown;e!==t&&(null!==t&&Kt.t(t,"function",y,"actionDown"),this.Zt(),this.g.q0=t,this.i("actionDown",e,t))}get actionMove(){return null!==this.g?this.g.W0:null}set actionMove(t){var e=this.actionMove;e!==t&&(null!==t&&Kt.t(t,"function",y,"actionMove"),this.Zt(),this.g.W0=t,this.i("actionMove",e,t))}get actionUp(){return null!==this.g?this.g.j0:null}set actionUp(t){var e=this.actionUp;e!==t&&(null!==t&&Kt.t(t,"function",y,"actionUp"),this.Zt(),this.g.j0=t,this.i("actionUp",e,t))}get actionCancel(){return null!==this.g?this.g.J0:null}set actionCancel(t){var e=this.actionCancel;e!==t&&(null!==t&&Kt.t(t,"function",y,"actionCancel"),this.Zt(),this.g.J0=t,this.i("actionCancel",e,t))}get toolTip(){return null!==this.g?this.g.vr:null}set toolTip(t){var e=this.toolTip;e!==t&&(Ht,null===t||(t instanceof K||t instanceof pt)||Kt.n("GraphObject.toolTip must be an Adornment or HTMLInfo."),this.Zt(),this.g.vr=t,this.i("toolTip",e,t))}get contextMenu(){return null!==this.g?this.g.qr:null}set contextMenu(t){var e=this.contextMenu;e!==t&&(Ht,t instanceof K||t instanceof pt||Kt.n("GraphObject.contextMenu must be an Adornment or HTMLInfo."),this.Zt(),this.g.qr=t,this.i("contextMenu",e,t))}findBindingPanel(){let t=this instanceof Xt?this:this.panel;for(;null!==t;){if(t.S2())return t;t=t.panel}return null}bind(t,e,i,s){return this.lc(t,e,i,s),this}bindTwoWay(t,e,i,s){return this.lc(t,e,i,s).makeTwoWay(),this}bindModel(t,e,i,s){return this.lc(t,e,i,s).ofModel(),this}bindObject(t,e,i,s,n){return this.lc(t,e,i,s).ofObject(n),this}theme(t,e,i,s,n){return this.yh(t,e,i,s,n),this}themeData(t,e,i,s,n){return this.yh(t,e,i,s,n).ofData(),this}themeObject(t,e,i,s,n,a){return this.yh(t,e,i,s,n).ofObject(a),this}themeModel(t,e,i,s,n){return this.yh(t,e,i,s,n).ofModel(),this}lc(t,e,i,s){let n=null;return n="string"==typeof t?new ai(t,e,i,s):t,this.Z0(n),n}yh(t,e,i,s,n){let a=null;return a="string"==typeof t?new ri(t,e,i,s,n):t,this.Z0(a),a}Z0(t){var e=(t.Te=this).findBindingPanel();null!==e&&e.dL()&&Kt.n("Cannot add a Binding to a template that has already been copied: "+t),null===this.Ii&&(this.Ii=new O),this.Ii.add(t)}set(t){Ht;for(const e in t)!e.startsWith("_")&&-1===e.indexOf(".")||Kt.n("Property with underscore or period passed to GraphObject.set. Did you mean to use GraphObject.attach?");return Object.assign(this,t),this}attach(t){return y.M2(this,t),this}apply(t){return t(this),this}setProperties(t){return q.p0(this,t),this}static build(t,e,...i){var s=y.$0.getValue(t);if("function"==typeof s){s=s([t].concat(i));if(s instanceof y)return e&&s.setProperties(e),s}Kt.n('GraphObject.build invoked object builder "'+t+'", but it did not return an Object')}static make(t){let e=arguments,i=null,s=null;var n;"function"==typeof t?s=t:"string"==typeof t&&("function"==typeof(n=y.$0.getValue(t))?(e=Array.prototype.slice.call(e),i=n(e),Kt.Mt(i)||Kt.n('GraphObject.make invoked object builder "'+t+'", but it did not return an Object')):s=v.go[t]),null===i&&(null!=s&&s.constructor||Kt.n("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+t),i=new s);let a=1;i instanceof q&&1{var e=2.76142374915397,i=2.761423749153969,e=new Xt(Xt.Auto,{isActionable:!0,enabledChanged:(t,e)=>{var i;t instanceof Xt&&null!==(i=t.findObject("ButtonBorder"))&&(e?(t._buttonFillDisabled=i.fill,i.fill=t._buttonFillNormal):(t._buttonFillNormal=i.fill,i.fill=t._buttonFillDisabled))},cursor:"pointer"}).attach({_buttonFillNormal:"#f5f5f5",_buttonStrokeNormal:"#737373",_buttonFillOver:"#d4d4d4",_buttonStrokeOver:"#737373",_buttonFillDisabled:"#a3a3a3"}).add(new G("RoundedRectangle",{name:"ButtonBorder",spot1:new Z(0,0,e,i),spot2:new Z(1,1,-e,-i),parameter1:2,fill:"#f5f5f5",stroke:"#737373"}));return e.mouseEnter=(t,e,i)=>{var s;e.isEnabledObject()&&e instanceof Xt&&(s=e.findObject("ButtonBorder"))instanceof G&&(e._buttonFillNormal=s.fill,s.fill=e._buttonFillOver,e._buttonStrokeNormal=s.stroke,s.stroke=e._buttonStrokeOver)},e.mouseLeave=(t,e,i)=>{var s;e.isEnabledObject()&&e instanceof Xt&&(s=e.findObject("ButtonBorder"))instanceof G&&(s.fill=e._buttonFillNormal,s.stroke=e._buttonStrokeNormal)},e}),y.defineBuilder("TreeExpanderButton",t=>{var e=y.build("Button");return e.attach({_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine",visible:!1}),e.add(new G("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:Yt.du}).bindObject("figure","isTreeExpanded",(t,e)=>{e=e.panel;return t?e._treeExpandedFigure:e._treeCollapsedFigure})),e.bindObject("visible","isTreeLeaf",t=>!t),e.click=(t,e)=>{let i=e.part;if((i=i instanceof K?i.adornedPart:i)instanceof D){e=i.diagram;if(null!==e){e=e.commandHandler;if(i.isTreeExpanded){if(!e.canCollapseTree(i))return}else if(!e.canExpandTree(i))return;t.handled=!0,i.isTreeExpanded?e.collapseTree(i):e.expandTree(i)}}},e}),y.defineBuilder("SubGraphExpanderButton",t=>{var e=y.build("Button");return e.attach({_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"}),e.add(new G("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:Yt.du}).bindObject("figure","isSubGraphExpanded",(t,e)=>{e=e.panel;return t?e._subGraphExpandedFigure:e._subGraphCollapsedFigure})),e.click=(t,e)=>{let i=e.part;if((i=i instanceof K?i.adornedPart:i)instanceof X){e=i.diagram;if(null!==e){e=e.commandHandler;if(i.isSubGraphExpanded){if(!e.canCollapseSubGraph(i))return}else if(!e.canExpandSubGraph(i))return;t.handled=!0,i.isSubGraphExpanded?e.collapseSubGraph(i):e.expandSubGraph(i)}}},e}),y.defineBuilder("ToolTip",t=>new K(Xt.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new _(0,2)}).add(new G("RoundedRectangle",{name:"Border",parameter1:1,fill:"#f5f5f5",strokeWidth:0,spot1:new Z(0,0,4,6),spot2:new Z(1,1,-4,-4)}))),y.defineBuilder("ContextMenu",t=>new K(Xt.Vertical,{background:"#f5f5f5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new _(0,2)}).bindObject("background","",t=>null!==t.adornedPart&&t.hasPlaceholder()?null:"#f5f5f5")),y.defineBuilder("ContextMenuButton",t=>{var e=y.build("Button"),i=(e.stretch=5,e.findObject("ButtonBorder"));return i instanceof G&&(i.figure="Rectangle",i.strokeWidth=0,i.spot1=new Z(0,0,4,6),i.spot2=new Z(1,1,-4,-4)),e}),y.defineBuilder("PanelExpanderButton",t=>{const n=y.takeBuilderArgument(t,"COLLAPSIBLE"),e=y.build("Button");e.attach({_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}),e.add(new G({name:"ButtonIcon",strokeWidth:2}).bindObject("geometryString","visible",t=>t?e._buttonExpandedFigure:e._buttonCollapsedFigure,void 0,n));t=e.findObject("ButtonBorder");return t instanceof G&&(t.stroke=null,t.fill="rgba(0, 0, 0, 0)"),e.click=(e,i)=>{if(i instanceof Xt){var s=i.diagram;if(null!==s&&!s.isReadOnly){let t=i.findBindingPanel();null!==(t=null===t?i.part:t)&&null!==(i=t.findObject(n))&&(e.handled=!0,s.startTransaction("Collapse/Expand Panel"),i.visible=!i.visible,s.commitTransaction("Collapse/Expand Panel"))}}},e}),y.defineBuilder("CheckBoxButton",t=>{const n=y.takeBuilderArgument(t),e=y.build("Button",{desiredSize:new Yt(14,14)});e.attach({"ButtonBorder.spot1":new Z(0,0,1,1),"ButtonBorder.spot2":new Z(1,1,-1,-1)});t=new G({name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:2,geometryStretch:6,visible:!1});return""!==n&&t.bindTwoWay("visible",n),e.add(t),e.click=(t,e)=>{var i,s;e instanceof Xt&&(null===(i=t.diagram)||i.isReadOnly||""!==n&&i.model.isReadOnly||(t.handled=!0,s=e.findObject("ButtonIcon"),i.startTransaction("checkbox"),null!==s&&(s.visible=!s.visible),"function"==typeof e._doClick&&e._doClick(t,e),i.commitTransaction("checkbox")))},e}),y.defineBuilder("CheckBox",t=>{var t=y.takeBuilderArgument(t),t=y.build("CheckBoxButton",{name:"Button",isActionable:!1,margin:new I(0,1,0,0)},t),e=new Xt("Horizontal",{isActionable:!0,cursor:t.cursor,margin:new I(1),mouseEnter:t.mouseEnter,mouseLeave:t.mouseLeave,click:t.click}).attach({_buttonFillNormal:t._buttonFillNormal,_buttonStrokeNormal:t._buttonStrokeNormal,_buttonFillOver:t._buttonFillOver,_buttonStrokeOver:t._buttonStrokeOver,_buttonFillDisabled:t._buttonFillDisabled,_buttonClick:t.click});return e.add(t),t.mouseEnter=null,t.mouseLeave=null,t.click=null,e})}}class _t{xi;Tt;so;Ii;no;js;Dl;Vr;Br;zr;Gr;Hr;Xr;Yr;Kr;H0;v0;Ur;q0;W0;j0;J0;vr;qr;D0;X0;Ns;Cr;Ar;lo;z0;B0;Nr;L0;Q0;_0;constructor(){this.xi=!1,this.Tt="",this.so=-1,this.Ii=null,this.no=null,this.js=null,this.Dl="",this.Vr=null,this.Br=null,this.zr=null,this.Gr=null,this.Hr=null,this.Xr=null,this.Yr=null,this.Kr=null,this.H0=null,this.v0=null,this.Ur=null,this.q0=null,this.W0=null,this.j0=null,this.J0=null,this.vr=null,this.qr=null,this.D0=null,this.X0=null,this.Ns=null,this.Cr=Yt.lf,this.Ar=Yt.zk,this.lo=1,this.z0=1,this.B0=1,this.Nr=0,this.L0=null,this.Q0=null,this._0="category"}copy(){var t=new _t;return t.Tt=this.Tt,t.so=this.so,t.Ii=this.Ii,t.js=this.js,t.Dl=this.Dl,t.Vr=this.Vr,t.Br=this.Br,t.zr=this.zr,t.Gr=this.Gr,t.Hr=this.Hr,t.Xr=this.Xr,t.Yr=this.Yr,t.Kr=this.Kr,t.H0=this.H0,t.v0=this.v0,t.Ur=this.Ur,t.q0=this.q0,t.W0=this.W0,t.j0=this.j0,t.J0=this.J0,t.vr=this.vr,t.qr=this.qr,t.D0=this.D0,t.X0=this.X0,t.Ns=this.Ns,t.Cr=this.Cr.L(),t.Ar=this.Ar.L(),t.lo=this.lo,t.z0=this.z0,t.B0=this.B0,t.Nr=this.Nr,t.L0=this.L0,t.Q0=this.Q0,t._0=this._0,t}}class Wt{m;constructor(){this.m=[1,0,0,1,0,0]}copy(){var t=new Wt;return t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5],t}translate(t,e){this.m[4]+=this.m[0]*t+this.m[2]*e,this.m[5]+=this.m[1]*t+this.m[3]*e}scale(t,e){this.m[0]*=t,this.m[1]*=t,this.m[2]*=e,this.m[3]*=e}rotate(i,s,n){if(360<=i?i-=360:i<0&&(i+=360),0!==i){this.translate(s,n);let t=0,e=0;e=90===i?(t=0,1):180===i?(t=-1,0):270===i?(t=0,-1):(i=i*Math.PI/180,t=Math.cos(i),Math.sin(i));var i=this.m[0]*t+this.m[2]*e,a=this.m[1]*t+this.m[3]*e,r=this.m[0]*-e+this.m[2]*t,o=this.m[1]*-e+this.m[3]*t;this.m[0]=i,this.m[1]=a,this.m[2]=r,this.m[3]=o,this.translate(-s,-n)}}}class Qt{type;x1;y1;r1;x2;y2;r2;colors;pattern;constructor(t){this.type=t,this.x1=0,this.y1=0,this.r1=0,this.x2=0,this.y2=0,this.r2=0,this.colors=[],this.pattern=null}addColorStop(t,e){this.colors.push({offset:t,color:e})}}class Zt{Bt;gi;ga;$u;P2;constructor(t,e,i){var e=void 0===e?v.document:e,s=(this.ga=e,this.P2="http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/");void 0!==e&&(this.Bt=this.makeElement("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",i||(this.style.position="absolute"),this.Bt.setAttributeNS(s,"xmlns",this.P2),this.Bt.setAttributeNS(s,"xmlns:xlink","http://www.w3.org/1999/xlink")),this.$u=null,this.gi=new Jt(this,i)}resize(t,e,i,s){return(this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=s+"px",this.Bt.setAttributeNS(null,"width",i+"px"),this.Bt.setAttributeNS(null,"height",s+"px"),this.Bt.setAttributeNS(null,"viewBox","0 0 "+i+" "+s),this.gi.N2.firstElementChild.setAttributeNS(null,"width",i+"px"),this.gi.N2.firstElementChild.setAttributeNS(null,"height",s+"px"),!0)}makeElement(t,e,i){var s=this.ga.createElementNS(this.P2,t);if(Kt.Mt(e))for(const n in e)s.setAttributeNS("href"===n?"http://www.w3.org/1999/xlink":"",n,e[n]);return void 0!==i&&(s.textContent=i),s}getBoundingClientRect(){return this.Bt.getBoundingClientRect()}focus(){this.Bt.focus()}get width(){return this.Bt.width.baseVal.value}set width(t){this.Bt.setAttribute("width",t+"px")}get height(){return this.Bt.height.baseVal.value}set height(t){this.Bt.setAttribute("height",t+"px")}dispose(){this.ga=null}get style(){return this.Bt.style}}class Jt{hc;ac;Cn;Oi;Je;fillStyle;font;globalAlpha;lineCap;lineDashOffset;lineJoin;lineWidth;miterLimit;shadowBlur;shadowColor;shadowOffsetX;shadowOffsetY;strokeStyle;textAlign;imageSmoothingEnabled;clipInsteadOfFill;lastCreatedElement;fc;cc;surface;svg;N2;gL;Z1;jo;wh;Ca;currentElement;clipPathGroup;diagramGroup;lastDrawnPart;currentPath;outerGroup;pathAttributes;hl;Fr;filter;partClipRect;constructor(t,e){this.surface=t,this.svg=t.Bt,this.fc=[],this.cc=[],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.shadowOffsetX=0,this.shadowOffsetY=0,this.hl=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.hc=0,this.ac=0,this.Cn=0,this.lastCreatedElement=null,this.currentElement=null,this.Oi=[],this.pathAttributes={},this.Z1=!1,this.jo=null,this.wh=0,this.Je=new Wt,this.clipPathGroup=this.newGroup2(),this.diagramGroup=this.newGroup2("gojs-diagram"),this.lastDrawnPart=null,this.currentPath=null;var i=N.fu++,s=this.makeElement("clipPath",{id:"mainClip"+i}),t={x:0,y:0,width:t.width,height:t.height};s.appendChild(this.makeElement("rect",t)),this.N2=s,this.svg.appendChild(this.clipPathGroup),this.clipPathGroup.appendChild(this.diagramGroup),this.svg.appendChild(s),this.clipPathGroup.setAttributeNS(null,"clip-path","url(#mainClip"+i+")"),this.gL={},this.Fr=!!e,this.filter="",this.partClipRect=null}setDiagramPosScale(t,e,i,s,n,a){void 0===this.diagramGroup?this.newGroup(t,e,i,s,n,a):this.diagramGroup.setAttribute("transform","matrix("+t+", "+e+", "+i+", "+s+", "+n+", "+a+")")}resetInnerSVG(){null!==this.diagramGroup&&(this.diagramGroup.innerHTML="")}arc(t,e,i,s,n,a,r,o){var l=2*Math.PI,h=l-1e-6,u=i*Math.cos(s),d=i*Math.sin(s),c=t+u,g=e+d,m=a?0:1;let f=a?s-n:n-s;(1e-6h?(this.Oi.push(["A",i,i,0,1,m,t-u,e-d]),this.Oi.push(["A",i,i,0,1,m,c,g])):1e-6=Math.PI),m,t+i*Math.cos(n),e+i*Math.sin(n)])}beginPath(){this.Oi=[],this.pathAttributes={stroke:"none",fill:"none"}}endPath(t){this.GR(this.Oi,this.Je,t||0)}bezierCurveTo(t,e,i,s,n,a){this.Oi.push(["C",t,e,i,s,n,a])}clearRect(t,e,i,s){}clip(){this.pathAttributes.clipPath=!0}closePath(){this.Oi.push(["z"])}createLinearGradient(t,e,i,s){var n=new Qt("linear");return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}createPattern(t,e){let i="";t instanceof HTMLCanvasElement&&(i=t.toDataURL()),t instanceof HTMLImageElement&&(i=t.getAttribute("src"));var s,n,a=this.gL;return a[i]?"url(#"+a[i]+")":(s="PATTERN"+N.fu++,n={width:t.width,height:t.height,id:s,patternUnits:"userSpaceOnUse"},t={x:0,y:0,width:t.width,height:t.height,href:i},(n=this.makeElement("pattern",n)).appendChild(this.makeElement(q.img,t)),this.svg.appendChild(n),"url(#"+(a[i]=s)+")")}createRadialGradient(t,e,i,s,n,a){var r=new Qt("radial");return r.x1=t,r.y1=e,r.r1=i,r.x2=s,r.y2=n,r.r2=a,r}amendImageTransform(t,e,i,s,n,a,r,o){r/=i,i=o/s;0===n&&0===a||this.Je.translate(n,a),1==r&&1==i||this.Je.scale(r,i),0===t&&0===e||this.Je.translate(-t,-e)}drawImage(t,e,i,s,n,a,r,o,l){let h="";t instanceof HTMLCanvasElement&&(h=t.toDataURL()),t instanceof HTMLImageElement&&(h=t.getAttribute("src"));var u=t instanceof HTMLImageElement?t.naturalWidth:t.width,t=t instanceof HTMLImageElement?t.naturalHeight:t.height,a=(void 0===s&&(a=e,r=i,o=s=u,l=n=t),this.amendImageTransform(e,i,s=s||0,n=n||0,a=a||0,r=r||0,o=o||0,l=l||0),{x:0,y:0,width:u||s,height:t||n,href:h});z.q(s,o)&&z.q(n,l)?-1===h.toLowerCase().indexOf(".svg")&&-1===h.toLowerCase().indexOf("data:image/svg")&&(a.preserveAspectRatio="xMidYMid slice"):a.preserveAspectRatio="none",0===e&&0===i&&s===u&&n===t||(a["clip-path"]=`path('M ${e},${i} L ${s+=e} ${i} L ${s} ${n+=i} L ${e} ${n} z')`),this.processCommon(q.img,a,this.Je),this.dd(q.img,a)}fill(t,e){t&&(this.pathAttributes["fill-rule"]="evenodd"),this.setFill(this.pathAttributes)}fillContext(t,e,i){this.clipInsteadOfFill?this.clip():this.fill(e,i)}fillRect(t,e,i,s){this.addRect("fill",[t,e,i,s],this.Je)}fillBackground(t,e,i,s){t={x:t,y:e,width:i,height:s};this.processCommon("fill",t,this.Je),this.setFill(t),this.svg.prepend(this.makeElement("rect",t))}fillText(t,e,i){this.addText("fill",[t,e,i],this.Je)}lineTo(t,e){this.Oi.push(["L",t,e])}moveTo(t,e){this.Oi.push(["M",t,e])}quadraticCurveTo(t,e,i,s){this.Oi.push(["Q",t,e,i,s])}rect(t,e,i,s){this.Oi.push(["M",t,e],["L",t+i,e],["L",t+i,e+s],["L",t,e+s],["z"])}restore(){this.Je=this.fc.pop(),this.Oi=this.fc.pop();var t=this.fc.pop();this.fillStyle=t.fillStyle,this.font=t.font,this.globalAlpha=t.globalAlpha,this.lineCap=t.lineCap,this.lineDashOffset=t.lineDashOffset,this.lineJoin=t.lineJoin,this.lineWidth=t.lineWidth,this.miterLimit=t.miterLimit,this.shadowBlur=t.shadowBlur,this.shadowColor=t.shadowColor,this.shadowOffsetX=t.shadowOffsetX,this.shadowOffsetY=t.shadowOffsetY,this.strokeStyle=t.strokeStyle,this.textAlign=t.textAlign,this.partClipRect=t.partClipRect}save(){var t={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,partClipRect:this.partClipRect},e=(this.fc.push(t),[]);for(let t=0;tt.offset>e.offset?1:-1);for(let t=0;t= zero",m,"startRadius"),this.ip=t,this.Pn=null}get endRadius(){return this.ep}set endRadius(t){this.f&&Kt.O(this,t),Kt.r(t,m,"endRadius"),t<0&&Kt.G(t,">= zero",m,"endRadius"),this.ep=t,this.Pn=null}get colorStops(){return this.An}set colorStops(t){this.f&&Kt.O(this,t),Ht,Kt.s(t,L,m,"colorStops"),this.An=t,this.Pn=null}get pattern(){return this.sp}set pattern(t){this.f&&Kt.O(this,t),this.sp=t,this.Pn=null}static randomColor(t,e){void 0===t&&(t=128),(Ht,Kt.r(t,m,"randomColor:min"),t<0||255s&&o=i&&oe&&(l=t,t=e,e=l,l=i,i=s,s=l);var l=e-t;return m.isDark(m.mix(n.get(t),n.get(e),1-s/l))}}static isDark(t){return!!t&&(t instanceof m?t.isDark():(m.Bo(t),(299*m.j.n0+587*m.j.n1+114*m.j.n2)/1e3<128))}static gd(t,e){switch(e){case 1:return m.vR(),m.ho.n0=Math.min(100,Math.max(0,m.ho.n0+100*t)),m.qR(),"rgba("+m.j.n0+", "+m.j.n1+", "+m.j.n2+", "+m.j.n3+")";case 2:return m.UM(),m.Yi.n2=Math.min(100,Math.max(0,m.Yi.n2+100*t)),"hsla("+m.Yi.n0+", "+m.Yi.n1+"%, "+m.Yi.n2+"%, "+m.Yi.n3+")";case 3:return m.WR(),m.ao.n0=Math.min(100,Math.max(0,m.ao.n0+100*t)),m.jR(),"rgba("+m.j.n0+", "+m.j.n1+", "+m.j.n2+", "+m.j.n3+")";default:Kt.n("Unknown color space: "+e)}}static Bo(t){var e,i=m.al;null!==i&&(i.clearRect(0,0,1,1),i.fillStyle="#000000",e=i.fillStyle,i.fillStyle=t,i.fillStyle!==e?(i.fillRect(0,0,1,1),e=i.getImageData(0,0,1,1).data,m.j.n0=e[0],m.j.n1=e[1],m.j.n2=e[2],m.j.n3=e[3]/255):(i.fillStyle="#FFFFFF",e=i.fillStyle,i.fillStyle=t,i.fillStyle===e&&(Ht,Kt.n('Color "'+t+'" is not a valid color string for RGBA color conversion')),m.j.n0=0,m.j.n1=0,m.j.n2=0,m.j.n3=1))}static UM(){var t=m.j.n0/255,e=m.j.n1/255,i=m.j.n2/255,s=Math.max(t,e,i),n=Math.min(t,e,i),a=s-n;let r,o;n=(s+n)/2;if(0==a)r=o=0;else{switch(s){case t:r=(e-i)/a%6;break;case e:r=(i-t)/a+2;break;case i:r=(t-e)/a+4}(r*=60)<0&&(r+=360),o=a/(1-Math.abs(2*n-1))}m.Yi.n0=Math.round(r),m.Yi.n1=Math.round(100*o),m.Yi.n2=Math.round(100*n),m.Yi.n3=m.j.n3}static dE(){var t=m.Yi.n0,e=m.Yi.n1/100,i=m.Yi.n2/100;let s,n,a;var e=(1-Math.abs(2*i-1))*e,t=t/60,r=e*(1-Math.abs(t%2-1)),t=(0<=t&&t<1?(s=e,n=r,a=0):1<=t&&t<2?(s=r,n=e,a=0):2<=t&&t<3?(s=0,n=e,a=r):3<=t&&t<4?(s=0,n=r,a=e):4<=t&&t<5?(s=r,n=0,a=e):5<=t&&t<6&&(s=e,n=0,a=r),i-.5*e);s+=t,n+=t,a+=t,m.j.n0=Math.round(255*s),m.j.n1=Math.round(255*n),m.j.n2=Math.round(255*a),m.j.n3=m.Yi.n3}static vR(){m.mL(),m.JR()}static qR(){m.ZR(),m.pL()}static C2(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}static A2(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055}static mL(){var t=m.C2(m.j.n0),e=m.C2(m.j.n1),i=m.C2(m.j.n2);m.zt.n0=.4124564*t+.3575761*e+.1804375*i,m.zt.n1=.2126729*t+.7151522*e+.072175*i,m.zt.n2=.0193339*t+.119192*e+.9503041*i,m.zt.n3=m.j.n3}static pL(){var t=3.2404542*m.zt.n0+-1.5371385*m.zt.n1+-.4985314*m.zt.n2,e=-.969266*m.zt.n0+1.8760108*m.zt.n1+.041556*m.zt.n2,i=.0556434*m.zt.n0+-.2040259*m.zt.n1+1.0572252*m.zt.n2;m.j.n0=255*m.A2(t),m.j.n1=255*m.A2(e),m.j.n2=255*m.A2(i),m.j.n3=m.zt.n3,m.j.n0=Math.round(m.j.n0),255m.L2?Math.pow(t,1/3):(m.tb*t+16)/116}static JR(){var t=m.T2(100*m.zt.n0/m.md[0]),e=m.T2(100*m.zt.n1/m.md[1]),i=m.T2(100*m.zt.n2/m.md[2]);m.ho.n0=116*e-16,m.ho.n1=500*(t-e),m.ho.n2=200*(e-i),m.ho.n3=m.zt.n3}static yL(t){var e=t*t*t;return e>m.L2?e:(116*t-16)/m.tb}static ZR(){var t=(m.ho.n0+16)/116,e=m.ho.n1/500+t,i=t-m.ho.n2/200;m.zt.n0=m.md[0]/100*m.yL(e),m.zt.n1=m.md[1]/100*(m.ho.n0>m.tb*m.L2?Math.pow(t,3):m.ho.n0/m.tb),m.zt.n2=m.md[2]/100*m.yL(i),m.zt.n3=m.ho.n3}static $R(){var t=.8190224*m.zt.n0+.3619062*m.zt.n1+-.1288737*m.zt.n2,e=.03298366*m.zt.n0+.9292868*m.zt.n1+.03614466*m.zt.n2,i=.04817719*m.zt.n0+.2642395*m.zt.n1+.6335478*m.zt.n2,t=Math.cbrt(t),e=Math.cbrt(e),i=Math.cbrt(i);m.mi.n0=.2104542*t+.7936177*e+-.004072046*i,m.mi.n1=1.977998*t+-2.428592*e+.4505937*i,m.mi.n2=.02590403*t+.7827717*e+-.8086757*i,m.mi.n3=m.zt.n3,m.mi.n0*=100}static QR(){m.mi.n0/=100;var t=(.9999999*m.mi.n0+.3963377*m.mi.n1+.2158037*m.mi.n2)**3,e=(1.000000009*m.mi.n0+-.1055613*m.mi.n1+-.06385417*m.mi.n2)**3,i=(1.00000005*m.mi.n0+-.08948418*m.mi.n1+-1.291485*m.mi.n2)**3;m.zt.n0=1.2268798*t+-.5578149*e+.281391*i,m.zt.n1=-.04057576*t+1.112286*e+-.07171106*i,m.zt.n2=-.07637294*t+-.4214933*e+1.586924*i,m.zt.n3=m.mi.n3}static _R(){var t=180*Math.atan2(m.mi.n2,m.mi.n1)/Math.PI;m.ao.n0=m.mi.n0,m.ao.n1=Math.sqrt(m.mi.n1**2+m.mi.n2**2),m.ao.n2=0<=t?t:360+t,m.ao.n3=m.mi.n3}static tI(){m.mi.n0=m.ao.n0,m.mi.n1=m.ao.n1*Math.cos(m.ao.n2*Math.PI/180),m.mi.n2=m.ao.n1*Math.sin(m.ao.n2*Math.PI/180),m.mi.n3=m.ao.n3}static WR(){m.mL(),m.$R(),m._R()}static jR(){m.tI(),m.QR(),m.pL()}static ud(t,e){"string"==typeof t?(Ht,m.isValidColor(t)||Kt.n('Color "'+t+'" is not a valid color string for '+e)):t instanceof m||Kt.n("Value for "+e+" must be a color string or a Brush, not "+t)}static Solid=1;static Linear=2;static Radial=3;static Pattern=4;static Lab=1;static HSL=2;static al=q.isUsingDOM()?new $t(null,void 0,{willReadFrequently:!0}).gi:null;static j=new ie;static Yi=new ie;static zt=new ie;static ho=new ie;static mi=new ie;static ao=new ie}class se{Tt="Base";static Layouts=new L;static definePanelLayout(t,e){e.name=t,se.Layouts.add(t,e)}get name(){return this.Tt}set name(t){this.Tt=t}constructor(){}get classType(){return Xt}measure(t,e,i,s,n,a,r){}measureElement(t,e,i,s,n){t.wt(e,i,s,n)}arrange(t,e,i){}arrangeElement(t,e,i,s,n,a){t.vt(e,i,s,n,a)}remeasureObject(t){t.oc()}Ji(t,e,i){}}class ne extends se{constructor(){super()}measure(t,i,s,e,n,a,r){var o=e.length,l=t.Jo();for(let t=0;tg&&(p=Math.max(g-b,0)),m.Zi=m.Zi+p,m.actual=m.at+p,g=Math.max(g-(p+(w?b:0)),0)),1!==A.columnSpan||0!==v&&4!==v||(x=(m=r.getColumnDefinition(e)).computeEffectiveSpacing(),w=0===m.at,(p=Math.max(y-m.actual,0))+(w?x:0)>c&&(p=Math.max(c-x,0)),m.Zi=m.Zi+p,m.actual=m.at+p,c=Math.max(c-(p+(w?x:0)),0)),(st||nt)&&A.oc())}}}Kt.ot(K);let P=0,k=0;e=r.columnCount;for(let t=0;t=r.rowCount);t++)m=r.getRowDefinition(E.row+t),p=0,p=2===v||4===v?Math.max(m.minimum,0===B[E.row+t]?m.maximum:Math.min(B[E.row+t],m.maximum)):Math.max(m.minimum,isNaN(m.ke)?m.maximum:Math.min(m.ke,m.maximum)),yt.height+=p,i+=m.minimum;for(let t=1;t=r.columnCount);t++)m=r.getColumnDefinition(E.column+t),p=0,p=2===v||5===v?Math.max(m.minimum,0===F[E.column+t]?m.maximum:Math.min(F[E.column+t],m.maximum)):Math.max(m.minimum,isNaN(m.ke)?m.maximum:Math.min(m.ke,m.maximum)),yt.width+=p,e+=m.minimum;N.width+=yt.width,N.height+=yt.height;var wt=E.margin,At=wt.right+wt.left,wt=wt.top+wt.bottom,Pt=(E.wt(N.width,N.height,e,i),E.measuredBounds),At=Math.max(Pt.width+At,0),Pt=Math.max(Pt.height+wt,0);let s=0;for(let t=0;t=r.rowCount);t++)m=r.getRowDefinition(E.row+t),s+=m.total||0;if(s=r.rowCount);t++){var Mt=(m=r.getRowDefinition(E.row+t)).at||0,Ct=St(E,m,kt);Ht,"number"!=typeof Ct&&Kt.n(E+" spanAllocation does not return a number: "+Ct),m.actual=Math.min(m.maximum,Mt+Ct),m.at!==Mt&&(e-=m.at-Mt)}}for(;0Nt&&(m.actual=Math.min(m.maximum,Nt+e),m.at!==Nt)&&(e-=m.at-Nt),0===m.index)break;m=r.getRowDefinition(m.index-1)}}let n=0;for(let t=0;t=r.columnCount);t++)m=r.getColumnDefinition(E.column+t),n+=m.total||0;if(n=r.columnCount);t++){var Tt=(m=r.getColumnDefinition(E.column+t)).at||0,Bt=Dt(E,m,Lt);Ht,"number"!=typeof Bt&&Kt.n(E+" spanAllocation does not return a number: "+Bt),m.actual=Math.min(m.maximum,Tt+Bt),m.at!==Tt&&(e-=m.at-Tt)}}for(;0Ft&&(m.actual=Math.min(m.maximum,Ft+e),m.at!==Ft)&&(e-=m.at-Ft),0===m.index)break;m=r.getColumnDefinition(m.index-1)}}}}Kt.ot(Y),Yt.o(yt),Yt.o(N),void 0!==B&&Kt.ot(B),void 0!==F&&Kt.ot(F);let Et=0,Rt=0;var Ot=r.desiredSize,It=r.maxSize;v=r.qs(!0),P=0;let Vt=k=0,zt=0;e=r.columnCount;for(let t=0;t=m.rowCount);t++){var F=m.getRowDefinition(d+t);0!==F.at&&(C.height+=F.total)}for(let t=1;t=m.columnCount);t++){var E=m.getColumnDefinition(u+t);0!==E.at&&(C.width+=E.total)}var R=L.at+C.width,O=N.at+C.height,I=c,V=g,_=R,W=O,z=c,q=g;let t=R,e=O,i=(c+R>f.width&&(t=Math.max(f.width-c,0)),g+O>f.height&&(e=Math.max(f.height-g,0)),T.alignment),s=0,n=0,a=0,r=0,o=(i.isDefault()?((i=m.defaultAlignment).isSpot()||(i=Z.Center),s=i.x,n=i.y,a=i.offsetX,r=i.offsetY,G=L.alignment,j=N.alignment,G.isSpot()&&(s=G.x,a=G.offsetX),j.isSpot()&&(n=j.y,r=j.offsetY)):(s=i.x,n=i.y,a=i.offsetX,r=i.offsetY),(isNaN(s)||isNaN(n))&&(s=.5,n=.5,a=0,r=0),B.width),l=B.height;var G=T.margin,j=G.left+G.right,H=G.top+G.bottom,K=T.F0(N,L,!1),R=(!isNaN(T.desiredSize.width)||2!==K&&5!==K||(o=Math.max(R-j,0)),!isNaN(T.desiredSize.height)||2!==K&&4!==K||(l=Math.max(O-H,0)),T.maxSize),K=T.minSize,O=(o=Math.min(R.width,o),l=Math.min(R.height,l),o=Math.max(K.width,o),l=Math.max(K.height,l),o+j),R=l+H;I+=_*s-O*s+a+G.left,V+=W*n-R*n+r+G.top,T.visible&&(Q.contains(z,q,t,e,I,V,B.width,B.height)?T.vt(I,V,o,l):T.vt(I,V,o,l,new Q(z,q,t,e)))}}}Yt.o(C);for(let t=0;te.graduatedMin+C&&(S=Math.floor((a-e.graduatedMin)/C),a-=S*C);var N=v[t],L=a,D=1e-6*e.graduatedMax;for(let t=1;a<=e.graduatedMax+D;t++){if(this.lI(e,a-e.graduatedTickBase,N)&&(a>e.graduatedMax&&(a=e.graduatedMax),null===P.graduatedSkip||P instanceof j&&!P.graduatedSkip(a,P)||P instanceof G&&!P.graduatedSkip(a,P))&&w<=(x=(x=(a-e.graduatedMin)*d/e.graduatedRange)>d?d:x)&&x<=A){let e=c[s][n],t=u[s][n];for(;si&&n= 0",Xt,"padding"),t=new I(t)):(Kt.s(t,I,Xt,"padding"),t.left<0&&Kt.G(t.left,">= 0",Xt,"padding:value.left"),t.right<0&&Kt.G(t.right,">= 0",Xt,"padding:value.right"),t.top<0&&Kt.G(t.top,">= 0",Xt,"padding:value.top"),t.bottom<0&&Kt.G(t.bottom,">= 0",Xt,"padding:value.bottom"));var e=this.ei;e.equals(t)||(t=t.L(),this.ei=t,this.u(),this.i("padding",e,t))}get defaultAlignment(){return this.yd}set defaultAlignment(t){var e=this.yd;e.equals(t)||(Ht,Kt.s(t,Z,Xt,"defaultAlignment"),t=t.L(),this.yd=t,this.u(),this.i("defaultAlignment",e,t))}get defaultStretch(){return this.Jn}set defaultStretch(t){var e=this.Jn;e!==t&&(this.Jn=t,this.u(),this.i("defaultStretch",e,t))}get defaultSeparatorPadding(){return null!==this.B?this.B.op:I.qg}set defaultSeparatorPadding(t){"number"==typeof t?t=new I(t):(Ht,Kt.s(t,I,Xt,"defaultSeparatorPadding"));var e=this.defaultSeparatorPadding;e.equals(t)||(t=t.L(),null===this.B&&(this.B=new be),this.B.op=t,this.u(),this.i("defaultSeparatorPadding",e,t))}get defaultRowSeparatorStroke(){return null!==this.B?this.B.rp:null}set defaultRowSeparatorStroke(t){var e=this.defaultRowSeparatorStroke;e!==t&&(null===t||"string"==typeof t||t instanceof m)&&(t instanceof m&&t.w(),null===this.B&&(this.B=new be),this.B.rp=t,this.T(),this.i("defaultRowSeparatorStroke",e,t))}get defaultRowSeparatorStrokeWidth(){return null!==this.B?this.B.lp:1}set defaultRowSeparatorStrokeWidth(t){var e=this.defaultRowSeparatorStrokeWidth;e!==t&&isFinite(t)&&0<=t&&(null===this.B&&(this.B=new be),this.B.lp=t,this.u(),this.i("defaultRowSeparatorStrokeWidth",e,t))}get defaultRowSeparatorDashArray(){return null!==this.B?this.B.hp:null}set defaultRowSeparatorDashArray(i){var t=this.defaultRowSeparatorDashArray;if(t!==i){if(null===i||Array.isArray(i)||Kt.Bi(i,"Array",Xt,"defaultRowSeparatorDashArray:value"),null!==i){var s=i.length;let e=0;for(let t=0;tl.height)continue}else if(h.position>l.width)continue;let s=h.separatorStrokeWidth,n=(isNaN(s)&&(s=r?this.defaultRowSeparatorStrokeWidth:this.defaultColumnSeparatorStrokeWidth),h.separatorStroke);if(null===n&&(n=r?this.defaultRowSeparatorStroke:this.defaultColumnSeparatorStroke),0!==s&&null!==n){this.bn(a,n,!1,!1,l,o);let t=!1,e=h.separatorDashArray;null!==(e=null===e?r?this.defaultRowSeparatorDashArray:this.defaultColumnSeparatorDashArray:e)&&(t=!0,a.enableDash(e,0)),a.beginPath();var u=h.position+s;r?u>l.height&&(s-=u-l.height):u>l.width&&(s-=u-l.width);let i=h.position+s/2;a.lineWidth=s;var d,u=this.ei;r?(i+=u.top,h=u.left,d=l.width-u.right,a.moveTo(h,i),a.lineTo(d,i)):(i+=u.left,h=u.top,d=l.height-u.bottom,a.moveTo(i,h),a.lineTo(i,d)),a.stroke(),a.endPath(),t&&a.disableDash()}}}}sb(n,t,a,e,i){var s=e.length,r=this.actualBounds,o=this.naturalBounds,l=this.SL(!0),h=this.SL(!1);for(let t=0;td)){let t=u.computeEffectiveSpacing(),e=u.separatorStrokeWidth,i=(isNaN(e)&&(e=a?this.defaultRowSeparatorStrokeWidth:this.defaultColumnSeparatorStrokeWidth),u.separatorStroke);null===i&&(i=a?this.defaultRowSeparatorStroke:this.defaultColumnSeparatorStroke),t-=e=null!==i&&u.index!==(a?l:h)?e:0;var c=u.position+e;let s=t+u.actual;(s=c+s>d?d-c:s)<=0||(d=this.ei,this.bn(n,u.background,!0,!1,o,r),a?n.fillRect(d.left,c+d.top,r.width-(d.left+d.right),s):n.fillRect(c+d.left,d.top,s,r.height-(d.top+d.bottom)))}}}}SL(e){var i=e?this.rowCount:this.columnCount;for(let t=0;te&&h.set(n),_.o(n)),_.o(S),u&&h.D(d),i}}Bu(){var e=this.F.h,i=e.length;for(let t=0;td.width||u.y>d.height||u.x+u.width<0||u.y+u.height<0)){let t=h;d=h instanceof Xt?h:null,u=V.a();u.set(e),(null!==d?d.Um(i,s,n,a,r,u):t.eL(i,a,u))&&null!==(t=null!==s?s(t):t)&&(null===n||n(t))&&r.add(t),V.o(u)}}}}return void 0===t&&V.o(e),a}void 0===t&&V.o(e)}return!1}V2(e,i,s){var n=this.F.h;for(let t=n.length;t--;){var a=n[t];if(a.visible){var r=a.actualBounds,o=this.naturalBounds;if(!(r.x>o.width||r.y>o.height||r.x+r.width<0||r.y+r.height<0)){a instanceof Xt&&a.V2(e,i,s);let t=a;null===(t=null!==e?e(t):t)||null!==i&&!i(t)||s.add(t)}}}}oA(e,i,s,n,a,r){if(!1!==this.pickable){void 0===s&&(s=null),void 0===n&&(n=null);var t=this.naturalBounds,o=this.Mn(),l=o?e:_.H(e.x,e.y).Ge(this.D),h=o?i:_.H(i.x,i.y).Ge(this.D),u=l.distanceSquaredPoint(h),d=0y.width||v.y>y.height||v.x+v.width<0||v.y+v.height<0)){p.Mn()?(y=p.D,c.set(e).Ge(y),g.set(i).Ge(y)):(c.set(e),g.set(i));let t=p;v=p instanceof Xt?p:null;(null!==v?v.oA(c,g,s,n,a,r):t.sL(c,g,a))&&null!==(t=null!==s?s(t):t)&&(null===n||n(t))&&r.add(t)}}}_.o(c),_.o(g)}return a?d:t}}return!1}F2(t){let e=null;return e=null===(e=t instanceof G&&((e=t.spot1)===Z.Default&&(e=null),null!==(t=t.geometry))&&null===e?t.spot1:e)?Z.TopLeft:e}R2(t){let e=null;return e=null===(e=t instanceof G&&((e=t.spot2)===Z.Default&&(e=null),null!==(t=t.geometry))&&null===e?t.spot2:e)?Z.BottomRight:e}add(...e){for(let t=0;t=n.count&&t>=n.count)return;n.removeAt(e),a=e}else Kt.n("element "+i.toString()+" has panel "+s.toString()+" but is not contained by it.")}(t<0||t>n.count)&&(t=n.count),n.insertAt(t,i),0!==t&&!i.isPanelMain||(this.fl=null),this.Ko()||this.u(),i.u(!1),(null!==i.portId||i instanceof Xt&&!0===i.Nn)&&(this.Nn=!0),this.cs=null,this.isEnabledObject()||this.nb(i,!1);s=this.part;null!==s&&(s.V0(),s.gc(),this.Nn&&s instanceof D&&(s.Nn=!0),s.Nn&&s instanceof D&&(s.ue=null),null!==(n=this.diagram)&&n.undoManager.isUndoingRedoing||(-1!==a&&s.raiseChangedEvent(4,"elements",this,i,null,a,null),s.raiseChangedEvent(3,"elements",this,null,i,null,t)))}get Nn(){return 0!=(8388608&this.l)}set Nn(t){0!=(8388608&this.l)!==t&&(this.l=8388608^this.l)}f2(){return 0!=(16777216&this.l)}B2(t){t?this.l|=16777216:this.l&=-16777217}dI(t){t.Pa(this),t.rl=null;var e,i=this.F,s=i.count,i=(i.insertAt(s,t),this.part);null!==i&&(i.V0(),null!==t.portId&&i instanceof D&&(i.Nn=!0),null!==(e=this.diagram)&&e.undoManager.isUndoingRedoing||i.raiseChangedEvent(3,"elements",this,null,t,null,s))}ER(e){var i=this.F.h,s=i.length;let n=-1;for(let t=0;ta.k2(e,i)):a.k2(n,i)),null!==(e=this.diagram)&&e.undoManager.isUndoingRedoing||a.raiseChangedEvent(4,"elements",this,n,null,t,null))}get Ze(){return null===this.B&&(this.B=new be),this.B.Ze}get rowCount(){return null===this.B?0:this.Ze.length}getRowDefinition(t){Ht,Kt.r(t,Xt,"getRowDefinition:idx"),t<0&&Kt.G(t,">= 0",Xt,"getRowDefinition:idx"),t=Math.round(t);var e,i=this.Ze;return void 0===i[t]&&((e=new we).Pa(this),e.isRow=!0,i[e.index=t]=e,this.raiseChangedEvent(3,"rowdefs",this,null,e,null,t)),i[t]}removeRowDefinition(e){if(Ht,Kt.r(e,Xt,"removeRowDefinition:idx"),e<0&&Kt.G(e,">= 0",Xt,"removeRowDefinition:idx"),0!==this.rowCount){e=Math.round(e);var i=this.Ze,s=i[e];if(s){i[e]=void 0;let t=i.length-1;for(;0<=t&&void 0===i[t--];)i.length--;this.raiseChangedEvent(4,"rowdefs",this,s,null,e,null),this.u()}}}IA(t,e){var i=this.Ze;if(!(t<0)){if(i[t]=e instanceof we?e:void 0,!e){let t=i.length-1;for(;0<=t&&void 0===i[t--];)i.length--}this.u()}}get $e(){return null===this.B&&(this.B=new be),this.B.$e}get columnCount(){return null===this.B?0:this.$e.length}getColumnDefinition(t){Ht,Kt.r(t,Xt,"getColumnDefinition:idx"),t<0&&Kt.G(t,">= 0",Xt,"getColumnDefinition:idx"),t=Math.round(t);var e,i=this.$e;return void 0===i[t]&&((e=new we).Pa(this),e.isRow=!1,i[e.index=t]=e,this.raiseChangedEvent(3,"coldefs",this,null,e,null,t)),i[t]}removeColumnDefinition(e){if(Ht,Kt.r(e,Xt,"removeColumnDefinition:idx"),e<0&&Kt.G(e,">= 0",Xt,"removeColumnDefinition:idx"),0!==this.columnCount){e=Math.round(e);var i=this.$e,s=i[e];if(s){i[e]=void 0;let t=i.length-1;for(;0<=t&&void 0===i[t--];)i.length--;this.raiseChangedEvent(4,"coldefs",this,s,null,e,null),this.u()}}}OA(t,e){var i=this.$e;if(!(t<0)){if(i[t]=e instanceof we?e:void 0,!e){let t=i.length-1;for(;0<=t&&void 0===i[t--];)i.length--}this.u()}}addRowColumnDefinition(t){let e=null;return t.isRow?e=this.getRowDefinition(t.index):t.isRow||(e=this.getColumnDefinition(t.index)),e&&e.J1(t),this}addRowDefinition(t,e){t=this.getRowDefinition(t);return t&&t.J1(new we(e)),this}addColumnDefinition(t,e){t=this.getColumnDefinition(t);return t&&t.J1(new we(e)),this}get rowSizing(){return null!==this.B?this.B.wp:3}set rowSizing(t){var e=this.rowSizing;e!==t&&(Ht,3!==t&&2!==t&&Kt.n("Panel.rowSizing must be ProportionalExtra or None, not: "+t),null===this.B&&(this.B=new be),this.B.wp=t,this.u(),this.i("rowSizing",e,t))}get columnSizing(){return null!==this.B?this.B.xp:3}set columnSizing(t){var e=this.columnSizing;e!==t&&(Ht,3!==t&&2!==t&&Kt.n("Panel.columnSizing must be ProportionalExtra or None, not: "+t),null===this.B&&(this.B=new be),this.B.xp=t,this.u(),this.i("columnSizing",e,t))}get topIndex(){return null!==this.B?this.B.bp:0}set topIndex(t){var e=this.topIndex;e!==t&&((!isFinite(t)||t<0)&&Kt.n("Panel.topIndex must be greater than zero and a real number, not: "+t),null===this.B&&(this.B=new be),this.B.bp=t,this.u(),this.i("topIndex",e,t))}get leftIndex(){return null!==this.B?this.B.kp:0}set leftIndex(t){var e=this.leftIndex;e!==t&&((!isFinite(t)||t<0)&&Kt.n("Panel.leftIndex must be greater than zero and a real number, not: "+t),null===this.B&&(this.B=new be),this.B.kp=t,this.u(),this.i("leftIndex",e,t))}findRowForLocalY(t){if(t<0||this.type!==Xt.Table||0===this.rowCount)return-1;let e=0;var i=this.Ze,s=i.length;let n=this.topIndex;for(;n{e.uh();var i=e.Ii;if(null!==i){e.p2(!1);for(var s=i.iterator;s.next();){var n=s.value,a=(2===n.mode&&e.p2(!0),n.sourceName);n.isToObject&&("/"===a&&t.B2(!0),null!==(a=n.iL(t,e)))&&(v.add(a),null===a.no&&(a.no=new O),a.no.add(n)),p.add(n)}}if(e instanceof Xt&&e.type===Xt.Table){if(0{if(i instanceof Xt&&(i.type===Xt.Auto||i.type===Xt.Spot||i.type===Xt.Graduated)&&i.elements.count<=1&&!(i instanceof H)){let t=!1;if(1===i.elements.count&&!(t=null!==i.itemArray))for(n=p.iterator;n.next();)if("itemArray"===n.value.targetProperty){t=!0;break}t||(Kt.ft("Auto, Spot, or Graduated Panel should not have zero or one elements: "+i.toString()+" in "+e.toString()),Xt.AL=!0)}}),this}static AL=!1;copyTemplate(t){void 0===t&&(t=!1);var e=this.copy();return e.gI(e=>{e instanceof Xt&&(e.js=null,e.si=null);var t=e.Ii,t=(null!==t&&(e.Ii=null,t.each(t=>e.bind(t.copy()))),e.Ns);null!==t&&(e.Ns=null,t.each(t=>e.trigger(t.value.copy())))}),t&&e.ui(),e}updateTargetBindings(t){var e=this.js;if(null!==e){void 0===t&&(t="");for(var i=e.iterator;i.next();){var s,n=i.value,a=this.LL(n,t);null===a||({data:a,elt:s}=a,n.isToTheme&&null===this.diagram)||void 0!==s&&n.updateTarget(s,a)}}}Uo(){if(null!==this.diagram)if(this.S2())for(var t=this.js.iterator;t.next();){var e,i,s=t.value;s.isToTheme&&null!==(e=this.LL(s))&&({data:e,elt:i}=e,void 0!==i)&&s.updateTarget(i,e)}else{var n=this.F.h,a=n.length;for(let t=0;tt;)this.re(this.F.length-1,!1);this.TL(null,this.itemArray)}TL(t,e){var s=this.yp(),n=e;if(null===n||0===n.length)for(;this.F.length>s;)this.re(this.F.length-1,!1);else if(this.F.length<=s){var i=n.length;for(let t=0;t= 0",we,"height"),this.ke=t,this.actual=this.at,null!==this.panel&&this.panel.u(),this.i("height",e,t))}get width(){return this.ke}set width(t){var e=this.ke;e!==t&&(Ht,Kt.t(t,"number",we,"width"),t<0&&Kt.G(t,">= 0",we,"width"),this.ke=t,this.actual=this.at,null!==this.panel&&this.panel.u(),this.i("width",e,t))}get minimum(){return this.La}set minimum(t){var e=this.La;e!==t&&(Ht,Kt.t(t,"number",we,"minimum"),(t<0||!isFinite(t))&&Kt.G(t,">= 0",we,"minimum"),this.La=t,this.actual=this.at,null!==this.panel&&this.panel.u(),this.i("minimum",e,t))}get maximum(){return this.Ta}set maximum(t){var e=this.Ta;e!==t&&(Ht,Kt.t(t,"number",we,"maximum"),t<0&&Kt.G(t,">= 0",we,"maximum"),this.Ta=t,this.actual=this.at,null!==this.panel&&this.panel.u(),this.i("maximum",e,t))}get alignment(){return this.fi}set alignment(t){var e=this.fi;e.equals(t)||(Ht,Kt.s(t,Z,we,"alignment"),this.fi=t.L(),null!==this.panel&&this.panel.u(),this.i("alignment",e,t))}get stretch(){return this.lo}set stretch(t){var e=this.lo;e!==t&&(this.lo=t,null!==this.panel&&this.panel.u(),this.i("stretch",e,t))}get separatorPadding(){return this.$o}set separatorPadding(t){"number"==typeof t?t=new I(t):null!==t&&(Ht,Kt.s(t,I,we,"separatorPadding"));var e=this.$o;null!==t&&null!==e&&e.equals(t)||(null!==t&&(t=t.L()),this.$o=t,null!==this.panel&&this.panel.u(),this.i("separatorPadding",e,t))}get separatorStroke(){return this.Pd}set separatorStroke(t){var e=this.Pd;e!==t&&(null!==t&&m.ud(t,"RowColumnDefinition.separatorStroke"),t instanceof m&&t.w(),this.Pd=t,null!==this.panel&&this.panel.u(),this.i("separatorStroke",e,t))}get separatorStrokeWidth(){return this.Nd}set separatorStrokeWidth(t){var e=this.Nd;e!==t&&(this.Nd=t,null!==this.panel&&this.panel.u(),this.i("separatorStrokeWidth",e,t))}get separatorDashArray(){return this.Da}set separatorDashArray(i){var t=this.Da;if(t!==i){if(null===i||Array.isArray(i)||Kt.Bi(i,"Array",we,"separatorDashArray:value"),null!==i){var s=i.length;let e=0;for(let t=0;tu)return d=u,void Kt.ot(P);d>h?(f=d-h,d=h):f=0;let t=Math.sqrt(d*d/(1+o*o));if(a<0&&(t=-t),e+=t,i+=o*t,p.translate(e,i),p.rotate(l),p.translate(-w/2,-A/2),0===f&&b.ph(p,v),p.translate(w/2,A/2),p.rotate(-l),p.translate(-e,-i),u-=d,h-=d,0!==f){if(++g===P.length)return void Kt.ot(P);m=P[g],a=m[0],l=m[1],o=m[2],h=m[3],d=f}}Kt.ot(P)}}ph(n,a){var r=n instanceof Jt;let o=this.$i;var l=this.Fa;if(null!==o||null!==l){var h=this.yt;if(null!==h){n.commitTransform();var u=this.actualBounds,d=this.naturalBounds,c=(null!==l&&this.bn(n,l,!0,!1,d,u),this.part);let t=this.Qo,e=(null===o||0!==t||null===c||!this.isPanelMain&&c.findMainElement()!==this||(t=c.MI()),null!==(o=0===t?null:o)&&0!==t&&(this.bn(n,o,!1,!1,d,u),n.lineWidth=t,n.lineJoin=this.strokeJoin,n.lineCap=this.strokeCap,n.miterLimit=this.strokeMiterLimit),!1),i=(c&&a.getRenderingHint("drawShadows")&&(e=c.isShadowed),!1===n.hl&&(e=!1),!0),s=(null===o||null!==l&&"transparent"!==l||(i=!1),!1);d=this.strokeDashArray;if(null!==d&&(s=!0,n.enableDash(d,this.strokeDashOffset)),1===h.type)n.beginPath(),n.moveTo(h.startX,h.startY),n.lineTo(h.endX,h.endY),null!==o&&n.strokeContext(),n.endPath();else if(2===h.type){var u=h.startX,c=h.startY,d=h.endX,g=h.endY,m=Math.min(u,d),f=Math.min(c,g),d=Math.abs(d-u),u=Math.abs(g-c);n.beginPath(),n.rect(m,f,d,u),null!==l&&n.fillContext(l,!1,null),null!==o&&(i&&e&&n.shadowsOff(),n.strokeContext(),i)&&e&&n.shadowsOn(),n.endPath()}else if(3===h.type){g=h.startX,c=h.startY,m=h.endX,f=h.endY,d=Math.abs(m-g)/2,u=Math.abs(f-c)/2,g=Math.min(g,m)+d,m=Math.min(c,f)+u;n.beginPath(),n.moveTo(g,m-u),n.bezierCurveTo(g+z.Gn*d,m-u,g+d,m-z.Gn*u,g+d,m),n.bezierCurveTo(g+d,m+z.Gn*u,g+z.Gn*d,m+u,g,m+u),n.bezierCurveTo(g-z.Gn*d,m+u,g-d,m+z.Gn*u,g-d,m),n.bezierCurveTo(g-d,m-z.Gn*u,g-z.Gn*d,m-u,g,m-u),n.closePath(),null!==l&&n.fillContext(l,!1,null),null!==o&&(i&&e&&n.shadowsOff(),n.strokeContext(),i)&&e&&n.shadowsOn(),n.endPath()}else if(4===h.type){var p=h.figures,v=p.length;for(let t=0;t(r=e(o=t=t&&n<=e}{let t=0,e=0;return e=a=t&&o<=e}}LI(t,e){if(this.containedInRect(t,e)||void 0===e&&(e=this.D,t.containsRect(this.actualBounds)))return!0;var i=t.left,s=t.right,n=t.top,t=t.bottom,a=_.a(),r=_.a(),o=_.a(),l=V.a();l.set(e),l.uC(this.D),l.Mw(),r.x=s,r.y=n,r.D(l),a.x=i,a.y=n,a.D(l);let h=!1;return(this.Ia(a,r,o)||(a.x=s,a.y=t,a.D(l),this.Ia(a,r,o))||(r.x=i,r.y=t,r.D(l),this.Ia(a,r,o))||(a.x=i,a.y=n,a.D(l),this.Ia(a,r,o)))&&(h=!0),V.o(l),_.o(a),_.o(r),_.o(o),h}sL(n,t,e){if(e&&null!==this.fill&&this.dh(n,!0))return!0;let a=n.distanceSquaredPoint(t);t=a;1.5=a||_.distanceSquared(d,h,0,-t)>=a||_.distanceSquared(d,h,0,t)>=a||_.distanceSquared(d,h,u,0)>=a);if(4===i.type){r=i.bounds,l=r.x,s=r.y,o=r.x+r.width,t=r.y+r.height;if(n.x>o&&n.xt&&n.ya&&_.distanceLineSegmentSquared(n.x,n.y,l,s,o,s)>a&&_.distanceLineSegmentSquared(n.x,n.y,o,t,l,t)>a&&_.distanceLineSegmentSquared(n.x,n.y,o,t,o,s)>a)return!1;var d=Math.sqrt(a);if(!e){var c=i.figures;for(let t=0;ta)return!1;var m=g.segments.h,f=m.length;for(let t=0;ta)return!1;break;case 3:var v=Kt.ct(),y=(z.Hn(i,s,p.point1X,p.point1Y,p.point2X,p.point2Y,p.endX,p.endY,.8,v),A(v,n));if(Kt.ot(v),y||(i=p.endX,s=p.endY,n.distanceSquared(i,s)>a))return!1;break;case 4:v=Kt.ct(),y=(z.Wg(i,s,p.point1X,p.point1Y,p.endX,p.endY,.8,v),A(v,n));if(Kt.ot(v),y||(i=p.endX,s=p.endY,n.distanceSquared(i,s)>a))return!1;break;case 5:case 6:{var b=5===p.type?p.Fo(g):p.Kh(g,i,s),x=b.length;if(0===x){if(i=5===p.type?p.centerX:p.endX,s=5===p.type?p.centerY:p.endY,n.distanceSquared(i,s)>a)return!1;break}let e=null;var w=Kt.ct();for(let t=0;ta)return!0;return!1}}CI(e,i,s,n,a,r){if(0===e.width)return z.vn(e.x,e.y,e.x,e.y+e.height,i,s,n,a,r);if(0===e.height)return z.vn(e.x,e.y,e.x+e.width,e.y,i,s,n,a,r);{var o=e.width/2,l=e.height/2,h=e.x+o,e=e.y+l;let t=i!==n?(s-a)/(i-n):9999;if(Math.abs(t)<9999){a=s-e-t*(i-h);if(o*o*(t*t)+l*l-a*a<0)return r.x=NaN,r.y=NaN,!1;var n=Math.sqrt(o*o*(t*t)+l*l-a*a),u=(-(o*o*t)*a+o*l*n)/(l*l+o*o*(t*t))+h,n=(-(o*o*t)*a-o*l*n)/(l*l+o*o*(t*t))+h,d=t*(u-h)+a+e,a=t*(n-h)+a+e;Math.abs((i-u)*(i-u))+Math.abs((s-d)*(s-d))= 0",G,"strokeWidth:value"))}K1(){return this.Qo}get strokeCap(){return null!==this.Rt?this.Rt.Mp:"butt"}set strokeCap(t){var e=this.strokeCap;e!==t&&("string"!=typeof t||"butt"!==t&&"round"!==t&&"square"!==t?Kt.G(t,'"butt", "round", or "square"',G,"strokeCap"):(this.Ra(),this.Rt.Mp=t,this.T(),this.i("strokeCap",e,t)))}get strokeJoin(){return null!==this.Rt?this.Rt.Pp:"miter"}set strokeJoin(t){var e=this.strokeJoin;e!==t&&("string"!=typeof t||"miter"!==t&&"bevel"!==t&&"round"!==t?Kt.G(t,'"miter", "bevel", or "round"',G,"strokeJoin"):(this.Ra(),this.Rt.Pp=t,this.T(),this.i("strokeJoin",e,t)))}get strokeMiterLimit(){return null!==this.Rt?this.Rt.Np:10}set strokeMiterLimit(t){var e,i=this.strokeMiterLimit;i!==t&&(Ht,Kt.r(t,G,"strokeMiterLimit"),1<=t?(this.Ra(),this.Rt.Np=t,this.T(),null!==(e=this.part)&&e.gc(),this.i("strokeMiterLimit",i,t)):(Ht,Kt.G(t,"value >= 1",G,"strokeWidth:value")))}get strokeDashArray(){return this.jo}set strokeDashArray(i){var t=this.jo;if(t!==i){if(null===i||Array.isArray(i)||Kt.Bi(i,"Array",G,"strokeDashArray:value"),null!==i){var s=i.length;let e=0;for(let t=0;ti+1e-5||n.bounds.height>s+1e-5)&&Kt.n('Geometry made with figure "'+e.figure+'" has bounds '+n.bounds.toString()+" that are too large for the given size ("+i+","+s+"). See documentation for Shape.defineFigureGenerator."),n}static getFigureGenerators(){var t,e=new L;for(const i in z.qn)i!==i.toLowerCase()&&(t=z.qn[i],e.add(i,t));return e.w(),e}static defineFigureGenerator(t,e){Kt.t(t,"string",G,"defineFigureGenerator:name"),"string"==typeof e?(Ht,""!==e&&z.qn[e]||Kt.n("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+e)):Kt.t(e,"function",G,"defineFigureGenerator:func");var i=t.toLowerCase(),s=(Ht,""!==t&&t!==i||Kt.n("Shape.defineFigureGenerator name must not be empty or all-lower-case: "+t),z.qn);s[t]=e,s[i]=t}static getArrowheadGeometries(){var t,e,i=new L;for(const s in z.$g)void 0===G.co[s]&&(t=W.parse(z.$g[s],!1),G.co[s]=t,(t=s.toLowerCase())!==s)&&(G.co[t]=s);for(const n in G.co)n!==n.toLowerCase()&&(e=G.co[n])instanceof W&&i.add(n,e);return i.w(),i}static defineArrowheadGeometry(t,e){Kt.t(t,"string",G,"defineArrowheadGeometry:name");let i=null;i="string"==typeof e?(Kt.t(e,"string",G,"defineArrowheadGeometry:pathstr"),W.parse(e,!1)):(Kt.s(e,W,G,"defineArrowheadGeometry:pathstr"),e);var e=t.toLowerCase(),s=(Ht,""!==t&&"none"!==e&&t!==e||Kt.n("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t),G.co);s[t]=i,s[e]=t}static co=new l;static K2=new l;static RL(t){let e=G.co[t];if(void 0===e){var i,s=t.toLowerCase();if("none"===s)return"None";if(void 0===(e=G.co[s])){let t=null;for(const n in z.$g)if(n.toLowerCase()===s){t=n;break}if(null!==t)return i=W.parse(z.$g[t],!1),G.co[t]=i,s!==t&&(G.co[s]=t),t}}return"string"==typeof e?e:e instanceof W?t:null}}class Ae{xi;Mp;Pp;Np;wh;Lp;Tp;Wn;jn;constructor(){this.xi=!1,this.Mp="butt",this.Pp="miter",this.Np=10,this.wh=0,this.Lp=null,this.Tp=1,this.Wn=Z.Default,this.jn=Z.Default}copy(){var t=new Ae;return t.Mp=this.Mp,t.Pp=this.Pp,t.Np=this.Np,t.wh=this.wh,t.Lp=this.Lp,t.Tp=this.Tp,t.Wn=this.Wn.L(),t.jn=this.jn.L(),t}}(a={})[a.None=0]="None",a[a.Fit=1]="Fit",a[a.DesiredSize=2]="DesiredSize",a[a.BreakAll=3]="BreakAll";var Pe=a,ke=((a={})[a.Clip=0]="Clip",a[a.Ellipsis=1]="Ellipsis",a),Se=((a={})[a.Trim=0]="Trim",a[a.None=1]="None",a);class j extends y{di;$i;Ln;Oe;bi;C0;Fd;tt;_;Bl;uo;Tn;Ee;Ei;Dn;constructor(t,e){return super(),this.l|=2097152,this.di="",this.$i="black",this.Ln="13px sans-serif",this.Oe=0,this.bi=0,this.C0=0,this.Fd=null,this.tt=null,this._=null,this.Bl=0,this.uo=null,this.Tn=0,this.Ee=null,this.Ei=null,this.Dn=null,"string"==typeof t?this.text=t:t&&Object.assign(this,t),e&&Object.assign(this,e),this}cloneProtected(t){super.cloneProtected(t),t.di=this.di,t.$i=this.$i,t.Ln=this.Ln,t.Oe=this.Oe,t.bi=this.bi,t.C0=this.C0,t.Fd=this.Fd,null!==this.tt&&(t.tt=this.tt.copy()),null!==this._&&(this._.xi?t._=this._:t._=this._.copy()),t.Bl=this.Bl,t.uo=this.uo,t.Tn=this.Tn,t.Ee=this.Ee,t.Ei=this.Ei,t.Dn=this.Dn}Fn(){null===this._?this._=new Me:this._.xi&&(this._=this._.copy())}uh(){super.uh(),null!==this._&&(this._.xi=!0)}uI(t){this.l=6144|t.l,this._t=t.opacity,this.Ft=t.background,this.We=t.desiredSize.L(),this.minSize=t.minSize.L(),this.maxSize=t.maxSize.L(),null!==t.Ni?this.Ni=t.Ni.copy():this.Ni=null,this.v=t.scale,this.qt=t.angle,this.stretch=t.stretch,this.ol=t.margin.L(),this.fi=t.alignment.L(),this._f=t.alignmentFocus.L(),this.segmentFraction=t.segmentFraction,this.segmentOffset=t.segmentOffset.L(),this.segmentOrientation=t.segmentOrientation,null!==t.hi&&(this.hi=t.hi.copy()),this.shadowVisible=t.shadowVisible,this.di=t.di,this.$i=t.$i,this.Ln=t.Ln,null!==this.tt&&(this.tt=t.tt.copy()),null!==t._&&(t._.xi?this._=t._:this._=t._.copy()),this.Bl=t.Bl}fI(t){this.di=t.text||"",this.qt=t.labelAngle||0,this.Oe=t.lineCount||0,this.TI(t.lines),t.naturalBounds&&(this.Hi=t.naturalBounds),t.actualBounds&&(t=t.actualBounds,this.vt(t.x,t.y,t.width,t.height))}ci(t){t in Pe?this.wrap=t:super.ci(t)}toString(){return 22g&&(t=g),s+=m,this.EL(this.Dn,a,0,s,g,h,t,n,i,d,c)}else if(null!==this.Ee&&null!==this.Ei)for(let e=0;eg&&(t=g),s+=m,this.EL(this.Ei[e],a,0,s,g,h,t,n,i,d,c),s+=h+f}switch(this.flip){case 0:break;case 2:a.scale(-1,1),a.translate(-o,0);break;case 1:a.scale(1,-1),a.translate(0,-l);break;case 3:a.scale(-1,-1),a.translate(-o,-l)}}}EL(t,i,s,n,a,r,o,l,h,u,d){let c=0;if(l)"left"===h?c=0:"right"===h?c=a-o:"center"===h&&(c=(a-o)/2),i.fillRect(s+c,n+.25*r,o,1);else{"left"===h?c=0:"right"===h?c=a:"center"===h&&(c=a/2);l=null!==j.ab?j.ab(this,r):.75*r;i.fillText(t,s+c,n+l);let e=r/20|0;if(0===e&&(e=1),"right"===h?c-=o:"center"===h&&(c-=o/2),u&&(a=null!==j.fb?j.fb(this,r):.8*r,this.VL(s+c,n+a,s+c+o,n+a,e,i),i instanceof Jt)&&i.lastCreatedElement.classList.add("gojs-td"),d){let t=n+r-r/2.2|0;e%2!=0&&(t+=.5),this.VL(s+c,t,s+c+o,t,e,i),i instanceof Jt&&i.lastCreatedElement.classList.add("gojs-td")}}}VL(t,e,i,s,n,a){a.beginPath(),a.lineWidth=n,a.moveTo(t,e),a.lineTo(i,s),a.stroke(),a.endPath()}sc(e,t,i){if(!super.sc(e,t,i))return!1;if(this.bn(e,this.$i,!0,!1,this.naturalBounds,this.actualBounds),i){if(0===this.svg.getElementsByTagName("text").length)return!0;var s=this.svg.getElementsByClassName("gojs-td");for(let t=0;tthis.maxLines&&(this.l|=16777216))}G2(t,a,r){var o=0===this.formatting;o&&(t=t.trim());let l=0,h=0,u=0;var s=this.Ln,d=this.spacingAbove+this.spacingBelow,d=Math.max(0,this.Op()+d),s=1===this.overflow?this.zL(s):0;if(this.Oe>=this.maxLines)null!==r&&r.e(0,d);else{let n=t;if(0===this.wrap){if(this.Tn=1,h=this.getStringWidth(t),0===s||h<=a)return this.bi=Math.max(this.bi,h),this.Rn(t,this.bi),void(null!==r&&r.e(h,d));let e=this.Rd(n),i=(n=n.substring(e.length),this.Rd(n));for(h=this.getStringWidth(e+i),u=0;0a&&1a;){let t=1;for(h=this.getStringWidth(i.substring(0,t)),u=0;h<=a;)t++,u=h,h=this.getStringWidth(i.substring(0,t));let e=0;l=1===t?(e=h,Math.max(l,h)):(e=u,Math.max(l,u)),--t<1&&(t=1);var c=i.substring(0,t);if(this.Rn(c,e),s++,i=i.substring(t),this.Oe+s>this.maxLines)break}let e=this.Rd(n);for(h=this.getStringWidth(i+e),u=0;0this.maxLines)break}}this.Tn=Math.min(this.maxLines,s),this.bi=Math.max(this.bi,l),null!==r&&r.e(this.bi,d*this.Tn)}}}II(e,i){if(0!==this.bi&&null!==this.Ee&&null!==this.Ei&&1===this.overflow){var s=this.Ln,s=1===this.overflow?this.zL(s):0,n=this.spacingAbove+this.spacingBelow,n=Math.max(0,this.Op()+n),i=Math.min(this.maxLines-1,Math.max(Math.floor(i/n+.01)-1,0));if(!(i+1>=this.Ei.length)){this.H2(!0);let t=this.Ei[i];for(var a=Math.max(1,e-s);this.getStringWidth(t)>a&&1=t.length?t:t.substring(0,i)}getStringWidth(t){return null===j.al?8*t.length:j.al.measureText(t).width}Op(){if(null!==this.uo)return this.uo;var t=this.Ln;let e=0;return null===j.al?e=16:void 0!==j.v2[t]&&j.XL<5e3?e=j.v2[t]:(e=1.3*j.al.measureText("M").width,j.v2[t]=e,j.XL++),this.uo=e}zL(t){if(null===j.al)return 6;let e=0;return void 0!==j.hb[t]&&j.U2<5e3?e=j.hb[t]:(e=j.al.measureText(j.Dp).width,j.hb[t]=e,j.U2++),e}cb(t,e){return t.indexOf(` + `+this.history.elt(t).toString(e-1)}return i}clear(){var e=this.history;e.ut();for(let t=e.count-1;0<=t;t--){var i=e.elt(t);null!==i&&i.clear()}e.clear(),this.Ys=-1,e.w(),this.Ks=!1,this.km=null,this.Zn=0,this.pn.ut(),this.pn.clear(),this.pn.w(),this.yf.clear(),this.zw=!1,this.Xw=!1,this.Sm=!1,this.Yw=!1}copyProperties(t){this.isEnabled=t.isEnabled,this.maxHistoryLength=t.maxHistoryLength,this.bu=t.bu}addModel(t){this.Ew.add(t)}removeModel(t){this.Ew.remove(t)}startTransaction(t){if(null===(t=void 0===t?"":t)&&(t=""),this.isUndoingRedoing)return!1;!0===this.Bw&&(this.Bw=!1,this.Zn++,this.Cl||this.i("StartingFirstTransaction",t,this.currentTransaction),0=a&&(null!==(r=o.elt(0))&&r.clear(),o.removeAt(0),this.Ys--)),0===a||0!==o.count&&o.get(o.count-1)===n||(o.add(n),this.Ys++),o.w(),t=n),this.Cl||this.i("CommittedTransaction",s,t);else{this.Ks=!0;try{this.isEnabled&&null!==t&&(t.isComplete=!0,t.undo())}finally{this.Cl||this.i("RolledBackTransaction",s,t),this.Ks=!1}null!==t&&t.clear()}return this.km=null,this.Kw&&this.clear(),this.Kw=!1,!(this.Uw=!1)}this.isEnabled&&!i&&null!==t&&t.jD(e)}return!1}discardHistoryAfterIndex(){if(!this.isUndoingRedoing&&this.canRedo()){var e=this.history;e.ut();for(let t=e.count-1;t>this.historyIndex;t--){var i=e.elt(t);null!==i&&i.clear(),e.removeAt(t),this.Sm=!0}e.w()}}oE(t){this.Zn+=t,this.Zn<0&&(this.Zn=0)}canUndo(){var t;return!(!this.isEnabled||0!t.layer.isTemporary:e);return s.targetObject=t,this.JD(t,s,i),s.handled}JD(i,s,n){if(s.handled=!1,null===i||i.isEnabledObject()){let e=0,t=(s.left?e=1!==s.clickCount&&2===s.clickCount?2:1:s.right&&1===s.clickCount&&(e=3),"ObjectSingleClicked");if(null!==i){switch(e){case 1:t="ObjectSingleClicked";break;case 2:t="ObjectDoubleClicked";break;case 3:t="ObjectContextClicked"}0!==e&&n.V(t,i)}else{switch(e){case 1:t="BackgroundSingleClicked";break;case 2:t="BackgroundDoubleClicked";break;case 3:t="BackgroundContextClicked"}0!==e&&n.V(t)}if(null!==i)for(;null!==i;){let t=null;switch(e){case 1:t=i.click;break;case 2:t=i.doubleClick||i.click;break;case 3:t=i.contextClick}if(null!==t&&(t(s,i),s.handled))break;i=i.panel}else{let t=null;switch(e){case 1:t=n.click;break;case 2:t=n.doubleClick||n.click;break;case 3:t=n.contextClick}null!==t&&t(s)}}}standardMouseOver(){var n=this.diagram,a=n.lastInput;if(!0!==n.animationManager.Mi){var t=n.skipsUndoManager;n.skipsUndoManager=!0;let i=n.viewportBounds.containsPoint(a.documentPoint)?n.findObjectAt(a.documentPoint,null,null):null,s=(!a.event||"pointercancel"!==a.event.type&&"pointerout"!==a.event.type||(i=null),!1);if((a.targetObject=i)!==n.wf){let t=n.wf;var e=t;for(n.wf=i,this.doCurrentObjectChanged(t,i),a.handled=!1;null!==t;){var r=t.mouseLeave;if(null!==r&&(i===t||null!==i&&i.isContainedBy(t)||(r(a,t,i),s=!0,a.handled)))break;t=t.panel}for(t=e,a.handled=!1;null!==i;){var o=i.mouseEnter;if(null!==o&&(t===i||null!==t&&t.isContainedBy(i)||(o(a,i,t),s=!0,a.handled)))break;i=i.panel}i=n.wf}if(null!==i){let t=i,e="";for(;null!==t&&""===(e=t.cursor);)t=t.panel;for(n.currentCursor=e,a.handled=!1,t=i;null!==t;){var l=t.mouseOver;if(null!==l&&(l(a,t),s=!0,a.handled))break;t=t.panel}}else{this.doUpdateCursor(null);e=n.mouseOver;null!==e&&(e(a),s=!0)}s&&n.requestUpdate(),n.skipsUndoManager=t}}doUpdateCursor(t){var e=this.diagram;e&&(e.currentCursor="")}doCurrentObjectChanged(t,e){}standardMouseWheel(){var s=this.diagram,n=s.lastInput;let a=n.delta;if(0!==a&&s.documentBounds.isReal()){var r=s.commandHandler,o=s.toolManager.mouseWheelBehavior;if(null!==r&&(2===o&&!n.shift||1===o&&n.control))(0i.doWaitAfter(s),t)}cancelWaitAfter(){-1!==this.Mm&&Kt.Gg(this.Mm),this.Mm=-1}doWaitAfter(t){}findToolHandleAt(t,e){t=this.diagram.findObjectAt(t,t=>{for(;null!==t&&!(t.panel instanceof K);)t=t.panel;return t});return null!==t&&t.part.category===e?t:null}isBeyondDragSize(t,e){var i=this.diagram,s=(void 0===t&&(t=i.firstInput.viewPoint),void 0===e&&(e=i.lastInput.viewPoint),i.toolManager.dragSize);let n=s.width,a=s.height;return i.firstInput.isTouchEvent&&(n+=6,a+=6),Math.abs(e.x-t.x)>n||Math.abs(e.y-t.y)>a}get name(){return this.Tt}set name(t){Kt.t(t,"string",J,"name"),this.Tt=t}get isEnabled(){return this.Xi}set isEnabled(t){Kt.t(t,"boolean",J,"isEnabled"),this.Xi=t}get isActive(){return this.tS}set isActive(t){Kt.t(t,"boolean",J,"isActive"),this.tS=t}get transactionResult(){return this.iS}set transactionResult(t){null!==t&&Kt.t(t,"string",J,"transactionResult"),this.iS=t}}(t={})[t.Scroll=1]="Scroll",t[t.Zoom=2]="Zoom",t[t.None=3]="None";var $=t,it=((t={})[t.Zoom=1]="Zoom",t[t.Cancel=2]="Cancel",t[t.None=3]="None",t);class st extends J{FC;RC;IC;nS;oS;rS;lS;hS;aS;fS;Nm;Gh;constructor(t){super(),this.name="ToolManager",this.FC=new O,this.RC=new O,this.IC=new O,this.nS=850,this.oS=850,this.rS=new Yt(2,2).rt(),this.lS=5e3,this.hS=1,this.aS=1,this.fS=null,this.Nm=null,this.Gh=-1,t&&Object.assign(this,t)}static WheelScroll=1;static WheelZoom=2;static WheelNone=3;static GestureZoom=1;static GestureCancel=2;static GestureNone=3;get mouseWheelBehavior(){return this.hS}set mouseWheelBehavior(t){Kt.it(t,$,"WheelMode"),this.hS=t}get gestureBehavior(){return this.aS}set gestureBehavior(t){Kt.it(t,it,"GestureMode"),this.aS=t}initializeStandardTools(){}updateAdornments(t){var e,i=this.currentToolTip;i instanceof K&&this.Nm===t&&(e=i.adornedObject,(null!==t?e.part===t:null===e)?this.showToolTip(i,e):this.hideToolTip())}doMouseDown(){var e=this.diagram,t=e.lastInput;if(t.isTouchEvent&&2===this.gestureBehavior&&(t.bubbles=!1),t.isMultiTouch){if(this.cancelWaitAfter(),3===this.gestureBehavior)return void(t.bubbles=!0);if(2===this.gestureBehavior)return;if(e.currentTool.canStartMultiTouch())return void e.currentTool.standardPinchZoomStart()}var i=e.undoManager,s=(Ht,i.bu&&0!==i.transactionLevel&&Kt.ft("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero"),this.mouseDownTools.length);for(let t=0;tn.hideToolTip(),s)}}positionToolTip(t,e){var i,s,n,a;t.hasPlaceholder()||(t=t,s=(i=this.diagram).lastInput.documentPoint.copy(),n=t.measuredBounds,a=i.viewportBounds,i.lastInput.isTouchEvent&&(s.x-=n.width),s.x+n.width>a.right&&(s.x-=n.width+5/i.scale),s.xa.bottom?s.y-=n.height+5/i.scale:s.y+=20/i.scale,s.yn&&(n=o),l>a&&(a=l)))}return i===1/0?e.e(0,0,0,0):e.e(i,s,n-i,a-s),e}AS(t){if(null===this.copiedParts){var e=this.diagram;if(!(t&&(e.isReadOnly||e.isModelReadOnly)||null===this.draggedParts)){for(var i=e.undoManager,i=(i.isEnabled&&i.isInTransaction?null!==i.currentTransaction&&0!this.tF(t))}doUpdateCursor(t){var e=this.diagram;null!==t&&this.Su===t||(!this.diagram.currentTool.isActive||this.mayCopy()?e.currentCursor=this.copyCursor:this.mayMove()?e.currentCursor=this.moveCursor:this.mayDragOut()&&(e.currentCursor=this.nodropCursor))}VC(e,i){let s=!1,n=this.Sr.length;var a=0s.findValidLinkablePort(t,e)),a=_.a();let r=1/0,o=null;for(var l=n.iterator;l.next();){var h,u=l.value;null!==u.part&&(h=u.getDocumentPoint(Z.Center,a),(h=t.distanceSquaredPoint(h))t.wn=!1)}if(this.doDropOnto(t,i),this.isActive||null!==d.St){for(var l=Q.a(),h=e.selection.iterator;h.next();){var u=h.value;u instanceof D&&this.eF(e,u,l)}Q.o(l)}}}iF(t,e){var i=this.diagram,e=e.part;!i.handlesDragDropForTopLevelParts||!e.isTopLevel||e instanceof X||null!==(e=i.mouseDrop)&&e(t)}eF(e,i,s){if(i.canAvoid()){let t=!1;s=i.getAvoidableRect(s),e.viewportBounds.containsRect(s)&&(t=!0);var n=this.copiedParts||this.draggedParts,e=e.IS(s,t=>t.part,t=>t instanceof Y,!0,t=>t instanceof Y,t);if(0!==e.count)for(var a=e.iterator;a.next();){var r=a.value;n.contains(r)&&n.contains(i)||!r.isMemberOf(i)&&r.isAvoiding&&r.invalidateRoute()}}}doDropOnto(t,e){}doMouseMove(){var t,e;this.isActive&&(e=(t=this.diagram).lastInput,this.simulatedMouseMove(e.event,e.documentPoint,e.targetDiagram)||null!==this.currentPart&&null!==this.draggedParts&&(this.mayCopy()?(this.AS(!1),t.qw(this.copiedParts),this.kf(this.copiedParts,!1),t.Lm(this.copiedParts)):this.mayMove()?(this.Ll(),this.kf(this.draggedParts,!0)):this.mayDragOut()?(this.AS(!1),this.kf(this.copiedParts,!1)):this.Ll(),this.TS(t.lastInput.documentPoint)))}doMouseUp(){if(this.isActive){var e=this.diagram,i=e.lastInput;if(!this.simulatedMouseUp(i.event,i.documentPoint,i.targetDiagram)){let t=!1;var s,i=this.mayCopy();i&&null!==this.copiedParts?(this.Ll(),this.AS(!0),e.qw(this.copiedParts),this.kf(this.copiedParts,!1),e.Lm(this.copiedParts),null!==this.copiedParts&&(e.V("ChangingSelection",e.selection),e.clearSelection(!0),this.copiedParts.iteratorKeys.each(t=>{t.isSelected=!0}))):(t=!0,this.Ll(),this.mayMove()&&(this.kf(this.draggedParts,!0),this.TS(e.lastInput.documentPoint))),this.ku=!0,this.KC(e.lastInput.documentPoint),this.isActive&&(s=(i?this.copiedParts:this.draggedParts).toKeySet(),this.copiedParts=null,t&&this.sF(),e.invalidateDocumentBounds(),e.Lm(this.draggedParts),this.transactionResult=i?"Copy":"Move",e.V(i?"SelectionCopied":"SelectionMoved",s)),this.stopTool(),i&&e.V("ChangedSelection",e.selection)}}}simulatedMouseMove(e,i,s){if(null===d.St)return!1;var t=d.St.diagram,n=(s instanceof G||(s=null),d.vh);if(s!==n&&(null!==n&&n!==t&&(n.stopAutoScroll(),d.St.isDragOutStarted=!1,null!==(n=n.toolManager.findTool("Dragging")))&&n.doSimulatedDragLeave(),null!==(d.vh=s)&&s!==t&&(d.St.BC(),null!==(n=s.toolManager.findTool("Dragging")))&&(n.UC(),n.doSimulatedDragEnter()),this.doUpdateCursor(null)),null===s||s===t||!s.allowDrop||s.isReadOnly||!s.allowInsert)return!1;n=s.toolManager.findTool("Dragging");if(null!==n){let t=i;null!==e&&(void 0!==e.targetTouches&&(0{t.isSelected=!0,s.add(t)})),this.KC(t.lastInput.documentPoint),t.invalidateDocumentBounds(),null!==this.copiedParts&&(this.transactionResult="ExternalCopy"),this.copiedParts=null,t.doFocus(),t.V("ExternalObjectsDropped",s,i),this.stopTransaction(),t.V("ChangedSelection",t.selection)}t.animationManager.Nu=!1}GC(t,e,i){if(null===this.copiedParts){var s=this.diagram;if(!s.isReadOnly&&!s.isModelReadOnly){s.skipsUndoManager=!e,s.partManager.addsToTemporaryLayer=!e,this.startPoint=i.documentPoint;for(var n=s.copyParts(t,s,!0),e=Q.a(),a=(this._D(t,e),e.x+e.width/2),r=e.y+e.height/2,o=(Q.o(e),this.Cm),l=new L,h=_.a(),u=t.iterator;u.next();){var d,c=u.value;c instanceof Y&&c.canCopy()&&null!==(d=n.getValue(c))&&(d.points=c.points,d.Mr(o.x-a,o.y-r),d.wn=!0,l.add(d,this.Us()))}for(var g=t.iterator;g.next();){var m,f=g.value;f.De()&&f.canCopy()&&null!==(m=n.getValue(f))&&(f=f.location,h.e(o.x-(a-f.x),o.y-(r-f.y)),m.location=h,m.ensureBounds(),l.add(m,this.Us(h)))}_.o(h),this.copiedParts=l,this.MS(l.toKeySet()),null!==this.draggedLink&&(s=(i=this.draggedLink).routeBounds,i.Mr(this.startPoint.x-(s.x+s.width/2),this.startPoint.y-(s.y+s.height/2))),this.doUpdateCursor(null)}}}$D(){this.isDragOutStarted=!0,this.ku=!1,d.St=this,d.vh=this.diagram,this.doSimulatedDragOut()}doSimulatedDragOut(){var t=this.diagram;t.Am=!1,this.mayCopy()||this.mayMove()?t.currentCursor="":t.currentCursor=this.nodropCursor,this.Su=null}computeMove(t,e,i,s){var n=this.diagram;return null!==n?n.computeMove(t,e,this.dragOptions,s):new _}static Ww=new O;static St=null;static vh=null}st.prototype.doCancel=function(){null!==d.St&&d.St.doCancel(),J.prototype.doCancel.call(this)};class nt extends J{OS;ES;Dl;VS;BS;qh;zS;Wh;XS;YS;KS;US;GS;HS;HC;vS;Fl;qS;constructor(){super(),this.OS=100,this.ES=!1,this.Dl="pointer",this.VS=new Y({layerName:"Tool"}).add(new q({isPanelMain:!0,stroke:"blue"}).theme("stroke","tempLink"),new q({toArrow:"Standard",fill:"blue",stroke:"blue"}).theme("fill","tempLink").theme("stroke","tempLink")).ui(),this.qh=new q("Rectangle",{portId:"",fill:null,stroke:"magenta",strokeWidth:2,desiredSize:Yt.Bk}).theme("stroke","tempPort"),this.BS=new D({selectable:!1,layerName:"Tool"}).add(this.qh).ui(),this.Wh=new q("Rectangle",{portId:"",fill:null,stroke:"magenta",strokeWidth:2,desiredSize:Yt.Bk}).theme("stroke","tempPort"),this.zS=new D({selectable:!1,layerName:"Tool"}).add(this.Wh).ui(),this.XS=null,this.YS=null,this.KS=null,this.US=null,this.GS=null,this.HS=!0,this.HC=new L,this.vS=null,this.Fl=null,this.qS=null}doStop(){this.diagram.stopAutoScroll(),this.originalLink=null,this.originalFromNode=null,this.originalFromPort=null,this.originalToNode=null,this.originalToPort=null,this.validPortsCache.clear(),this.targetPort=null}get portGravity(){return this.OS}set portGravity(t){Kt.t(t,"number",nt,"portGravity"),0<=t&&(this.OS=t)}get isUnconnectedLinkValid(){return this.ES}set isUnconnectedLinkValid(t){Kt.t(t,"boolean",nt,"isUnconnectedLinkValid"),this.ES=t}get linkingCursor(){return this.Dl}set linkingCursor(t){this.Dl=t}get temporaryLink(){return this.VS}set temporaryLink(t){Kt.s(t,Y,nt,"temporaryLink"),t.ui(),this.VS=t}get temporaryFromNode(){return this.BS}set temporaryFromNode(t){Kt.s(t,D,nt,"temporaryFromNode"),t.ui(),(this.BS=t)&&(this.qh=t.port)}get temporaryFromPort(){return this.qh}set temporaryFromPort(t){var e,i;Kt.s(t,y,nt,"temporaryFromPort"),null!==this.qh&&null!==(e=this.qh.panel)&&(i=e.F.indexOf(this.qh),e.removeAt(i),e.insertAt(i,t)),this.qh=t}get temporaryToNode(){return this.zS}set temporaryToNode(t){Kt.s(t,D,nt,"temporaryToNode"),t.ui(),(this.zS=t)&&(this.Wh=t.port)}get temporaryToPort(){return this.Wh}set temporaryToPort(t){var e,i;Kt.s(t,y,nt,"temporaryToPort"),null!==this.Wh&&null!==(e=this.Wh.panel)&&(i=e.F.indexOf(this.Wh),e.removeAt(i),e.insertAt(i,t)),this.Wh=t}get originalLink(){return this.XS}set originalLink(t){null!==t&&Kt.s(t,Y,nt,"originalLink"),this.XS=t}get originalFromNode(){return this.YS}set originalFromNode(t){null!==t&&Kt.s(t,D,nt,"originalFromNode"),this.YS=t}get originalFromPort(){return this.KS}set originalFromPort(t){null!==t&&Kt.s(t,y,nt,"originalFromPort"),this.KS=t}get originalToNode(){return this.US}set originalToNode(t){null!==t&&Kt.s(t,D,nt,"originalToNode"),this.US=t}get originalToPort(){return this.GS}set originalToPort(t){null!==t&&Kt.s(t,y,nt,"originalToPort"),this.GS=t}get isForwards(){return this.HS}set isForwards(t){this.HS=t}get validPortsCache(){return this.HC}get targetPort(){return this.vS}set targetPort(t){null!==t&&Kt.s(t,y,nt,"targetPort"),this.vS=t}copyPortProperties(t,e,i,s,n){var a,r;null!==t&&null!==e&&null!==i&&null!==s&&(r=e.getDocumentScale(),(a=Yt.a()).width=e.naturalBounds.width*r,a.height=e.naturalBounds.height*r,s.desiredSize=a,Yt.o(a),n?(s.toSpot=e.toSpot,s.toEndSegmentLength=e.toEndSegmentLength):(s.fromSpot=e.fromSpot,s.fromEndSegmentLength=e.fromEndSegmentLength),i.locationSpot=Z.Center,r=_.a(),i.location=e.getDocumentPoint(Z.Center,r),_.o(r),s.angle=e.getDocumentAngle(),null!==this.portTargeted)&&this.portTargeted(t,e,i,s,n)}setNoTargetPortProperties(t,e,i){null!==e&&(e.desiredSize=Yt.Bk,e.fromSpot=Z.None,e.toSpot=Z.None),null!==t&&(t.location=this.diagram.lastInput.documentPoint),null!==this.portTargeted&&this.portTargeted(null,null,t,e,i)}doMouseDown(){this.isActive&&this.doMouseMove()}doMouseMove(){var t,e;this.isActive&&(t=this.diagram,this.targetPort=this.findTargetPort(this.isForwards),null!==this.targetPort&&this.targetPort.part instanceof D?(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)):this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1),t.allowHorizontalScroll||t.allowVerticalScroll)&&t.doAutoScroll(t.lastInput.viewPoint)}findValidLinkablePort(t,e){if(null!==t){var i=t.part;if(i instanceof D)for(;null!==t;){var s=e?t.toLinkable:t.fromLinkable;if(!0===s&&(null!==t.portId||t instanceof D)&&(e?this.isValidTo(i,t):this.isValidFrom(i,t)))return t;if(!1===s)return null;t=t.panel}}return null}findTargetPort(e){var t=this.diagram,i=t.lastInput.documentPoint;let s=this.portGravity;s<=0&&(s=.1);const n=this,a=t.findObjectsNear(i,s,t=>n.findValidLinkablePort(t,e),null,!0);let r=1/0,o=null;for(var l=a.iterator;l.next();){var h,u,d,c=l.value,g=c.part;g instanceof D&&(u=c.getDocumentPoint(Z.Center,_.a()),d=i.x-u.x,h=i.y-u.y,_.o(u),(u=d*d+h*h)=s)return!1}return!0}isValidTo(e,i){if(null===e||null===i)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==e.layer&&!e.layer.allowLink||!0!==i.toLinkable))return!1;var s=i.toMaxLinks;if(s<1/0){if(null!==this.originalLink&&e===this.originalToNode&&i===this.originalToPort)return!0;let t=i.portId;if(null===t&&(t=""),e.findLinksInto(t).count>=s)return!1}return!0}isInSameNode(t,e){return null!==t&&null!==e&&(t===e||(t=t.part,e=e.part,null!==t&&t===e))}isLinked(i,s){if(null!==i&&null!==s){var n=i.part;if(n instanceof D){let e=i.portId;null===e&&(e="");i=s.part;if(i instanceof D){let t=s.portId;null===t&&(t="");for(var a=i.findLinksInto(t);a.next();){var r=a.value;if(r.fromNode===n&&r.fromPortId===e)return!0}}}}return!1}isValidLink(t,e,i,s){if(!this.isValidFrom(t,e)||!this.isValidTo(i,s)||null!==e&&null!==s&&((!e.fromLinkableSelfNode||!s.toLinkableSelfNode)&&this.isInSameNode(e,s)||(!e.fromLinkableDuplicates||!s.toLinkableDuplicates)&&this.isLinked(e,s))||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;let n;return!(null!==t&&null!==(n=t.linkValidation)&&!n(t,e,i,s,this.originalLink)||null!==i&&null!==(n=i.linkValidation)&&!n(t,e,i,s,this.originalLink))&&(null===(n=this.linkValidation)||n(t,e,i,s,this.originalLink))}isLabelDependentOnLink(t,e){var i,s;return null!==t&&null!==(i=t.labeledLink)&&(i===e||((s=new N).add(t),this.WS(i,e,s)))}WS(t,e,i){var s;return t===e||!(null===(s=t.fromNode)||!s.isLinkLabel||(i.add(s),!this.WS(s.labeledLink,e,i)))||!(null===(s=t.toNode)||!s.isLinkLabel||(i.add(s),!this.WS(s.labeledLink,e,i)))}isValidCycle(t,e,i){if(void 0===i&&(i=null),null===t||null===e)return this.isUnconnectedLinkValid;var s=this.diagram.validCycle;if(1===s)return!0;if(5===s){var n=i||this.temporaryLink;if(null!==n&&!n.isTreeLink)return!0;for(var a=e.linksConnected;a.next();){var r=a.value;if(r!==i&&r.isTreeLink&&r.toNode===e)return!1}}else{if(6!==s)return 2===s?!this.nF(t,e,i):3===s?!this.Cu(t,e,i,!1):4!==s||!this.oF(t,e,i);n=i||this.temporaryLink;if(null!==n&&!n.isTreeLink)return!0;for(var o=t.linksConnected;o.next();){var l=o.value;if(l!==i&&l.isTreeLink&&l.fromNode===t)return!1}}return!this.Cu(t,e,i,!0)}Cu(t,e,i,s){if(t===e)return!0;if(null!==t&&null!==e)for(var n=t.linksConnected;n.next();){var a=n.value;if(a!==i&&(!s||a.isTreeLink)&&a.toNode===t){a=a.fromNode;if(a!==t&&this.Cu(a,e,i,s))return!0}}return!1}nF(t,e,i){var s;return t===e||((s=new N).add(e),this.vC(s,t,e,i))}vC(t,e,i,s){if(e===i)return!0;if(null!==e&&null!==i&&!t.contains(e)){t.add(e);for(var n=e.linksConnected;n.next();){var a=n.value;if(a!==s&&a.toNode===e){a=a.fromNode;if(a!==e&&this.vC(t,a,i,s))return!0}}}return!1}oF(t,e,i){var s;return t===e||((s=new N).add(e),this.qC(s,t,e,i))}qC(t,e,i,s){if(e===i)return!0;if(null!==e&&null!==i&&!t.contains(e)){t.add(e);for(var n=e.linksConnected;n.next();){var a=n.value;if(a!==s){var r=a.fromNode,a=a.toNode,a=r===e?a:r;if(a!==e&&this.qC(t,a,i,s))return!0}}}return!1}get linkValidation(){return this.Fl}set linkValidation(t){null!==t&&Kt.t(t,"function",nt,"linkValidation"),this.Fl=t}get portTargeted(){return this.qS}set portTargeted(t){null!==t&&Kt.t(t,"function",nt,"portTargeted"),this.qS=t}}(t={})[t.Either=1]="Either",t[t.ForwardsOnly=2]="ForwardsOnly",t[t.BackwardsOnly=3]="BackwardsOnly";var at=t;class rt extends nt{jS;JS;C;ZS;constructor(t){super(),this.name="Linking",this.jS={},this.JS=null,this.C=1,this.ZS=null,t&&Object.assign(this,t)}static Either=1;static ForwardsOnly=2;static BackwardsOnly=3;get archetypeLinkData(){return this.jS}set archetypeLinkData(t){null!==t&&Kt.t(t,"object",rt,"archetypeLinkData"),t instanceof y&&Kt.s(t,Y,rt,"archetypeLinkData"),this.jS=t}get archetypeLabelNodeData(){return this.JS}set archetypeLabelNodeData(t){null!==t&&Kt.t(t,"object",rt,"archetypeLabelNodeData"),t instanceof y&&Kt.s(t,D,rt,"archetypeLabelNodeData"),this.JS=t}get direction(){return this.C}set direction(t){Kt.it(t,at,"LinkingDirection"),this.C=t}get startObject(){return this.ZS}set startObject(t){null!==t&&Kt.s(t,y,rt,"startObject"),this.ZS=t}canStart(){var t;return!(!this.isEnabled||(t=this.diagram).isReadOnly||t.isModelReadOnly||!t.allowLink||!t.model.jw()||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize()||null===this.findLinkablePort())}findLinkablePort(){var t=this.diagram;let e=this.startObject;if(null!==(e=null===e?t.findObjectAt(t.firstInput.documentPoint,null,null):e)){t=e.part;if(t instanceof D){var i=this.direction;if(1===i||2===i){var s=this.findValidLinkablePort(e,!1);if(null!==s)return this.isForwards=!0,s;if(this.startObject===t){s=t.port;if(this.findValidLinkablePort(s,!1))return this.isForwards=!0,s}}if(1===i||3===i){s=this.findValidLinkablePort(e,!0);if(null!==s)return this.isForwards=!1,s;if(this.startObject===t){i=t.port;if(this.findValidLinkablePort(i,!0))return this.isForwards=!1,i}}}}return null}doActivate(){var t,e=this.diagram,i=this.findLinkablePort();null===i?this.stopTool():(this.startTransaction(this.name),e.isMouseCaptured=!0,e.currentCursor=this.linkingCursor,this.isForwards?(null!==this.temporaryToNode&&(this.temporaryToNode.location=e.lastInput.documentPoint),this.originalFromPort=i,(t=this.originalFromPort.part)instanceof D&&(this.originalFromNode=t),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(null!==this.temporaryFromNode&&(this.temporaryFromNode.location=e.lastInput.documentPoint),this.originalToPort=i,(t=this.originalToPort.part)instanceof D&&(this.originalToNode=t),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),e.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.ensureBounds(),e.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.ensureBounds(),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.invalidateRoute(),e.add(this.temporaryLink)),this.isActive=!0)}doDeactivate(){this.isActive=!1;var t=this.diagram;t.remove(this.temporaryLink),t.remove(this.temporaryFromNode),t.remove(this.temporaryToNode),t.isMouseCaptured=!1,t.currentCursor="",this.stopTransaction()}doStop(){super.doStop(),this.startObject=null}doMouseUp(){if(this.isActive){var a=this.diagram;let t=this.transactionResult=null,e=null,i=null,s=null,n=null;try{this.targetPort=this.findTargetPort(this.isForwards);var r,o=this.targetPort;null!==o?(r=o.part)instanceof D&&(this.isForwards?(null!==this.originalFromNode&&(t=this.originalFromNode,e=this.originalFromPort),i=r,s=o):(t=r,e=o,null!==this.originalToNode&&(i=this.originalToNode,s=this.originalToPort))):this.isForwards?null!==this.originalFromNode&&this.isUnconnectedLinkValid&&(t=this.originalFromNode,e=this.originalFromPort):null!==this.originalToNode&&this.isUnconnectedLinkValid&&(i=this.originalToNode,s=this.originalToPort),null!==t||null!==i?null!==(n=this.insertLink(t,e,i,s))?(null===o&&(this.isForwards?n.defaultToPoint=a.lastInput.documentPoint:n.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.V("ChangingSelection",a.selection),a.clearSelection(!0),n.isSelected=!0),this.transactionResult=this.name,a.V("LinkDrawn",n)):this.doNoLink(t,e,i,s):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),n&&a.allowSelect&&a.V("ChangedSelection",a.selection)}}}isNewTreeLink(){var t,e=this.archetypeLinkData;return null===e||(e instanceof Y?e.isTreeLink:null===(t=this.diagram)||(e=t.partManager.getLinkCategoryForData(e),null===(t=t.partManager.findLinkTemplateForCategory(e)))||t.isTreeLink)}insertLink(t,e,i,s){return this.diagram.partManager.insertLink(t,e,i,s)}doNoLink(t,e,i,s){}}class ot extends nt{$S;QS;ws;_S;constructor(t){super(),this.name="Relinking",this.$S=new q("Diamond",{desiredSize:Yt.du,fill:"lightblue",stroke:"dodgerblue",cursor:this.linkingCursor,segmentIndex:0}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.QS=new q("Diamond",{desiredSize:Yt.du,fill:"lightblue",stroke:"dodgerblue",cursor:this.linkingCursor,segmentIndex:-1}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.ws=null,this._S=new Q,t&&Object.assign(this,t)}updateAdornments(i){if(null!==i&&i instanceof Y){let t="RelinkFrom",e=null;var s;i.isSelected&&!this.diagram.isReadOnly&&null!==(s=i.selectionObject)&&i.canRelinkFrom()&&i.actualBounds.isReal()&&i.isVisible()&&s.actualBounds.isReal()&&s.isVisibleObject()&&null===(e=i.findAdornment(t))&&(e=this.makeAdornment(s,!1),i.addAdornment(t,e)),null===e&&i.removeAdornment(t),t="RelinkTo",e=null,i.isSelected&&!this.diagram.isReadOnly&&null!==(s=i.selectionObject)&&i.canRelinkTo()&&i.actualBounds.isReal()&&i.isVisible()&&s.actualBounds.isReal()&&s.isVisibleObject()&&(null===(e=i.findAdornment(t))?(e=this.makeAdornment(s,!0),i.addAdornment(t,e)):e.u()),null===e&&i.removeAdornment(t)}}makeAdornment(t,e){var i=new K,e=(i.type=Xt.Link,e?this.toHandleArchetype:this.fromHandleArchetype);return null!==e&&i.add(e.copy().Tm()),i.adornedObject=t,i}get fromHandleArchetype(){return this.$S}set fromHandleArchetype(t){null!==t&&Kt.s(t,y,ot,"fromHandleArchetype"),this.$S=t}get toHandleArchetype(){return this.QS}set toHandleArchetype(t){null!==t&&Kt.s(t,y,ot,"toHandleArchetype"),this.QS=t}get handle(){return this.ws}set handle(t){if(null!==t&&(Kt.s(t,y,ot,"handle"),!(t.part instanceof K)))throw new Error("new handle is not in an Adornment: "+t);this.ws=t}canStart(){if(!this.isEnabled)return!1;var t=this.diagram;if(t.isReadOnly||t.isModelReadOnly||!t.allowRelink||!t.model.jw()||!t.lastInput.left)return!1;let e=this.findToolHandleAt(t.firstInput.documentPoint,"RelinkFrom");return null!==(e=null===e?this.findToolHandleAt(t.firstInput.documentPoint,"RelinkTo"):e)}doActivate(){var e=this.diagram;if(null===this.originalLink){let t=this.handle;if(null===(t=null===t&&null===(t=this.findToolHandleAt(e.firstInput.documentPoint,"RelinkFrom"))?this.findToolHandleAt(e.firstInput.documentPoint,"RelinkTo"):t))return;var i=t.part;if(!(i instanceof K&&i.adornedPart instanceof Y))return;this.handle=t,this.isForwards=null===i||"RelinkTo"===i.category,this.originalLink=i.adornedPart}this.startTransaction(this.name),e.isMouseCaptured=!0,e.currentCursor=this.linkingCursor,this.originalFromPort=this.originalLink.fromPort,this.originalFromNode=this.originalLink.fromNode,this.originalToPort=this.originalLink.toPort,this.originalToNode=this.originalLink.toNode,this._S.set(this.originalLink.actualBounds),null!==this.originalLink&&0t.firstPickIndex+1&&et.width&&(t.width=e.width),!isNaN(e.height)&&e.height>t.height&&(t.height=e.height),t}computeMaxSize(){var t=this.adornedObject.maxSize.copy(),e=this.maxSize;return!isNaN(e.width)&&e.widtht-i&&(e=(Math.floor(e/t)+1)*t)),360<=e?e-=360:e<0&&(e+=360),e}get snapAngleMultiple(){return this.hM}set snapAngleMultiple(t){Kt.t(t,"number",ut,"snapAngleMultiple"),this.hM=t}get snapAngleEpsilon(){return this.aM}set snapAngleEpsilon(t){Kt.t(t,"number",ut,"snapAngleEpsilon"),this.aM=t}get originalAngle(){return this.fM}get rotationPoint(){return this.Rm}set rotationPoint(t){this.Rm=t.copy()}get handleAngle(){return this.cM}set handleAngle(t){Kt.t(t,"number",ut,"handleAngle"),this.cM=t}get handleDistance(){return this.uM}set handleDistance(t){Kt.t(t,"number",ut,"handleDistance"),this.uM=t}}class dt extends J{constructor(t){super(),this.name="ClickSelecting",t&&Object.assign(this,t)}canStart(){return!(!this.isEnabled||this.isBeyondDragSize())}doMouseUp(){this.isActive&&(this.standardMouseSelect(),this.standardMouseClick()||this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()}}class ct extends J{Pf;constructor(t){super(),this.name="Action",this.Pf=null,t&&Object.assign(this,t)}canStart(){var t,e,i;return!(!this.isEnabled||(e=(t=this.diagram).lastInput,null===(i=t.findObjectAt(e.documentPoint,t=>{for(;null!==t.panel;){if(t.isActionable)return t;t=t.panel}return t})))||!i.isActionable||(this.Pf=i,t.wf=t.findObjectAt(e.documentPoint,null,null),0))}doMouseDown(){var t,e;this.isActive?(t=this.diagram.lastInput,null!==(e=this.Pf)&&null!==(t.targetObject=e).actionDown&&e.actionDown(t,e)):this.canStart()&&this.doActivate()}doMouseMove(){var t,e;this.isActive&&(t=this.diagram.lastInput,null!==(e=this.Pf))&&null!==(t.targetObject=e).actionMove&&e.actionMove(t,e)}doMouseUp(){if(this.isActive){const t=this.diagram.lastInput,e=this.Pf;if(null===e)return;null!==(t.targetObject=e).actionUp&&e.actionUp(t,e),this.standardMouseClick(t=>{for(;null!==t.panel;){if(t.isActionable&&t===e)return t;t=t.panel}return t},t=>t===e)}this.stopTool()}doCancel(){var t=this.diagram.lastInput,e=this.Pf;null!==e&&(null!==(t.targetObject=e).actionCancel&&e.actionCancel(t,e),this.stopTool())}doStop(){this.Pf=null}}class gt extends J{Ol;dM;Sf;gM;constructor(t){super(),this.name="ClickCreating",this.Ol=null,this.dM=!0,this.Sf=!1,this.gM=new _(0,0),t&&Object.assign(this,t)}canStart(){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.gM=t.lastInput.viewPoint.copy()),2!==t.lastInput.clickCount||this.isBeyondDragSize(this.gM))return!1}else if(1!==t.lastInput.clickCount)return!1;return!(t.currentTool!==this&&null!==t.findPartAt(t.lastInput.documentPoint,!0))}doMouseUp(){var t=this.diagram;this.isActive&&this.insertPart(t.lastInput.documentPoint),this.stopTool()}insertPart(t){var e,i,s=this.diagram,n=this.archetypeNodeData;if(null===n)return null;let a=null;try{s.V("ChangingSelection",s.selection),this.startTransaction(this.name),n instanceof H?n.De()&&(n.ui(),null!==(a=n.copy()))&&s.add(a):null!==n&&(e=s.model.copyNodeData(n),Kt.Mt(e))&&(s.model.addNodeData(e),a=s.findPartForData(e)),null!==a&&(i=_.H(t.x,t.y),this.isGridSnapEnabled&&this.diagram.mM(a,t,i),a.location=i,s.allowSelect&&(s.clearSelection(!0),a.isSelected=!0),_.o(i)),s.invalidateDocumentBounds(),this.transactionResult=this.name,s.V("PartCreated",a)}finally{this.stopTransaction(),s.V("ChangedSelection",s.selection)}return a}get archetypeNodeData(){return this.Ol}set archetypeNodeData(t){null!==t&&Kt.t(t,"object",gt,"archetypeNodeData"),this.Ol=t}get isDoubleClick(){return this.dM}set isDoubleClick(t){Kt.t(t,"boolean",gt,"isDoubleClick"),this.dM=t}get isGridSnapEnabled(){return this.Sf}set isGridSnapEnabled(t){Kt.t(t,"boolean",gt,"isGridSnapEnabled"),this.Sf=t}}class mt extends J{Hh;pM;El;constructor(t){super(),this.name="DragSelecting",this.Hh=175,this.pM=!1,this.El=new H({layerName:"Tool",selectable:!1}).add(new q("Rectangle",{name:"SHAPE",fill:null,stroke:"magenta"}).theme("stroke","dragSelect")).ui(),t&&Object.assign(this,t)}canStart(){var t,e;return!!this.isEnabled&&!!(t=this.diagram).allowSelect&&!(!(e=t.lastInput).left||t.currentTool!==this&&(!this.isBeyondDragSize()||e.timestamp-t.firstInput.timestamp{var t=e.diagram;null!==t&&t.Ti(v.document,"scroll",e.yM,!1),e.stopTool()},t&&Object.assign(this,t)}canStart(){var t;return!!this.isEnabled&&!(!(t=this.diagram).allowHorizontalScroll&&!t.allowVerticalScroll||!t.lastInput.left||t.currentTool!==this&&!this.isBeyondDragSize())}doActivate(){var t=this.diagram;this.Ro?(t.lastInput.bubbles=!0,t.Ht(v.document,"scroll",this.yM,!1)):(t.currentCursor="move",t.isMouseCaptured=!0,this._w.c(t.position)),this.isActive=!0}doDeactivate(){var t=this.diagram;t.currentCursor="",t.isMouseCaptured=!1,this.isActive=!1}doCancel(){var t=this.diagram;t.position=this._w,t.isMouseCaptured=!1,this.stopTool()}doMouseMove(){this.jC()}doMouseUp(){this.jC(),this.stopTool()}jC(){var i=this.diagram;if(this.isActive&&i)if(this.Ro)i.lastInput.bubbles=!0;else{var s=i.position,n=i.firstInput.documentPoint,a=i.lastInput.documentPoint;let t=s.x+n.x-a.x,e=s.y+n.y-a.y;i.allowHorizontalScroll||(t=s.x),i.allowVerticalScroll||(e=s.y),i.position=this.WC.e(t,e)}}get bubbles(){return this.Ro}set bubbles(t){Kt.t(t,"boolean",ft,"bubbles"),this.Ro=t}get originalPosition(){return this._w}}class pt{tx;ix;wM;xM;constructor(t){this.tx=null,this.ix=null,this.wM=null,this.xM=null,t&&Object.assign(this,t)}get mainElement(){return this.wM}set mainElement(t){null!==t&&Kt.s(t,HTMLElement,pt,"mainElement"),this.wM=t}get show(){return this.tx}set show(t){this.tx!==t&&(null!==t&&Kt.t(t,"function",pt,"show"),this.tx=t)}get hide(){return this.ix}set hide(t){this.ix!==t&&(null!==t&&Kt.t(t,"function",pt,"hide"),this.ix=t)}get valueFunction(){return this.xM}set valueFunction(t){this.xM=t}}class vt{di;Im;Cf;constructor(t,e,i){this.di=t,this.Im=e,this.Cf=i}}class yt extends J{bM;ex;kM;SM;sx;nx;ox;constructor(t){super(),this.name="ContextMenu",this.bM=null,this.ex=null,this.kM=null,this.SM=new _,this.sx=null,this.ox=!1;const e=this;this.nx=()=>e.stopTool(),t&&Object.assign(this,t)}lF(){var t=new pt;t.show=(t,e,i)=>i.showDefaultContextMenu(),t.hide=(t,e)=>e.hideDefaultContextMenu(),yt.Au=t;const e=this;this.nx=()=>e.stopTool();var t=Kt.hn("div"),i=Kt.hn("div"),s=(t.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;",Kt.hn("style")),s=(v.document.getElementsByTagName("head")[0].appendChild(s),s.sheet.insertRule(".goCXul { list-style: none; }",0),s.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),s.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),this.diagram);null!==s&&(s.Ht(t,"contextmenu",yt.jh,!1),s.Ht(t,"selectstart",yt.jh,!1),s.Ht(i,"contextmenu",yt.jh,!1)),t.className="goCXforeground",i.className="goCXbackground",v.document.body&&(v.document.body.appendChild(t),v.document.body.appendChild(i)),yt.Om=t,yt.Em=i,yt.MM=!0}static Au=null;static MM=!1;static Em=null;static Om=null;static jh(t){return t.preventDefault(),!1}canStart(){var t;return!(!this.isEnabled||(t=this.diagram,this.isBeyondDragSize())||!t.lastInput.right||1!t.layer.isTemporary))){let t=s;for(;null!==t;){if(null!==t.contextMenu)return t;t=t.panel}if(e.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return s.part}else if(null!==e.contextMenu)return e;return null}doActivate(){}doMouseDown(){var t;super.doMouseDown(),this.isActive&&this.currentContextMenu instanceof K&&null!==(t=this.diagram.toolManager.findTool("Action"))&&t.canStart()&&(t.doActivate(),t.doMouseDown(),t.doDeactivate()),this.diagram.toolManager.mouseDownTools.contains(this)&&this.doContextClick()}doMouseUp(){var t;this.isActive&&this.currentContextMenu instanceof K&&null!==(t=this.diagram.toolManager.findTool("Action"))&&t.canStart()&&(t.doActivate(),t.doCancel(),t.doDeactivate()),this.doContextClick()}doContextClick(){var e=this.diagram;if(this.isActive){var i=this.currentContextMenu;if(null!==i){let t=null;i instanceof pt||null!==(t=e.findObjectAt(e.lastInput.documentPoint,null,null))&&t.isContainedBy(i)&&this.standardMouseClick(null,null),this.maybeStopTool(t)}}else this.canStart()&&(this.openMenu(!0),this.isActive||this.stopTool())}maybeStopTool(t){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this).doMouseUp()}openMenu(t,e){var i;void 0===e&&(e=null),this.ox||(this.ox=!0,t&&this.standardMouseSelect(),t=this.standardMouseClick(),this.ox=!1,t)||(this.isActive=!0,t=yt.Au,null!==(e=null===e?this.findObjectWithContextMenu():e)?null!==(i=e.contextMenu)?(this.currentObject=e instanceof y?e:null,this.showContextMenu(i,this.currentObject)):null!==t&&this.showContextMenu(t,this.currentObject):null!==t&&this.showContextMenu(t,null),this.currentContextMenu instanceof K&&!this.currentContextMenu.visible&&this.stopTool())}doMouseMove(){var t=this.diagram.toolManager.findTool("Action");null!==t&&t.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()}showContextMenu(t,e){Ht,t instanceof K||t instanceof pt||Kt.n("showContextMenu:contextMenu must be an Adornment or HTMLInfo."),null!==e&&Kt.s(e,y,yt,"showContextMenu:obj");var i,s,n=this.diagram;t!==this.currentContextMenu&&this.hideContextMenu(),t instanceof K?((i=t).layerName="Tool",i.selectable=!1,i.scale=1/n.scale,i.category=this.name,i.hasPlaceholder()&&(i.placeholder.scale=n.scale),null!==(s=i.diagram)&&s!==n&&s.remove(i),n.add(i),null!==e?i.adornedObject=e:i.data=n.model,i.ensureBounds(),this.positionContextMenu(i,e)):t instanceof pt&&t.show(e,n,this),this.currentContextMenu=t}positionContextMenu(t,e){var i,s,n,a;t.hasPlaceholder()||(t=t,s=(i=this.diagram).lastInput.documentPoint.copy(),n=t.measuredBounds,a=i.viewportBounds,i.lastInput.isTouchEvent&&(s.x-=n.width),s.x+n.width>a.right&&(s.x-=n.width+5/i.scale),s.xa.bottom&&(s.y-=n.height+5/i.scale),s.yt.commandHandler.copySelection(),t=>t.commandHandler.canCopySelection())),t.add(new vt("Cut",t=>t.commandHandler.cutSelection(),t=>t.commandHandler.canCutSelection())),t.add(new vt("Delete",t=>t.commandHandler.deleteSelection(),t=>t.commandHandler.canDeleteSelection())),t.add(new vt("Paste",t=>t.commandHandler.pasteSelection(e.mouseDownPoint),t=>t.commandHandler.canPasteSelection(e.mouseDownPoint))),t.add(new vt("Select All",t=>t.commandHandler.selectAll(),t=>t.commandHandler.canSelectAll())),t.add(new vt("Undo",t=>t.commandHandler.undo(),t=>t.commandHandler.canUndo())),t.add(new vt("Redo",t=>t.commandHandler.redo(),t=>t.commandHandler.canRedo())),t.add(new vt("Scroll To Part",t=>t.commandHandler.scrollToPart(),t=>t.commandHandler.canScrollToPart())),t.add(new vt("Zoom To Fit",t=>t.commandHandler.zoomToFit(),t=>t.commandHandler.canZoomToFit())),t.add(new vt("Reset Zoom",t=>t.commandHandler.resetZoom(),t=>t.commandHandler.canResetZoom())),t.add(new vt("Group Selection",t=>t.commandHandler.groupSelection(),t=>t.commandHandler.canGroupSelection())),t.add(new vt("Ungroup Selection",t=>t.commandHandler.ungroupSelection(),t=>t.commandHandler.canUngroupSelection())),t.add(new vt("Edit Text",t=>t.commandHandler.editTextBlock(),t=>t.commandHandler.canEditTextBlock())),t}showDefaultContextMenu(){const e=this.diagram,i=(null===this.sx&&(this.sx=this.hF()),yt.Om.innerHTML="",yt.Em.addEventListener("pointerdown",this.nx,!1),this),t=Kt.hn("ul");t.className="goCXul",yt.Om.appendChild(t),t.innerHTML="";for(var s=this.sx.iterator;s.next();){var n=s.value,a=n.Im,r=n.Cf;"function"!=typeof a||"function"==typeof r&&!r(e)||((a=Kt.hn("li")).className="goCXli",(r=Kt.hn("a")).className="goCXa",r.href="#",r.Im=n.Im,r.addEventListener("pointerdown",function(t){return this.Im(e),i.stopTool(),t.preventDefault(),!1},!1),r.textContent=n.di,a.appendChild(r),t.appendChild(a))}yt.Om.style.display="block",yt.Em.style.display="block"}hideDefaultContextMenu(){var t;null!==this.currentContextMenu&&this.currentContextMenu===yt.Au&&(yt.Om.style.display="none",yt.Em.style.display="none",null!==(t=this.diagram)&&t.Ti(yt.Em,"pointerdown",this.nx,!1),this.currentContextMenu=null)}get currentContextMenu(){return this.bM}set currentContextMenu(t){Ht,null===t||(t instanceof K||t instanceof pt)||Kt.n("ContextMenuTool.currentContextMenu must be an Adornment or HTMLInfo."),this.bM=t,this.ex=t instanceof K?t.adornedPart:null}get defaultTouchContextMenu(){return!1===yt.MM&&null===yt.Au&&G.isUsingDOM()&&this.lF(),yt.Au}set defaultTouchContextMenu(t){Ht,null===t||(t instanceof K||t instanceof pt)||Kt.n("ContextMenuTool.defaultTouchContextMenu must be an Adornment or HTMLInfo."),null===t&&(yt.MM=!0),yt.Au=t}get currentObject(){return this.kM}set currentObject(t){null!==t&&Kt.s(t,y,yt,"currentObject"),this.kM=t}get mouseDownPoint(){return this.SM}}(bt={})[bt.LostFocus=1]="LostFocus",bt[bt.MouseDown=2]="MouseDown",bt[bt.Tab=3]="Tab",bt[bt.Enter=4]="Enter";(e={})[e.SingleClick=1]="SingleClick",e[e.SingleClickSelected=2]="SingleClickSelected",e[e.DoubleClick=3]="DoubleClick";var bt,xt=e,wt=((e={})[e.None=1]="None",e[e.Active=2]="Active",e[e.Editing=3]="Editing",e[e.Validating=4]="Validating",e[e.Invalid=5]="Invalid",e[e.Validated=6]="Validated",e);class At extends J{Fe;PM;NM;Vl;jt;CM;AM;LM;rx;lx;constructor(t){super(),this.name="TextEditing",this.Fe=new j,this.PM=null,this.NM=2,this.Vl=null,this.jt=1,this.CM=1,this.AM=!0,this.LM=null,this.rx=new pt,this.lx=null,this.aF(this.rx),t&&Object.assign(this,t)}static LostFocus=1;static MouseDown=2;static Tab=3;static Enter=4;static SingleClick=1;static SingleClickSelected=2;static DoubleClick=3;static StateNone=1;static StateActive=2;static StateEditing=3;static StateValidating=4;static StateInvalid=5;static StateValidated=6;aF(t){if(G.isUsingDOM()){const u=Kt.hn("textarea"),s=(this.lx=u,this);u.addEventListener("input",function(t){var e,i;null!==s.textBlock&&(e=s.measureTemporaryTextBlock(this.value),i=this.textScale,this.style.width=20+Math.max(s.textBlock.measuredBounds.width,e.measuredBounds.width)*i+"px",this.rows=Math.max(s.textBlock.lineCount,e.lineCount))},!1),u.addEventListener("keydown",function(t){var e;t.isComposing||null===s.textBlock||("Enter"===(e=t.key)?(!1===s.textBlock.isMultiline&&t.preventDefault(),s.acceptText(4)):"Tab"===e?(s.acceptText(3),t.preventDefault()):"Escape"===e&&(s.doCancel(),null!==s.diagram)&&s.diagram.doFocus())},!1),u.addEventListener("focus",function(t){s.fF(t)},!1),u.addEventListener("blur",function(t){s.cF(t)},!1),t.valueFunction=()=>u.value,t.mainElement=u,t.show=(e,i,s)=>{if(e instanceof j&&s instanceof At)if(5===s.state)u.style.border="3px solid red",u.focus();else{var n=e.getDocumentPoint(Z.Center),a=i.position,r=i.scale;let t=e.getDocumentScale()*r;t{t.div.removeChild(u)}}}get textBlock(){return this.PM}set textBlock(t){null!==t&&Kt.s(t,j,At,"textBlock"),this.PM=t}get currentTextEditor(){return this.LM}set currentTextEditor(t){this.LM=t}get defaultTextEditor(){return this.rx}set defaultTextEditor(t){Ht,t instanceof pt||Kt.n("TextEditingTool.defaultTextEditor must be an HTMLInfo."),this.rx=t}get starting(){return this.NM}set starting(t){Kt.it(t,xt,"TextEditingStarting"),this.NM=t}canStart(){var t,e;return!!this.isEnabled&&!(null===(t=this.diagram)||t.isReadOnly||At.Af&&At.Af!==this&&(At.Af.acceptText(2),At.Af)&&At.Af!==this||!t.lastInput.left||this.isBeyondDragSize()||(e=t.lastInput.documentPoint,!(null!==(e=t.findObjectAt(e))&&e instanceof j&&e.editable&&e.part.canEdit()))||null===(e=e.part)||2===this.starting&&!e.isSelected||3===this.starting&&t.lastInput.clickCount<2)}doStart(){null!==(At.Af=this).textBlock&&this.doActivate()}doActivate(){if(!this.isActive){var i=this.diagram;if(null!==i){let e=this.textBlock;if(null!==(e=null===e?i.findObjectAt(i.lastInput.documentPoint):e)&&e instanceof j&&null!==(this.textBlock=e).part){i.animationManager.stopAnimation(),this.isActive=!0,this.jt=2;let t=this.defaultTextEditor;null!==e.textEditor&&(t=e.textEditor),this.Fe=this.textBlock.copy();var s=new Q(this.textBlock.getDocumentPoint(Z.TopLeft),this.textBlock.getDocumentPoint(Z.BottomRight));i.scrollToRect(s),t.show(e,i,this),this.currentTextEditor=t}}}}doCancel(){this.stopTool()}doMouseUp(){this.canStart()&&this.doActivate()}doMouseDown(){this.isActive&&this.acceptText(2)}acceptText(t){switch(t){case 2:6===this.jt?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():2!==this.jt&&5!==this.jt&&3!==this.jt||(this.jt=4,this.JC());break;case 1:case 4:case 3:4===t&&!0===this.textBlock.isMultiline||2!==this.jt&&5!==this.jt&&3!==this.jt||(this.jt=4,this.JC())}}JC(){var e=this.textBlock,i=this.diagram,s=this.currentTextEditor;if(null!==e&&null!==s){var n=e.text;let t="";(null!==s.valueFunction&&(t=s.valueFunction()),this.isValidText(e,n,t))?(this.startTransaction(this.name),this.jt=6,this.transactionResult=this.name,e.text=t,this.doSuccess(n,t),null!==i&&i.V("TextEdited",e,n),this.stopTransaction(),this.stopTool(),null!==i&&i.doFocus()):(this.jt=5,this.doError(n,t))}}doError(t,e){var i=this.textBlock,t=(null!==i.errorFunction&&i.errorFunction(this,t,e),this.currentTextEditor);t&&t.show(i,this.diagram,this)}doSuccess(t,e){var i=this.textBlock;null!==i.textEdited&&i.textEdited(i,t,e)}doDeactivate(){var t=this.diagram;null!==t&&(this.jt=1,null!==this.currentTextEditor&&this.currentTextEditor.hide(t,this),this.textBlock=null,this.isActive=!1)}doStop(){At.Af=null}fF(t){var e;null!==this.currentTextEditor&&1!==this.state&&(e=this.lx,2===this.jt&&(this.jt=3),"function"==typeof e.select)&&this.selectsTextOnActivate&&(e.select(),e.setSelectionRange(0,9999))}cF(t){var e;null!==this.currentTextEditor&&1!==this.state&&("function"==typeof(e=this.lx).focus&&e.focus(),"function"==typeof e.select)&&this.selectsTextOnActivate&&(e.select(),e.setSelectionRange(0,9999))}isValidText(t,e,i){Kt.s(t,j,At,"isValidText:textblock");var s=this.textValidation;return!(null!==s&&!s(t,e,i)||null!==(s=t.textValidation)&&!s(t,e,i))}get textValidation(){return this.Vl}set textValidation(t){null!==t&&Kt.t(t,"function",At,"textValidation"),this.Vl=t}get minimumEditorScale(){return this.CM}set minimumEditorScale(t){null!==t&&Kt.t(t,"number",At,"minimumEditorScale"),this.CM=t}get selectsTextOnActivate(){return this.AM}set selectsTextOnActivate(t){null!==t&&Kt.t(t,"boolean",At,"selectsTextOnActivate"),this.AM=t}get state(){return this.jt}set state(t){this.jt!==t&&(Kt.it(t,wt,"TextEditingState"),this.jt=t)}measureTemporaryTextBlock(t){var e=this.Fe;return e.text=t,e.wt(this.textBlock.Bl,1/0),e}static Af=null}(e={})[e.Default=1]="Default",e[e.AnimateLocations=2]="AnimateLocations",e[e.None=3]="None";var Pt=e;class kt{b;Di;Xi;Lr;$n;Eo;TM;DM;Vm;Mi;Lf;xn;Bm;Jh;hx;zm;ax;Tf;Nu;Xm;constructor(t){this.b=G.Pm(),this.Di=!1,this.Vm=!1,this.Mi=!1,this.Lf=!1,this.ax=!0,this.Tf=1,this.Nu=!1,this.Xi=!0,this.Lr=!0,this.Eo=600,this.TM=!1,this.DM=!1,this.$n=new N,this.xn=new St,this.Bm=new St,(this.xn.bs=this).Jh=new N,this.hx=new N,this.zm=new N,this.Xm=new N,t&&Object.assign(this,t)}Vo(t){this.b=t}lE(){return this.b}canStart(t){return!0}zl(t){return!(!this.Xi||!this.canStart(t)||(this.$n.add(t),this.defaultAnimation.isAnimating&&this.stopAnimation(),this.b.Fi(),this.Mi=!0,0))}getBundleAnimation(){return this.Bm}FM(){if(this.Xi&&(0{!1===n.Mi||e.Di||(i.getRenderingHint("temporaryPixelRatio")&&i.vw(),i.RM(),n.Mi=!1,e.start(),e.Di&&(n.Lu(),i.invalidateDocumentBounds(),e.ZC(0),i.Pr(!0),n.Tu(),i.V("AnimationStarting",n)))})}}}IM(){return this.$n.contains("Trigger")&&1===this.$n.count}$C(t,e,i,s){this.isTicking||this.IM()||t instanceof Y&&(null!==t.fromNode||null!==t.toNode)||this.xn.add(t,"position",e,i,s)}ux(t){return this.xn.ux(t)}OM(t){return this.xn.OM(t)}uF(t){const i=this.Jh,s=this;function n(){if(0n()))}gF(t){this.zm.add(t)}mF(){for(var t=this.Jh.iterator;t.next();)t.value.Df=!1}Lu(){var t;this.Vm||(t=this.b,this.TM=t.skipsUndoManager,this.DM=t.xe,t.skipsUndoManager=!0,t.xe=!0,this.Vm=!0)}Tu(){var t=this.b;t.skipsUndoManager=this.TM,t.xe=this.DM,this.Vm=!1}stopAnimation(t){var e=this.xn;if(!0===this.Mi&&(this.Mi=!1,this.Lf=!1,this.$n.clear(),e.pF())&&this.b.requestUpdate(),this.Di){if(e.Du(!0),e.cx(null),!0===t){var i=this.Jh.toArray();for(let t=0;t{t.isAnimating||t.runCount!==1/0||t.start()})}get duration(){return this.Eo}set duration(t){Kt.t(t,"number",kt,"duration"),t<1&&Kt.G(t,">= 1",kt,"duration"),this.Eo=t}get isAnimating(){return this.Di}get isTicking(){return this.Vm}get isInitial(){return this.Lr}set isInitial(t){Kt.t(t,"boolean",kt,"isInitial"),this.Lr=t}get defaultAnimation(){return this.xn}get activeAnimations(){return this.Jh}get initialAnimationStyle(){return this.Tf}set initialAnimationStyle(t){Ht,Kt.it(t,Pt,"AnimationStyle"),this.Tf=t}static gx=new L;static defineAnimationEffect(t,e){kt.gx.add(t,e)}static BM(t,e,i,s,n){let a=(t=null===t?[0,0,0,0]:t)[0],r=t[1];var o=t[2],t=t[3];let l=(e=null===e?[0,0,0,0]:e)[0],h=e[1];var u=e[2],e=e[3],d=(0===o||100===o?(a=l,r=h):0!==u&&100!==u||(l=a,h=r),180a?a+=360:l+=360),n(i,a,l-a,s)%360);return"hsla("+d+", "+n(i,r,h-r,s)+"%, "+n(i,o,u-o,s)+"%, "+n(i,t,e-t,s)+")"}static{var t=kt.gx,e=(t,e,i,s,n,a)=>{t.position=new _(s(n,e.x,i.x-e.x,a),s(n,e.y,i.y-e.y,a))};t.add("position:diagram",e),t.add("position",e),t.add("position:part",(t,e,i,s,n,a)=>{n{n{n{var r=t.actualBounds,i=i.actualBounds,o=i.x+i.width/2-r.width/2,i=i.y+i.height/2-r.height/2;n{t.desiredSize=new Q(s(n,e.width,i.width-e.width,a),s(n,e.height,i.height-e.height,a))}),t.add("width",(t,e,i,s,n,a)=>{t.width=s(n,e,i-e,a)}),t.add("height",(t,e,i,s,n,a)=>{t.height=s(n,e,i-e,a)}),t.add("fill",(t,e,i,s,n,a)=>{t.fill=kt.BM(e,i,n,a,s)}),t.add("stroke",(t,e,i,s,n,a)=>{t.stroke=kt.BM(e,i,n,a,s)}),t.add("strokeWidth",(t,e,i,s,n,a)=>{t.strokeWidth=s(n,e,i-e,a)}),t.add("strokeDashOffset",(t,e,i,s,n,a)=>{t.strokeDashOffset=s(n,e,i-e,a)}),t.add("background",(t,e,i,s,n,a)=>{t.background=kt.BM(e,i,n,a,s)}),t.add("opacity",(t,e,i,s,n,a)=>{t.opacity=s(n,e,i-e,a)}),t.add("scale",(t,e,i,s,n,a)=>{t.scale=s(n,e,i-e,a)}),t.add("angle",(t,e,i,s,n,a)=>{t.angle=s(n,e,i-e,a)})}static Default=1;static AnimateLocations=2;static None=3}class St{mx;Ym;Di;Fu;Eo;Ss;eA;If;we;px;li;Qn;Ru;Of;yx;wx;Df;zM;xx;bs;b;XM;YM;KM;constructor(t){this.b=null,this.bs=null,this.zM=null,this.xx=null,this.XM=!1,this.Di=!1,this.Df=!1,this.li=0,this.Qn=0,this.mx=St.EaseInOutQuad,this.Ym=St.EaseInOutQuad,this.Ru=!1,this.Of=!1,this.yx=1,this.wx=0,this.Eo=NaN,this.Ss=NaN,this.YM=0,this.Fu=null,this.eA=_.To,this.we=new L,this.px=new L,this.If=new N,this.KM=1,t&&Object.assign(this,t)}suspend(){this.Df=!0}advanceTo(t,e){e&&(this.Df=!1),this.Ru&&t>=this.Ss&&(this.Of=!0,t-=this.Ss),this.YM=t,this.QC(!0),this.bs.Lu(),this.b.Pr(),this.bs.Tu(),this.b.redraw()}cx(t){if(this.px.clear(),this.Of=!1,this.wx=0,this.Ss=NaN,0{t.data=null,e.add(t)}),t.Tu(),this.Di=!0,this.li=+new Date,this.Qn=this.li+this.Ss,t.uF(this))}return this}addTemporaryPart(t,e){return t.De()&&((Ht,void 0===e&&Kt.n("addTemporaryPart: Required Diagram argument missing"),t.diagram===e&&Kt.n("addTemporaryPart: Part already in Diagram, did you mean to pass in a copy?"),null!==this.b)&&this.b!==e&&Kt.n("addTemporaryPart: A different Diagram is already associated with this Animation: "+this.b.toString()),this.If.add(t),this.b=e),this}add(t,e,i,s,n){if(null===this.b&&(t instanceof G?this.b=t:t instanceof y&&null!==t.diagram&&(this.b=t.diagram)),t instanceof H){if(!t.isAnimated)return this;"position"===e&&(e="position:part")}return this.EM(t,e,i,s,n),this}EM(t,e,i,s,n){var a=this.we;let r,o,l;if("fill"!==(e=t instanceof G&&"position"===e?"position:diagram":e)&&"stroke"!==e&&"background"!==e||(m.Bo(i),m.UM(),i=[m.Yi.n0,m.Yi.n1,m.Yi.n2,m.Yi.n3],m.Bo(s),m.UM(),s=[m.Yi.n0,m.Yi.n1,m.Yi.n2,m.Yi.n3]),a.contains(t))r=a.getValue(t),o=r.li,l=r.ks,void 0===o[e]&&(o[e]=this.Iu(i)),l[e]=this.Iu(s);else{if("position"===e&&i.equalsApprox(s))return;o={},l={},o[e]=this.Iu(i),l[e]=this.Iu(s),r=new Mt(o,l,n),a.add(t,r)}s=o[e];s instanceof _&&!s.isReal()&&s.c(this.eA),n&&0===e.indexOf("position:")&&t instanceof H?r.bx.location=this.Iu(t.location):n&&(r.bx[e]=this.Iu(i))}Iu(t){return t instanceof _||t instanceof Yt?t.copy():t}yF(t){var e=this.we;e.contains(t)&&(e.getValue(t).kx=!0)}ux(t){return!!this.Di&&null!==(t=this.we.getValue(t))&&t.kx}OM(t){return!!this.Di&&null!==(t=this.we.getValue(t))&&!!(t.li.position||t.li["position:part"]||t.li.location)}dF(){if(0this.Qn?this.Ss:s-this.li;e&&((t=this.YM)this.Qn&&(this.Ru&&!this.Of?(this.li=+new Date,this.Qn=this.li+this.Ss,this.Of=!0):this.Du(!1))}}}ZC(t){for(var e=this.Ss,i=this.we.iterator,s=this.Of;i.next();){var n=i.key;if(!(n instanceof y&&null===n.diagram)){var a=i.value,r=s?a.ks:a.li,o=s?a.li:a.ks,l=kt.gx;for(const h in o)"position"===h&&(o["position:placeholder"]||o["position:nodeCollapse"])||null!==l.get(h)&&l.get(h)(n,r[h],o[h],this.Ym,t,e,this)}}}stop(){return this.Di&&this.Du(!0),this}Du(t){if(null!==this.xx&&this.xx.wF(this.zM),this.Di){for(var e=this.b,i=this.bs,s=(i.Lf=!1,this.Di=!1,this.Df=!1,i.Lu(),this.we),n=this.If.iterator;n.next();)e.remove(n.value);for(var a=this.Ru,r=s.iterator,o=kt.gx;r.next();){var l=r.key,h=r.value,u=a?h.ks:h.li,d=a?h.li:h.ks,c=h.bx;for(const m in d)if(null!==o.get(m)){let t=m;!h.Sx||"position:nodeCollapse"!==t&&"position:placeholder"!==t||(t="position"),o.get(t)(l,u[m],(void 0!==c[m]?c:h.Sx?u:d)[m],this.Ym,this.Ss,this.Ss,this)}h.Sx&&void 0!==c.location&&l instanceof H&&(l.location=c.location),h.kx&&l instanceof H&&l.Ki(!1)}this.wx++;s=!t&&this.yx>this.wx;if(s||this!==i.Bm&&this!==i.defaultAnimation||this.we.clear(),e.Mx.clear(),e.NS(!1),e.invalidateDocumentBounds(),e.T(),e.Pr(!0),i.defaultAnimation===this){for(var g=i.Xm.iterator;g.next();)g.value.xF();i.Xm.clear()}e.Pr(!0),this.isViewportUnconstrained&&(e.scrollMode=this.KM),i.Tu(),s?(this.Of=!1,this.start()):(this.cx(null),i.Du(this),this.Fu&&this.Fu(this),e.requestUpdate())}}Ff(t,e){var i,s,n=e.actualBounds;let a=null;null!==(a=e instanceof X?e.placeholder:a)&&a.visible?(i=a.getDocumentPoint(Z.TopLeft),s=a.padding,i.x+=s.left,i.y+=s.top,this.add(t,"position",i,t.position,!1)):this.add(t,"position",new _(n.x+n.width/2,n.y+n.height/2),t.position,!1),this.add(t,"scale",.01,t.scale,!1),t instanceof X&&this.bF(t,e)}bF(t,e){for(var i=t.memberParts;i.next();){var s=i.value;s instanceof D&&this.Ff(s,e)}}Rf(e,i){if(e.isVisible()){let t=null;var s,n;null!==(t=i instanceof X?i.placeholder:t)&&t.visible?(s=t.getDocumentPoint(Z.TopLeft),n=t.padding,s.x+=n.left,s.y+=n.top,this.add(e,"position:placeholder",e.position,s,!0)):this.add(e,"position:nodeCollapse",e.position,i,!0),this.add(e,"scale",e.scale,.01,!0),this.yF(e),e instanceof X&&this.kF(e,i)}}kF(t,e){for(var i=t.memberParts;i.next();){var s=i.value;s instanceof D&&this.Rf(s,e)}}get duration(){return this.Eo}set duration(t){Kt.t(t,"number",St,"duration"),t<1&&Kt.G(t,">= 1",St,"duration"),this.Eo=t}get reversible(){return this.Ru}set reversible(t){this.Ru=t}get runCount(){return this.yx}set runCount(t){0i*t/s+e;static EaseInOutQuad=(t,e,i,s)=>(t/=s/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e;static EaseInQuad=(t,e,i,s)=>i*(t/=s)*t+e;static EaseOutQuad=(t,e,i,s)=>-i*(t/=s)*(t-2)+e;static EaseInExpo=(t,e,i,s)=>0===t?e:i*Math.pow(2,10*(t/s-1))+e;static EaseOutExpo=(t,e,i,s)=>t===s?e+i:i*(1-Math.pow(2,-10*t/s))+e}class Mt{li;ks;bx;Sx;kx;constructor(t,e,i){this.li=t,this.ks=e,this.bx={},this.Sx=i,this.kx=!1}}(e={})[e.Default=1]="Default",e[e.Immediate=2]="Immediate",e[e.Bundled=3]="Bundled";var Ct=e;class Nt{Te;mn;Ou;Ef;constructor(t,e,i){i&&(Ht,Kt.it(i,Ct,"TriggerStart")),this.Te=null,this.mn=t,this.Ou=i||1,this.Ef=null,void 0!==e&&(this.Ef=e,void 0===i)&&(this.Ou=2)}copy(){var t,e=new Nt(this.mn),i=(e.Ou=this.Ou,this.Ef);return null!==i&&(t={},void 0!==i.duration&&(t.duration=i.duration),void 0!==i.finished&&(t.finished=i.finished),void 0!==i.easing&&(t.easing=i.easing),e.Ef=t),e}get propertyName(){return this.mn}set propertyName(t){this.mn=t}get animationSettings(){return this.Ef}set animationSettings(t){this.Ef=t}SF(t){var e=this.Ef;null!==e&&(e.duration&&(t.duration=e.duration),e.finished&&(t.finished=e.finished),e.easing)&&(t.easing=e.easing)}get startCondition(){return this.Ou}set startCondition(t){Ht,Kt.it(t,Ct,"TriggerStart"),this.Ou=t}static Default=1;static Immediate=2;static Bundled=3}class Lt{b;Tt;_t;Fr;Xl;Yl;Kl;Ul;Gl;Hl;vl;ql;Wl;jl;Jl;Zl;Cf;$l;Px;Km;Eu;It;constructor(t){N.ji(this),this.b=null,this.It=new O,this.Tt="",this._t=1,this.Fr=!1,this.Xl=!0,this.Yl=!0,this.Kl=!0,this.Ul=!0,this.Gl=!0,this.Hl=!0,this.vl=!0,this.ql=!0,this.Wl=!0,this.jl=!0,this.Jl=!0,this.Zl=!0,this.Cf=!0,this.$l=!0,this.Px=!0,this.Km=!1,this.Eu=[],t&&Object.assign(this,t)}MF(){var e=this.It;for(let t=0;ta.Hm||l.height*r>a.Hm?n.Ji(s,a):this.AF(s,n),i&&(s.restore(),s.clearContextCache(!0))}}AF(t,e){var i,s=e.actualBounds,n=e.naturalBounds;0===s.width||0===s.height||isNaN(s.x)||isNaN(s.y)||!e.isVisible()||(i=e.D,null===e.background&&(e.bn(t,"rgba(0,0,0,0.3)",!0,!1,n,s),t.fillRect(s.x,s.y,s.width,s.height)),null===e.background)||(t.transform(i.m11,i.m12,i.m21,i.m22,i.dx,i.dy),e.bn(t,e.background,!0,!1,n,s),t.fillRect(0,0,n.width/2,n.height/2),i.Gk())||(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)))}CF(e,i,s,t){var n=2/t,a=4/t;for(let t=0;t=s.count)t=s.count;else if(s.elt(t)===e)return-1;s.insertAt(t,e),e.vm(i);s=this.diagram;return null!==s&&(i?s.T():s.Qh(e)),this.Nx(t,e),t}re(t,e,i){if(!i&&e.layer!==this&&null!==e.layer)return e.layer.re(t,e,i);var s=this.It;if(t<0||t>=s.length){if((t=s.indexOf(e))<0)return-1}else if(s.elt(t)!==e&&(t=s.indexOf(e))<0)return-1;e.qm(i),s.removeAt(t);s=this.diagram;return null!==s&&(i?s.T():s.re(e)),e.GM(null),t}Nx(t,e){t=this.LF(t,e),e instanceof X&&this.TF(t,e),null!==e.svg&&e.svg.remove()}LF(n,a){var r=a.zOrder;if(!isNaN(r)){var o=this.It,l=o.count;if(!(l<=1)){if((n=n<0?o.indexOf(a):n)<0)return-1;let t=n-1,e=NaN;for(;0<=t&&(e=o.elt(t).zOrder,isNaN(e));)t--;let i=n+1,s=NaN;for(;ir)for(;;){if(-1===t||e<=r)return++t===n?n:(o.removeAt(n),o.insertAt(t,a),t);for(e=NaN;0<=--t&&(e=o.elt(t).zOrder,isNaN(e)););}else if(!isNaN(s)&&s=r)return--i===n?n:(o.removeAt(n),o.insertAt(i,a),i);for(s=NaN;++i{s.Ti(v.document,"DOMContentLoaded",n,!1),s.setRTL()};null!==v.document.body?this.setRTL():s.Ht(v.document,"DOMContentLoaded",n,!1)}this.Uf=null,G.xP("Model",ei);const i=this;return this.sP=t=>i.partManager.doModelDataChanged(t),this.nP=t=>i.partManager.doModelChanged(t),this.g1=null,this.m1=null,this.dA(),this.model=b.initDiagramModel(),this.C1=null,this.themeManager=new ji,this.Xo=!0,this.gA(),this.layout=new Ue,this.Xo=!1,this.BF=null,this.zF=null,this.XF=null,this.w1=null,this.YF=null,this.KF=null,this.UF=null,this.oa=null,this.fA=null,this.nh=null,this.ra=null,this.la=null,this.ha=null,this.aa=null,this.Pu=()=>{},this.jh=null,this.vu=!1,this.Hf=new Ft(this),void 0!==t&&("string"==typeof t||v.Element&&t instanceof Element?this.bP(t):e=t),e&&this.setProperties(e),this.$t=!1,this.requestUpdate(),this}ZD(){return null!==this.xt}get renderer(){return this.Yf}set renderer(e){if(!(this instanceof Vt)){var e=(e=""===e?"default":e).toLowerCase(),t=this.Yf;if(e!==t){let t=null;"default"===(this.Yf=e)||"canvas"===e?(null!==(t=this.ih.get("svg"))&&t.Bt.remove(),this.xt&&(this.ai=this.xt.gi)):"svg"===e?(this.ih.contains("svg")?t=this.ih.get("svg"):(t=new Zt(this,v.document),this.addRenderer("svg",t)),null!==this.div&&this.div.appendChild(t.Bt),this.ai=t.gi,this.xt&&(this.xt.gi.setTransform(this.Gi,0,0,this.Gi,0,0),this.xt.gi.clearRect(0,0,this.Ct,this.At))):"debug"!==e||this.ih.contains("SVG")||(t=new Zt(this,v.document),this.addRenderer("SVG",t),t.Bt.style.backgroundColor="whitesmoke",null!==this.div&&this.div.after(t.Bt)),this.$t||this.redraw()}}}dA(){this.vf=new O,this.setupRouters(),this.bs=new kt,this.bs.Vo(this),this.wi=17,this.WM=!1,this.ju=!1,this.Cx="default",this.Jt=new O,this.ih=new L,this.Yf="default",this.resetRenderingHints(),this.GF(),this._t=1,this.lt=new _(NaN,NaN).w(),this.fx=new _(NaN,NaN),this.v=1,this.s0=1,this.Ax=new _(NaN,NaN).w(),this.Lx=NaN,this.Tx=1e-4,this.Dx=100,this.D=new V,this.Fx=new _(NaN,NaN).w(),this.Rx=new Q(NaN,NaN,NaN,NaN).w(),this.Vf=new I(0,0,0,0).w(),this.Zh=1,this.Ix=!1,this.Ox=null,this.Ex=null,this.Ql=1,this.Bf=Z.Default,this.Ir=1,this.Wm=Z.Default,this.Vx=Z.None,this.Bx=Z.None,this.qe=!0,this.Xu=!1,this._n=new Set,this.Or=new N,this._h=new N,this.zo=!1,this.sh=new L,this.qu=!0,this.jm=250,this.zf=-1,this.Jm=new I(16,16,16,16).w(),this.Tr=!1,this.Xf=!1,this.Yu=!0,this.e0=new C,(this.e0.diagram=this).jr=new C,(this.jr.diagram=this).ia=new C,(this.ia.diagram=this).Er=null,this.to=null,this.Hw=!1,this.HF(),this.Zr=new N,this.zx=!0,this.Xx=1,this.ZM=!1,this.Yx=1,this.Kx="auto",this.Zm="auto",this.Vr=null,this.Br=null,this.zr=null,this.Xr=null,this.Yr=null,this.Kr=null,this.Ux=null,this.Ur=null,this.Gx=!1,this.Gr=null,this.Hr=null,this.vr=null,this.qr=null,this.Hx=!1,this.d1={},this.na=[null,null],this.Xo=!1,this.iP=!1,this.vx=!1,this.qx=!1,this.eP=!0,this.Ps=!1,this.sa=!1,this.oP=!0,this.Ys=-2,this.eh=new L,this.Wu=new O,this.Yo=!1,this.Xi=!0,this.Wx=!0,this.Xl=!0,this.Yl=!0,this.jx=!1,this.Jx=!0,this.Kl=!0,this.Ul=!0,this.Gl=!0,this.Zx=!0,this.Hl=!0,this.vl=!0,this.ql=!0,this.Wl=!0,this.jl=!0,this.Jl=!0,this.Zl=!0,this.$x=!0,this.Qx=!0,this.rP=!1,this.Gf=!1,this.Ku=!0,this.Uu=!0,this._x=!0,this.t1=!0,this.i1=16,this.e1=16,this.$m=!1,this.s1=!1,this.o1=0,this.l1=0,this.ei=new I(5).w(),this.lP=(new N).w(),this.h1=999999999,this.hP=(new N).w(),this.ea=!0,this.Gu=!0,this.Kf=!0,this.kn=!1,this.io=!1,this.Jr=!0,this.Al=!1,this.eo=!1,this.hA=new N,this.uP=new N,this._l=null,this.aP=new Yt(8,8),this.fP=999,this.eS=1,this.sS=0,this.Ui={scale:1,position:new _,bounds:new Q,canvasSize:new Yt,newCanvasSize:new Yt,isScroll:!1},this.Ui.canvasSize=this.Ui.canvasSize,this.Ui.newCanvasSize=this.Ui.newCanvasSize,this.Ui.isScroll=!1,this.a1=new Q(NaN,NaN,NaN,NaN).w(),this.Hu=new Yt(NaN,NaN).w(),this.Qm=new Q(NaN,NaN,NaN,NaN).w(),this.f1=!1,this.vF(),this.ls=null,this.t0=!1,this.wf=null,this.partManager=new ei,this.toolManager=new st,this.toolManager.initializeStandardTools(),this.defaultTool=this.toolManager,this.currentTool=this.defaultTool,this.S1=null,this.M1=new Ot,this.P1=null,this.N1=null,this.k1=!1,this.Mu=!1,this.commandHandler=new Gt,this.a0=null,this.f0=_.Ek,this.wP=!1,this.Gi=1,this.Tl=null,this.Hm=1,this.l0=0,this.yP=[0,0,0,0,0],this.h0=0,this.o0=1,this.dP=0,this.gP=new _,this.aA=500,this.i0=new _,this.r0=!1}static mA=void 0!==v.document;static isUsingDOM(){return G.mA}static useDOM(t){G.mA=!!t&&void 0!==v.document}static he=new WeakMap;clear(){this.animationManager.stopAnimation(),this.model.clear(),G.pA(),this.yA(!1),this.Wu.clear(),this.wA(),this._l=null,this.invalidateDocumentBounds(),this.ensureBounds(),this.T()}yA(t){this.animationManager.stopAnimation(!0),this.lP=(new N).w(),this.hP=(new N).w();var e=this.skipsUndoManager,i=null!==this.Li&&void 0!==this.Li;i&&(this.skipsUndoManager=!0);let s=null;null!==this.ls&&null!==(s=this.ls.part)&&this.remove(s);var n=[],a=this.Jt.length;if(t){for(let t=0;tt?new I(t/2):1.5)),this.c1=this._m,this.u1=new K(Xt.Link).add(new q({isPanelMain:!0,fill:null,stroke:"dodgerblue",strokeWidth:3}).theme("stroke","selection").theme("strokeWidth","selection"))}setRTL(t){let e=void 0===t?this.div:t;null===e&&(e=v.document.body);t=Kt.hn("div");t.dir="rtl",t.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",t.textContent="A",e.appendChild(t);let i="reverse";0t.cancelWaitAfter()),e.mouseMoveTools.each(t=>t.cancelWaitAfter()),e.mouseUpTools.each(t=>t.cancelWaitAfter())),e.cancelWaitAfter(),this.currentTool.doCancel(),this.xt=null,this.Ti(v,"resize",this.w1,!1),this.Ti(v,"wheel",this.oa,!0),G.Pm()===this&&G.uA(null)):null===this.nh&&(this.eo=!1),(this.Ot=null)!==t?((e=G.he.get(t))&&(e.div=null),this.bP(t),this.Pu(),this.themeManager&&this.themeManager.qF()):this.themeManager&&this.themeManager.WF())}setupRouters(){this.vf.push(new Ki)}bP(t){const a=this;if(G.isUsingDOM()){null==t&&Kt.n("Diagram setup requires an argument DIV."),null!==a.Ot&&Kt.n("Diagram has already completed setup."),"string"==typeof t?a.Ot=v.document.getElementById(t):t instanceof HTMLDivElement?a.Ot=t:Kt.n("No DIV or DIV id supplied: "+t),null===a.Ot&&Kt.n("Invalid DIV id; could not get element with id: "+t);t=G.he.get(a.Ot);if(t&&t!==this&&Kt.n("Invalid div id; div already has a Diagram associated with it."),!a.Uf&&v.ResizeObserver){const s=v.ResizeObserver,n=Kt.Rk(()=>a.requestUpdate(),250,!1);a.Uf=new s(()=>n()),a.Uf.observe(a.Ot)}"static"===v.getComputedStyle(a.Ot,null).position&&(a.Ot.style.position="relative");a.Ot.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)",a.Ot.innerHTML="",G.he.set(a.Ot,a),(a.Ot.goDiagram=a).Ot.go=v.go;var t=new $t(a),e=(void 0!==t.style&&(t.style.position="absolute",t.style.top="0px",t.style.left="0px","rtl"===v.getComputedStyle(a.Ot,null).getPropertyValue("direction")&&(a.ju=!0),t.style.zIndex="2",t.style.userSelect="none",t.style.MozUserSelect="none",t.style.touchAction="none",t.style.letterSpacing="normal !important",t.style.wordSpacing="normal !important",t.style.lang="unknown"),a.xt=t,a.ai=t.gi,a.ai);a.Gi=a.computePixelRatio(),a.viewSize.isReal()||(a.Ct=a.Ot.clientWidth||1,a.At=a.Ot.clientHeight||1),a.xA(a.Ct,a.At);const r=a;a.Ot.insertBefore(t.Bt,a.Ot.firstChild);var i,t=new $t(null),t=(t.width=1,t.height=1,a.EF=t,a.VF=t.gi,G.isUsingDOM()&&(t=Kt.hn("div"),i=Kt.hn("div"),t.style.position="absolute",t.style.overflow="auto",t.style.width=a.Ct+"px",t.style.height=a.At+"px",t.style.zIndex="1",i.style.position="absolute",i.style.width="1px",i.style.height="1px",a.Ot.appendChild(t),t.appendChild(i),t.onscroll=G.jF,t.addEventListener("pointerdown",G.JF),t.b=a,t.ZF=!0,t.$F=!0,a.g1=t,a.m1=i),a.Pu=Kt.Rk(()=>{a.Tl=null,a.T()},300,!1),a.w1=Kt.Rk(()=>{a.RM()},250,!1),a.jh=t=>(t.preventDefault(),!1),a.oa=i=>{if(r.isEnabled){var s=r.qf(i,!0);s.bubbles=!0;let t=0,e=0;void(s.delta=0)!==i.deltaX?(0!==i.deltaX&&(t=0Math.abs(i.deltaY)?-t:-e):void 0!==i.wheelDeltaX?(0!==i.wheelDeltaX&&(t=0Math.abs(i.wheelDeltaY)?-t:-e):void 0!==i.wheelDelta&&0!==i.wheelDelta&&(s.delta=0{r.isEnabled&&(a.Gf=!1,r.qf(t,!0),(t=r.currentTool).cancelWaitAfter(),t.standardMouseOver())},a.nh=e=>{if(r.isEnabled){a.Gf=!0;var i=r.d1,i=(void 0===i[e.pointerId]&&(i[e.pointerId]=e),r.na);let t=!1;if(null===i[0]||i[0].pointerId!==e.pointerId&&i[0].pointerType===e.pointerType)if(null!==i[1]&&i[1].pointerId===e.pointerId)i[1]=e,t=!0;else if(null===i[0])i[0]=e;else{if(null!==i[1])return void e.preventDefault();i[1]=e,t=!0}else i[0]=e;var i="touch"===e.pointerType||"pen"===e.pointerType,s=(i&&(r.Hw=!1,r.r0=!0),r.QF(e,e,t)),n=r.gP,i=i?25:10;e.timeStamp-r.dPi||Math.abs(n.y-e.screenY)>i)?r.o0++:r.o0=1,s.clickCount=r.o0,r.dP=e.timeStamp,r.gP.setTo(e.screenX,e.screenY),r.doMouseDown(),1===e.button?e.preventDefault():r.fa(s,e)}},a.ra=t=>{if(r.isEnabled){a.Gf=!0;var e=r.na;if(null===e[0]||e[0].pointerId!==t.pointerId&&e[0].pointerType===t.pointerType){if(null!==e[1]&&e[1].pointerId===t.pointerId)return void(e[1]=t);if(null!==e[0])return}e[0]=t,e[0].pointerId===t.pointerId&&(e=r._F(t,t,null!==e[1]),r.doMouseMove(),r.fa(e,t))}},a.la=e=>{if(r.isEnabled){a.Gf=!0;var i="touch"===e.pointerType||"pen"===e.pointerType,s=r.d1;if(i&&r.Hw)delete s[e.pointerId],e.preventDefault();else{s=r.na;if(null===s[0]||s[0].pointerId!==e.pointerId&&s[0].pointerType===e.pointerType)return null!==s[1]&&s[1].pointerId===e.pointerId?void(s[1]=null):void 0;s[0]=null;s=r.kP(e,!1,!0,!1,!0,!1);let t=v.document.elementFromPoint(e.clientX,e.clientY)||null;null!==(t=null!==t&&void 0!==t.shadowRoot&&null!==t.shadowRoot?t.shadowRoot.elementFromPoint(e.clientX,e.clientY):t)&&t.b instanceof G&&t.b!==r&&t.b.u0(e,s),null===t&&(t=e.target),r.u0(e,s),s.clickCount=r.o0,s.targetDiagram=r.SP(e,t),s.targetObject=null,r.doMouseUp(),r.fa(s,e),i&&(r.r0=!1)}}},a.ha=t=>{var e;r.isEnabled&&(a.Gf=!1,(e=r.d1)[t.pointerId]&&delete e[t.pointerId],null!==(e=r.na)[0]&&e[0].pointerId===t.pointerId&&(e[0]=null),null!==e[1]&&e[1].pointerId===t.pointerId&&(e[1]=null),"touch"!==t.pointerType)&&"pen"!==t.pointerType&&((e=r.currentTool).cancelWaitAfter(),e.standardMouseOver())},a.aa=t=>{var e=r.na;null!==e[0]&&e[0].pointerId===t.pointerId?(e[0]=null,r.r0=!1):null!==e[1]&&e[1].pointerId===t.pointerId&&(e[1]=null)},e);a.p1=t.Y[Kt.Os("7eba17a4ca3b1a8346")][Kt.Os("78a118b7")](t.Y,G.Ju,4,4),e.clearContextCache(!0),a.tR(),"svg"===this.Yf&&(i=this.ih.get("svg"),this.Ot.appendChild(i.Bt),this.ai=i.gi)}}addEventListener(t,e,i,s){t.addEventListener(e,i,{capture:s,passive:!1})}Ht(t,e,i,s){t.addEventListener(e,i,{capture:s,passive:!1})}removeEventListener(t,e,i,s){t.removeEventListener(e,i,{capture:s})}Ti(t,e,i,s){t.removeEventListener(e,i,{capture:s})}tR(){var t=this;let e=this.xt.Bt;e instanceof HTMLCanvasElement||(e=t.div),this.Ht(e,"pointerdown",t.nh,!1),this.Ht(e,"pointermove",t.ra,!1),this.Ht(e,"pointerup",t.la,!1),this.Ht(e,"pointerout",t.ha,!1),this.Ht(e,"pointercancel",t.aa,!1),this.Ht(e,"pointerenter",t.iR,!1),this.Ht(e,"pointerleave",t.eR,!1),this.Ht(e,"wheel",t.oa,!1),this.Ht(e,"keydown",t.sR,!1),this.Ht(e,"keyup",t.nR,!1),this.Ht(e,"blur",t.oR,!1),this.Ht(e,"focus",t.rR,!1),this.Ht(e,"selectstart",t=>(t.preventDefault(),!1),!1),this.Ht(e,"contextmenu",t=>(t.preventDefault(),!1),!1),this.Ht(v,"resize",t.w1,!1)}vw(){30e?e:l)this.maxScale?this.maxScale:l:3===t?(l=0,l=(l=(l=(l=re?e:l)this.maxScale?this.maxScale:l):this.scale}zoomToFit(){var t=this.Zh;this.Zh=1,this.scale=this.Zu(2),1!==t&&(this.Hs(!1),this.MP(this.documentBounds,this.Ct/this.v,this.At/this.v,this.Bf,!1)),this.Zh=t}zoomToRect(e,i){void 0===i&&(i=2);var s,n,a=e.width,r=e.height;if(!(0===a||0===r||isNaN(a)&&isNaN(r))){let t=1;2!==i&&3!==i||(t=isNaN(a)?this.viewportBounds.height*this.scale/r:isNaN(r)?this.viewportBounds.width*this.scale/a:(s=this.Ct,n=this.At,3===i?s/at.width&&(o=t.x+(s.x*t.width+s.offsetX)-(s.x*e-s.offsetX)),i>t.height)&&(l=t.y+(s.y*t.height+s.offsetY)-(s.y*i-s.offsetY)),a=this.Vf,n=e-t.width,et.left?o=t.left:ot.top?l=t.top:lt.part,t=>t.canSelect());if(e instanceof H)return e}else{e=this.DS(t,t=>t.part);if(e instanceof H)return e}return null}findObjectAt(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null),this.Fi();for(var s=this.Jt.iteratorBackwards;s.next();){var n=s.value;if(n.visible){n=n.findObjectAt(t,e,i);if(null!==n)return n}}return null}DS(t,e,i){void 0===e&&(e=null),void 0===i&&(i=null),this.Fi();for(var s=this.Jt.iteratorBackwards;s.next();){var n=s.value;if(n.visible&&!n.isTemporary){n=n.findObjectAt(t,e,i);if(null!==n)return n}}return null}findPartsAt(t,e,i){return this.aR(t,t=>t.part,(e=void 0===e?!0:e)?t=>t instanceof H&&t.canSelect():null,i)}aR(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=null),s instanceof O||s instanceof N||(s=new N),this.Fi();for(var n=this.Jt.iteratorBackwards;n.next();){var a=n.value;a.visible&&!a.isTemporary&&a.findObjectsAt(t,e,i,s)}return s}findObjectsAt(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=null),s instanceof O||s instanceof N||(s=new N),this.Fi();for(var n=this.Jt.iteratorBackwards;n.next();){var a=n.value;a.visible&&a.findObjectsAt(t,e,i,s)}return s}findPartsIn(t,e,i,s){return void 0===i&&(i=!0),this.fR(t,null,t=>t instanceof H&&(!i||t.canSelect()),e=void 0===e?!1:e,s)}findObjectsIn(t,e,i,s,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===s&&(s=!1),n instanceof O||n instanceof N||(n=new N),this.Fi();for(var a=this.Jt.iteratorBackwards;a.next();){var r=a.value;r.visible&&r.findObjectsIn(t,e,i,s,n)}return n}IS(t,e,i,s,n,a){for(var r=new N,o=(this.Fi(),this.Jt.iteratorBackwards);o.next();){var l=o.value;l.visible&&l.IS(t,e,i,s,r,n,a)}return r}fR(t,e,i,s,n){void 0===e&&(e=null),void 0===i&&(i=null),void 0===s&&(s=!1),n instanceof O||n instanceof N||(n=new N),this.Fi();for(var a=this.Jt.iteratorBackwards;a.next();){var r=a.value;r.visible&&!r.isTemporary&&r.findObjectsIn(t,e,i,s,n)}return n}findPartsNear(t,e,i,s,n){return void 0===s&&(s=!0),this.cR(t,e,null,t=>t instanceof H&&(!s||t.canSelect()),i=void 0===i?!0:i,n)}findObjectsNear(t,e,i,s,n,a){void 0===i&&(i=null),void 0===s&&(s=null),!1!==(n=void 0===n?!0:n)&&!0!==n&&((n instanceof O||n instanceof N)&&(a=n),n=!0),a instanceof O||a instanceof N||(a=new N),this.Fi();for(var r=this.Jt.iteratorBackwards;r.next();){var o=r.value;o.visible&&o.findObjectsNear(t,e,i,s,n,a)}return a}cR(t,e,i,s,n,a){void 0===i&&(i=null),void 0===s&&(s=null),!1!==(n=void 0===n?!0:n)&&!0!==n&&((n instanceof O||n instanceof N)&&(a=n),n=!0),a instanceof O||a instanceof N||(a=new N),this.Fi();for(var r=this.Jt.iteratorBackwards;r.next();){var o=r.value;o.visible&&!o.isTemporary&&o.findObjectsNear(t,e,i,s,n,a)}return a}acceptEvent(t){return this.qf(t,t instanceof MouseEvent)}qf(t,e){var i=this.jr;this.jr=this.ia,(this.ia=i).diagram=this,i.event=t,e?this.u0(t,i):(i.viewPoint=this.jr.viewPoint,i.documentPoint=this.jr.documentPoint);let s=0;e=t;return e.ctrlKey&&(s+=1),e.altKey&&(s+=2),e.shiftKey&&(s+=4),e.metaKey&&(s+=8),i.modifiers=s,i.button=e.button,void 0!==e.buttons&&(i.buttons=e.buttons),Kt.dr&&0===e.button&&e.ctrlKey&&(i.button=2),i.down=!1,i.up=!1,i.clickCount=1,i.delta=0,i.handled=!1,i.bubbles=!1,i.timestamp=t.timeStamp,i.isMultiTouch=!1,i.targetDiagram=this.SP(t,t.target),i.targetObject=null,i}SP(t,e){if(null===e)return null;e=G.he.get(e);if(e)return e;let i=t.path;return(i=i||"function"!=typeof t.composedPath?i:t.composedPath())&&i[0]&&G.he.has(i[0])?G.he.get(i[0]):null}QF(t,e,i){var s=this.kP(t,!0,!1,!1,!0,i);return this.u0(e,s),s.targetDiagram=this.SP(t,t.target),s.targetObject=null,i||s.clone(this.e0),s}_F(t,e,i){i=this.kP(t,!1,!1,!1,!1,i);let s=v.document.elementFromPoint(e.clientX,e.clientY)||null,n=this,a=t;return(s=null!==s&&void 0!==s.shadowRoot&&null!==s.shadowRoot?s.shadowRoot.elementFromPoint(e.clientX,e.clientY):s)&&G.he.get(s)&&(a=e,n=G.he.get(s)),i.targetDiagram=n,this.u0(a,i),i.targetObject=null,i}kP(t,e,i,s,n,a){var r=this.jr;this.jr=this.ia,(this.ia=r).diagram=this,r.clickCount=1;let o=r.delta=0;return t.ctrlKey&&(o+=1),t.altKey&&(o+=2),t.shiftKey&&(o+=4),t.metaKey&&(o+=8),r.modifiers=o,r.event=t,r.timestamp=t.timeStamp,r.button=(i?this.firstInput:t).button,r.buttons=t.buttons,Kt.dr&&0===t.button&&t.ctrlKey&&(r.button=2),r.down=e,r.up=i,r.handled=s,r.bubbles=n,r.isMultiTouch=a,r}fa(t,e){return t.bubbles?(Ht,Ht.handleMessages&&Kt.ft("NOT handled "+e.type+" "+t.toString()),!0):(Ht,Ht.handleMessages&&Kt.ft("handled "+e.type+" "+this.currentTool.name+" "+t.toString()),void 0!==e.stopPropagation&&e.stopPropagation(),!1!==e.cancelable&&e.preventDefault(),!(e.cancelBubble=!0))}sR(t){var e,i=G.he.get(this);return!!i.isEnabled&&((e=i.qf(t,!1)).key=t.key,e.code=t.code,e.down=!0,i.doKeyDown(),i.fa(e,t))}nR(t){var e,i=G.he.get(this);return!!i.isEnabled&&((e=i.qf(t,!1)).key=t.key,e.code=t.code,e.up=!0,i.doKeyUp(),i.fa(e,t))}iR(t){var e,i=G.he.get(this);return!!i.isEnabled&&(e=i.qf(t,!0),null!==i.mouseEnter&&i.mouseEnter(e),i.currentTool.standardMouseOver(),i.fa(e,t))}eR(t){var e,i=G.he.get(this);return!!i.isEnabled&&(e=i.qf(t,!0),null!==i.mouseLeave&&i.mouseLeave(e),i.fa(e,t))}getMouse(t){var e,i=this.xt;return null===i?new _(0,0):(i=i.getBoundingClientRect(),e=(t.clientX-i.left)*(this.Ct/i.width),t=(t.clientY-i.top)*(this.At/i.height),null!==this.D?new _(e,t).Ge(this.D):new _(e,t))}u0(t,e){var i=this.xt;let s=0,n=0;null!==i&&(i=i.getBoundingClientRect(),s=(t.clientX-i.left)*(this.Ct/i.width),n=(t.clientY-i.top)*(this.At/i.height)),e.viewPoint.e(s,n),null!==this.D?(t=_.H(s,n),this.D.rs(t),e.documentPoint.c(t),_.o(t)):e.documentPoint.e(s,n)}NC(t,e,i){let s;null!==this.na[0]&&(s=this.na[e],null!==(e=this.xt))&&(e=e.getBoundingClientRect(),i.e((s.clientX-e.left)*(this.Ct/e.width),(s.clientY-e.top)*(this.At/e.height)))}invalidateDocumentBounds(){this.ea||(this.ea=!0,this.requestUpdate(!1))}uR(){this.Ps||this.Fi(),this.ensureBounds()}redraw(){this.$t||this.Ps||(this.T(),this.maybeUpdate())}isUpdateRequested(){return this.Tr}delayInitialization(t){void 0===t&&(t=null);const e=this.animationManager,i=e.isEnabled,s=(e.stopAnimation(),e.isEnabled=!1,this.Pr(),this.eo=!1,this.fx=new _(NaN,NaN),e.isEnabled=i,this.Ps=!0,this);null!==t&&Kt.Xh(()=>{s.Ps=!1,e.zl("Model"),t(s)},1)}requestUpdate(t){if(void 0===t&&(t=!1),!(!0===this.Tr||this.$t||!1===t&&this.Ps)){this.Tr=!0;const e=this;v.requestAnimationFrame(()=>{e.Tr&&e.maybeUpdate()})}}maybeUpdate(){this.Yu&&!this.Tr||(this.Yu&&(this.Yu=!1),this.Pr())}PP(t,e){!this.Gu||this.$t||this.animationManager.defaultAnimation.isAnimating||this.kA()||(t&&this.Fi(),e&&this.Hs(!1))}Pr(n){if(!this.Ps&&(this.Tr=!1,null!==this.Ot||this.Hu.isReal())){this.Ps=!0;var a=this.animationManager,r=this.Wu;if(!a.isAnimating&&0!==r.length){var o=r.h,l=o.length;for(let t=0;tt.NP()),r.clear());let t=!1,e=!1;a.defaultAnimation.isAnimating&&(e=!0,t=this.skipsUndoManager,this.skipsUndoManager=!0),a.Mi||this.RM(),n||this.PP(!1,!0),null!==this.ls&&(this.ls.visible&&!this.t0&&(this._r(),this.t0=!0),!this.ls.visible)&&this.t0&&(this.t0=!1);var r=!this.undoManager.isUndoingRedoing&&(this.Al||0!==this.vf.count&&0!==this.Or.size),u=!this.eo||this.Jr;this.Fi(!0);let i=!1,s=((u||r)&&(this.eo?this.CP(!this.Xf,r):(this.startTransaction("Initial Layout"),!1===a.isEnabled&&a.stopAnimation(),this.CP(!1,r)),i=u),this.Xf=!1,this.Al=!1,this.Fi(),this.vx||this.uR(),n||this.PP(!0,!1),!1);i?((r=Q.a()).c(this.viewportBounds),this.eo||(this.eo=!0,s=!0,this.skipsUndoManager||(this.undoManager.Kw=!0),this.undoManager.Uw=!0,this.dR()),this.gR(),this.Fi(!1),n||this.PP(!0,!0),Q.o(r)):a.Lf&&a.ax&&(1!==this.Ir?this.scale=this.Zu(this.Ir):1!==this.Ql?this.scale=this.Zu(this.Ql):(u=this.initialScale,isFinite(u)&&0{t instanceof X&&t.PA(!1)})}}MA(t,e){for(const i of t)!i.De()||i instanceof X||(i.tl()?(i.wt(1/0,1/0),i.vt()):e&&e.add(i));for(const s of t)if(s instanceof X){if(!s.isVisible())continue;this.L1(s)}}NP(t,e){this.MA(t,e);for(const s of t){var i;s instanceof Y&&(i=s).isVisible()&&(i.tl()?(i.wt(1/0,1/0),i.vt()):e.add(i))}for(const n of t)n instanceof K&&n.isVisible()&&(n.tl()?(n.wt(1/0,1/0),n.vt()):e.add(n))}g0(t){var e=t instanceof G,i=e?t.links:t.memberParts,s=this._n;if(e)this.Fi(!0);else{for(;i.next();){var n=i.value;!s.has(n)||!n.De()||n instanceof X||n.tl()&&(n.wt(1/0,1/0),n.vt())}for(i.reset();i.next();){var a=i.value;s.has(a)&&a instanceof X&&a.isVisible()&&this.L1(a)}i.reset()}for(;i.next();){var r=i.value;r instanceof Y&&s.has(r)&&r.isVisible()&&r.tl()&&(r.wt(1/0,1/0),r.vt())}}L1(t){for(var e=Kt.ct(),i=Kt.ct(),s=t.memberParts;s.next();){var n=s.value;n.isVisible()&&(n instanceof X?(n.Ko()||n.hs()||n.rh())&&this.L1(n):n instanceof Y?(n.fromNode===t||n.toNode===t?i:e).push(n):(n.wt(1/0,1/0),n.vt()))}let a=e.length;for(let t=0;tt.Bu())}else for(let t=0;tv&&(g=b.left,m=b.right),c.height>y&&(f=b.top,p=b.bottom)):(g=b.left,m=b.right,f=b.top,p=b.bottom),c.width+g+m),x=c.height+f+p,w=this.scale,z=w,A=o/wC+1&&(t=Math.max((M-C)*w+this.Ct,t)),v+a+1D+1&&(t=Math.max((c-D)*w+this.At,t)),y+r+1C+1&&(t=Math.max((M-C)*w+this.Ct,t)),v+1D+1&&(t=Math.max((c-D)*w+e,t)),y+1C+1&&(R=this.position.x*w)),this.ju)switch(this.Cx){case"negative":R=-(u.scrollWidth-R-u.clientWidth);break;case"reverse":R=u.scrollWidth-R-u.clientWidth}return u.scrollLeft=R,this.hasVerticalScrollbar&&this.allowVerticalScroll&&(y+1D+1&&(u.scrollTop=this.position.y*w)),o=this.Ct,l=this.At,u.style.width=o+(this.io?this.wi:0)+"px",u.style.height=l+(this.kn?this.wi:0)+"px",e===o&&i===l&&!this.animationManager.Mi||(A=Q.H(h,O,I,V),this.onViewportBoundsChanged(A,this.viewportBounds,z,n),Q.o(A),!1)}add(e){Kt.s(e,H,G,"add:part");var i=e.diagram;if(i!==this){null!==i&&Kt.n("Cannot add part "+e.toString()+" to "+this.toString()+". It is already a part of "+i.toString());let t=this.findLayer(e.layerName);null===(t=null===t?this.findLayer(""):t)&&Kt.n('Cannot add a Part when unable find a Layer named "'+e.layerName+'" and there is no default Layer'),e.layer!==t&&(0<=(i=t.Qh(99999999,e,e.diagram===this))&&this.raiseChangedEvent(3,"parts",t,null,e,null,i),t.isTemporary||this.invalidateDocumentBounds(),e.invalidateLayout(1),null!==(i=e.layerChanged))&&i(e,null,t)}}Qh(t){this.partManager.Qh(t);const e=this;t.il(t=>e.CA(t)),t.data||t.Uo(),t.hasPlaceholder()&&t.u(),null!==t.data&&t.il(t=>e.partManager.LP(t,null)),!0!==t.hs()&&!0!==t.rh()||this.d0(t),t.AA(!0,this),t.LA()?(t.actualBounds.isReal()&&this.T(t.$h(t.actualBounds)),this.invalidateDocumentBounds()):t.isVisible()&&t.actualBounds.isReal()&&this.T(t.$h(t.actualBounds)),this.requestUpdate()}re(t){t.clearAdornments(),this.partManager.re(t);const e=this;null!==t.data&&t.il(t=>e.partManager.TP(t,e)),this._n.delete(t),t instanceof Y&&this.Or.delete(t),t.LA()?(t.actualBounds.isReal()&&this.T(t.$h(t.actualBounds)),this.invalidateDocumentBounds()):t.isVisible()&&t.actualBounds.isReal()&&this.T(t.$h(t.actualBounds)),this.requestUpdate()}remove(t){Kt.s(t,H,G,"remove:part"),this.DP(t,!0)}DP(t,e){var i=t.layer;null!==i&&i.diagram===this&&(t.isSelected=!1,t.isHighlighted=!1,t.invalidateLayout(2),e&&t.Wf(),0<=(e=i.re(-1,t,!1))&&this.raiseChangedEvent(4,"parts",i,t,null,e,null),null!==(e=t.layerChanged))&&e(t,i,null)}removeParts(e,i){if(void 0===i&&(i=!1),Array.isArray(e)){var s=e.length;for(let t=0;tthis.maxScale&&(s=this.maxScale),_.H(this.lt.x+t/i-t/s,this.lt.y+e/i-e/s));this.position=r,_.o(r),this.v=s,this.$r(),this.$t=!1,this.onViewportBoundsChanged(a,this.viewportBounds,i,!1),this.Hs(!1),n.iA(i,this.v),this.T()}}hR(){var e=this.Jt.h;for(let t=0;t{t.isAvoiding&&t.actualBounds.intersectsRect(e)&&t.invalidateRoute()}))}_r(t){var e,i,s,n=this.ls;null!==n&&n.visible&&null!==n.layer&&(t=void 0!==t?t:this.a1).isReal()&&(s=t.width,e=t.height,n.scale=1,n.angle=0,n.layer.isViewportAligned?(n.width=s*this.scale,n.height=e*this.scale,n.part.alignment=Z.TopLeft):(null===n.Pi&&(n.Pi=new ye),(i=n.Pi.jf).isReal()&&(n.width=s+2*i.width,n.height=e+2*i.height,s=_.a(),z.vg(t.x,t.y,0,0,i.width,i.height,s),s.offset(-i.width,-i.height),n.part.location=s,_.o(s))))}clearSelection(t){void 0===t&&(t=!1);var e=this.selection;if(0!==e.count){t||this.V("ChangingSelection",e);var i=e.toArray(),s=i.length;for(let t=0;t= 0",G,"scrollHorizontalLineChange"),this.i1=t,this.i("scrollHorizontalLineChange",e,t))}get scrollVerticalLineChange(){return this.e1}set scrollVerticalLineChange(t){var e=this.e1;e!==t&&(Kt.t(t,"number",G,"scrollVerticalLineChange"),t<0&&Kt.G(t,">= 0",G,"scrollVerticalLineChange"),this.e1=t,this.i("scrollVerticalLineChange",e,t))}get lastInput(){return this.ia}set lastInput(t){Ht,Kt.s(t,C,G,"lastInput"),this.ia=t}get previousInput(){return this.jr}set previousInput(t){Ht,Kt.s(t,C,G,"previousInput"),this.jr=t}get firstInput(){return this.e0}set firstInput(t){Ht,Kt.s(t,C,G,"firstInput"),this.e0=t}get currentCursor(){return this.Kx}set currentCursor(t){var e,i,s;""===t&&(t=this.Zm),this.Kx!==t&&(Kt.t(t,"string",G,"currentCursor"),e=this.xt,i=this.Ot,null!==e)&&null!==i&&(this.Kx=t,s=e.style.cursor,e.style.cursor=t,i.style.cursor=t,e.style.cursor===s)&&(e.style.cursor="-webkit-"+t,i.style.cursor="-webkit-"+t,e.style.cursor===s)&&(e.style.cursor="-moz-"+t,i.style.cursor="-moz-"+t,e.style.cursor===s)&&(e.style.cursor=t,i.style.cursor=t)}get defaultCursor(){return this.Zm}set defaultCursor(t){var e=this.Zm;e!==(t=""===t?"auto":t)&&(Kt.t(t,"string",G,"defaultCursor"),this.Zm=t,this.i("defaultCursor",e,t))}get click(){return this.Vr}set click(t){var e=this.Vr;e!==t&&(null!==t&&Kt.t(t,"function",G,"click"),this.Vr=t,this.i("click",e,t))}get doubleClick(){return this.Br}set doubleClick(t){var e=this.Br;e!==t&&(null!==t&&Kt.t(t,"function",G,"doubleClick"),this.Br=t,this.i("doubleClick",e,t))}get contextClick(){return this.zr}set contextClick(t){var e=this.zr;e!==t&&(null!==t&&Kt.t(t,"function",G,"contextClick"),this.zr=t,this.i("contextClick",e,t))}get mouseOver(){return this.Xr}set mouseOver(t){var e=this.Xr;e!==t&&(null!==t&&Kt.t(t,"function",G,"mouseOver"),this.Xr=t,this.i("mouseOver",e,t))}get mouseHover(){return this.Yr}set mouseHover(t){var e=this.Yr;e!==t&&(null!==t&&Kt.t(t,"function",G,"mouseHover"),this.Yr=t,this.i("mouseHover",e,t))}get mouseHold(){return this.Kr}set mouseHold(t){var e=this.Kr;e!==t&&(null!==t&&Kt.t(t,"function",G,"mouseHold"),this.Kr=t,this.i("mouseHold",e,t))}get mouseDragOver(){return this.Ux}set mouseDragOver(t){var e=this.Ux;e!==t&&(null!==t&&Kt.t(t,"function",G,"mouseDragOver"),this.Ux=t,this.i("mouseDragOver",e,t))}get mouseDrop(){return this.Ur}set mouseDrop(t){var e=this.Ur;e!==t&&(Ht,null!==t&&Kt.t(t,"function",G,"mouseDrop"),this.Ur=t,this.i("mouseDrop",e,t))}get handlesDragDropForTopLevelParts(){return this.Gx}set handlesDragDropForTopLevelParts(t){var e=this.Gx;e!==t&&(Kt.t(t,"boolean",G,"handlesDragDropForTopLevelParts"),this.Gx=t,this.i("handlesDragDropForTopLevelParts",e,t))}get mouseEnter(){return this.Gr}set mouseEnter(t){var e=this.Gr;e!==t&&(null!==t&&Kt.t(t,"function",G,"mouseEnter"),this.Gr=t,this.i("mouseEnter",e,t))}get mouseLeave(){return this.Hr}set mouseLeave(t){var e=this.Hr;e!==t&&(null!==t&&Kt.t(t,"function",G,"mouseLeave"),this.Hr=t,this.i("mouseLeave",e,t))}get toolTip(){return this.vr}set toolTip(t){var e=this.vr;e!==t&&(Ht,null===t||(t instanceof K||t instanceof pt)||Kt.n("Diagram.toolTip must be an Adornment or HTMLInfo."),this.vr=t,this.i("toolTip",e,t))}get contextMenu(){return this.qr}set contextMenu(t){var e=this.qr;e!==t&&(Ht,t instanceof K||t instanceof pt||Kt.n("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.qr=t,this.i("contextMenu",e,t))}get commandHandler(){return this.tP}set commandHandler(t){this.tP!==t&&(this.tP=t).Vo(this)}get toolManager(){return this.$M}set toolManager(t){this.$M!==t&&(Kt.s(t,st,G,"toolManager"),(this.$M=t).diagram=this)}get defaultTool(){return this.QM}set defaultTool(t){var e=this.QM;e!==t&&(Kt.s(t,J,G,"defaultTool"),((this.QM=t).diagram=this).currentTool===e)&&(this.currentTool=t)}get currentTool(){return this._M}set currentTool(t){var e=this._M;e&&(e.isActive&&e.doDeactivate(),e.cancelWaitAfter(),e.doStop()),null!==(t=null===t?this.defaultTool:t)&&(Kt.s(t,J,G,"currentTool"),(this._M=t).diagram=this,t.doStart())}get selection(){return this.lP}get maxSelectionCount(){return this.h1}set maxSelectionCount(t){var e=this.h1;if(e!==t)if(Kt.t(t,"number",G,"maxSelectionCount"),0<=t&&!isNaN(t)){if(this.h1=t,this.i("maxSelectionCount",e,t),!this.undoManager.isUndoingRedoing){var i=this.selection.count-t;if(0= 0",G,"maxSelectionCount")}get nodeSelectionAdornmentTemplate(){return this._m}set nodeSelectionAdornmentTemplate(t){var e=this._m;e!==t&&(Kt.s(t,K,G,"nodeSelectionAdornmentTemplate"),this._m=t,this.i("nodeSelectionAdornmentTemplate",e,t))}get groupSelectionAdornmentTemplate(){return this.c1}set groupSelectionAdornmentTemplate(t){var e=this.c1;e!==t&&(Kt.s(t,K,G,"groupSelectionAdornmentTemplate"),this.c1=t,this.i("groupSelectionAdornmentTemplate",e,t))}get linkSelectionAdornmentTemplate(){return this.u1}set linkSelectionAdornmentTemplate(t){var e=this.u1;e!==t&&(Kt.s(t,K,G,"linkSelectionAdornmentTemplate"),this.u1=t,this.i("linkSelectionAdornmentTemplate",e,t))}get highlighteds(){return this.hP}get isModified(){var t=this.undoManager;return t.isEnabled?null!==t.currentTransaction||this.vu&&this.Ys!==t.historyIndex:this.vu}set isModified(t){var e;this.vu!==t&&(Kt.t(t,"boolean",G,"isModified"),this.vu=t,e=this.undoManager,!t&&e.isEnabled&&(this.Ys=e.historyIndex),t||this.VA())}VA(){var t=this.isModified;this.oP!==t&&(this.oP=t,this.V("Modified"))}get model(){return this.Li}set model(e){const i=this.Li;if(i!==e){Kt.s(e,b,G,"model"),this.currentTool.doCancel(),i&&i.undoManager!==e.undoManager&&i.undoManager.isInTransaction&&Kt.n("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.stopAnimation(!0);var s=this.yA(!0),t=(this.eo=!1,this.Yu=!0,this.Ys=-2,this.Tr=!1,this.$t);this.$t=!0,this.animationManager.zl("Model"),i&&(null!==this.to&&this.to.each(t=>i.removeChangedListener(t)),i.removeChangedListener(this.nP)),this.Li=e,this.partManager=this.wR(this.Li.type),this.initializePartManager(this.partManager);for(let t=0;te.addChangedListener(t)),this.$t=t,this.invalidateDocumentBounds(),this.$t||this.T(),i&&e.undoManager.copyProperties(i.undoManager)}}get themeManager(){return this.C1}set themeManager(t){var e=this.C1;e!==t&&(Kt.s(t,ji,b,"themeManager"),null!==e&&e.removeDiagram(this),null!==(this.C1=t))&&t.addDiagram(this)}initializePartManager(t){}static xP(t,e){G.cA.add(t,e)}static get licenseKey(){return G.IP.last()}static set licenseKey(t){G.IP.add(t.replace(/\s/g,""))}static get version(){return G.xR}static IP=new O;static xR="3.0.2";wR(t){t=G.cA.get(t);return new(null!==t?t:ei)}get W(){return this.eP}set W(t){this.eP=t}get Mx(){return this.hA}bR(t){if(t.model===this.model){var e,i=t.change,s=t.propertyName;if(1===i&&"S"===s[0])if("StartingFirstTransaction"===s){const r=this,o=this.toolManager;o.mouseDownTools.each(t=>t.diagram=r),o.mouseMoveTools.each(t=>t.diagram=r),o.mouseUpTools.each(t=>t.diagram=r),this.routers.each(t=>t.diagram=r),this.Ps||this.eo||(this.Xf=!0,!this.Yu)||(this.Tr=!0)}else"StartingUndo"===s||"StartingRedo"===s?(e=this.animationManager,this.skipsUndoManager||(e.defaultAnimation.isAnimating&&e.stopAnimation(),e.getBundleAnimation().isAnimating&&e.getBundleAnimation().stop()),this.V("ChangingSelection",this.selection)):"StartedTransaction"===s&&(e=this.animationManager).defaultAnimation.isAnimating&&!this.skipsUndoManager&&e.stopAnimation();else if(this.W){this.W=!1;try{if(""===t.modelChange&&1===i){"FinishedUndo"!==s&&"FinishedRedo"!==s||(this.V("ChangedSelection",this.selection),this.Fi());var n=this.animationManager,a=("RolledBackTransaction"===s&&n.stopAnimation(),this.yR(),this.Xf=!0,this.maybeUpdate(),0!==this.undoManager.transactionLevel&&1!==this.undoManager.transactionLevel||n.FM(),"CommittedTransaction"===s&&this.undoManager.isJustDiscarded&&(this.Ys=Math.min(this.Ys,this.undoManager.historyIndex-1)),"CommittedTransaction"!==s&&"RolledBackTransaction"!==s||!this.undoManager.Uw||setTimeout(()=>{this.isModified=!1},1),t.isTransactionFinished);if(a&&(this.VA(),this.Mx.clear(),this.animationManager.mF()),!this.Hx&&a&&this.lastInput.targetDiagram){this.Hx=!0;const l=this;Kt.Xh(()=>{l.currentTool.standardMouseOver(),l.Hx=!1},10)}}}finally{this.W=!0}}}}get xe(){return this.iP}set xe(t){this.iP=t}get Am(){return this.vx}set Am(t){this.vx=t}CA(t){for(const e of t.F.h)e instanceof Le&&this.OP(e)}OP(e){var t=e.element;if(null!==t&&t instanceof HTMLImageElement&&(t.as instanceof N&&t.as.add(this),e.kR(),t.w0)){var i=t.getAttribute("src")||"",s=this.eh.getValue(i);if(null===s){Le.BA(e,t);t=[];t.push(e),this.eh.add(i,t)}else{for(let t=0;tthis.scale&&(this.scale=t)):Kt.G(t,"> 0",G,"minScale"))}get maxScale(){return this.Dx}set maxScale(t){Kt.r(t,G,"maxScale");var e=this.Dx;e!==t&&(0 0",G,"maxScale"))}get zoomPoint(){return this.Fx}set zoomPoint(t){this.Fx.equals(t)||(Kt.s(t,_,G,"zoomPoint"),t=t.L(),this.Fx=t)}get contentAlignment(){return this.Bf}set contentAlignment(t){var e=this.Bf;e.equals(t)||(Kt.s(t,Z,G,"contentAlignment"),t=t.L(),this.Bf=t,this.i("contentAlignment",e,t),this.Hs(!1))}get initialContentAlignment(){return this.Wm}set initialContentAlignment(t){var e=this.Wm;e.equals(t)||(Kt.s(t,Z,G,"initialContentAlignment"),t=t.L(),this.Wm=t,this.i("initialContentAlignment",e,t))}get padding(){return this.ei}set padding(t){"number"==typeof t?t=new I(t):Kt.s(t,I,G,"padding");var e=this.ei;e.equals(t)||(t=t.L(),this.ei=t,this.invalidateDocumentBounds(),this.i("padding",e,t))}get partManager(){return this.cP}set partManager(t){var e=this.cP;e!==t&&(Kt.s(t,ei,G,"partManager"),null!==t.diagram&&Kt.n("Cannot share PartManagers between Diagrams: "+t.toString()),e&&e.Vo(null),(this.cP=t).Vo(this))}get nodes(){return this.partManager.nodes.iterator}get links(){return this.partManager.links.iterator}get parts(){return this.partManager.parts.iterator}findTopLevelNodesAndLinks(){for(var t=new N,e=this.nodes;e.next();){var i=e.value;i.isTopLevel&&t.add(i)}for(var s=this.links;s.next();){var n=s.value;n.isTopLevel&&t.add(n)}return t.iterator}findTopLevelGroups(){return this.Zr.iterator}get routers(){return this.vf}doLinkRouting(e){this.zo=!0;var i=this.vf.h;for(let t=0;t{var t;-1===e.zf||(e.stopAutoScroll(),null===e.lastInput.event)||(t=e.computeAutoScrollPosition(e.i0)).equalsApprox(e.position)||(e.position=t,e.lastInput.documentPoint=e.transformViewToDoc(e.i0),e.doMouseMove(),e.ea=!0,t=Q.a(),e.computeBounds(t),t.unionRect(e.documentBounds),e.zA(t),Q.o(t),e.qe=!0,e.maybeUpdate(),e.HA())},t)}}stopAutoScroll(){-1!==this.zf&&(Kt.Gg(this.zf),this.zf=-1)}computeAutoScrollPosition(t){let e=this.position;var i,s,n,a,r=this.Jm;return r.top<=0&&r.left<=0&&r.right<=0&&r.bottom<=0||(s=this.viewportBounds,i=this.scale,s=Q.H(0,0,s.width*i,s.height*i),n=_.H(0,0),t.x>=s.x&&t.xs.x+s.width-r.right&&this.allowHorizontalScroll&&(a=Math.max(this.scrollHorizontalLineChange,1),n.x+=a|=0,t.x>s.x+s.width-r.right/2&&(n.x+=a),t.x>s.x+s.width-r.right/4)&&(n.x+=4*a),t.y>=s.y&&t.ys.y+s.height-r.bottom&&this.allowVerticalScroll&&(a=Math.max(this.scrollVerticalLineChange,1),n.y+=a|=0,t.y>s.y+s.height-r.bottom/2&&(n.y+=a),t.y>s.y+s.height-r.bottom/4)&&(n.y+=4*a),n.equalsApprox(_.To)||(e=new _(e.x+n.x/i,e.y+n.y/i)),Q.o(s),_.o(n)),e}makeSvg(t){this.ih.contains("SVG")||this.addRenderer("SVG",new Zt(this,v.document));const i=new Zt(this,v.document,!0),s=this;return this.qA(function(t,e){return t=null!==(t=s.vA(t,"SVG",i))?t.svg:null,"function"==typeof e?(e(t),null):t},t=void 0===t?{}:t)}makeSVG(t){return this.makeSvg(t)}addRenderer(t,e){this.ih.add(t,e)}removeRenderer(t){this.ih.remove(t)}cacheGroupExternalLinks(t){(this.wP=t)||this.nodes.each(t=>{t instanceof X&&(t.b0=null)})}qA(e,i){const s=i.callback;let n=!0;const a=this.eh.iterator;for(;a.next();)if(!a.value[0].Sn){n=!1;break}if("function"!=typeof s||n)return e(i,s,this);const r=this;function o(){var t=+new Date;for(n=!0,a.reset();a.next();)if(!a.value[0].Sn){n=!1;break}n||t-h>l?e(i,s,r):v.requestAnimationFrame(o)}const l=i.callbackTimeout||300,h=+new Date;return v.requestAnimationFrame(()=>o()),null}makeImage(t){return G.isUsingDOM()?((t=void 0===t?{}:t).returnType="Image",this.makeImageData(t)):null}makeImageData(t){return this.qA(this.NR,t=void 0===t?{}:t)}static img="image";NR(e,i,t){var s=t.vA(e,"canvas",null);if(null===s)return null;var n=s.Y.canvas;let a=null;if(null!==n){let t=e.returnType;switch(t=void 0===t?"string":t.toLowerCase()){case G.img+"data":a=s.getImageData(0,0,n.width,n.height);break;case G.img:var r=(e.document||document).createElement("img");r.src=n.toDataURL(e.type,e.details),a=r;break;case"blob":r=n;return"function"!=typeof i&&(a="",Kt.n('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.')),"function"==typeof r.toBlob?(r.toBlob(i,e.type,e.details),"toBlob"):(i(null),null);default:a=n.toDataURL(e.type,e.details)}}return"function"==typeof i?(i(a),null):a}static WA=!1;vA(t,i,e){if(this.animationManager.stopAnimation(),this.maybeUpdate(),null===this.xt)return null;"object"!=typeof t&&Kt.n("properties argument must be an Object.");let s=!1,n=t.size||null,a=t.scale||null,r=(void 0!==t.scale&&isNaN(t.scale)&&(a="NaN"),t.maxSize);void 0===t.maxSize&&(s=!0,r="SVG"===i?new Yt(1/0,1/0):new Yt(2e3,2e3));var o=t.position||null;let l=t.parts||null,h=(Array.isArray(l)&&(l=new O(l)),void 0===t.padding?1:t.padding);var u=t.background||null;let d=t.omitTemporary;void 0===d&&(d=!0);var c=t.document||document,g=t.elementFinished||null;let m=t.showTemporary,f=(void 0===m&&(m=!d),t.showGrid);void 0===f&&(f=m),null!==n&&isNaN(n.width)&&isNaN(n.height)&&(n=null),"number"==typeof h?h=new I(h):h instanceof I||Kt.n("MakeImage padding must be a Margin or a number."),h.left=Math.max(h.left,0),h.right=Math.max(h.right,0),h.top=Math.max(h.top,0),h.bottom=Math.max(h.bottom,0),this.ai.clearContextCache(!0);var t=new $t(null,c,void 0,!0),p=t.gi;if(!(n||a||l||o))return t.width=this.Ct+Math.ceil(h.left+h.right),t.height=this.At+Math.ceil(h.top+h.bottom),"SVG"===i?null===e?null:(e.resize(t.width,t.height,t.width,t.height),e.ga=c,e.$u=g,this.T1(e.gi,h,new Yt(t.width,t.height),this.v,this.lt,l,u,m,f),e.gi):(this.qu=!1,this.T1(p,h,new Yt(t.width,t.height),this.v,this.lt,l,u,m,f),this.qu=!0,t.gi);var v=this.s0,y=this.documentBounds.copy();if(y.subtractMargin(this.ei),m){var b=this.Jt.h,x=b.length;for(let t=0;tv?(a=v,E=y.width,y):(E=r.width,r)).height:(E=y.width*a,y.height*a):(a=v,E=y.width,y.height),null!==h?(E+=D,R+=T):h=new I(0),null!==r){let t=r.width,e=r.height;"SVG"!==i&&s&&!G.WA&&(Ht,E>t||R>e)&&(Kt.ft("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(E)+"x"+Math.ceil(R)+" vs 2000x2000) Consider increasing the max size."),G.WA=!0),isNaN(t)&&(t=2e3),isNaN(e)&&(e=2e3),isFinite(t)&&(E=Math.min(E,t)),isFinite(e)&&(R=Math.min(R,e))}return t.width=Math.ceil(E),t.height=Math.ceil(R),"SVG"===i?null===e?null:(e.resize(t.width,t.height,t.width,t.height),e.ga=c,e.$u=g,this.T1(e.gi,h,new Yt(Math.ceil(E),Math.ceil(R)),a,S,l,u,m,f),e.gi):(this.qu=!1,this.T1(p,h,new Yt(Math.ceil(E),Math.ceil(R)),a,S,l,u,m,f),this.qu=!0,t.gi)}static Ju=null;static jA="5da73c80a36555d4038e4972187c3cae51fd22";static ww=!1;static Hk=()=>{if(void 0===G.jA[5]&&(V.prototype.rs=V.prototype.Pw),G.isUsingDOM()){var t=v.document.createElement("canvas"),e=t.getContext("2d"),i=Kt.Os("7ca11abfd022028846"),s=(e[i]=Kt.Os("398c3597c01238"),"7ca11abfd7330390"),n=[G.jA,Kt.ww+"4ae6247590da4bb21c324ba3a84e385776",V.Hk+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",z.za];for(let t=1;t<5;t++)e[Kt.Os(s)](Kt.Os(n[t-1]),10,15*t+0);e[i]=Kt.Os("39f046ebb36e4b");for(let t=1;t<5;t++)e[Kt.Os(s)](Kt.Os(n[t-1]),10,15*t+0);4===n.length&&"5"===n[0][0]&&"7"===n[3][0]||(V.prototype.rs=V.prototype.Pw),G.Ju=t}}}class Ft{JA;ZA;UP;Ie;constructor(t){this.JA=null,this.ZA="63ad05bbe23a1786468a4c741b6d2",this.UP="@onz",this.ZA===this._tk?(this.UP=!0,this.Ie=this.UP):this.Ie=null}CR(t,e){let i="f";var s=v[Kt.Os("76a715b2f73f148a")][Kt.Os("72ba13b5")]||"",n=Kt.Os;if(this.Ie=!0,G.isUsingDOM())if(G[n("76a115b6ed251eaf4692")])for(var a=G.IP.iterator;a.next();){var r=n(a.value).split(n("39e9"));if(r.length<6)return;var o=n(r[1]).split(".");if("7da71ca0"!==r[4])return;var l=n(Kt[n("6cae19")]).split(".");if(o[0]>l[0]||o[0]===l[0]&&o[1]>=l[1]){var o="73a612b6fb191d",l=v[n("74a900bae4370f8b51")][n("6fbb13a1c2311e8a57")].toLowerCase(),h=l[n(o)](n("3aad1ab6e022098b4dc4")),u=n(r[2]);if(-1h),!this.Ie))return;l=u;if("#"===l[0]){o=v.document.createElement("div");let t=r[0].replace(/[A-Za-z]/g,"");for(;t.length<4;)t+="9";var h=t,c=(t=t.substring(t.length-4),""),u=["Header","Background","Display","Feedback"],c=(c+=["gsh","gsf"][parseInt(t.substring(0,1),10)%2])+u[parseInt(t.substring(0,1),10)%4];if(o[n("79a417a0f0181a8946")]=c,v.document[n("78a712aa")]){v.document[n("78a712aa")][n("7bb806b6ed32388c4a875b")](o);r=v.getComputedStyle(o).getPropertyValue(n("78a704b7e62456904c9b12701b6532a8")),u=v.getComputedStyle(o).getPropertyValue(n("75b817b0ea2202"));if(v.document[n("78a712aa")][n("68ad1bbcf533388c4a875b")](o),r){o=v[n("77a902b0eb1b1e804a8a")];if(u==="0."+parseInt(h,10)%100||-1!==r.indexOf(parseInt(l[1]+l[2],16))&&-1!==r.indexOf(parseInt(l[3]+l[4],16)))return void(this.Ie=!1);if(o&&o(n("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches){c="."+c;for(let t=0;t{var t,e,i=this.observed;null!==i&&(t=i.viewportBounds,e=this.lastInput.documentPoint,i.position=new _(e.x-t.width/2,e.y-t.height/2))},this.vP=t=>{this.invalidateDocumentBounds(),this.S0()},this.qP=t=>{null!==this.observed&&(this.invalidateDocumentBounds(),this.T())},this.B1=t=>{this.updateDelay<1?this.T():this.k0||(this.k0=!0,setTimeout(()=>this.redraw(),this.updateDelay))},this.WP=t=>{null!==this.observed&&this.S0()},this.autoScale=2,this.$t=!1,e&&Object.assign(this,e),this}setupRouters(){}computePixelRatio(){return 1}redraw(){this.k0&&1<=this.updateDelay&&(this.k0=!1,this.AR()),super.redraw()}Ji(){if(null===this.Ot&&Kt.n("No div specified"),null===this.xt&&Kt.n("No canvas specified"),!(this.xt instanceof Zt)&&(this.box.qM(),this.qe)){var t=this.observed;if(null!==t&&!t.animationManager.defaultAnimation.isAnimating&&t.Uh){this.m0();var t=this.xt,e=this.ai,i=(e.clearContextCache(!0),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,t.width,t.height),this.updateDelay<1?this.QA():null!==this.Zf&&(e.drawImage(this.Zf.Bt,0,0),(t=this.D).ti(),1!==this.scale&&t.v(this.scale),0===this.position.x&&0===this.position.y||t.se(-this.position.x,-this.position.y),e.scale(this.Gi,this.Gi),e.transform(t.m11,t.m12,t.m21,t.m22,t.dx,t.dy),e.commitTransform()),this.Jt.h),s=i.length;for(let t=0;tt.canDelete())}t.removeParts(e,!0),t.V("SelectionDeleted",e)}finally{t.commitTransaction("Delete"),t.V("ChangedSelection",t.selection),t.currentCursor=""}}canDeleteSelection(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowDelete||0===t.selection.count)}copySelection(){for(var t=this.diagram,e=new N,i=t.selection.iterator;i.next();){var s=i.value;H.ah(e,s,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,t=>t.canCopy())}this.copyToClipboard(e)}canCopySelection(){var t=this.diagram;return!(!t.allowCopy||!t.allowClipboard||0===t.selection.count)}cutSelection(){this.copySelection(),this.deleteSelection()}canCutSelection(){var t=this.diagram;return!(t.isReadOnly||t.isModelReadOnly||!t.allowCopy||!t.allowDelete||!t.allowClipboard||0===t.selection.count)}copyToClipboard(s){var n=this.diagram;let a=null;if(null===s)G.pA();else{var r=n.model;let t=!1,e=!1,i=null;try{r.Qu()&&(t=r.copiesParentKeyOfNodeData,r.copiesParentKeyOfNodeData=this.copiesParentKey),(r.bf()||r._u())&&(e=r.copiesGroupKeyOfNodeData,r.copiesGroupKeyOfNodeData=this.copiesGroupKey),i=n.copyParts(s,null,!0)}finally{r.Qu()&&(r.copiesParentKeyOfNodeData=t),(r.bf()||r._u())&&(r.copiesGroupKeyOfNodeData=e),(a=new O).addAll(i.iteratorValues),G.c0=a,G.A1=n.model.dataFormat}}n.V("ClipboardChanged",a)}pasteFromClipboard(){var s=new N,n=G.c0;if(null!==n){var a=this.diagram;if(G.A1===a.model.dataFormat){var r=a.model;let t=!1,e=!1,i=null;try{r.Qu()&&(t=r.copiesParentKeyOfNodeData,r.copiesParentKeyOfNodeData=this.copiesParentKey),(r.bf()||r._u())&&(e=r.copiesGroupKeyOfNodeData,r.copiesGroupKeyOfNodeData=this.copiesGroupKey),i=a.copyParts(n,a,!1)}finally{r.Qu()&&(r.copiesParentKeyOfNodeData=t),(r.bf()||r._u())&&(r.copiesGroupKeyOfNodeData=e);for(var o=i.iterator;o.next();){var l=o.value,h=o.key;l.location.isReal()||(h.location.isReal()?l.location=h.location:!l.position.isReal()&&h.position.isReal()&&(l.position=h.position)),s.add(l)}}}}return s}pasteSelection(t){void 0===t&&(t=null);var e=this.diagram;try{e.currentCursor="wait",e.V("ChangingSelection",e.selection),e.startTransaction("Paste");for(var i,s,n=this.pasteFromClipboard(),a=(0e.maxScale||(e.scale=t)}canDecreaseZoom(t){void 0===t&&(t=1/this.zoomFactor),Kt.r(t,Gt,"canDecreaseZoom:factor");var e=this.diagram;return 1===e.autoScale&&!((t=e.scale*t)e.maxScale)&&e.allowZoom}increaseZoom(t){void 0===t&&(t=this.zoomFactor),Kt.r(t,Gt,"increaseZoom:factor");var e=this.diagram;1!==e.autoScale||(t=e.scale*t)e.maxScale||(e.scale=t)}canIncreaseZoom(t){void 0===t&&(t=this.zoomFactor),Kt.r(t,Gt,"canIncreaseZoom:factor");var e=this.diagram;return 1===e.autoScale&&!((t=e.scale*t)e.maxScale)&&e.allowZoom}resetZoom(t){void 0===t&&(t=this.defaultScale),Kt.r(t,Gt,"resetZoom:newscale");var e=this.diagram;te.maxScale||(e.scale=t)}canResetZoom(t){void 0===t&&(t=this.defaultScale),Kt.r(t,Gt,"canResetZoom:newscale");var e=this.diagram;return!(te.maxScale)&&e.allowZoom}zoomToFit(){var t=this.diagram,e=t.animationManager,i=(e.stopAnimation(),t.redraw(),t.position),s=t.scale;e.zl("Zoom To Fit"),this.isZoomToFitRestoreEnabled&&s===this.X1&&!isNaN(this.z1)&&t.documentBounds.equals(this.Y1)?(t.scale=this.z1,t.position=this.s2,this.X1=NaN,this.Y1=Q.Xk):(this.z1=s,this.s2=i.copy(),t.zoomToFit(),this.X1=t.scale,this.Y1=t.documentBounds.copy()),e.FM()}canZoomToFit(){return this.diagram.allowZoom}scrollToPart(t){null!==(t=void 0===t?null:t)&&Kt.s(t,H,Gt,"part");const e=this.diagram;if(e.ensureBounds(),null===t){try{null!==this.Ho&&(this.Ho.next()?t=this.Ho.value:this.Ho=null)}catch{this.Ho=null}null===t&&(0{e.startTransaction();let t=a.pop();for(;0{Kt.Xh(r,(s.isEnabled?s.duration:0)+n)};e.addDiagramListener("LayoutCompleted",o),r()}}else{var i=e.position.copy();e.centerRect(t.actualBounds),i.equalsApprox(e.position)&&s.stopAnimation()}}}$f(t,e){var i;return t.isVisible()||(t instanceof K?this.$f(t.adornedPart,e):t instanceof Y?(null!==(i=t.fromNode)&&this.$f(i,e),null!==(i=t.toNode)&&this.$f(i,e)):(t instanceof D&&(null!==(i=t.labeledLink)&&this.$f(i,e),null!==(i=t.findTreeParentNode()))&&(i.isTreeExpanded||i.wasTreeExpanded||e.push(i),this.$f(i,e)),null!==(i=t.containingGroup)&&(i.isSubGraphExpanded||i.wasSubGraphExpanded||e.push(i),this.$f(i,e)))),e}canScrollToPart(t){return(null===(t=void 0===t?null:t)||t instanceof H)&&(0!==(t=this.diagram).selection.count||0!==t.highlighteds.count)&&t.allowHorizontalScroll&&t.allowVerticalScroll}collapseTree(t){void 0===t&&(t=null);var e=this.diagram,i="Collapse Tree";try{e.startTransaction(i),e.animationManager.zl(i);var s=new O;if(null!==t&&t.isTreeExpanded)t.collapseTree(),s.add(t);else if(null===t)for(var n=e.selection.iterator;n.next();){var a=n.value;a instanceof D&&a.isTreeExpanded&&(a.collapseTree(),s.add(a))}e.V("TreeCollapsed",s)}finally{e.commitTransaction(i)}}canCollapseTree(t){void 0===t&&(t=null);var e=this.diagram;if(!e.isReadOnly)if(null!==t){if(!(t instanceof D&&t.isTreeExpanded))return!1;if(0{t instanceof Y||t instanceof H&&i.push(t)});else for(var e=t.iterator;e.next();){var s=e.value;s instanceof Y||s instanceof H&&i.push(s)}var n=new N,a=i.length;for(let t=0;tt instanceof j&&t.editable)}null!==e&&(i.currentTool=null,t.textBlock=e,i.currentTool=t)}}canEditTextBlock(t){void 0===t&&(t=null);var e=this.diagram;if(!e.isReadOnly&&!e.isModelReadOnly&&e.allowTextEdit&&null!==e.toolManager.findTool("TextEditing"))if(null!==t){if(!(t instanceof j))return!1;var i=t.part;if(null!==i&&i.canEdit())return!0}else for(var s=e.selection.iterator;s.next();){var n=s.value;if(n.canEdit()&&null!==(t=n.findInVisualTree(t=>t instanceof j&&t.editable)))return!0}return!1}showContextMenu(e){var i=this.diagram,s=i.toolManager.findTool("ContextMenu");if(null!==s){void 0===e&&(e=0{null!==t.data&&t.f2()&&t.updateTargetBindings(i)})}}}}wF(t){this.od.remove(t)}Uo(){if(null!==this.diagram&&null===this.findBindingPanel()&&null!==this.Ii)for(var t=this.Ii.iterator;t.next();){var i=t.value;if(i.isToTheme){let t=null;var s=i.sourceName;i.isToObject&&(t=this.tL(s));let e=this;var n=i.targetId;-1!==n&&null===(e=this.M0(n))||("/"===s?t=e.part:"."===s?t=e:".."===s&&(t=e.panel),i.updateTarget(e,t))}}}Sa(e,i){var s=this.findBindingPanel();if(null!==s)for(var n=this.Ii.iterator;n.next();){var a,r=n.value;let t=null;if(r.isToObject){if(null===(t=r.iL(s,this)))continue;r.updateSource(this,t,i,null)}else if(r.isToModel){var o=e.diagram;null===o||o.xe||r.updateSource(this,o.model.modelData,i,s)}else if(!r.isToTheme){o=s.data;if(null===o)continue;var l=e.diagram;null===l||l.xe||r.updateSource(this,o,i,s)}t===this&&(l=r.targetId,null!==(a=s.M0(l)))&&r.updateTarget(a,t,i)}}M0(t){return this.so===t?this:null}tL(t){let e;return""===t||"/"===t||"."===t||".."===t?e=this:null===(e=this.part.findObject(t))&&(Ht,Kt.ft("Binding error: missing GraphObject named "+t+" in "+this.part.toString())),e}get so(){return null!==this.g?this.g.so:-1}set so(t){this.so!==t&&(null===this.g&&(this.g=new _t),this.g.so=t)}get Ii(){return null!==this.g?this.g.Ii:null}set Ii(t){this.Ii!==t&&(null===this.g&&(this.g=new _t),this.g.Ii=t)}get no(){return null!==this.g?this.g.no:null}set no(t){this.no!==t&&(null===this.g&&(this.g=new _t),this.g.no=t)}raiseChanged(t,e,i){this.raiseChangedEvent(2,t,this,e,i)}i(t,e,i){this.raiseChangedEvent(2,t,this,e,i)}oo(t,e,i,s){var n,a=this.ce;a.e(t,e,i,s),1===this.v&&0===this.qt||(null===this.Ni&&(this.Ni=new V),(n=this.Ni).ti(),this.P0(n,t,e,i,s),n.Nw(a))}eL(t,e,i){return!1!==this.pickable&&(i.hf(this.D),e?this.intersectsRect(t,i):this.containedInRect(t,i))}sL(t,e,i){var s;return!1!==this.pickable&&(s=this.naturalBounds,e=t.distanceSquaredPoint(e),i?_.distanceLineSegmentSquared(t.x,t.y,0,0,0,s.height)<=e||_.distanceLineSegmentSquared(t.x,t.y,0,s.height,s.width,s.height)<=e||_.distanceLineSegmentSquared(t.x,t.y,s.width,s.height,s.width,0)<=e||_.distanceLineSegmentSquared(t.x,t.y,s.width,0,0,0)<=e:t.distanceSquared(0,0)<=e&&t.distanceSquared(0,s.height)<=e&&t.distanceSquared(s.width,0)<=e&&t.distanceSquared(s.width,s.height)<=e)}Mn(){return!0}containsPoint(t){Ht,Kt.s(t,_,y,"containsPoint:p");var e=_.a(),i=(e.c(t),this.D.Pt(e),this.actualBounds);if(!i.isReal())return _.o(e),!1;var s=this.diagram;if(null!==s&&s.r0){var n=s.getInputOption("extraTouchThreshold"),a=s.getInputOption("extraTouchArea"),r=a/2,o=this.naturalBounds,s=this.getDocumentScale()*s.scale,l=1/s;if(o.width*sr.width&&l.widthr.height&&l.heighte.height||this.bi>e.width)&&(r=!0)}r?this.l|=256:this.l&=-257,this.Ri.isReal()||Kt.n("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ri.toString()),this.ad(t,this.Ri),this.ro(!1),Q.o(t)}gh(t,e,i,s){}commonArrange(e,i,s,n){if(this.Ri.e(e,i,s,n),!this.desiredSize.isReal()){var e=this.ce,i=this.ol,a=i.right+i.left,i=i.top+i.bottom,r=e.width+a,o=e.height+i;s+=a,n+=i;let t=this.qs(!0);switch(t=r===s&&o===n?0:t){case 0:(sd.width+d.x||d.x>c.width+c.x)return 1!==o&&(r.globalAlpha=n),void(""!==this.filter&&(r.filter=a));r.save(),r.beginPath(),r.rect(t,e,i,s),r.clip()}if(u){if(!h.isVisible())return 1!==o&&(r.globalAlpha=n),void(""!==this.filter&&(r.filter=a));e&&(g=h.shadowOffset,r.shadowsSet(g.x*i.scale*this.scale*i.Gi,g.y*i.scale*this.scale*i.Gi,h.shadowBlur),r.shadowsOn(),r.shadowColor=h.shadowColor)}c=this.naturalBounds;r.transform(s.m11,s.m12,s.m21,s.m22,s.dx,s.dy),this.oL(e,r,u,l),null!==this.Ft&&(r.commitTransform(),this.G1(r,c,d)),this.rL(e,r,u,l),this.ph(r,i),this.lL(e,r,u),t&&(r.restore(),r.clearContextCache(this instanceof Xt)),s.Gk()||(g=1/(s.m11*s.m22-s.m12*s.m21),r.transform(s.m22*g,-s.m12*g,-s.m21*g,s.m11*g,g*(s.m21*s.dy-s.m22*s.dx),g*(s.m12*s.dx-s.m11*s.dy)))}}1!==o&&(r.globalAlpha=n),""!==this.filter&&(r.filter=a)}}}oL(t,e,i,s){t&&!0===this.shadowVisible?e.shadowsOn():t&&!1===this.shadowVisible&&e.shadowsOff(),t&&this.H1(s)&&null===this.shadowVisible&&e.shadowsOff()}rL(t,e,i,s){t&&(null!==this.Ft||this.H1(s))?(this.v1(!0),null===this.shadowVisible&&e.shadowsOff()):this.v1(!1)}lL(t,e,i){t&&!0===this.u2()&&e.shadowsOn(),i&&t&&e.shadowsOff()}IR(t,e,i){var s=this.part;let n=!1;s&&t.getRenderingHint("drawShadows")&&(n=s.isShadowed),e.clipInsteadOfFill&&(n=!1),this.Ws()&&n&&e.shadowsOn(),n&&!0===this.shadowVisible?e.shadowsOn():n&&!1===this.shadowVisible&&e.shadowsOff();s=this.panel;return n&&this.H1(s)&&null===this.shadowVisible&&e.shadowsOff(),e.hl&&(t=t.computePixelRatio(),t=`drop-shadow(${e.shadowOffsetX/t}px ${e.shadowOffsetY/t}px ${e.shadowBlur/t/2}px ${e.shadowColor})`,null!==this.background)&&i.Ft.setAttributeNS(null,"filter",t),n&&(null!==this.Ft||this.H1(s))?(this.v1(!0),null===this.shadowVisible&&e.shadowsOff()):this.v1(!1),n}OR(t,e,i,s){i.hl&&(e=e.computePixelRatio(),e=`drop-shadow(${i.shadowOffsetX/e}px ${i.shadowOffsetY/e}px ${i.shadowBlur/e/2}px ${i.shadowColor})`,this.d2(t,e)),s&&!0===this.u2()&&i.shadowsOn(),this.Ws()&&i.shadowsOff()}H1(t){return null!==t&&((t=t.ll()?t.panel:t).u2()||(t.type===Xt.Auto||t.type===Xt.Spot)&&t.findMainElement()!==this)}d2(t,e){}G1(t,e,i){var s=this.K1(),n=e.x,a=e.y,r=e.width+s,o=e.height+s;this.bn(t,this.Ft,!0,!1,e,i),this.Ft instanceof m&&3===this.Ft.type?(t.beginPath(),t.rect(n-s/2,a-s/2,r,o),t.fillContext(this.Ft,!1,null)):t.fillRect(n-s/2,a-s/2,r,o)}hL(t,e){let i=t.ER(this);if(-1!==i)if(0===i)t.svg.Ft?t.svg.Ft.after(e):t.type===Xt.Table?null!==(s=0!==(s=t.svg.getElementsByClassName("gojs-ts")).length?s[0]:null)&&s.after(e):t.svg.prepend(e);else{for(;0!==i&&!t.elt(i-1).isVisibleObject();)i--;var s;0===i?t.svg.prepend(e):null!==(s=t.elt(i-1).svg)?s.after(e):t.svg.appendChild(e)}}FR(t,e){var i,s,n,a,r,o,l;return t instanceof Jt&&(!this.visible||0===this.opacity||this.Ws()&&!this.isVisible()?null!==this.svg&&null!==this.svg.parentNode&&this.svg.remove():(i=this.panel,r=this.fd(t),this.sc(t,e,r)?(this.aL(this.svg),null!==this.svg.parentElement?this.Ws()&&(t.lastDrawnPart=this.svg):this.Ws()?(null!==t.lastDrawnPart?t.lastDrawnPart.after(this.svg):t.diagramGroup.prepend(this.svg),t.lastDrawnPart=this.svg):i&&this.hL(i,this.svg)):(this.Ws()&&this.isShadowed&&(a=this.shadowOffset,t.shadowsSet(a.x*e.scale*this.scale*e.Gi,a.y*e.scale*this.scale*e.Gi,this.shadowBlur),t.shadowsOn(),t.shadowColor=this.shadowColor),this instanceof j&&(t.font=this.font),t.currentElement=null,a=this.D,l=this instanceof Xt,o=this instanceof Xt&&this.ll(),s=this.svg,!0===this.N0()&&this.U1(),n=this.Ri,t.setCurrentTransform(1,0,0,1,0,0),t.outerGroup=!1,r&&(t.outerGroup=!0,l&&o?(t.newGroup(1,0,0,1,0,0),this.svg=t.lastCreatedElement):l?(t.newGroup(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),this.svg=t.lastCreatedElement):t.newGroup(1,0,0,1,0,0)),r=this.naturalBounds,l||t.setCurrentTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),null!==this.background&&(l?(o&&t.setCurrentTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),this.G1(t,r,n),o&&t.setCurrentTransform(1,0,0,1,0,0)):(t.setCurrentTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy),this.G1(t,r,n)),t.currentElement.Ft=t.lastCreatedElement,t.currentElement.prepend(t.lastCreatedElement)),o=this.IR(e,t,t.currentElement),this.ph(t,e),l&&t.endGroup(),t.outerGroup&&t.endGroup(),a=t.surface.$u,r=l?this.svg:t.currentElement,l||null===s||r===s||s.parentNode!==this.panel.svg?(this.svg=r,null!==a&&null===r&&t.dummyGroup(),null!==r&&(this.T0(t,i,n,r),this.OR(r,e,t,o),1!==(l=this.Ws()?this.opacity*t.globalAlpha:this.opacity)&&r.setAttributeNS(null,"opacity",l.toString()),""!==this.filter&&r.setAttributeNS(null,"filter",this.filter),this.Ws()?(null!==s&&r!==s&&s.parentNode===t.diagramGroup?(null!==(e=s.getAttribute("filter"))&&r.setAttribute("filter",e),s.replaceWith(r)):t.lastDrawnPart?t.lastDrawnPart.after(r):t.diagramGroup.prepend(r),t.lastDrawnPart=r):null!==i&&this.hL(i,r),null!==a&&a(this,r),this.aL(r))):(null!==(o=this.svg.getAttribute("filter"))&&r.setAttribute("filter",o),this.svg.replaceWith(r),null!==(this.svg=r)&&this.T0(t,i,n,r),this.fL(t,s)))),!0)}aL(t){var e=this,t=t.dataset;e instanceof y&&(null!==e.portId&&(t.portId=e.portId),e instanceof Xt)&&(isNaN(e.itemIndex)||(t.itemIndex=e.itemIndex.toString()),e instanceof H)&&(t.className=Kt.an(e),void 0!==e.key&&(t.key=e.key.toString()),e instanceof Y)&&(null!==e.fromNode&&void 0!==e.fromNode.key&&(t.fromKey=e.fromNode.key.toString()),""!==e.fromPortId&&(t.fromPortId=e.fromPortId),null!==e.toNode&&void 0!==e.toNode.key&&(t.toKey=e.toNode.key.toString()),""!==e.toPortId)&&(t.toPortId=e.toPortId)}T0(a,r,o,l){let t=0!=(256&this.l);if(t=a.clipInsteadOfFill?!1:t){r=r.Mn()?r.naturalBounds:r.actualBounds;let t=Math.max(o.x,r.x),e=Math.max(o.y,r.y),i=Math.min(o.right,r.right)-t,s=Math.min(o.bottom,r.bottom)-e;var h,u,o=this.hi,r=(null!==o&&(t=o.x,e=o.y,i=o.width,s=o.height),l.getAttribute("clip-path"));let n=null;null===(n=null!==r?a.svg.getElementById(r.split("#")[1].slice(0,-1)):n)?(o="CLIP"+N.fu++,r=a.makeElement("clipPath",{id:o}),h=a.makeElement("rect",{x:t,y:e,width:i,height:s}),this instanceof Xt&&(u=this.D.copy().Mw(),h.setAttribute("transform",`matrix(${u.m11}, ${u.m12}, ${u.m21}, ${u.m22}, ${u.dx}, ${u.dy})`)),r.appendChild(h),a.svg.appendChild(r),l.setAttributeNS(null,"clip-path","url(#"+o+")")):((u=n.firstElementChild).setAttribute("x",t.toString()),u.setAttribute("y",e.toString()),u.setAttribute("width",i.toString()),u.setAttribute("height",s.toString()))}else l.removeAttributeNS(null,"clip-path"),this.fL(a,l)}fL(t,e){e=e.getAttribute("clip-path");null!==e&&null!==(t=t.svg.getElementById(e.split("#")[1].slice(0,-1)))&&t.remove()}VR(){if(null!==this.svg){var t=this.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),e=this.svg.ownerDocument;if(null!==t)for(const s of t){var i=e.getElementById(s.split("#")[1].slice(0,-1));null!==i&&i.remove()}this.svg.remove()}}RR(t,e){var i=this.Ri,s=this.Hi,n=this.Ft;null!==n&&t.commitTransform(),null!==n&&(this.bn(t,n,!0,!1,s,i),n instanceof m&&3===n.type?(t.beginPath(),t.rect(i.x,i.y,i.width,i.height),t.fillContext(n,!1,null)):t.fillRect(i.x,i.y,i.width,i.height)),this.ph(t,e)}ph(t,e){}g2(){this.fs(!0)}sc(t,e,i){var s=this.svg;if(this.BR())return this.g2(),this.fs(!1),null!==s&&(null!==(a=this.svg.getAttribute("clip-path"))&&null!==(r=t.svg.getElementById(a.split("#")[1].slice(0,-1))))&&r.remove(),!1;if(null===s)return!1;if(!this.visible)return s.remove(),!1;if("g"!==s.nodeName&&i||"g"===s.nodeName&&!i)return!1;var n=this.D,a=this instanceof Xt,r=this instanceof Xt&&this.ll();if(!a||!r)if(this instanceof Le){a=this.q1;t.setCurrentTransform(n.m11,n.m12,n.m21,n.m22,n.dx,n.dy),null!==a&&t.amendImageTransform(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]),(i?s.lastElementChild:s).setAttributeNS(null,"transform",t.getCurrentTransform())}else if(!i||this instanceof Xt)s.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")");else if(this instanceof q){var o=s.getElementsByTagName("path");for(let t=0;td&&(o=d);let t=Math.sqrt(o*o/(1+u*u));i+=t=h<0?-t:t,s+=u*t,g?e.lineTo(i,s):e.moveTo(i,s),d-=o,g=!g}}bn(h,u,d,c,g,m){let f=1,p=1;if("string"==typeof u)d?h.fillStyle=u:h.strokeStyle=u;else if(1===u.type)d?h.fillStyle=u.color:h.strokeStyle=u.color;else{let l;var v=this.K1(),g=(f=g.width,p=g.height,c?(f=m.width,p=m.height):d||(f+=v,p+=v),h instanceof te);if(g&&u.Pn&&(4===u.type||u.nc===f&&u.W1===p))l=u.Pn;else{let t,e,i,s,n=0,a=0,r=0,o=0;if(c?(r=m.x,o=m.y):d||(r-=v/2,o-=v/2),t=u.start.x*f+u.start.offsetX+r,e=u.start.y*p+u.start.offsetY+o,i=u.end.x*f+u.end.offsetX+r,s=u.end.y*p+u.end.offsetY+o,2===u.type)l=h.createLinearGradient(t,e,i,s);else if(3===u.type)a=isNaN(u.endRadius)?Math.max(f,p)/2:u.endRadius,isNaN(u.startRadius)?(n=0,a=Math.max(f,p)/2):n=u.startRadius,l=h.createRadialGradient(t,e,n,i,s,a);else if(4===u.type)try{l=h.createPattern(u.pattern,"repeat")}catch{l=null}else Kt.Bi(u.type,"Brush type");if(4!==u.type){c=u.colorStops;if(null!==c)for(var y=c.iterator;y.next();)l.addColorStop(y.key,y.value)}if(g&&(null!==(u.Pn=l)&&(u.nc=f,u.W1=p),null===l)&&4===u.type&&-1!==u.nc){u.nc=-1;const b=this.diagram;null!==b&&-1===u.nc&&Kt.Xh(()=>{b.redraw()},600)}}d?h.fillStyle=l:h.strokeStyle=l}}isContainedBy(t){return t instanceof Xt&&this.zR(this,t)}zR(e,i){if(e!==i&&null!==i){let t=e.panel;for(;null!==t;){if(t===i)return!0;t=t.panel}}return!1}isVisibleObject(){var t;return!!this.visible&&(null===(t=this.panel)||t.isVisibleObject())}isEnabledObject(){let t=this instanceof Xt?this:this.panel;for(;null!==t&&t.isEnabled;)t=t.panel;return null===t}get enabledChanged(){return null!==this.g?this.g.D0:null}set enabledChanged(t){var e=this.enabledChanged;e!==t&&(null!==t&&Kt.t(t,"function",y,"enabledChanged"),this.Zt(),this.g.D0=t,this.i("enabledChanged",e,t))}U1(){if(!0===this.j1()){var t=this.nl;if(t.ti(),!this.Ri.isReal()||!this.ce.isReal())return void this.cd(!1);t.se(this.Ri.x-this.ce.x,this.Ri.y-this.ce.y),1===this.scale&&0===this.angle||(e=this.naturalBounds,this.P0(t,e.x,e.y,e.width,e.height)),this.cd(!1),this.Ma(!0)}var e;!0===this.N0()&&(null===(t=this.panel)?(this.ch.set(this.nl),this.Qf=this.scale):null!==t.Ms&&((e=this.ch).ti(),t.Mn()?e.hf(t.ch):null!==t.panel&&e.hf(t.panel.ch),e.hf(this.nl),this.Qf=this.scale*t.Qf),this.Ma(!1))}P0(t,e,i,s,n){var a;1!==this.v&&t.v(this.v),0!==this.qt&&((a=_.a()).setSpot(e,i,s,n,Z.Center),t.ys(this.qt,a.x,a.y),_.o(a))}u(t){var e;this.Ko()||(void 0===t&&(t=!1),this.ae(!0),this.ro(!0),null===(e=this.panel))||t||e.u()}oc(){this.Ko()||(this.ae(!0),this.ro(!0))}rc(t){var e;this.hs()||(e=this.panel,t||null===e||e.u(),this.ro(!0))}hd(){!1===this.j1()&&(this.cd(!0),this.Ma(!0))}m2(){this.Ma(!0)}T(){var t=this.part;null!==t&&t.T()}qs(t){var e=this.stretch,i=this.panel;return null!==i&&i.type===Xt.Table?this.F0(i.getRowDefinition(this.row),i.getColumnDefinition(this.column),t):null!==i&&i.type===Xt.Auto&&i.findMainElement()===this?this.Wo(2,t):1===e?null!==i?i.type===Xt.Spot&&i.findMainElement()===this?this.Wo(2,t):1===(i=i.defaultStretch)?this.Wo(0,t):this.Wo(i,t):this.Wo(0,t):this.Wo(e,t)}F0(t,e,i){var s=this.stretch;if(1!==s)return this.Wo(s,i);let n=null,a=null;switch(t.stretch){case 1:case 5:break;case 4:case 2:a=!0}switch(e.stretch){case 1:case 4:break;case 5:case 2:n=!0}s=this.panel.defaultStretch;return null===n&&(n=5===s||2===s),null===a&&(a=4===s||2===s),!0===n&&!0===a?this.Wo(2,i):!0===n?this.Wo(5,i):!0===a?this.Wo(4,i):this.Wo(0,i)}Wo(t,e){if(!e){if(0===t)return 0;e=this.desiredSize;if(e.isReal())return 0;var i=!isNaN(e.width),e=!isNaN(e.height),s=this.angle;if(i)if(90!==s&&270!==s){if(5===t)return 0;if(2===t)return 4}else{if(4===t)return 0;if(2===t)return 5}if(e)if(90!==s&&270!==s){if(4===t)return 0;if(2===t)return 5}else{if(5===t)return 0;if(2===t)return 4}}return t}get segmentOrientation(){return null!==this.Ut?this.Ut.R0:0}set segmentOrientation(t){var e=this.segmentOrientation;e!==t&&(Ht,Kt.it(t,jt,"Orientation"),null===this.Ut&&(this.Ut=new Ye),this.Ut.R0=t,this.u(),this.i("segmentOrientation",e,t),0===t)&&(this.angle=0)}XR(){this.segmentOrientation=21}get segmentIndex(){return null!==this.Ut?this.Ut.I0:-1/0}set segmentIndex(t){Ht,Kt.t(t,"number",y,"segmentIndex"),t=Math.round(t);var e=this.segmentIndex;e!==t&&(null===this.Ut&&(this.Ut=new Ye),this.Ut.I0=t,this.u(),this.i("segmentIndex",e,t))}get segmentFraction(){return null!==this.Ut?this.Ut.O0:0}set segmentFraction(t){Ht,Kt.t(t,"number",y,"segmentFraction"),isNaN(t)||t<0?t=0:1= 0",y,"column"),this.vo=t,this.u(),this.i("column",e,t),null!==this.svg)&&this.svg.remove()}get columnSpan(){return null!==this.g?this.g.B0:1}set columnSpan(t){Ht,Kt.t(t,"number",y,"columnSpan"),t=Math.round(t);var e=this.columnSpan;e!==t&&(t<1&&Kt.G(t,">= 1",y,"columnSpan"),this.Zt(),this.g.B0=t,this.u(),this.i("columnSpan",e,t))}get row(){return this.ed}set row(t){Ht,Kt.r(t,y,"row"),t=Math.round(t);var e=this.ed;e!==t&&(t<0&&Kt.G(t,">= 0",y,"row"),this.ed=t,this.u(),this.i("row",e,t),null!==this.svg)&&this.svg.remove()}get rowSpan(){return null!==this.g?this.g.z0:1}set rowSpan(t){Ht,Kt.t(t,"number",y,"rowSpan"),t=Math.round(t);var e=this.rowSpan;e!==t&&(t<1&&Kt.G(t,">= 1",y,"rowSpan"),this.Zt(),this.g.z0=t,this.u(),this.i("rowSpan",e,t))}get spanAllocation(){return null!==this.g?this.g.X0:null}set spanAllocation(t){var e=this.spanAllocation;e!==t&&(null!==t&&Kt.t(t,"function",y,"spanAllocation"),this.Zt(),this.g.X0=t,this.u(),this.i("spanAllocation",e,t))}get alignmentFocus(){return this._f}set alignmentFocus(t){var e=this._f;e.equals(t)||(Ht,Kt.s(t,Z,y,"alignmentFocus"),Ht,!t.isNoSpot()||t.isDefault()||t.isNone()&&this instanceof D||Kt.n("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+t),t=t.L(),this._f=t,this.u(),this.i("alignmentFocus",e,t))}get portId(){return this.td}set portId(t){var e,i=this.td;i!==t&&(Ht,null!==t&&Kt.t(t,"string",y,"portId"),null===(e=this.part)||e instanceof D||Kt.n("Cannot set portID on a Link: "+t),e=e,null!==i&&null!==e&&e.k2(this),null!==(this.td=t)&&null!==e&&(e.Nn=!0,e.uL(this)),this.i("portId",i,t))}Na(){var t,e=this.part;e instanceof D&&(null!==this.portId||this===e.port)&&null!==(t=e.diagram)&&!t.undoManager.isUndoingRedoing&&e.nL(this)}cL(){var t=this.diagram;null===t||t.undoManager.isUndoingRedoing||(this instanceof Xt?this instanceof D?this.invalidateConnectedLinks():this.walkVisualTreeFrom(this,t=>{t.Na()}):this.Na())}get toSpot(){return null!==this.$?this.$.ya:Z.None}set toSpot(t){var e=this.toSpot;e.equals(t)||(Ht,Kt.s(t,Z,y,"toSpot"),t=t.L(),this.je(),this.$.ya=t,this.i("toSpot",e,t),this.Na())}get toEndSegmentLength(){return null!==this.$?this.$.xa:10}set toEndSegmentLength(t){var e=this.toEndSegmentLength;e!==t&&(Ht,Kt.t(t,"number",y,"toEndSegmentLength"),t<0&&Kt.G(t,">= 0",y,"toEndSegmentLength"),this.je(),this.$.xa=t,this.i("toEndSegmentLength",e,t),this.Na())}get toShortLength(){return null!==this.$?this.$.ka:0}set toShortLength(t){var e=this.toShortLength;e!==t&&(Ht,Kt.t(t,"number",y,"toShortLength"),this.je(),this.$.ka=t,this.i("toShortLength",e,t),this.Na())}get toLinkable(){return null!==this.$?this.$.Y0:null}set toLinkable(t){var e=this.toLinkable;e!==t&&(Ht,null!==t&&Kt.t(t,"boolean",y,"toLinkable"),this.je(),this.$.Y0=t,this.i("toLinkable",e,t))}get toMaxLinks(){return null!==this.$?this.$.K0:1/0}set toMaxLinks(t){var e=this.toMaxLinks;e!==t&&(Ht,Kt.t(t,"number",y,"toMaxLinks"),t<0&&Kt.G(t,">= 0",y,"toMaxLinks"),this.je(),this.$.K0=t,this.i("toMaxLinks",e,t))}get fromSpot(){return null!==this.$?this.$.pa:Z.None}set fromSpot(t){var e=this.fromSpot;e.equals(t)||(Ht,Kt.s(t,Z,y,"fromSpot"),t=t.L(),this.je(),this.$.pa=t,this.i("fromSpot",e,t),this.Na())}get fromEndSegmentLength(){return null!==this.$?this.$.wa:10}set fromEndSegmentLength(t){var e=this.fromEndSegmentLength;e!==t&&(Ht,Kt.t(t,"number",y,"fromEndSegmentLength"),t<0&&Kt.G(t,">= 0",y,"fromEndSegmentLength"),this.je(),this.$.wa=t,this.i("fromEndSegmentLength",e,t),this.Na())}get fromShortLength(){return null!==this.$?this.$.ba:0}set fromShortLength(t){var e=this.fromShortLength;e!==t&&(Ht,Kt.t(t,"number",y,"fromShortLength"),this.je(),this.$.ba=t,this.i("fromShortLength",e,t),this.Na())}get fromLinkable(){return null!==this.$?this.$.U0:null}set fromLinkable(t){var e=this.fromLinkable;e!==t&&(Ht,null!==t&&Kt.t(t,"boolean",y,"fromLinkable"),this.je(),this.$.U0=t,this.i("fromLinkable",e,t))}get fromMaxLinks(){return null!==this.$?this.$.G0:1/0}set fromMaxLinks(t){var e=this.fromMaxLinks;e!==t&&(Ht,Kt.t(t,"number",y,"fromMaxLinks"),t<0&&Kt.G(t,">= 0",y,"fromMaxLinks"),this.je(),this.$.G0=t,this.i("fromMaxLinks",e,t))}get cursor(){return null!==this.g?this.g.Dl:""}set cursor(t){var e=this.cursor;e!==t&&(Kt.t(t,"string",y,"cursor"),this.Zt(),this.g.Dl=t,this.i("cursor",e,t))}get click(){return null!==this.g?this.g.Vr:null}set click(t){var e=this.click;e!==t&&(null!==t&&Kt.t(t,"function",y,"click"),this.Zt(),this.g.Vr=t,this.i("click",e,t))}get doubleClick(){return null!==this.g?this.g.Br:null}set doubleClick(t){var e=this.doubleClick;e!==t&&(null!==t&&Kt.t(t,"function",y,"doubleClick"),this.Zt(),this.g.Br=t,this.i("doubleClick",e,t))}get contextClick(){return null!==this.g?this.g.zr:null}set contextClick(t){var e=this.contextClick;e!==t&&(null!==t&&Kt.t(t,"function",y,"contextClick"),this.Zt(),this.g.zr=t,this.i("contextClick",e,t))}get mouseEnter(){return null!==this.g?this.g.Gr:null}set mouseEnter(t){var e=this.mouseEnter;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseEnter"),this.Zt(),this.g.Gr=t,this.i("mouseEnter",e,t))}get mouseLeave(){return null!==this.g?this.g.Hr:null}set mouseLeave(t){var e=this.mouseLeave;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseLeave"),this.Zt(),this.g.Hr=t,this.i("mouseLeave",e,t))}get mouseOver(){return null!==this.g?this.g.Xr:null}set mouseOver(t){var e=this.mouseOver;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseOver"),this.Zt(),this.g.Xr=t,this.i("mouseOver",e,t))}get mouseHover(){return null!==this.g?this.g.Yr:null}set mouseHover(t){var e=this.mouseHover;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseHover"),this.Zt(),this.g.Yr=t,this.i("mouseHover",e,t))}get mouseHold(){return null!==this.g?this.g.Kr:null}set mouseHold(t){var e=this.mouseHold;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseHold"),this.Zt(),this.g.Kr=t,this.i("mouseHold",e,t))}get mouseDragEnter(){return null!==this.g?this.g.H0:null}set mouseDragEnter(t){var e=this.mouseDragEnter;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseDragEnter"),this.Zt(),this.g.H0=t,this.i("mouseDragEnter",e,t))}get mouseDragLeave(){return null!==this.g?this.g.v0:null}set mouseDragLeave(t){var e=this.mouseDragLeave;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseDragLeave"),this.Zt(),this.g.v0=t,this.i("mouseDragLeave",e,t))}get mouseDrop(){return null!==this.g?this.g.Ur:null}set mouseDrop(t){var e=this.mouseDrop;e!==t&&(null!==t&&Kt.t(t,"function",y,"mouseDrop"),this.Zt(),this.g.Ur=t,this.i("mouseDrop",e,t))}get actionDown(){return null!==this.g?this.g.q0:null}set actionDown(t){var e=this.actionDown;e!==t&&(null!==t&&Kt.t(t,"function",y,"actionDown"),this.Zt(),this.g.q0=t,this.i("actionDown",e,t))}get actionMove(){return null!==this.g?this.g.W0:null}set actionMove(t){var e=this.actionMove;e!==t&&(null!==t&&Kt.t(t,"function",y,"actionMove"),this.Zt(),this.g.W0=t,this.i("actionMove",e,t))}get actionUp(){return null!==this.g?this.g.j0:null}set actionUp(t){var e=this.actionUp;e!==t&&(null!==t&&Kt.t(t,"function",y,"actionUp"),this.Zt(),this.g.j0=t,this.i("actionUp",e,t))}get actionCancel(){return null!==this.g?this.g.J0:null}set actionCancel(t){var e=this.actionCancel;e!==t&&(null!==t&&Kt.t(t,"function",y,"actionCancel"),this.Zt(),this.g.J0=t,this.i("actionCancel",e,t))}get toolTip(){return null!==this.g?this.g.vr:null}set toolTip(t){var e=this.toolTip;e!==t&&(Ht,null===t||(t instanceof K||t instanceof pt)||Kt.n("GraphObject.toolTip must be an Adornment or HTMLInfo."),this.Zt(),this.g.vr=t,this.i("toolTip",e,t))}get contextMenu(){return null!==this.g?this.g.qr:null}set contextMenu(t){var e=this.contextMenu;e!==t&&(Ht,t instanceof K||t instanceof pt||Kt.n("GraphObject.contextMenu must be an Adornment or HTMLInfo."),this.Zt(),this.g.qr=t,this.i("contextMenu",e,t))}findBindingPanel(){let t=this instanceof Xt?this:this.panel;for(;null!==t;){if(t.S2())return t;t=t.panel}return null}bind(t,e,i,s){return this.lc(t,e,i,s),this}bindTwoWay(t,e,i,s){return this.lc(t,e,i,s).makeTwoWay(),this}bindModel(t,e,i,s){return this.lc(t,e,i,s).ofModel(),this}bindObject(t,e,i,s,n){return this.lc(t,e,i,s).ofObject(n),this}theme(t,e,i,s,n){return this.yh(t,e,i,s,n),this}themeData(t,e,i,s,n){return this.yh(t,e,i,s,n).ofData(),this}themeObject(t,e,i,s,n,a){return this.yh(t,e,i,s,n).ofObject(a),this}themeModel(t,e,i,s,n){return this.yh(t,e,i,s,n).ofModel(),this}lc(t,e,i,s){let n=null;return n="string"==typeof t?new ai(t,e,i,s):t,this.Z0(n),n}yh(t,e,i,s,n){let a=null;return a="string"==typeof t?new ri(t,e,i,s,n):t,this.Z0(a),a}Z0(t){var e=(t.Te=this).findBindingPanel();null!==e&&e.dL()&&Kt.n("Cannot add a Binding to a template that has already been copied: "+t),null===this.Ii&&(this.Ii=new O),this.Ii.add(t)}set(t){Ht;for(const e in t)!e.startsWith("_")&&-1===e.indexOf(".")||Kt.n("Property with underscore or period passed to GraphObject.set. Did you mean to use GraphObject.attach?");return Object.assign(this,t),this}attach(t){return y.M2(this,t),this}apply(t){return t(this),this}setProperties(t){return G.p0(this,t),this}static build(t,e,...i){var s=y.$0.getValue(t);if("function"==typeof s){s=s([t].concat(i));if(s instanceof y)return e&&s.setProperties(e),s}Kt.n('GraphObject.build invoked object builder "'+t+'", but it did not return an Object')}static make(t){let e=arguments,i=null,s=null;var n;"function"==typeof t?s=t:"string"==typeof t&&("function"==typeof(n=y.$0.getValue(t))?(e=Array.prototype.slice.call(e),i=n(e),Kt.Mt(i)||Kt.n('GraphObject.make invoked object builder "'+t+'", but it did not return an Object')):s=v.go[t]),null===i&&(null!=s&&s.constructor||Kt.n("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+t),i=new s);let a=1;i instanceof G&&1{var e=2.76142374915397,i=2.761423749153969,e=new Xt(Xt.Auto,{isActionable:!0,enabledChanged:(t,e)=>{var i;t instanceof Xt&&null!==(i=t.findObject("ButtonBorder"))&&(e?(t._buttonFillDisabled=i.fill,i.fill=t._buttonFillNormal):(t._buttonFillNormal=i.fill,i.fill=t._buttonFillDisabled))},cursor:"pointer"}).attach({_buttonFillNormal:"#f5f5f5",_buttonStrokeNormal:"#737373",_buttonFillOver:"#d4d4d4",_buttonStrokeOver:"#737373",_buttonFillDisabled:"#a3a3a3"}).add(new q("RoundedRectangle",{name:"ButtonBorder",spot1:new Z(0,0,e,i),spot2:new Z(1,1,-e,-i),parameter1:2,fill:"#f5f5f5",stroke:"#737373"}));return e.mouseEnter=(t,e,i)=>{var s;e.isEnabledObject()&&e instanceof Xt&&(s=e.findObject("ButtonBorder"))instanceof q&&(e._buttonFillNormal=s.fill,s.fill=e._buttonFillOver,e._buttonStrokeNormal=s.stroke,s.stroke=e._buttonStrokeOver)},e.mouseLeave=(t,e,i)=>{var s;e.isEnabledObject()&&e instanceof Xt&&(s=e.findObject("ButtonBorder"))instanceof q&&(s.fill=e._buttonFillNormal,s.stroke=e._buttonStrokeNormal)},e}),y.defineBuilder("TreeExpanderButton",t=>{var e=y.build("Button");return e.attach({_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine",visible:!1}),e.add(new q("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:Yt.du}).bindObject("figure","isTreeExpanded",(t,e)=>{e=e.panel;return t?e._treeExpandedFigure:e._treeCollapsedFigure})),e.bindObject("visible","isTreeLeaf",t=>!t),e.click=(t,e)=>{let i=e.part;if((i=i instanceof K?i.adornedPart:i)instanceof D){e=i.diagram;if(null!==e){e=e.commandHandler;if(i.isTreeExpanded){if(!e.canCollapseTree(i))return}else if(!e.canExpandTree(i))return;t.handled=!0,i.isTreeExpanded?e.collapseTree(i):e.expandTree(i)}}},e}),y.defineBuilder("SubGraphExpanderButton",t=>{var e=y.build("Button");return e.attach({_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"}),e.add(new q("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:Yt.du}).bindObject("figure","isSubGraphExpanded",(t,e)=>{e=e.panel;return t?e._subGraphExpandedFigure:e._subGraphCollapsedFigure})),e.click=(t,e)=>{let i=e.part;if((i=i instanceof K?i.adornedPart:i)instanceof X){e=i.diagram;if(null!==e){e=e.commandHandler;if(i.isSubGraphExpanded){if(!e.canCollapseSubGraph(i))return}else if(!e.canExpandSubGraph(i))return;t.handled=!0,i.isSubGraphExpanded?e.collapseSubGraph(i):e.expandSubGraph(i)}}},e}),y.defineBuilder("ToolTip",t=>new K(Xt.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new _(0,2)}).add(new q("RoundedRectangle",{name:"Border",parameter1:1,fill:"#f5f5f5",strokeWidth:0,spot1:new Z(0,0,4,6),spot2:new Z(1,1,-4,-4)}))),y.defineBuilder("ContextMenu",t=>new K(Xt.Vertical,{background:"#f5f5f5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new _(0,2)}).bindObject("background","",t=>null!==t.adornedPart&&t.hasPlaceholder()?null:"#f5f5f5")),y.defineBuilder("ContextMenuButton",t=>{var e=y.build("Button"),i=(e.stretch=5,e.findObject("ButtonBorder"));return i instanceof q&&(i.figure="Rectangle",i.strokeWidth=0,i.spot1=new Z(0,0,4,6),i.spot2=new Z(1,1,-4,-4)),e}),y.defineBuilder("PanelExpanderButton",t=>{const n=y.takeBuilderArgument(t,"COLLAPSIBLE"),e=y.build("Button");e.attach({_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}),e.add(new q({name:"ButtonIcon",strokeWidth:2}).bindObject("geometryString","visible",t=>t?e._buttonExpandedFigure:e._buttonCollapsedFigure,void 0,n));t=e.findObject("ButtonBorder");return t instanceof q&&(t.stroke=null,t.fill="rgba(0, 0, 0, 0)"),e.click=(e,i)=>{if(i instanceof Xt){var s=i.diagram;if(null!==s&&!s.isReadOnly){let t=i.findBindingPanel();null!==(t=null===t?i.part:t)&&null!==(i=t.findObject(n))&&(e.handled=!0,s.startTransaction("Collapse/Expand Panel"),i.visible=!i.visible,s.commitTransaction("Collapse/Expand Panel"))}}},e}),y.defineBuilder("CheckBoxButton",t=>{const n=y.takeBuilderArgument(t),e=y.build("Button",{desiredSize:new Yt(14,14)});e.attach({"ButtonBorder.spot1":new Z(0,0,1,1),"ButtonBorder.spot2":new Z(1,1,-1,-1)});t=new q({name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:2,geometryStretch:6,visible:!1});return""!==n&&t.bindTwoWay("visible",n),e.add(t),e.click=(t,e)=>{var i,s;e instanceof Xt&&(null===(i=t.diagram)||i.isReadOnly||""!==n&&i.model.isReadOnly||(t.handled=!0,s=e.findObject("ButtonIcon"),i.startTransaction("checkbox"),null!==s&&(s.visible=!s.visible),"function"==typeof e._doClick&&e._doClick(t,e),i.commitTransaction("checkbox")))},e}),y.defineBuilder("CheckBox",t=>{var t=y.takeBuilderArgument(t),t=y.build("CheckBoxButton",{name:"Button",isActionable:!1,margin:new I(0,1,0,0)},t),e=new Xt("Horizontal",{isActionable:!0,cursor:t.cursor,margin:new I(1),mouseEnter:t.mouseEnter,mouseLeave:t.mouseLeave,click:t.click}).attach({_buttonFillNormal:t._buttonFillNormal,_buttonStrokeNormal:t._buttonStrokeNormal,_buttonFillOver:t._buttonFillOver,_buttonStrokeOver:t._buttonStrokeOver,_buttonFillDisabled:t._buttonFillDisabled,_buttonClick:t.click});return e.add(t),t.mouseEnter=null,t.mouseLeave=null,t.click=null,e})}}class _t{xi;Tt;so;Ii;no;js;Dl;Vr;Br;zr;Gr;Hr;Xr;Yr;Kr;H0;v0;Ur;q0;W0;j0;J0;vr;qr;D0;X0;Ns;Cr;Ar;lo;z0;B0;Nr;L0;Q0;_0;constructor(){this.xi=!1,this.Tt="",this.so=-1,this.Ii=null,this.no=null,this.js=null,this.Dl="",this.Vr=null,this.Br=null,this.zr=null,this.Gr=null,this.Hr=null,this.Xr=null,this.Yr=null,this.Kr=null,this.H0=null,this.v0=null,this.Ur=null,this.q0=null,this.W0=null,this.j0=null,this.J0=null,this.vr=null,this.qr=null,this.D0=null,this.X0=null,this.Ns=null,this.Cr=Yt.lf,this.Ar=Yt.zk,this.lo=1,this.z0=1,this.B0=1,this.Nr=0,this.L0=null,this.Q0=null,this._0="category"}copy(){var t=new _t;return t.Tt=this.Tt,t.so=this.so,t.Ii=this.Ii,t.js=this.js,t.Dl=this.Dl,t.Vr=this.Vr,t.Br=this.Br,t.zr=this.zr,t.Gr=this.Gr,t.Hr=this.Hr,t.Xr=this.Xr,t.Yr=this.Yr,t.Kr=this.Kr,t.H0=this.H0,t.v0=this.v0,t.Ur=this.Ur,t.q0=this.q0,t.W0=this.W0,t.j0=this.j0,t.J0=this.J0,t.vr=this.vr,t.qr=this.qr,t.D0=this.D0,t.X0=this.X0,t.Ns=this.Ns,t.Cr=this.Cr.L(),t.Ar=this.Ar.L(),t.lo=this.lo,t.z0=this.z0,t.B0=this.B0,t.Nr=this.Nr,t.L0=this.L0,t.Q0=this.Q0,t._0=this._0,t}}class Wt{m;constructor(){this.m=[1,0,0,1,0,0]}copy(){var t=new Wt;return t.m[0]=this.m[0],t.m[1]=this.m[1],t.m[2]=this.m[2],t.m[3]=this.m[3],t.m[4]=this.m[4],t.m[5]=this.m[5],t}translate(t,e){this.m[4]+=this.m[0]*t+this.m[2]*e,this.m[5]+=this.m[1]*t+this.m[3]*e}scale(t,e){this.m[0]*=t,this.m[1]*=t,this.m[2]*=e,this.m[3]*=e}rotate(i,s,n){if(360<=i?i-=360:i<0&&(i+=360),0!==i){this.translate(s,n);let t=0,e=0;e=90===i?(t=0,1):180===i?(t=-1,0):270===i?(t=0,-1):(i=i*Math.PI/180,t=Math.cos(i),Math.sin(i));var i=this.m[0]*t+this.m[2]*e,a=this.m[1]*t+this.m[3]*e,r=this.m[0]*-e+this.m[2]*t,o=this.m[1]*-e+this.m[3]*t;this.m[0]=i,this.m[1]=a,this.m[2]=r,this.m[3]=o,this.translate(-s,-n)}}}class Qt{type;x1;y1;r1;x2;y2;r2;colors;pattern;constructor(t){this.type=t,this.x1=0,this.y1=0,this.r1=0,this.x2=0,this.y2=0,this.r2=0,this.colors=[],this.pattern=null}addColorStop(t,e){this.colors.push({offset:t,color:e})}}class Zt{Bt;gi;ga;$u;P2;constructor(t,e,i){var e=void 0===e?v.document:e,s=(this.ga=e,this.P2="http://www.w3.org/2000/svg","http://www.w3.org/2000/xmlns/");void 0!==e&&(this.Bt=this.makeElement("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",i||(this.style.position="absolute"),this.Bt.setAttributeNS(s,"xmlns",this.P2),this.Bt.setAttributeNS(s,"xmlns:xlink","http://www.w3.org/1999/xlink")),this.$u=null,this.gi=new Jt(this,i)}resize(t,e,i,s){return(this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this.style.width=i+"px",this.style.height=s+"px",this.Bt.setAttributeNS(null,"width",i+"px"),this.Bt.setAttributeNS(null,"height",s+"px"),this.Bt.setAttributeNS(null,"viewBox","0 0 "+i+" "+s),this.gi.N2.firstElementChild.setAttributeNS(null,"width",i+"px"),this.gi.N2.firstElementChild.setAttributeNS(null,"height",s+"px"),!0)}makeElement(t,e,i){var s=this.ga.createElementNS(this.P2,t);if(Kt.Mt(e))for(const n in e)s.setAttributeNS("href"===n?"http://www.w3.org/1999/xlink":"",n,e[n]);return void 0!==i&&(s.textContent=i),s}getBoundingClientRect(){return this.Bt.getBoundingClientRect()}focus(){this.Bt.focus()}get width(){return this.Bt.width.baseVal.value}set width(t){this.Bt.setAttribute("width",t+"px")}get height(){return this.Bt.height.baseVal.value}set height(t){this.Bt.setAttribute("height",t+"px")}dispose(){this.ga=null}get style(){return this.Bt.style}}class Jt{hc;ac;Cn;Oi;Je;fillStyle;font;globalAlpha;lineCap;lineDashOffset;lineJoin;lineWidth;miterLimit;shadowBlur;shadowColor;shadowOffsetX;shadowOffsetY;strokeStyle;textAlign;imageSmoothingEnabled;clipInsteadOfFill;lastCreatedElement;fc;cc;surface;svg;N2;gL;Z1;jo;wh;Ca;currentElement;clipPathGroup;diagramGroup;lastDrawnPart;currentPath;outerGroup;pathAttributes;hl;Fr;filter;partClipRect;constructor(t,e){this.surface=t,this.svg=t.Bt,this.fc=[],this.cc=[],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.shadowOffsetX=0,this.shadowOffsetY=0,this.hl=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.hc=0,this.ac=0,this.Cn=0,this.lastCreatedElement=null,this.currentElement=null,this.Oi=[],this.pathAttributes={},this.Z1=!1,this.jo=null,this.wh=0,this.Je=new Wt,this.clipPathGroup=this.newGroup2(),this.diagramGroup=this.newGroup2("gojs-diagram"),this.lastDrawnPart=null,this.currentPath=null;var i=N.fu++,s=this.makeElement("clipPath",{id:"mainClip"+i}),t={x:0,y:0,width:t.width,height:t.height};s.appendChild(this.makeElement("rect",t)),this.N2=s,this.svg.appendChild(this.clipPathGroup),this.clipPathGroup.appendChild(this.diagramGroup),this.svg.appendChild(s),this.clipPathGroup.setAttributeNS(null,"clip-path","url(#mainClip"+i+")"),this.gL={},this.Fr=!!e,this.filter="",this.partClipRect=null}setDiagramPosScale(t,e,i,s,n,a){void 0===this.diagramGroup?this.newGroup(t,e,i,s,n,a):this.diagramGroup.setAttribute("transform","matrix("+t+", "+e+", "+i+", "+s+", "+n+", "+a+")")}resetInnerSVG(){null!==this.diagramGroup&&(this.diagramGroup.innerHTML="")}arc(t,e,i,s,n,a,r,o){var l=2*Math.PI,h=l-1e-6,u=i*Math.cos(s),d=i*Math.sin(s),c=t+u,g=e+d,m=a?0:1;let f=a?s-n:n-s;(1e-6h?(this.Oi.push(["A",i,i,0,1,m,t-u,e-d]),this.Oi.push(["A",i,i,0,1,m,c,g])):1e-6=Math.PI),m,t+i*Math.cos(n),e+i*Math.sin(n)])}beginPath(){this.Oi=[],this.pathAttributes={stroke:"none",fill:"none"}}endPath(t){this.GR(this.Oi,this.Je,t||0)}bezierCurveTo(t,e,i,s,n,a){this.Oi.push(["C",t,e,i,s,n,a])}clearRect(t,e,i,s){}clip(){this.pathAttributes.clipPath=!0}closePath(){this.Oi.push(["z"])}createLinearGradient(t,e,i,s){var n=new Qt("linear");return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}createPattern(t,e){let i="";t instanceof HTMLCanvasElement&&(i=t.toDataURL()),t instanceof HTMLImageElement&&(i=t.getAttribute("src"));var s,n,a=this.gL;return a[i]?"url(#"+a[i]+")":(s="PATTERN"+N.fu++,n={width:t.width,height:t.height,id:s,patternUnits:"userSpaceOnUse"},t={x:0,y:0,width:t.width,height:t.height,href:i},(n=this.makeElement("pattern",n)).appendChild(this.makeElement(G.img,t)),this.svg.appendChild(n),"url(#"+(a[i]=s)+")")}createRadialGradient(t,e,i,s,n,a){var r=new Qt("radial");return r.x1=t,r.y1=e,r.r1=i,r.x2=s,r.y2=n,r.r2=a,r}amendImageTransform(t,e,i,s,n,a,r,o){r/=i,i=o/s;0===n&&0===a||this.Je.translate(n,a),1==r&&1==i||this.Je.scale(r,i),0===t&&0===e||this.Je.translate(-t,-e)}drawImage(t,e,i,s,n,a,r,o,l){let h="";t instanceof HTMLCanvasElement&&(h=t.toDataURL()),t instanceof HTMLImageElement&&(h=t.getAttribute("src"));var u=t instanceof HTMLImageElement?t.naturalWidth:t.width,t=t instanceof HTMLImageElement?t.naturalHeight:t.height,a=(void 0===s&&(a=e,r=i,o=s=u,l=n=t),this.amendImageTransform(e,i,s=s||0,n=n||0,a=a||0,r=r||0,o=o||0,l=l||0),{x:0,y:0,width:u||s,height:t||n,href:h});z.q(s,o)&&z.q(n,l)?-1===h.toLowerCase().indexOf(".svg")&&-1===h.toLowerCase().indexOf("data:image/svg")&&(a.preserveAspectRatio="xMidYMid slice"):a.preserveAspectRatio="none",0===e&&0===i&&s===u&&n===t||(a["clip-path"]=`path('M ${e},${i} L ${s+=e} ${i} L ${s} ${n+=i} L ${e} ${n} z')`),this.processCommon(G.img,a,this.Je),this.dd(G.img,a)}fill(t,e){t&&(this.pathAttributes["fill-rule"]="evenodd"),this.setFill(this.pathAttributes)}fillContext(t,e,i){this.clipInsteadOfFill?this.clip():this.fill(e,i)}fillRect(t,e,i,s){this.addRect("fill",[t,e,i,s],this.Je)}fillBackground(t,e,i,s){t={x:t,y:e,width:i,height:s};this.processCommon("fill",t,this.Je),this.setFill(t),this.svg.prepend(this.makeElement("rect",t))}fillText(t,e,i){this.addText("fill",[t,e,i],this.Je)}lineTo(t,e){this.Oi.push(["L",t,e])}moveTo(t,e){this.Oi.push(["M",t,e])}quadraticCurveTo(t,e,i,s){this.Oi.push(["Q",t,e,i,s])}rect(t,e,i,s){this.Oi.push(["M",t,e],["L",t+i,e],["L",t+i,e+s],["L",t,e+s],["z"])}restore(){this.Je=this.fc.pop(),this.Oi=this.fc.pop();var t=this.fc.pop();this.fillStyle=t.fillStyle,this.font=t.font,this.globalAlpha=t.globalAlpha,this.lineCap=t.lineCap,this.lineDashOffset=t.lineDashOffset,this.lineJoin=t.lineJoin,this.lineWidth=t.lineWidth,this.miterLimit=t.miterLimit,this.shadowBlur=t.shadowBlur,this.shadowColor=t.shadowColor,this.shadowOffsetX=t.shadowOffsetX,this.shadowOffsetY=t.shadowOffsetY,this.strokeStyle=t.strokeStyle,this.textAlign=t.textAlign,this.partClipRect=t.partClipRect}save(){var t={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,partClipRect:this.partClipRect},e=(this.fc.push(t),[]);for(let t=0;tt.offset>e.offset?1:-1);for(let t=0;t= zero",m,"startRadius"),this.ip=t,this.Pn=null}get endRadius(){return this.ep}set endRadius(t){this.f&&Kt.O(this,t),Kt.r(t,m,"endRadius"),t<0&&Kt.G(t,">= zero",m,"endRadius"),this.ep=t,this.Pn=null}get colorStops(){return this.An}set colorStops(t){this.f&&Kt.O(this,t),Ht,Kt.s(t,L,m,"colorStops"),this.An=t,this.Pn=null}get pattern(){return this.sp}set pattern(t){this.f&&Kt.O(this,t),this.sp=t,this.Pn=null}static randomColor(t,e){void 0===t&&(t=128),(Ht,Kt.r(t,m,"randomColor:min"),t<0||255s&&o=i&&oe&&(l=t,t=e,e=l,l=i,i=s,s=l);var l=e-t;return m.isDark(m.mix(n.get(t),n.get(e),1-s/l))}}static isDark(t){return!!t&&(t instanceof m?t.isDark():(m.Bo(t),(299*m.j.n0+587*m.j.n1+114*m.j.n2)/1e3<128))}static gd(t,e){switch(e){case 1:return m.vR(),m.ho.n0=Math.min(100,Math.max(0,m.ho.n0+100*t)),m.qR(),"rgba("+m.j.n0+", "+m.j.n1+", "+m.j.n2+", "+m.j.n3+")";case 2:return m.UM(),m.Yi.n2=Math.min(100,Math.max(0,m.Yi.n2+100*t)),"hsla("+m.Yi.n0+", "+m.Yi.n1+"%, "+m.Yi.n2+"%, "+m.Yi.n3+")";case 3:return m.WR(),m.ao.n0=Math.min(100,Math.max(0,m.ao.n0+100*t)),m.jR(),"rgba("+m.j.n0+", "+m.j.n1+", "+m.j.n2+", "+m.j.n3+")";default:Kt.n("Unknown color space: "+e)}}static Bo(t){var e,i=m.al;null!==i&&(i.clearRect(0,0,1,1),i.fillStyle="#000000",e=i.fillStyle,i.fillStyle=t,i.fillStyle!==e?(i.fillRect(0,0,1,1),e=i.getImageData(0,0,1,1).data,m.j.n0=e[0],m.j.n1=e[1],m.j.n2=e[2],m.j.n3=e[3]/255):(i.fillStyle="#FFFFFF",e=i.fillStyle,i.fillStyle=t,i.fillStyle===e&&(Ht,Kt.n('Color "'+t+'" is not a valid color string for RGBA color conversion')),m.j.n0=0,m.j.n1=0,m.j.n2=0,m.j.n3=1))}static UM(){var t=m.j.n0/255,e=m.j.n1/255,i=m.j.n2/255,s=Math.max(t,e,i),n=Math.min(t,e,i),a=s-n;let r,o;n=(s+n)/2;if(0==a)r=o=0;else{switch(s){case t:r=(e-i)/a%6;break;case e:r=(i-t)/a+2;break;case i:r=(t-e)/a+4}(r*=60)<0&&(r+=360),o=a/(1-Math.abs(2*n-1))}m.Yi.n0=Math.round(r),m.Yi.n1=Math.round(100*o),m.Yi.n2=Math.round(100*n),m.Yi.n3=m.j.n3}static dE(){var t=m.Yi.n0,e=m.Yi.n1/100,i=m.Yi.n2/100;let s,n,a;var e=(1-Math.abs(2*i-1))*e,t=t/60,r=e*(1-Math.abs(t%2-1)),t=(0<=t&&t<1?(s=e,n=r,a=0):1<=t&&t<2?(s=r,n=e,a=0):2<=t&&t<3?(s=0,n=e,a=r):3<=t&&t<4?(s=0,n=r,a=e):4<=t&&t<5?(s=r,n=0,a=e):5<=t&&t<6&&(s=e,n=0,a=r),i-.5*e);s+=t,n+=t,a+=t,m.j.n0=Math.round(255*s),m.j.n1=Math.round(255*n),m.j.n2=Math.round(255*a),m.j.n3=m.Yi.n3}static vR(){m.mL(),m.JR()}static qR(){m.ZR(),m.pL()}static C2(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}static A2(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055}static mL(){var t=m.C2(m.j.n0),e=m.C2(m.j.n1),i=m.C2(m.j.n2);m.zt.n0=.4124564*t+.3575761*e+.1804375*i,m.zt.n1=.2126729*t+.7151522*e+.072175*i,m.zt.n2=.0193339*t+.119192*e+.9503041*i,m.zt.n3=m.j.n3}static pL(){var t=3.2404542*m.zt.n0+-1.5371385*m.zt.n1+-.4985314*m.zt.n2,e=-.969266*m.zt.n0+1.8760108*m.zt.n1+.041556*m.zt.n2,i=.0556434*m.zt.n0+-.2040259*m.zt.n1+1.0572252*m.zt.n2;m.j.n0=255*m.A2(t),m.j.n1=255*m.A2(e),m.j.n2=255*m.A2(i),m.j.n3=m.zt.n3,m.j.n0=Math.round(m.j.n0),255m.L2?Math.pow(t,1/3):(m.tb*t+16)/116}static JR(){var t=m.T2(100*m.zt.n0/m.md[0]),e=m.T2(100*m.zt.n1/m.md[1]),i=m.T2(100*m.zt.n2/m.md[2]);m.ho.n0=116*e-16,m.ho.n1=500*(t-e),m.ho.n2=200*(e-i),m.ho.n3=m.zt.n3}static yL(t){var e=t*t*t;return e>m.L2?e:(116*t-16)/m.tb}static ZR(){var t=(m.ho.n0+16)/116,e=m.ho.n1/500+t,i=t-m.ho.n2/200;m.zt.n0=m.md[0]/100*m.yL(e),m.zt.n1=m.md[1]/100*(m.ho.n0>m.tb*m.L2?Math.pow(t,3):m.ho.n0/m.tb),m.zt.n2=m.md[2]/100*m.yL(i),m.zt.n3=m.ho.n3}static $R(){var t=.8190224*m.zt.n0+.3619062*m.zt.n1+-.1288737*m.zt.n2,e=.03298366*m.zt.n0+.9292868*m.zt.n1+.03614466*m.zt.n2,i=.04817719*m.zt.n0+.2642395*m.zt.n1+.6335478*m.zt.n2,t=Math.cbrt(t),e=Math.cbrt(e),i=Math.cbrt(i);m.mi.n0=.2104542*t+.7936177*e+-.004072046*i,m.mi.n1=1.977998*t+-2.428592*e+.4505937*i,m.mi.n2=.02590403*t+.7827717*e+-.8086757*i,m.mi.n3=m.zt.n3,m.mi.n0*=100}static QR(){m.mi.n0/=100;var t=(.9999999*m.mi.n0+.3963377*m.mi.n1+.2158037*m.mi.n2)**3,e=(1.000000009*m.mi.n0+-.1055613*m.mi.n1+-.06385417*m.mi.n2)**3,i=(1.00000005*m.mi.n0+-.08948418*m.mi.n1+-1.291485*m.mi.n2)**3;m.zt.n0=1.2268798*t+-.5578149*e+.281391*i,m.zt.n1=-.04057576*t+1.112286*e+-.07171106*i,m.zt.n2=-.07637294*t+-.4214933*e+1.586924*i,m.zt.n3=m.mi.n3}static _R(){var t=180*Math.atan2(m.mi.n2,m.mi.n1)/Math.PI;m.ao.n0=m.mi.n0,m.ao.n1=Math.sqrt(m.mi.n1**2+m.mi.n2**2),m.ao.n2=0<=t?t:360+t,m.ao.n3=m.mi.n3}static tI(){m.mi.n0=m.ao.n0,m.mi.n1=m.ao.n1*Math.cos(m.ao.n2*Math.PI/180),m.mi.n2=m.ao.n1*Math.sin(m.ao.n2*Math.PI/180),m.mi.n3=m.ao.n3}static WR(){m.mL(),m.$R(),m._R()}static jR(){m.tI(),m.QR(),m.pL()}static ud(t,e){"string"==typeof t?(Ht,m.isValidColor(t)||Kt.n('Color "'+t+'" is not a valid color string for '+e)):t instanceof m||Kt.n("Value for "+e+" must be a color string or a Brush, not "+t)}static Solid=1;static Linear=2;static Radial=3;static Pattern=4;static Lab=1;static HSL=2;static al=G.isUsingDOM()?new $t(null,void 0,{willReadFrequently:!0}).gi:null;static j=new ie;static Yi=new ie;static zt=new ie;static ho=new ie;static mi=new ie;static ao=new ie}class se{Tt="Base";static Layouts=new L;static definePanelLayout(t,e){e.name=t,se.Layouts.add(t,e)}get name(){return this.Tt}set name(t){this.Tt=t}constructor(){}get classType(){return Xt}measure(t,e,i,s,n,a,r){}measureElement(t,e,i,s,n){t.wt(e,i,s,n)}arrange(t,e,i){}arrangeElement(t,e,i,s,n,a){t.vt(e,i,s,n,a)}remeasureObject(t){t.oc()}Ji(t,e,i){}}class ne extends se{constructor(){super()}measure(t,i,s,e,n,a,r){var o=e.length,l=t.Jo();for(let t=0;tg&&(p=Math.max(g-b,0)),m.Zi=m.Zi+p,m.actual=m.at+p,g=Math.max(g-(p+(w?b:0)),0)),1!==A.columnSpan||0!==v&&4!==v||(x=(m=r.getColumnDefinition(e)).computeEffectiveSpacing(),w=0===m.at,(p=Math.max(y-m.actual,0))+(w?x:0)>c&&(p=Math.max(c-x,0)),m.Zi=m.Zi+p,m.actual=m.at+p,c=Math.max(c-(p+(w?x:0)),0)),(st||nt)&&A.oc())}}}Kt.ot(K);let P=0,k=0;e=r.columnCount;for(let t=0;t=r.rowCount);t++)m=r.getRowDefinition(E.row+t),p=0,p=2===v||4===v?Math.max(m.minimum,0===B[E.row+t]?m.maximum:Math.min(B[E.row+t],m.maximum)):Math.max(m.minimum,isNaN(m.ke)?m.maximum:Math.min(m.ke,m.maximum)),yt.height+=p,i+=m.minimum;for(let t=1;t=r.columnCount);t++)m=r.getColumnDefinition(E.column+t),p=0,p=2===v||5===v?Math.max(m.minimum,0===F[E.column+t]?m.maximum:Math.min(F[E.column+t],m.maximum)):Math.max(m.minimum,isNaN(m.ke)?m.maximum:Math.min(m.ke,m.maximum)),yt.width+=p,e+=m.minimum;N.width+=yt.width,N.height+=yt.height;var wt=E.margin,At=wt.right+wt.left,wt=wt.top+wt.bottom,Pt=(E.wt(N.width,N.height,e,i),E.measuredBounds),At=Math.max(Pt.width+At,0),Pt=Math.max(Pt.height+wt,0);let s=0;for(let t=0;t=r.rowCount);t++)m=r.getRowDefinition(E.row+t),s+=m.total||0;if(s=r.rowCount);t++){var Mt=(m=r.getRowDefinition(E.row+t)).at||0,Ct=St(E,m,kt);Ht,"number"!=typeof Ct&&Kt.n(E+" spanAllocation does not return a number: "+Ct),m.actual=Math.min(m.maximum,Mt+Ct),m.at!==Mt&&(e-=m.at-Mt)}}for(;0Nt&&(m.actual=Math.min(m.maximum,Nt+e),m.at!==Nt)&&(e-=m.at-Nt),0===m.index)break;m=r.getRowDefinition(m.index-1)}}let n=0;for(let t=0;t=r.columnCount);t++)m=r.getColumnDefinition(E.column+t),n+=m.total||0;if(n=r.columnCount);t++){var Tt=(m=r.getColumnDefinition(E.column+t)).at||0,Bt=Dt(E,m,Lt);Ht,"number"!=typeof Bt&&Kt.n(E+" spanAllocation does not return a number: "+Bt),m.actual=Math.min(m.maximum,Tt+Bt),m.at!==Tt&&(e-=m.at-Tt)}}for(;0Ft&&(m.actual=Math.min(m.maximum,Ft+e),m.at!==Ft)&&(e-=m.at-Ft),0===m.index)break;m=r.getColumnDefinition(m.index-1)}}}}Kt.ot(Y),Yt.o(yt),Yt.o(N),void 0!==B&&Kt.ot(B),void 0!==F&&Kt.ot(F);let Et=0,Rt=0;var Ot=r.desiredSize,It=r.maxSize;v=r.qs(!0),P=0;let Vt=k=0,zt=0;e=r.columnCount;for(let t=0;t=m.rowCount);t++){var F=m.getRowDefinition(d+t);0!==F.at&&(C.height+=F.total)}for(let t=1;t=m.columnCount);t++){var E=m.getColumnDefinition(u+t);0!==E.at&&(C.width+=E.total)}var R=L.at+C.width,O=N.at+C.height,I=c,V=g,_=R,W=O,z=c,G=g;let t=R,e=O,i=(c+R>f.width&&(t=Math.max(f.width-c,0)),g+O>f.height&&(e=Math.max(f.height-g,0)),T.alignment),s=0,n=0,a=0,r=0,o=(i.isDefault()?((i=m.defaultAlignment).isSpot()||(i=Z.Center),s=i.x,n=i.y,a=i.offsetX,r=i.offsetY,q=L.alignment,j=N.alignment,q.isSpot()&&(s=q.x,a=q.offsetX),j.isSpot()&&(n=j.y,r=j.offsetY)):(s=i.x,n=i.y,a=i.offsetX,r=i.offsetY),(isNaN(s)||isNaN(n))&&(s=.5,n=.5,a=0,r=0),B.width),l=B.height;var q=T.margin,j=q.left+q.right,H=q.top+q.bottom,K=T.F0(N,L,!1),R=(!isNaN(T.desiredSize.width)||2!==K&&5!==K||(o=Math.max(R-j,0)),!isNaN(T.desiredSize.height)||2!==K&&4!==K||(l=Math.max(O-H,0)),T.maxSize),K=T.minSize,O=(o=Math.min(R.width,o),l=Math.min(R.height,l),o=Math.max(K.width,o),l=Math.max(K.height,l),o+j),R=l+H;I+=_*s-O*s+a+q.left,V+=W*n-R*n+r+q.top,T.visible&&(Q.contains(z,G,t,e,I,V,B.width,B.height)?T.vt(I,V,o,l):T.vt(I,V,o,l,new Q(z,G,t,e)))}}}Yt.o(C);for(let t=0;te.graduatedMin+C&&(S=Math.floor((a-e.graduatedMin)/C),a-=S*C);var N=v[t],L=a,D=1e-6*e.graduatedMax;for(let t=1;a<=e.graduatedMax+D;t++){if(this.lI(e,a-e.graduatedTickBase,N)&&(a>e.graduatedMax&&(a=e.graduatedMax),null===P.graduatedSkip||P instanceof j&&!P.graduatedSkip(a,P)||P instanceof q&&!P.graduatedSkip(a,P))&&w<=(x=(x=(a-e.graduatedMin)*d/e.graduatedRange)>d?d:x)&&x<=A){let e=c[s][n],t=u[s][n];for(;si&&n= 0",Xt,"padding"),t=new I(t)):(Kt.s(t,I,Xt,"padding"),t.left<0&&Kt.G(t.left,">= 0",Xt,"padding:value.left"),t.right<0&&Kt.G(t.right,">= 0",Xt,"padding:value.right"),t.top<0&&Kt.G(t.top,">= 0",Xt,"padding:value.top"),t.bottom<0&&Kt.G(t.bottom,">= 0",Xt,"padding:value.bottom"));var e=this.ei;e.equals(t)||(t=t.L(),this.ei=t,this.u(),this.i("padding",e,t))}get defaultAlignment(){return this.yd}set defaultAlignment(t){var e=this.yd;e.equals(t)||(Ht,Kt.s(t,Z,Xt,"defaultAlignment"),t=t.L(),this.yd=t,this.u(),this.i("defaultAlignment",e,t))}get defaultStretch(){return this.Jn}set defaultStretch(t){var e=this.Jn;e!==t&&(this.Jn=t,this.u(),this.i("defaultStretch",e,t))}get defaultSeparatorPadding(){return null!==this.B?this.B.op:I.qg}set defaultSeparatorPadding(t){"number"==typeof t?t=new I(t):(Ht,Kt.s(t,I,Xt,"defaultSeparatorPadding"));var e=this.defaultSeparatorPadding;e.equals(t)||(t=t.L(),null===this.B&&(this.B=new be),this.B.op=t,this.u(),this.i("defaultSeparatorPadding",e,t))}get defaultRowSeparatorStroke(){return null!==this.B?this.B.rp:null}set defaultRowSeparatorStroke(t){var e=this.defaultRowSeparatorStroke;e!==t&&(null===t||"string"==typeof t||t instanceof m)&&(t instanceof m&&t.w(),null===this.B&&(this.B=new be),this.B.rp=t,this.T(),this.i("defaultRowSeparatorStroke",e,t))}get defaultRowSeparatorStrokeWidth(){return null!==this.B?this.B.lp:1}set defaultRowSeparatorStrokeWidth(t){var e=this.defaultRowSeparatorStrokeWidth;e!==t&&isFinite(t)&&0<=t&&(null===this.B&&(this.B=new be),this.B.lp=t,this.u(),this.i("defaultRowSeparatorStrokeWidth",e,t))}get defaultRowSeparatorDashArray(){return null!==this.B?this.B.hp:null}set defaultRowSeparatorDashArray(i){var t=this.defaultRowSeparatorDashArray;if(t!==i){if(null===i||Array.isArray(i)||Kt.Bi(i,"Array",Xt,"defaultRowSeparatorDashArray:value"),null!==i){var s=i.length;let e=0;for(let t=0;tl.height)continue}else if(h.position>l.width)continue;let s=h.separatorStrokeWidth,n=(isNaN(s)&&(s=r?this.defaultRowSeparatorStrokeWidth:this.defaultColumnSeparatorStrokeWidth),h.separatorStroke);if(null===n&&(n=r?this.defaultRowSeparatorStroke:this.defaultColumnSeparatorStroke),0!==s&&null!==n){this.bn(a,n,!1,!1,l,o);let t=!1,e=h.separatorDashArray;null!==(e=null===e?r?this.defaultRowSeparatorDashArray:this.defaultColumnSeparatorDashArray:e)&&(t=!0,a.enableDash(e,0)),a.beginPath();var u=h.position+s;r?u>l.height&&(s-=u-l.height):u>l.width&&(s-=u-l.width);let i=h.position+s/2;a.lineWidth=s;var d,u=this.ei;r?(i+=u.top,h=u.left,d=l.width-u.right,a.moveTo(h,i),a.lineTo(d,i)):(i+=u.left,h=u.top,d=l.height-u.bottom,a.moveTo(i,h),a.lineTo(i,d)),a.stroke(),a.endPath(),t&&a.disableDash()}}}}sb(n,t,a,e,i){var s=e.length,r=this.actualBounds,o=this.naturalBounds,l=this.SL(!0),h=this.SL(!1);for(let t=0;td)){let t=u.computeEffectiveSpacing(),e=u.separatorStrokeWidth,i=(isNaN(e)&&(e=a?this.defaultRowSeparatorStrokeWidth:this.defaultColumnSeparatorStrokeWidth),u.separatorStroke);null===i&&(i=a?this.defaultRowSeparatorStroke:this.defaultColumnSeparatorStroke),t-=e=null!==i&&u.index!==(a?l:h)?e:0;var c=u.position+e;let s=t+u.actual;(s=c+s>d?d-c:s)<=0||(d=this.ei,this.bn(n,u.background,!0,!1,o,r),a?n.fillRect(d.left,c+d.top,r.width-(d.left+d.right),s):n.fillRect(c+d.left,d.top,s,r.height-(d.top+d.bottom)))}}}}SL(e){var i=e?this.rowCount:this.columnCount;for(let t=0;te&&h.set(n),_.o(n)),_.o(S),u&&h.D(d),i}}Bu(){var e=this.F.h,i=e.length;for(let t=0;td.width||u.y>d.height||u.x+u.width<0||u.y+u.height<0)){let t=h;d=h instanceof Xt?h:null,u=V.a();u.set(e),(null!==d?d.Um(i,s,n,a,r,u):t.eL(i,a,u))&&null!==(t=null!==s?s(t):t)&&(null===n||n(t))&&r.add(t),V.o(u)}}}}return void 0===t&&V.o(e),a}void 0===t&&V.o(e)}return!1}V2(e,i,s){var n=this.F.h;for(let t=n.length;t--;){var a=n[t];if(a.visible){var r=a.actualBounds,o=this.naturalBounds;if(!(r.x>o.width||r.y>o.height||r.x+r.width<0||r.y+r.height<0)){a instanceof Xt&&a.V2(e,i,s);let t=a;null===(t=null!==e?e(t):t)||null!==i&&!i(t)||s.add(t)}}}}oA(e,i,s,n,a,r){if(!1!==this.pickable){void 0===s&&(s=null),void 0===n&&(n=null);var t=this.naturalBounds,o=this.Mn(),l=o?e:_.H(e.x,e.y).Ge(this.D),h=o?i:_.H(i.x,i.y).Ge(this.D),u=l.distanceSquaredPoint(h),d=0y.width||v.y>y.height||v.x+v.width<0||v.y+v.height<0)){p.Mn()?(y=p.D,c.set(e).Ge(y),g.set(i).Ge(y)):(c.set(e),g.set(i));let t=p;v=p instanceof Xt?p:null;(null!==v?v.oA(c,g,s,n,a,r):t.sL(c,g,a))&&null!==(t=null!==s?s(t):t)&&(null===n||n(t))&&r.add(t)}}}_.o(c),_.o(g)}return a?d:t}}return!1}F2(t){let e=null;return e=null===(e=t instanceof q&&((e=t.spot1)===Z.Default&&(e=null),null!==(t=t.geometry))&&null===e?t.spot1:e)?Z.TopLeft:e}R2(t){let e=null;return e=null===(e=t instanceof q&&((e=t.spot2)===Z.Default&&(e=null),null!==(t=t.geometry))&&null===e?t.spot2:e)?Z.BottomRight:e}add(...e){for(let t=0;t=n.count&&t>=n.count)return;n.removeAt(e),a=e}else Kt.n("element "+i.toString()+" has panel "+s.toString()+" but is not contained by it.")}(t<0||t>n.count)&&(t=n.count),n.insertAt(t,i),0!==t&&!i.isPanelMain||(this.fl=null),this.Ko()||this.u(),i.u(!1),(null!==i.portId||i instanceof Xt&&!0===i.Nn)&&(this.Nn=!0),this.cs=null,this.isEnabledObject()||this.nb(i,!1);s=this.part;null!==s&&(s.V0(),s.gc(),this.Nn&&s instanceof D&&(s.Nn=!0),s.Nn&&s instanceof D&&(s.ue=null),null!==(n=this.diagram)&&n.undoManager.isUndoingRedoing||(-1!==a&&s.raiseChangedEvent(4,"elements",this,i,null,a,null),s.raiseChangedEvent(3,"elements",this,null,i,null,t)))}get Nn(){return 0!=(8388608&this.l)}set Nn(t){0!=(8388608&this.l)!==t&&(this.l=8388608^this.l)}f2(){return 0!=(16777216&this.l)}B2(t){t?this.l|=16777216:this.l&=-16777217}dI(t){t.Pa(this),t.rl=null;var e,i=this.F,s=i.count,i=(i.insertAt(s,t),this.part);null!==i&&(i.V0(),null!==t.portId&&i instanceof D&&(i.Nn=!0),null!==(e=this.diagram)&&e.undoManager.isUndoingRedoing||i.raiseChangedEvent(3,"elements",this,null,t,null,s))}ER(e){var i=this.F.h,s=i.length;let n=-1;for(let t=0;ta.k2(e,i)):a.k2(n,i)),null!==(e=this.diagram)&&e.undoManager.isUndoingRedoing||a.raiseChangedEvent(4,"elements",this,n,null,t,null))}get Ze(){return null===this.B&&(this.B=new be),this.B.Ze}get rowCount(){return null===this.B?0:this.Ze.length}getRowDefinition(t){Ht,Kt.r(t,Xt,"getRowDefinition:idx"),t<0&&Kt.G(t,">= 0",Xt,"getRowDefinition:idx"),t=Math.round(t);var e,i=this.Ze;return void 0===i[t]&&((e=new we).Pa(this),e.isRow=!0,i[e.index=t]=e,this.raiseChangedEvent(3,"rowdefs",this,null,e,null,t)),i[t]}removeRowDefinition(e){if(Ht,Kt.r(e,Xt,"removeRowDefinition:idx"),e<0&&Kt.G(e,">= 0",Xt,"removeRowDefinition:idx"),0!==this.rowCount){e=Math.round(e);var i=this.Ze,s=i[e];if(s){i[e]=void 0;let t=i.length-1;for(;0<=t&&void 0===i[t--];)i.length--;this.raiseChangedEvent(4,"rowdefs",this,s,null,e,null),this.u()}}}IA(t,e){var i=this.Ze;if(!(t<0)){if(i[t]=e instanceof we?e:void 0,!e){let t=i.length-1;for(;0<=t&&void 0===i[t--];)i.length--}this.u()}}get $e(){return null===this.B&&(this.B=new be),this.B.$e}get columnCount(){return null===this.B?0:this.$e.length}getColumnDefinition(t){Ht,Kt.r(t,Xt,"getColumnDefinition:idx"),t<0&&Kt.G(t,">= 0",Xt,"getColumnDefinition:idx"),t=Math.round(t);var e,i=this.$e;return void 0===i[t]&&((e=new we).Pa(this),e.isRow=!1,i[e.index=t]=e,this.raiseChangedEvent(3,"coldefs",this,null,e,null,t)),i[t]}removeColumnDefinition(e){if(Ht,Kt.r(e,Xt,"removeColumnDefinition:idx"),e<0&&Kt.G(e,">= 0",Xt,"removeColumnDefinition:idx"),0!==this.columnCount){e=Math.round(e);var i=this.$e,s=i[e];if(s){i[e]=void 0;let t=i.length-1;for(;0<=t&&void 0===i[t--];)i.length--;this.raiseChangedEvent(4,"coldefs",this,s,null,e,null),this.u()}}}OA(t,e){var i=this.$e;if(!(t<0)){if(i[t]=e instanceof we?e:void 0,!e){let t=i.length-1;for(;0<=t&&void 0===i[t--];)i.length--}this.u()}}addRowColumnDefinition(t){let e=null;return t.isRow?e=this.getRowDefinition(t.index):t.isRow||(e=this.getColumnDefinition(t.index)),e&&e.J1(t),this}addRowDefinition(t,e){t=this.getRowDefinition(t);return t&&t.J1(new we(e)),this}addColumnDefinition(t,e){t=this.getColumnDefinition(t);return t&&t.J1(new we(e)),this}get rowSizing(){return null!==this.B?this.B.wp:3}set rowSizing(t){var e=this.rowSizing;e!==t&&(Ht,3!==t&&2!==t&&Kt.n("Panel.rowSizing must be ProportionalExtra or None, not: "+t),null===this.B&&(this.B=new be),this.B.wp=t,this.u(),this.i("rowSizing",e,t))}get columnSizing(){return null!==this.B?this.B.xp:3}set columnSizing(t){var e=this.columnSizing;e!==t&&(Ht,3!==t&&2!==t&&Kt.n("Panel.columnSizing must be ProportionalExtra or None, not: "+t),null===this.B&&(this.B=new be),this.B.xp=t,this.u(),this.i("columnSizing",e,t))}get topIndex(){return null!==this.B?this.B.bp:0}set topIndex(t){var e=this.topIndex;e!==t&&((!isFinite(t)||t<0)&&Kt.n("Panel.topIndex must be greater than zero and a real number, not: "+t),null===this.B&&(this.B=new be),this.B.bp=t,this.u(),this.i("topIndex",e,t))}get leftIndex(){return null!==this.B?this.B.kp:0}set leftIndex(t){var e=this.leftIndex;e!==t&&((!isFinite(t)||t<0)&&Kt.n("Panel.leftIndex must be greater than zero and a real number, not: "+t),null===this.B&&(this.B=new be),this.B.kp=t,this.u(),this.i("leftIndex",e,t))}findRowForLocalY(t){if(t<0||this.type!==Xt.Table||0===this.rowCount)return-1;let e=0;var i=this.Ze,s=i.length;let n=this.topIndex;for(;n{e.uh();var i=e.Ii;if(null!==i){e.p2(!1);for(var s=i.iterator;s.next();){var n=s.value,a=(2===n.mode&&e.p2(!0),n.sourceName);n.isToObject&&("/"===a&&t.B2(!0),null!==(a=n.iL(t,e)))&&(v.add(a),null===a.no&&(a.no=new O),a.no.add(n)),p.add(n)}}if(e instanceof Xt&&e.type===Xt.Table){if(0{if(i instanceof Xt&&(i.type===Xt.Auto||i.type===Xt.Spot||i.type===Xt.Graduated)&&i.elements.count<=1&&!(i instanceof H)){let t=!1;if(1===i.elements.count&&!(t=null!==i.itemArray))for(n=p.iterator;n.next();)if("itemArray"===n.value.targetProperty){t=!0;break}t||(Kt.ft("Auto, Spot, or Graduated Panel should not have zero or one elements: "+i.toString()+" in "+e.toString()),Xt.AL=!0)}}),this}static AL=!1;copyTemplate(t){void 0===t&&(t=!1);var e=this.copy();return e.gI(e=>{e instanceof Xt&&(e.js=null,e.si=null);var t=e.Ii,t=(null!==t&&(e.Ii=null,t.each(t=>e.bind(t.copy()))),e.Ns);null!==t&&(e.Ns=null,t.each(t=>e.trigger(t.value.copy())))}),t&&e.ui(),e}updateTargetBindings(t){var e=this.js;if(null!==e){void 0===t&&(t="");for(var i=e.iterator;i.next();){var s,n=i.value,a=this.LL(n,t);null===a||({data:a,elt:s}=a,n.isToTheme&&null===this.diagram)||void 0!==s&&n.updateTarget(s,a)}}}Uo(){if(null!==this.diagram)if(this.S2())for(var t=this.js.iterator;t.next();){var e,i,s=t.value;s.isToTheme&&null!==(e=this.LL(s))&&({data:e,elt:i}=e,void 0!==i)&&s.updateTarget(i,e)}else{var n=this.F.h,a=n.length;for(let t=0;tt;)this.re(this.F.length-1,!1);this.TL(null,this.itemArray)}TL(t,e){var s=this.yp(),n=e;if(null===n||0===n.length)for(;this.F.length>s;)this.re(this.F.length-1,!1);else if(this.F.length<=s){var i=n.length;for(let t=0;t= 0",we,"height"),this.ke=t,this.actual=this.at,null!==this.panel&&this.panel.u(),this.i("height",e,t))}get width(){return this.ke}set width(t){var e=this.ke;e!==t&&(Ht,Kt.t(t,"number",we,"width"),t<0&&Kt.G(t,">= 0",we,"width"),this.ke=t,this.actual=this.at,null!==this.panel&&this.panel.u(),this.i("width",e,t))}get minimum(){return this.La}set minimum(t){var e=this.La;e!==t&&(Ht,Kt.t(t,"number",we,"minimum"),(t<0||!isFinite(t))&&Kt.G(t,">= 0",we,"minimum"),this.La=t,this.actual=this.at,null!==this.panel&&this.panel.u(),this.i("minimum",e,t))}get maximum(){return this.Ta}set maximum(t){var e=this.Ta;e!==t&&(Ht,Kt.t(t,"number",we,"maximum"),t<0&&Kt.G(t,">= 0",we,"maximum"),this.Ta=t,this.actual=this.at,null!==this.panel&&this.panel.u(),this.i("maximum",e,t))}get alignment(){return this.fi}set alignment(t){var e=this.fi;e.equals(t)||(Ht,Kt.s(t,Z,we,"alignment"),this.fi=t.L(),null!==this.panel&&this.panel.u(),this.i("alignment",e,t))}get stretch(){return this.lo}set stretch(t){var e=this.lo;e!==t&&(this.lo=t,null!==this.panel&&this.panel.u(),this.i("stretch",e,t))}get separatorPadding(){return this.$o}set separatorPadding(t){"number"==typeof t?t=new I(t):null!==t&&(Ht,Kt.s(t,I,we,"separatorPadding"));var e=this.$o;null!==t&&null!==e&&e.equals(t)||(null!==t&&(t=t.L()),this.$o=t,null!==this.panel&&this.panel.u(),this.i("separatorPadding",e,t))}get separatorStroke(){return this.Pd}set separatorStroke(t){var e=this.Pd;e!==t&&(null!==t&&m.ud(t,"RowColumnDefinition.separatorStroke"),t instanceof m&&t.w(),this.Pd=t,null!==this.panel&&this.panel.u(),this.i("separatorStroke",e,t))}get separatorStrokeWidth(){return this.Nd}set separatorStrokeWidth(t){var e=this.Nd;e!==t&&(this.Nd=t,null!==this.panel&&this.panel.u(),this.i("separatorStrokeWidth",e,t))}get separatorDashArray(){return this.Da}set separatorDashArray(i){var t=this.Da;if(t!==i){if(null===i||Array.isArray(i)||Kt.Bi(i,"Array",we,"separatorDashArray:value"),null!==i){var s=i.length;let e=0;for(let t=0;tu)return d=u,void Kt.ot(P);d>h?(f=d-h,d=h):f=0;let t=Math.sqrt(d*d/(1+o*o));if(a<0&&(t=-t),e+=t,i+=o*t,p.translate(e,i),p.rotate(l),p.translate(-w/2,-A/2),0===f&&b.ph(p,v),p.translate(w/2,A/2),p.rotate(-l),p.translate(-e,-i),u-=d,h-=d,0!==f){if(++g===P.length)return void Kt.ot(P);m=P[g],a=m[0],l=m[1],o=m[2],h=m[3],d=f}}Kt.ot(P)}}ph(n,a){var r=n instanceof Jt;let o=this.$i;var l=this.Fa;if(null!==o||null!==l){var h=this.yt;if(null!==h){n.commitTransform();var u=this.actualBounds,d=this.naturalBounds,c=(null!==l&&this.bn(n,l,!0,!1,d,u),this.part);let t=this.Qo,e=(null===o||0!==t||null===c||!this.isPanelMain&&c.findMainElement()!==this||(t=c.MI()),null!==(o=0===t?null:o)&&0!==t&&(this.bn(n,o,!1,!1,d,u),n.lineWidth=t,n.lineJoin=this.strokeJoin,n.lineCap=this.strokeCap,n.miterLimit=this.strokeMiterLimit),!1),i=(c&&a.getRenderingHint("drawShadows")&&(e=c.isShadowed),!1===n.hl&&(e=!1),!0),s=(null===o||null!==l&&"transparent"!==l||(i=!1),!1);d=this.strokeDashArray;if(null!==d&&(s=!0,n.enableDash(d,this.strokeDashOffset)),1===h.type)n.beginPath(),n.moveTo(h.startX,h.startY),n.lineTo(h.endX,h.endY),null!==o&&n.strokeContext(),n.endPath();else if(2===h.type){var u=h.startX,c=h.startY,d=h.endX,g=h.endY,m=Math.min(u,d),f=Math.min(c,g),d=Math.abs(d-u),u=Math.abs(g-c);n.beginPath(),n.rect(m,f,d,u),null!==l&&n.fillContext(l,!1,null),null!==o&&(i&&e&&n.shadowsOff(),n.strokeContext(),i)&&e&&n.shadowsOn(),n.endPath()}else if(3===h.type){g=h.startX,c=h.startY,m=h.endX,f=h.endY,d=Math.abs(m-g)/2,u=Math.abs(f-c)/2,g=Math.min(g,m)+d,m=Math.min(c,f)+u;n.beginPath(),n.moveTo(g,m-u),n.bezierCurveTo(g+z.Gn*d,m-u,g+d,m-z.Gn*u,g+d,m),n.bezierCurveTo(g+d,m+z.Gn*u,g+z.Gn*d,m+u,g,m+u),n.bezierCurveTo(g-z.Gn*d,m+u,g-d,m+z.Gn*u,g-d,m),n.bezierCurveTo(g-d,m-z.Gn*u,g-z.Gn*d,m-u,g,m-u),n.closePath(),null!==l&&n.fillContext(l,!1,null),null!==o&&(i&&e&&n.shadowsOff(),n.strokeContext(),i)&&e&&n.shadowsOn(),n.endPath()}else if(4===h.type){var p=h.figures,v=p.length;for(let t=0;t(r=e(o=t=t&&n<=e}{let t=0,e=0;return e=a=t&&o<=e}}LI(t,e){if(this.containedInRect(t,e)||void 0===e&&(e=this.D,t.containsRect(this.actualBounds)))return!0;var i=t.left,s=t.right,n=t.top,t=t.bottom,a=_.a(),r=_.a(),o=_.a(),l=V.a();l.set(e),l.uC(this.D),l.Mw(),r.x=s,r.y=n,r.D(l),a.x=i,a.y=n,a.D(l);let h=!1;return(this.Ia(a,r,o)||(a.x=s,a.y=t,a.D(l),this.Ia(a,r,o))||(r.x=i,r.y=t,r.D(l),this.Ia(a,r,o))||(a.x=i,a.y=n,a.D(l),this.Ia(a,r,o)))&&(h=!0),V.o(l),_.o(a),_.o(r),_.o(o),h}sL(n,t,e){if(e&&null!==this.fill&&this.dh(n,!0))return!0;let a=n.distanceSquaredPoint(t);t=a;1.5=a||_.distanceSquared(d,h,0,-t)>=a||_.distanceSquared(d,h,0,t)>=a||_.distanceSquared(d,h,u,0)>=a);if(4===i.type){r=i.bounds,l=r.x,s=r.y,o=r.x+r.width,t=r.y+r.height;if(n.x>o&&n.xt&&n.ya&&_.distanceLineSegmentSquared(n.x,n.y,l,s,o,s)>a&&_.distanceLineSegmentSquared(n.x,n.y,o,t,l,t)>a&&_.distanceLineSegmentSquared(n.x,n.y,o,t,o,s)>a)return!1;var d=Math.sqrt(a);if(!e){var c=i.figures;for(let t=0;ta)return!1;var m=g.segments.h,f=m.length;for(let t=0;ta)return!1;break;case 3:var v=Kt.ct(),y=(z.Hn(i,s,p.point1X,p.point1Y,p.point2X,p.point2Y,p.endX,p.endY,.8,v),A(v,n));if(Kt.ot(v),y||(i=p.endX,s=p.endY,n.distanceSquared(i,s)>a))return!1;break;case 4:v=Kt.ct(),y=(z.Wg(i,s,p.point1X,p.point1Y,p.endX,p.endY,.8,v),A(v,n));if(Kt.ot(v),y||(i=p.endX,s=p.endY,n.distanceSquared(i,s)>a))return!1;break;case 5:case 6:{var b=5===p.type?p.Fo(g):p.Kh(g,i,s),x=b.length;if(0===x){if(i=5===p.type?p.centerX:p.endX,s=5===p.type?p.centerY:p.endY,n.distanceSquared(i,s)>a)return!1;break}let e=null;var w=Kt.ct();for(let t=0;ta)return!0;return!1}}CI(e,i,s,n,a,r){if(0===e.width)return z.vn(e.x,e.y,e.x,e.y+e.height,i,s,n,a,r);if(0===e.height)return z.vn(e.x,e.y,e.x+e.width,e.y,i,s,n,a,r);{var o=e.width/2,l=e.height/2,h=e.x+o,e=e.y+l;let t=i!==n?(s-a)/(i-n):9999;if(Math.abs(t)<9999){a=s-e-t*(i-h);if(o*o*(t*t)+l*l-a*a<0)return r.x=NaN,r.y=NaN,!1;var n=Math.sqrt(o*o*(t*t)+l*l-a*a),u=(-(o*o*t)*a+o*l*n)/(l*l+o*o*(t*t))+h,n=(-(o*o*t)*a-o*l*n)/(l*l+o*o*(t*t))+h,d=t*(u-h)+a+e,a=t*(n-h)+a+e;Math.abs((i-u)*(i-u))+Math.abs((s-d)*(s-d))= 0",q,"strokeWidth:value"))}K1(){return this.Qo}get strokeCap(){return null!==this.Rt?this.Rt.Mp:"butt"}set strokeCap(t){var e=this.strokeCap;e!==t&&("string"!=typeof t||"butt"!==t&&"round"!==t&&"square"!==t?Kt.G(t,'"butt", "round", or "square"',q,"strokeCap"):(this.Ra(),this.Rt.Mp=t,this.T(),this.i("strokeCap",e,t)))}get strokeJoin(){return null!==this.Rt?this.Rt.Pp:"miter"}set strokeJoin(t){var e=this.strokeJoin;e!==t&&("string"!=typeof t||"miter"!==t&&"bevel"!==t&&"round"!==t?Kt.G(t,'"miter", "bevel", or "round"',q,"strokeJoin"):(this.Ra(),this.Rt.Pp=t,this.T(),this.i("strokeJoin",e,t)))}get strokeMiterLimit(){return null!==this.Rt?this.Rt.Np:10}set strokeMiterLimit(t){var e,i=this.strokeMiterLimit;i!==t&&(Ht,Kt.r(t,q,"strokeMiterLimit"),1<=t?(this.Ra(),this.Rt.Np=t,this.T(),null!==(e=this.part)&&e.gc(),this.i("strokeMiterLimit",i,t)):(Ht,Kt.G(t,"value >= 1",q,"strokeWidth:value")))}get strokeDashArray(){return this.jo}set strokeDashArray(i){var t=this.jo;if(t!==i){if(null===i||Array.isArray(i)||Kt.Bi(i,"Array",q,"strokeDashArray:value"),null!==i){var s=i.length;let e=0;for(let t=0;ti+1e-5||n.bounds.height>s+1e-5)&&Kt.n('Geometry made with figure "'+e.figure+'" has bounds '+n.bounds.toString()+" that are too large for the given size ("+i+","+s+"). See documentation for Shape.defineFigureGenerator."),n}static getFigureGenerators(){var t,e=new L;for(const i in z.qn)i!==i.toLowerCase()&&(t=z.qn[i],e.add(i,t));return e.w(),e}static defineFigureGenerator(t,e){Kt.t(t,"string",q,"defineFigureGenerator:name"),"string"==typeof e?(Ht,""!==e&&z.qn[e]||Kt.n("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+e)):Kt.t(e,"function",q,"defineFigureGenerator:func");var i=t.toLowerCase(),s=(Ht,""!==t&&t!==i||Kt.n("Shape.defineFigureGenerator name must not be empty or all-lower-case: "+t),z.qn);s[t]=e,s[i]=t}static getArrowheadGeometries(){var t,e,i=new L;for(const s in z.$g)void 0===q.co[s]&&(t=W.parse(z.$g[s],!1),q.co[s]=t,(t=s.toLowerCase())!==s)&&(q.co[t]=s);for(const n in q.co)n!==n.toLowerCase()&&(e=q.co[n])instanceof W&&i.add(n,e);return i.w(),i}static defineArrowheadGeometry(t,e){Kt.t(t,"string",q,"defineArrowheadGeometry:name");let i=null;i="string"==typeof e?(Kt.t(e,"string",q,"defineArrowheadGeometry:pathstr"),W.parse(e,!1)):(Kt.s(e,W,q,"defineArrowheadGeometry:pathstr"),e);var e=t.toLowerCase(),s=(Ht,""!==t&&"none"!==e&&t!==e||Kt.n("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t),q.co);s[t]=i,s[e]=t}static co=new l;static K2=new l;static RL(t){let e=q.co[t];if(void 0===e){var i,s=t.toLowerCase();if("none"===s)return"None";if(void 0===(e=q.co[s])){let t=null;for(const n in z.$g)if(n.toLowerCase()===s){t=n;break}if(null!==t)return i=W.parse(z.$g[t],!1),q.co[t]=i,s!==t&&(q.co[s]=t),t}}return"string"==typeof e?e:e instanceof W?t:null}}class Ae{xi;Mp;Pp;Np;wh;Lp;Tp;Wn;jn;constructor(){this.xi=!1,this.Mp="butt",this.Pp="miter",this.Np=10,this.wh=0,this.Lp=null,this.Tp=1,this.Wn=Z.Default,this.jn=Z.Default}copy(){var t=new Ae;return t.Mp=this.Mp,t.Pp=this.Pp,t.Np=this.Np,t.wh=this.wh,t.Lp=this.Lp,t.Tp=this.Tp,t.Wn=this.Wn.L(),t.jn=this.jn.L(),t}}(a={})[a.None=0]="None",a[a.Fit=1]="Fit",a[a.DesiredSize=2]="DesiredSize",a[a.BreakAll=3]="BreakAll";var Pe=a,ke=((a={})[a.Clip=0]="Clip",a[a.Ellipsis=1]="Ellipsis",a),Se=((a={})[a.Trim=0]="Trim",a[a.None=1]="None",a);class j extends y{di;$i;Ln;Oe;bi;C0;Fd;tt;_;Bl;uo;Tn;Ee;Ei;Dn;constructor(t,e){return super(),this.l|=2097152,this.di="",this.$i="black",this.Ln="13px sans-serif",this.Oe=0,this.bi=0,this.C0=0,this.Fd=null,this.tt=null,this._=null,this.Bl=0,this.uo=null,this.Tn=0,this.Ee=null,this.Ei=null,this.Dn=null,"string"==typeof t?this.text=t:t&&Object.assign(this,t),e&&Object.assign(this,e),this}cloneProtected(t){super.cloneProtected(t),t.di=this.di,t.$i=this.$i,t.Ln=this.Ln,t.Oe=this.Oe,t.bi=this.bi,t.C0=this.C0,t.Fd=this.Fd,null!==this.tt&&(t.tt=this.tt.copy()),null!==this._&&(this._.xi?t._=this._:t._=this._.copy()),t.Bl=this.Bl,t.uo=this.uo,t.Tn=this.Tn,t.Ee=this.Ee,t.Ei=this.Ei,t.Dn=this.Dn}Fn(){null===this._?this._=new Me:this._.xi&&(this._=this._.copy())}uh(){super.uh(),null!==this._&&(this._.xi=!0)}uI(t){this.l=6144|t.l,this._t=t.opacity,this.Ft=t.background,this.We=t.desiredSize.L(),this.minSize=t.minSize.L(),this.maxSize=t.maxSize.L(),null!==t.Ni?this.Ni=t.Ni.copy():this.Ni=null,this.v=t.scale,this.qt=t.angle,this.stretch=t.stretch,this.ol=t.margin.L(),this.fi=t.alignment.L(),this._f=t.alignmentFocus.L(),this.segmentFraction=t.segmentFraction,this.segmentOffset=t.segmentOffset.L(),this.segmentOrientation=t.segmentOrientation,null!==t.hi&&(this.hi=t.hi.copy()),this.shadowVisible=t.shadowVisible,this.di=t.di,this.$i=t.$i,this.Ln=t.Ln,null!==this.tt&&(this.tt=t.tt.copy()),null!==t._&&(t._.xi?this._=t._:this._=t._.copy()),this.Bl=t.Bl}fI(t){this.di=t.text||"",this.qt=t.labelAngle||0,this.Oe=t.lineCount||0,this.TI(t.lines),t.naturalBounds&&(this.Hi=t.naturalBounds),t.actualBounds&&(t=t.actualBounds,this.vt(t.x,t.y,t.width,t.height))}ci(t){t in Pe?this.wrap=t:super.ci(t)}toString(){return 22g&&(t=g),s+=m,this.EL(this.Dn,a,0,s,g,h,t,n,i,d,c)}else if(null!==this.Ee&&null!==this.Ei)for(let e=0;eg&&(t=g),s+=m,this.EL(this.Ei[e],a,0,s,g,h,t,n,i,d,c),s+=h+f}switch(this.flip){case 0:break;case 2:a.scale(-1,1),a.translate(-o,0);break;case 1:a.scale(1,-1),a.translate(0,-l);break;case 3:a.scale(-1,-1),a.translate(-o,-l)}}}EL(t,i,s,n,a,r,o,l,h,u,d){let c=0;if(l)"left"===h?c=0:"right"===h?c=a-o:"center"===h&&(c=(a-o)/2),i.fillRect(s+c,n+.25*r,o,1);else{"left"===h?c=0:"right"===h?c=a:"center"===h&&(c=a/2);l=null!==j.ab?j.ab(this,r):.75*r;i.fillText(t,s+c,n+l);let e=r/20|0;if(0===e&&(e=1),"right"===h?c-=o:"center"===h&&(c-=o/2),u&&(a=null!==j.fb?j.fb(this,r):.8*r,this.VL(s+c,n+a,s+c+o,n+a,e,i),i instanceof Jt)&&i.lastCreatedElement.classList.add("gojs-td"),d){let t=n+r-r/2.2|0;e%2!=0&&(t+=.5),this.VL(s+c,t,s+c+o,t,e,i),i instanceof Jt&&i.lastCreatedElement.classList.add("gojs-td")}}}VL(t,e,i,s,n,a){a.beginPath(),a.lineWidth=n,a.moveTo(t,e),a.lineTo(i,s),a.stroke(),a.endPath()}sc(e,t,i){if(!super.sc(e,t,i))return!1;if(this.bn(e,this.$i,!0,!1,this.naturalBounds,this.actualBounds),i){if(0===this.svg.getElementsByTagName("text").length)return!0;var s=this.svg.getElementsByClassName("gojs-td");for(let t=0;tthis.maxLines&&(this.l|=16777216))}G2(t,a,r){var o=0===this.formatting;o&&(t=t.trim());let l=0,h=0,u=0;var s=this.Ln,d=this.spacingAbove+this.spacingBelow,d=Math.max(0,this.Op()+d),s=1===this.overflow?this.zL(s):0;if(this.Oe>=this.maxLines)null!==r&&r.e(0,d);else{let n=t;if(0===this.wrap){if(this.Tn=1,h=this.getStringWidth(t),0===s||h<=a)return this.bi=Math.max(this.bi,h),this.Rn(t,this.bi),void(null!==r&&r.e(h,d));let e=this.Rd(n),i=(n=n.substring(e.length),this.Rd(n));for(h=this.getStringWidth(e+i),u=0;0a&&1a;){let t=1;for(h=this.getStringWidth(i.substring(0,t)),u=0;h<=a;)t++,u=h,h=this.getStringWidth(i.substring(0,t));let e=0;l=1===t?(e=h,Math.max(l,h)):(e=u,Math.max(l,u)),--t<1&&(t=1);var c=i.substring(0,t);if(this.Rn(c,e),s++,i=i.substring(t),this.Oe+s>this.maxLines)break}let e=this.Rd(n);for(h=this.getStringWidth(i+e),u=0;0this.maxLines)break}}this.Tn=Math.min(this.maxLines,s),this.bi=Math.max(this.bi,l),null!==r&&r.e(this.bi,d*this.Tn)}}}II(e,i){if(0!==this.bi&&null!==this.Ee&&null!==this.Ei&&1===this.overflow){var s=this.Ln,s=1===this.overflow?this.zL(s):0,n=this.spacingAbove+this.spacingBelow,n=Math.max(0,this.Op()+n),i=Math.min(this.maxLines-1,Math.max(Math.floor(i/n+.01)-1,0));if(!(i+1>=this.Ei.length)){this.H2(!0);let t=this.Ei[i];for(var a=Math.max(1,e-s);this.getStringWidth(t)>a&&1=t.length?t:t.substring(0,i)}getStringWidth(t){return null===j.al?8*t.length:j.al.measureText(t).width}Op(){if(null!==this.uo)return this.uo;var t=this.Ln;let e=0;return null===j.al?e=16:void 0!==j.v2[t]&&j.XL<5e3?e=j.v2[t]:(e=1.3*j.al.measureText("M").width,j.v2[t]=e,j.XL++),this.uo=e}zL(t){if(null===j.al)return 6;let e=0;return void 0!==j.hb[t]&&j.U2<5e3?e=j.hb[t]:(e=j.al.measureText(j.Dp).width,j.hb[t]=e,j.U2++),e}cb(t,e){return t.indexOf(` `,e)}OL(t){let e=this.di.replace(/\r\n/g,` `).replace(/\r/g,` `);var i,s,n=this.spacingAbove+this.spacingBelow,a=Math.max(0,this.Op()+n);if(0===e.length)return this.bi=0,this.Oe=1,a;this.isMultiline||0<=(n=this.cb(e,0))&&(e=e.substring(0,n));let r=0,o=this.Oe=0,l=-1,h=!1;for(;!h;)-1===(l=this.cb(e,o))&&(l=e.length,h=!0),o<=l&&(i=e.substring(o,l),0!==this.wrap?(this.Tn=0,s=Yt.a(),this.G2(i,t,s),r+=s.height,Yt.o(s),this.Oe+=this.Tn):(this.G2(i,t,null),r+=a,this.Oe++),this.Oe===this.maxLines)&&(h=!0),o=l+1;return this.C0=r}RI(){let a=this.di.replace(/\r\n/g,` `).replace(/\r/g,` -`);if(0===a.length)return 8;var t;if(this.isMultiline){let i=0,s=0,n=!1;for(;!n;){let t=this.cb(a,s),e=(-1===t&&(t=a.length,n=!0),a.substring(s,t));0===this.formatting&&(e=e.trim()),i=Math.max(i,this.getStringWidth(e)),s=t+1}return i}return 0<=(t=this.cb(a,0))&&(a=a.substring(0,t)),this.getStringWidth(a)}get textValidation(){return null!==this._?this._.Vl:null}set textValidation(t){var e=this.textValidation;e!==t&&(null!==t&&Kt.t(t,"function",j,"textValidation"),this.Fn(),this._.Vl=t,this.i("textValidation",e,t))}get textEdited(){return null!==this._?this._.Bp:null}set textEdited(t){var e=this.textEdited;e!==t&&(null!==t&&Kt.t(t,"function",j,"textEdited"),this.Fn(),this._.Bp=t,this.i("textEdited",e,t))}get spacingAbove(){return null!==this._?this._.zp:0}set spacingAbove(t){var e=this.spacingAbove;e!==t&&(Ht,Kt.t(t,"number",j,"spacingAbove"),this.Fn(),this._.zp=t,this.u(),this.i("spacingAbove",e,t))}get spacingBelow(){return null!==this._?this._.Xp:0}set spacingBelow(t){var e=this.spacingBelow;e!==t&&(Ht,Kt.t(t,"number",j,"spacingBelow"),this.Fn(),this._.Xp=t,this.u(),this.i("spacingBelow",e,t))}get formatting(){return null!==this._?this._.Yp:0}set formatting(t){var e=this.formatting;e!==t&&(Kt.it(t,Se,"formatting"),this.Fn(),this._.Yp=t,this.u(),this.i("formatting",e,t))}get maxLines(){return null!==this._?this._.Kp:1/0}set maxLines(t){var e=this.maxLines;e!==t&&(Ht,Kt.t(t,"number",j,"maxLines"),(t=Math.floor(t))<=0&&Kt.G(t,"> 0",j,"maxLines"),this.Fn(),this._.Kp=t,this.u(),this.i("maxLines",e,t))}getMetrics(){return[this.bi,this.Bl,this.uo,this.Tn,this.Ee,this.Ei,this.Dn]}TI(t){void 0!==t&&(this.bi=t[0],this.Bl=t[1],this.uo=t[2],this.Tn=t[3],this.Ee=t[4],this.Ei=t[5],this.Dn=t[6])}get metrics(){return{arrSize:null!==this.Ee?this.Ee:[this.bi],arrText:null!==this.Ei?this.Ei:[this.Dn],maxLineWidth:this.bi,fontHeight:this.uo}}get choices(){return this.Fd}set choices(t){var e=this.Fd;e!==t&&(Ht,null===t||Array.isArray(t)||Kt.Bi(t,"Array",j,"choices:value"),this.Fd=t,this.i("choices",e,t))}static OI=new RegExp("[ ​­]");static v2=new l;static XL=0;static hb=new l;static U2=0;static Dp="...";static BL="";static al=q.isUsingDOM()?new $t(null).gi:null}class Me{xi;us;go;Yp;Kp;Ip;zp;Xp;Fp;Bp;Ep;Vl;cl;Rp;constructor(){this.xi=!1,this.us=null,this.go=0,this.Yp=0,this.Kp=1/0,this.Ip=0,this.zp=0,this.Xp=0,this.Fp="start",this.Bp=null,this.Ep=null,this.Vl=null,this.cl=Z.Top,this.Rp=2}copy(){var t=new Me;return t.us=this.us,t.go=this.go,t.Yp=this.Yp,t.Kp=this.Kp,t.Ip=this.Ip,t.zp=this.zp,t.Xp=this.Xp,t.Fp=this.Fp,t.Bp=this.Bp,t.Ep=this.Ep,t.Vl=this.Vl,t.cl=this.cl,t.Rp=this.Rp,t}}class Ce{pc;yc;wc;Vp;xc;constructor(){this.pc=1,this.yc=0,this.wc=1,this.Vp=null,this.xc=null}copy(){var t=new Ce;return t.pc=this.pc,t.yc=this.yc,t.wc=this.wc,t.Vp=this.Vp,t.xc=this.xc,t}}(a={})[a.None=0]="None",a[a.Fill=2]="Fill",a[a.Uniform=6]="Uniform",a[a.UniformToFill=7]="UniformToFill";var Ne=a;class Le extends y{ul;St;dl;bc;us;gl;kc;go;Sc;Mc;q1;constructor(t,e){super(),this.l|=2097152,this.ul=null,this.St="",this.dl=Q.RD,this.bc=2,this.us=null,this.gl=null,this.kc=Z.Center,this.go=0,this.Sc=null,this.Mc=null,this.q1=null,"string"==typeof t?this.source=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.St=this.St,t.element=this.ul,t.dl=this.dl.L(),t.bc=this.bc,t.go=this.go,t.us=this.us,t.gl=this.gl,t.kc=this.kc.L(),t.Mc=this.Mc}ci(t){t in Ne?this.imageStretch=t:super.ci(t)}toString(){return"Picture("+this.source+")#"+N.ps(this)}get Pc(){return 0!=(1048576&this.l)}set Pc(t){this.Pc!==t&&(this.l=1048576^this.l)}get Oa(){return 0!=(2097152&this.l)}set Oa(t){this.Oa!==t&&(this.l=2097152^this.l)}get Sn(){return 0!=(4194304&this.l)}set Sn(t){this.Sn!==t&&(this.l=4194304^this.l)}static clearCache(t){void 0===t&&(t=""),Kt.t(t,"string",Le,"clearCache:url"),""!==t?Le.Up[t]&&(delete Le.Up[t],Le.ub--):(Le.Up=new l,Le.ub=0)}static BA(e,i){i.YL||(i.db=t=>{Le.EI(i,t),e.desiredSize.isReal()||(e.ae(!1),e.u())},i.gb=t=>Le.VI(i,t),i.addEventListener("load",i.db),i.addEventListener("error",i.gb),i.YL=!0)}static MR(t){t.db&&t.removeEventListener("load",t.db),t.gb&&t.removeEventListener("error",t.gb),delete t.db,delete t.gb,delete t.YL}get element(){return this.ul}set element(t){var e,i,s=this.ul;this.fs(!0),s!==t&&(this.Pc=t instanceof HTMLCanvasElement,e=t instanceof HTMLImageElement,null===t||e||t instanceof HTMLVideoElement||this.Pc||Kt.n("Picture.element must be an instance of Image, Canvas, or Video, not: "+t),null!==(i=this.diagram)&&i.EP(this),null!==(this.ul=t)&&e&&void 0===t.as&&(t.as=new N),null!==i&&e&&i.OP(this),this.i("element",s,t),this.T())}kR(){var t=this.ul;null!==t&&(!this.Pc&&!0!==t.complete||(t.w0&&(t.Gp instanceof Event&&null!==this.us?this.us(this,t.Gp):!0===t.Sn&&!t.Gp&&null!==this.gl&&t.q2&&this.gl(this,t.q2)),t.Sn=!0,this.desiredSize.isReal())||(this.ae(!1),this.u()),!0===t.Sn)&&null!==this.diagram&&this.diagram.Wu.add(this)}BI(){if(null===this.ul)this.Sc=!1;else{var t=new $t(null).gi;try{t.drawImage(this.ul,0,0)}catch(t){Ht,this.Oa&&Kt.ft(t.toString()),this.Oa=!1}try{t.getImageData(0,0,1,1).data[3]&&(this.Sc=!1),this.Sc=!1}catch{this.Sc=!0}}}get source(){return this.St}set source(i){var s,t=this.St;if(t!==i){this.fs(!0),Kt.t(i,"string",Le,"source"),this.St=i;let e=Le.Up;if(q.isUsingDOM()){let t=null;void 0!==e[i]?t=e[i]:""!==i&&(30=d.width&&(n=n+f.offsetX+(e*f.x-d.width*f.x)),i>=d.height&&(a=a+f.offsetY+(i*f.y-d.height*f.y)),r=Math.min(d.width,e),o=Math.min(d.height,i));break;case 2:e=d.width,i=d.height;break;case 6:case 7:let t=0;6===m?(t=Math.min(d.height/i,d.width/e),e*=t,i*=t):7===m&&(t=Math.max(d.height/i,d.width/e),e*=t,i*=t,e>=d.width&&(n=(n+f.offsetX+(e*f.x-d.width*f.x)/e)*r),i>=d.height&&(a=(a+f.offsetY+(i*f.y-d.height*f.y)/i)*o),r*=1/(e/d.width),o*=1/(i/d.height),e=d.width,i=d.height)}var p=r*o,v=this.getDocumentScale()*l.scale,v=e*v*(i*v),y=p/v,p=h.__goCache;let s=null;var b=Le.zI;if(!u){if(h.Sn&&void 0!==p&&4{var s="r"+e+","+i;let n=z.yr[s];return void 0===n&&((n=new W(2)).endX=e,n.endY=i,z.wr{var s="s"+e+","+i;let n=z.yr[s];return void 0===n&&((n=new W(2)).endX=e,n.endY=i,n.defaultStretch=6,z.wr{var a="rr"+e+","+i+","+(s=isNaN(s)||s<0?5:s)+","+(n=isNaN(n)?15:n),r=z.yr[a];if(void 0===r){let t=s;t=1==(1&n)?(t=Math.min(t,2==(2&n)?e/3:e),Math.min(t,8==(8&n)?i/3:i)):0;var o,l,h=new S(t,0,!0),r=(new W).add(h),u=Z.TopLeft.copy(),d=Z.BottomRight.copy();2==(2&n)?(o=s,o=Math.min(o,1==(1&n)?e/3:e),l=(o=Math.min(o,4==(4&n)?i/3:i))*z.Gn,h.add(new A(2,e-o,0)).add(new A(3,e,o,e-l,0,e,l)),u.offsetY=l,d.offsetX=-l):h.add(new A(2,e,0)),4==(4&n)?(o=s,o=Math.min(o,8==(8&n)?e/3:e),l=(o=Math.min(o,2==(2&n)?i/3:i))*z.Gn,h.add(new A(2,e,i-o)).add(new A(3,e-o,i,e,i-l,e-l,i)),d.offsetX=-l,d.offsetY=-l):h.add(new A(2,e,i)),8==(8&n)?(o=s,o=Math.min(o,4==(4&n)?e/3:e),l=(o=Math.min(o,1==(1&n)?i/3:i))*z.Gn,h.add(new A(2,o,i)).add(new A(3,0,i-o,l,i,0,i-l)),u.offsetX=l,d.offsetY=-l):h.add(new A(2,0,i)),1==(1&n)?(s=t*z.Gn,h.add(new A(2,0,t)).add(new A(3,t,0,0,s,s,0).close()),u.offsetX=s,u.offsetY=s):h.add(new A(2,0,0).close()),r.spot1=u,r.spot2=d,z.wr{var s=t?t.parameter1:NaN,t=t?t.parameter2:NaN;return Yi(0,e,i,s,t)}),Fe("Border","RoundedRectangle"),Fe("RoundedTopRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Yi(0,e,i,t,3)}),Fe("RoundedBottomRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Yi(0,e,i,t,12)}),Fe("RoundedLeftRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Yi(0,e,i,t,9)}),Fe("RoundedRightRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Yi(0,e,i,t,6)}),Fe("Ellipse",(t,e,i)=>{var s="e"+e+","+i;let n=z.yr[s];return void 0===n&&((n=new W(3)).endX=e,n.endY=i,n.spot1=Z.Kk,n.spot2=Z.Uk,z.wr{var s="c"+e+","+i;let n=z.yr[s];return void 0===n&&((n=new W(3)).endX=e,n.endY=i,n.spot1=Z.Kk,n.spot2=Z.Uk,n.defaultStretch=6,z.wr(new W).add(new S(0,0).add(new A(2,e,.5*i)).add(new A(2,0,i).close())).setSpots(0,.25,.5,.75)),Fe("TriangleDown",(t,e,i)=>(new W).add(new S(0,0).add(new A(2,e,0)).add(new A(2,.5*e,i).close())).setSpots(.25,0,.75,.5)),Fe("TriangleLeft",(t,e,i)=>(new W).add(new S(e,i).add(new A(2,0,.5*i)).add(new A(2,e,0).close())).setSpots(.5,.25,1,.75)),Fe("TriangleUp",(t,e,i)=>(new W).add(new S(e,i).add(new A(2,0,i)).add(new A(2,.5*e,0).close())).setSpots(.25,.5,.75,1)),Fe("Triangle","TriangleUp"),Fe("Diamond",(t,e,i)=>(new W).add(new S(.5*e,0).add(new A(2,0,.5*i)).add(new A(2,.5*e,i)).add(new A(2,e,.5*i).close())).setSpots(.25,.25,.75,.75)),Fe("LineH",(t,e,i)=>{var s=new W(1);return s.startX=0,s.startY=i/2,s.endX=e,s.endY=i/2,s}),Fe("LineV",(t,e,i)=>{var s=new W(1);return s.startX=e/2,s.startY=0,s.endX=e/2,s.endY=i,s}),Fe("None","Rectangle"),Fe("BarH","Rectangle"),Fe("BarV","Rectangle"),Fe("MinusLine","LineH"),Fe("PlusLine",(t,e,i)=>(new W).add(new S(0,i/2,!1).add(new A(2,e,i/2)).add(new A(1,e/2,0)).add(new A(2,e/2,i)))),Fe("XLine",(t,e,i)=>(new W).add(new S(0,i,!1).add(new A(2,e,0)).add(new A(1,0,0)).add(new A(2,e,i)))),Fe("LineRight",(t,e,i)=>(new W).add(new S(.25*e,0,!1).add(new A(2,.75*e,.5*i)).add(new A(2,.25*e,i)))),Fe("LineDown",(t,e,i)=>(new W).add(new S(0,.25*i,!1).add(new A(2,.5*e,.75*i)).add(new A(2,e,.25*i)))),Fe("LineLeft",(t,e,i)=>(new W).add(new S(.75*e,0,!1).add(new A(2,.25*e,.5*i)).add(new A(2,.75*e,i)))),Fe("LineUp",(t,e,i)=>(new W).add(new S(0,.75*i,!1).add(new A(2,.5*e,.25*i)).add(new A(2,e,.75*i)))),Fe("Capsule",(t,e,i)=>{var s,n=new W;return enew S(t,e,!1,!1)),Ui=(t,e,i)=>t.add(new A(2,e,i)),_i=(t,e,i)=>t.add(new A(1,e,i));Fe("Borders",(t,e,i)=>{let s=t?t.parameter1:NaN;isNaN(s)?s=10:s&=15;t=new W;let n;return 10===s?(n=Xi(e,0),Ui(n,e,i),_i(n,0,i),Ui(n,0,0)):5===s?(n=Xi(0,0),Ui(n,e,0),_i(n,e,i),Ui(n,0,i)):1===s?(n=Xi(0,0),Ui(n,e,0),_i(n,e,i)):2===s?(n=Xi(e,0),Ui(n,e,i)):4===s?(n=Xi(e,i),Ui(n,0,i)):8===s?(n=Xi(0,i),Ui(n,0,0),_i(n,e,i)):3===s?(n=Xi(0,0),Ui(n,e,0),Ui(n,e,i)):6===s?(n=Xi(e,0),Ui(n,e,i),Ui(n,0,i)):12===s?(n=Xi(e,i),Ui(n,0,i),Ui(n,0,0)):9===s?(n=Xi(0,i),Ui(n,0,0),Ui(n,e,0)):7===s?(n=Xi(0,0),Ui(n,e,0),Ui(n,e,i),Ui(n,0,i)):14===s?(n=Xi(e,0),Ui(n,e,i),Ui(n,0,i),Ui(n,0,0)):13===s?(n=Xi(e,i),Ui(n,0,i),Ui(n,0,0),Ui(n,e,0)):11===s?(n=Xi(0,i),Ui(n,0,0),Ui(n,e,0),Ui(n,e,i)):15===s?(n=Xi(0,0),Ui(n,e,0),Ui(n,e,i),Ui(n,0,i),n.add(new A(2,0,0).close())):(n=Xi(0,0),_i(n,e,i)),t.add(n),t})}z.$g={"":"",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"};(a={})[a.None=0]="None",a[a.Added=1]="Added",a[a.Removed=2]="Removed",a[a.Shown=4]="Shown",a[a.Hidden=8]="Hidden",a[a.NodeSized=16]="NodeSized",a[a.GroupLayout=32]="GroupLayout",a[a.NodeReplaced=64]="NodeReplaced",a[a.Standard=127]="Standard",a[a.All=16777215]="All";class H extends Xt{N;_o;E;ml;pl;tr;di;ir;kh;$s;er;Od;vM;UL;Hp;vp;constructor(t,e){void 0===t||t instanceof se||"number"==typeof t||"string"==typeof t?super(t):(super(),t&&(e=t)),this.N=2408959,this._o="",this.E=null,this.ml="",this.pl=null,this.tr=null,this.di="",this.ir=null,this.kh=null,this.$s=new _(NaN,NaN).w(),this.er=null,this.Od=NaN,this.vM=-1,this.UL=new Q,this.Hp=null,this.vp=NaN,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.N=-4097&this.N|49152,t._o=this._o,null!==this.E&&(this.E.xi?t.E=this.E:t.E=this.E.copy()),t.ml=this.ml,t.tr=null,t.di=this.di,t.$s.c(this.$s),t.Od=this.Od}qo(t){super.qo(t),t.mh(),t.pl=null,t.er=null,t.Hp=null}toString(){let t=Kt.an(this.constructor)+"#"+N.ps(this);return null!==this.data&&(t+="("+Kt.toString(this.data)+")"),t}static LayoutNone=0;static LayoutAdded=1;static LayoutRemoved=2;static LayoutShown=4;static LayoutHidden=8;static LayoutNodeSized=16;static LayoutGroupLayout=32;static LayoutNodeReplaced=64;static LayoutStandard=127;static LayoutAll=16777215;Qi(){null===this.E?this.E=new Ee:this.E.xi&&(this.E=this.E.copy())}uh(){super.uh(),null!==this.E&&(this.E.xi=!0)}tc(t,e,i,s,n,a,r){const o=this.diagram;null!==o&&(3===t&&"elements"===e?n instanceof Xt?n.il(t=>{o.partManager.LP(t,o)}):n instanceof Le&&o.OP(n):4===t&&"elements"===e&&(n instanceof Xt?n.il(t=>o.partManager.TP(t,o)):n instanceof Le&&o.EP(n)),o.raiseChangedEvent(t,e,i,s,n,a,r))}updateTargetBindings(t){if(super.updateTargetBindings(t),null!==this.data){var e=this.F.h,i=e.length;for(let t=0;t{null!==t.data&&t.updateTargetBindings()})}for(var n=this.adornments;n.next();)n.value.updateTargetBindings(t)}}Uo(){if(super.Uo(),this.S2()){var e=this.F.h,i=e.length;for(let t=0;tt.Uo())}}for(var t=this.adornments;t.next();)t.value.Uo()}updateRelationshipsFromData(){null!==this.data&&this.diagram?.partManager.updateRelationshipsFromData(this)}get key(){var t=this.diagram;if(null!==t)return t.model.getKeyForNodeData(this.data)}get adornments(){return null===this.tr?o.instance:this.tr.iteratorValues}findAdornment(t){Ht,Kt.t(t,"string",H,"findAdornment:category");var e=this.tr;return null===e?null:e.getValue(t)}addAdornment(i,s){if(null!==s){Ht,Kt.t(i,"string",H,"addAdornment:category"),Kt.s(s,K,H,"addAdornment:ad");let t=null,e=this.tr;var n;(t=null!==e?e.getValue(i):t)!==s&&(null!==t&&null!==(n=t.diagram)&&n.remove(t),null===e&&(e=new L,this.tr=e),s._o!==i&&(s.category=i),e.add(i,s),null!==(n=this.diagram))&&(n.add(s),null!==(i=s.adornedObject))&&null!==(n=i.findBindingPanel())&&(s.data=n.data)}}removeAdornment(t){Ht,Kt.t(t,"string",H,"removeAdornment:category");var e,i,s=this.tr;null!==s&&(null!==(e=s.getValue(t))&&null!==(i=e.diagram)&&(i.remove(e),e.data=null),s.remove(t),0===s.count)&&(this.tr=null)}clearAdornments(){var t=this.tr;if(null!==t){for(var e=Kt.ct(),i=t.iterator;i.next();){var s=i.key;e.push(s)}var n=e.length;for(let t=0;t{t.isEnabled&&t.updateAdornments(e)}),t.toolManager.updateAdornments(e)}GM(t){null===(this.ir=t)&&this.VR()}get layer(){return this.ir}get diagram(){var t=this.ir;return null==t?null:t.diagram}get layerName(){return this.ml}set layerName(e){var i,s,n=this.ml;if(n!==e){Kt.t(e,"string",H,"layerName");let t=this.diagram;null!==t&&(null===t.findLayer(e)||t.partManager.addsToTemporaryLayer)||(this.ml=e,null!==t&&t.invalidateDocumentBounds(),this.i("layerName",n,e),null===(n=this.layer))||n.name===e||null===(t=n.diagram)||null===(e=t.findLayer(e))||e===n||(0<=(i=n.re(-1,this,!0))&&t.raiseChangedEvent(4,"parts",n,this,null,i,!0),i=e.Qh(99999999,this,!0),n.visible!==e.visible&&this.Ki(e.visible),0<=i&&t.raiseChangedEvent(3,"parts",e,null,this,!0,i),null===(i=this.layerChanged))||(s=t.W,t.W=!0,i(this,n,e),t.W=s)}}get layerChanged(){return null!==this.E?this.E.qp:null}set layerChanged(t){var e=this.layerChanged;e!==t&&(null!==t&&Kt.t(t,"function",H,"layerChanged"),this.Qi(),this.E.qp=t,this.i("layerChanged",e,t))}get zOrder(){return this.Od}set zOrder(t){var e,i=this.Od;i!==t&&(Kt.t(t,"number",H,"zOrder"),this.Od=t,null!==(e=this.layer)&&e.Nx(-1,this),this.i("zOrder",i,t),null!==(e=this.diagram))&&e.T()}KI(){var t=this.layer;null!==t&&t.Nx(-1,this)}mb(){var t;!1===this.rh()&&(this.j2(!0),this.hd(),null!==(t=this.diagram))&&(t.d0(this),t.requestUpdate())}vL(){var t,e,i;this.N|=2097152,!1!==this.rh()&&(t=this.position,(e=this.location).isReal()&&t.isReal()||this.qL(t,e),e=this.Ri,i=Q.a().c(e),e.ut(),e.x=t.x,e.y=t.y,e.w(),this.ad(i,e),Q.o(i),this.j2(!1))}oo(t,e,i,s){var n=this.ce,a=(n.e(t,e,i,s),null===this.Ni&&(this.Ni=new V),this.Ni);a.ti(),this.P0(a,t,e,i,s),(this.Ni=a).Gk()||a.Nw(n)}P0(t,i,s,n,a){if(1!==this.v&&t.v(this.v),0!==this.qt){let e=Z.Center;this.locationSpot.isSpot()&&(e=this.locationSpot);var r=_.a();if(this.locationObject!==this){var o=this.locationObject,l=o.naturalBounds;r.setSpot(l.x,l.y,l.width,l.height,e),null!==o.Ni&&o.Ni.Pt(r),r.offset(-o.measuredBounds.x,-o.measuredBounds.y);let t=o.panel;for(;null!==t&&t!==this;)null!==t.Ni&&t.Ni.Pt(r),r.offset(-t.measuredBounds.x,-t.measuredBounds.y),t=t.panel}else r.setSpot(i,s,n,a,e);t.ys(this.qt,r.x,r.y),_.o(r)}}get locationObject(){var t;return null===this.er&&(this instanceof K&&this.type!==Xt.Link&&this.hasPlaceholder()?this.er=this.placeholder:""!==(t=this.locationObjectName)?(t=this.findObject(t),this.er=null!==t?t:this):this.er=this),this.er.visible?this.er:this}get minLocation(){return null!==this.E?this.E.Wp:_.iC}set minLocation(t){var e=this.minLocation;e.equals(t)||(Ht,Kt.s(t,_,H,"minLocation"),t=t.L(),this.Qi(),this.E.Wp=t,this.i("minLocation",e,t))}get maxLocation(){return null!==this.E?this.E.jp:_.eC}set maxLocation(t){var e=this.maxLocation;e.equals(t)||(Ht,Kt.s(t,_,H,"maxLocation"),t=t.L(),this.Qi(),this.E.jp=t,this.i("maxLocation",e,t))}get locationObjectName(){return null!==this.E?this.E.Jp:""}set locationObjectName(t){var e=this.locationObjectName;e!==t&&(Ht,Kt.t(t,"string",H,"locationObjectName"),this.Qi(),this.E.Jp=t,this.er=null,this.u(),this.i("locationObjectName",e,t))}get locationSpot(){return null!==this.E?this.E.Zp:Z.TopLeft}set locationSpot(t){var e=this.locationSpot;e.equals(t)||(Ht,Kt.s(t,Z,H,"locationSpot"),t.isSpot()||Kt.n("Part.locationSpot must be a specific Spot value, not: "+t),t=t.L(),this.Qi(),this.E.Zp=t,this.u(),this.i("locationSpot",e,t))}move(t,e){!0===e?this.location=t:this.position=t}moveTo(t,e,i){t=_.H(t,e);this.move(t,i),_.o(t)}isVisible(){if(!this.visible)return!1;var t=this.layer;if(null!==t){if(!t.visible)return!1;t=t.diagram;if(null!==t&&t.animationManager.ux(this))return!0}t=this.containingGroup;return!!(null===t||t.isSubGraphExpanded&&t.isVisible())}Ki(t){var e=this.diagram;t?(this.invalidateLayout(4),this.invalidateAdornments(),null!==e&&e.d0(this)):(this.invalidateLayout(8),this.clearAdornments()),this.mh(),null!==e&&(e.invalidateDocumentBounds(),e.T())}findObject(t){if(this.name===t)return this;let e=this.Hp;var i;return null===e&&(this.Hp=e=new L),null!==e.getValue(t)?e.getValue(t):null!==(i=super.findObject(t))?(e.set(t,i),i):(e.set(t,null),null)}V0(){this.Hp=null}getRelativePoint(e,t,i){void 0===i&&(i=new _);var t=t.isNoSpot()?Z.Center:t,s=e.naturalBounds;if(i.e(s.width*t.x+t.offsetX,s.height*t.y+t.offsetY),null!==e&&e!==this){e.D.Pt(i);let t=e.panel;for(;null!==t&&t!==this;)t.D.Pt(i),t=t.panel;null!==this.Ni&&this.Ni.Pt(i),i.offset(-this.ce.x,-this.ce.y)}return i}getDocumentBounds(t){return(t=void 0===t?new Q:t).c(this.actualBounds)}ensureBounds(){this.wt(1/0,1/0),this.vt()}xL(e){var t=this.locationSpot,i=this.locationObject,s=i.naturalBounds,n=i instanceof G?i.strokeWidth:0;if(e.setSpot(0,0,s.width+n,s.height+n,t),i!==this){e.offset(-n/2,-n/2),i.D.Pt(e);let t=i.panel;for(;null!==t&&t!==this;)t.D.Pt(e),t=t.panel}return null!==this.Ni&&this.Ni.Pt(e),e.offset(-this.ce.x,-this.ce.y),e}$h(n,a){var a=void 0===a?this.UL:a,t=this.UI(),e=2*t;if(this.isShadowed){let t=n.x,e=n.y,i=n.width,s=n.height;var r=this.shadowBlur,o=this.shadowOffset;i+=r,s+=r,t-=r/2,e-=r/2,0s.x&&e.y>s.y&&e.rights.x&&i.y>s.y&&i.right=n)return}}this.N=4096^this.N;let t=!1;null!==s&&(t=s.skipsUndoManager,s.skipsUndoManager=!0,(n=s.selection).ut(),e?n.add(this):n.remove(this),n.w()),this.i("isSelected",i,e),this.invalidateAdornments();n=this.selectionChanged;null!==n&&n(this),null!==s&&(s.requestUpdate(),s.skipsUndoManager=t)}}get isHighlighted(){return 0!=(524288&this.N)}set isHighlighted(t){var e,i=0!=(524288&this.N);i!==t&&(Ht,Kt.t(t,"boolean",H,"isHighlighted"),this.N=524288^this.N,null!==(e=this.diagram)&&((e=e.highlighteds).ut(),t?e.add(this):e.remove(this),e.w()),this.i("isHighlighted",i,t),this.T(),null!==(e=this.highlightedChanged))&&e(this)}get isShadowed(){return 0!=(8192&this.N)}set isShadowed(t){var e=0!=(8192&this.N);e!==t&&(Ht,Kt.t(t,"boolean",H,"isShadowed"),this.N=8192^this.N,this.fs(!0),this.i("isShadowed",e,t),this.T())}GL(){return 0!=(16384&this.N)}HL(t){t?this.N|=16384:this.N&=-16385}rh(){return 0!=(32768&this.N)}j2(t){t?this.N|=32768:this.N&=-32769}GI(){return 0!=(65536&this.N)}c2(t){t?this.N|=65536:this.N&=-65537}Rl(){return 0!=(131072&this.N)}Gs(t){t?this.N|=131072:this.N&=-131073}$L(){return 0!=(1048576&this.N)}pb(t){t?this.N|=1048576:this.N&=-1048577}get isAnimated(){return 0!=(262144&this.N)}set isAnimated(t){var e=0!=(262144&this.N);e!==t&&(Ht,Kt.t(t,"boolean",H,"isAnimated"),this.N=262144^this.N,this.i("isAnimated",e,t))}get highlightedChanged(){return null!==this.E?this.E.$p:null}set highlightedChanged(t){var e=this.highlightedChanged;e!==t&&(null!==t&&Kt.t(t,"function",H,"highlightedChanged"),this.Qi(),this.E.$p=t,this.i("highlightedChanged",e,t))}get selectionObjectName(){return null!==this.E?this.E.Qp:""}set selectionObjectName(t){var e=this.selectionObjectName;e!==t&&(Ht,Kt.t(t,"string",H,"selectionObjectName"),this.Qi(),this.E.Qp=t,this.pl=null,this.i("selectionObjectName",e,t))}get selectionAdornmentTemplate(){return null!==this.E?this.E._p:null}set selectionAdornmentTemplate(t){var e=this.selectionAdornmentTemplate;e!==t&&(Ht,Kt.s(t,K,H,"selectionAdornmentTemplate"),this.Qi(),this.E._p=t,this.i("selectionAdornmentTemplate",e,t))}get selectionObject(){var t;return null===this.pl&&(null!==(t=this.selectionObjectName)&&""!==t?(t=this.findObject(t),this.pl=null!==t?t:this):this instanceof Y?(t=this.path,this.pl=null!==t?t:this):this.pl=this),this.pl}get selectionChanged(){return null!==this.E?this.E.ty:null}set selectionChanged(t){var e=this.selectionChanged;e!==t&&(null!==t&&Kt.t(t,"function",H,"selectionChanged"),this.Qi(),this.E.ty=t,this.i("selectionChanged",e,t))}get resizeAdornmentTemplate(){return null!==this.E?this.E.iy:null}set resizeAdornmentTemplate(t){var e=this.resizeAdornmentTemplate;e!==t&&(Ht,Kt.s(t,K,H,"resizeAdornmentTemplate"),this.Qi(),this.E.iy=t,this.i("resizeAdornmentTemplate",e,t))}get resizeObjectName(){return null!==this.E?this.E.ey:""}set resizeObjectName(t){var e=this.resizeObjectName;e!==t&&(Ht,Kt.t(t,"string",H,"resizeObjectName"),this.Qi(),this.E.ey=t,this.i("resizeObjectName",e,t))}get resizeObject(){var t=this.resizeObjectName;if(""!==t){t=this.findObject(t);if(null!==t)return t}return this}get resizeCellSize(){return null!==this.E?this.E.sy:Yt.xw}set resizeCellSize(t){var e=this.resizeCellSize;e.equals(t)||(Ht,Kt.s(t,Yt,H,"resizeCellSize"),t=t.L(),this.Qi(),this.E.sy=t,this.i("resizeCellSize",e,t))}get rotateAdornmentTemplate(){return null!==this.E?this.E.ny:null}set rotateAdornmentTemplate(t){var e=this.rotateAdornmentTemplate;e!==t&&(Ht,Kt.s(t,K,H,"rotateAdornmentTemplate"),this.Qi(),this.E.ny=t,this.i("rotateAdornmentTemplate",e,t))}get rotateObjectName(){return null!==this.E?this.E.oy:""}set rotateObjectName(t){var e=this.rotateObjectName;e!==t&&(Ht,Kt.t(t,"string",H,"rotateObjectName"),this.Qi(),this.E.oy=t,this.i("rotateObjectName",e,t))}get rotateObject(){var t=this.rotateObjectName;if(""!==t){t=this.findObject(t);if(null!==t)return t}return this}get rotationSpot(){return null!==this.E?this.E.ry:Z.Default}set rotationSpot(t){var e=this.rotationSpot;e.equals(t)||((Ht,Kt.s(t,Z,H,"rotationSpot"),t===Z.Default)||t.isSpot()||Kt.n("Part.rotationSpot must be a specific Spot value or Spot.Default, not: "+t),t=t.L(),this.Qi(),this.E.ry=t,this.i("rotationSpot",e,t))}get text(){return this.di}set text(t){var e=this.di;e!==t&&(Ht,Kt.t(t,"string",H,"text"),this.di=t,this.i("text",e,t))}get containingGroup(){return this.kh}set containingGroup(e){if(this.De()){var i=this.kh;if(i!==e){Ht,null!==e&&Kt.s(e,X,H,"containingGroup"),null===e||this!==e&&!e.isMemberOf(this)||(this===e&&Kt.n("Cannot make a Group a member of itself: "+this.toString()),Kt.n("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+e.toString())),this.invalidateLayout(2);var s=this.diagram,n=(null!==i?i.Z2(this):this instanceof X&&null!==s&&s.Zr.remove(this),null!==(this.kh=e)?e.$2(this):this instanceof X&&null!==s&&s.Zr.add(this),this.invalidateLayout(1),null!==s&&s.W&&(n=this.data,t=s.model,null!==n)&&t.ma()&&(h=null!==e?e.data:null,t.setGroupForData(n,t.getKeyForNodeData(h))),this.containingGroupChanged);if(null!==n){let t=!0;null!==s&&(t=s.W,s.W=!0),n(this,i,e),null!==s&&(s.W=t)}if(this instanceof X)for(var t=new N,a=(H.ah(t,this,!0,0,!0),t.iterator);a.next();){var r=a.value;if(r instanceof D)for(var o=r.linksConnected;o.next();)o.value.Ed()}if(this instanceof D){for(var l=this.linksConnected;l.next();)l.value.Ed();var h=this.labeledLink;null!==h&&h.Ed()}this.i("containingGroup",i,e),null!==e&&e.KI()}}else Kt.n("cannot set the Part.containingGroup of a Link or Adornment")}mh(){var t=this.containingGroup;null!==t&&(t.hasPlaceholder()&&t.placeholder.u(),t.u(),t.invalidateConnectedLinks())}T(){var t=this.diagram;null!==t&&!this.hs()&&!this.rh()&&this.isVisible()&&this.Ri.isReal()&&t.T(this.$h(this.Ri))}u(){var t;this.Ko()||(super.u(),null!==(t=this.diagram)&&(t.d0(this),this instanceof D&&null!==this.labeledLink&&this.labeledLink.rc(),t.requestUpdate(!0)))}rc(t){var e;this.hs()||(null!==(e=this.diagram)&&(e.d0(this),this instanceof D&&this.invalidateConnectedLinks(),e.requestUpdate()),this.ro(!0))}vm(t){t||null!==(t=this.kh)&&t.$2(this)}qm(t){t||null!==(t=this.kh)&&t.Z2(this)}Wf(){var t,e=this.data;null!==e&&null!==(t=this.diagram)&&null!==(t=t.model)&&t.removeNodeData(e)}get containingGroupChanged(){return null!==this.E?this.E.ly:null}set containingGroupChanged(t){var e=this.containingGroupChanged;e!==t&&(null!==t&&Kt.t(t,"function",H,"containingGroupChanged"),this.Qi(),this.E.ly=t,this.i("containingGroupChanged",e,t))}findSubGraphLevel(){return this.Q2(this)}Q2(t){var e=t.containingGroup;if(null!==e)return 1+this.Q2(e);if(t instanceof D){e=t.labeledLink;if(null!==e)return this.Q2(e)}return 0}findTopLevelPart(){return this._2(this)}_2(t){var e=t.containingGroup;if(null!==e)return this._2(e);if(t instanceof D){e=t.labeledLink;if(null!==e)return this._2(e)}return t}get isTopLevel(){return!(null!==this.containingGroup||this instanceof D&&null!==this.labeledLink)}isMemberOf(t){return t instanceof X&&this.tN(this,t)}tN(t,e){if(t!==e&&null!==e){var i=t.containingGroup;if(null!==i&&(i===e||this.tN(i,e)))return!0;if(t instanceof D){i=t.labeledLink;if(null!==i)return this.tN(i,e)}}return!1}findCommonContainingGroup(t){if(null===t)return null;if(Ht,Kt.s(t,H,H,"findCommonContainingGroup:other"),this===t)return this.containingGroup;let e=this;for(;null!==e;){var i;e instanceof X&&e.pb(!0),e=(e=e instanceof D&&null!==(i=e.labeledLink)?i:e).containingGroup}let s=null;for(e=t;null!==e;){if(e.$L()){s=e;break}var n;e=(e=e instanceof D&&null!==(n=e.labeledLink)?n:e).containingGroup}for(e=this;null!==e;){var a;e instanceof X&&e.pb(!1),e=(e=e instanceof D&&null!==(a=e.labeledLink)?a:e).containingGroup}return s}get layoutConditions(){return null!==this.E?this.E.hy:127}set layoutConditions(t){var e=this.layoutConditions;e!==t&&(Ht,Kt.t(t,"number",H,"layoutConditions"),this.Qi(),this.E.hy=t,this.i("layoutConditions",e,t))}canLayout(){var t;return!(!this.isLayoutPositioned||!this.isVisible()||null!==(t=this.layer)&&t.isTemporary||this instanceof D&&this.isLinkLabel)}vI(t){return!!(this.isLayoutPositioned&&t&this.layoutConditions)&&!(null!==(t=this.layer)&&t.isTemporary||this instanceof D&&this.isLinkLabel||null!==(t=this.diagram)&&t.undoManager.isUndoingRedoing)}invalidateLayout(t){var e,i;this.vI(t=void 0===t?16777215:t)&&(null!==(i=this.kh)?null!==(e=i.layout)?e.invalidateLayout():i.invalidateLayout(t):null!==(e=this.diagram)&&null!==(i=e.layout)&&i.invalidateLayout())}LA(){var t;return!(!this.isVisible()||null!==(t=this.layer)&&t.isTemporary)}static ah(t,e,i,s,n,a){if(void 0===a&&(a=null),!t.contains(e)&&(null===a||a(e))&&!(e instanceof K))if(t.add(e),e instanceof D){if(i&&e instanceof X)for(var r=e.memberParts;r.next();){var o=r.value;H.ah(t,o,i,s,n,a)}if(!1!==n)for(var l=e.linksConnected;l.next();){var h,u,d=l.value;!t.contains(d)&&(h=d.fromNode,u=d.toNode,h=null===h||t.contains(h),u=null===u||t.contains(u),n?h&&u:h||u)&&H.ah(t,d,i,s,n,a)}if(1t instanceof Xe))instanceof Xe&&(null===this.Et?this.Et=o:(Ht,this.Et!==o&&Kt.n("Cannot insert a second Placeholder into the visual tree of an Adornment."))):4===t&&"elements"===e&&null!==this.Et&&(s===this.Et||s instanceof Xt&&this.Et.isContainedBy(s))&&(this.Et=null),super.tc(t,e,i,s,n,a,r)}updateAdornments(){}Wf(){}}(Re={})[Re.None=0]="None",Re[Re.Evenly=1]="Evenly",Re[Re.Packed=2]="Packed";var Re;class D extends H{z;bt;Nc;yl;Sh;ue;ni;constructor(t,e){void 0===t||t instanceof se||"number"==typeof t||"string"==typeof t?super(t):(super(),t&&(e=t)),this.z=13,this.bt=null,this.ni=new O,this.Nc=null,this.yl=null,this.ue=null,this.Sh=!1,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.z=this.z,null!==this.bt&&(this.bt.xi?t.bt=this.bt:t.bt=this.bt.copy())}qo(t){super.qo(t),t.invalidateConnectedLinks(),t.yl=this.yl,t.ue=null}static SpreadingNone=0;static SpreadingEvenly=1;static SpreadingPacked=2;wl(){null===this.bt?this.bt=new Oe:this.bt.xi&&(this.bt=this.bt.copy())}uh(){super.uh(),null!==this.bt&&(this.bt.xi=!0)}QL(t){null!==t&&(null===this.yl&&(this.yl=new N),this.yl.add(t))}_L(t){null!==t&&null!==this.yl&&this.yl.remove(t)}tT(t,e,i){if(null!==t&&null!==this.yl)for(var s=this.yl.iterator;s.next();){var n=s.value;if(n.uy===this&&n.yb===t&&n.iN===e&&n.eN===i||n.uy===t&&n.yb===this&&n.iN===i&&n.eN===e)return n}return null}invalidateLinkBundle(t,e,i){t=this.tT(t,e=null==e?"":e,i=null==i?"":i);null!==t&&t.Vd()}tc(t,e,i,s,n,a,r){(3===t&&"elements"===e||4===t&&"elements"===e)&&(this.ue=null),super.tc(t,e,i,s,n,a,r)}invalidateConnectedLinks(t){for(var e=this.linksConnected;e.next();){var i=e.value;void 0!==t&&t.contains(i)||(this.Se(i.fromPort),this.Se(i.toPort),i.invalidateRoute())}}nL(t){for(var e=this.linksConnected;e.next();){var i=e.value;i.fromPort!==t&&i.toPort!==t||(this.Se(i.fromPort),this.Se(i.toPort),i.invalidateRoute())}}Se(t){var e;null===t||(null!==(e=t.nd)&&e.Vd(),null===(t=(e=t.part).containingGroup))||e.isVisible()||t.Se(t.port)}tl(){return!0}get portSpreading(){return null!==this.bt?this.bt.gy:1}set portSpreading(t){var e=this.portSpreading;e!==t&&(Ht,0!==t&&1!==t&&2!==t&&Kt.n("Node.portSpreading can only be set to PortSpreading.None, PortSpreading.Evenly, or PortSpreading.Packed, not: "+t),this.wl(),this.bt.gy=t,this.i("portSpreading",e,t),null!==(e=this.diagram)&&e.undoManager.isUndoingRedoing||this.invalidateConnectedLinks())}get avoidable(){return 0!=(8&this.z)}set avoidable(t){var e,i=0!=(8&this.z);i!==t&&(Ht,Kt.t(t,"boolean",D,"avoidable"),this.z=8^this.z,null!==(e=this.diagram)&&e.KP(this),this.i("avoidable",i,t))}get avoidableMargin(){return null!==this.bt?this.bt.my:I.aC}set avoidableMargin(t){"number"==typeof t?t=new I(t):Kt.s(t,I,D,"avoidableMargin");var e,i=this.avoidableMargin;i.equals(t)||(t=t.L(),this.wl(),this.bt.my=t,null!==(e=this.diagram)&&e.KP(this),this.i("avoidableMargin",i,t))}canAvoid(){return this.avoidable&&!this.isLinkLabel}getAvoidableRect(t){return t.set(this.actualBounds),t.addMargin(this.avoidableMargin),t}findVisibleNode(){let t=this;for(;null!==t&&!t.isVisible();)t=t.containingGroup;return t}isVisible(){if(!super.isVisible())return!1;let i=!0,t=1;var e=this.diagram;if(null!==e){if(e.animationManager.ux(this))return!0;i=e.isTreePathToChildren,t=e.treeCollapsePolicy}if(1===t){e=this.findTreeParentNode();if(null!==e&&!e.isTreeExpanded)return!1}else if(2===t){var s=i?this.findLinksInto():this.findLinksOutOf();let t=!1,e=!1;for(;s.next();){var n=s.value;if(n.isTreeLink){t=!0;n=i?n.fromNode:n.toNode;if(n&&n.isTreeExpanded){e=!0;break}}}if(t&&!e)return!1}else if(3===t){var a=i?this.findLinksInto():this.findLinksOutOf();let t=!1,e=!1;for(;a.next();){var r=a.value;if(r.isTreeLink){t=!0;r=i?r.fromNode:r.toNode;if(r&&!r.isTreeExpanded){e=!0;break}}}if(t&&e)return!1}e=this.labeledLink;return null===e||e.isVisible()}Ki(t){super.Ki(t);for(var e=this.linksConnected;e.next();){var i,s=e.value;!t||null===this.containingGroup||null===(i=s.getOtherNode(this))||i.isMemberOf(this.containingGroup)||s.invalidateRoute(),s.Ki(t)}}get linksConnected(){return this.ni.iterator}findExternalTreeLinksConnected(){var t=new N,e=new N;return this.iT(this,t,e),e.iterator}iT(i,s,n){if(null!==i&&!s.has(i)){s.add(i);let e=!0;var t=this.diagram;null!==t&&(e=t.isTreePathToChildren),i.linksConnected.each(t=>{t.isTreeLink?(e?t.fromNode===i:t.toNode===i)&&this.iT(e?t.toNode:t.fromNode,s,n):n.add(t)})}}findLinksConnected(e){if(null===(e=void 0===e?null:e))return this.ni.iterator;Ht,Kt.t(e,"string",D,"findLinksConnected:pid");const t=new u(this.ni),i=this;return t.predicate=t=>t.fromNode===i&&t.fromPortId===e||t.toNode===i&&t.toPortId===e,t}findLinksOutOf(e){void 0===e&&(e=null),Ht,null!==e&&Kt.t(e,"string",D,"findLinksOutOf:pid");const t=new u(this.ni),i=this;return t.predicate=t=>t.fromNode===i&&(null===e||t.fromPortId===e),t}findLinksInto(e){void 0===e&&(e=null),Ht,null!==e&&Kt.t(e,"string",D,"findLinksInto:pid");const t=new u(this.ni),i=this;return t.predicate=t=>t.toNode===i&&(null===e||t.toPortId===e),t}findNodesConnected(t){void 0===t&&(t=null),Ht,null!==t&&Kt.t(t,"string",D,"findNodesConnected:pid");let e=null,i=null;for(var s=this.ni.iterator;s.next();){var n,a=s.value;a.fromNode===this?null!==t&&a.fromPortId!==t||(n=a.toNode,null!==e?e.add(n):null!==i&&i!==n?((e=new N).add(i),e.add(n)):i=n):a.toNode!==this||null!==t&&a.toPortId!==t||(n=a.fromNode,null!==e?e.add(n):null!==i&&i!==n?((e=new N).add(i),e.add(n)):i=n)}return null!==e?e.iterator:null!==i?new h(i):o.instance}findNodesOutOf(t){void 0===t&&(t=null),Ht,null!==t&&Kt.t(t,"string",D,"findNodesOutOf:pid");let e=null,i=null;for(var s=this.ni.iterator;s.next();){var n=s.value;n.fromNode!==this||null!==t&&n.fromPortId!==t||(n=n.toNode,null!==e?e.add(n):null!==i&&i!==n?((e=new N).add(i),e.add(n)):i=n)}return null!==e?e.iterator:null!==i?new h(i):o.instance}findNodesInto(t){void 0===t&&(t=null),Ht,null!==t&&Kt.t(t,"string",D,"findNodesInto:pid");let e=null,i=null;for(var s=this.ni.iterator;s.next();){var n=s.value;n.toNode!==this||null!==t&&n.toPortId!==t||(n=n.fromNode,null!==e?e.add(n):null!==i&&i!==n?((e=new N).add(i),e.add(n)):i=n)}return null!==e?e.iterator:null!==i?new h(i):o.instance}findLinksBetween(e,i,s){void 0===i&&(i=null),void 0===s&&(s=null),(Ht,Kt.s(e,D,D,"findLinksBetween:othernode"),null!==i&&Kt.t(i,"string",D,"findLinksBetween:pid"),null!==s)&&Kt.t(s,"string",D,"findLinksBetween:otherpid");const t=new u(this.ni),n=this;return t.predicate=t=>!((t.fromNode!==n||t.toNode!==e||null!==i&&t.fromPortId!==i||null!==s&&t.toPortId!==s)&&(t.fromNode!==e||t.toNode!==n||null!==s&&t.fromPortId!==s||null!==i&&t.toPortId!==i)),t}findLinksTo(e,i,s){void 0===i&&(i=null),void 0===s&&(s=null),(Ht,Kt.s(e,D,D,"findLinksTo:othernode"),null!==i&&Kt.t(i,"string",D,"findLinksTo:pid"),null!==s)&&Kt.t(s,"string",D,"findLinksTo:otherpid");const t=new u(this.ni),n=this;return t.predicate=t=>!(t.fromNode!==n||t.toNode!==e||null!==i&&t.fromPortId!==i||null!==s&&t.toPortId!==s),t}get linkConnected(){return null!==this.bt?this.bt.py:null}set linkConnected(t){var e=this.linkConnected;e!==t&&(null!==t&&Kt.t(t,"function",D,"linkConnected"),this.wl(),this.bt.py=t,this.i("linkConnected",e,t))}get linkDisconnected(){return null!==this.bt?this.bt.yy:null}set linkDisconnected(t){var e=this.linkDisconnected;e!==t&&(null!==t&&Kt.t(t,"function",D,"linkDisconnected"),this.wl(),this.bt.yy=t,this.i("linkDisconnected",e,t))}get linkValidation(){return null!==this.bt?this.bt.Fl:null}set linkValidation(t){var e=this.linkValidation;e!==t&&(null!==t&&Kt.t(t,"function",D,"linkValidation"),this.wl(),this.bt.Fl=t,this.i("linkValidation",e,t))}wb(e,i){this.Se(i);var s=this.ni.contains(e);if(s||this.ni.add(e),!s||e.fromNode===e.toNode){var n=this.linkConnected;if(null!==n){let t=!0;var a=this.diagram;null!==a&&(t=a.W,a.W=!0),n(this,e,i),null!==a&&(a.W=t)}}if(!s&&e.isTreeLink){n=e.fromNode,i=e.toNode;if(null!==n&&null!==i&&n!==i){let t=!0;a=this.diagram,s=(t=null!==a?a.isTreePathToChildren:t)?i:n,e=t?n:i;s.Sh||(s.Sh=e),!e.isTreeLeaf||null!==a&&a.undoManager.isUndoingRedoing||(t?n===e&&(e.isTreeLeaf=!1):i===e&&(e.isTreeLeaf=!1))}}}xb(e,i){this.Se(i);var t=this.ni.remove(e);let s=null;if(t||e.toNode===e.fromNode){var n=this.linkDisconnected;if(s=this.diagram,null!==n){let t=!0;null!==s&&(t=s.W,s.W=!0),n(this,e,i),null!==s&&(s.W=t)}}if(t&&e.isTreeLink){let t=!0;n=(t=null!==s?s.isTreePathToChildren:t)?e.toNode:e.fromNode,i=t?e.fromNode:e.toNode;null!==n&&(n.Sh=!1),null===i||i.isTreeLeaf||(0===i.ni.count?(i.Sh=null)!==s&&s.undoManager.isUndoingRedoing||(i.isTreeLeaf=!0):i.x0())}}x0(){if(this.Sh=!1,0!==this.ni.count){let t=!0;var e=this.diagram;if(null===e||!e.undoManager.isUndoingRedoing){null!==e&&(t=e.isTreePathToChildren);for(var i=this.ni.iterator;i.next();){var s=i.value;if(s.isTreeLink)if(t){if(s.fromNode===this)return void(this.isTreeLeaf=!1)}else if(s.toNode===this)return void(this.isTreeLeaf=!1)}this.isTreeLeaf=!0}}}updateRelationshipsFromData(){var t=this.diagram;null!==t&&t.partManager.updateRelationshipsFromData(this)}vm(t){super.vm(t),t||(this.x0(),null!==(t=this.Nc)&&t.eT(this))}qm(t){super.qm(t),t||null!==(t=this.Nc)&&t.sT(this)}Wf(){if(0t.uL(e)),0===this.ue.count&&this.ue.add("",this)}uL(t){var e=t.portId;null!==e&&null!==this.ue&&this.ue.add(e,t)}k2(t,e){t=t.portId;if(null!==t){null!==this.ue&&this.ue.remove(t);var i=this.diagram;if(null!==i&&e){let e=null;for(var s=this.findLinksConnected(t);s.next();){var n=s.value;(e=null===e?Kt.ct():e).push(n)}if(null!==e){for(let t=0;t!(!t.isTreeLink||t.fromNode!==s):i.predicate=t=>!(!t.isTreeLink||t.toNode!==s),i}findTreeChildrenNodes(){let t=!0;var e=this.diagram;null!==e&&(t=e.isTreePathToChildren);let i=null,s=null;var n=this.ni.iterator;if(t)for(;n.next();){var a=n.value;a.isTreeLink&&a.fromNode===this&&(a=a.toNode,null!==i?i.add(a):null!==s&&s!==a?((i=new O).add(s),i.add(a)):s=a)}else for(;n.next();){var r=n.value;r.isTreeLink&&r.toNode===this&&(r=r.fromNode,null!==i?i.add(r):null!==s&&s!==r?((i=new O).add(s),i.add(r)):s=r)}return null!==i?i.iterator:null!==s?new h(s):o.instance}findTreeParts(t){void 0===t&&(t=1/0),Kt.t(t,"number",D,"findTreeParts:level");var e=new N;return H.ah(e,this,!1,t,!0),e}collapseTree(t){void 0===t&&(t=1),Kt.r(t,D,"collapseTree:level"),t<1&&(t=1);var e,i=this.diagram;null===i||i.isCollapsingExpanding||(i.isCollapsingExpanding=!0,(e=new N).add(this),this.oT(e,i.isTreePathToChildren,t,i,this,1===i.treeCollapsePolicy),i.isCollapsingExpanding=!1)}oT(t,e,i,s,n,a){if(1t===u||!t.isTreeExpanded)&&i.Rf(o,s),o.mh(),o.Ki(!1)}o.isTreeExpanded&&(o.wasTreeExpanded=o.isTreeExpanded,l||o.rT(t,e,i,s,n))}}}this.isTreeExpanded=!1}expandTree(t){void 0===t&&(t=2),Kt.r(t,D,"expandTree:level"),t<2&&(t=2);var e,i=this.diagram;null===i||i.isCollapsingExpanding||(i.isCollapsingExpanding=!0,(e=new N).add(this),this.lT(e,i.isTreePathToChildren,t,i,this,1===i.treeCollapsePolicy),i.isCollapsingExpanding=!1)}lT(t,e,i,s,n,a){for(var r=n!==this&&this.isTreeExpanded,o=e?this.findLinksOutOf():this.findLinksInto();o.next();){var l=o.value;if(l.isTreeLink){r||l.Re||l.invalidateRoute();l=l.getOtherNode(this);if(null!==l&&l!==this&&!t.contains(l)){if(t.add(l),!r){l.Ki(!0),l.mh();const h=e?l.findNodesInto():l.findNodesOutOf(),u=this;h.all(t=>t===u||!t.isTreeExpanded)&&s.Ff(l,n)}(2= 0",Y,"fromEndSegmentLength"),this.je(),this.$.wa=t,this.i("fromEndSegmentLength",e,t),this.invalidateRoute())}get fromShortLength(){return null!==this.$?this.$.ba:NaN}set fromShortLength(t){var e=this.fromShortLength;e!==t&&(Ht,Kt.t(t,"number",Y,"fromShortLength"),this.je(),this.$.ba=t,this.fe(),this.i("fromShortLength",e,t))}get toSpot(){return null!==this.$?this.$.ya:Z.Default}set toSpot(t){var e=this.toSpot;e.equals(t)||(Ht,Kt.s(t,Z,Y,"toSpot"),t=t.L(),this.je(),this.$.ya=t,this.i("toSpot",e,t),(e.isSide()||t.isSide())&&null!==(e=this.toNode)&&e.Se(this.toPort),this.invalidateRoute())}get toEndSegmentLength(){return null!==this.$?this.$.xa:NaN}set toEndSegmentLength(t){var e=this.toEndSegmentLength;e!==t&&(Ht,Kt.t(t,"number",Y,"toEndSegmentLength"),t<0&&Kt.G(t,">= 0",Y,"toEndSegmentLength"),this.je(),this.$.xa=t,this.i("toEndSegmentLength",e,t),this.invalidateRoute())}get toShortLength(){return null!==this.$?this.$.ka:NaN}set toShortLength(t){var e=this.toShortLength;e!==t&&(Ht,Kt.t(t,"number",Y,"toShortLength"),this.je(),this.$.ka=t,this.fe(),this.i("toShortLength",e,t))}Ed(){var t=this.fromNode,e=this.toNode;let i=null;if(i=null!==t?null!==e?t.findCommonContainingGroup(e):t.containingGroup:null!==e?e.containingGroup:null,this.ZI(i),this.isLabeledLink)for(var s=this.labelNodes;s.next();)s.value.containingGroup=i}ZI(e){var i=this.kh;if(i!==e){null!==i&&i.Z2(this),null!==(this.kh=e)&&e.$2(this);var s=this.containingGroupChanged;if(null!==s){let t=!0;var n=this.diagram;null!==n&&(t=n.W,n.W=!0),s(this,i,e),null!==n&&(n.W=t)}!this.Re||this.oN!==i&&this.rN!==i||this.invalidateRoute()}}mh(){var t=this.containingGroup;null!==t&&this.fromNode!==t&&this.toNode!==t&&t.computesBoundsIncludingLinks&&super.mh()}getOtherNode(t){Ht,Kt.s(t,D,Y,"getOtherNode:node");var e=this.fromNode;return t===e?this.toNode:e}getOtherPort(t){Ht,Kt.s(t,y,Y,"getOtherPort:port");var e=this.fromPort;return t===e?this.toPort:e}get isLabeledLink(){return null!==this.Qs&&0=a&&(t=a-1),this.getPoint(t-1)),h=this.getPoint(t);z.gu(e.x,e.y,o.x,o.y,l.x,l.y,h.x,h.y,.5,i),s=Math.min(h.x,s),n=Math.min(h.y,n),e=h}}else{t=this.getPoint(0),r=this.getPoint(1);s=Math.min(t.x,r.x),n=Math.min(t.y,r.y),i.e(t.x,t.y,0,0),i.unionPoint(r);for(let t=2;tr/2));)t+=i,e++;var o,l,h,u=this.getPoint(e),d=this.getPoint(e+1);Math.abs(u.x-d.x)<1?u.y>d.y?s.e(u.x,u.y-(r/2-t)):s.e(u.x,u.y+(r/2-t)):Math.abs(u.y-d.y)<1?u.x>d.x?s.e(u.x-(r/2-t),u.y):s.e(u.x+(r/2-t),u.y):(l=(o=(r/2-t)/i)*(d.x-u.x),h=o*(d.y-u.y),s.e(u.x+l,u.y+h))}return s}get midAngle(){return this.updateRoute(),this.computeMidAngle()}computeMidAngle(){var e=this.pointsCount;if(e<2)return NaN;if(2===e)return i=this.getPoint(0),o=this.getPoint(1),i.directionPoint(o);if(this.isOrthogonal&&(15<=this.computeCorner()||9===this.computeCurve()))return this.yt.getAngleAlongPath(.5);if(9===this.computeCurve()&&4<=e){var i=(e-1)/3|0;let t=3*(i/2|0);if(i%2==1)return t=Math.floor(t),o=this.getPoint(t),i=this.getPoint(t+1),l=this.getPoint(t+2),h=this.getPoint(t+3),z.ED(o.x,o.y,i.x,i.y,l.x,l.y,h.x,h.y);if(0s/2));)n+=r,a++;var o,l=this.getPoint(a),h=this.getPoint(a+1);if(Math.abs(l.x-h.x)<1&&Math.abs(l.y-h.y)<1){if(0h.y?270:90;if(Math.abs(l.y-h.y)<1)return l.x>h.x?180:0}return l.directionPoint(h)}QI(){var t;null===this.Sy&&(this.Re||this.Sb(),t=this.Sy=[],this._I(t))}get flattenedLengths(){return this.QI(),this.Sy}get flattenedTotalLength(){let e=this.kb;if(isNaN(e)){var i=this.flattenedLengths,s=i.length;for(let t=e=0;tMath.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}getLinkPointFromPoint(r,o,l,h,t,u){if(void 0===u&&(u=new _),null===r||null===o)u.c(l);else{var d,c,g,m,f;r.isVisible()||null!==(f=r.findVisibleNode())&&f!==r&&(o=(r=f).port);let t=0,e=0,i=0,s=0,n=null,a=o.panel;s=null===(a=null===a||a.Mn()?a:a.panel)?(t=h.x,e=h.y,i=l.x,l.y):(f=1/((n=a.Ms).m11*n.m22-n.m12*n.m21),r=n.m22*f,d=-n.m12*f,c=-n.m21*f,g=n.m11*f,m=f*(n.m21*n.dy-n.m22*n.dx),f=f*(n.m12*n.dx-n.m11*n.dy),t=h.x*r+h.y*c+m,e=h.x*d+h.y*g+f,i=l.x*r+l.y*c+m,l.x*d+l.y*g+f),o.ec(t,e,i,s,u),null!==n&&u.D(n)}return u}eO(t,e){t=t.nd;return null!==t?t.hT(e):null}Pb(t){let e=t.nd;return null===e&&((e=new je).or=t,e.be=t.part,t.nd=e),e.hT(this)}getLinkPoint(e,i,s,n,a,r,o,l){if(void 0===l&&(l=new _),s.isSpot()&&!this.Gd(s))i.getDocumentPoint(s,l);else{if(s.isSide()){var h,u=this.Pb(i);if(null!==u)return h=u.Hd,l.c(h),a&&7===this.routing&&null!==(h=this.Pb(o))&&u.Lc=d.y&&r.y<=d.y+d.height?l.y=r.y:(s.includesSide(Z.TopSide)||s.includesSide(Z.BottomSide))&&r.x>=d.x&&r.x<=d.x+d.width&&(l.x=r.x),_.o(u),_.o(h)),l}var d,c=i.getDocumentPoint(this.Nb(s,n),_.a());let t=null;this.pointsCount>(a?6:2)?(t=n?this.getPoint(1):this.getPoint(this.pointsCount-2),a&&(t=this.uN(c,t.copy()))):(d=this.computeSpot(!n,o),r=_.a(),t=o.getDocumentPoint(this.Nb(d,!n),r),a&&(t=this.uN(c,t)),_.o(r)),this.getLinkPointFromPoint(e,i,c,t,n,l),_.o(c)}return l}getLinkDirection(t,e,i,s,n,a,r,o){let l=this.sO(t,e,i,s,n,a,r,o);return r&&s.isNoSpot()&&r.isMemberOf(t)&&360<=(l+=180)&&(l-=360),this.Gd(s)||0!==(i=e.getDocumentAngle())&&(45<=i&&i<135?l+=90:135<=i&&i<225?l+=180:225<=i&&i<315&&(l+=270),360<=l)&&(l-=360),l}sO(t,e,i,s,n,a,r,o){if(s.isSpot())return s.x>s.y?s.x>1-s.y?0:s.x<1-s.y?270:315:s.x1-s.y?90:s.x<1-s.y?180:135:s.x<.5?225:.5(a?6:2)?(l=n?this.getPoint(1):this.getPoint(this.pointsCount-2),l=a?this.uN(s,l.copy()):i):(e=_.a(),l=o.getDocumentPoint(Z.Center,e),_.o(e)),0);return h=Math.abs(l.x-s.x)>Math.abs(l.y-s.y)?l.x>=s.x?0:180:l.y>=s.y?90:270,_.o(s),h}computeEndSegmentLength(t,e,i,s){if(null!==e&&i.isSide()){i=this.Pb(e);if(null!==i)return i.Cb}let n=NaN;return n=s?this.fromEndSegmentLength:this.toEndSegmentLength,null!==e&&isNaN(n)&&(n=s?e.fromEndSegmentLength:e.toEndSegmentLength),n=isNaN(n)?10:n}computeSpot(t,e){return void 0===e&&(e=null),t?this.nO(e||this.fromPort):this.oO(e||this.toPort)}nO(t){if(null===t)return Z.Center;let e=this.fromSpot;return(e=e.isDefault()?t.fromSpot:e)===Z.Default?Z.None:e}oO(t){if(null===t)return Z.Center;let e=this.toSpot;return(e=e.isDefault()?t.toSpot:e)===Z.Default?Z.None:e}Gd(t){return t===Z.None||.5===t.x&&.5===t.y}Nb(t,e){return.5===t.x&&.5===t.y?t:Z.Center}computeOtherPoint(t,e){var i;return 0!==this.computeAdjusting()&&4d.width||u.y>d.height||u.x+u.width<0||u.y+u.height<0)){d=h,u=V.a();if(u.set(i),d instanceof Xt?e=d.Um(s,n,a,r,o,u):this.path===d?d instanceof G&&(e=d.AI(s,r,u)):e=d.eL(s,r,u),e){let t=d;(t=null!==n?n(d):t)&&(null===a||a(t))&&o.add(t)}V.o(u)}}}}return void 0===t&&V.o(i),e||null!==this.background}void 0===t&&V.o(i)}return!1}get isOrthogonal(){return 2==(2&this.Va)}static aN(t){return 2==(2&t)}get isAvoiding(){return 4==(4&this.Va)}computeCurve(){var t,e;return null===this.sr&&(t=null!==(t=this.fromPort)&&t===this.toPort,e=this.isOrthogonal,this.sr=t&&!e),this.sr?9:this.curve}computeCorner(){if(9===this.curve)return 0;let t=this.corner;return t=isNaN(t)||t<0?10:t}findMidLabel(){var e=this.path,i=this.F.h,s=i.length;for(let t=0;to.x||270===s&&l.yo.x||90===s&&l.y>o.y&&a.right>o.x?(t.e(l.x,o.y),i.e(l.x,(o.y+l.y)/2),180===s?(t.x=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!1),i.x=t.x,i.y=l.y):270===s&&l.yo.y?(o.xa.bottom)?t.x=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!1):t.x=a.right,i.x=t.x,i.y=l.y):0===s&&o.xa.top&&o.yn.bottom)&&(180===s&&(a.containsPoint(o)||n.containsPoint(l))?t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!0):l.yo.y&&(180===s||270===s)&&(t.y=this.computeMidOrthoPosition(o.x,n.bottom,l.x,Math.min(l.y,a.top),!0)),i.x=l.x,i.y=t.y),t.y>n.top&&t.y=n.left&&l.x<=o.x||o.x<=a.right&&o.x>=l.x?90!==s&&270!==s||(t.e(Math.max((o.x+l.x)/2,o.x),o.y),i.e(t.x,l.y)):(270===s||(0===s||180===s)&&l.yo.y&&a.lefto.y?(o.x>a.right?t.x=this.computeMidOrthoPosition(o.x,o.y,a.right,l.y,!1):o.x>a.left&&(270===s&&o.ya.bottom)?t.x=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!1):t.x=a.left,i.x=t.x,i.y=l.y):180===s&&o.x>a.right&&o.y>a.top&&o.yn.bottom)&&(0===s&&(a.containsPoint(o)||n.containsPoint(l))?t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!0):l.yo.y&&(0===s||270===s)&&(t.y=this.computeMidOrthoPosition(o.x,n.bottom,l.x,Math.min(l.y,a.top),!0)),i.x=l.x,i.y=t.y),t.y>n.top&&t.y=o.x||o.x>=a.left&&o.x<=l.x?90!==s&&270!==s||(t.e(Math.min((o.x+l.x)/2,o.x),o.y),i.e(t.x,l.y)):(270===s||(0===s||180===s)&&l.yo.y||180===s&&l.xo.y||0===s&&l.x>o.x&&a.bottom>o.y?(t.e(o.x,l.y),i.e((o.x+l.x)/2,l.y),270===s?(t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!0),i.x=l.x,i.y=t.y):180===s&&l.xo.x?(o.ya.right)?t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!0):t.y=a.bottom,i.x=l.x,i.y=t.y):90===s&&o.ya.left&&o.xn.right)&&(270===s&&(a.containsPoint(o)||n.containsPoint(l))?t.x=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!1):l.xo.x&&(270===s||180===s)&&(t.x=this.computeMidOrthoPosition(n.right,o.y,Math.min(l.x,a.left),l.y,!1)),i.x=t.x,i.y=l.y),t.x>n.left&&t.x=n.top&&l.y<=o.y||o.y<=a.bottom&&o.y>=l.y?0!==s&&180!==s||(t.e(o.x,Math.max((o.y+l.y)/2,o.y)),i.e(l.x,t.y)):(180===s||(90===s||270===s)&&l.xo.x&&a.top=o.x?(o.y>a.bottom?t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,a.bottom,!0):o.y>a.top&&(180===s&&o.xa.right)?t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!0):t.y=a.top,i.x=l.x,i.y=t.y):270===s&&o.y>a.bottom&&o.x>a.left&&o.xn.right)&&(90===s&&(a.containsPoint(o)||n.containsPoint(l))?t.x=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!1):l.xo.x&&(90===s||180===s)&&(t.x=this.computeMidOrthoPosition(n.right,o.y,Math.min(l.x,a.left),l.y,!1)),i.x=t.x,i.y=l.y),t.x>n.left&&t.x=o.y||o.y>=a.top&&o.y<=l.y?0!==s&&180!==s||(t.e(o.x,Math.min((o.y+l.y)/2,o.y)),i.e(l.x,t.y)):(180===s||(90===s||270===s)&&l.xGe.xo&&s._i(d,c)!==l-1&&(s._i(h-r,u)===l-1?(n=180,d=h-r,c=u):s._i(h+r,u)===l-1?(n=0,d=h+r,c=u):s._i(h,u-o)===l-1?(n=270,d=h,c=u-o):s._i(h,u+o)===l-1&&(n=90,d=h,c=u+o));l>Ge.xo&&s._i(d,c)===l-1;)h=d,u=c,0===n?d+=r:90===n?c+=o:180===n?d-=r:c-=o,--l;if(i?l>Ge.xo&&(180===n||0===n?h=Math.floor(h/r)*r+r/2:90!==n&&270!==n||(u=Math.floor(u/o)*o+o/2)):(h=Math.floor(h/r)*r+r/2,u=Math.floor(u/o)*o+o/2),l>Ge.xo){let i=n,t=h,e=u;if(0===n?(i=90,e+=o):90===n?(i=180,t-=r):180===n?(i=270,e-=o):270===n&&(i=0,t+=r),s._i(t,e)===l-1)this.vd(s,t,e,i,!1,i);else{let t=h,e=u;0===n?(i=270,e-=o):90===n?(i=0,t+=r):180===n?(i=90,e+=o):270===n&&(i=180,t-=r),s._i(t,e)===l-1&&this.vd(s,t,e,i,!1,i)}}this.addPointAt(h,u)}findClosestSegment(t){Ht,Kt.s(t,_,Y,"findClosestSegment:p");var e=t.x,i=t.y;let s=this.getPoint(0),n=this.getPoint(1),a=_.distanceLineSegmentSquared(e,i,s.x,s.y,n.x,n.y),r=0;for(let t=1;t=s&&(t=s-1);var c=this.getPoint(t);l.x=Math.min(c.x,l.x),l.y=Math.min(c.y,l.y)}a=l.x,r=l.y}else{for(let t=0;t=s&&(e=s-1),this.getPoint(e-1));let t=this.getPoint(e);e===s-1&&0!==this.computeShortLength(!1)&&(t=this.Tc(t.copy(),!1,_.To)),m.br(P.x-a,P.y-r,k.x-a,k.y-r,t.x-a,t.y-r)}else{var S=_.a(),M=(S.c(this.getPoint(0)),_.a()),C=(M.c(S),this.computeCorner());let e=1,i=0;for(;e=s-1){if(S.equals(t)){if(0===i)for(e=1;eo?o:t)*(a-e.x)/r,a=t*(i-e.y)/r;e.x+=o,e.y+=a}else{i=this.getPoint(n-2),r=i.x-s.x,o=i.y-s.y,a=this.Ab(e.x,e.y,r,o);if(0===a)return e;i=2===n?.5*a:a;let t=this.computeShortLength(!1);s=(t=t>i?i:t)*(e.x-r)/a,n=t*(e.y-o)/a;e.x-=s,e.y-=n}return e}dN(t,e,i){var s=this.pointsCount;let n=t;for(;z.q(t.x,n.x)&&z.q(t.y,n.y);){if(s<=e)return s-1;n=this.getPoint(e++)}if(!z.q(t.x,n.x)&&!z.q(t.y,n.y))return e-1;let a=n;for(;z.q(t.x,n.x)&&z.q(n.x,a.x)&&(!i||(t.y>=n.y?n.y>=a.y:n.y<=a.y))||z.q(t.y,n.y)&&z.q(n.y,a.y)&&(!i||(t.x>=n.x?n.x>=a.x:n.x<=a.x));){if(s<=e)return s-1;a=this.getPoint(e++)}return e-2}cO(i,s,n,a,r,o,l,t,h,u){if(z.p(a.y,r.y)&&z.p(r.x,o.x)){var d=Math.min(h,Math.abs(r.x-t.x)/2),c=Math.min(d,Math.abs(o.y-r.y)/2),d=c;if(z.p(d,0))this.Rn(i,s,n,a,r,u),l.c(r);else{let t=r.x;var g=r.y,m=t;let e=g;e=(t=r.x>a.x?r.x-d:r.x+d,o.y>r.y?r.y+c:r.y-c);d=_.H(t,g);this.Rn(i,s,n,a,d,u),_.o(d),i.Dw(r.x+s,r.y+n,m+s,e+n),l.e(m,e)}}else if(z.p(a.x,r.x)&&z.p(r.y,o.y)){c=Math.min(h,Math.abs(r.y-t.y)/2),g=Math.min(c,Math.abs(o.x-r.x)/2),c=g;if(z.p(g,0))this.Rn(i,s,n,a,r,u),l.c(r);else{d=r.x;let t=r.y,e=d;m=t,h=(e=(t=r.y>a.y?r.y-c:r.y+c,o.x>r.x?r.x+g:r.x-g),_.H(d,t));this.Rn(i,s,n,a,h,u),_.o(h),i.Dw(r.x+s,r.y+n,e+s,m+n),l.e(e,m)}}else this.Rn(i,s,n,a,r,u),l.c(r)}computeJumpLength(){return 10}Rn(a,r,o,l,h,t){if(!t&&this.Ya()){var u=this.computeJumpLength(),d=u/2,c=[];let i=0,s=(this.isVisible()&&(i=this.uO(l,h,c)),l.x),n=l.y;if(0t-u))break;e--,t=Math.max(y-d,h.x)}var v=h.y-u+o,b=t+r,x=h.y+o;10===this.curve?a.yu(b,x,!1,!1):a.br(s,v,b,v,b,x),s=b,n=x}}else if(z.p(l.x,h.x))if(l.yt-u))break;e--,t=Math.max(M-d,h.y)}var S=h.x-u+r,C=h.x+r,N=t+o;10===this.curve?a.yu(C,N,!1,!1):a.br(S,n,S,N,C,N),s=C,n=N}}}a.xr(h.x+r,h.y+o)}uO(e,i,s){var t=this.diagram;if(null===t||e.equals(i))return 0;for(var n=t.layers;n.next();){var a=n.value;if(null!==a&&a.visible){var r=a.HM(),o=r.length;for(let t=0;tt-e),s.length;h.isVisible()&&h.Ya()&&(l=h.routeBounds).isReal()&&this.routeBounds.intersectsRect(l)&&!this.usesSamePort(h)&&null!==(l=h.path)&&l.isVisibleObject()&&this.dO(e,i,s,h)}}}}return 0t-e),s.length}dO(e,i,s,n){var a=z.p(e.y,i.y),r=n.pointsCount;let o=n.getPoint(0);var l=_.a();for(let t=1;to.x&&u.x>=h.x||h.xo.y&&u.y>=h.y||h.yi&&Math.min(o,l)a&&!z.p(o,l))return n.x=a,n.y=i,!0}else if(z.p(t,e)&&z.p(o,l)&&Math.min(a,r)o&&Math.min(i,s)t&&!z.p(i,s))return n.x=o,n.y=t,!0;return n.x=0,n.y=0,!1}get firstPickIndex(){return!(this.pointsCount<=2)&&(this.isOrthogonal||!this.Gd(this.computeSpot(!0)))?1:0}get lastPickIndex(){var t=this.pointsCount;return 0===t?0:!(t<=2)&&(this.isOrthogonal||!this.Gd(this.computeSpot(!1)))?t-2:t-1}Ya(){var t=this.curve;return 11===t||10===t}Mb(t){!t&&!this.Ya()||null===(t=this.diagram)||t.animationManager.isTicking||t.sh.contains(this)||0===this.Ac.width&&0===this.Ac.height||t.sh.add(this,this.Ac.copy())}invalidateOtherJumpOvers(i){var e=this.layer;if(null!==e&&e.visible&&!e.isTemporary){var s=e.diagram;if(null!==s&&!s.animationManager.isTicking){let t=!1;for(var n=s.layers;n.next();){var a=n.value;if(a.visible)if(a===e){let e=!(t=!0);var r=a.HM(),o=r.length;for(let t=0;t=Ge.xo&&(e[t]=Ge.gN)}}pO(t,e){return this._i(t,e)===Ge.tn}isUnoccupied(n,a,r,o){if(!(n>this.Ka||n+rthis.Ua||a+othis.Ka||ethis.Ua||ithis.Ua||ethis.Ka||i=Ge.xo&&l=h)break;this.Yt[t][e]=l,l+=1,s?e+=i:t+=i}return s?e:t}bo(e,i,s,n,a,r,o,l){if(!(eh;t+=s)this.bo(e,t,1,!n,a,r,o,l),this.bo(e,t,-1,!n,a,r,o,l);else if(0h;t+=s)this.bo(t,i,1,!n,a,r,o,l),this.bo(t,i,-1,!n,a,r,o,l)}}Lb(t,e,i,s,n,a,r,o,l,h){let u=0|t,d=0|e,c=Ge.tn,g=Ge.xo;for(this.Yt[u][d]=g;c===Ge.tn&&u>r&&ul&&dr&&ul&&di?i++:ms?s++:fr))break;t--}else{if(!(e>o))break;e--}var i=h[t][e];if(0===i||i===Ge.mN)break;u=t,d=e}for(;;){let t=a,e=u,i=d;0===a||90!==a&&180===a?io&&(t=270,i--):er&&(t=180,e--);var c=h[e][i];if(t!==a&&0!==c&&c!==Ge.mN){if(l.push(u),l.push(d),this.cT(u,d,t,r,o,l))return!0;l.pop(),l.pop()}if(h[u][d]=Ge.mN,0===a){if(u===s)return!1;u--}else if(90===a){if(d===n)return!1;d--}else if(180===a){if(u===s)return!1;u++}else{if(d===n)return!1;d++}}}}class je{be;or;ds;jd;constructor(){N.ji(this),this.be=null,this.or=null,this.ds=[],this.jd=!1}toString(){var e=this.ds;let i=this.be.toString()+" "+e.length.toString()+":";for(let t=0;ta&&n<=180+a?180:270;case 5:return n>180-a&&n<=360-a?270:0;case 12:return n>a&&n<=180+a?90:0;case 10:return n>180-a&&n<=360-a?180:90;case 7:return 90180+a&&n<=360-a?270:0;case 13:return 180a&&n<=180?90:0;case 14:return n>a&&n<=180-a?90:n>180-a&&n<=270?180:0;case 11:return n>180-a&&n<=180+a?180:n>180+a?270:90}return s&&15!==e&&(n-=15)<0&&(n+=360),n>a&&n<180-a?90:n>=180-a&&n<=180+a?180:n>180+a&&n<360-a?270:0}Vd(){this.ds.length=0}hT(e){let i=this.ds;0===i.length&&(this.xO(),i=this.ds);for(let t=0;te.Me?1:t.qte.qt?1:0}bO(){this.ds.sort(je.prototype.MO)}kO(e){var t=this.or,i=this.be.portSpreading,s=_.a(),n=_.a(),a=_.a(),r=_.a();t.getDocumentPoint(Z.TopLeft,s),t.getDocumentPoint(Z.TopRight,n),t.getDocumentPoint(Z.BottomRight,a),t.getDocumentPoint(Z.BottomLeft,r);let o=0,l=0,h=0,u=0;if(2===i)for(let t=0;tMath.abs(y)?(f=Math.abs(y)/h,h=Math.abs(y)):f=1;break;case 2:u>Math.abs(b)?(f=Math.abs(b)/u,u=Math.abs(b)):f=1;break;case 1:o>Math.abs(y)?(f=Math.abs(y)/o,o=Math.abs(y)):f=1;break;default:l>Math.abs(b)?(f=Math.abs(b)/l,l=Math.abs(b)):f=1}m=0}var w=x.Hd;if(2===i){var A=x._e.computeThickness();switch(A*=f,w.set(p),g){case 8:w.x=p.x+y/2+h/2-m-A/2;break;case 2:w.y=p.y+b/2+u/2-m-A/2;break;case 1:w.x=p.x+y/2-o/2+m+A/2;break;default:w.y=p.y+b/2-l/2+m+A/2}m+=A}else{let t=.5;1===i&&(t=(x.Jd+1)/(x.Lc+1)),w.x=p.x+y*t,w.y=p.y+b*t}}}_.o(s),_.o(n),_.o(a),_.o(r)}SO(e){for(let t=0;tt instanceof Xe);e instanceof Xe?t.Et=e:t.Et=null,null!==this.le?(t.le=this.le.copy(),t.le.group=t):(null!==t.le&&(t.le.group=null),t.le=null),null!==this.hi&&(t.hi=this.hi.copy())}qo(t){super.qo(t);for(var e=t.findSubGraphParts(),i=t.memberParts;i.next();){var s=i.value;if(s.u(),s.invalidateLayout(8),s.clearAdornments(),s instanceof D)s.invalidateConnectedLinks(e);else if(s instanceof Y)for(var n=s.labelNodes;n.next();)n.value.invalidateConnectedLinks(e)}}tc(t,e,i,s,n,a,r){var o;3===t&&"elements"===e?n instanceof Xe?null===this.Et?this.Et=n:this.Et!==n&&Kt.n("Cannot insert a second Placeholder into the visual tree of a Group."):n instanceof Xt&&(o=n.findInVisualTree(t=>t instanceof Xe))instanceof Xe&&(null===this.Et?this.Et=o:this.Et!==o&&Kt.n("Cannot insert a second Placeholder into the visual tree of a Group.")):4===t&&"elements"===e&&null!==this.Et&&(s===this.Et||s instanceof Xt&&this.Et.isContainedBy(s))&&(this.Et=null),super.tc(t,e,i,s,n,a,r)}ad(t,e){if(super.ad(t,e),this.isClipping&&this.type!==Xt.Spot&&this.isSubGraphExpanded){let t=this.resizeObject;t instanceof Xt&&(t=t.findMainElement()),null===this.hi&&(this.hi=new Q),t.getDocumentBounds(this.hi),t instanceof G&&this.hi.inflate(-t.strokeWidth,-t.strokeWidth)}}gh(t,e,i,s){this.hasPlaceholder()&&(this.er=this.placeholder),super.gh(t,e,i,s)}ensureBounds(){const e=this;e.isSubGraphExpanded&&this.memberParts.each(t=>{!e.computesBoundsIncludingLinks&&t instanceof Y||t.ensureBounds()}),super.ensureBounds()}tl(){if(!super.tl())return!1;for(var t=this.memberParts;t.next();){var e=t.value;if(e instanceof D){if(e.isVisible()&&e.hs())return!1}else if(e instanceof Y&&e.isVisible()&&e.hs()&&e.fromNode!==this&&e.toNode!==this)return!1}return!0}hasPlaceholder(){return null!==this.Et&&this.Et.isVisibleObject()&&this.isSubGraphExpanded}get placeholder(){return this.Et}get computesBoundsAfterDrag(){return 0!=(2048&this.z)}set computesBoundsAfterDrag(t){var e=0!=(2048&this.z);e!==t&&(Kt.t(t,"boolean",X,"computesBoundsAfterDrag"),this.z=2048^this.z,this.i("computesBoundsAfterDrag",e,t))}get computesBoundsIncludingLinks(){return 0!=(4096&this.z)}set computesBoundsIncludingLinks(t){Kt.t(t,"boolean",X,"computesBoundsIncludingLinks");var e=0!=(4096&this.z);e!==t&&(this.z=4096^this.z,this.i("computesBoundsIncludingLinks",e,t))}get computesBoundsIncludingLocation(){return 0!=(8192&this.z)}set computesBoundsIncludingLocation(t){Kt.t(t,"boolean",X,"computesBoundsIncludingLocation");var e=0!=(8192&this.z);e!==t&&(this.z=8192^this.z,this.i("computesBoundsIncludingLocation",e,t))}get handlesDragDropForMembers(){return 0!=(16384&this.z)}set handlesDragDropForMembers(t){Kt.t(t,"boolean",X,"handlesDragDropForMembers");var e=0!=(16384&this.z);e!==t&&(this.z=16384^this.z,this.i("handlesDragDropForMembers",e,t))}get avoidableMembers(){return 0!=(131072&this.z)}set avoidableMembers(t){Kt.t(t,"boolean",X,"avoidableMembers");var e=0!=(131072&this.z);e!==t&&(this.z=131072^this.z,this.i("avoidableMembers",e,t))}get memberParts(){return this.Zd.iterator}$2(e){if(this.Zd.add(e)){e instanceof X&&this.ua.add(e);var i=this.memberAdded;if(null!==i){let t=!0;var s=this.diagram;null!==s&&(t=s.W,s.W=!0),i(this,e),null!==s&&(s.W=t)}this.isVisible()&&this.isSubGraphExpanded||e.Ki(!1)}if(!(e instanceof Y)||this.computesBoundsIncludingLinks){let t=this.Et;(t=null===t?this:t).u()}}Z2(e){if(this.Zd.remove(e)){e instanceof X&&this.ua.remove(e);var i=this.memberRemoved;if(null!==i){let t=!0;var s=this.diagram;null!==s&&(t=s.W,s.W=!0),i(this,e),null!==s&&(s.W=t)}this.isVisible()&&this.isSubGraphExpanded||e.Ki(!0)}if(!(e instanceof Y)||this.computesBoundsIncludingLinks){let t=this.Et;(t=null===t?this:t).u()}}Wf(){if(0t.updateAdornments())):t?this.expandSubGraph():this.collapseSubGraph()}}get wasSubGraphExpanded(){return 0!=(1024&this.z)}set wasSubGraphExpanded(t){var e=0!=(1024&this.z);e!==t&&(Kt.t(t,"boolean",X,"wasSubGraphExpanded"),this.z=1024^this.z,this.i("wasSubGraphExpanded",e,t))}get subGraphExpandedChanged(){return null!==this.bt?this.bt.ky:null}set subGraphExpandedChanged(t){var e=this.subGraphExpandedChanged;e!==t&&(null!==t&&Kt.t(t,"function",X,"subGraphExpandedChanged"),this.wl(),this.bt.ky=t,this.i("subGraphExpandedChanged",e,t))}move(t,e){var i=(e=void 0===e?!1:e)?this.location:this.position,s=i.x,i=i.y,n=t.x,a=t.y;if(!(s===n||isNaN(s)&&isNaN(n))||!(i===a||isNaN(i)&&isNaN(a))){for(var r=n-(isNaN(s)?0:s),o=a-(isNaN(i)?0:i),l=_.a(),h=(super.move(t,e),new N),u=this.findSubGraphParts().iterator;u.next();){var d=u.value;d instanceof Y&&(d.wn&&h.add(d),d.Re||d.fromNode!==this&&d.toNode!==this)&&(d.wn=!0)}for(u.reset();u.next();){var c,g,m=u.value;m.Il()||m instanceof D&&m.isLinkLabel||(c=m.position,g=m.location,c.isReal()?(l.x=c.x+r,l.y=c.y+o,m.position=l):g.isReal()&&(l.x=g.x+r,l.y=g.y+o,m.location=l))}for(u.reset();u.next();){var f,p=u.value;p instanceof Y&&(p.wn=h.contains(p),p.Re||p.fromNode!==this&&p.toNode!==this)&&(f=p.position,l.x=f.x+r,l.y=f.y+o,l.isReal()?p.move(l):p.invalidateRoute())}_.o(l)}}NO(){return 0!=(65536&this.z)}PA(t){0!=(65536&this.z)!==t&&(this.z=65536^this.z)}get sl(){return 0!=(32768&this.z)}set sl(t){0!=(32768&this.z)!==t&&(this.z=32768^this.z)}}class Xe extends y{ei;$d;constructor(t){super(),this.ei=I.qg,this.$d=new Q(NaN,NaN,NaN,NaN),t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.ei=this.ei.L(),t.$d=this.$d.copy()}dh(t){var e;return null!==this.background&&(e=this.naturalBounds,Q.contains(0,0,e.width,e.height,t.x,t.y))}ld(t,e,i,s){var n=this.part;if(null!==n&&(n instanceof X||n instanceof K)||Kt.n("Placeholder is not inside a Group or Adornment."),n instanceof X){var a=this.computeBorder(this.$d),r=this.minSize,o=isFinite(r.width)?Math.max(r.width,a.width):a.width,r=isFinite(r.height)?Math.max(r.height,a.height):a.height,l=this.Hi,h=(l.Do(o||0,r||0),this.oo(0,0,l.width,l.height),n.memberParts);let t=!1;for(;h.next();)if(h.value.isVisible()){t=!0;break}o=n.diagram;!t||null===o||o.animationManager.OM(n)||isNaN(a.x)||isNaN(a.y)||((r=_.a()).setRectSpot(a,n.locationSpot),n.location=r,_.o(r))}else{var l=n,o=this.Hi,a=this.ei,r=a.left+a.right,n=a.top+a.bottom,u=l.adornedObject,d=u.getDocumentAngle();l.angle=d;let t=0;u instanceof G&&(t=u.strokeWidth);var d=u.getDocumentScale(),c=u.naturalBounds,g=(c.width+t)*d,c=(c.height+t)*d;l.type!==Xt.Link&&(d="Selection"===l.category?Z.TopLeft:l.locationSpot,d=u.getDocumentPoint(d,_.a()),l.location=d,_.o(d)),isNaN(g)||isNaN(c)?(l=u.getDocumentPoint(Z.TopLeft,_.a()),(d=Q.H(l.x,l.y,0,0)).unionPoint(u.getDocumentPoint(Z.BottomRight,l)),d.unionPoint(u.getDocumentPoint(Z.TopRight,l)),d.unionPoint(u.getDocumentPoint(Z.BottomLeft,l)),o.Do(d.width+r||0,d.height+n||0),this.oo(-a.left,-a.top,o.width,o.height),_.o(l),Q.o(d)):(o.Do(g+r||0,c+n||0),this.oo(-a.left,-a.top,o.width,o.height))}}gh(t,e,i,s){this.actualBounds.e(t,e,i,s)}computeBorder(t){var e=this.part,i=e.diagram,s=null===i||!i.animationManager.isAnimating;if(null!==i&&e instanceof X&&!e.layer.isTemporary&&e.computesBoundsAfterDrag&&this.$d.isReal()){var n=i.toolManager.findTool("Dragging");if(n===i.currentTool){i=n.computeBorder(e,this.$d,t);if(null!==i)return i}}var n=Q.a(),i=this.computeMemberBounds(n),a=this.ei;return e instanceof X&&!e.isSubGraphExpanded?t.e(i.x-a.left,i.y-a.top,0,0):t.e(i.x-a.left,i.y-a.top,Math.max(i.width+a.left+a.right,0),Math.max(i.height+a.top+a.bottom,0)),Q.o(n),s&&e instanceof X&&e.computesBoundsIncludingLocation&&e.location.isReal()&&t.unionPoint(e.location),t}computeMemberBounds(n){if(this.part instanceof X){var a=this.part;let t=1/0,e=1/0,i=-1/0,s=-1/0;for(var r,o=a.memberParts;o.next();){var l=o.value;!l.isVisible()||l instanceof Y&&(!a.computesBoundsIncludingLinks||l.Ko()||l.fromNode===a||l.toNode===a)||((l=l.actualBounds).lefti&&(i=l.right),l.bottom>s&&(s=l.bottom))}isFinite(t)&&isFinite(e)?n.e(t,e,i-t,s-e):(r=a.location,n.e(r.x,r.y,0,0))}else n.e(0,0,0,0);return n}get padding(){return this.ei}set padding(t){"number"==typeof t?t=new I(t):Kt.s(t,I,Xe,"padding");var e=this.ei;e.equals(t)||(t=t.L(),this.ei=t,this.i("padding",e,t),this.u())}}class Ue{b;da;Qd;Lr;_d;tg;zo;xl;ig;eg;ko;constructor(t){N.ji(this),this.b=null,this.da=null,this.Qd=!0,this.Lr=!0,this._d=!1,this.tg=new _(0,0).w(),this.zo=!0,this.xl=null,this.ig=null,this.eg=!1,this.ko=null,t&&Object.assign(this,t)}cloneProtected(t){t.Qd=this.Qd,t.Lr=this.Lr,t._d=this._d,t.tg.c(this.tg),t.zo=this.zo,t.xl=this.xl,t.ig=this.ig,t.eg=!0}copy(){var t=new this.constructor;return this.cloneProtected(t),t}ci(t){Kt.gr(this,t)}toString(){let t=Kt.an(this.constructor);return t+="(",null!==this.group&&(t+=" in "+this.group),null!==this.diagram&&(t+=" for "+this.diagram),t+=")"}get diagram(){return this.b}set diagram(t){null!==t&&Kt.s(t,q,Ue,"diagram"),this.b=t}get group(){return this.da}set group(t){this.da!==t&&(null!==t&&Kt.s(t,X,Ue,"group"),null!==(this.da=t))&&(this.b=t.diagram)}get isOngoing(){return this.Qd}set isOngoing(t){this.Qd!==t&&(Kt.t(t,"boolean",Ue,"isOngoing"),this.Qd=t)}get isInitial(){return this.Lr}set isInitial(t){Kt.t(t,"boolean",Ue,"isInitial"),(this.Lr=t)||(this.eg=!0)}get isViewportSized(){return this._d}set isViewportSized(t){this._d!==t&&(Kt.t(t,"boolean",Ue,"isViewportSized"),this._d=t)&&this.invalidateLayout()}get isRouting(){return this.zo}set isRouting(t){this.zo!==t&&(Kt.t(t,"boolean",Ue,"isRouting"),this.zo=t)}get isRealtime(){return this.xl}set isRealtime(t){this.xl!==t&&(null!==t&&Kt.t(t,"boolean",Ue,"isRealtime"),this.xl=t)}get isValidLayout(){return this.eg}set isValidLayout(t){this.eg===t||(Kt.t(t,"boolean",Ue,"isValidLayout"),this.eg=t)||null!==(t=this.diagram)&&(t.Jr=!0)}invalidateLayout(){var t,e;this.isValidLayout&&null!==(t=this.diagram)&&!t.undoManager.isUndoingRedoing&&!(e=t.animationManager).isTicking&&(e.defaultAnimation.isAnimating&&e.stopAnimation(),this.isOngoing&&t.Uh||this.isInitial&&!t.Uh)&&(this.isValidLayout=!1,t.requestUpdate())}get network(){return this.ko}set network(t){this.ko!==t&&(null!==t&&Kt.s(t,_e,Ue,"network"),null!==(this.ko=t))&&(t.layout=this)}createNetwork(){return new _e(this)}makeNetwork(t){var e=this.createNetwork();return t instanceof q?(e.addParts(t.nodes,!0),e.addParts(t.links,!0)):t instanceof X?e.addParts(t.memberParts):e.addParts(t.iterator),e}updateParts(){this.isValidLayout=!0;let 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&&null!==(t=i.diagram))break}try{null!==t&&t.startTransaction("Layout"),this.commitLayout()}finally{null!==t&&t.commitTransaction("Layout")}}commitLayout(){if(null!==this.network){for(var t=this.network.vertexes.iterator;t.next();)t.value.commit();if(this.isRouting)for(var e=this.network.edges.iterator;e.next();)e.value.commit()}}doLayout(t){Ht,null===t&&Kt.n("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var e=new N;t instanceof q?(this.Ch(e,t.nodes,!0,this.sl,!0,!1,!0),this.Ch(e,t.parts,!0,this.sl,!0,!1,!0)):t instanceof X?this.Ch(e,t.memberParts,!1,this.sl,!0,!1,!0):e.addAll(t.iterator),0=i-1?(r=0,n=s,a+=o+20,o=0):r++}}doMinimalNetworkLayout(){var t=this.network.vertexes.count,e=Math.ceil(Math.sqrt(t)),i=(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.arrangementOrigin.x);let s=i,n=this.arrangementOrigin.y,a=0,r=0;for(var o=this.network.vertexes.iterator;o.next();){var l,h,u=o.value.node;null===u||u instanceof Y||(u.ensureBounds(),!this.sl(u))||(l=(h=u.measuredBounds).width,h=h.height,u.moveTo(s,n),u instanceof X&&(u.sl=!1),s+=Math.max(l,50)+20,r=Math.max(r,Math.max(h,50)),a>=e-1?(a=0,s=i,n+=r+20,r=0):a++)}}sl(t){return!!(!t.location.isReal()&&!t.position.isReal()||t instanceof X&&t.sl)}Ch(t,e,i,s,n,a,r){for(var o=e.iterator;o.next();){var l=o.value;i&&!l.isTopLevel||null!==s&&!s(l)||!l.canLayout()||(n&&l instanceof D?l.isLinkLabel||(l instanceof X&&null===l.layout?this.Ch(t,l.memberParts,!1,s,n,a,r):(l.ensureBounds(),t.add(l))):a&&l instanceof Y?t.add(l):!r||!l.De()||l instanceof D||(l.ensureBounds(),t.add(l)))}}getLayoutBounds(t,e){var i=this.boundsComputation;return null!==i?i(t,this,e=e||new Q):!e&&t.margin.equalTo(0,0,0,0)?t.actualBounds:((e=e||new Q).set(t.actualBounds),e.addMargin(t.margin),e)}get boundsComputation(){return this.ig}set boundsComputation(t){this.ig!==t&&(null!==t&&Kt.t(t,"function",Ue,"boundsComputation"),this.ig=t,this.invalidateLayout())}collectParts(t){var e=new N;return t instanceof q?(this.Ch(e,t.nodes,!0,null,!0,!0,!0),this.Ch(e,t.links,!0,null,!0,!0,!0),this.Ch(e,t.parts,!0,null,!0,!0,!0)):t instanceof X?this.Ch(e,t.memberParts,!1,null,!0,!0,!0):this.Ch(e,t.iterator,!1,null,!0,!0,!0),e}get arrangementOrigin(){return this.tg}set arrangementOrigin(t){Kt.s(t,_,Ue,"arrangementOrigin"),this.tg.equals(t)||(this.tg.c(t),this.invalidateLayout())}initialOrigin(t){var e,i,s=this.group;return null!==s?s.hasPlaceholder()?(e=(i=s.placeholder).getDocumentPoint(Z.TopLeft),(isNaN(e.x)||isNaN(e.y))&&e.set(t),i=i.padding,e.x+=i.left,e.y+=i.top,e):(i=s.position.copy(),(isNaN(i.x)||isNaN(i.y))&&i.set(t),i):t}}class _e{le;So;In;Ay;Ly;constructor(t){N.ji(this),Ht,t||Kt.n("LayoutNetwork constructor requires non-null Layout argument"),this.le=t,this.So=new N,this.In=new N,this.Ay=new L,this.Ly=new L}clear(){if(this.So)for(var t=this.So.iterator;t.next();)t.value.clear();if(this.In)for(var e=this.In.iterator;e.next();)e.value.clear();this.So=new N,this.In=new N,this.Ay=new L,this.Ly=new L}toString(t){void 0===t&&(t=0);let e="LayoutNetwork"+(null!==this.layout?"("+this.layout.toString()+")":"");if(!(t<=0)&&(e+=" vertexes: "+this.So.count+" edges: "+this.In.count,1 0",j,"maxLines"),this.Fn(),this._.Kp=t,this.u(),this.i("maxLines",e,t))}getMetrics(){return[this.bi,this.Bl,this.uo,this.Tn,this.Ee,this.Ei,this.Dn]}TI(t){void 0!==t&&(this.bi=t[0],this.Bl=t[1],this.uo=t[2],this.Tn=t[3],this.Ee=t[4],this.Ei=t[5],this.Dn=t[6])}get metrics(){return{arrSize:null!==this.Ee?this.Ee:[this.bi],arrText:null!==this.Ei?this.Ei:[this.Dn],maxLineWidth:this.bi,fontHeight:this.uo}}get choices(){return this.Fd}set choices(t){var e=this.Fd;e!==t&&(Ht,null===t||Array.isArray(t)||Kt.Bi(t,"Array",j,"choices:value"),this.Fd=t,this.i("choices",e,t))}static OI=new RegExp("[ ​­]");static v2=new l;static XL=0;static hb=new l;static U2=0;static Dp="...";static BL="";static al=G.isUsingDOM()?new $t(null).gi:null}class Me{xi;us;go;Yp;Kp;Ip;zp;Xp;Fp;Bp;Ep;Vl;cl;Rp;constructor(){this.xi=!1,this.us=null,this.go=0,this.Yp=0,this.Kp=1/0,this.Ip=0,this.zp=0,this.Xp=0,this.Fp="start",this.Bp=null,this.Ep=null,this.Vl=null,this.cl=Z.Top,this.Rp=2}copy(){var t=new Me;return t.us=this.us,t.go=this.go,t.Yp=this.Yp,t.Kp=this.Kp,t.Ip=this.Ip,t.zp=this.zp,t.Xp=this.Xp,t.Fp=this.Fp,t.Bp=this.Bp,t.Ep=this.Ep,t.Vl=this.Vl,t.cl=this.cl,t.Rp=this.Rp,t}}class Ce{pc;yc;wc;Vp;xc;constructor(){this.pc=1,this.yc=0,this.wc=1,this.Vp=null,this.xc=null}copy(){var t=new Ce;return t.pc=this.pc,t.yc=this.yc,t.wc=this.wc,t.Vp=this.Vp,t.xc=this.xc,t}}(a={})[a.None=0]="None",a[a.Fill=2]="Fill",a[a.Uniform=6]="Uniform",a[a.UniformToFill=7]="UniformToFill";var Ne=a;class Le extends y{ul;St;dl;bc;us;gl;kc;go;Sc;Mc;q1;constructor(t,e){super(),this.l|=2097152,this.ul=null,this.St="",this.dl=Q.RD,this.bc=2,this.us=null,this.gl=null,this.kc=Z.Center,this.go=0,this.Sc=null,this.Mc=null,this.q1=null,"string"==typeof t?this.source=t:t&&Object.assign(this,t),e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.St=this.St,t.element=this.ul,t.dl=this.dl.L(),t.bc=this.bc,t.go=this.go,t.us=this.us,t.gl=this.gl,t.kc=this.kc.L(),t.Mc=this.Mc}ci(t){t in Ne?this.imageStretch=t:super.ci(t)}toString(){return"Picture("+this.source+")#"+N.ps(this)}get Pc(){return 0!=(1048576&this.l)}set Pc(t){this.Pc!==t&&(this.l=1048576^this.l)}get Oa(){return 0!=(2097152&this.l)}set Oa(t){this.Oa!==t&&(this.l=2097152^this.l)}get Sn(){return 0!=(4194304&this.l)}set Sn(t){this.Sn!==t&&(this.l=4194304^this.l)}static clearCache(t){void 0===t&&(t=""),Kt.t(t,"string",Le,"clearCache:url"),""!==t?Le.Up[t]&&(delete Le.Up[t],Le.ub--):(Le.Up=new l,Le.ub=0)}static BA(e,i){i.YL||(i.db=t=>{Le.EI(i,t),e.desiredSize.isReal()||(e.ae(!1),e.u())},i.gb=t=>Le.VI(i,t),i.addEventListener("load",i.db),i.addEventListener("error",i.gb),i.YL=!0)}static MR(t){t.db&&t.removeEventListener("load",t.db),t.gb&&t.removeEventListener("error",t.gb),delete t.db,delete t.gb,delete t.YL}get element(){return this.ul}set element(t){var e,i,s=this.ul;this.fs(!0),s!==t&&(this.Pc=t instanceof HTMLCanvasElement,e=t instanceof HTMLImageElement,null===t||e||t instanceof HTMLVideoElement||this.Pc||Kt.n("Picture.element must be an instance of Image, Canvas, or Video, not: "+t),null!==(i=this.diagram)&&i.EP(this),null!==(this.ul=t)&&e&&void 0===t.as&&(t.as=new N),null!==i&&e&&i.OP(this),this.i("element",s,t),this.T())}kR(){var t=this.ul;null!==t&&(!this.Pc&&!0!==t.complete||(t.w0&&(t.Gp instanceof Event&&null!==this.us?this.us(this,t.Gp):!0===t.Sn&&!t.Gp&&null!==this.gl&&t.q2&&this.gl(this,t.q2)),t.Sn=!0,this.desiredSize.isReal())||(this.ae(!1),this.u()),!0===t.Sn)&&null!==this.diagram&&this.diagram.Wu.add(this)}BI(){if(null===this.ul)this.Sc=!1;else{var t=new $t(null).gi;try{t.drawImage(this.ul,0,0)}catch(t){Ht,this.Oa&&Kt.ft(t.toString()),this.Oa=!1}try{t.getImageData(0,0,1,1).data[3]&&(this.Sc=!1),this.Sc=!1}catch{this.Sc=!0}}}get source(){return this.St}set source(i){var s,t=this.St;if(t!==i){this.fs(!0),Kt.t(i,"string",Le,"source"),this.St=i;let e=Le.Up;if(G.isUsingDOM()){let t=null;void 0!==e[i]?t=e[i]:""!==i&&(30=d.width&&(n=n+f.offsetX+(e*f.x-d.width*f.x)),i>=d.height&&(a=a+f.offsetY+(i*f.y-d.height*f.y)),r=Math.min(d.width,e),o=Math.min(d.height,i));break;case 2:e=d.width,i=d.height;break;case 6:case 7:let t=0;6===m?(t=Math.min(d.height/i,d.width/e),e*=t,i*=t):7===m&&(t=Math.max(d.height/i,d.width/e),e*=t,i*=t,e>=d.width&&(n=(n+f.offsetX+(e*f.x-d.width*f.x)/e)*r),i>=d.height&&(a=(a+f.offsetY+(i*f.y-d.height*f.y)/i)*o),r*=1/(e/d.width),o*=1/(i/d.height),e=d.width,i=d.height)}var p=r*o,v=this.getDocumentScale()*l.scale,v=e*v*(i*v),y=p/v,p=h.__goCache;let s=null;var b=Le.zI;if(!u){if(h.Sn&&void 0!==p&&4{var s="r"+e+","+i;let n=z.yr[s];return void 0===n&&((n=new W(2)).endX=e,n.endY=i,z.wr{var s="s"+e+","+i;let n=z.yr[s];return void 0===n&&((n=new W(2)).endX=e,n.endY=i,n.defaultStretch=6,z.wr{var a="rr"+e+","+i+","+(s=isNaN(s)||s<0?5:s)+","+(n=isNaN(n)?15:n),r=z.yr[a];if(void 0===r){let t=s;t=1==(1&n)?(t=Math.min(t,2==(2&n)?e/3:e),Math.min(t,8==(8&n)?i/3:i)):0;var o,l,h=new S(t,0,!0),r=(new W).add(h),u=Z.TopLeft.copy(),d=Z.BottomRight.copy();2==(2&n)?(o=s,o=Math.min(o,1==(1&n)?e/3:e),l=(o=Math.min(o,4==(4&n)?i/3:i))*z.Gn,h.add(new A(2,e-o,0)).add(new A(3,e,o,e-l,0,e,l)),u.offsetY=l,d.offsetX=-l):h.add(new A(2,e,0)),4==(4&n)?(o=s,o=Math.min(o,8==(8&n)?e/3:e),l=(o=Math.min(o,2==(2&n)?i/3:i))*z.Gn,h.add(new A(2,e,i-o)).add(new A(3,e-o,i,e,i-l,e-l,i)),d.offsetX=-l,d.offsetY=-l):h.add(new A(2,e,i)),8==(8&n)?(o=s,o=Math.min(o,4==(4&n)?e/3:e),l=(o=Math.min(o,1==(1&n)?i/3:i))*z.Gn,h.add(new A(2,o,i)).add(new A(3,0,i-o,l,i,0,i-l)),u.offsetX=l,d.offsetY=-l):h.add(new A(2,0,i)),1==(1&n)?(s=t*z.Gn,h.add(new A(2,0,t)).add(new A(3,t,0,0,s,s,0).close()),u.offsetX=s,u.offsetY=s):h.add(new A(2,0,0).close()),r.spot1=u,r.spot2=d,z.wr{var s=t?t.parameter1:NaN,t=t?t.parameter2:NaN;return Yi(0,e,i,s,t)}),Fe("Border","RoundedRectangle"),Fe("RoundedTopRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Yi(0,e,i,t,3)}),Fe("RoundedBottomRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Yi(0,e,i,t,12)}),Fe("RoundedLeftRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Yi(0,e,i,t,9)}),Fe("RoundedRightRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Yi(0,e,i,t,6)}),Fe("Ellipse",(t,e,i)=>{var s="e"+e+","+i;let n=z.yr[s];return void 0===n&&((n=new W(3)).endX=e,n.endY=i,n.spot1=Z.Kk,n.spot2=Z.Uk,z.wr{var s="c"+e+","+i;let n=z.yr[s];return void 0===n&&((n=new W(3)).endX=e,n.endY=i,n.spot1=Z.Kk,n.spot2=Z.Uk,n.defaultStretch=6,z.wr(new W).add(new S(0,0).add(new A(2,e,.5*i)).add(new A(2,0,i).close())).setSpots(0,.25,.5,.75)),Fe("TriangleDown",(t,e,i)=>(new W).add(new S(0,0).add(new A(2,e,0)).add(new A(2,.5*e,i).close())).setSpots(.25,0,.75,.5)),Fe("TriangleLeft",(t,e,i)=>(new W).add(new S(e,i).add(new A(2,0,.5*i)).add(new A(2,e,0).close())).setSpots(.5,.25,1,.75)),Fe("TriangleUp",(t,e,i)=>(new W).add(new S(e,i).add(new A(2,0,i)).add(new A(2,.5*e,0).close())).setSpots(.25,.5,.75,1)),Fe("Triangle","TriangleUp"),Fe("Diamond",(t,e,i)=>(new W).add(new S(.5*e,0).add(new A(2,0,.5*i)).add(new A(2,.5*e,i)).add(new A(2,e,.5*i).close())).setSpots(.25,.25,.75,.75)),Fe("LineH",(t,e,i)=>{var s=new W(1);return s.startX=0,s.startY=i/2,s.endX=e,s.endY=i/2,s}),Fe("LineV",(t,e,i)=>{var s=new W(1);return s.startX=e/2,s.startY=0,s.endX=e/2,s.endY=i,s}),Fe("None","Rectangle"),Fe("BarH","Rectangle"),Fe("BarV","Rectangle"),Fe("MinusLine","LineH"),Fe("PlusLine",(t,e,i)=>(new W).add(new S(0,i/2,!1).add(new A(2,e,i/2)).add(new A(1,e/2,0)).add(new A(2,e/2,i)))),Fe("XLine",(t,e,i)=>(new W).add(new S(0,i,!1).add(new A(2,e,0)).add(new A(1,0,0)).add(new A(2,e,i)))),Fe("LineRight",(t,e,i)=>(new W).add(new S(.25*e,0,!1).add(new A(2,.75*e,.5*i)).add(new A(2,.25*e,i)))),Fe("LineDown",(t,e,i)=>(new W).add(new S(0,.25*i,!1).add(new A(2,.5*e,.75*i)).add(new A(2,e,.25*i)))),Fe("LineLeft",(t,e,i)=>(new W).add(new S(.75*e,0,!1).add(new A(2,.25*e,.5*i)).add(new A(2,.75*e,i)))),Fe("LineUp",(t,e,i)=>(new W).add(new S(0,.75*i,!1).add(new A(2,.5*e,.25*i)).add(new A(2,e,.75*i)))),Fe("Capsule",(t,e,i)=>{var s,n=new W;return enew S(t,e,!1,!1)),Ui=(t,e,i)=>t.add(new A(2,e,i)),_i=(t,e,i)=>t.add(new A(1,e,i));Fe("Borders",(t,e,i)=>{let s=t?t.parameter1:NaN;isNaN(s)?s=10:s&=15;t=new W;let n;return 10===s?(n=Xi(e,0),Ui(n,e,i),_i(n,0,i),Ui(n,0,0)):5===s?(n=Xi(0,0),Ui(n,e,0),_i(n,e,i),Ui(n,0,i)):1===s?(n=Xi(0,0),Ui(n,e,0),_i(n,e,i)):2===s?(n=Xi(e,0),Ui(n,e,i)):4===s?(n=Xi(e,i),Ui(n,0,i)):8===s?(n=Xi(0,i),Ui(n,0,0),_i(n,e,i)):3===s?(n=Xi(0,0),Ui(n,e,0),Ui(n,e,i)):6===s?(n=Xi(e,0),Ui(n,e,i),Ui(n,0,i)):12===s?(n=Xi(e,i),Ui(n,0,i),Ui(n,0,0)):9===s?(n=Xi(0,i),Ui(n,0,0),Ui(n,e,0)):7===s?(n=Xi(0,0),Ui(n,e,0),Ui(n,e,i),Ui(n,0,i)):14===s?(n=Xi(e,0),Ui(n,e,i),Ui(n,0,i),Ui(n,0,0)):13===s?(n=Xi(e,i),Ui(n,0,i),Ui(n,0,0),Ui(n,e,0)):11===s?(n=Xi(0,i),Ui(n,0,0),Ui(n,e,0),Ui(n,e,i)):15===s?(n=Xi(0,0),Ui(n,e,0),Ui(n,e,i),Ui(n,0,i),n.add(new A(2,0,0).close())):(n=Xi(0,0),_i(n,e,i)),t.add(n),t})}z.$g={"":"",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"};(a={})[a.None=0]="None",a[a.Added=1]="Added",a[a.Removed=2]="Removed",a[a.Shown=4]="Shown",a[a.Hidden=8]="Hidden",a[a.NodeSized=16]="NodeSized",a[a.GroupLayout=32]="GroupLayout",a[a.NodeReplaced=64]="NodeReplaced",a[a.Standard=127]="Standard",a[a.All=16777215]="All";class H extends Xt{N;_o;E;ml;pl;tr;di;ir;kh;$s;er;Od;vM;UL;Hp;vp;constructor(t,e){void 0===t||t instanceof se||"number"==typeof t||"string"==typeof t?super(t):(super(),t&&(e=t)),this.N=2408959,this._o="",this.E=null,this.ml="",this.pl=null,this.tr=null,this.di="",this.ir=null,this.kh=null,this.$s=new _(NaN,NaN).w(),this.er=null,this.Od=NaN,this.vM=-1,this.UL=new Q,this.Hp=null,this.vp=NaN,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.N=-4097&this.N|49152,t._o=this._o,null!==this.E&&(this.E.xi?t.E=this.E:t.E=this.E.copy()),t.ml=this.ml,t.tr=null,t.di=this.di,t.$s.c(this.$s),t.Od=this.Od}qo(t){super.qo(t),t.mh(),t.pl=null,t.er=null,t.Hp=null}toString(){let t=Kt.an(this.constructor)+"#"+N.ps(this);return null!==this.data&&(t+="("+Kt.toString(this.data)+")"),t}static LayoutNone=0;static LayoutAdded=1;static LayoutRemoved=2;static LayoutShown=4;static LayoutHidden=8;static LayoutNodeSized=16;static LayoutGroupLayout=32;static LayoutNodeReplaced=64;static LayoutStandard=127;static LayoutAll=16777215;Qi(){null===this.E?this.E=new Ee:this.E.xi&&(this.E=this.E.copy())}uh(){super.uh(),null!==this.E&&(this.E.xi=!0)}tc(t,e,i,s,n,a,r){const o=this.diagram;null!==o&&(3===t&&"elements"===e?n instanceof Xt?n.il(t=>{o.partManager.LP(t,o)}):n instanceof Le&&o.OP(n):4===t&&"elements"===e&&(n instanceof Xt?n.il(t=>o.partManager.TP(t,o)):n instanceof Le&&o.EP(n)),o.raiseChangedEvent(t,e,i,s,n,a,r))}updateTargetBindings(t){if(super.updateTargetBindings(t),null!==this.data){var e=this.F.h,i=e.length;for(let t=0;t{null!==t.data&&t.updateTargetBindings()})}for(var n=this.adornments;n.next();)n.value.updateTargetBindings(t)}}Uo(){if(super.Uo(),this.S2()){var e=this.F.h,i=e.length;for(let t=0;tt.Uo())}}for(var t=this.adornments;t.next();)t.value.Uo()}updateRelationshipsFromData(){null!==this.data&&this.diagram?.partManager.updateRelationshipsFromData(this)}get key(){var t=this.diagram;if(null!==t)return t.model.getKeyForNodeData(this.data)}get adornments(){return null===this.tr?o.instance:this.tr.iteratorValues}findAdornment(t){Ht,Kt.t(t,"string",H,"findAdornment:category");var e=this.tr;return null===e?null:e.getValue(t)}addAdornment(i,s){if(null!==s){Ht,Kt.t(i,"string",H,"addAdornment:category"),Kt.s(s,K,H,"addAdornment:ad");let t=null,e=this.tr;var n;(t=null!==e?e.getValue(i):t)!==s&&(null!==t&&null!==(n=t.diagram)&&n.remove(t),null===e&&(e=new L,this.tr=e),s._o!==i&&(s.category=i),e.add(i,s),null!==(n=this.diagram))&&(n.add(s),null!==(i=s.adornedObject))&&null!==(n=i.findBindingPanel())&&(s.data=n.data)}}removeAdornment(t){Ht,Kt.t(t,"string",H,"removeAdornment:category");var e,i,s=this.tr;null!==s&&(null!==(e=s.getValue(t))&&null!==(i=e.diagram)&&(i.remove(e),e.data=null),s.remove(t),0===s.count)&&(this.tr=null)}clearAdornments(){var t=this.tr;if(null!==t){for(var e=Kt.ct(),i=t.iterator;i.next();){var s=i.key;e.push(s)}var n=e.length;for(let t=0;t{t.isEnabled&&t.updateAdornments(e)}),t.toolManager.updateAdornments(e)}GM(t){null===(this.ir=t)&&this.VR()}get layer(){return this.ir}get diagram(){var t=this.ir;return null==t?null:t.diagram}get layerName(){return this.ml}set layerName(e){var i,s,n=this.ml;if(n!==e){Kt.t(e,"string",H,"layerName");let t=this.diagram;null!==t&&(null===t.findLayer(e)||t.partManager.addsToTemporaryLayer)||(this.ml=e,null!==t&&t.invalidateDocumentBounds(),this.i("layerName",n,e),null===(n=this.layer))||n.name===e||null===(t=n.diagram)||null===(e=t.findLayer(e))||e===n||(0<=(i=n.re(-1,this,!0))&&t.raiseChangedEvent(4,"parts",n,this,null,i,!0),i=e.Qh(99999999,this,!0),n.visible!==e.visible&&this.Ki(e.visible),0<=i&&t.raiseChangedEvent(3,"parts",e,null,this,!0,i),null===(i=this.layerChanged))||(s=t.W,t.W=!0,i(this,n,e),t.W=s)}}get layerChanged(){return null!==this.E?this.E.qp:null}set layerChanged(t){var e=this.layerChanged;e!==t&&(null!==t&&Kt.t(t,"function",H,"layerChanged"),this.Qi(),this.E.qp=t,this.i("layerChanged",e,t))}get zOrder(){return this.Od}set zOrder(t){var e,i=this.Od;i!==t&&(Kt.t(t,"number",H,"zOrder"),this.Od=t,null!==(e=this.layer)&&e.Nx(-1,this),this.i("zOrder",i,t),null!==(e=this.diagram))&&e.T()}KI(){var t=this.layer;null!==t&&t.Nx(-1,this)}mb(){var t;!1===this.rh()&&(this.j2(!0),this.hd(),null!==(t=this.diagram))&&(t.d0(this),t.requestUpdate())}vL(){var t,e,i;this.N|=2097152,!1!==this.rh()&&(t=this.position,(e=this.location).isReal()&&t.isReal()||this.qL(t,e),e=this.Ri,i=Q.a().c(e),e.ut(),e.x=t.x,e.y=t.y,e.w(),this.ad(i,e),Q.o(i),this.j2(!1))}oo(t,e,i,s){var n=this.ce,a=(n.e(t,e,i,s),null===this.Ni&&(this.Ni=new V),this.Ni);a.ti(),this.P0(a,t,e,i,s),(this.Ni=a).Gk()||a.Nw(n)}P0(t,i,s,n,a){if(1!==this.v&&t.v(this.v),0!==this.qt){let e=Z.Center;this.locationSpot.isSpot()&&(e=this.locationSpot);var r=_.a();if(this.locationObject!==this){var o=this.locationObject,l=o.naturalBounds;r.setSpot(l.x,l.y,l.width,l.height,e),null!==o.Ni&&o.Ni.Pt(r),r.offset(-o.measuredBounds.x,-o.measuredBounds.y);let t=o.panel;for(;null!==t&&t!==this;)null!==t.Ni&&t.Ni.Pt(r),r.offset(-t.measuredBounds.x,-t.measuredBounds.y),t=t.panel}else r.setSpot(i,s,n,a,e);t.ys(this.qt,r.x,r.y),_.o(r)}}get locationObject(){var t;return null===this.er&&(this instanceof K&&this.type!==Xt.Link&&this.hasPlaceholder()?this.er=this.placeholder:""!==(t=this.locationObjectName)?(t=this.findObject(t),this.er=null!==t?t:this):this.er=this),this.er.visible?this.er:this}get minLocation(){return null!==this.E?this.E.Wp:_.iC}set minLocation(t){var e=this.minLocation;e.equals(t)||(Ht,Kt.s(t,_,H,"minLocation"),t=t.L(),this.Qi(),this.E.Wp=t,this.i("minLocation",e,t))}get maxLocation(){return null!==this.E?this.E.jp:_.eC}set maxLocation(t){var e=this.maxLocation;e.equals(t)||(Ht,Kt.s(t,_,H,"maxLocation"),t=t.L(),this.Qi(),this.E.jp=t,this.i("maxLocation",e,t))}get locationObjectName(){return null!==this.E?this.E.Jp:""}set locationObjectName(t){var e=this.locationObjectName;e!==t&&(Ht,Kt.t(t,"string",H,"locationObjectName"),this.Qi(),this.E.Jp=t,this.er=null,this.u(),this.i("locationObjectName",e,t))}get locationSpot(){return null!==this.E?this.E.Zp:Z.TopLeft}set locationSpot(t){var e=this.locationSpot;e.equals(t)||(Ht,Kt.s(t,Z,H,"locationSpot"),t.isSpot()||Kt.n("Part.locationSpot must be a specific Spot value, not: "+t),t=t.L(),this.Qi(),this.E.Zp=t,this.u(),this.i("locationSpot",e,t))}move(t,e){!0===e?this.location=t:this.position=t}moveTo(t,e,i){t=_.H(t,e);this.move(t,i),_.o(t)}isVisible(){if(!this.visible)return!1;var t=this.layer;if(null!==t){if(!t.visible)return!1;t=t.diagram;if(null!==t&&t.animationManager.ux(this))return!0}t=this.containingGroup;return!!(null===t||t.isSubGraphExpanded&&t.isVisible())}Ki(t){var e=this.diagram;t?(this.invalidateLayout(4),this.invalidateAdornments(),null!==e&&e.d0(this)):(this.invalidateLayout(8),this.clearAdornments()),this.mh(),null!==e&&(e.invalidateDocumentBounds(),e.T())}findObject(t){if(this.name===t)return this;let e=this.Hp;var i;return null===e&&(this.Hp=e=new L),null!==e.getValue(t)?e.getValue(t):null!==(i=super.findObject(t))?(e.set(t,i),i):(e.set(t,null),null)}V0(){this.Hp=null}getRelativePoint(e,t,i){void 0===i&&(i=new _);var t=t.isNoSpot()?Z.Center:t,s=e.naturalBounds;if(i.e(s.width*t.x+t.offsetX,s.height*t.y+t.offsetY),null!==e&&e!==this){e.D.Pt(i);let t=e.panel;for(;null!==t&&t!==this;)t.D.Pt(i),t=t.panel;null!==this.Ni&&this.Ni.Pt(i),i.offset(-this.ce.x,-this.ce.y)}return i}getDocumentBounds(t){return(t=void 0===t?new Q:t).c(this.actualBounds)}ensureBounds(){this.wt(1/0,1/0),this.vt()}xL(e){var t=this.locationSpot,i=this.locationObject,s=i.naturalBounds,n=i instanceof q?i.strokeWidth:0;if(e.setSpot(0,0,s.width+n,s.height+n,t),i!==this){e.offset(-n/2,-n/2),i.D.Pt(e);let t=i.panel;for(;null!==t&&t!==this;)t.D.Pt(e),t=t.panel}return null!==this.Ni&&this.Ni.Pt(e),e.offset(-this.ce.x,-this.ce.y),e}$h(n,a){var a=void 0===a?this.UL:a,t=this.UI(),e=2*t;if(this.isShadowed){let t=n.x,e=n.y,i=n.width,s=n.height;var r=this.shadowBlur,o=this.shadowOffset;i+=r,s+=r,t-=r/2,e-=r/2,0s.x&&e.y>s.y&&e.rights.x&&i.y>s.y&&i.right=n)return}}this.N=4096^this.N;let t=!1;null!==s&&(t=s.skipsUndoManager,s.skipsUndoManager=!0,(n=s.selection).ut(),e?n.add(this):n.remove(this),n.w()),this.i("isSelected",i,e),this.invalidateAdornments();n=this.selectionChanged;null!==n&&n(this),null!==s&&(s.requestUpdate(),s.skipsUndoManager=t)}}get isHighlighted(){return 0!=(524288&this.N)}set isHighlighted(t){var e,i=0!=(524288&this.N);i!==t&&(Ht,Kt.t(t,"boolean",H,"isHighlighted"),this.N=524288^this.N,null!==(e=this.diagram)&&((e=e.highlighteds).ut(),t?e.add(this):e.remove(this),e.w()),this.i("isHighlighted",i,t),this.T(),null!==(e=this.highlightedChanged))&&e(this)}get isShadowed(){return 0!=(8192&this.N)}set isShadowed(t){var e=0!=(8192&this.N);e!==t&&(Ht,Kt.t(t,"boolean",H,"isShadowed"),this.N=8192^this.N,this.fs(!0),this.i("isShadowed",e,t),this.T())}GL(){return 0!=(16384&this.N)}HL(t){t?this.N|=16384:this.N&=-16385}rh(){return 0!=(32768&this.N)}j2(t){t?this.N|=32768:this.N&=-32769}GI(){return 0!=(65536&this.N)}c2(t){t?this.N|=65536:this.N&=-65537}Rl(){return 0!=(131072&this.N)}Gs(t){t?this.N|=131072:this.N&=-131073}$L(){return 0!=(1048576&this.N)}pb(t){t?this.N|=1048576:this.N&=-1048577}get isAnimated(){return 0!=(262144&this.N)}set isAnimated(t){var e=0!=(262144&this.N);e!==t&&(Ht,Kt.t(t,"boolean",H,"isAnimated"),this.N=262144^this.N,this.i("isAnimated",e,t))}get highlightedChanged(){return null!==this.E?this.E.$p:null}set highlightedChanged(t){var e=this.highlightedChanged;e!==t&&(null!==t&&Kt.t(t,"function",H,"highlightedChanged"),this.Qi(),this.E.$p=t,this.i("highlightedChanged",e,t))}get selectionObjectName(){return null!==this.E?this.E.Qp:""}set selectionObjectName(t){var e=this.selectionObjectName;e!==t&&(Ht,Kt.t(t,"string",H,"selectionObjectName"),this.Qi(),this.E.Qp=t,this.pl=null,this.i("selectionObjectName",e,t))}get selectionAdornmentTemplate(){return null!==this.E?this.E._p:null}set selectionAdornmentTemplate(t){var e=this.selectionAdornmentTemplate;e!==t&&(Ht,Kt.s(t,K,H,"selectionAdornmentTemplate"),this.Qi(),this.E._p=t,this.i("selectionAdornmentTemplate",e,t))}get selectionObject(){var t;return null===this.pl&&(null!==(t=this.selectionObjectName)&&""!==t?(t=this.findObject(t),this.pl=null!==t?t:this):this instanceof Y?(t=this.path,this.pl=null!==t?t:this):this.pl=this),this.pl}get selectionChanged(){return null!==this.E?this.E.ty:null}set selectionChanged(t){var e=this.selectionChanged;e!==t&&(null!==t&&Kt.t(t,"function",H,"selectionChanged"),this.Qi(),this.E.ty=t,this.i("selectionChanged",e,t))}get resizeAdornmentTemplate(){return null!==this.E?this.E.iy:null}set resizeAdornmentTemplate(t){var e=this.resizeAdornmentTemplate;e!==t&&(Ht,Kt.s(t,K,H,"resizeAdornmentTemplate"),this.Qi(),this.E.iy=t,this.i("resizeAdornmentTemplate",e,t))}get resizeObjectName(){return null!==this.E?this.E.ey:""}set resizeObjectName(t){var e=this.resizeObjectName;e!==t&&(Ht,Kt.t(t,"string",H,"resizeObjectName"),this.Qi(),this.E.ey=t,this.i("resizeObjectName",e,t))}get resizeObject(){var t=this.resizeObjectName;if(""!==t){t=this.findObject(t);if(null!==t)return t}return this}get resizeCellSize(){return null!==this.E?this.E.sy:Yt.xw}set resizeCellSize(t){var e=this.resizeCellSize;e.equals(t)||(Ht,Kt.s(t,Yt,H,"resizeCellSize"),t=t.L(),this.Qi(),this.E.sy=t,this.i("resizeCellSize",e,t))}get rotateAdornmentTemplate(){return null!==this.E?this.E.ny:null}set rotateAdornmentTemplate(t){var e=this.rotateAdornmentTemplate;e!==t&&(Ht,Kt.s(t,K,H,"rotateAdornmentTemplate"),this.Qi(),this.E.ny=t,this.i("rotateAdornmentTemplate",e,t))}get rotateObjectName(){return null!==this.E?this.E.oy:""}set rotateObjectName(t){var e=this.rotateObjectName;e!==t&&(Ht,Kt.t(t,"string",H,"rotateObjectName"),this.Qi(),this.E.oy=t,this.i("rotateObjectName",e,t))}get rotateObject(){var t=this.rotateObjectName;if(""!==t){t=this.findObject(t);if(null!==t)return t}return this}get rotationSpot(){return null!==this.E?this.E.ry:Z.Default}set rotationSpot(t){var e=this.rotationSpot;e.equals(t)||((Ht,Kt.s(t,Z,H,"rotationSpot"),t===Z.Default)||t.isSpot()||Kt.n("Part.rotationSpot must be a specific Spot value or Spot.Default, not: "+t),t=t.L(),this.Qi(),this.E.ry=t,this.i("rotationSpot",e,t))}get text(){return this.di}set text(t){var e=this.di;e!==t&&(Ht,Kt.t(t,"string",H,"text"),this.di=t,this.i("text",e,t))}get containingGroup(){return this.kh}set containingGroup(e){if(this.De()){var i=this.kh;if(i!==e){Ht,null!==e&&Kt.s(e,X,H,"containingGroup"),null===e||this!==e&&!e.isMemberOf(this)||(this===e&&Kt.n("Cannot make a Group a member of itself: "+this.toString()),Kt.n("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+e.toString())),this.invalidateLayout(2);var s=this.diagram,n=(null!==i?i.Z2(this):this instanceof X&&null!==s&&s.Zr.remove(this),null!==(this.kh=e)?e.$2(this):this instanceof X&&null!==s&&s.Zr.add(this),this.invalidateLayout(1),null!==s&&s.W&&(n=this.data,t=s.model,null!==n)&&t.ma()&&(h=null!==e?e.data:null,t.setGroupForData(n,t.getKeyForNodeData(h))),this.containingGroupChanged);if(null!==n){let t=!0;null!==s&&(t=s.W,s.W=!0),n(this,i,e),null!==s&&(s.W=t)}if(this instanceof X)for(var t=new N,a=(H.ah(t,this,!0,0,!0),t.iterator);a.next();){var r=a.value;if(r instanceof D)for(var o=r.linksConnected;o.next();)o.value.Ed()}if(this instanceof D){for(var l=this.linksConnected;l.next();)l.value.Ed();var h=this.labeledLink;null!==h&&h.Ed()}this.i("containingGroup",i,e),null!==e&&e.KI()}}else Kt.n("cannot set the Part.containingGroup of a Link or Adornment")}mh(){var t=this.containingGroup;null!==t&&(t.hasPlaceholder()&&t.placeholder.u(),t.u(),t.invalidateConnectedLinks())}T(){var t=this.diagram;null!==t&&!this.hs()&&!this.rh()&&this.isVisible()&&this.Ri.isReal()&&t.T(this.$h(this.Ri))}u(){var t;this.Ko()||(super.u(),null!==(t=this.diagram)&&(t.d0(this),this instanceof D&&null!==this.labeledLink&&this.labeledLink.rc(),t.requestUpdate(!0)))}rc(t){var e;this.hs()||(null!==(e=this.diagram)&&(e.d0(this),this instanceof D&&this.invalidateConnectedLinks(),e.requestUpdate()),this.ro(!0))}vm(t){t||null!==(t=this.kh)&&t.$2(this)}qm(t){t||null!==(t=this.kh)&&t.Z2(this)}Wf(){var t,e=this.data;null!==e&&null!==(t=this.diagram)&&null!==(t=t.model)&&t.removeNodeData(e)}get containingGroupChanged(){return null!==this.E?this.E.ly:null}set containingGroupChanged(t){var e=this.containingGroupChanged;e!==t&&(null!==t&&Kt.t(t,"function",H,"containingGroupChanged"),this.Qi(),this.E.ly=t,this.i("containingGroupChanged",e,t))}findSubGraphLevel(){return this.Q2(this)}Q2(t){var e=t.containingGroup;if(null!==e)return 1+this.Q2(e);if(t instanceof D){e=t.labeledLink;if(null!==e)return this.Q2(e)}return 0}findTopLevelPart(){return this._2(this)}_2(t){var e=t.containingGroup;if(null!==e)return this._2(e);if(t instanceof D){e=t.labeledLink;if(null!==e)return this._2(e)}return t}get isTopLevel(){return!(null!==this.containingGroup||this instanceof D&&null!==this.labeledLink)}isMemberOf(t){return t instanceof X&&this.tN(this,t)}tN(t,e){if(t!==e&&null!==e){var i=t.containingGroup;if(null!==i&&(i===e||this.tN(i,e)))return!0;if(t instanceof D){i=t.labeledLink;if(null!==i)return this.tN(i,e)}}return!1}findCommonContainingGroup(t){if(null===t)return null;if(Ht,Kt.s(t,H,H,"findCommonContainingGroup:other"),this===t)return this.containingGroup;let e=this;for(;null!==e;){var i;e instanceof X&&e.pb(!0),e=(e=e instanceof D&&null!==(i=e.labeledLink)?i:e).containingGroup}let s=null;for(e=t;null!==e;){if(e.$L()){s=e;break}var n;e=(e=e instanceof D&&null!==(n=e.labeledLink)?n:e).containingGroup}for(e=this;null!==e;){var a;e instanceof X&&e.pb(!1),e=(e=e instanceof D&&null!==(a=e.labeledLink)?a:e).containingGroup}return s}get layoutConditions(){return null!==this.E?this.E.hy:127}set layoutConditions(t){var e=this.layoutConditions;e!==t&&(Ht,Kt.t(t,"number",H,"layoutConditions"),this.Qi(),this.E.hy=t,this.i("layoutConditions",e,t))}canLayout(){var t;return!(!this.isLayoutPositioned||!this.isVisible()||null!==(t=this.layer)&&t.isTemporary||this instanceof D&&this.isLinkLabel)}vI(t){return!!(this.isLayoutPositioned&&t&this.layoutConditions)&&!(null!==(t=this.layer)&&t.isTemporary||this instanceof D&&this.isLinkLabel||null!==(t=this.diagram)&&t.undoManager.isUndoingRedoing)}invalidateLayout(t){var e,i;this.vI(t=void 0===t?16777215:t)&&(null!==(i=this.kh)?null!==(e=i.layout)?e.invalidateLayout():i.invalidateLayout(t):null!==(e=this.diagram)&&null!==(i=e.layout)&&i.invalidateLayout())}LA(){var t;return!(!this.isVisible()||null!==(t=this.layer)&&t.isTemporary)}static ah(t,e,i,s,n,a){if(void 0===a&&(a=null),!t.contains(e)&&(null===a||a(e))&&!(e instanceof K))if(t.add(e),e instanceof D){if(i&&e instanceof X)for(var r=e.memberParts;r.next();){var o=r.value;H.ah(t,o,i,s,n,a)}if(!1!==n)for(var l=e.linksConnected;l.next();){var h,u,d=l.value;!t.contains(d)&&(h=d.fromNode,u=d.toNode,h=null===h||t.contains(h),u=null===u||t.contains(u),n?h&&u:h||u)&&H.ah(t,d,i,s,n,a)}if(1t instanceof Xe))instanceof Xe&&(null===this.Et?this.Et=o:(Ht,this.Et!==o&&Kt.n("Cannot insert a second Placeholder into the visual tree of an Adornment."))):4===t&&"elements"===e&&null!==this.Et&&(s===this.Et||s instanceof Xt&&this.Et.isContainedBy(s))&&(this.Et=null),super.tc(t,e,i,s,n,a,r)}updateAdornments(){}Wf(){}}(Re={})[Re.None=0]="None",Re[Re.Evenly=1]="Evenly",Re[Re.Packed=2]="Packed";var Re;class D extends H{z;bt;Nc;yl;Sh;ue;ni;constructor(t,e){void 0===t||t instanceof se||"number"==typeof t||"string"==typeof t?super(t):(super(),t&&(e=t)),this.z=13,this.bt=null,this.ni=new O,this.Nc=null,this.yl=null,this.ue=null,this.Sh=!1,e&&Object.assign(this,e)}cloneProtected(t){super.cloneProtected(t),t.z=this.z,null!==this.bt&&(this.bt.xi?t.bt=this.bt:t.bt=this.bt.copy())}qo(t){super.qo(t),t.invalidateConnectedLinks(),t.yl=this.yl,t.ue=null}static SpreadingNone=0;static SpreadingEvenly=1;static SpreadingPacked=2;wl(){null===this.bt?this.bt=new Oe:this.bt.xi&&(this.bt=this.bt.copy())}uh(){super.uh(),null!==this.bt&&(this.bt.xi=!0)}QL(t){null!==t&&(null===this.yl&&(this.yl=new N),this.yl.add(t))}_L(t){null!==t&&null!==this.yl&&this.yl.remove(t)}tT(t,e,i){if(null!==t&&null!==this.yl)for(var s=this.yl.iterator;s.next();){var n=s.value;if(n.uy===this&&n.yb===t&&n.iN===e&&n.eN===i||n.uy===t&&n.yb===this&&n.iN===i&&n.eN===e)return n}return null}invalidateLinkBundle(t,e,i){t=this.tT(t,e=null==e?"":e,i=null==i?"":i);null!==t&&t.Vd()}tc(t,e,i,s,n,a,r){(3===t&&"elements"===e||4===t&&"elements"===e)&&(this.ue=null),super.tc(t,e,i,s,n,a,r)}invalidateConnectedLinks(t){for(var e=this.linksConnected;e.next();){var i=e.value;void 0!==t&&t.contains(i)||(this.Se(i.fromPort),this.Se(i.toPort),i.invalidateRoute())}}nL(t){for(var e=this.linksConnected;e.next();){var i=e.value;i.fromPort!==t&&i.toPort!==t||(this.Se(i.fromPort),this.Se(i.toPort),i.invalidateRoute())}}Se(t){var e;null===t||(null!==(e=t.nd)&&e.Vd(),null===(t=(e=t.part).containingGroup))||e.isVisible()||t.Se(t.port)}tl(){return!0}get portSpreading(){return null!==this.bt?this.bt.gy:1}set portSpreading(t){var e=this.portSpreading;e!==t&&(Ht,0!==t&&1!==t&&2!==t&&Kt.n("Node.portSpreading can only be set to PortSpreading.None, PortSpreading.Evenly, or PortSpreading.Packed, not: "+t),this.wl(),this.bt.gy=t,this.i("portSpreading",e,t),null!==(e=this.diagram)&&e.undoManager.isUndoingRedoing||this.invalidateConnectedLinks())}get avoidable(){return 0!=(8&this.z)}set avoidable(t){var e,i=0!=(8&this.z);i!==t&&(Ht,Kt.t(t,"boolean",D,"avoidable"),this.z=8^this.z,null!==(e=this.diagram)&&e.KP(this),this.i("avoidable",i,t))}get avoidableMargin(){return null!==this.bt?this.bt.my:I.aC}set avoidableMargin(t){"number"==typeof t?t=new I(t):Kt.s(t,I,D,"avoidableMargin");var e,i=this.avoidableMargin;i.equals(t)||(t=t.L(),this.wl(),this.bt.my=t,null!==(e=this.diagram)&&e.KP(this),this.i("avoidableMargin",i,t))}canAvoid(){return this.avoidable&&!this.isLinkLabel}getAvoidableRect(t){return t.set(this.actualBounds),t.addMargin(this.avoidableMargin),t}findVisibleNode(){let t=this;for(;null!==t&&!t.isVisible();)t=t.containingGroup;return t}isVisible(){if(!super.isVisible())return!1;let i=!0,t=1;var e=this.diagram;if(null!==e){if(e.animationManager.ux(this))return!0;i=e.isTreePathToChildren,t=e.treeCollapsePolicy}if(1===t){e=this.findTreeParentNode();if(null!==e&&!e.isTreeExpanded)return!1}else if(2===t){var s=i?this.findLinksInto():this.findLinksOutOf();let t=!1,e=!1;for(;s.next();){var n=s.value;if(n.isTreeLink){t=!0;n=i?n.fromNode:n.toNode;if(n&&n.isTreeExpanded){e=!0;break}}}if(t&&!e)return!1}else if(3===t){var a=i?this.findLinksInto():this.findLinksOutOf();let t=!1,e=!1;for(;a.next();){var r=a.value;if(r.isTreeLink){t=!0;r=i?r.fromNode:r.toNode;if(r&&!r.isTreeExpanded){e=!0;break}}}if(t&&e)return!1}e=this.labeledLink;return null===e||e.isVisible()}Ki(t){super.Ki(t);for(var e=this.linksConnected;e.next();){var i,s=e.value;!t||null===this.containingGroup||null===(i=s.getOtherNode(this))||i.isMemberOf(this.containingGroup)||s.invalidateRoute(),s.Ki(t)}}get linksConnected(){return this.ni.iterator}findExternalTreeLinksConnected(){var t=new N,e=new N;return this.iT(this,t,e),e.iterator}iT(i,s,n){if(null!==i&&!s.has(i)){s.add(i);let e=!0;var t=this.diagram;null!==t&&(e=t.isTreePathToChildren),i.linksConnected.each(t=>{t.isTreeLink?(e?t.fromNode===i:t.toNode===i)&&this.iT(e?t.toNode:t.fromNode,s,n):n.add(t)})}}findLinksConnected(e){if(null===(e=void 0===e?null:e))return this.ni.iterator;Ht,Kt.t(e,"string",D,"findLinksConnected:pid");const t=new u(this.ni),i=this;return t.predicate=t=>t.fromNode===i&&t.fromPortId===e||t.toNode===i&&t.toPortId===e,t}findLinksOutOf(e){void 0===e&&(e=null),Ht,null!==e&&Kt.t(e,"string",D,"findLinksOutOf:pid");const t=new u(this.ni),i=this;return t.predicate=t=>t.fromNode===i&&(null===e||t.fromPortId===e),t}findLinksInto(e){void 0===e&&(e=null),Ht,null!==e&&Kt.t(e,"string",D,"findLinksInto:pid");const t=new u(this.ni),i=this;return t.predicate=t=>t.toNode===i&&(null===e||t.toPortId===e),t}findNodesConnected(t){void 0===t&&(t=null),Ht,null!==t&&Kt.t(t,"string",D,"findNodesConnected:pid");let e=null,i=null;for(var s=this.ni.iterator;s.next();){var n,a=s.value;a.fromNode===this?null!==t&&a.fromPortId!==t||(n=a.toNode,null!==e?e.add(n):null!==i&&i!==n?((e=new N).add(i),e.add(n)):i=n):a.toNode!==this||null!==t&&a.toPortId!==t||(n=a.fromNode,null!==e?e.add(n):null!==i&&i!==n?((e=new N).add(i),e.add(n)):i=n)}return null!==e?e.iterator:null!==i?new h(i):o.instance}findNodesOutOf(t){void 0===t&&(t=null),Ht,null!==t&&Kt.t(t,"string",D,"findNodesOutOf:pid");let e=null,i=null;for(var s=this.ni.iterator;s.next();){var n=s.value;n.fromNode!==this||null!==t&&n.fromPortId!==t||(n=n.toNode,null!==e?e.add(n):null!==i&&i!==n?((e=new N).add(i),e.add(n)):i=n)}return null!==e?e.iterator:null!==i?new h(i):o.instance}findNodesInto(t){void 0===t&&(t=null),Ht,null!==t&&Kt.t(t,"string",D,"findNodesInto:pid");let e=null,i=null;for(var s=this.ni.iterator;s.next();){var n=s.value;n.toNode!==this||null!==t&&n.toPortId!==t||(n=n.fromNode,null!==e?e.add(n):null!==i&&i!==n?((e=new N).add(i),e.add(n)):i=n)}return null!==e?e.iterator:null!==i?new h(i):o.instance}findLinksBetween(e,i,s){void 0===i&&(i=null),void 0===s&&(s=null),(Ht,Kt.s(e,D,D,"findLinksBetween:othernode"),null!==i&&Kt.t(i,"string",D,"findLinksBetween:pid"),null!==s)&&Kt.t(s,"string",D,"findLinksBetween:otherpid");const t=new u(this.ni),n=this;return t.predicate=t=>!((t.fromNode!==n||t.toNode!==e||null!==i&&t.fromPortId!==i||null!==s&&t.toPortId!==s)&&(t.fromNode!==e||t.toNode!==n||null!==s&&t.fromPortId!==s||null!==i&&t.toPortId!==i)),t}findLinksTo(e,i,s){void 0===i&&(i=null),void 0===s&&(s=null),(Ht,Kt.s(e,D,D,"findLinksTo:othernode"),null!==i&&Kt.t(i,"string",D,"findLinksTo:pid"),null!==s)&&Kt.t(s,"string",D,"findLinksTo:otherpid");const t=new u(this.ni),n=this;return t.predicate=t=>!(t.fromNode!==n||t.toNode!==e||null!==i&&t.fromPortId!==i||null!==s&&t.toPortId!==s),t}get linkConnected(){return null!==this.bt?this.bt.py:null}set linkConnected(t){var e=this.linkConnected;e!==t&&(null!==t&&Kt.t(t,"function",D,"linkConnected"),this.wl(),this.bt.py=t,this.i("linkConnected",e,t))}get linkDisconnected(){return null!==this.bt?this.bt.yy:null}set linkDisconnected(t){var e=this.linkDisconnected;e!==t&&(null!==t&&Kt.t(t,"function",D,"linkDisconnected"),this.wl(),this.bt.yy=t,this.i("linkDisconnected",e,t))}get linkValidation(){return null!==this.bt?this.bt.Fl:null}set linkValidation(t){var e=this.linkValidation;e!==t&&(null!==t&&Kt.t(t,"function",D,"linkValidation"),this.wl(),this.bt.Fl=t,this.i("linkValidation",e,t))}wb(e,i){this.Se(i);var s=this.ni.contains(e);if(s||this.ni.add(e),!s||e.fromNode===e.toNode){var n=this.linkConnected;if(null!==n){let t=!0;var a=this.diagram;null!==a&&(t=a.W,a.W=!0),n(this,e,i),null!==a&&(a.W=t)}}if(!s&&e.isTreeLink){n=e.fromNode,i=e.toNode;if(null!==n&&null!==i&&n!==i){let t=!0;a=this.diagram,s=(t=null!==a?a.isTreePathToChildren:t)?i:n,e=t?n:i;s.Sh||(s.Sh=e),!e.isTreeLeaf||null!==a&&a.undoManager.isUndoingRedoing||(t?n===e&&(e.isTreeLeaf=!1):i===e&&(e.isTreeLeaf=!1))}}}xb(e,i){this.Se(i);var t=this.ni.remove(e);let s=null;if(t||e.toNode===e.fromNode){var n=this.linkDisconnected;if(s=this.diagram,null!==n){let t=!0;null!==s&&(t=s.W,s.W=!0),n(this,e,i),null!==s&&(s.W=t)}}if(t&&e.isTreeLink){let t=!0;n=(t=null!==s?s.isTreePathToChildren:t)?e.toNode:e.fromNode,i=t?e.fromNode:e.toNode;null!==n&&(n.Sh=!1),null===i||i.isTreeLeaf||(0===i.ni.count?(i.Sh=null)!==s&&s.undoManager.isUndoingRedoing||(i.isTreeLeaf=!0):i.x0())}}x0(){if(this.Sh=!1,0!==this.ni.count){let t=!0;var e=this.diagram;if(null===e||!e.undoManager.isUndoingRedoing){null!==e&&(t=e.isTreePathToChildren);for(var i=this.ni.iterator;i.next();){var s=i.value;if(s.isTreeLink)if(t){if(s.fromNode===this)return void(this.isTreeLeaf=!1)}else if(s.toNode===this)return void(this.isTreeLeaf=!1)}this.isTreeLeaf=!0}}}updateRelationshipsFromData(){var t=this.diagram;null!==t&&t.partManager.updateRelationshipsFromData(this)}vm(t){super.vm(t),t||(this.x0(),null!==(t=this.Nc)&&t.eT(this))}qm(t){super.qm(t),t||null!==(t=this.Nc)&&t.sT(this)}Wf(){if(0t.uL(e)),0===this.ue.count&&this.ue.add("",this)}uL(t){var e=t.portId;null!==e&&null!==this.ue&&this.ue.add(e,t)}k2(t,e){t=t.portId;if(null!==t){null!==this.ue&&this.ue.remove(t);var i=this.diagram;if(null!==i&&e){let e=null;for(var s=this.findLinksConnected(t);s.next();){var n=s.value;(e=null===e?Kt.ct():e).push(n)}if(null!==e){for(let t=0;t!(!t.isTreeLink||t.fromNode!==s):i.predicate=t=>!(!t.isTreeLink||t.toNode!==s),i}findTreeChildrenNodes(){let t=!0;var e=this.diagram;null!==e&&(t=e.isTreePathToChildren);let i=null,s=null;var n=this.ni.iterator;if(t)for(;n.next();){var a=n.value;a.isTreeLink&&a.fromNode===this&&(a=a.toNode,null!==i?i.add(a):null!==s&&s!==a?((i=new O).add(s),i.add(a)):s=a)}else for(;n.next();){var r=n.value;r.isTreeLink&&r.toNode===this&&(r=r.fromNode,null!==i?i.add(r):null!==s&&s!==r?((i=new O).add(s),i.add(r)):s=r)}return null!==i?i.iterator:null!==s?new h(s):o.instance}findTreeParts(t){void 0===t&&(t=1/0),Kt.t(t,"number",D,"findTreeParts:level");var e=new N;return H.ah(e,this,!1,t,!0),e}collapseTree(t){void 0===t&&(t=1),Kt.r(t,D,"collapseTree:level"),t<1&&(t=1);var e,i=this.diagram;null===i||i.isCollapsingExpanding||(i.isCollapsingExpanding=!0,(e=new N).add(this),this.oT(e,i.isTreePathToChildren,t,i,this,1===i.treeCollapsePolicy),i.isCollapsingExpanding=!1)}oT(t,e,i,s,n,a){if(1t===u||!t.isTreeExpanded)&&i.Rf(o,s),o.mh(),o.Ki(!1)}o.isTreeExpanded&&(o.wasTreeExpanded=o.isTreeExpanded,l||o.rT(t,e,i,s,n))}}}this.isTreeExpanded=!1}expandTree(t){void 0===t&&(t=2),Kt.r(t,D,"expandTree:level"),t<2&&(t=2);var e,i=this.diagram;null===i||i.isCollapsingExpanding||(i.isCollapsingExpanding=!0,(e=new N).add(this),this.lT(e,i.isTreePathToChildren,t,i,this,1===i.treeCollapsePolicy),i.isCollapsingExpanding=!1)}lT(t,e,i,s,n,a){for(var r=n!==this&&this.isTreeExpanded,o=e?this.findLinksOutOf():this.findLinksInto();o.next();){var l=o.value;if(l.isTreeLink){r||l.Re||l.invalidateRoute();l=l.getOtherNode(this);if(null!==l&&l!==this&&!t.contains(l)){if(t.add(l),!r){l.Ki(!0),l.mh();const h=e?l.findNodesInto():l.findNodesOutOf(),u=this;h.all(t=>t===u||!t.isTreeExpanded)&&s.Ff(l,n)}(2= 0",Y,"fromEndSegmentLength"),this.je(),this.$.wa=t,this.i("fromEndSegmentLength",e,t),this.invalidateRoute())}get fromShortLength(){return null!==this.$?this.$.ba:NaN}set fromShortLength(t){var e=this.fromShortLength;e!==t&&(Ht,Kt.t(t,"number",Y,"fromShortLength"),this.je(),this.$.ba=t,this.fe(),this.i("fromShortLength",e,t))}get toSpot(){return null!==this.$?this.$.ya:Z.Default}set toSpot(t){var e=this.toSpot;e.equals(t)||(Ht,Kt.s(t,Z,Y,"toSpot"),t=t.L(),this.je(),this.$.ya=t,this.i("toSpot",e,t),(e.isSide()||t.isSide())&&null!==(e=this.toNode)&&e.Se(this.toPort),this.invalidateRoute())}get toEndSegmentLength(){return null!==this.$?this.$.xa:NaN}set toEndSegmentLength(t){var e=this.toEndSegmentLength;e!==t&&(Ht,Kt.t(t,"number",Y,"toEndSegmentLength"),t<0&&Kt.G(t,">= 0",Y,"toEndSegmentLength"),this.je(),this.$.xa=t,this.i("toEndSegmentLength",e,t),this.invalidateRoute())}get toShortLength(){return null!==this.$?this.$.ka:NaN}set toShortLength(t){var e=this.toShortLength;e!==t&&(Ht,Kt.t(t,"number",Y,"toShortLength"),this.je(),this.$.ka=t,this.fe(),this.i("toShortLength",e,t))}Ed(){var t=this.fromNode,e=this.toNode;let i=null;if(i=null!==t?null!==e?t.findCommonContainingGroup(e):t.containingGroup:null!==e?e.containingGroup:null,this.ZI(i),this.isLabeledLink)for(var s=this.labelNodes;s.next();)s.value.containingGroup=i}ZI(e){var i=this.kh;if(i!==e){null!==i&&i.Z2(this),null!==(this.kh=e)&&e.$2(this);var s=this.containingGroupChanged;if(null!==s){let t=!0;var n=this.diagram;null!==n&&(t=n.W,n.W=!0),s(this,i,e),null!==n&&(n.W=t)}!this.Re||this.oN!==i&&this.rN!==i||this.invalidateRoute()}}mh(){var t=this.containingGroup;null!==t&&this.fromNode!==t&&this.toNode!==t&&t.computesBoundsIncludingLinks&&super.mh()}getOtherNode(t){Ht,Kt.s(t,D,Y,"getOtherNode:node");var e=this.fromNode;return t===e?this.toNode:e}getOtherPort(t){Ht,Kt.s(t,y,Y,"getOtherPort:port");var e=this.fromPort;return t===e?this.toPort:e}get isLabeledLink(){return null!==this.Qs&&0=a&&(t=a-1),this.getPoint(t-1)),h=this.getPoint(t);z.gu(e.x,e.y,o.x,o.y,l.x,l.y,h.x,h.y,.5,i),s=Math.min(h.x,s),n=Math.min(h.y,n),e=h}}else{t=this.getPoint(0),r=this.getPoint(1);s=Math.min(t.x,r.x),n=Math.min(t.y,r.y),i.e(t.x,t.y,0,0),i.unionPoint(r);for(let t=2;tr/2));)t+=i,e++;var o,l,h,u=this.getPoint(e),d=this.getPoint(e+1);Math.abs(u.x-d.x)<1?u.y>d.y?s.e(u.x,u.y-(r/2-t)):s.e(u.x,u.y+(r/2-t)):Math.abs(u.y-d.y)<1?u.x>d.x?s.e(u.x-(r/2-t),u.y):s.e(u.x+(r/2-t),u.y):(l=(o=(r/2-t)/i)*(d.x-u.x),h=o*(d.y-u.y),s.e(u.x+l,u.y+h))}return s}get midAngle(){return this.updateRoute(),this.computeMidAngle()}computeMidAngle(){var e=this.pointsCount;if(e<2)return NaN;if(2===e)return i=this.getPoint(0),o=this.getPoint(1),i.directionPoint(o);if(this.isOrthogonal&&(15<=this.computeCorner()||9===this.computeCurve()))return this.yt.getAngleAlongPath(.5);if(9===this.computeCurve()&&4<=e){var i=(e-1)/3|0;let t=3*(i/2|0);if(i%2==1)return t=Math.floor(t),o=this.getPoint(t),i=this.getPoint(t+1),l=this.getPoint(t+2),h=this.getPoint(t+3),z.ED(o.x,o.y,i.x,i.y,l.x,l.y,h.x,h.y);if(0s/2));)n+=r,a++;var o,l=this.getPoint(a),h=this.getPoint(a+1);if(Math.abs(l.x-h.x)<1&&Math.abs(l.y-h.y)<1){if(0h.y?270:90;if(Math.abs(l.y-h.y)<1)return l.x>h.x?180:0}return l.directionPoint(h)}QI(){var t;null===this.Sy&&(this.Re||this.Sb(),t=this.Sy=[],this._I(t))}get flattenedLengths(){return this.QI(),this.Sy}get flattenedTotalLength(){let e=this.kb;if(isNaN(e)){var i=this.flattenedLengths,s=i.length;for(let t=e=0;tMath.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}getLinkPointFromPoint(r,o,l,h,t,u){if(void 0===u&&(u=new _),null===r||null===o)u.c(l);else{var d,c,g,m,f;r.isVisible()||null!==(f=r.findVisibleNode())&&f!==r&&(o=(r=f).port);let t=0,e=0,i=0,s=0,n=null,a=o.panel;s=null===(a=null===a||a.Mn()?a:a.panel)?(t=h.x,e=h.y,i=l.x,l.y):(f=1/((n=a.Ms).m11*n.m22-n.m12*n.m21),r=n.m22*f,d=-n.m12*f,c=-n.m21*f,g=n.m11*f,m=f*(n.m21*n.dy-n.m22*n.dx),f=f*(n.m12*n.dx-n.m11*n.dy),t=h.x*r+h.y*c+m,e=h.x*d+h.y*g+f,i=l.x*r+l.y*c+m,l.x*d+l.y*g+f),o.ec(t,e,i,s,u),null!==n&&u.D(n)}return u}eO(t,e){t=t.nd;return null!==t?t.hT(e):null}Pb(t){let e=t.nd;return null===e&&((e=new je).or=t,e.be=t.part,t.nd=e),e.hT(this)}getLinkPoint(e,i,s,n,a,r,o,l){if(void 0===l&&(l=new _),s.isSpot()&&!this.Gd(s))i.getDocumentPoint(s,l);else{if(s.isSide()){var h,u=this.Pb(i);if(null!==u)return h=u.Hd,l.c(h),a&&7===this.routing&&null!==(h=this.Pb(o))&&u.Lc=d.y&&r.y<=d.y+d.height?l.y=r.y:(s.includesSide(Z.TopSide)||s.includesSide(Z.BottomSide))&&r.x>=d.x&&r.x<=d.x+d.width&&(l.x=r.x),_.o(u),_.o(h)),l}var d,c=i.getDocumentPoint(this.Nb(s,n),_.a());let t=null;this.pointsCount>(a?6:2)?(t=n?this.getPoint(1):this.getPoint(this.pointsCount-2),a&&(t=this.uN(c,t.copy()))):(d=this.computeSpot(!n,o),r=_.a(),t=o.getDocumentPoint(this.Nb(d,!n),r),a&&(t=this.uN(c,t)),_.o(r)),this.getLinkPointFromPoint(e,i,c,t,n,l),_.o(c)}return l}getLinkDirection(t,e,i,s,n,a,r,o){let l=this.sO(t,e,i,s,n,a,r,o);return r&&s.isNoSpot()&&r.isMemberOf(t)&&360<=(l+=180)&&(l-=360),this.Gd(s)||0!==(i=e.getDocumentAngle())&&(45<=i&&i<135?l+=90:135<=i&&i<225?l+=180:225<=i&&i<315&&(l+=270),360<=l)&&(l-=360),l}sO(t,e,i,s,n,a,r,o){if(s.isSpot())return s.x>s.y?s.x>1-s.y?0:s.x<1-s.y?270:315:s.x1-s.y?90:s.x<1-s.y?180:135:s.x<.5?225:.5(a?6:2)?(l=n?this.getPoint(1):this.getPoint(this.pointsCount-2),l=a?this.uN(s,l.copy()):i):(e=_.a(),l=o.getDocumentPoint(Z.Center,e),_.o(e)),0);return h=Math.abs(l.x-s.x)>Math.abs(l.y-s.y)?l.x>=s.x?0:180:l.y>=s.y?90:270,_.o(s),h}computeEndSegmentLength(t,e,i,s){if(null!==e&&i.isSide()){i=this.Pb(e);if(null!==i)return i.Cb}let n=NaN;return n=s?this.fromEndSegmentLength:this.toEndSegmentLength,null!==e&&isNaN(n)&&(n=s?e.fromEndSegmentLength:e.toEndSegmentLength),n=isNaN(n)?10:n}computeSpot(t,e){return void 0===e&&(e=null),t?this.nO(e||this.fromPort):this.oO(e||this.toPort)}nO(t){if(null===t)return Z.Center;let e=this.fromSpot;return(e=e.isDefault()?t.fromSpot:e)===Z.Default?Z.None:e}oO(t){if(null===t)return Z.Center;let e=this.toSpot;return(e=e.isDefault()?t.toSpot:e)===Z.Default?Z.None:e}Gd(t){return t===Z.None||.5===t.x&&.5===t.y}Nb(t,e){return.5===t.x&&.5===t.y?t:Z.Center}computeOtherPoint(t,e){var i;return 0!==this.computeAdjusting()&&4d.width||u.y>d.height||u.x+u.width<0||u.y+u.height<0)){d=h,u=V.a();if(u.set(i),d instanceof Xt?e=d.Um(s,n,a,r,o,u):this.path===d?d instanceof q&&(e=d.AI(s,r,u)):e=d.eL(s,r,u),e){let t=d;(t=null!==n?n(d):t)&&(null===a||a(t))&&o.add(t)}V.o(u)}}}}return void 0===t&&V.o(i),e||null!==this.background}void 0===t&&V.o(i)}return!1}get isOrthogonal(){return 2==(2&this.Va)}static aN(t){return 2==(2&t)}get isAvoiding(){return 4==(4&this.Va)}computeCurve(){var t,e;return null===this.sr&&(t=null!==(t=this.fromPort)&&t===this.toPort,e=this.isOrthogonal,this.sr=t&&!e),this.sr?9:this.curve}computeCorner(){if(9===this.curve)return 0;let t=this.corner;return t=isNaN(t)||t<0?10:t}findMidLabel(){var e=this.path,i=this.F.h,s=i.length;for(let t=0;to.x||270===s&&l.yo.x||90===s&&l.y>o.y&&a.right>o.x?(t.e(l.x,o.y),i.e(l.x,(o.y+l.y)/2),180===s?(t.x=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!1),i.x=t.x,i.y=l.y):270===s&&l.yo.y?(o.xa.bottom)?t.x=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!1):t.x=a.right,i.x=t.x,i.y=l.y):0===s&&o.xa.top&&o.yn.bottom)&&(180===s&&(a.containsPoint(o)||n.containsPoint(l))?t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!0):l.yo.y&&(180===s||270===s)&&(t.y=this.computeMidOrthoPosition(o.x,n.bottom,l.x,Math.min(l.y,a.top),!0)),i.x=l.x,i.y=t.y),t.y>n.top&&t.y=n.left&&l.x<=o.x||o.x<=a.right&&o.x>=l.x?90!==s&&270!==s||(t.e(Math.max((o.x+l.x)/2,o.x),o.y),i.e(t.x,l.y)):(270===s||(0===s||180===s)&&l.yo.y&&a.lefto.y?(o.x>a.right?t.x=this.computeMidOrthoPosition(o.x,o.y,a.right,l.y,!1):o.x>a.left&&(270===s&&o.ya.bottom)?t.x=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!1):t.x=a.left,i.x=t.x,i.y=l.y):180===s&&o.x>a.right&&o.y>a.top&&o.yn.bottom)&&(0===s&&(a.containsPoint(o)||n.containsPoint(l))?t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!0):l.yo.y&&(0===s||270===s)&&(t.y=this.computeMidOrthoPosition(o.x,n.bottom,l.x,Math.min(l.y,a.top),!0)),i.x=l.x,i.y=t.y),t.y>n.top&&t.y=o.x||o.x>=a.left&&o.x<=l.x?90!==s&&270!==s||(t.e(Math.min((o.x+l.x)/2,o.x),o.y),i.e(t.x,l.y)):(270===s||(0===s||180===s)&&l.yo.y||180===s&&l.xo.y||0===s&&l.x>o.x&&a.bottom>o.y?(t.e(o.x,l.y),i.e((o.x+l.x)/2,l.y),270===s?(t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!0),i.x=l.x,i.y=t.y):180===s&&l.xo.x?(o.ya.right)?t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!0):t.y=a.bottom,i.x=l.x,i.y=t.y):90===s&&o.ya.left&&o.xn.right)&&(270===s&&(a.containsPoint(o)||n.containsPoint(l))?t.x=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!1):l.xo.x&&(270===s||180===s)&&(t.x=this.computeMidOrthoPosition(n.right,o.y,Math.min(l.x,a.left),l.y,!1)),i.x=t.x,i.y=l.y),t.x>n.left&&t.x=n.top&&l.y<=o.y||o.y<=a.bottom&&o.y>=l.y?0!==s&&180!==s||(t.e(o.x,Math.max((o.y+l.y)/2,o.y)),i.e(l.x,t.y)):(180===s||(90===s||270===s)&&l.xo.x&&a.top=o.x?(o.y>a.bottom?t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,a.bottom,!0):o.y>a.top&&(180===s&&o.xa.right)?t.y=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!0):t.y=a.top,i.x=l.x,i.y=t.y):270===s&&o.y>a.bottom&&o.x>a.left&&o.xn.right)&&(90===s&&(a.containsPoint(o)||n.containsPoint(l))?t.x=this.computeMidOrthoPosition(o.x,o.y,l.x,l.y,!1):l.xo.x&&(90===s||180===s)&&(t.x=this.computeMidOrthoPosition(n.right,o.y,Math.min(l.x,a.left),l.y,!1)),i.x=t.x,i.y=l.y),t.x>n.left&&t.x=o.y||o.y>=a.top&&o.y<=l.y?0!==s&&180!==s||(t.e(o.x,Math.min((o.y+l.y)/2,o.y)),i.e(l.x,t.y)):(180===s||(90===s||270===s)&&l.xqe.xo&&s._i(d,c)!==l-1&&(s._i(h-r,u)===l-1?(n=180,d=h-r,c=u):s._i(h+r,u)===l-1?(n=0,d=h+r,c=u):s._i(h,u-o)===l-1?(n=270,d=h,c=u-o):s._i(h,u+o)===l-1&&(n=90,d=h,c=u+o));l>qe.xo&&s._i(d,c)===l-1;)h=d,u=c,0===n?d+=r:90===n?c+=o:180===n?d-=r:c-=o,--l;if(i?l>qe.xo&&(180===n||0===n?h=Math.floor(h/r)*r+r/2:90!==n&&270!==n||(u=Math.floor(u/o)*o+o/2)):(h=Math.floor(h/r)*r+r/2,u=Math.floor(u/o)*o+o/2),l>qe.xo){let i=n,t=h,e=u;if(0===n?(i=90,e+=o):90===n?(i=180,t-=r):180===n?(i=270,e-=o):270===n&&(i=0,t+=r),s._i(t,e)===l-1)this.vd(s,t,e,i,!1,i);else{let t=h,e=u;0===n?(i=270,e-=o):90===n?(i=0,t+=r):180===n?(i=90,e+=o):270===n&&(i=180,t-=r),s._i(t,e)===l-1&&this.vd(s,t,e,i,!1,i)}}this.addPointAt(h,u)}findClosestSegment(t){Ht,Kt.s(t,_,Y,"findClosestSegment:p");var e=t.x,i=t.y;let s=this.getPoint(0),n=this.getPoint(1),a=_.distanceLineSegmentSquared(e,i,s.x,s.y,n.x,n.y),r=0;for(let t=1;t=s&&(t=s-1);var c=this.getPoint(t);l.x=Math.min(c.x,l.x),l.y=Math.min(c.y,l.y)}a=l.x,r=l.y}else{for(let t=0;t=s&&(e=s-1),this.getPoint(e-1));let t=this.getPoint(e);e===s-1&&0!==this.computeShortLength(!1)&&(t=this.Tc(t.copy(),!1,_.To)),m.br(P.x-a,P.y-r,k.x-a,k.y-r,t.x-a,t.y-r)}else{var S=_.a(),M=(S.c(this.getPoint(0)),_.a()),C=(M.c(S),this.computeCorner());let e=1,i=0;for(;e=s-1){if(S.equals(t)){if(0===i)for(e=1;eo?o:t)*(a-e.x)/r,a=t*(i-e.y)/r;e.x+=o,e.y+=a}else{i=this.getPoint(n-2),r=i.x-s.x,o=i.y-s.y,a=this.Ab(e.x,e.y,r,o);if(0===a)return e;i=2===n?.5*a:a;let t=this.computeShortLength(!1);s=(t=t>i?i:t)*(e.x-r)/a,n=t*(e.y-o)/a;e.x-=s,e.y-=n}return e}dN(t,e,i){var s=this.pointsCount;let n=t;for(;z.q(t.x,n.x)&&z.q(t.y,n.y);){if(s<=e)return s-1;n=this.getPoint(e++)}if(!z.q(t.x,n.x)&&!z.q(t.y,n.y))return e-1;let a=n;for(;z.q(t.x,n.x)&&z.q(n.x,a.x)&&(!i||(t.y>=n.y?n.y>=a.y:n.y<=a.y))||z.q(t.y,n.y)&&z.q(n.y,a.y)&&(!i||(t.x>=n.x?n.x>=a.x:n.x<=a.x));){if(s<=e)return s-1;a=this.getPoint(e++)}return e-2}cO(i,s,n,a,r,o,l,t,h,u){if(z.p(a.y,r.y)&&z.p(r.x,o.x)){var d=Math.min(h,Math.abs(r.x-t.x)/2),c=Math.min(d,Math.abs(o.y-r.y)/2),d=c;if(z.p(d,0))this.Rn(i,s,n,a,r,u),l.c(r);else{let t=r.x;var g=r.y,m=t;let e=g;e=(t=r.x>a.x?r.x-d:r.x+d,o.y>r.y?r.y+c:r.y-c);d=_.H(t,g);this.Rn(i,s,n,a,d,u),_.o(d),i.Dw(r.x+s,r.y+n,m+s,e+n),l.e(m,e)}}else if(z.p(a.x,r.x)&&z.p(r.y,o.y)){c=Math.min(h,Math.abs(r.y-t.y)/2),g=Math.min(c,Math.abs(o.x-r.x)/2),c=g;if(z.p(g,0))this.Rn(i,s,n,a,r,u),l.c(r);else{d=r.x;let t=r.y,e=d;m=t,h=(e=(t=r.y>a.y?r.y-c:r.y+c,o.x>r.x?r.x+g:r.x-g),_.H(d,t));this.Rn(i,s,n,a,h,u),_.o(h),i.Dw(r.x+s,r.y+n,e+s,m+n),l.e(e,m)}}else this.Rn(i,s,n,a,r,u),l.c(r)}computeJumpLength(){return 10}Rn(a,r,o,l,h,t){if(!t&&this.Ya()){var u=this.computeJumpLength(),d=u/2,c=[];let i=0,s=(this.isVisible()&&(i=this.uO(l,h,c)),l.x),n=l.y;if(0t-u))break;e--,t=Math.max(y-d,h.x)}var v=h.y-u+o,b=t+r,x=h.y+o;10===this.curve?a.yu(b,x,!1,!1):a.br(s,v,b,v,b,x),s=b,n=x}}else if(z.p(l.x,h.x))if(l.yt-u))break;e--,t=Math.max(M-d,h.y)}var S=h.x-u+r,C=h.x+r,N=t+o;10===this.curve?a.yu(C,N,!1,!1):a.br(S,n,S,N,C,N),s=C,n=N}}}a.xr(h.x+r,h.y+o)}uO(e,i,s){var t=this.diagram;if(null===t||e.equals(i))return 0;for(var n=t.layers;n.next();){var a=n.value;if(null!==a&&a.visible){var r=a.HM(),o=r.length;for(let t=0;tt-e),s.length;h.isVisible()&&h.Ya()&&(l=h.routeBounds).isReal()&&this.routeBounds.intersectsRect(l)&&!this.usesSamePort(h)&&null!==(l=h.path)&&l.isVisibleObject()&&this.dO(e,i,s,h)}}}}return 0t-e),s.length}dO(e,i,s,n){var a=z.p(e.y,i.y),r=n.pointsCount;let o=n.getPoint(0);var l=_.a();for(let t=1;to.x&&u.x>=h.x||h.xo.y&&u.y>=h.y||h.yi&&Math.min(o,l)a&&!z.p(o,l))return n.x=a,n.y=i,!0}else if(z.p(t,e)&&z.p(o,l)&&Math.min(a,r)o&&Math.min(i,s)t&&!z.p(i,s))return n.x=o,n.y=t,!0;return n.x=0,n.y=0,!1}get firstPickIndex(){return!(this.pointsCount<=2)&&(this.isOrthogonal||!this.Gd(this.computeSpot(!0)))?1:0}get lastPickIndex(){var t=this.pointsCount;return 0===t?0:!(t<=2)&&(this.isOrthogonal||!this.Gd(this.computeSpot(!1)))?t-2:t-1}Ya(){var t=this.curve;return 11===t||10===t}Mb(t){!t&&!this.Ya()||null===(t=this.diagram)||t.animationManager.isTicking||t.sh.contains(this)||0===this.Ac.width&&0===this.Ac.height||t.sh.add(this,this.Ac.copy())}invalidateOtherJumpOvers(i){var e=this.layer;if(null!==e&&e.visible&&!e.isTemporary){var s=e.diagram;if(null!==s&&!s.animationManager.isTicking){let t=!1;for(var n=s.layers;n.next();){var a=n.value;if(a.visible)if(a===e){let e=!(t=!0);var r=a.HM(),o=r.length;for(let t=0;t=qe.xo&&(e[t]=qe.gN)}}pO(t,e){return this._i(t,e)===qe.tn}isUnoccupied(n,a,r,o){if(!(n>this.Ka||n+rthis.Ua||a+othis.Ka||ethis.Ua||ithis.Ua||ethis.Ka||i=qe.xo&&l=h)break;this.Yt[t][e]=l,l+=1,s?e+=i:t+=i}return s?e:t}bo(e,i,s,n,a,r,o,l){if(!(eh;t+=s)this.bo(e,t,1,!n,a,r,o,l),this.bo(e,t,-1,!n,a,r,o,l);else if(0h;t+=s)this.bo(t,i,1,!n,a,r,o,l),this.bo(t,i,-1,!n,a,r,o,l)}}Lb(t,e,i,s,n,a,r,o,l,h){let u=0|t,d=0|e,c=qe.tn,g=qe.xo;for(this.Yt[u][d]=g;c===qe.tn&&u>r&&ul&&dr&&ul&&di?i++:ms?s++:fr))break;t--}else{if(!(e>o))break;e--}var i=h[t][e];if(0===i||i===qe.mN)break;u=t,d=e}for(;;){let t=a,e=u,i=d;0===a||90!==a&&180===a?io&&(t=270,i--):er&&(t=180,e--);var c=h[e][i];if(t!==a&&0!==c&&c!==qe.mN){if(l.push(u),l.push(d),this.cT(u,d,t,r,o,l))return!0;l.pop(),l.pop()}if(h[u][d]=qe.mN,0===a){if(u===s)return!1;u--}else if(90===a){if(d===n)return!1;d--}else if(180===a){if(u===s)return!1;u++}else{if(d===n)return!1;d++}}}}class je{be;or;ds;jd;constructor(){N.ji(this),this.be=null,this.or=null,this.ds=[],this.jd=!1}toString(){var e=this.ds;let i=this.be.toString()+" "+e.length.toString()+":";for(let t=0;ta&&n<=180+a?180:270;case 5:return n>180-a&&n<=360-a?270:0;case 12:return n>a&&n<=180+a?90:0;case 10:return n>180-a&&n<=360-a?180:90;case 7:return 90180+a&&n<=360-a?270:0;case 13:return 180a&&n<=180?90:0;case 14:return n>a&&n<=180-a?90:n>180-a&&n<=270?180:0;case 11:return n>180-a&&n<=180+a?180:n>180+a?270:90}return s&&15!==e&&(n-=15)<0&&(n+=360),n>a&&n<180-a?90:n>=180-a&&n<=180+a?180:n>180+a&&n<360-a?270:0}Vd(){this.ds.length=0}hT(e){let i=this.ds;0===i.length&&(this.xO(),i=this.ds);for(let t=0;te.Me?1:t.qte.qt?1:0}bO(){this.ds.sort(je.prototype.MO)}kO(e){var t=this.or,i=this.be.portSpreading,s=_.a(),n=_.a(),a=_.a(),r=_.a();t.getDocumentPoint(Z.TopLeft,s),t.getDocumentPoint(Z.TopRight,n),t.getDocumentPoint(Z.BottomRight,a),t.getDocumentPoint(Z.BottomLeft,r);let o=0,l=0,h=0,u=0;if(2===i)for(let t=0;tMath.abs(y)?(f=Math.abs(y)/h,h=Math.abs(y)):f=1;break;case 2:u>Math.abs(b)?(f=Math.abs(b)/u,u=Math.abs(b)):f=1;break;case 1:o>Math.abs(y)?(f=Math.abs(y)/o,o=Math.abs(y)):f=1;break;default:l>Math.abs(b)?(f=Math.abs(b)/l,l=Math.abs(b)):f=1}m=0}var w=x.Hd;if(2===i){var A=x._e.computeThickness();switch(A*=f,w.set(p),g){case 8:w.x=p.x+y/2+h/2-m-A/2;break;case 2:w.y=p.y+b/2+u/2-m-A/2;break;case 1:w.x=p.x+y/2-o/2+m+A/2;break;default:w.y=p.y+b/2-l/2+m+A/2}m+=A}else{let t=.5;1===i&&(t=(x.Jd+1)/(x.Lc+1)),w.x=p.x+y*t,w.y=p.y+b*t}}}_.o(s),_.o(n),_.o(a),_.o(r)}SO(e){for(let t=0;tt instanceof Xe);e instanceof Xe?t.Et=e:t.Et=null,null!==this.le?(t.le=this.le.copy(),t.le.group=t):(null!==t.le&&(t.le.group=null),t.le=null),null!==this.hi&&(t.hi=this.hi.copy())}qo(t){super.qo(t);for(var e=t.findSubGraphParts(),i=t.memberParts;i.next();){var s=i.value;if(s.u(),s.invalidateLayout(8),s.clearAdornments(),s instanceof D)s.invalidateConnectedLinks(e);else if(s instanceof Y)for(var n=s.labelNodes;n.next();)n.value.invalidateConnectedLinks(e)}}tc(t,e,i,s,n,a,r){var o;3===t&&"elements"===e?n instanceof Xe?null===this.Et?this.Et=n:this.Et!==n&&Kt.n("Cannot insert a second Placeholder into the visual tree of a Group."):n instanceof Xt&&(o=n.findInVisualTree(t=>t instanceof Xe))instanceof Xe&&(null===this.Et?this.Et=o:this.Et!==o&&Kt.n("Cannot insert a second Placeholder into the visual tree of a Group.")):4===t&&"elements"===e&&null!==this.Et&&(s===this.Et||s instanceof Xt&&this.Et.isContainedBy(s))&&(this.Et=null),super.tc(t,e,i,s,n,a,r)}ad(t,e){if(super.ad(t,e),this.isClipping&&this.type!==Xt.Spot&&this.isSubGraphExpanded){let t=this.resizeObject;t instanceof Xt&&(t=t.findMainElement()),null===this.hi&&(this.hi=new Q),t.getDocumentBounds(this.hi),t instanceof q&&this.hi.inflate(-t.strokeWidth,-t.strokeWidth)}}gh(t,e,i,s){this.hasPlaceholder()&&(this.er=this.placeholder),super.gh(t,e,i,s)}ensureBounds(){const e=this;e.isSubGraphExpanded&&this.memberParts.each(t=>{!e.computesBoundsIncludingLinks&&t instanceof Y||t.ensureBounds()}),super.ensureBounds()}tl(){if(!super.tl())return!1;for(var t=this.memberParts;t.next();){var e=t.value;if(e instanceof D){if(e.isVisible()&&e.hs())return!1}else if(e instanceof Y&&e.isVisible()&&e.hs()&&e.fromNode!==this&&e.toNode!==this)return!1}return!0}hasPlaceholder(){return null!==this.Et&&this.Et.isVisibleObject()&&this.isSubGraphExpanded}get placeholder(){return this.Et}get computesBoundsAfterDrag(){return 0!=(2048&this.z)}set computesBoundsAfterDrag(t){var e=0!=(2048&this.z);e!==t&&(Kt.t(t,"boolean",X,"computesBoundsAfterDrag"),this.z=2048^this.z,this.i("computesBoundsAfterDrag",e,t))}get computesBoundsIncludingLinks(){return 0!=(4096&this.z)}set computesBoundsIncludingLinks(t){Kt.t(t,"boolean",X,"computesBoundsIncludingLinks");var e=0!=(4096&this.z);e!==t&&(this.z=4096^this.z,this.i("computesBoundsIncludingLinks",e,t))}get computesBoundsIncludingLocation(){return 0!=(8192&this.z)}set computesBoundsIncludingLocation(t){Kt.t(t,"boolean",X,"computesBoundsIncludingLocation");var e=0!=(8192&this.z);e!==t&&(this.z=8192^this.z,this.i("computesBoundsIncludingLocation",e,t))}get handlesDragDropForMembers(){return 0!=(16384&this.z)}set handlesDragDropForMembers(t){Kt.t(t,"boolean",X,"handlesDragDropForMembers");var e=0!=(16384&this.z);e!==t&&(this.z=16384^this.z,this.i("handlesDragDropForMembers",e,t))}get avoidableMembers(){return 0!=(131072&this.z)}set avoidableMembers(t){Kt.t(t,"boolean",X,"avoidableMembers");var e=0!=(131072&this.z);e!==t&&(this.z=131072^this.z,this.i("avoidableMembers",e,t))}get memberParts(){return this.Zd.iterator}$2(e){if(this.Zd.add(e)){e instanceof X&&this.ua.add(e);var i=this.memberAdded;if(null!==i){let t=!0;var s=this.diagram;null!==s&&(t=s.W,s.W=!0),i(this,e),null!==s&&(s.W=t)}this.isVisible()&&this.isSubGraphExpanded||e.Ki(!1)}if(!(e instanceof Y)||this.computesBoundsIncludingLinks){let t=this.Et;(t=null===t?this:t).u()}}Z2(e){if(this.Zd.remove(e)){e instanceof X&&this.ua.remove(e);var i=this.memberRemoved;if(null!==i){let t=!0;var s=this.diagram;null!==s&&(t=s.W,s.W=!0),i(this,e),null!==s&&(s.W=t)}this.isVisible()&&this.isSubGraphExpanded||e.Ki(!0)}if(!(e instanceof Y)||this.computesBoundsIncludingLinks){let t=this.Et;(t=null===t?this:t).u()}}Wf(){if(0t.updateAdornments())):t?this.expandSubGraph():this.collapseSubGraph()}}get wasSubGraphExpanded(){return 0!=(1024&this.z)}set wasSubGraphExpanded(t){var e=0!=(1024&this.z);e!==t&&(Kt.t(t,"boolean",X,"wasSubGraphExpanded"),this.z=1024^this.z,this.i("wasSubGraphExpanded",e,t))}get subGraphExpandedChanged(){return null!==this.bt?this.bt.ky:null}set subGraphExpandedChanged(t){var e=this.subGraphExpandedChanged;e!==t&&(null!==t&&Kt.t(t,"function",X,"subGraphExpandedChanged"),this.wl(),this.bt.ky=t,this.i("subGraphExpandedChanged",e,t))}move(t,e){var i=(e=void 0===e?!1:e)?this.location:this.position,s=i.x,i=i.y,n=t.x,a=t.y;if(!(s===n||isNaN(s)&&isNaN(n))||!(i===a||isNaN(i)&&isNaN(a))){for(var r=n-(isNaN(s)?0:s),o=a-(isNaN(i)?0:i),l=_.a(),h=(super.move(t,e),new N),u=this.findSubGraphParts().iterator;u.next();){var d=u.value;d instanceof Y&&(d.wn&&h.add(d),d.Re||d.fromNode!==this&&d.toNode!==this)&&(d.wn=!0)}for(u.reset();u.next();){var c,g,m=u.value;m.Il()||m instanceof D&&m.isLinkLabel||(c=m.position,g=m.location,c.isReal()?(l.x=c.x+r,l.y=c.y+o,m.position=l):g.isReal()&&(l.x=g.x+r,l.y=g.y+o,m.location=l))}for(u.reset();u.next();){var f,p=u.value;p instanceof Y&&(p.wn=h.contains(p),p.Re||p.fromNode!==this&&p.toNode!==this)&&(f=p.position,l.x=f.x+r,l.y=f.y+o,l.isReal()?p.move(l):p.invalidateRoute())}_.o(l)}}NO(){return 0!=(65536&this.z)}PA(t){0!=(65536&this.z)!==t&&(this.z=65536^this.z)}get sl(){return 0!=(32768&this.z)}set sl(t){0!=(32768&this.z)!==t&&(this.z=32768^this.z)}}class Xe extends y{ei;$d;constructor(t){super(),this.ei=I.qg,this.$d=new Q(NaN,NaN,NaN,NaN),t&&Object.assign(this,t)}cloneProtected(t){super.cloneProtected(t),t.ei=this.ei.L(),t.$d=this.$d.copy()}dh(t){var e;return null!==this.background&&(e=this.naturalBounds,Q.contains(0,0,e.width,e.height,t.x,t.y))}ld(t,e,i,s){var n=this.part;if(null!==n&&(n instanceof X||n instanceof K)||Kt.n("Placeholder is not inside a Group or Adornment."),n instanceof X){var a=this.computeBorder(this.$d),r=this.minSize,o=isFinite(r.width)?Math.max(r.width,a.width):a.width,r=isFinite(r.height)?Math.max(r.height,a.height):a.height,l=this.Hi,h=(l.Do(o||0,r||0),this.oo(0,0,l.width,l.height),n.memberParts);let t=!1;for(;h.next();)if(h.value.isVisible()){t=!0;break}o=n.diagram;!t||null===o||o.animationManager.OM(n)||isNaN(a.x)||isNaN(a.y)||((r=_.a()).setRectSpot(a,n.locationSpot),n.location=r,_.o(r))}else{var l=n,o=this.Hi,a=this.ei,r=a.left+a.right,n=a.top+a.bottom,u=l.adornedObject,d=u.getDocumentAngle();l.angle=d;let t=0;u instanceof q&&(t=u.strokeWidth);var d=u.getDocumentScale(),c=u.naturalBounds,g=(c.width+t)*d,c=(c.height+t)*d;l.type!==Xt.Link&&(d="Selection"===l.category?Z.TopLeft:l.locationSpot,d=u.getDocumentPoint(d,_.a()),l.location=d,_.o(d)),isNaN(g)||isNaN(c)?(l=u.getDocumentPoint(Z.TopLeft,_.a()),(d=Q.H(l.x,l.y,0,0)).unionPoint(u.getDocumentPoint(Z.BottomRight,l)),d.unionPoint(u.getDocumentPoint(Z.TopRight,l)),d.unionPoint(u.getDocumentPoint(Z.BottomLeft,l)),o.Do(d.width+r||0,d.height+n||0),this.oo(-a.left,-a.top,o.width,o.height),_.o(l),Q.o(d)):(o.Do(g+r||0,c+n||0),this.oo(-a.left,-a.top,o.width,o.height))}}gh(t,e,i,s){this.actualBounds.e(t,e,i,s)}computeBorder(t){var e=this.part,i=e.diagram,s=null===i||!i.animationManager.isAnimating;if(null!==i&&e instanceof X&&!e.layer.isTemporary&&e.computesBoundsAfterDrag&&this.$d.isReal()){var n=i.toolManager.findTool("Dragging");if(n===i.currentTool){i=n.computeBorder(e,this.$d,t);if(null!==i)return i}}var n=Q.a(),i=this.computeMemberBounds(n),a=this.ei;return e instanceof X&&!e.isSubGraphExpanded?t.e(i.x-a.left,i.y-a.top,0,0):t.e(i.x-a.left,i.y-a.top,Math.max(i.width+a.left+a.right,0),Math.max(i.height+a.top+a.bottom,0)),Q.o(n),s&&e instanceof X&&e.computesBoundsIncludingLocation&&e.location.isReal()&&t.unionPoint(e.location),t}computeMemberBounds(n){if(this.part instanceof X){var a=this.part;let t=1/0,e=1/0,i=-1/0,s=-1/0;for(var r,o=a.memberParts;o.next();){var l=o.value;!l.isVisible()||l instanceof Y&&(!a.computesBoundsIncludingLinks||l.Ko()||l.fromNode===a||l.toNode===a)||((l=l.actualBounds).lefti&&(i=l.right),l.bottom>s&&(s=l.bottom))}isFinite(t)&&isFinite(e)?n.e(t,e,i-t,s-e):(r=a.location,n.e(r.x,r.y,0,0))}else n.e(0,0,0,0);return n}get padding(){return this.ei}set padding(t){"number"==typeof t?t=new I(t):Kt.s(t,I,Xe,"padding");var e=this.ei;e.equals(t)||(t=t.L(),this.ei=t,this.i("padding",e,t),this.u())}}class Ue{b;da;Qd;Lr;_d;tg;zo;xl;ig;eg;ko;constructor(t){N.ji(this),this.b=null,this.da=null,this.Qd=!0,this.Lr=!0,this._d=!1,this.tg=new _(0,0).w(),this.zo=!0,this.xl=null,this.ig=null,this.eg=!1,this.ko=null,t&&Object.assign(this,t)}cloneProtected(t){t.Qd=this.Qd,t.Lr=this.Lr,t._d=this._d,t.tg.c(this.tg),t.zo=this.zo,t.xl=this.xl,t.ig=this.ig,t.eg=!0}copy(){var t=new this.constructor;return this.cloneProtected(t),t}ci(t){Kt.gr(this,t)}toString(){let t=Kt.an(this.constructor);return t+="(",null!==this.group&&(t+=" in "+this.group),null!==this.diagram&&(t+=" for "+this.diagram),t+=")"}get diagram(){return this.b}set diagram(t){null!==t&&Kt.s(t,G,Ue,"diagram"),this.b=t}get group(){return this.da}set group(t){this.da!==t&&(null!==t&&Kt.s(t,X,Ue,"group"),null!==(this.da=t))&&(this.b=t.diagram)}get isOngoing(){return this.Qd}set isOngoing(t){this.Qd!==t&&(Kt.t(t,"boolean",Ue,"isOngoing"),this.Qd=t)}get isInitial(){return this.Lr}set isInitial(t){Kt.t(t,"boolean",Ue,"isInitial"),(this.Lr=t)||(this.eg=!0)}get isViewportSized(){return this._d}set isViewportSized(t){this._d!==t&&(Kt.t(t,"boolean",Ue,"isViewportSized"),this._d=t)&&this.invalidateLayout()}get isRouting(){return this.zo}set isRouting(t){this.zo!==t&&(Kt.t(t,"boolean",Ue,"isRouting"),this.zo=t)}get isRealtime(){return this.xl}set isRealtime(t){this.xl!==t&&(null!==t&&Kt.t(t,"boolean",Ue,"isRealtime"),this.xl=t)}get isValidLayout(){return this.eg}set isValidLayout(t){this.eg===t||(Kt.t(t,"boolean",Ue,"isValidLayout"),this.eg=t)||null!==(t=this.diagram)&&(t.Jr=!0)}invalidateLayout(){var t,e;this.isValidLayout&&null!==(t=this.diagram)&&!t.undoManager.isUndoingRedoing&&!(e=t.animationManager).isTicking&&(e.defaultAnimation.isAnimating&&e.stopAnimation(),this.isOngoing&&t.Uh||this.isInitial&&!t.Uh)&&(this.isValidLayout=!1,t.requestUpdate())}get network(){return this.ko}set network(t){this.ko!==t&&(null!==t&&Kt.s(t,_e,Ue,"network"),null!==(this.ko=t))&&(t.layout=this)}createNetwork(){return new _e(this)}makeNetwork(t){var e=this.createNetwork();return t instanceof G?(e.addParts(t.nodes,!0),e.addParts(t.links,!0)):t instanceof X?e.addParts(t.memberParts):e.addParts(t.iterator),e}updateParts(){this.isValidLayout=!0;let 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&&null!==(t=i.diagram))break}try{null!==t&&t.startTransaction("Layout"),this.commitLayout()}finally{null!==t&&t.commitTransaction("Layout")}}commitLayout(){if(null!==this.network){for(var t=this.network.vertexes.iterator;t.next();)t.value.commit();if(this.isRouting)for(var e=this.network.edges.iterator;e.next();)e.value.commit()}}doLayout(t){Ht,null===t&&Kt.n("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var e=new N;t instanceof G?(this.Ch(e,t.nodes,!0,this.sl,!0,!1,!0),this.Ch(e,t.parts,!0,this.sl,!0,!1,!0)):t instanceof X?this.Ch(e,t.memberParts,!1,this.sl,!0,!1,!0):e.addAll(t.iterator),0=i-1?(r=0,n=s,a+=o+20,o=0):r++}}doMinimalNetworkLayout(){var t=this.network.vertexes.count,e=Math.ceil(Math.sqrt(t)),i=(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.arrangementOrigin.x);let s=i,n=this.arrangementOrigin.y,a=0,r=0;for(var o=this.network.vertexes.iterator;o.next();){var l,h,u=o.value.node;null===u||u instanceof Y||(u.ensureBounds(),!this.sl(u))||(l=(h=u.measuredBounds).width,h=h.height,u.moveTo(s,n),u instanceof X&&(u.sl=!1),s+=Math.max(l,50)+20,r=Math.max(r,Math.max(h,50)),a>=e-1?(a=0,s=i,n+=r+20,r=0):a++)}}sl(t){return!!(!t.location.isReal()&&!t.position.isReal()||t instanceof X&&t.sl)}Ch(t,e,i,s,n,a,r){for(var o=e.iterator;o.next();){var l=o.value;i&&!l.isTopLevel||null!==s&&!s(l)||!l.canLayout()||(n&&l instanceof D?l.isLinkLabel||(l instanceof X&&null===l.layout?this.Ch(t,l.memberParts,!1,s,n,a,r):(l.ensureBounds(),t.add(l))):a&&l instanceof Y?t.add(l):!r||!l.De()||l instanceof D||(l.ensureBounds(),t.add(l)))}}getLayoutBounds(t,e){var i=this.boundsComputation;return null!==i?i(t,this,e=e||new Q):!e&&t.margin.equalTo(0,0,0,0)?t.actualBounds:((e=e||new Q).set(t.actualBounds),e.addMargin(t.margin),e)}get boundsComputation(){return this.ig}set boundsComputation(t){this.ig!==t&&(null!==t&&Kt.t(t,"function",Ue,"boundsComputation"),this.ig=t,this.invalidateLayout())}collectParts(t){var e=new N;return t instanceof G?(this.Ch(e,t.nodes,!0,null,!0,!0,!0),this.Ch(e,t.links,!0,null,!0,!0,!0),this.Ch(e,t.parts,!0,null,!0,!0,!0)):t instanceof X?this.Ch(e,t.memberParts,!1,null,!0,!0,!0):this.Ch(e,t.iterator,!1,null,!0,!0,!0),e}get arrangementOrigin(){return this.tg}set arrangementOrigin(t){Kt.s(t,_,Ue,"arrangementOrigin"),this.tg.equals(t)||(this.tg.c(t),this.invalidateLayout())}initialOrigin(t){var e,i,s=this.group;return null!==s?s.hasPlaceholder()?(e=(i=s.placeholder).getDocumentPoint(Z.TopLeft),(isNaN(e.x)||isNaN(e.y))&&e.set(t),i=i.padding,e.x+=i.left,e.y+=i.top,e):(i=s.position.copy(),(isNaN(i.x)||isNaN(i.y))&&i.set(t),i):t}}class _e{le;So;In;Ay;Ly;constructor(t){N.ji(this),Ht,t||Kt.n("LayoutNetwork constructor requires non-null Layout argument"),this.le=t,this.So=new N,this.In=new N,this.Ay=new L,this.Ly=new L}clear(){if(this.So)for(var t=this.So.iterator;t.next();)t.value.clear();if(this.In)for(var e=this.In.iterator;e.next();)e.value.clear();this.So=new N,this.In=new N,this.Ay=new L,this.Ly=new L}toString(t){void 0===t&&(t=0);let e="LayoutNetwork"+(null!==this.layout?"("+this.layout.toString()+")":"");if(!(t<=0)&&(e+=" vertexes: "+this.So.count+" edges: "+this.In.count,1{var e;return t instanceof D?!t.isLinkLabel:t instanceof Y&&null!==(e=t.fromNode)&&!e.isLinkLabel&&!(null===(e=t.toNode)||e.isLinkLabel)});for(var s=t.iterator;s.next();){var n,a=s.value;a instanceof D&&(!e||a.isTopLevel)&&a.canLayout()&&i(a)&&(a instanceof X&&null===a.layout?this.addParts(a.memberParts,!1):null===this.findVertex(a)&&((n=this.createVertex()).node=a,this.addVertex(n)))}for(s.reset();s.next();){var r,o,l=s.value;l instanceof Y&&(!e||l.isTopLevel)&&l.canLayout()&&i(l)&&null===this.findEdge(l)&&(r=l.fromNode,o=l.toNode,null!==r)&&null!==o&&r!==o&&(r=this.findGroupVertex(r),o=this.findGroupVertex(o),this.linkVertexes(r,o,l))}}}findGroupVertex(i){if(null!==i){i=i.findVisibleNode();if(null!==i){let t=this.findVertex(i);if(null!==t)return t;let e=i.containingGroup;for(;null!==e;){if(null!==(t=this.findVertex(e)))return t;e=e.containingGroup}}}return null}addVertex(t){var e;null!==t&&(Ht,Kt.s(t,We,_e,"addVertex:vertex"),this.So.add(t),null!==(e=t.node)&&this.Ay.add(e,t),t.network=this)}addNode(t){if(null===t)return null;Ht,Kt.s(t,D,_e,"addNode:node");let e=this.findVertex(t);return null===e&&((e=this.createVertex()).node=t,this.addVertex(e)),e}deleteVertex(i){if(null!==i&&(Ht,Kt.s(i,We,_e,"deleteVertex:vertex"),this.gT(i))){let e=i.rr;for(let t=e.count-1;0<=t;t--){var s=e.elt(t);this.deleteEdge(s)}for(let t=(e=i.lr).count-1;0<=t;t--){var n=e.elt(t);this.deleteEdge(n)}}}gT(t){var e;return null!==t&&((e=this.So.remove(t))&&null!==(t=t.node)&&this.Ay.remove(t),e)}deleteNode(t){null!==t&&(Ht,Kt.s(t,D,_e,"deleteNode:node"),null!==(t=this.findVertex(t)))&&this.deleteVertex(t)}findVertex(t){return null===t?null:(Ht,Kt.s(t,D,_e,"findVertex:node"),this.Ay.getValue(t))}addEdge(t){var e;null!==t&&(Ht,Kt.s(t,Qe,_e,"addEdge:edge"),this.pN(t),null!==(e=t.toVertex)&&e.addSourceEdge(t),null!==(e=t.fromVertex))&&e.addDestinationEdge(t)}pN(t){var e;null!==t&&(this.In.add(t),null!==(e=t.link)&&null===this.findEdge(e)&&this.Ly.add(e,t),t.network=this)}addLink(t){if(null===t)return null;Ht,Kt.s(t,Y,_e,"addLink:link");var e=t.fromNode,i=t.toNode;let s=this.findEdge(t);return null===s?((s=this.createEdge()).link=t,null!==e&&(s.fromVertex=this.addNode(e)),null!==i&&(s.toVertex=this.addNode(i)),this.addEdge(s)):(s.fromVertex=null!==e?this.addNode(e):null,s.toVertex=null!==i?this.addNode(i):null),s}deleteEdge(t){var e;null!==t&&(Ht,Kt.s(t,Qe,_e,"deleteEdge:edge"),null!==(e=t.toVertex)&&e.deleteSourceEdge(t),null!==(e=t.fromVertex)&&e.deleteDestinationEdge(t),this.yN(t))}yN(t){var e;return null!==t&&((e=this.In.remove(t))&&null!==(t=t.link)&&this.Ly.remove(t),e)}deleteLink(t){null!==t&&(Ht,Kt.s(t,Y,_e,"deleteLink:link"),null!==(t=this.findEdge(t)))&&this.deleteEdge(t)}findEdge(t){return null===t?null:(Ht,Kt.s(t,Y,_e,"findEdge:link"),this.Ly.getValue(t))}linkVertexes(t,e,i){var s;return null!==t&&null!==e&&((Ht,Kt.s(t,We,_e,"linkVertexes:fromVertex"),Kt.s(e,We,_e,"linkVertexes:toVertex"),null!==i)&&Kt.s(i,Y,_e,"linkVertexes:link"),t.network===this)&&e.network===this?((s=this.createEdge()).link=i,s.fromVertex=t,s.toVertex=e,this.addEdge(s),s):null}reverseEdge(t){var e,i;null!==t&&(Ht,Kt.s(t,Qe,_e,"reverseEdge:edge"),e=t.fromVertex,i=t.toVertex,null!==e)&&null!==i&&(e.deleteDestinationEdge(t),i.deleteSourceEdge(t),t.reverseEdge(),e.addSourceEdge(t),i.addDestinationEdge(t))}deleteSelfEdges(){for(var e=Kt.ct(),t=this.In.iterator;t.next();){var i=t.value;i.fromVertex===i.toVertex&&e.push(i)}var s=e.length;for(let t=0;tnull===t||null===e||t===e?0:e.vertexes.count-t.vertexes.count),e}CO(e,t){if(null!==t){var i=new O;for(i.add(t);0a-1||0n)&&(l.push(new Q(0,f,n+r,v)),p=0,m=g,f+=v,v=0),v=Math.max(v,w),0);e=11===c?-b.width:0,11===(y.moveTo(m+e,f),c)?m-=x:m+=x,p++}l.push(new Q(0,f,n+r,v)),Q.o(h)}LO(i,s,n,a,r,o){var l=Q.a();let h=Math.max(this.cellSize.width,1),e=0,u=0,d=0;var c=_.a();for(let t=0;t=e&&(s-=e),0),w=0;var A=Math.max(this.cellSize.height,1);let P=d=0,k=!0;var S=_.a();for(let e=0;en-1||0s){o.push(new Q(0,k?y-d:y,s+a,P+d+r));for(let t=0;tw&&(E.width+=E.x-w,E.x=w)}Q.o(l)}commitLayers(t,e){}get wrappingWidth(){return this.sg}set wrappingWidth(t){this.sg!==t&&(Kt.t(t,"number",ti,"wrappingWidth"),0{i.containsNodeData(t)&&this.wT(t,!1)}),t.forEach(t=>{i.containsNodeData(t)&&this.Fb(t)}),!1!==e&&this.diagram.F1(!1)}wT(t,e){if(null==t||this.diagram.undoManager.isUndoingRedoing||this.Po.contains(t))return null;void 0===e&&(e=!0);var i=this.TO(t);return null!==i&&e&&this.Fb(t),i}TO(t){if(null!=t&&!this.b.undoManager.isUndoingRedoing&&!this.Po.contains(t)){var e=this.DO(t),i=this.findTemplateForNodeData(t,e);if(null!==i){i.ui();var s,i=i.copy();if(null!==i)return s=this.diagram.xe,this.diagram.xe=!0,i._o=e,i.si=t,this.Ty&&(i.ml="Tool"),this.diagram.add(i),i.si=null,i.data=t,this.diagram.xe=s,i}}return null}insertLink(t,e,i,s){return null}Fb(t){}DO(t){return this.b.model.getCategoryForNodeData(t)}static xT=!1;static bT=!1;findTemplateForNodeData(t,e){var i=this.b,s=i.model;let n=null;return s.ma()&&s.isGroupForData(t)?null===(n=i.groupTemplateMap.getValue(e))&&null===(n=i.groupTemplateMap.getValue(""))&&(ei.bT||(ei.bT=!0,Kt.ft('No Group template found for category "'+e+'"'),Kt.ft(" Using default group template")),n=i.OF):null===(n=i.nodeTemplateMap.getValue(e))&&null===(n=i.nodeTemplateMap.getValue(""))&&(ei.xT||(ei.xT=!0,Kt.ft('No Node template found for category "'+e+'"'),Kt.ft(" Using default node template")),n=i.RF),n}getLinkCategoryForData(t){return""}setLinkCategoryForData(t,e){}setFromNodeForLink(t,e,i){}setToNodeForLink(t,e,i){}static kT=!1;findLinkTemplateForCategory(t){var e=this.b;let i=e.linkTemplateMap.getValue(t);return null===i&&null===(i=e.linkTemplateMap.getValue(""))&&(ei.kT||(ei.kT=!0,Kt.ft('No Link template found for category "'+t+'"'),Kt.ft(" Using default link template")),i=e.IF),i}yI(t,e,i){t instanceof Y?(null!==e&&this.pT(e,t),null!==i&&this.mT(i,t)):t instanceof H&&(null!==e&&this.Po.remove(e),null!==i)&&this.Po.add(i,t)}yT(){var t=this.diagram.model;this.xN(t.nodeDataArray)}xN(t){t.forEach(t=>{this.Rb(t)})}Rb(t){t=this.findPartForData(t);null!==t&&(this.diagram.DP(t,!1),this.bN(t))}bN(t){}fN(t){}findPartForKey(t){return null!=t&&null!==(t=this.b.model.findNodeDataForKey(t))?this.Po.getValue(t):null}findNodeForKey(t){return null!=t&&null!==(t=this.b.model.findNodeDataForKey(t))&&(t=this.Po.getValue(t))instanceof D?t:null}findLinkForKey(t){return null}findPartForData(t){if(null===t)return null;let e=this.Po.getValue(t);return e=null===e?this.bl.getValue(t):e}findNodeForData(t){return null!==t&&(t=this.Po.getValue(t))instanceof D?t:null}findLinkForData(t,e){return null===t?null:this.bl.getValue(t)}findNodesByExample(){for(var e=new N,t=this.og.iterator;t.next();){var i=t.value,s=i.data;if(null!==s)for(let t=0;t{null===t.data||i.contains(t.data)||a.push(t.data)}),this.parts.each(t=>{null===t.data||i.contains(t.data)||a.push(t.data)}),a.forEach(t=>e.MT(t,!1));for(let t=0;ti.CA(t));var t=e.bh;if(Array.isArray(t)){var s=this.Ga.getValue(t);if(null===s){var n=[];n.push(e),this.Ga.add(t,n)}else{for(let t=0;ti.SR(t));var s=e.bh;if(Array.isArray(s)){var n=this.Ga.getValue(s);if(null!==n)for(let t=0;t{null!==t.key.data&&C.add(t.key.data,t.value.data)});var S=this.b.model;k(C,P,S)}}for(var M=n.iterator;M.next();)M.value.updateTargetBindings();return n}Ib(t,e,i,s){if(null===t||s&&!t.canCopy())return null;if(i.contains(t))return i.getValue(t);var n=this.SN(t,e);if(!(n instanceof H))return null;if(n.isSelected=!1,n.isHighlighted=!1,i.add(t,n),t instanceof D){for(var a=t.linksConnected;a.next();){var r,o=a.value;o.fromNode===t&&null!==(r=i.getValue(o))&&(r.fromNode=n),o.toNode===t&&null!==(r=i.getValue(o))&&(r.toNode=n)}if(t instanceof X&&n instanceof X)for(var l=t.memberParts;l.next();){var h=l.value,h=this.Ib(h,e,i,s);h instanceof Y||null!==h&&(h.containingGroup=n)}}else if(t instanceof Y&&n instanceof Y)for(var u=t.fromNode,u=(null!==u&&null!==(u=i.getValue(u))&&(n.fromNode=u),t.toNode),d=(null!==u&&null!==(u=i.getValue(u))&&(n.toNode=u),t.labelNodes);d.next();){var c=d.value,c=this.Ib(c,e,i,s);null!==c&&c instanceof D&&(c.labeledLink=n)}return n}SN(t,e){let i=null;var s=t.data;if(null!==s&&null!==e){var n=e.model;t instanceof Y||(a=n.copyNodeData(s),Kt.Mt(a)&&(n.addNodeData(a),i=e.findPartForData(a)))}else if(t.ui(),null!==(i=t.copy())){n=this.b;if(null!==e)e.add(i);else if(null!==s&&null!==n&&null!==n.commandHandler&&n.commandHandler.copiesClipboardData){var a=n.model;let t=null;i instanceof Y||(t=a.copyNodeData(s)),Kt.Mt(t)&&(i.data=t)}}return i}get nodes(){return this.og}get links(){return this._s}get parts(){return this.It}get diagram(){return this.b}get addsToTemporaryLayer(){return this.Ty}set addsToTemporaryLayer(t){this.Ty=t}get preservesRebuildLocations(){return this.wN}set preservesRebuildLocations(t){this.wN=t}}class ii extends ei{RP(){var t=this.diagram.model;this.Dy(t.nodeDataArray),this.CT(t.linkDataArray)}Dy(t){super.Dy(t,!1);for(var e=this.links.iterator;e.next();)e.value.Ed();this.diagram.F1(!1)}CT(t){t.forEach(t=>{this.AT(t)}),this.diagram.F1(!1)}AT(t){if(null!=t&&!this.diagram.undoManager.isUndoingRedoing&&!this.bl.contains(t)){var e,i=this.getLinkCategoryForData(t),s=this.findLinkTemplateForCategory(i);if(null!==s){s.ui();const n=s.copy();if(null!==n)return s=this.diagram.xe,this.diagram.xe=!0,n._o=i,n.si=t,""!==(e=(i=this.diagram.model).Ob(t,!0))&&(n.fromPortId=e),void 0!==(e=i.ze(t,!0))&&(e=this.findNodeForKey(e))instanceof D&&(n.fromNode=e),""!==(e=i.Ob(t,!1))&&(n.toPortId=e),void 0!==(e=i.ze(t,!1))&&(e=this.findNodeForKey(e))instanceof D&&(n.toNode=e),e=i.getLabelKeysForLinkData(t),Array.isArray(e)&&e.forEach(t=>{t=this.findNodeForKey(t);null!==t&&(t.labeledLink=n)}),this.Ty&&(n.ml="Tool"),this.diagram.add(n),n.si=null,n.data=t,this.diagram.xe=s,n}}return null}yT(){var t=this.diagram.model;this.LT(t.linkDataArray),this.xN(t.nodeDataArray)}LT(t){t.forEach(t=>{this.Rb(t)})}getLinkCategoryForData(t){return this.diagram.model.getCategoryForLinkData(t)}setLinkCategoryForData(t,e){return this.diagram.model.setCategoryForLinkData(t,e)}setFromNodeForLink(t,e){var i=this.diagram.model,e=null!==e?e.data:null;i.setFromKeyForLinkData(t.data,i.getKeyForNodeData(e))}setToNodeForLink(t,e){var i=this.diagram.model,e=null!==e?e.data:null;i.setToKeyForLinkData(t.data,i.getKeyForNodeData(e))}fN(t){this.diagram.model.removeLinkData(t.data)}findPartForKey(t){var e=super.findPartForKey(t);if(null===e){t=this.diagram.model.findLinkDataForKey(t);if(null!==t)return this.bl.getValue(t)}return e}findLinkForKey(t){return null!=t&&null!==(t=this.diagram.model.findLinkDataForKey(t))?this.bl.getValue(t):null}doModelChanged(t){if(super.doModelChanged(t),this.diagram){var e=this.diagram;if(t.model===e.model){var i=t.change;if(e.W){e.W=!1;try{var s,n,a,r,o,l,h,u,d,c,g,m,f=t.modelChange;if(""!==f)if(2===i){if("linkFromKey"===f){var p,v,y=t.object,b=this.findLinkForData(y);null!==b&&(p=t.newValue,v=this.findNodeForKey(p),b.fromNode=v)}else if("linkToKey"===f){var x,w,A=t.object,P=this.findLinkForData(A);null!==P&&(x=t.newValue,w=this.findNodeForKey(x),P.toNode=w)}else if("linkFromPortId"===f){var k,S=t.object,M=this.findLinkForData(S);null!==M&&"string"==typeof(k=t.newValue)&&(M.fromPortId=k)}else if("linkToPortId"===f){var C,O=t.object,N=this.findLinkForData(O);null!==N&&"string"==typeof(C=t.newValue)&&(N.toPortId=C)}else if("nodeGroupKey"===f){var L,D,I=t.object,T=this.findPartForData(I);null!==T&&(void 0!==(L=t.newValue)&&(D=this.findNodeForKey(L))instanceof X?T.containingGroup=D:T.containingGroup=null)}else if("linkLabelKeys"===f){const B=t.object,F=this.findLinkForData(B);if(null!==F){const E=t.oldValue,R=t.newValue;Array.isArray(E)&&E.forEach(t=>{0<=R.indexOf(t)||null!==(t=this.findNodeForKey(t))&&(t.labeledLink=null)}),Array.isArray(R)&&R.forEach(t=>{t=this.findNodeForKey(t);null!==t&&(t.labeledLink=F)})}}else"linkCategory"===f?(n=t.object,a=this.findLinkForData(n),r=t.newValue,null!==a&&"string"==typeof r&&(a.category=r)):"linkDataArray"===f&&(o=t.oldValue,this.LT(o),l=t.newValue,this.CT(l));e.isModified=!0}else 3===i?(h=t.newValue,"linkDataArray"===f&&"object"==typeof h&&null!==h?this.AT(h):"linkLabelKeys"===f&&t.model.isKeyType(h)&&(u=t.object,d=this.findLinkForData(u),c=this.findNodeForKey(h),null!==d)&&null!==c&&(c.labeledLink=d),e.isModified=!0):4===i&&(g=t.oldValue,"linkDataArray"===f&&"object"==typeof g&&null!==g?this.Rb(g):"linkLabelKeys"===f&&t.model.isKeyType(g)&&null!==(m=this.findNodeForKey(g))&&(m.labeledLink=null),e.isModified=!0);else 2===i&&(s=t.propertyName,t.object!==e.model||"linkFromKeyProperty"!==s&&"linkToKeyProperty"!==s&&"linkFromPortIdProperty"!==s&&"linkToPortIdProperty"!==s&&"linkLabelKeysProperty"!==s&&"nodeIsGroupProperty"!==s&&"nodeGroupKeyProperty"!==s&&"linkCategoryProperty"!==s||e.undoManager.isUndoingRedoing||this.rebuildParts(),e.isModified=!0)}finally{e.W=!0}}}}}NT(){const e=this.diagram.model,i=new N,t=e.linkDataArray,s=(t.forEach(t=>{i.add(t)}),[]);this.links.each(t=>{null===t.data||i.contains(t.data)||s.push(t.data)}),s.forEach(t=>{e.TT(t,!1)}),t.forEach(t=>{null===this.findLinkForData(t)&&e.DT(t,!1)})}updateRelationshipsFromData(t){var e=t.data;if(null!==e){const a=t.diagram;if(null!==a){const r=a.model;if(t instanceof Y){var i=r.ze(e,!0),s=a.findNodeForKey(i),i=(t.fromNode=s,i=r.ze(e,!1),s=a.findNodeForKey(i),t.toNode=s,r.getLabelKeysForLinkData(e));if(0{null!==t.data&&void 0!==(t=r.getKeyForNodeData(t.data))&&l.add(t)});var n=l.copy(),s=(n.removeAll(o),o.copy());if(s.removeAll(l),0{t=a.findNodeForKey(t);null!==t&&t.labeledLink===h&&(t.labeledLink=null)}),s.each(t=>{t=a.findNodeForKey(t);null!==t&&t.labeledLink!==h&&(t.labeledLink=h)})}}}else t instanceof K||(i=r.getGroupKeyForNodeData(e),(null===(n=a.findPartForKey(i))||n instanceof X)&&(t.containingGroup=n))}}}Fb(t){const e=this.diagram.model,i=e.getKeyForNodeData(t);if(void 0!==i){const r=e.Ry(i),o=this.findPartForData(t);if(null!==r&&null!==o){for(var s=r.iterator;s.next();){var n,a=s.value;if(e.containsNodeData(a))o instanceof X&&e.getGroupKeyForNodeData(a)===i&&null!==(n=this.findPartForData(a))&&(n.containingGroup=o);else{const l=this.findLinkForData(a);null!==l&&o instanceof D&&(e.ze(a,!0)===i&&(l.fromNode=o),e.ze(a,!1)===i&&(l.toNode=o),n=e.getLabelKeysForLinkData(a),Array.isArray(n))&&n.some(t=>t===i&&(o.labeledLink=l,!0))}}e.en(i)}var t=e.getGroupKeyForNodeData(t);void 0!==t&&(t=this.findNodeForKey(t))instanceof X&&(o.containingGroup=t)}}bN(t){var e=this.diagram.model;if(t instanceof D){var i=e.getKeyForNodeData(t.data);if(void 0!==i){for(var s,n=t.linksConnected;n.next();){var a=n.value;e.sn(i,a.data)}if(t.isLinkLabel&&null!==(s=t.labeledLink)&&e.sn(i,s.data),t instanceof X)for(var r=t.memberParts;r.next();){var o=r.value.data;e.containsNodeData(o)&&e.sn(i,o)}}}}SN(t,e){let i=super.SN(t,e);var s,n;return t instanceof Y&&(null!==(t=t.data)&&null!==e?"object"==typeof(s=(n=e.model).copyLinkData(t))&&null!==s&&(n.addLinkData(s),i=e.findLinkForData(s)):null!==i&&(n=this.diagram,null!==t)&&null!==n&&null!==n.commandHandler&&n.commandHandler.copiesClipboardData&&"object"==typeof(e=n.model.copyLinkData(t))&&null!==e&&(i.data=e)),i}insertLink(t,e,i,s){var n=this.diagram,a=n.model,r=n.toolManager.findTool("Linking");let o="",l=(null!==t&&(null===e&&(e=t),null===(o=e.portId))&&(o=""),"");null!==i&&(null===s&&(s=i),null===(l=s.portId))&&(l="");e=r.archetypeLinkData;if(e instanceof Y){e.ui();s=e.copy();if(null!==s)return s.fromNode=t,s.fromPortId=o,s.toNode=i,s.toPortId=l,n.add(s),(h=r.archetypeLabelNodeData)instanceof D&&(h.ui(),null!==(h=h.copy()))&&(h.labeledLink=s,n.add(h)),s}else if(null!==e){var h=a.copyLinkData(e);if("object"==typeof h&&null!==h)return null!==t&&a.rg(h,a.getKeyForNodeData(t.data),!0),a.lg(h,o,!0),null!==i&&a.rg(h,a.getKeyForNodeData(i.data),!1),a.lg(h,l,!1),a.addLinkData(h),null===(s=r.archetypeLabelNodeData)||s instanceof D||"object"==typeof(e=a.copyNodeData(s))&&null!==e&&(a.addNodeData(e),void 0!==(t=a.getKeyForNodeData(e)))&&a.addLabelKeyForLinkData(h,t),n.findLinkForData(h)}return null}}class si extends ei{Ah=null;Eb(i,s){if(null!==i&&null!==s&&null===s.findTreeParentLink()){var n=this.diagram.toolManager.findTool("Linking");let t=i,e=s;if(this.diagram.isTreePathToChildren){if(null!==n&&n.Cu(t,e,null,!0))return null}else if(t=s,e=i,null!==n&&n.Cu(t,e,null,!0))return null;i=this.getLinkCategoryForData(s.data),n=this.findLinkTemplateForCategory(i);if(null!==n){n.ui();var a,n=n.copy();if(null!==n)return a=this.diagram.xe,this.diagram.xe=!0,n._o=i,n.si=s.data,n.fromNode=t,n.toNode=e,this.diagram.add(n),n.si=null,n.data=s.data,this.diagram.xe=a,n}}return null}getLinkCategoryForData(t){return this.diagram.model.getParentLinkCategoryForNodeData(t)}setLinkCategoryForData(t,e){this.diagram.model.setParentLinkCategoryForNodeData(t,e)}setFromNodeForLink(t,e,i){var s,n=this.diagram.model,e=(void 0===i&&(i=null),null!==e?e.data:null);this.diagram.isTreePathToChildren?n.setParentKeyForNodeData(t.data,n.getKeyForNodeData(e)):(s=this.Ah,this.Ah=t,null!==i&&n.setParentKeyForNodeData(i.data,void 0),i=null!==t.toNode?t.toNode.data:null,n.setParentKeyForNodeData(e,n.getKeyForNodeData(i)),this.Ah=s)}setToNodeForLink(t,e,i){var s,n=this.diagram.model,e=(void 0===i&&(i=null),null!==e?e.data:null);this.diagram.isTreePathToChildren?(s=this.Ah,this.Ah=t,null!==i&&n.setParentKeyForNodeData(i.data,void 0),i=null!==t.fromNode?t.fromNode.data:null,n.setParentKeyForNodeData(e,n.getKeyForNodeData(i)),this.Ah=s):n.setParentKeyForNodeData(t.data,n.getKeyForNodeData(e))}fN(t){this.diagram.model.setParentKeyForNodeData(t.data,void 0)}findLinkForKey(t){return null!=t&&null!==(t=this.diagram.model.findNodeDataForKey(t))?this.bl.getValue(t):null}doModelChanged(t){if(super.doModelChanged(t),this.diagram){var e=this.diagram;if(t.model===e.model){var i=t.change;if(e.W){e.W=!1;try{var s,n,a,r,o,l,h,u,d,c,g=t.modelChange;""!==g?2===i&&("nodeParentKey"===g?(s=t.object,n=t.newValue,a=this.findNodeForKey(n),r=this.findNodeForData(s),null!==this.Ah?null!==a&&(this.Ah.data=s,this.Ah.category=this.getLinkCategoryForData(s)):null!==r&&(null!==(o=r.findTreeParentLink())?null===a?e.remove(o):e.isTreePathToChildren?o.fromNode=a:o.toNode=a:this.Eb(a,r))):"parentLinkCategory"===g&&(l=t.object,h=this.findNodeForData(l),u=t.newValue,null!==h)&&"string"==typeof u&&null!==(d=h.findTreeParentLink())&&(d.category=u),e.isModified=!0):2===i&&(c=t.propertyName,t.object!==e.model||"nodeParentKeyProperty"!==c||e.undoManager.isUndoingRedoing||this.rebuildParts(),e.isModified=!0)}finally{e.W=!0}}}}}updateRelationshipsFromData(t){var e,i,s,n=t.data;null!==n&&null!==(e=t.diagram)&&(i=e.model,t instanceof D)&&(i=i.getParentKeyForNodeData(n),(s=e.findNodeForKey(i))!==t.findTreeParentNode())&&(n=t.findTreeParentLink(),null!==s?null!==n?e.isTreePathToChildren?n.fromNode=s:n.toNode=s:this.Eb(s,t):null!==n&&e.DP(n,!1))}Fy(t,e){super.Fy(t,e),"string"==typeof e&&null!==this.findPartForData(t)&&null!==(t=this.findLinkForData(t))&&t.updateTargetBindings(e)}Fb(t){var e=this.diagram.model,i=e.getKeyForNodeData(t);if(void 0!==i){var s=e.Ry(i),n=this.findPartForData(t);if(null!==s&&null!==n){for(var a=s.iterator;a.next();){var r=a.value;e.containsNodeData(r)&&n instanceof D&&e.getParentKeyForNodeData(r)===i&&(r=this.findNodeForData(r),this.Eb(n,r))}e.en(i)}s=e.getParentKeyForNodeData(t);void 0!==s&&n instanceof D&&(t=this.findNodeForKey(s),this.Eb(t,n))}}bN(t){var e=this.diagram.model;if(t instanceof D)for(var i,s,n=e.getKeyForNodeData(t.data),a=this.findLinkForData(t.data),r=(null!==a&&(a.isSelected=!1,a.isHighlighted=!1,null!==(i=a.layer))&&(0<=(s=i.re(-1,a,!1))&&this.diagram.raiseChangedEvent(4,"parts",i,a,null,s,null),null!==(s=a.layerChanged))&&s(a,i,null),this.diagram.isTreePathToChildren),o=t.linksConnected;o.next();){var l=o.value,l=(r?l.toNode:l.fromNode).data;e.containsNodeData(l)&&e.sn(n,l)}}insertLink(t,e,i,s){var n=this.diagram.model;let a=t,r=i;return this.diagram.isTreePathToChildren||(a=i,r=t),null!==a&&null!==r?(i=a.data,t=r.data,n.setParentKeyForNodeData(t,n.getKeyForNodeData(i)),r.findTreeParentLink()):null}}(s={})[s.OneWay=1]="OneWay",s[s.TwoWay=2]="TwoWay";var ni=s;class ai{l;MN;Ha;Dc;Lh;Fc;Rc;Ic;Vb;Te;Sd;mc;constructor(t,e,i,s){N.ji(this),void 0===t?t="":Kt.t(t,"string",ai,"constructor:targetprop"),void 0===e?e=t:Kt.t(e,"string",ai,"constructor:sourceprop"),void 0===i?i=null:null!==i&&Kt.t(i,"function",ai,"constructor:conv"),this.MN=-1,this.Te=null,this.Ha=t,this.Sd=0,this.mc=0,this.Dc=null,this.Lh=e,this.Fc=i,void 0===s?(this.Rc=1,this.Ic=null):(this.Rc=2,this.Ic=s),this.Vb=new N,this.l=2}copy(){var t=new this.constructor;return this.cloneProtected(t),t}cloneProtected(t){t.Ha=this.Ha,t.Sd=this.Sd,t.mc=this.mc,t.Dc=this.Dc,t.Lh=this.Lh,t.Fc=this.Fc,t.Rc=this.Rc,t.Ic=this.Ic,t.l=-2&this.l}static OneWay=1;static TwoWay=2;static parseEnum(i,s){return Kt.t(i,"function",ai,"parseEnum:ctor"),t=>{let e=parseInt(t);return isNaN(e)&&null===(e=Kt.Yh(i,t))?s:e}}ci(t){t in ni?this.mode=t:Kt.gr(this,t)}static toString(t){return Kt.toString(t)}toString(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(-1!==this.targetId?" "+this.targetId:"")+" "+ni[this.mode]+")"}w(){return this.l=1|this.l,this}ut(){return this.l=-2&this.l,this}get targetId(){return this.MN}set targetId(t){this.f&&Kt.O(this),Kt.t(t,"number",ai,"targetId"),this.MN=t}get targetProperty(){return this.Ha}set targetProperty(t){this.f&&Kt.O(this),Kt.t(t,"string",ai,"targetProperty"),this.Ha=t}get sourceProperty(){return this.Lh}set sourceProperty(t){this.f&&Kt.O(this),Kt.t(t,"string",ai,"sourceProperty"),this.Lh=t}get f(){return 0!=(1&this.l)}get isToData(){return 0!=(2&this.l)}get isToObject(){return 0!=(4&this.l)}get isToModel(){return 0!=(8&this.l)}get isToTheme(){return 0!=(16&this.l)}get PN(){return this.isToTheme&&!(this.isToData||this.isToObject||this.isToModel)}rd(){return!1}get sourceName(){return this.Dc}set sourceName(t){this.f&&Kt.O(this),null!==t&&Kt.t(t,"string",ai,"sourceName"),this.Dc=t,this.l=null!==t?-3&this.l|4:2|this.l}get converter(){return this.Fc}set converter(t){this.f&&Kt.O(this),null!==t&&Kt.t(t,"function",ai,"converter"),this.Fc=t}get backConverter(){return this.Ic}set backConverter(t){this.f&&Kt.O(this),null!==t&&Kt.t(t,"function",ai,"backConverter"),this.Ic=t}get mode(){return this.Rc}set mode(t){this.f&&Kt.O(this),this.isToTheme&&2===t&&Kt.n("Theme Bindings cannot be TwoWay."),Kt.it(t,ni,"BindingMode"),this.Rc=t}makeTwoWay(t){return this.isToTheme&&Kt.n("Theme Bindings cannot be TwoWay."),this.mode=2,t&&(Kt.t(t,"function",ai,"makeTwoWay"),this.backConverter=t),this}ofObject(t){return this.f&&Kt.O(this),void 0===t&&(t=""),Ht,Kt.t(t,"string",ai,"ofObject:srcname"),this.sourceName=t,this}ofModel(){return this.f&&Kt.O(this),this.l=-3&this.l&-5|8,this.Dc=null,this}iL(t,e){var i=this.sourceName;let s=null;return s=null===i||""===i?t:"/"===i?e.part:"."===i?e:".."===i?e.panel:t.findObject(i)}check(t){var e=this.Ha,i=this.Lh,s=this.Fc;(this.rd()&&null===s&&null===this.Th&&""===e||null===s&&""===e)&&Kt.ft("Binding error: target property is the empty string: "+this.toString()),this.rd()&&this.PN&&""===i&&null===s&&null===this.Th&&Kt.ft("Binding error: theme bindings require a source property when not using a converter: "+this.toString()),t&&"string"==typeof e&&("function"!=typeof t.setAttribute&&0{var e;return t instanceof D?!t.isLinkLabel:t instanceof Y&&null!==(e=t.fromNode)&&!e.isLinkLabel&&!(null===(e=t.toNode)||e.isLinkLabel)});for(var s=t.iterator;s.next();){var n,a=s.value;a instanceof D&&(!e||a.isTopLevel)&&a.canLayout()&&i(a)&&(a instanceof X&&null===a.layout?this.addParts(a.memberParts,!1):null===this.findVertex(a)&&((n=this.createVertex()).node=a,this.addVertex(n)))}for(s.reset();s.next();){var r,o,l=s.value;l instanceof Y&&(!e||l.isTopLevel)&&l.canLayout()&&i(l)&&null===this.findEdge(l)&&(r=l.fromNode,o=l.toNode,null!==r)&&null!==o&&r!==o&&(r=this.findGroupVertex(r),o=this.findGroupVertex(o),this.linkVertexes(r,o,l))}}}findGroupVertex(i){if(null!==i){i=i.findVisibleNode();if(null!==i){let t=this.findVertex(i);if(null!==t)return t;let e=i.containingGroup;for(;null!==e;){if(null!==(t=this.findVertex(e)))return t;e=e.containingGroup}}}return null}addVertex(t){var e;null!==t&&(Ht,Kt.s(t,We,_e,"addVertex:vertex"),this.So.add(t),null!==(e=t.node)&&this.Ay.add(e,t),t.network=this)}addNode(t){if(null===t)return null;Ht,Kt.s(t,D,_e,"addNode:node");let e=this.findVertex(t);return null===e&&((e=this.createVertex()).node=t,this.addVertex(e)),e}deleteVertex(i){if(null!==i&&(Ht,Kt.s(i,We,_e,"deleteVertex:vertex"),this.gT(i))){let e=i.rr;for(let t=e.count-1;0<=t;t--){var s=e.elt(t);this.deleteEdge(s)}for(let t=(e=i.lr).count-1;0<=t;t--){var n=e.elt(t);this.deleteEdge(n)}}}gT(t){var e;return null!==t&&((e=this.So.remove(t))&&null!==(t=t.node)&&this.Ay.remove(t),e)}deleteNode(t){null!==t&&(Ht,Kt.s(t,D,_e,"deleteNode:node"),null!==(t=this.findVertex(t)))&&this.deleteVertex(t)}findVertex(t){return null===t?null:(Ht,Kt.s(t,D,_e,"findVertex:node"),this.Ay.getValue(t))}addEdge(t){var e;null!==t&&(Ht,Kt.s(t,Qe,_e,"addEdge:edge"),this.pN(t),null!==(e=t.toVertex)&&e.addSourceEdge(t),null!==(e=t.fromVertex))&&e.addDestinationEdge(t)}pN(t){var e;null!==t&&(this.In.add(t),null!==(e=t.link)&&null===this.findEdge(e)&&this.Ly.add(e,t),t.network=this)}addLink(t){if(null===t)return null;Ht,Kt.s(t,Y,_e,"addLink:link");var e=t.fromNode,i=t.toNode;let s=this.findEdge(t);return null===s?((s=this.createEdge()).link=t,null!==e&&(s.fromVertex=this.addNode(e)),null!==i&&(s.toVertex=this.addNode(i)),this.addEdge(s)):(s.fromVertex=null!==e?this.addNode(e):null,s.toVertex=null!==i?this.addNode(i):null),s}deleteEdge(t){var e;null!==t&&(Ht,Kt.s(t,Qe,_e,"deleteEdge:edge"),null!==(e=t.toVertex)&&e.deleteSourceEdge(t),null!==(e=t.fromVertex)&&e.deleteDestinationEdge(t),this.yN(t))}yN(t){var e;return null!==t&&((e=this.In.remove(t))&&null!==(t=t.link)&&this.Ly.remove(t),e)}deleteLink(t){null!==t&&(Ht,Kt.s(t,Y,_e,"deleteLink:link"),null!==(t=this.findEdge(t)))&&this.deleteEdge(t)}findEdge(t){return null===t?null:(Ht,Kt.s(t,Y,_e,"findEdge:link"),this.Ly.getValue(t))}linkVertexes(t,e,i){var s;return null!==t&&null!==e&&((Ht,Kt.s(t,We,_e,"linkVertexes:fromVertex"),Kt.s(e,We,_e,"linkVertexes:toVertex"),null!==i)&&Kt.s(i,Y,_e,"linkVertexes:link"),t.network===this)&&e.network===this?((s=this.createEdge()).link=i,s.fromVertex=t,s.toVertex=e,this.addEdge(s),s):null}reverseEdge(t){var e,i;null!==t&&(Ht,Kt.s(t,Qe,_e,"reverseEdge:edge"),e=t.fromVertex,i=t.toVertex,null!==e)&&null!==i&&(e.deleteDestinationEdge(t),i.deleteSourceEdge(t),t.reverseEdge(),e.addSourceEdge(t),i.addDestinationEdge(t))}deleteSelfEdges(){for(var e=Kt.ct(),t=this.In.iterator;t.next();){var i=t.value;i.fromVertex===i.toVertex&&e.push(i)}var s=e.length;for(let t=0;tnull===t||null===e||t===e?0:e.vertexes.count-t.vertexes.count),e}CO(e,t){if(null!==t){var i=new O;for(i.add(t);0a-1||0n)&&(l.push(new Q(0,f,n+r,v)),p=0,m=g,f+=v,v=0),v=Math.max(v,w),0);e=11===c?-b.width:0,11===(y.moveTo(m+e,f),c)?m-=x:m+=x,p++}l.push(new Q(0,f,n+r,v)),Q.o(h)}LO(i,s,n,a,r,o){var l=Q.a();let h=Math.max(this.cellSize.width,1),e=0,u=0,d=0;var c=_.a();for(let t=0;t=e&&(s-=e),0),w=0;var A=Math.max(this.cellSize.height,1);let P=d=0,k=!0;var S=_.a();for(let e=0;en-1||0s){o.push(new Q(0,k?y-d:y,s+a,P+d+r));for(let t=0;tw&&(E.width+=E.x-w,E.x=w)}Q.o(l)}commitLayers(t,e){}get wrappingWidth(){return this.sg}set wrappingWidth(t){this.sg!==t&&(Kt.t(t,"number",ti,"wrappingWidth"),0{i.containsNodeData(t)&&this.wT(t,!1)}),t.forEach(t=>{i.containsNodeData(t)&&this.Fb(t)}),!1!==e&&this.diagram.F1(!1)}wT(t,e){if(null==t||this.diagram.undoManager.isUndoingRedoing||this.Po.contains(t))return null;void 0===e&&(e=!0);var i=this.TO(t);return null!==i&&e&&this.Fb(t),i}TO(t){if(null!=t&&!this.b.undoManager.isUndoingRedoing&&!this.Po.contains(t)){var e=this.DO(t),i=this.findTemplateForNodeData(t,e);if(null!==i){i.ui();var s,i=i.copy();if(null!==i)return s=this.diagram.xe,this.diagram.xe=!0,i._o=e,i.si=t,this.Ty&&(i.ml="Tool"),this.diagram.add(i),i.si=null,i.data=t,this.diagram.xe=s,i}}return null}insertLink(t,e,i,s){return null}Fb(t){}DO(t){return this.b.model.getCategoryForNodeData(t)}static xT=!1;static bT=!1;findTemplateForNodeData(t,e){var i=this.b,s=i.model;let n=null;return s.ma()&&s.isGroupForData(t)?null===(n=i.groupTemplateMap.getValue(e))&&null===(n=i.groupTemplateMap.getValue(""))&&(ei.bT||(ei.bT=!0,Kt.ft('No Group template found for category "'+e+'"'),Kt.ft(" Using default group template")),n=i.OF):null===(n=i.nodeTemplateMap.getValue(e))&&null===(n=i.nodeTemplateMap.getValue(""))&&(ei.xT||(ei.xT=!0,Kt.ft('No Node template found for category "'+e+'"'),Kt.ft(" Using default node template")),n=i.RF),n}getLinkCategoryForData(t){return""}setLinkCategoryForData(t,e){}setFromNodeForLink(t,e,i){}setToNodeForLink(t,e,i){}static kT=!1;findLinkTemplateForCategory(t){var e=this.b;let i=e.linkTemplateMap.getValue(t);return null===i&&null===(i=e.linkTemplateMap.getValue(""))&&(ei.kT||(ei.kT=!0,Kt.ft('No Link template found for category "'+t+'"'),Kt.ft(" Using default link template")),i=e.IF),i}yI(t,e,i){t instanceof Y?(null!==e&&this.pT(e,t),null!==i&&this.mT(i,t)):t instanceof H&&(null!==e&&this.Po.remove(e),null!==i)&&this.Po.add(i,t)}yT(){var t=this.diagram.model;this.xN(t.nodeDataArray)}xN(t){t.forEach(t=>{this.Rb(t)})}Rb(t){t=this.findPartForData(t);null!==t&&(this.diagram.DP(t,!1),this.bN(t))}bN(t){}fN(t){}findPartForKey(t){return null!=t&&null!==(t=this.b.model.findNodeDataForKey(t))?this.Po.getValue(t):null}findNodeForKey(t){return null!=t&&null!==(t=this.b.model.findNodeDataForKey(t))&&(t=this.Po.getValue(t))instanceof D?t:null}findLinkForKey(t){return null}findPartForData(t){if(null===t)return null;let e=this.Po.getValue(t);return e=null===e?this.bl.getValue(t):e}findNodeForData(t){return null!==t&&(t=this.Po.getValue(t))instanceof D?t:null}findLinkForData(t,e){return null===t?null:this.bl.getValue(t)}findNodesByExample(){for(var e=new N,t=this.og.iterator;t.next();){var i=t.value,s=i.data;if(null!==s)for(let t=0;t{null===t.data||i.contains(t.data)||a.push(t.data)}),this.parts.each(t=>{null===t.data||i.contains(t.data)||a.push(t.data)}),a.forEach(t=>e.MT(t,!1));for(let t=0;ti.CA(t));var t=e.bh;if(Array.isArray(t)){var s=this.Ga.getValue(t);if(null===s){var n=[];n.push(e),this.Ga.add(t,n)}else{for(let t=0;ti.SR(t));var s=e.bh;if(Array.isArray(s)){var n=this.Ga.getValue(s);if(null!==n)for(let t=0;t{null!==t.key.data&&C.add(t.key.data,t.value.data)});var S=this.b.model;k(C,P,S)}}for(var M=n.iterator;M.next();)M.value.updateTargetBindings();return n}Ib(t,e,i,s){if(null===t||s&&!t.canCopy())return null;if(i.contains(t))return i.getValue(t);var n=this.SN(t,e);if(!(n instanceof H))return null;if(n.isSelected=!1,n.isHighlighted=!1,i.add(t,n),t instanceof D){for(var a=t.linksConnected;a.next();){var r,o=a.value;o.fromNode===t&&null!==(r=i.getValue(o))&&(r.fromNode=n),o.toNode===t&&null!==(r=i.getValue(o))&&(r.toNode=n)}if(t instanceof X&&n instanceof X)for(var l=t.memberParts;l.next();){var h=l.value,h=this.Ib(h,e,i,s);h instanceof Y||null!==h&&(h.containingGroup=n)}}else if(t instanceof Y&&n instanceof Y)for(var u=t.fromNode,u=(null!==u&&null!==(u=i.getValue(u))&&(n.fromNode=u),t.toNode),d=(null!==u&&null!==(u=i.getValue(u))&&(n.toNode=u),t.labelNodes);d.next();){var c=d.value,c=this.Ib(c,e,i,s);null!==c&&c instanceof D&&(c.labeledLink=n)}return n}SN(t,e){let i=null;var s=t.data;if(null!==s&&null!==e){var n=e.model;t instanceof Y||(a=n.copyNodeData(s),Kt.Mt(a)&&(n.addNodeData(a),i=e.findPartForData(a)))}else if(t.ui(),null!==(i=t.copy())){n=this.b;if(null!==e)e.add(i);else if(null!==s&&null!==n&&null!==n.commandHandler&&n.commandHandler.copiesClipboardData){var a=n.model;let t=null;i instanceof Y||(t=a.copyNodeData(s)),Kt.Mt(t)&&(i.data=t)}}return i}get nodes(){return this.og}get links(){return this._s}get parts(){return this.It}get diagram(){return this.b}get addsToTemporaryLayer(){return this.Ty}set addsToTemporaryLayer(t){this.Ty=t}get preservesRebuildLocations(){return this.wN}set preservesRebuildLocations(t){this.wN=t}}class ii extends ei{RP(){var t=this.diagram.model;this.Dy(t.nodeDataArray),this.CT(t.linkDataArray)}Dy(t){super.Dy(t,!1);for(var e=this.links.iterator;e.next();)e.value.Ed();this.diagram.F1(!1)}CT(t){t.forEach(t=>{this.AT(t)}),this.diagram.F1(!1)}AT(t){if(null!=t&&!this.diagram.undoManager.isUndoingRedoing&&!this.bl.contains(t)){var e,i=this.getLinkCategoryForData(t),s=this.findLinkTemplateForCategory(i);if(null!==s){s.ui();const n=s.copy();if(null!==n)return s=this.diagram.xe,this.diagram.xe=!0,n._o=i,n.si=t,""!==(e=(i=this.diagram.model).Ob(t,!0))&&(n.fromPortId=e),void 0!==(e=i.ze(t,!0))&&(e=this.findNodeForKey(e))instanceof D&&(n.fromNode=e),""!==(e=i.Ob(t,!1))&&(n.toPortId=e),void 0!==(e=i.ze(t,!1))&&(e=this.findNodeForKey(e))instanceof D&&(n.toNode=e),e=i.getLabelKeysForLinkData(t),Array.isArray(e)&&e.forEach(t=>{t=this.findNodeForKey(t);null!==t&&(t.labeledLink=n)}),this.Ty&&(n.ml="Tool"),this.diagram.add(n),n.si=null,n.data=t,this.diagram.xe=s,n}}return null}yT(){var t=this.diagram.model;this.LT(t.linkDataArray),this.xN(t.nodeDataArray)}LT(t){t.forEach(t=>{this.Rb(t)})}getLinkCategoryForData(t){return this.diagram.model.getCategoryForLinkData(t)}setLinkCategoryForData(t,e){return this.diagram.model.setCategoryForLinkData(t,e)}setFromNodeForLink(t,e){var i=this.diagram.model,e=null!==e?e.data:null;i.setFromKeyForLinkData(t.data,i.getKeyForNodeData(e))}setToNodeForLink(t,e){var i=this.diagram.model,e=null!==e?e.data:null;i.setToKeyForLinkData(t.data,i.getKeyForNodeData(e))}fN(t){this.diagram.model.removeLinkData(t.data)}findPartForKey(t){var e=super.findPartForKey(t);if(null===e){t=this.diagram.model.findLinkDataForKey(t);if(null!==t)return this.bl.getValue(t)}return e}findLinkForKey(t){return null!=t&&null!==(t=this.diagram.model.findLinkDataForKey(t))?this.bl.getValue(t):null}doModelChanged(t){if(super.doModelChanged(t),this.diagram){var e=this.diagram;if(t.model===e.model){var i=t.change;if(e.W){e.W=!1;try{var s,n,a,r,o,l,h,u,d,c,g,m,f=t.modelChange;if(""!==f)if(2===i){if("linkFromKey"===f){var p,v,y=t.object,b=this.findLinkForData(y);null!==b&&(p=t.newValue,v=this.findNodeForKey(p),b.fromNode=v)}else if("linkToKey"===f){var x,w,A=t.object,P=this.findLinkForData(A);null!==P&&(x=t.newValue,w=this.findNodeForKey(x),P.toNode=w)}else if("linkFromPortId"===f){var k,S=t.object,M=this.findLinkForData(S);null!==M&&"string"==typeof(k=t.newValue)&&(M.fromPortId=k)}else if("linkToPortId"===f){var C,O=t.object,N=this.findLinkForData(O);null!==N&&"string"==typeof(C=t.newValue)&&(N.toPortId=C)}else if("nodeGroupKey"===f){var L,D,I=t.object,T=this.findPartForData(I);null!==T&&(void 0!==(L=t.newValue)&&(D=this.findNodeForKey(L))instanceof X?T.containingGroup=D:T.containingGroup=null)}else if("linkLabelKeys"===f){const B=t.object,F=this.findLinkForData(B);if(null!==F){const E=t.oldValue,R=t.newValue;Array.isArray(E)&&E.forEach(t=>{0<=R.indexOf(t)||null!==(t=this.findNodeForKey(t))&&(t.labeledLink=null)}),Array.isArray(R)&&R.forEach(t=>{t=this.findNodeForKey(t);null!==t&&(t.labeledLink=F)})}}else"linkCategory"===f?(n=t.object,a=this.findLinkForData(n),r=t.newValue,null!==a&&"string"==typeof r&&(a.category=r)):"linkDataArray"===f&&(o=t.oldValue,this.LT(o),l=t.newValue,this.CT(l));e.isModified=!0}else 3===i?(h=t.newValue,"linkDataArray"===f&&"object"==typeof h&&null!==h?this.AT(h):"linkLabelKeys"===f&&t.model.isKeyType(h)&&(u=t.object,d=this.findLinkForData(u),c=this.findNodeForKey(h),null!==d)&&null!==c&&(c.labeledLink=d),e.isModified=!0):4===i&&(g=t.oldValue,"linkDataArray"===f&&"object"==typeof g&&null!==g?this.Rb(g):"linkLabelKeys"===f&&t.model.isKeyType(g)&&null!==(m=this.findNodeForKey(g))&&(m.labeledLink=null),e.isModified=!0);else 2===i&&(s=t.propertyName,t.object!==e.model||"linkFromKeyProperty"!==s&&"linkToKeyProperty"!==s&&"linkFromPortIdProperty"!==s&&"linkToPortIdProperty"!==s&&"linkLabelKeysProperty"!==s&&"nodeIsGroupProperty"!==s&&"nodeGroupKeyProperty"!==s&&"linkCategoryProperty"!==s||e.undoManager.isUndoingRedoing||this.rebuildParts(),e.isModified=!0)}finally{e.W=!0}}}}}NT(){const e=this.diagram.model,i=new N,t=e.linkDataArray,s=(t.forEach(t=>{i.add(t)}),[]);this.links.each(t=>{null===t.data||i.contains(t.data)||s.push(t.data)}),s.forEach(t=>{e.TT(t,!1)}),t.forEach(t=>{null===this.findLinkForData(t)&&e.DT(t,!1)})}updateRelationshipsFromData(t){var e=t.data;if(null!==e){const a=t.diagram;if(null!==a){const r=a.model;if(t instanceof Y){var i=r.ze(e,!0),s=a.findNodeForKey(i),i=(t.fromNode=s,i=r.ze(e,!1),s=a.findNodeForKey(i),t.toNode=s,r.getLabelKeysForLinkData(e));if(0{null!==t.data&&void 0!==(t=r.getKeyForNodeData(t.data))&&l.add(t)});var n=l.copy(),s=(n.removeAll(o),o.copy());if(s.removeAll(l),0{t=a.findNodeForKey(t);null!==t&&t.labeledLink===h&&(t.labeledLink=null)}),s.each(t=>{t=a.findNodeForKey(t);null!==t&&t.labeledLink!==h&&(t.labeledLink=h)})}}}else t instanceof K||(i=r.getGroupKeyForNodeData(e),(null===(n=a.findPartForKey(i))||n instanceof X)&&(t.containingGroup=n))}}}Fb(t){const e=this.diagram.model,i=e.getKeyForNodeData(t);if(void 0!==i){const r=e.Ry(i),o=this.findPartForData(t);if(null!==r&&null!==o){for(var s=r.iterator;s.next();){var n,a=s.value;if(e.containsNodeData(a))o instanceof X&&e.getGroupKeyForNodeData(a)===i&&null!==(n=this.findPartForData(a))&&(n.containingGroup=o);else{const l=this.findLinkForData(a);null!==l&&o instanceof D&&(e.ze(a,!0)===i&&(l.fromNode=o),e.ze(a,!1)===i&&(l.toNode=o),n=e.getLabelKeysForLinkData(a),Array.isArray(n))&&n.some(t=>t===i&&(o.labeledLink=l,!0))}}e.en(i)}var t=e.getGroupKeyForNodeData(t);void 0!==t&&(t=this.findNodeForKey(t))instanceof X&&(o.containingGroup=t)}}bN(t){var e=this.diagram.model;if(t instanceof D){var i=e.getKeyForNodeData(t.data);if(void 0!==i){for(var s,n=t.linksConnected;n.next();){var a=n.value;e.sn(i,a.data)}if(t.isLinkLabel&&null!==(s=t.labeledLink)&&e.sn(i,s.data),t instanceof X)for(var r=t.memberParts;r.next();){var o=r.value.data;e.containsNodeData(o)&&e.sn(i,o)}}}}SN(t,e){let i=super.SN(t,e);var s,n;return t instanceof Y&&(null!==(t=t.data)&&null!==e?"object"==typeof(s=(n=e.model).copyLinkData(t))&&null!==s&&(n.addLinkData(s),i=e.findLinkForData(s)):null!==i&&(n=this.diagram,null!==t)&&null!==n&&null!==n.commandHandler&&n.commandHandler.copiesClipboardData&&"object"==typeof(e=n.model.copyLinkData(t))&&null!==e&&(i.data=e)),i}insertLink(t,e,i,s){var n=this.diagram,a=n.model,r=n.toolManager.findTool("Linking");let o="",l=(null!==t&&(null===e&&(e=t),null===(o=e.portId))&&(o=""),"");null!==i&&(null===s&&(s=i),null===(l=s.portId))&&(l="");e=r.archetypeLinkData;if(e instanceof Y){e.ui();s=e.copy();if(null!==s)return s.fromNode=t,s.fromPortId=o,s.toNode=i,s.toPortId=l,n.add(s),(h=r.archetypeLabelNodeData)instanceof D&&(h.ui(),null!==(h=h.copy()))&&(h.labeledLink=s,n.add(h)),s}else if(null!==e){var h=a.copyLinkData(e);if("object"==typeof h&&null!==h)return null!==t&&a.rg(h,a.getKeyForNodeData(t.data),!0),a.lg(h,o,!0),null!==i&&a.rg(h,a.getKeyForNodeData(i.data),!1),a.lg(h,l,!1),a.addLinkData(h),null===(s=r.archetypeLabelNodeData)||s instanceof D||"object"==typeof(e=a.copyNodeData(s))&&null!==e&&(a.addNodeData(e),void 0!==(t=a.getKeyForNodeData(e)))&&a.addLabelKeyForLinkData(h,t),n.findLinkForData(h)}return null}}class si extends ei{Ah=null;Eb(i,s){if(null!==i&&null!==s&&null===s.findTreeParentLink()){var n=this.diagram.toolManager.findTool("Linking");let t=i,e=s;if(this.diagram.isTreePathToChildren){if(null!==n&&n.Cu(t,e,null,!0))return null}else if(t=s,e=i,null!==n&&n.Cu(t,e,null,!0))return null;i=this.getLinkCategoryForData(s.data),n=this.findLinkTemplateForCategory(i);if(null!==n){n.ui();var a,n=n.copy();if(null!==n)return a=this.diagram.xe,this.diagram.xe=!0,n._o=i,n.si=s.data,n.fromNode=t,n.toNode=e,this.diagram.add(n),n.si=null,n.data=s.data,this.diagram.xe=a,n}}return null}getLinkCategoryForData(t){return this.diagram.model.getParentLinkCategoryForNodeData(t)}setLinkCategoryForData(t,e){this.diagram.model.setParentLinkCategoryForNodeData(t,e)}setFromNodeForLink(t,e,i){var s,n=this.diagram.model,e=(void 0===i&&(i=null),null!==e?e.data:null);this.diagram.isTreePathToChildren?n.setParentKeyForNodeData(t.data,n.getKeyForNodeData(e)):(s=this.Ah,this.Ah=t,null!==i&&n.setParentKeyForNodeData(i.data,void 0),i=null!==t.toNode?t.toNode.data:null,n.setParentKeyForNodeData(e,n.getKeyForNodeData(i)),this.Ah=s)}setToNodeForLink(t,e,i){var s,n=this.diagram.model,e=(void 0===i&&(i=null),null!==e?e.data:null);this.diagram.isTreePathToChildren?(s=this.Ah,this.Ah=t,null!==i&&n.setParentKeyForNodeData(i.data,void 0),i=null!==t.fromNode?t.fromNode.data:null,n.setParentKeyForNodeData(e,n.getKeyForNodeData(i)),this.Ah=s):n.setParentKeyForNodeData(t.data,n.getKeyForNodeData(e))}fN(t){this.diagram.model.setParentKeyForNodeData(t.data,void 0)}findLinkForKey(t){return null!=t&&null!==(t=this.diagram.model.findNodeDataForKey(t))?this.bl.getValue(t):null}doModelChanged(t){if(super.doModelChanged(t),this.diagram){var e=this.diagram;if(t.model===e.model){var i=t.change;if(e.W){e.W=!1;try{var s,n,a,r,o,l,h,u,d,c,g=t.modelChange;""!==g?2===i&&("nodeParentKey"===g?(s=t.object,n=t.newValue,a=this.findNodeForKey(n),r=this.findNodeForData(s),null!==this.Ah?null!==a&&(this.Ah.data=s,this.Ah.category=this.getLinkCategoryForData(s)):null!==r&&(null!==(o=r.findTreeParentLink())?null===a?e.remove(o):e.isTreePathToChildren?o.fromNode=a:o.toNode=a:this.Eb(a,r))):"parentLinkCategory"===g&&(l=t.object,h=this.findNodeForData(l),u=t.newValue,null!==h)&&"string"==typeof u&&null!==(d=h.findTreeParentLink())&&(d.category=u),e.isModified=!0):2===i&&(c=t.propertyName,t.object!==e.model||"nodeParentKeyProperty"!==c||e.undoManager.isUndoingRedoing||this.rebuildParts(),e.isModified=!0)}finally{e.W=!0}}}}}updateRelationshipsFromData(t){var e,i,s,n=t.data;null!==n&&null!==(e=t.diagram)&&(i=e.model,t instanceof D)&&(i=i.getParentKeyForNodeData(n),(s=e.findNodeForKey(i))!==t.findTreeParentNode())&&(n=t.findTreeParentLink(),null!==s?null!==n?e.isTreePathToChildren?n.fromNode=s:n.toNode=s:this.Eb(s,t):null!==n&&e.DP(n,!1))}Fy(t,e){super.Fy(t,e),"string"==typeof e&&null!==this.findPartForData(t)&&null!==(t=this.findLinkForData(t))&&t.updateTargetBindings(e)}Fb(t){var e=this.diagram.model,i=e.getKeyForNodeData(t);if(void 0!==i){var s=e.Ry(i),n=this.findPartForData(t);if(null!==s&&null!==n){for(var a=s.iterator;a.next();){var r=a.value;e.containsNodeData(r)&&n instanceof D&&e.getParentKeyForNodeData(r)===i&&(r=this.findNodeForData(r),this.Eb(n,r))}e.en(i)}s=e.getParentKeyForNodeData(t);void 0!==s&&n instanceof D&&(t=this.findNodeForKey(s),this.Eb(t,n))}}bN(t){var e=this.diagram.model;if(t instanceof D)for(var i,s,n=e.getKeyForNodeData(t.data),a=this.findLinkForData(t.data),r=(null!==a&&(a.isSelected=!1,a.isHighlighted=!1,null!==(i=a.layer))&&(0<=(s=i.re(-1,a,!1))&&this.diagram.raiseChangedEvent(4,"parts",i,a,null,s,null),null!==(s=a.layerChanged))&&s(a,i,null),this.diagram.isTreePathToChildren),o=t.linksConnected;o.next();){var l=o.value,l=(r?l.toNode:l.fromNode).data;e.containsNodeData(l)&&e.sn(n,l)}}insertLink(t,e,i,s){var n=this.diagram.model;let a=t,r=i;return this.diagram.isTreePathToChildren||(a=i,r=t),null!==a&&null!==r?(i=a.data,t=r.data,n.setParentKeyForNodeData(t,n.getKeyForNodeData(i)),r.findTreeParentLink()):null}}(s={})[s.OneWay=1]="OneWay",s[s.TwoWay=2]="TwoWay";var ni=s;class ai{l;MN;Ha;Dc;Lh;Fc;Rc;Ic;Vb;Te;Sd;mc;constructor(t,e,i,s){N.ji(this),void 0===t?t="":Kt.t(t,"string",ai,"constructor:targetprop"),void 0===e?e=t:Kt.t(e,"string",ai,"constructor:sourceprop"),void 0===i?i=null:null!==i&&Kt.t(i,"function",ai,"constructor:conv"),this.MN=-1,this.Te=null,this.Ha=t,this.Sd=0,this.mc=0,this.Dc=null,this.Lh=e,this.Fc=i,void 0===s?(this.Rc=1,this.Ic=null):(this.Rc=2,this.Ic=s),this.Vb=new N,this.l=2}copy(){var t=new this.constructor;return this.cloneProtected(t),t}cloneProtected(t){t.Ha=this.Ha,t.Sd=this.Sd,t.mc=this.mc,t.Dc=this.Dc,t.Lh=this.Lh,t.Fc=this.Fc,t.Rc=this.Rc,t.Ic=this.Ic,t.l=-2&this.l}static OneWay=1;static TwoWay=2;static parseEnum(i,s){return Kt.t(i,"function",ai,"parseEnum:ctor"),t=>{let e=parseInt(t);return isNaN(e)&&null===(e=Kt.Yh(i,t))?s:e}}ci(t){t in ni?this.mode=t:Kt.gr(this,t)}static toString(t){return Kt.toString(t)}toString(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(-1!==this.targetId?" "+this.targetId:"")+" "+ni[this.mode]+")"}w(){return this.l=1|this.l,this}ut(){return this.l=-2&this.l,this}get targetId(){return this.MN}set targetId(t){this.f&&Kt.O(this),Kt.t(t,"number",ai,"targetId"),this.MN=t}get targetProperty(){return this.Ha}set targetProperty(t){this.f&&Kt.O(this),Kt.t(t,"string",ai,"targetProperty"),this.Ha=t}get sourceProperty(){return this.Lh}set sourceProperty(t){this.f&&Kt.O(this),Kt.t(t,"string",ai,"sourceProperty"),this.Lh=t}get f(){return 0!=(1&this.l)}get isToData(){return 0!=(2&this.l)}get isToObject(){return 0!=(4&this.l)}get isToModel(){return 0!=(8&this.l)}get isToTheme(){return 0!=(16&this.l)}get PN(){return this.isToTheme&&!(this.isToData||this.isToObject||this.isToModel)}rd(){return!1}get sourceName(){return this.Dc}set sourceName(t){this.f&&Kt.O(this),null!==t&&Kt.t(t,"string",ai,"sourceName"),this.Dc=t,this.l=null!==t?-3&this.l|4:2|this.l}get converter(){return this.Fc}set converter(t){this.f&&Kt.O(this),null!==t&&Kt.t(t,"function",ai,"converter"),this.Fc=t}get backConverter(){return this.Ic}set backConverter(t){this.f&&Kt.O(this),null!==t&&Kt.t(t,"function",ai,"backConverter"),this.Ic=t}get mode(){return this.Rc}set mode(t){this.f&&Kt.O(this),this.isToTheme&&2===t&&Kt.n("Theme Bindings cannot be TwoWay."),Kt.it(t,ni,"BindingMode"),this.Rc=t}makeTwoWay(t){return this.isToTheme&&Kt.n("Theme Bindings cannot be TwoWay."),this.mode=2,t&&(Kt.t(t,"function",ai,"makeTwoWay"),this.backConverter=t),this}ofObject(t){return this.f&&Kt.O(this),void 0===t&&(t=""),Ht,Kt.t(t,"string",ai,"ofObject:srcname"),this.sourceName=t,this}ofModel(){return this.f&&Kt.O(this),this.l=-3&this.l&-5|8,this.Dc=null,this}iL(t,e){var i=this.sourceName;let s=null;return s=null===i||""===i?t:"/"===i?e.part:"."===i?e:".."===i?e.panel:t.findObject(i)}check(t){var e=this.Ha,i=this.Lh,s=this.Fc;(this.rd()&&null===s&&null===this.Th&&""===e||null===s&&""===e)&&Kt.ft("Binding error: target property is the empty string: "+this.toString()),this.rd()&&this.PN&&""===i&&null===s&&null===this.Th&&Kt.ft("Binding error: theme bindings require a source property when not using a converter: "+this.toString()),t&&"string"==typeof e&&("function"!=typeof t.setAttribute&&0{t.model===i&&("nodeDataArray"===t.modelChange?3===t.change?n.add(t.newValue):4===t.change&&r.add(t.oldValue):i.containsNodeData(t.object)?a.add(t.object):2!==t.change||i.modelData!==t.object&&"modelData"!==t.propertyName?null!==t.object&&(o&&o.contains(t.object)?o.get(t.object).each(t=>{i.containsNodeData(t)&&a.add(t)}):t.object instanceof b||i.Ea()&&i.containsLinkData(t.object)||i.IT(t.object).each(t=>{a.add(t)})):s=!0)}),this.gg),h=(l.clear(),n.each(t=>{l.add(i.getKeyForNodeData(t)),e||a.add(t)}),this.dg);h.clear(),r.each(t=>{h.add(i.getKeyForNodeData(t)),e&&a.add(t)});t=i.cloneDeep(a.toArray());let u=null;return s&&((u=null===u?{}:u).modelData=this.cloneDeep(this.modelData)),0{delete t.__gohashid}),u}Xe(t){return JSON.stringify(t).replace(/[\u007F-\uFFFF]/g,t=>{t="0000"+t.charCodeAt(0).toString(16);return"\\u"+t.substring(t.length-4)})}pg(){let t="";return""!==this.name&&(t+=`, "name": `+this.Xe(this.name)),""!==this.dataFormat&&(t+=`, "dataFormat": `+this.Xe(this.dataFormat)),this.isReadOnly&&(t+=`, @@ -49,7 +49,7 @@ Model data should not have any references to a Diagram or any part of a diagram, "modifiedLinkData": `;GT=`, "removedLinkKeys": `;KT(e){var i=new N;for(let t=0;t{t.model===n&&("linkDataArray"===t.modelChange?3===t.change?a.add(t.newValue):4===t.change&&o.add(t.oldValue):n.containsLinkData(t.object)?r.add(t.object):null!==t.object&&(null!==t.object&&l&&l.contains(t.object)?l.get(t.object).each(t=>{n.containsLinkData(t)&&r.add(t)}):t.object instanceof b||n.containsNodeData(t.object)||n.KT(t.object).each(t=>r.add(t))))}),this.gg),u=(h.clear(),a.each(t=>{h.add(n.getKeyForLinkData(t)),e||r.add(t)}),this.dg);u.clear(),o.each(t=>{u.add(n.getKeyForLinkData(t)),e&&r.add(t)});let d=s;return 0new oi,b.initDiagramModel=b.initDiagramModel=()=>new oi;class li extends b{Bn;kg;$a;constructor(t,e){super(),this.Bn="parent",this.kg=!1,this.$a="parentLinkCategory",void 0!==t&&(Array.isArray(t)?this.nodeDataArray=t:e=t),e&&(Object.assign(this,e),t=e.Changed)&&(delete this.Changed,this.addChangedListener(t))}cloneProtected(t){super.cloneProtected(t),t.Bn=this.Bn,t.kg=this.kg,t.$a=this.$a}toString(t){if(2<=(t=void 0===t?0:t))return this.toJson();{let e=(""!==this.name?this.name:"")+" TreeModel";if(0=i.length||(e.add(i.elt(t)),t+1>=i.length));t+=2)s.add(i.elt(t+1));12===this.direction?(3===this.arrangement&&e.reverse(),(i=new O).addAll(e),i.addAll(s)):(3===this.arrangement&&s.reverse(),(i=new O).addAll(s),i.addAll(e))}var g=i.length;let m=u=0;for(let e=0;ea?(a=A,d=a*r,b):y/(360<=l?g:g-1)}}return this.vb=t,this.EN=n,this.me=a,this.Xc=r,this.Hb=o,this.Sg=l,this.Ih=h,this.VN=u,this.Ls=d,this.Xy=c,i}doLayout(e){Ht,null===e&&Kt.n("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"),null===this.network&&(this.network=this.makeNetwork(e)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);e=this.network.vertexes;if(e.count<=1)1===e.count&&((a=e.first()).centerX=0,a.centerY=0);else{let t=new O;t.addAll(e.iterator);var s=new O,n=new O,a=(t=this.YO(t,s,n),this.vb),r=this.me,o=this.Hb,l=this.Sg,h=this.Ih,u=this.Ls,d=this.Xy;if(12!==this.direction&&13!==this.direction||3!==a)if(12===this.direction||13===this.direction){let i=0;switch(a){case 1:i=180*this.Wb(r,u,o,d)/Math.PI;break;case 0:{let t=0,e=0;var c=s.first(),c=(null!==c&&(t=c.Oh(Math.PI/2)),n.first());null!==c&&(e=c.Oh(Math.PI/2)),i=180*this.Wb(r,u,o,h+(t+e)/2)/Math.PI;break}case 2:i=l/t.length}if(12===this.direction){switch(a){case 1:this.Uy(s,l/2,o,11);break;case 0:this.Gy(s,l/2,o,11);break;case 2:this.Hy(s,l/2,o,11)}switch(a){case 1:this.Uy(n,l/2,o+i,10);break;case 0:this.Gy(n,l/2,o+i,10);break;case 2:this.Hy(n,l/2,o+i,10)}}else{switch(a){case 1:this.Uy(n,l/2,o,11);break;case 0:this.Gy(n,l/2,o,11);break;case 2:this.Hy(n,l/2,o,11)}switch(a){case 1:this.Uy(s,l/2,o+i,10);break;case 0:this.Gy(s,l/2,o+i,10);break;case 2:this.Hy(s,l/2,o+i,10)}}}else switch(a){case 1:this.Uy(t,l,o,this.direction);break;case 0:this.Gy(t,l,o,this.direction);break;case 2:this.Hy(t,l,o,this.direction);break;case 3:this.qT(t,l,o,this.direction)}else this.qT(t,l,o-l/2,10)}this.updateParts(),this.network=null,this.isValidLayout=!0}Hy(e,t,i,s){var n=this.Sg,a=this.me,r=this.Ls,o=i*Math.PI/180,l=t*Math.PI/180,h=e.length;for(let t=0;t=d.length-1));t++)this.JT(e,i,d,t,r,c)||this.ZT(e,i,d,t,r,c),e=c.x,i=c.y;if(_.o(c),this.Qa++,!(23Math.abs(m)?0=d.length-1));t++)this.JT(o,l,d,t,s,u)||this.ZT(o,l,d,t,s,u),o=u.x,l=u.y;_.o(u),this.Qa++,23o){if((h=t-r)<-o)return a.x=h,a.y=u,!1;d=!0}}else if((h=t-r)<-o){if((h=t+r)>o)return a.x=h,a.y=u,!1;d=!0}return u=Math.sqrt(1-Math.min(1,h*h/(o*o)))*l,e<0!==d&&(u=-u),Math.abs(e-u)>(i[s].height+i[s+1].height)/2?(a.x=h,a.y=u,!1):(a.x=h,a.y=u,!0)}ZT(t,e,i,s,n,a){var r=this.Ih,o=this.me,l=this.Ls;let h=0,u=0;r=(i[s].height+i[s+1].height)/2+r;let d=!1;if(0<=t!=(10===n)){if((u=e-r)<-l){if((u=e+r)>l)return a.x=h,a.y=u,!1;d=!0}}else if((u=e+r)>l){if((u=e-r)<-l)return a.x=h,a.y=u,!1;d=!0}return h=Math.sqrt(1-Math.min(1,u*u/(l*l)))*o,t<0!==d&&(h=-h),Math.abs(t-h)>(i[s].width+i[s+1].width)/2?(a.x=h,a.y=u,!1):(a.x=h,a.y=u,!0)}commitLayout(){this.commitNodes(),this.isRouting&&this.commitLinks()}commitNodes(){var t=null!==this.group&&this.group.hasPlaceholder(),e=t?this.group.location.copy():null;let i=this.actualCenter;t?i=new _(0,0):(i.x=this.arrangementOrigin.x+this.me,i.y=this.arrangementOrigin.y+this.Ls);for(var s,n=this.network.vertexes.iterator;n.next();){var a=n.value;a.x+=i.x,a.y+=i.y,a.commit()}t&&(this.group.ensureBounds(),t=this.group.position.copy(),s=this.group.location.copy(),e=e.subtract(s.subtract(t)),this.group.move(e),this.ON=e.subtract(t))}commitLinks(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()}BN(t,e,i,s){var n=this.vT;if(Math.abs(this.Xc-1)<.001)return void 0!==i&&void 0!==s?s*t:2*Math.PI*t;var a=e=n)return t*o}}KO(t){switch(this.sorting){case 20:break;case 21:t.reverse();break;case 22:t.sort(this.comparer);break;case 23:t.sort(this.comparer),t.reverse();break;case 24:return this.HO(this.vO(t));default:Kt.n("Invalid sorting type.")}return t}vO(n){var a=[];for(let t=0;te&&(e=o,i=t)}else for(let t=0;te&&(e=l,i=t)}r.add(n.elt(i)),a[i]=-1;var h=n.elt(i);let t=0;for(var u=h.sourceEdges;u.next();){var d=u.value.fromVertex;!((t=n.indexOf(d))<0)&&0<=a[t]&&a[t]++}for(var c=h.destinationEdges;c.next();){var g=c.value.toVertex;!((t=n.indexOf(g))<0)&&0<=a[t]&&a[t]++}}return r}HO(i){var r=[];for(let e=0;e=v&&t++,e>=v&&e++,t>e&&(p=e,e=t,t=p),e-t<(u.length+2)/2==(tMath.max(100,Math.sqrt(n*t.vertexes.count));)s=this.coarsenNetwork(s);let a=0,r=(e=s.vertexes.iterator,this.randomNumberGenerator);for(null===r&&(this.randomNumberGenerator=r=new Ai(0));e.next();){e.value.idInCluster=a++;for(var o=10*(r.random()-.5),l=10*(r.random()-.5),h=(e.value.x=o,e.value.y=l,e.value.hierarchicalVertexes.iterator);h.next();)h.value.x=o,h.value.y=l}var u=this.computePairwiseDistances(s);this.jO(s,u,this.maxPrelayoutIterations,t.vertexes.count),this.$T(t,this.maxIterations)}computePairwiseDistances(t){var e=t.vertexes.count,i=new Array(e);for(let t=0;tu.y&&i[t].x-u.xu.x&&i[t].y-u.yr-a,u=(h?i.sort((t,e)=>null===t||null===e||t===e?0:t.centerX-e.centerX):i.sort((t,e)=>null===t||null===e||t===e?0:t.centerY-e.centerY),this.Gc);let d=0,c=0,g=0;for(let e=0;ethis.epsilonDistance*this.epsilonDistance}jO(t,i,e,s){Ht,Kt.r(e,yi,"performIterations:num");var n,a,r=this.Eh+e,o=Math.sqrt(s),l=(this.vy=this.tf*t.vertexes.count,t.vertexes.toArray());let h=0,u,d=0;for(;this.Eh=u){if(5<=++d)break}else d=0;this.vy*=.95}}moveVertex(t){let e=t.forceX,i=t.forceY;var s=this.moveLimit;return e<-s?e=-s:e>s&&(e=s),i<-s?i=-s:i>s&&(i=s),t.centerX+=e,t.centerY+=i,e*e+i*i}shouldInteract(t,e){return!0}moveFixedVertex(t){}commitLayout(){this.qy(),this.commitNodes(),this.isRouting&&this.commitLinks()}qy(){if(this.setsPortSpots)for(var t=this.network.edges.iterator;t.next();){var e=t.value.link;null!==e&&(e.fromSpot=Z.Default,e.toSpot=Z.Default)}}commitNodes(){let t=0,e=0;this.arrangesToOrigin&&(i=Q.a(),this.Fw(this.network,i),s=this.arrangementOrigin,t=s.x-i.x,e=s.y-i.y,Q.o(i));for(var i,s,n=Q.a(),a=this.network.vertexes.iterator;a.next();){var r=a.value;0===t&&0===e||(n.c(r.bounds),n.x+=t,n.y+=e,r.bounds=n),r.commit()}Q.o(n)}commitLinks(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()}springStiffness(t){t=t.stiffness;return isNaN(t)?this.Hc:t}springLength(t){t=t.length;return isNaN(t)?this.vc:t}electricalCharge(t){t=t.charge;return isNaN(t)?this.qc:t}electricalFieldX(t,e){return 0}electricalFieldY(t,e){return 0}gravitationalMass(t){t=t.mass;return isNaN(t)?this.Wc:t}gravitationalFieldX(t,e){return 0}gravitationalFieldY(t,e){return 0}isFixed(t){return t.isFixed}get currentIteration(){return this.Eh}get arrangementSpacing(){return this.Ts}set arrangementSpacing(t){Kt.s(t,Yt,yi,"arrangementSpacing"),this.Ts.equals(t)||(this.Ts.c(t),this.invalidateLayout())}get arrangesToOrigin(){return this.Ag}set arrangesToOrigin(t){this.Ag!==t&&(Kt.t(t,"boolean",yi,"arrangesToOrigin"),this.Ag=t,this.invalidateLayout())}get setsPortSpots(){return this.zn}set setsPortSpots(t){this.zn!==t&&(Kt.t(t,"boolean",yi,"setsPortSpots"),this.zn=t,this.invalidateLayout())}get comments(){return this.Ye}set comments(t){this.Ye!==t&&(Kt.t(t,"boolean",yi,"comments"),this.Ye=t,this.invalidateLayout())}get maxPrelayoutIterations(){return this.Lg}set maxPrelayoutIterations(t){this.Lg!==t&&(Kt.t(t,"number",yi,"maxPrelayoutIterations"),0<=t)&&(this.Lg=t,this.invalidateLayout())}get maxIterations(){return this.Tg}set maxIterations(t){this.Tg!==t&&(Kt.t(t,"number",yi,"maxIterations"),0<=t)&&(this.Tg=t,this.invalidateLayout())}get epsilonDistance(){return this.Dg}set epsilonDistance(t){this.Dg!==t&&(Kt.t(t,"number",yi,"epsilonDistance"),0d||a===d&&o>g)&&t++,ca||d===a&&g>o)&&t++;if(v<=0)for(e=y[f].hr,s=0;sd||a===d&&r>c)&&t++,ga||d===a&&c>r)&&t++;for(x[f*b+f]=t,i=f+1;it-e),h=s>>1,1&s?l[t]=u[h]:l[t]=u[h-1]+u[h]>>1)}return this.Bh(a,o),l}Zy(i,s,n,a,r){if(i.component===n){i.component=s;let t=0,e=0;if(a)for(var o=i.destinationEdges;o.next();){var l=o.value,h=l.toVertex;t=i.layer-h.layer,e=this.linkMinLength(l),t===e&&this.Zy(h,s,n,a,r)}if(r)for(var u=i.sourceEdges;u.next();){var d=u.value,c=d.fromVertex;t=c.layer-i.layer,e=this.linkMinLength(d),t===e&&this.Zy(c,s,n,a,r)}}}KN(t,e,i,s,n){if(t.component===i){if(t.component=e,s)for(var a=t.destinationEdges;a.next();){var r=a.value.toVertex;this.KN(r,e,i,s,n)}if(n)for(var o=t.sourceEdges;o.next();){var l=o.value.fromVertex;this.KN(l,e,i,s,n)}}}removeCycles(){for(var t=this.network.edges.iterator;t.next();)t.value.rev=!1;switch(this.Jc){default:case 1:this.e3();break;case 0:this.s3();break;case 2:this.o3()}}o3(){var t=this.network,i=t.vertexes.iterator;let s=1/0;for(;i.next();){var e=i.value;s=Math.min(s,e.layer)}if(s<1/0){if(s<0)for(i.reset();i.next();)i.value.layer-=s;var n=[];for(i.reset();i.next();){var a=i.value,r=n[a.layer];void 0===r?n[a.layer]=[a]:r.push(a)}let e=0;for(let t=0;tl.index&&(e.reverseEdge(r),r.rev=!0)}}r3(t){for(var e=t.vertexes.iterator;e.next();){var i=e.value;if(i.ee)return i}return null}iD(t){for(var e=t.vertexes.iterator;e.next();){var i=e.value;if(i.ee){let t=!0;for(var s=i.destinationEdges;s.next();)if(s.value.toVertex.ee){t=!1;break}if(t)return i}}return null}eD(t){for(var e=t.vertexes.iterator;e.next();){var i=e.value;if(i.ee){let t=!0;for(var s=i.sourceEdges;s.next();)if(s.value.fromVertex.ee){t=!1;break}if(t)return i}}return null}l3(t){let i=null,s=0;for(var e=this.network.vertexes.iterator;e.next();){var n=e.value;if(n.ee){let t=0;for(var a=n.destinationEdges;a.next();)a.value.toVertex.ee&&t++;let e=0;for(var r=n.sourceEdges;r.next();)r.value.fromVertex.ee&&e++;(null===i||sn&&this.Zy(a,0,-1,!0,!1)}for(this.Zy(e,1,-1,!0,!0);0!==e.component;){let s=0,n=1/0,t=0,a=null;for(var l=this.network.vertexes.iterator;l.next();){var h=l.value;if(1===h.component){let e=0,i=!1;var u=h.Mo;r=u.length;for(let t=0;tt)&&!i&&(r=o,t=e)}}if(n<0){for(i.reset();i.next();){var m=i.value;1===m.component&&(m.layer-=a)}e.component=0}else r.component=0}}QO(){for(var d=this.network,e=[],t=d.edges.iterator;t.next();){var i=t.value;i.valid=!1,e.push(i)}for(let t=0;th&&0h&&0e[this.Fs]&&(this.Wy=e[t]-1,this.Fs=t),e[t]{t.index=this.yi[a],this.yi[a]++})}}}m3(){let e=null;for(var i=this.network.vertexes.iterator;i.next();){var t,s=i.value;s.near&&(null===e&&(e=new Map),s.layer===s.near.layer)&&((t=e.get(s.near)||[]).push(s),e.set(s.near,t))}for(let t=this.Lt;0<=t;t--)for(i.reset();i.next();){var n=i.value;n.layer===t&&-1===n.index&&this.aD(n,e)}}aD(t,i){if(!t.near){const l=t.layer;t.index=this.yi[l],this.yi[l]++,i&&(s=i.get(t),Array.isArray(s))&&s.forEach(t=>{t.index=this.yi[l],this.yi[l]++});var s,n=t.hr;let e=!0;for(;e;){e=!1;for(let t=0;tr.portFromColOffset&&(e=!0,n[t]=r,n[t+1]=a)}}for(let t=0;t{t.index=this.yi[h],this.yi[h]++});var n,a,r=i.Mo;let t=!0,e=0;for(;t;)for(t=!1,e=0;el.portToColOffset&&(t=!0,r[e]=l,r[e+1]=o)}for(e=0;e=o;s--)a=this.gs(s,-1,!1,-1)||a;for((n=this.countCrossings())>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=r;s>=o;s--)a=this.gs(s,1,!1,1)||a;for((n=this.countCrossings())>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,1,!1,1)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,-1,!1,-1)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=r;s>=o;s--)a=this.gs(s,0,!1,0)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,0,!1,0)||a;n>=t?this.ns(e):(t=n,e=this.ie())}break;default:for(r=this.Lt,o=0,l=t+1;(h=this.countCrossings())=o;s--)a=this.gs(s,-1,!1,-1)||a;for((n=this.countCrossings())>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=r;s>=o;s--)a=this.gs(s,1,!1,1)||a;for((n=this.countCrossings())>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,1,!1,1)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,-1,!1,-1)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=r;s>=o;s--)a=this.gs(s,0,!1,0)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,0,!1,0)||a;n>=t?this.ns(e):(t=n,e=this.ie())}}this.ns(e)}lk(t,e){Ht,Kt.r(t,Ni,"medianBarycenterCrossingReduction:unfixedLayer"),Kt.r(e,Ni,"medianBarycenterCrossingReduction:direction");let i=0,s=!1;var n,a=this.Vh(t),r=this.yi[t],o=this.tD(t,e),l=this.Jy(t,e);for(i=0;iw+1&&(t+=4*(u-w),e+=4*(u-(w+1)))}}var I=y[w].destinationEdges.iterator;if(p&&0<=v)for(;I.next();){var V=I.value;d=V.toVertex,V.valid&&d.layer!==f&&(n=this.linkStraightenWeight(V),a=V.portFromColOffset,r=V.portToColOffset,l=d.column,i+=(Math.abs(N+a-(l+r))+1)*n,s+=(Math.abs(F+a-(l+r))+1)*n)}for(I.reset();I.next();){var z=I.value;if(d=z.toVertex,z.valid&&d.layer===f){for(c=0;cw+1&&(t+=4*(u-(w+1)),e+=4*(u-w))}}var H=y[w+1].destinationEdges.iterator;if(p&&0<=v)for(;H.next();){var K=H.value;d=K.toVertex,K.valid&&d.layer!==f&&(n=this.linkStraightenWeight(K),a=K.portFromColOffset,r=K.portToColOffset,l=d.column,i+=(Math.abs(L+a-(l+r))+1)*n,s+=(Math.abs(B+a-(l+r))+1)*n)}for(H.reset();H.next();){var Y=H.value;if(d=Y.toVertex,Y.valid&&d.layer===f){for(c=0;c>1)+8*e}this.Wt*=8}if(2&this.cr){e=!0;let t=0;for(;e&&tw+this.nodeMinColumnSpace(m[g-1],!1)?x-1:x,0),i=(e=g+1>=f||m[g+1].column-x-1>A+this.nodeMinColumnSpace(m[g+1],!0)?x+1:x,0),s=0,n=0,a=0,r=0,o=0;if(c<=0)for(var P=m[g].sourceEdges.iterator;P.next();){var k=P.value,S=k.fromVertex;k.valid&&S.layer!==d&&(a=this.linkStraightenWeight(k),r=k.portFromColOffset,o=k.portToColOffset,k=S.column,i+=(Math.abs(x+o-(k+r))+1)*a,s+=(Math.abs(t+o-(k+r))+1)*a,n+=(Math.abs(e+o-(k+r))+1)*a)}if(0<=c)for(var M=m[g].destinationEdges.iterator;M.next();){var C=M.value,N=C.toVertex;C.valid&&N.layer!==d&&(a=this.linkStraightenWeight(C),r=C.portFromColOffset,o=C.portToColOffset,C=N.column,i+=(Math.abs(x+r-(C+o))+1)*a,s+=(Math.abs(t+r-(C+o))+1)*a,n+=(Math.abs(e+r-(C+o))+1)*a)}let l=0,h=0,u=0;w=p[m[g].index],A=v[m[g].index];-1!==w&&(l+=Math.abs(w-x),h+=Math.abs(w-t),u+=Math.abs(w-e)),-1!==A&&(l+=Math.abs(A-x),h+=Math.abs(A-t),u+=Math.abs(A-e)),s=l[a]?t=n:s<=l[a]&&(t=s)),t!==d&&(h=!0,u=!0,r[a].column=t)}return this.Bh(t,r),this.jy(),h}x3(){for(let t=0;t<=this.Wt;t++)for(;this.b3(t,1););this.jy()}b3(t,e){Ht,Kt.r(t,Ni,"packAux:column"),Kt.r(e,Ni,"packAux:direction");let i=!0;for(var s=this.network.vertexes.iterator;s.next();){var n=s.value,a=this.nodeMinColumnSpace(n,!0),r=this.nodeMinColumnSpace(n,!1);if(n.column-a<=t&&n.column+r>=t){i=!1;break}}let o=!1;if(i){if(0t&&(--l.column,o=!0)}if(e<0)for(s.reset();s.next();){var h=s.value;h.column=i&&(a[o.layer]=!0)}let u=!0,d=!1;for(s=0;s<=this.Lt;s++)u=u&&!(n[s]&&a[s]);if(u){if(0t&&(--c.column,d=!0)}if(e<0)for(r.reset();r.next();){var g=r.value;g.columns?this.ns(i):as?this.ns(i):a=t&&(n.component=this.rn)}for(this.rn++,e.reset();e.next();){var a=e.value;-1===a.component&&(this.KN(a,this.rn,-1,!0,!0),this.rn++)}let r=0;var o=[];for(r=0;r{var e=Kt.ct(),i=(h&&e.push(a.get(t)),u&&e.push(r.get(t)),d&&e.push(o.get(t)),c&&e.push(l.get(t)),e.sort((t,e)=>t-e),e.length),s=Math.floor((i-1)/2),i=Math.ceil((i-1)/2),s=(e[s]+e[i])/2;Kt.ot(e),t.pe=s})}M3(e,n){var i=e.length;for(let t=1;tt)&&n.add(u)}s++}i=t}}}}N3(t){if(null===t.node){t=t.getProperSourceVertexes();if(0t.zh-e.zh);r=(r-1)/2;for(let e=Math.floor(r),t=Math.ceil(r);e<=t;e++)if(l.Kn===l){var o=a[e];let t;t=n?o.getDestinationEdge(l):l.getDestinationEdge(o),!s.contains(t)&&i{o.set(t.key,t.value+l)})}}Kt.ot(n),Kt.ot(a)}L3(t,e,i,s){if(!t||0===t.count)return e[s]=0,1/(i[s]=0);let n=1/0,a=-1/0;return t.each(t=>{var e=t.key,t=t.value,e=90===this.C||270===this.C?e.width:e.height;ta&&(a=t+e)}),e[s]=n,(i[s]=a)-n}commitLayout(){this.qy(),this.commitNodes(),this.HN(),this.isRouting&&this.commitLinks()}qy(){if(this.setsPortSpots)for(var t=this.rk(!0),e=this.rk(!1),i=this.network.edges.iterator;i.next();){var s=i.value.link;null!==s&&(s.fromSpot=t,s.toSpot=e)}}rk(t){return 270===this.C?t?Z.MiddleTop:Z.MiddleBottom:90===this.C?t?Z.MiddleBottom:Z.MiddleTop:180===this.C?t?Z.MiddleLeft:Z.MiddleRight:t?Z.MiddleRight:Z.MiddleLeft}commitNodes(){this.on=[],this.Rs=[],this.Is=[],this.Gt=[];for(let t=0;t<=this.Lt;t++)this.on[t]=0,this.Rs[t]=0,this.Is[t]=0,this.Gt[t]=0;for(var i=this.network.vertexes.iterator;i.next();){var t=i.value,e=t.layer;this.on[e]=Math.max(this.on[e],this.nodeMinLayerSpace(t,!0)),this.Rs[e]=Math.max(this.Rs[e],this.nodeMinLayerSpace(t,!1))}let s=0;var n=this.Ds;for(let e=0;e<=this.Lt;e++){let t=n;this.on[e]+this.Rs[e]<=0&&(t=0),0=y.bounds.bottom?(e=y.bounds.y+y.bounds.height,b.insertPointAt(s++,l,e+c),b.insertPointAt(s++,l,e),b.insertPointAt(s++,l,e-d)):(b.insertPointAt(s++,l,h+c),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h-d)):270===this.C?h<=y.bounds.y?(e=y.bounds.y,b.insertPointAt(s++,l,e-d),b.insertPointAt(s++,l,e),b.insertPointAt(s++,l,e+c)):(b.insertPointAt(s++,l,h-d),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h+c)):0===this.C&&(l>=y.bounds.right?(e=y.bounds.x+y.bounds.width,b.insertPointAt(s++,e+c,h),b.insertPointAt(s++,e,h),b.insertPointAt(s++,e-d,h)):(b.insertPointAt(s++,l+c,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l-d,h)));else{b.insertPointAt(s++,r,o);let t=0;180===this.C||0===this.C?((180===this.C?l>=y.bounds.right:l<=y.bounds.x)&&(t=(0===this.C?-d:c)/2),b.insertPointAt(s++,r+t,h)):((270===this.C?h>=y.bounds.bottom:h<=y.bounds.y)&&(t=(90===this.C?-d:c)/2),b.insertPointAt(s++,l,o+t)),b.insertPointAt(s++,l,h)}else d=Math.max(10,this.on[n.layer]),c=Math.max(10,this.Rs[n.layer]),t?180===this.C?(b.insertPointAt(s++,l-d-S,h),b.insertPointAt(s++,Math.min(l-d+S/2,l),h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,Math.max(l+c-S/2,l),h),b.insertPointAt(s++,l+c+S,h)):90===this.C?(b.insertPointAt(s++,l,h+c+S),b.insertPointAt(s++,l,Math.max(h+c-S/2,h)),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,Math.min(h-d+S/2,h)),b.insertPointAt(s++,l,h-d-S)):270===this.C?(b.insertPointAt(s++,l,h-d-S),b.insertPointAt(s++,l,Math.min(h-d+S/2,h)),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,Math.max(h+c-S/2,h)),b.insertPointAt(s++,l,h+c+S)):(b.insertPointAt(s++,l+c+S,h),b.insertPointAt(s++,Math.max(l+c-S/2,l),h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,Math.min(l-d+S/2,l),h),b.insertPointAt(s++,l-d-S,h)):(180!==this.C&&90!==this.C&&this.C,b.insertPointAt(s++,l,h));y=n}if(null===p||A!==Z.None||i)if(r=b.getPoint(s-1).x,o=b.getPoint(s-1).y,l=b.getPoint(s).x,h=b.getPoint(s).y,i){var N=this.Rs[v.layer];let t=0;180===this.C||0===this.C?((t=o)>=v.bounds.y&&t<=v.bounds.bottom&&(180===this.C?l>=v.bounds.x:l<=v.bounds.right)&&(e=v.centerX+(180===this.C?-N:N),t=t=v.bounds.x&&t<=v.bounds.right&&(270===this.C?h>=v.bounds.y:h<=v.bounds.bottom)&&(e=v.centerY+(270===this.C?-N:N),t=t=v.bounds.x?(e=v.bounds.x+v.bounds.width,b.setPointAt(s-2,e,o),b.setPointAt(s-1,e+c,o)):90===this.C&&h<=v.bounds.bottom?(e=v.bounds.y,b.setPointAt(s-2,r,e),b.setPointAt(s-1,r,e-d)):270===this.C&&h>=v.bounds.y?(e=v.bounds.y+v.bounds.height,b.setPointAt(s-2,r,e),b.setPointAt(s-1,r,e+c)):0===this.C&&l<=v.bounds.right&&(e=v.bounds.x,b.setPointAt(s-2,e,o),b.setPointAt(s-1,e-d,o));else{d=Math.max(10,this.on[v.layer]),c=Math.max(10,this.Rs[v.layer]);let t=0;180===this.C||0===this.C?((180===this.C?l<=v.bounds.x:l>=v.bounds.right)&&(t=(0===this.C?c:-d)/2),b.insertPointAt(s++,l+t,o)):((270===this.C?h<=v.bounds.y:h>=v.bounds.bottom)&&(t=(90===this.C?c:-d)/2),b.insertPointAt(s++,r,h+t)),b.insertPointAt(s++,l,h)}}else{for(;null!==v&&v!==y;){n=null,a=null;for(var L=v.destinationEdges.iterator;L.next();){var D=L.value;if(D.link===x.link&&(n=D.toVertex,null!==(a=D.fromVertex).node&&(a=null),null===n.node))break}if(null===n)break;n!==y&&(r=b.getPoint(s-1).x,o=b.getPoint(s-1).y,l=n.centerX,h=n.centerY,i?180===this.C||0===this.C?(null!==a?a.centerY:o)!==h&&(u=this.Gt[n.layer]+this.ur.x,s===b.firstPickIndex+1&&(u=0===this.C?Math.max(u,r):Math.min(u,r)),b.insertPointAt(s++,u,o),b.insertPointAt(s++,u,h)):(null!==a?a.centerX:r)!==l&&(u=this.Gt[n.layer]+this.ur.y,s===b.firstPickIndex+1&&(u=90===this.C?Math.max(u,o):Math.min(u,o)),b.insertPointAt(s++,r,u),b.insertPointAt(s++,l,u)):(d=Math.max(10,this.on[n.layer]),c=Math.max(10,this.Rs[n.layer]),t?180===this.C?(b.insertPointAt(s++,l+c+S,h),b.insertPointAt(s++,Math.max(l+c-S/2,l),h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,Math.min(l-d+S/2,l),h),b.insertPointAt(s++,l-d-S,h)):90===this.C?(b.insertPointAt(s++,l,h-d-S),b.insertPointAt(s++,l,Math.min(h-d+S/2,h)),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,Math.max(h+c-S/2,h)),b.insertPointAt(s++,l,h+c+S)):270===this.C?(b.insertPointAt(s++,l,h+c+S),b.insertPointAt(s++,l,Math.max(h+c-S/2,h)),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,Math.min(h-d+S/2,h)),b.insertPointAt(s++,l,h-d-S)):(b.insertPointAt(s++,l-d-S,h),b.insertPointAt(s++,Math.min(l-d+S/2,l),h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,Math.max(l+c-S/2,l),h),b.insertPointAt(s++,l+c+S,h)):180===this.C?(b.insertPointAt(s++,l+c,h),b.insertPointAt(s++,l-d,h)):90===this.C?(b.insertPointAt(s++,l,h-d),b.insertPointAt(s++,l,h+c)):270===this.C?(b.insertPointAt(s++,l,h+c),b.insertPointAt(s++,l,h-d)):(b.insertPointAt(s++,l-d,h),b.insertPointAt(s++,l+c,h)))),v=n}i&&(r=b.getPoint(s-1).x,o=b.getPoint(s-1).y,l=b.getPoint(s).x,h=b.getPoint(s).y,180===this.C||0===this.C?o!==h&&(u=0===this.C?Math.min(Math.max((l+r)/2,this.Gt[y.layer]+this.ur.x),l):Math.max(Math.min((l+r)/2,this.Gt[y.layer]+this.ur.x),l),b.insertPointAt(s++,u,o),b.insertPointAt(s++,u,h)):r!==l&&(u=90===this.C?Math.min(Math.max((h+o)/2,this.Gt[y.layer]+this.ur.y),h):Math.max(Math.min((h+o)/2,this.Gt[y.layer]+this.ur.y),h),b.insertPointAt(s++,r,u),b.insertPointAt(s++,l,u)))}null!==w&&t&&4<=b.pointsCount&&(null!==f&&(k=A===Z.None?b.getLinkPointFromPoint(g,f,f.getDocumentPoint(Z.Center),b.getPoint(3),!0):b.getPoint(0),A===Z.None&&(w=b.getPoint(2),A=b.getPoint(3),90===this.direction||270===this.direction?(b.setPointAt(1,(k.x+w.x)/2,w.y),b.setPointAt(2,A.x,(w.y+A.y)/2)):(b.setPointAt(1,w.x,(k.y+w.y)/2),b.setPointAt(2,(w.x+A.x)/2,A.y))),k.isReal()||k.set(g.actualBounds.center),b.setPointAt(0,k.x,k.y)),null!==p)&&(w=P===Z.None?b.getLinkPointFromPoint(m,p,p.getDocumentPoint(Z.Center),b.getPoint(b.pointsCount-4),!1):b.getPoint(b.pointsCount-1),P===Z.None&&(A=b.getPoint(b.pointsCount-3),P=b.getPoint(b.pointsCount-4),90===this.direction||270===this.direction?(b.setPointAt(b.pointsCount-2,(w.x+A.x)/2,A.y),b.setPointAt(b.pointsCount-2,P.x,(A.y+P.y)/2)):(b.setPointAt(b.pointsCount-2,A.x,(w.y+A.y)/2),b.setPointAt(b.pointsCount-3,(A.x+P.x)/2,P.y))),w.isReal()||w.set(m.actualBounds.center),b.setPointAt(b.pointsCount-1,w.x,w.y)),b.commitRoute(),x.commit()}}}}ZO(){this.Wy=-1,this.Eg=0,this.Fs=0,this.sf=null,this.Bg=null,this.tu=null;for(let t=0;t=this.Xn.length){var s=[];for(let t=0;t{var e;return t instanceof D?!t.isLinkLabel&&"Comment"!==t.category:t instanceof Y&&null!==(e=t.fromNode)&&!e.isLinkLabel&&"Comment"!==e.category&&!(null===(e=t.toNode)||e.isLinkLabel||"Comment"===e.category)};return t instanceof q?(e.addParts(t.nodes,!0,i),e.addParts(t.links,!0,i)):t instanceof X?e.addParts(t.memberParts,!1,i):e.addParts(t.iterator,!1,i),e}doLayout(t){Ht,null===t&&Kt.n("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"),null===this.network&&(this.network=this.makeNetwork(t)),52!==this.arrangement&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));let e=this.diagram;null===e&&t instanceof q&&(e=t),0===this.path&&null!==e?this.ms=e.isTreePathToChildren?1:2:this.ms=0===this.path?1:this.path,0t.level||(this.Y3(e.parent,e),0))}X3(t,e){if(null===e)return!1;Ht,Kt.s(t,et,tt,"isAncestor:a"),Ht,Kt.s(e,et,tt,"isAncestor:b");let i=e.parent;for(;null!==i&&i!==t;)i=i.parent;return i===t}Y3(t,s){if(null!==t&&null!==s){Ht,Kt.s(t,et,tt,"removeChild:p"),Ht,Kt.s(s,et,tt,"removeChild:c");var n=t.children;let i=0;for(let t=0;tk&&(ak&&(rt&&(t=s+e.width),s<0&&(t-=s),t;case 22:return e.width>i?e.width:i;case 23:return 2*e.focus.x>i?e.width:i+e.width-2*e.focus.x;case 24:case 25:var n=Math.min(0,s),a=Math.max(i,s+e.width);return Math.max(e.width,a-n);case 26:return e.width-e.focus.x+e.nodeSpacing/2+i;case 27:return Math.max(e.width,e.focus.x+e.nodeSpacing/2+i);default:return i}}JN(e,i,s){switch(Ht,Kt.s(e,et,tt,"calculateSubheight:v"),e.alignment){case 21:case 20:let t=i;return s+e.height>t&&(t=s+e.height),s<0&&(t-=s),t;case 22:return e.height>i?e.height:i;case 23:return 2*e.focus.y>i?e.height:i+e.height-2*e.focus.y;case 24:case 25:var n=Math.min(0,s),a=Math.max(i,s+e.height);return Math.max(e.height,a-n);case 26:return e.height-e.focus.y+e.nodeSpacing/2+i;case 27:return Math.max(e.height,e.focus.y+e.nodeSpacing/2+i);default:return i}}ZN(t,e,i){switch(Ht,Kt.it(t,Ei,"TreeAlignment"),t){case 20:case 21:e/=2,i/=2;break;case 22:i=e=0;break;case 23:break;default:Kt.n("Unhandled alignment value "+t.toString())}return new _(e,i)}of(t,e,i,s,n,a){Ht,Kt.s(t,et,tt,"shiftRelPosAlign:v"),Ht,Kt.it(e,Ei,"TreeAlignment");e=this.ZN(e,i,s);this.ru(t,e.x,e.y,n,a)}ru(t,e,i,s,n){if(Ht,Kt.s(t,et,tt,"shiftRelPos:v"),0!==e||0!==i){var a=t.children;for(let t=s;t<=n;t++){var r=a[t].X;r.x+=e,r.y+=i}}}wk(t,e,i){Ht,Kt.s(t,et,tt,"recordMidPoints:v"),Kt.t(e,"number",tt,"recordMidPoints:x"),Kt.t(i,"number",tt,"recordMidPoints:y");var s=t.parent;switch(this.ms){case 1:for(var n=t.sourceEdges;n.next();){var a=n.value;a.fromVertex===s&&a.relativePoint.e(e,i)}break;case 2:for(var r=t.destinationEdges;r.next();){var o=r.value;o.toVertex===s&&o.relativePoint.e(e,i)}break;default:Kt.n("Unhandled path value "+this.ms.toString())}}U3(A){if(Ht,Kt.s(A,et,tt,"layoutTreeBlock:v"),0===A.childrenCount){var P=A.parent;let t=!1,e=0,i;null!==P&&(e=P.angle,i=P.alignment,t=this.isBusAlignment(i));P=this.WN(A);A.X.e(0,0),A.kt.e(A.width,A.height),null===A.parent||null===A.comments||(180!==e&&270!==e||t)&&!P?A.ht.e(0,0):180===e&&!t||(90===e||270===e)&&P?A.ht.e(A.width-2*A.focus.x,0):A.ht.e(0,A.height-2*A.focus.y),A.Yg=null,void(A.Kg=null)}else{var k=this.orthoAngle(A),S=90===k||270===k;let i=0;var M=A.children,C=M.length;for(let t=0;tB&&(uB&&(ds&&(P=this.ZN(L,V-s,0),y=P.x,b=P.y,s=V,p=0):s=this.jN(A,s,p),p<0&&(y-=p,p=0),135n&&(D=this.ZN(L,0,z-n),y=D.x,b=D.y,n=z,v=0):n=this.JN(A,n,v),v<0&&(b-=v,v=0),y+=V+F);let x,w;if(0x[0].x?x[2].c(x[1]):x[1].c(x[2])),x[3].yx[0].x?x[3].c(x[2]):x[2].c(x[3])),w[0].e(p+V,0),w[1].e(w[0].x,z),w[2].yx[0].y?x[2].c(x[1]):x[1].c(x[2])),x[3].xx[0].y?x[3].c(x[2]):x[2].c(x[3])),w[0].e(0,v+z),w[1].e(V,w[0].y),w[2].xh;){var u=e[a++];s[r++].e(u.x,u.y+i)}var d=this.ye(r);for(n=0;nh;){var u=e[a++];s[r++].e(u.x+i,u.y)}var d=this.ye(r);for(n=0;nh;){var u=t[n++];s[r++].e(u.x,u.y)}var d=this.ye(r);for(n=0;nh;){var u=t[n++];s[r++].e(u.x,u.y)}var d=this.ye(r);for(n=0;ng&&d.xd.x&&gm&&d.yd.y&&mm.y+n.rowIndent&&(s=Math.min(s,Math.max(e.y,s-r.computeNodeIndent(n))))):22===n.alignment?(s=l.top+o.y,0===o.y&&e.ym.x+n.rowIndent&&(s=Math.min(s,Math.max(e.x,s-r.computeNodeIndent(n))))):22===n.alignment?(s=l.left+o.x,0===o.x&&e.xm.y+n.rowIndent&&(s=Math.min(s,Math.max(e.y,s-r.computeNodeIndent(n))))):22===n.alignment?(s=l.top+o.y,0===o.y&&e.ym.x+n.rowIndent&&(s=Math.min(s,Math.max(e.x,s-r.computeNodeIndent(n))))):22===n.alignment?(s=l.left+o.x,0===o.x&&e.x{t=t.matches?"dark":"light";t!==this.Ug&&(this.Ug=t,"system"===this.Dk)&&this.pw()};constructor(t){t&&Object.assign(this,t),t?.themeMap||(this.lu.set("light",{colors:{...Gi.Light.colors},fonts:{...Gi.Light.fonts},numbers:{...Gi.Light.numbers},margins:{...Gi.Light.margins},arrowheads:{...Gi.Light.arrowheads}}),this.lu.set("dark",{colors:{...Gi.Dark.colors},fonts:{...Gi.Dark.fonts},numbers:{...Gi.Dark.numbers},margins:{...Gi.Dark.margins},arrowheads:{...Gi.Dark.arrowheads}})),v.matchMedia&&(this.Ug=v.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}get themeMap(){return this.lu}set themeMap(t){this.lu!==t&&(this.lu=t,this.pw())}get defaultTheme(){return this.Tk}set defaultTheme(t){this.Tk!==t&&(Kt.t(t,"string",ji,"defaultTheme"),this.Tk=t,this.pw())}get currentTheme(){return this.Dk}set currentTheme(t){this.Dk!==t&&(Kt.t(t,"string",ji,"currentTheme"),this.Dk=t,this.pw())}get changesDivBackground(){return this.Fk}set changesDivBackground(t){if(this.Fk!==t&&(this.Fk=t))for(const e of this.as)e.setDivBackground(this.findValue("div","","fill")),e.V("ThemeChanged",this)}get preferredColorScheme(){return this.Ug}addDiagram(t){return this.as.add(t),this.QN(t),this}removeDiagram(t){return this.as.delete(t),this.QN(t),this}qF(){0===this.as.size&&v.matchMedia&&v.matchMedia("(prefers-color-scheme: dark)")?.addEventListener("change",this.LD)}WF(){0===this.as.size&&v.matchMedia&&v.matchMedia("(prefers-color-scheme: dark)")?.removeEventListener("change",this.LD)}set(t,e){"system"===(t=""===t?this.Tk:t)&&(t=this.Ug);let i=this.lu.get(t);return i=i?this.TD(i,e):e,this.lu.set(t,i),this.pw(),this}findValue(t,e,i){return this.getValue(this.findTheme(this.currentTheme),t,e,i)||this.getValue(this.findTheme(this.defaultTheme),t,e,i)}getValue(t,e,i,n){if(t){null==i&&(i="");let s=t;const r=t=>{if(void 0!==s&&""!==t){if("number"==typeof t||!Array.isArray(t)&&!t.includes("."))return s[t];var e=Array.isArray(t)?t:t.split(".");for(let t=0;t{if(""===i||void 0!==(s=r(i)))return s=Array.isArray(s)&&"number"==typeof e?s[e%s.length]:r(e)};if(void 0===(s=o())&&"string"==typeof n&&0=Ge.qd&&(l.GA(),f.inflate(l.cellWidth*l.zP,l.cellHeight*l.XP),l.fT(e,i,s,n,f,!1),p=l._i(s.x,s.y)),!l.Cy&&pGe.xo&&n._i(d,c)!==l-1&&(n._i(h-r,u)===l-1?(a=180,d=h-r,c=u):n._i(h+r,u)===l-1?(a=0,d=h+r,c=u):n._i(h,u-o)===l-1?(a=270,d=h,c=u-o):n._i(h,u+o)===l-1&&(a=90,d=h,c=u+o));l>Ge.xo&&n._i(d,c)===l-1;)h=d,u=c,0===a?d+=r:90===a?c+=o:180===a?d-=r:c-=o,--l;if(i?l>Ge.xo&&(180===a||0===a?h=Math.floor(h/r)*r+r/2:90!==a&&270!==a||(u=Math.floor(u/o)*o+o/2)):(h=Math.floor(h/r)*r+r/2,u=Math.floor(u/o)*o+o/2),l>Ge.xo){let i=a,t=h,e=u;if(0===a?(i=90,e+=o):90===a?(i=180,t-=r):180===a?(i=270,e-=o):270===a&&(i=0,t+=r),n._i(t,e)===l-1)this.vd(s,n,t,e,i,!1);else{let t=h,e=u;0===a?(i=270,e-=o):90===a?(i=0,t+=r):180===a?(i=90,e+=o):270===a&&(i=180,t-=r),n._i(t,e)===l-1&&this.vd(s,n,t,e,i,!1)}}s.insertPointAt(s.pointsCount-2,h,u)}}st.prototype.initializeStandardTools=function(){this.ii("Action",new ct,this.mouseDownTools),this.ii("Relinking",new ot,this.mouseDownTools),this.ii("LinkReshaping",new lt,this.mouseDownTools),this.ii("Rotating",new ut,this.mouseDownTools),this.ii("Resizing",new ht,this.mouseDownTools),this.ii("Linking",new rt,this.mouseMoveTools),this.ii("Dragging",new d,this.mouseMoveTools),this.ii("DragSelecting",new mt,this.mouseMoveTools),this.ii("Panning",new ft,this.mouseMoveTools),this.ii("ContextMenu",new yt,this.mouseUpTools),this.ii("TextEditing",new At,this.mouseUpTools),this.ii("ClickCreating",new gt,this.mouseUpTools),this.ii("ClickSelecting",new dt,this.mouseUpTools)},q.xP("GraphLinksModel",ii),q.xP("TreeModel",si);var n=v.go,a={get version(){return q.version},Group:X,List:O,Set:N,Map:L,Point:_,Size:Yt,Rect:Q,Margin:I,Spot:Z,Geometry:W,PathFigure:S,PathSegment:A,InputEvent:C,DiagramEvent:B,ChangedEvent:E,Model:b,GraphLinksModel:oi,TreeModel:li,Binding:ai,ThemeBinding:ri,Transaction:R,UndoManager:U,CommandHandler:qt,Tool:J,DraggingTool:d,DraggingInfo:Et,DraggingOptions:Ot,LinkingBaseTool:nt,LinkingTool:rt,RelinkingTool:ot,LinkReshapingTool:lt,ResizingTool:ht,RotatingTool:ut,ClickSelectingTool:dt,ActionTool:ct,ClickCreatingTool:gt,HTMLInfo:pt,ContextMenuTool:yt,DragSelectingTool:mt,PanningTool:ft,TextEditingTool:At,ToolManager:st,Animation:St,AnimationManager:kt,AnimationTrigger:Nt,Layer:Lt,Diagram:q,Palette:It,Overview:Vt,Brush:m,GraphObject:y,Panel:Xt,RowColumnDefinition:we,Shape:G,TextBlock:j,Picture:Le,Part:H,Adornment:K,Node:D,Link:Y,Placeholder:Xe,Layout:Ue,LayoutNetwork:_e,LayoutVertex:We,LayoutEdge:Qe,GridLayout:ti,PanelLayout:se,CircularLayout:gi,CircularNetwork:fi,CircularVertex:pi,CircularEdge:vi,ForceDirectedLayout:yi,ForceDirectedNetwork:bi,ForceDirectedVertex:xi,ForceDirectedEdge:wi,LayeredDigraphLayout:Ni,LayeredDigraphNetwork:Li,LayeredDigraphVertex:Di,LayeredDigraphEdge:Ti,TreeLayout:tt,TreeNetwork:zi,TreeVertex:et,TreeEdge:qi,Themes:Gi,ThemeManager:ji,Router:Hi,AnimationStyle:Pt,AutoScale:Dt,CycleMode:Tt,Flip:Ut,TextFormat:Se,ImageStretch:Ne,LayoutConditions:a,LinkAdjusting:Ie,Curve:ze,Routing:Ve,Orientation:jt,TextOverflow:ke,PortSpreading:Re,ScrollMode:Bt,CollapsePolicy:e,Sizing:xe,TriggerStart:Ct,Stretch:Gt,ViewboxStretch:pe,Wrap:Pe,BrushType:ee,ColorSpace:i,GeometryStretch:k,GeometryType:P,SegmentType:M,BindingMode:ni,ChangeType:F,CircularArrangement:hi,CircularDirection:ui,CircularNodeDiameterFormula:ci,CircularSorting:di,GridAlignment:Ze,GridArrangement:Je,GridSorting:$e,LayeredDigraphAggressive:Ci,LayeredDigraphAlign:Pi,LayeredDigraphCycleRemove:ki,LayeredDigraphInit:Mi,LayeredDigraphLayering:Si,LayeredDigraphPack:s,TreeAlignment:Ei,TreeArrangement:Ii,TreeCompaction:Ri,TreeLayerStyle:Vi,TreePath:Bi,TreeSorting:Fi,TreeStyle:Oi,GestureMode:it,LinkingDirection:at,ReshapingBehavior:t,TextEditingAccept:bt,TextEditingStarting:xt,TextEditingState:wt,WheelMode:$};"object"==typeof n&&n.version&&Kt.ft("WARNING: a `go` object on the root object is already defined. "+("Debug"in n?"debug ":"")+"version: "+n.version+", replaced with version: "+a.version),q.prototype.go=a,((v.go=a).Debug=Ht).attachReadonlyWarnings(a)}(),"function"==typeof define&&define.amd&&define(("undefined"!=typeof global?global:self).go),"undefined"!=typeof module&&"object"==typeof module.exports&&(module.exports=("undefined"!=typeof global?global:self).go);const bino=go;class TopLeftBorderRadius extends bino.Shape{constructor(){super(),this._figure="TopLeftBorderRadius"}makeGeometry(){var t=new bino.Geometry,e=new bino.PathFigure(0,0,!0);return e.add(new bino.PathSegment(bino.PathSegment.Line,0,6)),e.add(new bino.PathSegment(bino.PathSegment.Arc,180,90,6,6,6,6)),t.add(e),t}}bino.Shape.defineFigureGenerator("TopLeftBorderRadius",t=>{return(new TopLeftBorderRadius).makeGeometry()});class BottomLeftBorderRadius extends bino.Shape{constructor(){super(),this._figure="BottomLeftBorderRadius"}makeGeometry(){var t=new bino.Geometry,e=new bino.PathFigure(0,0,!0);return e.add(new bino.PathSegment(bino.PathSegment.Arc,180,-90,6,0,6,6)),e.add(new bino.PathSegment(bino.PathSegment.Line,0,6)),t.add(e),t}}bino.Shape.defineFigureGenerator("BottomLeftBorderRadius",t=>{return(new BottomLeftBorderRadius).makeGeometry()});var $=bino.GraphObject.make;function addQueryParam(t,e){var i=new URL(window.location);i.searchParams.set(t,e),window.history.replaceState({},"",i)}function removeQueryParam(t){var e=new URL(window.location);e.searchParams.delete(t),window.history.replaceState({},"",e)}function decodeUrlSafeBase64ToUtf8(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4;)e+="=";t=atob(e),t=Uint8Array.from(t,t=>t.charCodeAt(0));return(new TextDecoder).decode(t)}function encodeUtf8ToUrlSafeBase64(t){t=(new TextEncoder).encode(t),t=String.fromCharCode(...t);let e=btoa(t);return e=e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}bino.useNonePhoto=function(t){return!t.hasImage&&!t.living&&null==t.birthDate&&null==t.marriageDate&&null==t.deathDate&&null==t.birthPlace&&null==t.marriagePlace&&null==t.deathPlace},bino.getRelativeDates=function(t,e){if(t.useNonePhoto)return"";var{living:i,birthDate:s,deathDate:n}=t,a=bino.calculateAge(s,n);let r=a;var o=bino.formatDate(t.birthDate,e&&t.living),e=bino.formatDate(t.marriageDate,e&&t.living),l=bino.formatDate(t.deathDate,!1);return o||l||e?o?l?(n.includes("after")?r=s.includes("after")?"~"+a:(s.includes("before")||s.includes("about"),a+"+"):n.includes("before")?r=s.includes("after")?a+"-":s.includes("before")?"~"+a:(s.includes("about"),a+"-"):n.includes("about")?r="~"+a:s.includes("after")?r=a+"-":s.includes("before")?r=a+"+":s.includes("about")&&(r="~"+a),t.deathAge&&(r=t.deathAge),String(r).includes("NaN")?e?o+` — ${e} — `+l:o+" — "+l:e?""+o+` — ${e} — ${l} (${r})`:""+o+` — ${l} (${r})`):(t.deathAge&&(r=t.deathAge),String(r).includes("NaN")?e?o+` — ${e} — `+(i?"Living":"Deceased"):o+" — "+(i?"Living":"Deceased"):e?o+` — ${e} — `+(i?"Living":"Deceased")+(i?` (${r})`:""):o+" — "+(i?"Living":"Deceased")+(i?` (${r})`:"")):(n=t.deathAge?` (${t.deathAge})`:"",e?l?` — ${e} — `+l+n:` — ${e} — `+(i?"Living":"Deceased")+n:" — "+l+n):i?"Living":"Deceased"},bino.convertCountryCode=function(t){if(!t)return t;var e=t.split(",").map(t=>t.trim());t.length<37&&(e[e.length-1]={USA:"United States of America",PHL:"Philippines",BHR:"Bahrain"}[e[e.length-1]]);let i=e.join(", ");return i=44<=i.length&&i.toLowerCase().includes("south caloocan")?i.replace("South Caloocan","S. Caloocan"):i},bino.calculateAge=function(t,e){t=new Date(t),e=e?new Date(e):new Date;let i=e.getFullYear()-t.getFullYear();var s=e.getMonth()-t.getMonth();return(s<0||0==s&&e.getDate()',beautician:'',beer:'',buysell:'',cattle:'',church:'',computer:'',dna:'',farming:'',"female-twin":'',government:'',househusband:'',housewife:'',intelligence:'',investigate:'',justice:'',"male-twin":'',manager:'',manufacturing:'',military:'',police:'',prelations:'',retail:'',sales:'',seaman:'',sergeant:'',software:'',train:'',book:'',fishery:'',skull:'',centennial:''},DARK_MARKERS={apparel:LIGHT_MARKERS.apparel,beautician:LIGHT_MARKERS.beautician,book:LIGHT_MARKERS.book,househusband:LIGHT_MARKERS.househusband,housewife:LIGHT_MARKERS.housewife,retail:LIGHT_MARKERS.retail,"female-twin":LIGHT_MARKERS["female-twin"],"male-twin":LIGHT_MARKERS["male-twin"],centennial:'',train:LIGHT_MARKERS.train.replace("#333333","#EAEAEA"),skull:LIGHT_MARKERS.skull.replace("#333333","#EAEAEA"),beer:LIGHT_MARKERS.beer.replace("#BD5C17","#B3825D"),buysell:LIGHT_MARKERS.buysell.replace("#333333","#EAEAEA"),cattle:LIGHT_MARKERS.cattle.replace("#BD5C17","#B3825D"),church:LIGHT_MARKERS.church.replace("#333333","#EAEAEA"),dna:LIGHT_MARKERS.dna.replace("#9831CF","#B73DF9"),intelligence:LIGHT_MARKERS.intelligence.replace("#4285F4","#4B8FFF"),justice:LIGHT_MARKERS.justice.replace("#4285F4","#4B8FFF"),farming:LIGHT_MARKERS.farming.replace("#259F31","#28BC36"),fishery:LIGHT_MARKERS.fishery.replace("#333333","#EAEAEA"),government:LIGHT_MARKERS.government.replace("#333333","#EDD5BB"),investigate:LIGHT_MARKERS.investigate.replace("#333333","#EAEAEA"),manufacturing:LIGHT_MARKERS.manufacturing.replace("#333333","#EAEAEA"),military:LIGHT_MARKERS.military.replace("#E99E0E","#FFB11B"),police:LIGHT_MARKERS.police.replace("#4285F4","#4B8FFF"),sales:LIGHT_MARKERS.sales.replace("#E99E0E","#FFB11B"),prelations:LIGHT_MARKERS.prelations.replace("#E99E0E","#FFB11B"),computer:LIGHT_MARKERS.computer.replace("#333333","#B6BFBF"),seaman:LIGHT_MARKERS.seaman.replace("#333333","#EAEAEA"),sergeant:LIGHT_MARKERS.sergeant.replace("#E99E0E","#FFB11B"),software:LIGHT_MARKERS.software.replace("#333333","#FFFFFF"),manager:LIGHT_MARKERS.manager.replace("#333333","#FFFFFF")};let MARKERS={};for(const[uS1,vS1]of Object.entries(isDark?DARK_MARKERS:LIGHT_MARKERS))MARKERS[uS1]="data:image/svg+xml;base64,"+btoa(vS1);var TREE_DATA=[{baptismDate:null,birthDate:"2025-03-15",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"80378400",lastName:"Argabioso",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Adanza",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Yeusef Loran",fid:"G1Q7-J85",height:0,width:0,paternal_siblings:[],father:"85203214",maternal_siblings:[],mother:"16057808",regular_siblings:[]},{baptismDate:"1995-05-27",birthDate:"1995-04-19",birthPlace:"Chinese General Hospital, Manila, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!0,hasImage:!0,key:"85203214",lastName:"Argabioso",living:!0,livingPlace:"Sangandaan, South Caloocan, PHL",marriageDate:"2024-06-15",marriagePlace:"St. John Bosco Parish Church, Makati, PHL",middleName:"Acosta",nickname:"Bino",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Arbyn",baptismPlace:"San Roque Cathedral Parish, South Caloocan, PHL",marker:"computer",marker3:"software",fid:"GQX8-CQP",child:"80378400",paternal_siblings:["70275697"],father:"50954818",maternal_siblings:["21719634","41448711"],mother:"50342947",regular_siblings:[]},{baptismDate:null,birthDate:"1965-10-09",birthPlace:"Maternity House, Poblacion, South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!0,hasImage:!0,key:"50954818",lastName:"Argabioso",living:!0,livingPlace:"Malolos, Bulacan, PHL",marriageDate:"2002-04-26",marriagePlace:"Regional Trial Court BR 226, Quezon City, PHL",middleName:"Saplala",nickname:"Olan",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Rolando",marker:"government",marker3:"justice",marker4:"prelations",fid:"GQJK-L51",child:"85203214",paternal_siblings:[],father:"96832424",maternal_siblings:[],mother:"82099124",regular_siblings:["4793299","48615922"]},{baptismDate:null,birthDate:"1932-10-13",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"2020-02-27",deathPlace:"Manila Memorial Park, Plaridel, Bulacan, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"96832424",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:"1963-01-23",marriagePlace:"Luisiana, Laguna, PHL",middleName:"Mia",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Marcial",marker:"beer",marker2:"prelations",fid:"GQJK-LCT",child:"50954818",paternal_siblings:[],father:"79164376",maternal_siblings:[],mother:"53221118",regular_siblings:["7663556","36448299","21653420","85278460"]},{baptismDate:null,birthDate:"about 1895",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"1972-10-27",deathPlace:"Municipal Cemetery, Majayjay, Laguna, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"79164376",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Lopecillo",nickname:"Bio",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Eusebio",marker:"farming",fid:"GHBZ-TM4",child:"96832424",maternal_siblings:["52063403","83646651"],mother:"17601526",paternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"about 1861",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"1951-08-30",deathPlace:"Catholic Cemetery, Majayjay, Laguna, PHL",gender:"F",hasDNA:!1,hasImage:!1,key:"17601526",lastName:"Lopecillo",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Estebana",fid:"GHB8-RCH",child:"79164376",paternal_siblings:[],father:"24157287",maternal_siblings:[],mother:"1093684",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"24157287",lastName:"Lopecillo",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Simplicio",fid:"G2HQ-YQS",child:"17601526",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"1093684",lastName:"Villarubin",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Gregoria",fid:"G2H7-Q75",child:"17601526",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"before 1910",birthPlace:null,deathAge:null,deathDate:"after 1936-10-13",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"53221118",lastName:"Mia",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Francisca",fid:"GHBZ-P5Q",child:"96832424",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1944-11-24",birthPlace:"San Rafael, Baruya, Lubao, Pampanga, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!0,hasImage:!0,key:"82099124",lastName:"Saplala",living:!0,livingPlace:"Malolos, Bulacan, PHL",marriageDate:"1963-01-23",marriagePlace:"Luisiana, Laguna, PHL",middleName:"Perez",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Lydia",marker:"retail",marker3:"sales",fid:"GHBZ-YVX",child:"50954818",paternal_siblings:[],father:"78763160",maternal_siblings:[],mother:"25174592",regular_siblings:["31493676","46768390"]},{baptismDate:null,birthDate:"1916-05-30",birthPlace:"Lubao, Pampanga, PHL",deathAge:null,deathDate:"1993-05-03",deathPlace:"Dinalupihan, Bataan, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"78763160",lastName:"Saplala",living:!1,livingPlace:null,marriageDate:"1937",marriagePlace:"Lubao, Pampanga, PHL",middleName:null,nickname:"Andong",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Fernando",marker:"military",marker2:"skull",fid:"GHB8-7T6",child:"82099124",paternal_siblings:[],father:"71728184",maternal_siblings:[],mother:"66525244",regular_siblings:["38373110","40891293"]},{baptismDate:null,birthDate:"before 1892",birthPlace:null,deathAge:null,deathDate:"after 1915-07",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"71728184",lastName:"Saplala",living:!1,livingPlace:null,marriageDate:"1902-09-17",marriagePlace:"Guagua, Pampanga, PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Estanislao",fid:"GNNH-JLM",child:"78763160",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"before 1892",birthPlace:null,deathAge:null,deathDate:"after 1916-05",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"66525244",lastName:"Sison",living:!1,livingPlace:null,marriageDate:"1902-09-17",marriagePlace:"Guagua, Pampanga, PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Adela",fid:"GJJX-1SG",child:"78763160",paternal_siblings:[],father:"12094064",maternal_siblings:[],mother:"14775735",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"12094064",lastName:"Sumangui",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Estanislao",child:"66525244",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"14775735",lastName:"Sison",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Florentina",child:"66525244",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1919-11-16",birthPlace:"Orani, Bataan, PHL",deathAge:null,deathDate:"1986-10-02",deathPlace:"Dinalupihan, Bataan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"25174592",lastName:"Perez",living:!1,livingPlace:null,marriageDate:"1937",marriagePlace:"Lubao, Pampanga, PHL",middleName:null,nickname:"Lucing",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Lucina",marker:"housewife",fid:"GHB8-GZL",child:"82099124",paternal_siblings:[],father:"65750680",maternal_siblings:[],mother:"40517733",regular_siblings:[]},{baptismDate:null,birthDate:"before 1913",birthPlace:null,deathAge:null,deathDate:"after 1952",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"65750680",lastName:"Perez",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Victor",marker:"fishery",fid:"GHB8-M8D",child:"25174592",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"40517733",lastName:"Gutierrez",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Genoveba",fid:"GHB8-M86",child:"25174592",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:"1971-09-05",birthDate:"1971-03-10",birthPlace:"The Family Clinic, Sampaloc, Manila, PHL",deathAge:null,deathDate:"2018-05-25",deathPlace:"Municipal Cemetery, Magdalena, Laguna, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"50342947",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:"2003-02-03",marriagePlace:"City Hall, Ermita, Manila, PHL",middleName:"Maramba",nickname:"Babycor",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Corazon",baptismPlace:"San Roque Cathedral Parish, South Caloocan, PHL",marker:"housewife",fid:"GQJK-G8W",child:"85203214",paternal_siblings:[],father:"80469632",maternal_siblings:[],mother:"58601193",regular_siblings:["4256552","77082334"]},{baptismDate:null,birthDate:"1948-07-06",birthPlace:"North General Hospital, España, Manila, PHL",deathAge:null,deathDate:"1979-06-07",deathPlace:"Monterey Park, Los Angeles, California, USA",gender:"M",hasDNA:!1,hasImage:!0,key:"80469632",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:"1966-03-26",marriagePlace:"Knox Methodist Church, Manila, PHL",middleName:"San Agustin",nickname:"Bhoy",prefix:null,suffix:"Jr.",vitalsCompleteAndVerified:!1,firstName:"Manuel",marker:"male-twin",marker2:"seaman",fid:"GHBD-7M4",child:"50342947",paternal_siblings:[],father:"59135880",maternal_siblings:[],mother:"54923824",regular_siblings:["41491264","54340914","12725118","73841862"]},{baptismDate:null,birthDate:"1913-11-10",birthPlace:"Orani, Bataan, PHL",deathAge:null,deathDate:"1994-11-20",deathPlace:"Forest Lawn, Covina, Los Angeles, California, USA",gender:"M",hasDNA:!1,hasImage:!0,key:"59135880",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:"1951-03-05",marriagePlace:"St. Paul's Methodist Church, Tondo, Manila, PHL",middleName:"Bongco",nickname:"Maning",prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Manuel",marker:"police",marker2:"investigate",fid:"GHBD-9L6",child:"80469632",paternal_siblings:[],father:"91699953",maternal_siblings:[],mother:"91567169",regular_siblings:["6375936","64329171"]},{baptismDate:null,birthDate:"about 1871",birthPlace:"Orani, Bataan, PHL",deathAge:null,deathDate:"1948-07-07",deathPlace:"Orani, Bataan, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"91699953",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Ligorio",fid:"GHB8-SQN",child:"59135880",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"before 1903",birthPlace:"Luzon, PHL",deathAge:null,deathDate:"after 1951-03-05",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"91567169",lastName:"Bongco",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Maximiana",fid:"GHB8-5K8",child:"59135880",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1925-12-21",birthPlace:"Philippine General Hospital, Ermita, Manila, PHL",deathAge:null,deathDate:"2008-10-09",deathPlace:"Forest Lawn, Covina, Los Angeles, California, USA",gender:"F",hasDNA:!1,hasImage:!0,key:"54923824",lastName:"San Agustin",living:!1,livingPlace:null,marriageDate:"1951-03-05",marriagePlace:"St. Paul's Methodist Church, Tondo, Manila, PHL",middleName:null,nickname:"Nati",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Natividad",marker:"housewife",fid:"GHB8-DXY",child:"80469632",paternal_siblings:[],father:"79826472",maternal_siblings:[],mother:"45640239",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"79826472",lastName:"San Agustin",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Vicente",fid:"GHB8-LCC",child:"54923824",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"45640239",lastName:null,living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Nena",fid:"GHB8-H7K",child:"54923824",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1943-01-28",birthPlace:"Azcarraga, Binondo, Manila, PHL",deathAge:null,deathDate:"1974-08-10",deathPlace:"Sangandaan Cemetery, South Caloocan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"58601193",lastName:"Maramba",living:!1,livingPlace:null,marriageDate:"1966-03-26",marriagePlace:"Knox Methodist Church, Manila, PHL",middleName:"Dumantay",nickname:"Lina",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Catalina",marker:"housewife",fid:"GHB8-J1B",child:"50342947",paternal_siblings:[],father:"51727808",maternal_siblings:[],mother:"30299840",regular_siblings:["95216770","55618304","42349252","95739264"]},{baptismDate:null,birthDate:"1903-04-22",birthPlace:"Santa Barbara, Pangasinan, PHL",deathAge:null,deathDate:"1969-12-12",deathPlace:"Sangandaan Cemetery, South Caloocan, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"51727808",lastName:"Maramba",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"Luzon, PHL",middleName:"Reyes",nickname:"Sotering",prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Sotero",marker:"police",marker2:"train",fid:"GHB8-GB6",child:"58601193",paternal_siblings:[],father:"51683352",maternal_siblings:[],mother:"50346650",regular_siblings:["28928680","392680","47386677","57182283"]},{baptismDate:null,birthDate:"about 1858",birthPlace:"Santa Barbara, Pangasinan, PHL",deathAge:null,deathDate:"after 1902-06",deathPlace:"Santa Barbara, Pangasinan, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"51683352",lastName:"Maramba",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Bautista",nickname:null,prefix:"Don",suffix:null,vitalsCompleteAndVerified:!1,firstName:"Miguel",marker:"government",fid:"LLQS-641",child:"51727808",paternal_siblings:[],father:"61599560",maternal_siblings:[],mother:"53643498",regular_siblings:["93051591"]},{baptismDate:null,birthDate:"from 1800 to 1858",birthPlace:null,deathAge:null,deathDate:null,deathPlace:"Santa Barbara, Pangasinan, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"61599560",lastName:"Maramba",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"B.",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Guillermo",marker:"sales",marker2:"cattle",fid:"LLQS-6YC",child:"51683352",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"from 1800 to 1858",birthPlace:null,deathAge:null,deathDate:null,deathPlace:"Santa Barbara, Pangasinan, PHL",gender:"F",hasDNA:!1,hasImage:!1,key:"53643498",lastName:"Bautista",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Garcia",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Maria",fid:"L281-614",child:"51683352",paternal_siblings:[],father:"85964364",maternal_siblings:[],mother:"89545654",regular_siblings:[]},{baptismDate:null,birthDate:"from 1735 to 1853",birthPlace:null,deathAge:null,deathDate:"after 1881",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"85964364",lastName:"Bautista",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:"Don",suffix:null,vitalsCompleteAndVerified:!1,firstName:"Agustin",marker:"government",fid:"GC7T-H59",child:"53643498",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"89545654",lastName:"Garcia",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:"Doña",suffix:null,vitalsCompleteAndVerified:!1,firstName:"Felipa",fid:"GC7T-1PK",child:"53643498",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"50346650",lastName:"Reyes",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Novilla",nickname:"Mitcher",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Mercedes",fid:"LLQS-6F1",child:"51727808",paternal_siblings:[],father:"23571091",maternal_siblings:[],mother:"90879248",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"23571091",lastName:"Reyes",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Gregorio",fid:"G7C3-B6P",child:"50346650",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"90879248",lastName:"Novilla",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Leocadia",fid:"G7C3-J9S",child:"50346650",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1918-04-19",birthPlace:"Luzon, PHL",deathAge:null,deathDate:"1990-04-16",deathPlace:"Sangandaan Cemetery, South Caloocan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"30299840",lastName:"Dumantay",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"Luzon, PHL",middleName:null,nickname:"Cresing",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Cresencia",marker:"apparel",marker2:"sales",fid:"GHBD-9LY",child:"58601193",maternal_siblings:[],mother:"78945712",paternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"before 1908",birthPlace:null,deathAge:"50+",deathDate:"after 1918-04-19",deathPlace:"Luzon, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"78945712",lastName:null,living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,fid:"GY85-YPS",firstName:"Unknown name",child:"30299840",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1994-12-16",birthPlace:"Dr. Jose Fabella Memorial Hospital, Manila, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!0,hasImage:!0,key:"16057808",lastName:"Adanza",living:!0,livingPlace:"Sangandaan, South Caloocan, PHL",marriageDate:"2024-06-15",marriagePlace:"St. John Bosco Parish Church, Makati, PHL",middleName:"Ajesta",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Mitchie",marker:"prelations",marker3:"housewife",fid:"GHB5-TWN",child:"80378400",paternal_siblings:[],father:"41741428",maternal_siblings:[],mother:"55859428",regular_siblings:["1031404"]},{baptismDate:null,birthDate:"1964-06-22",birthPlace:"Balingasag, Misamis Oriental, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"41741428",lastName:"Adanza",living:!0,livingPlace:"Sangandaan, South Caloocan, PHL",marriageDate:"1994-01-25",marriagePlace:"Santa Maria, Bulacan, PHL",middleName:"Elican",nickname:"Loloy",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Darne",marker:"manufacturing",marker2:"househusband",marker3:"prelations",fid:"GHB5-XTZ",child:"16057808",paternal_siblings:[],father:"32818992",maternal_siblings:[],mother:"18589217",regular_siblings:["78074094"]},{baptismDate:null,birthDate:"1938-02-26",birthPlace:"Balingasag, Misamis Oriental, PHL",deathAge:null,deathDate:"2018-09-28",deathPlace:"Balingasag, Misamis Oriental, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"32818992",lastName:"Adanza",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"Mindanao, PHL",middleName:"Ladera",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Nestor",marker:"farming",fid:"GH12-SVQ",child:"41741428",paternal_siblings:[],father:"64714771",maternal_siblings:[],mother:"58814600",regular_siblings:[]},{baptismDate:null,birthDate:"about 1909",birthPlace:"Dumaguete, Negros Oriental, PHL",deathAge:null,deathDate:"1990-11-03",deathPlace:"Balingasag, Misamis Oriental, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"64714771",lastName:"Adanza",living:!1,livingPlace:null,marriageDate:"1928-10-06",marriagePlace:"Balingasag, Misamis Oriental, PHL",middleName:"R.",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Felomino",marker:"farming",fid:"GH12-DRN",child:"32818992",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"about 1911",birthPlace:"Mindanao, PHL",deathAge:null,deathDate:"after 1990-11-03",deathPlace:"Balingasag, Misamis Oriental, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"58814600",lastName:"Ladera",living:!1,livingPlace:null,marriageDate:"1928-10-06",marriagePlace:"Balingasag, Misamis Oriental, PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Consuelo",fid:"GH12-3GN",child:"32818992",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1939-11-28",birthPlace:"Balingasag, Misamis Oriental, PHL",deathAge:null,deathDate:"2015-04-02",deathPlace:"Balingasag, Misamis Oriental, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"18589217",lastName:"Elican",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"Mindanao, PHL",middleName:"Acerto",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Rufa",marker:"farming",fid:"GH12-9F6",child:"41741428",paternal_siblings:[],father:"36360078",maternal_siblings:[],mother:"55588060",regular_siblings:[]},{baptismDate:null,birthDate:"before 1933",birthPlace:null,deathAge:null,deathDate:"after 1945-04-30",deathPlace:"Misamis Oriental, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"36360078",lastName:"Elican",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:"Sgt.",suffix:null,vitalsCompleteAndVerified:!1,firstName:"Cecelio",marker:"sergeant",fid:"GH12-9JZ",child:"18589217",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"55588060",lastName:"Acerto",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Jovita",fid:"GH12-35H",child:"18589217",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1974-04-13",birthPlace:"Sinamongan, Pilar, Capiz, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"55859428",lastName:"Ajesta",living:!0,livingPlace:"Manama, BHR",marriageDate:"1994-01-25",marriagePlace:"Santa Maria, Bulacan, PHL",middleName:"Vergara",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Mylen",marker:"beautician",marker2:"prelations",marker3:"manager",fid:"GHBR-FK3",child:"16057808",paternal_siblings:[],father:"17374654",maternal_siblings:[],mother:"64719992",regular_siblings:["44750858","57433236"]},{baptismDate:null,birthDate:"before 1953",birthPlace:"Binaobawan, Pilar, Capiz, PHL",deathAge:null,deathDate:"after 1980-02-26",deathPlace:"PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"17374654",lastName:"Ajesta",living:!1,livingPlace:null,marriageDate:"1962-08-05",marriagePlace:"Pilar, Capiz, PHL",middleName:"Badoles",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Napoleon Crispolon",fid:"GH12-Z3C",child:"55859428",paternal_siblings:[],father:"40943586",maternal_siblings:[],mother:"99295715",regular_siblings:[]},{baptismDate:null,birthDate:"about 1903",birthPlace:"Pilar, Capiz, PHL",deathAge:null,deathDate:"after 1922-02-15",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"40943586",lastName:"Ajesta",living:!1,livingPlace:null,marriageDate:"1922-02-15",marriagePlace:"Pontevedra, Capiz, PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Manuel",fid:"GH12-XX4",child:"17374654",paternal_siblings:[],father:"52727694",maternal_siblings:[],mother:"35729864",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"52727694",lastName:"Ajesta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Eustaquio",fid:"GKBR-M9Y",child:"40943586",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"35729864",lastName:"Bermudes",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Florencia",fid:"GKBR-7P7",child:"40943586",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"about 1904",birthPlace:null,deathAge:null,deathDate:"after 1922-02-15",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"99295715",lastName:"Badoles",living:!1,livingPlace:null,marriageDate:"1922-02-15",marriagePlace:"Pontevedra, Capiz, PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Ursula",fid:"GH12-HQN",child:"17374654",paternal_siblings:[],father:"95408617",maternal_siblings:[],mother:"78914496",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"95408617",lastName:"Badoles",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Pedro Benjamin",fid:"GKBT-9GD",child:"99295715",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"about 1852",birthPlace:"Panay, Capiz, PHL",deathAge:null,deathDate:"1922-01-08",deathPlace:"Panay, Capiz, PHL",gender:"F",hasDNA:!1,hasImage:!1,key:"78914496",lastName:"Billanes",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Leoncia",fid:"K2GJ-YY3",child:"99295715",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1941-07-08",birthPlace:"Dulangan, Pilar, Capiz, PHL",deathAge:null,deathDate:"2020-02-16",deathPlace:"Catholic Cemetery, Santa Maria, Bulacan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"64719992",lastName:"Vergara",living:!1,livingPlace:null,marriageDate:"1962-08-05",marriagePlace:"Pilar, Capiz, PHL",middleName:"Borja",nickname:"Mamang",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Selma",marker:"farming",fid:"GH12-W17",child:"55859428",paternal_siblings:[],father:"27738578",maternal_siblings:[],mother:"47733294",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"27738578",lastName:"Vergara",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Benigno",marker:"military",fid:"GH12-6YL",child:"64719992",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"before 1896",birthPlace:"PHL",deathAge:null,deathDate:"after 1996-12-16",deathPlace:"Tuguegarao, Cagayan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"47733294",lastName:"Borja",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"PHL",middleName:null,nickname:"Enor",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Enoria",marker:"centennial",fid:"GH12-DD8",child:"64719992",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]}],SIBLINGS_DATA={41491264:{baptismDate:null,birthDate:"1948-07-06",birthPlace:"Manila, PHL",deathAge:null,deathDate:"1948-07-07",deathPlace:"Manila, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"41491264",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"San Agustin",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Benjamin",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},95216770:{baptismDate:null,birthDate:"1946-12-27",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"95216770",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Dumantay",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Rodolfo",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},48615922:{baptismDate:null,birthDate:"1969-03-31",birthPlace:"South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"48615922",lastName:"Argabioso",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Saplala",nickname:"Dada",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Danilo",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},52063403:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"52063403",lastName:"Orillo",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Filomeno",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},44750858:{baptismDate:null,birthDate:"1964-08-05",birthPlace:null,deathAge:null,deathDate:"2023-01-23",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"44750858",lastName:"Ajesta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Vergara",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Roselyn",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},28928680:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"28928680",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Reyes",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Augustin",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},93051591:{baptismDate:null,birthDate:"1870-07-21",birthPlace:"Santa Barbara, Pangasinan, PHL",deathAge:null,deathDate:"1941-12-27",deathPlace:"Quezon City, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"93051591",lastName:"Maramba",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Bautista",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Daniel",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},38373110:{baptismDate:null,birthDate:"about 1907",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"38373110",lastName:"Saplala",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Hilaria",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},73841862:{baptismDate:null,birthDate:"1945-06-17",birthPlace:"Metro Manila, PHL",deathAge:null,deathDate:"2018-02-19",deathPlace:"South Caloocan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"73841862",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"San Agustin",nickname:"Vicky",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Victoria",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},85278460:{baptismDate:null,birthDate:"1919-10-18",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"1981-09-16",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"85278460",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Mia",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Leonor Rosario",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},64329171:{baptismDate:null,birthDate:"about 1905",birthPlace:null,deathAge:null,deathDate:"about 1983",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"64329171",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:"1932-06-01",marriagePlace:null,middleName:"Bongco",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Felipe",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},54340914:{baptismDate:null,birthDate:"1949-10-23",birthPlace:"Metro Manila, PHL",deathAge:null,deathDate:"before 2020",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"54340914",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"San Agustin",nickname:"Ben",prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Benjamin",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},4793299:{baptismDate:null,birthDate:"1963-12-14",birthPlace:"South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"4793299",lastName:"Argabioso",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Saplala",nickname:"Toni",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Antonio",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},77082334:{baptismDate:null,birthDate:"1968-02-21",birthPlace:"South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"77082334",lastName:"Acosta",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Maramba",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Susan",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},21653420:{baptismDate:null,birthDate:"1928-01-18",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"2009-05-23",deathPlace:"Majayjay, Laguna, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"21653420",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Mia",nickname:null,prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Celso",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},95739264:{baptismDate:null,birthDate:"before 1964-08-28",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"95739264",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Dumantay",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Becky",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},36448299:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:"before 2020",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"36448299",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Mia",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Amada",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},31493676:{baptismDate:null,birthDate:null,birthPlace:"Luzon, PHL",deathAge:null,deathDate:"about 2019",deathPlace:"Luzon, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"31493676",lastName:"Saplala",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Perez",nickname:null,prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Claro",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},21719634:{baptismDate:null,birthDate:"2008-08-01",birthPlace:"Maternity House, Poblacion, South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"21719634",lastName:"Ignacio",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Acosta",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Joshua Caleb",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},7663556:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:"before 2020",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"7663556",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Mia",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Trinidad",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},4256552:{baptismDate:null,birthDate:"1966-11-07",birthPlace:"South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"4256552",lastName:"Acosta",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Maramba",nickname:"Manolo",prefix:null,suffix:"III",vitalsCompleteAndVerified:!1,firstName:"Manuel",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},47386677:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"47386677",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Reyes",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Juan",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},1031404:{baptismDate:null,birthDate:"2004-10-13",birthPlace:"Metro Manila, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"1031404",lastName:"Adanza",living:!0,livingPlace:"Sangandaan, South Caloocan, PHL",marriageDate:null,marriagePlace:null,middleName:"Ajesta",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"DM",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},392680:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"392680",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Reyes",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Milagros",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},12725118:{baptismDate:null,birthDate:"1947-06-12",birthPlace:"Metro Manila, PHL",deathAge:null,deathDate:"2021-05-02",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"12725118",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"San Agustin",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Amelia",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},6375936:{baptismDate:null,birthDate:"1911-05-17",birthPlace:"Luzon, PHL",deathAge:null,deathDate:"1984-10-03",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"6375936",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Bongco",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Isabel",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},83646651:{baptismDate:null,birthDate:"1903-11-17",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"1993-04-22",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"83646651",lastName:"Orillo",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Gregorio",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},40891293:{baptismDate:null,birthDate:"about 1913",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"40891293",lastName:"Saplala",living:!0,livingPlace:null,marriageDate:"1930-03-29",marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Jose",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},41448711:{baptismDate:null,birthDate:"2004-08-05",birthPlace:"Amisola Maternity Hospital, Tondo, Manila, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"41448711",lastName:"Ignacio",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Acosta",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Ira Mae",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},78074094:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"78074094",lastName:"Adanza",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Elican",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Gloria",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},57433236:{baptismDate:null,birthDate:"1979-12-26",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"57433236",lastName:"Ajesta",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Vergara",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Cecil",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},70275697:{baptismDate:null,birthDate:"2003-11-05",birthPlace:"St. Luke's Medical Center, Quezon City, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"70275697",lastName:"Argabioso",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Martin",nickname:"Ryan",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Riand Nikole",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},46768390:{baptismDate:null,birthDate:"1946-03-02",birthPlace:"Luzon, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"46768390",lastName:"Saplala",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Perez",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Celia",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},57182283:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"57182283",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Reyes",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"José",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},55618304:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"55618304",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Dumantay",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Larry",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},42349252:{baptismDate:null,birthDate:"1928-04-20",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"42349252",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:"1953-02-08",marriagePlace:null,middleName:"Dumantay",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Aurora",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]}},STORIES={"GQX8-CQP":{headline:"An Electronics-Engineering-graduate turned Software Engineer focused on recording his family's history.",headshot:"GQX8-CQP-2.lossy.webp",stories:` + "nodeParentKeyProperty": `+this.Xe(this.nodeParentKeyProperty)),t+e}Ey(t){super.Ey(t),t.nodeParentKeyProperty&&(this.nodeParentKeyProperty=t.nodeParentKeyProperty)}Vy(t){void 0!==t.nodeParentKeyProperty&&t.nodeParentKeyProperty!==this.nodeParentKeyProperty&&Kt.n("applyIncrementalJson cannot change Model properties"),super.Vy(t)}maybeEnsureLinkReference(t){return t}get nodeParentKeyProperty(){return this.Bn}set nodeParentKeyProperty(t){var e=this.Bn;e!==t&&(this.En(t,li,"nodeParentKeyProperty"),this.Bn=t,this.i("nodeParentKeyProperty",e,t))}get copiesParentKeyOfNodeData(){return this.kg}set copiesParentKeyOfNodeData(t){this.kg!==t&&(Kt.t(t,"boolean",li,"copiesParentKeyOfNodeData"),this.kg=t)}getParentKeyForNodeData(t){if(null!==t){var e=this.Bn;if(""!==e){e=b.Xt(t,e);if(void 0!==e){if(this.isKeyType(e))return e;Kt.n("ParentKey value for node data "+t+" is not a number or a string: "+e)}}}}setParentKeyForNodeData(t,e){var i,s;void 0===(e=null===e?void 0:e)||this.isKeyType(e)||Kt.Bi(e,"number or string",li,"setParentKeyForNodeData:key"),null!==t&&""!==(i=this.Bn)&&(e=this.maybeEnsureLinkReference(e),this.containsNodeData(t)?(s=b.Xt(t,i))!==e&&(this.en(s,t),b.dt(t,i,e),null===this.findNodeDataForKey(e)&&this.sn(e,t),this.Kt("nodeParentKey",2,i,t,s,e),"string"==typeof i)&&this.updateTargetBindings(t,i):b.dt(t,i,e))}get parentLinkCategoryProperty(){return this.$a}set parentLinkCategoryProperty(t){var e=this.$a;e!==t&&(this.En(t,li,"parentLinkCategoryProperty"),this.$a=t,this.i("parentLinkCategoryProperty",e,t))}get linkCategoryProperty(){return this.parentLinkCategoryProperty}set linkCategoryProperty(t){this.parentLinkCategoryProperty=t}getParentLinkCategoryForNodeData(t){var e;return null===t||""===(e=this.$a)||void 0===(e=b.Xt(t,e))?"":"string"==typeof e?e:void Kt.n("getParentLinkCategoryForNodeData found a non-string category for "+t+": "+e)}getLinkCategoryForData(t){return this.getParentLinkCategoryForNodeData(t)}setParentLinkCategoryForNodeData(e,i){if(Kt.t(i,"string",li,"setParentLinkCategoryForNodeData:cat"),null!==e){var s=this.$a;if(""!==s)if(this.containsNodeData(e)){let t=b.Xt(e,s);(t=void 0===t?"":t)!==i&&(b.dt(e,s,i),this.Kt("parentLinkCategory",2,s,e,t,i),"string"==typeof s)&&this.updateTargetBindings(e,s)}else b.dt(e,s,i)}}setLinkCategoryForData(t,e){this.setParentLinkCategoryForNodeData(t,e)}copyNodeData(t){return null===t?null:(t=super.copyNodeData(t),this.copiesParentKeyOfNodeData||""===this.Bn||void 0===b.Xt(t,this.Bn)||b.dt(t,this.Bn,void 0),t)}setDataProperty(t,e,i){if((Ht,Kt.t(t,"object",li,"setDataProperty:data"),Kt.t(e,"string",li,"setDataProperty:propname"),""===e)&&Kt.n("TreeModel.setDataProperty: property name must not be an empty string when setting "+t+" to "+i),this.containsNodeData(t)){if(e===this.nodeKeyProperty)return void this.setKeyForNodeData(t,i);if(e===this.nodeCategoryProperty)return void this.setCategoryForNodeData(t,i);if(e===this.nodeParentKeyProperty)return void this.setParentKeyForNodeData(t,i)}var s=b.Xt(t,e);s!==i&&(b.dt(t,e,i),this.raiseDataChanged(t,e,s,i))}By(t,e){super.By(t,e);for(var i=this.oi.iterator;i.next();){var s=i.value;this.IN(s,t,e)}}IN(t,e,i){var s;this.getParentKeyForNodeData(t)===e&&(s=this.Bn,b.dt(t,s,i),this.Kt("nodeParentKey",2,s,t,e,i),"string"==typeof s)&&this.updateTargetBindings(t,s)}wg(t){super.wg(t);var e=this.getKeyForNodeData(t),t=this.Ry(e);if(null!==t){for(var i=Kt.ct(),s=t.iterator;s.next();){var n,a=s.value;this.containsNodeData(a)&&this.getParentKeyForNodeData(a)===e&&(n=this.Bn,this.Kt("nodeParentKey",2,n,a,e,e),"string"==typeof n&&this.updateTargetBindings(a,n),i.push(a))}for(let t=0;t=i.length||(e.add(i.elt(t)),t+1>=i.length));t+=2)s.add(i.elt(t+1));12===this.direction?(3===this.arrangement&&e.reverse(),(i=new O).addAll(e),i.addAll(s)):(3===this.arrangement&&s.reverse(),(i=new O).addAll(s),i.addAll(e))}var g=i.length;let m=u=0;for(let e=0;ea?(a=A,d=a*r,b):y/(360<=l?g:g-1)}}return this.vb=t,this.EN=n,this.me=a,this.Xc=r,this.Hb=o,this.Sg=l,this.Ih=h,this.VN=u,this.Ls=d,this.Xy=c,i}doLayout(e){Ht,null===e&&Kt.n("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"),null===this.network&&(this.network=this.makeNetwork(e)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);e=this.network.vertexes;if(e.count<=1)1===e.count&&((a=e.first()).centerX=0,a.centerY=0);else{let t=new O;t.addAll(e.iterator);var s=new O,n=new O,a=(t=this.YO(t,s,n),this.vb),r=this.me,o=this.Hb,l=this.Sg,h=this.Ih,u=this.Ls,d=this.Xy;if(12!==this.direction&&13!==this.direction||3!==a)if(12===this.direction||13===this.direction){let i=0;switch(a){case 1:i=180*this.Wb(r,u,o,d)/Math.PI;break;case 0:{let t=0,e=0;var c=s.first(),c=(null!==c&&(t=c.Oh(Math.PI/2)),n.first());null!==c&&(e=c.Oh(Math.PI/2)),i=180*this.Wb(r,u,o,h+(t+e)/2)/Math.PI;break}case 2:i=l/t.length}if(12===this.direction){switch(a){case 1:this.Uy(s,l/2,o,11);break;case 0:this.Gy(s,l/2,o,11);break;case 2:this.Hy(s,l/2,o,11)}switch(a){case 1:this.Uy(n,l/2,o+i,10);break;case 0:this.Gy(n,l/2,o+i,10);break;case 2:this.Hy(n,l/2,o+i,10)}}else{switch(a){case 1:this.Uy(n,l/2,o,11);break;case 0:this.Gy(n,l/2,o,11);break;case 2:this.Hy(n,l/2,o,11)}switch(a){case 1:this.Uy(s,l/2,o+i,10);break;case 0:this.Gy(s,l/2,o+i,10);break;case 2:this.Hy(s,l/2,o+i,10)}}}else switch(a){case 1:this.Uy(t,l,o,this.direction);break;case 0:this.Gy(t,l,o,this.direction);break;case 2:this.Hy(t,l,o,this.direction);break;case 3:this.qT(t,l,o,this.direction)}else this.qT(t,l,o-l/2,10)}this.updateParts(),this.network=null,this.isValidLayout=!0}Hy(e,t,i,s){var n=this.Sg,a=this.me,r=this.Ls,o=i*Math.PI/180,l=t*Math.PI/180,h=e.length;for(let t=0;t=d.length-1));t++)this.JT(e,i,d,t,r,c)||this.ZT(e,i,d,t,r,c),e=c.x,i=c.y;if(_.o(c),this.Qa++,!(23Math.abs(m)?0=d.length-1));t++)this.JT(o,l,d,t,s,u)||this.ZT(o,l,d,t,s,u),o=u.x,l=u.y;_.o(u),this.Qa++,23o){if((h=t-r)<-o)return a.x=h,a.y=u,!1;d=!0}}else if((h=t-r)<-o){if((h=t+r)>o)return a.x=h,a.y=u,!1;d=!0}return u=Math.sqrt(1-Math.min(1,h*h/(o*o)))*l,e<0!==d&&(u=-u),Math.abs(e-u)>(i[s].height+i[s+1].height)/2?(a.x=h,a.y=u,!1):(a.x=h,a.y=u,!0)}ZT(t,e,i,s,n,a){var r=this.Ih,o=this.me,l=this.Ls;let h=0,u=0;r=(i[s].height+i[s+1].height)/2+r;let d=!1;if(0<=t!=(10===n)){if((u=e-r)<-l){if((u=e+r)>l)return a.x=h,a.y=u,!1;d=!0}}else if((u=e+r)>l){if((u=e-r)<-l)return a.x=h,a.y=u,!1;d=!0}return h=Math.sqrt(1-Math.min(1,u*u/(l*l)))*o,t<0!==d&&(h=-h),Math.abs(t-h)>(i[s].width+i[s+1].width)/2?(a.x=h,a.y=u,!1):(a.x=h,a.y=u,!0)}commitLayout(){this.commitNodes(),this.isRouting&&this.commitLinks()}commitNodes(){var t=null!==this.group&&this.group.hasPlaceholder(),e=t?this.group.location.copy():null;let i=this.actualCenter;t?i=new _(0,0):(i.x=this.arrangementOrigin.x+this.me,i.y=this.arrangementOrigin.y+this.Ls);for(var s,n=this.network.vertexes.iterator;n.next();){var a=n.value;a.x+=i.x,a.y+=i.y,a.commit()}t&&(this.group.ensureBounds(),t=this.group.position.copy(),s=this.group.location.copy(),e=e.subtract(s.subtract(t)),this.group.move(e),this.ON=e.subtract(t))}commitLinks(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()}BN(t,e,i,s){var n=this.vT;if(Math.abs(this.Xc-1)<.001)return void 0!==i&&void 0!==s?s*t:2*Math.PI*t;var a=e=n)return t*o}}KO(t){switch(this.sorting){case 20:break;case 21:t.reverse();break;case 22:t.sort(this.comparer);break;case 23:t.sort(this.comparer),t.reverse();break;case 24:return this.HO(this.vO(t));default:Kt.n("Invalid sorting type.")}return t}vO(n){var a=[];for(let t=0;te&&(e=o,i=t)}else for(let t=0;te&&(e=l,i=t)}r.add(n.elt(i)),a[i]=-1;var h=n.elt(i);let t=0;for(var u=h.sourceEdges;u.next();){var d=u.value.fromVertex;!((t=n.indexOf(d))<0)&&0<=a[t]&&a[t]++}for(var c=h.destinationEdges;c.next();){var g=c.value.toVertex;!((t=n.indexOf(g))<0)&&0<=a[t]&&a[t]++}}return r}HO(i){var r=[];for(let e=0;e=v&&t++,e>=v&&e++,t>e&&(p=e,e=t,t=p),e-t<(u.length+2)/2==(tMath.max(100,Math.sqrt(n*t.vertexes.count));)s=this.coarsenNetwork(s);let a=0,r=(e=s.vertexes.iterator,this.randomNumberGenerator);for(null===r&&(this.randomNumberGenerator=r=new Ai(0));e.next();){e.value.idInCluster=a++;for(var o=10*(r.random()-.5),l=10*(r.random()-.5),h=(e.value.x=o,e.value.y=l,e.value.hierarchicalVertexes.iterator);h.next();)h.value.x=o,h.value.y=l}var u=this.computePairwiseDistances(s);this.jO(s,u,this.maxPrelayoutIterations,t.vertexes.count),this.$T(t,this.maxIterations)}computePairwiseDistances(t){var e=t.vertexes.count,i=new Array(e);for(let t=0;tu.y&&i[t].x-u.xu.x&&i[t].y-u.yr-a,u=(h?i.sort((t,e)=>null===t||null===e||t===e?0:t.centerX-e.centerX):i.sort((t,e)=>null===t||null===e||t===e?0:t.centerY-e.centerY),this.Gc);let d=0,c=0,g=0;for(let e=0;ethis.epsilonDistance*this.epsilonDistance}jO(t,i,e,s){Ht,Kt.r(e,yi,"performIterations:num");var n,a,r=this.Eh+e,o=Math.sqrt(s),l=(this.vy=this.tf*t.vertexes.count,t.vertexes.toArray());let h=0,u,d=0;for(;this.Eh=u){if(5<=++d)break}else d=0;this.vy*=.95}}moveVertex(t){let e=t.forceX,i=t.forceY;var s=this.moveLimit;return e<-s?e=-s:e>s&&(e=s),i<-s?i=-s:i>s&&(i=s),t.centerX+=e,t.centerY+=i,e*e+i*i}shouldInteract(t,e){return!0}moveFixedVertex(t){}commitLayout(){this.qy(),this.commitNodes(),this.isRouting&&this.commitLinks()}qy(){if(this.setsPortSpots)for(var t=this.network.edges.iterator;t.next();){var e=t.value.link;null!==e&&(e.fromSpot=Z.Default,e.toSpot=Z.Default)}}commitNodes(){let t=0,e=0;this.arrangesToOrigin&&(i=Q.a(),this.Fw(this.network,i),s=this.arrangementOrigin,t=s.x-i.x,e=s.y-i.y,Q.o(i));for(var i,s,n=Q.a(),a=this.network.vertexes.iterator;a.next();){var r=a.value;0===t&&0===e||(n.c(r.bounds),n.x+=t,n.y+=e,r.bounds=n),r.commit()}Q.o(n)}commitLinks(){for(var t=this.network.edges.iterator;t.next();)t.value.commit()}springStiffness(t){t=t.stiffness;return isNaN(t)?this.Hc:t}springLength(t){t=t.length;return isNaN(t)?this.vc:t}electricalCharge(t){t=t.charge;return isNaN(t)?this.qc:t}electricalFieldX(t,e){return 0}electricalFieldY(t,e){return 0}gravitationalMass(t){t=t.mass;return isNaN(t)?this.Wc:t}gravitationalFieldX(t,e){return 0}gravitationalFieldY(t,e){return 0}isFixed(t){return t.isFixed}get currentIteration(){return this.Eh}get arrangementSpacing(){return this.Ts}set arrangementSpacing(t){Kt.s(t,Yt,yi,"arrangementSpacing"),this.Ts.equals(t)||(this.Ts.c(t),this.invalidateLayout())}get arrangesToOrigin(){return this.Ag}set arrangesToOrigin(t){this.Ag!==t&&(Kt.t(t,"boolean",yi,"arrangesToOrigin"),this.Ag=t,this.invalidateLayout())}get setsPortSpots(){return this.zn}set setsPortSpots(t){this.zn!==t&&(Kt.t(t,"boolean",yi,"setsPortSpots"),this.zn=t,this.invalidateLayout())}get comments(){return this.Ye}set comments(t){this.Ye!==t&&(Kt.t(t,"boolean",yi,"comments"),this.Ye=t,this.invalidateLayout())}get maxPrelayoutIterations(){return this.Lg}set maxPrelayoutIterations(t){this.Lg!==t&&(Kt.t(t,"number",yi,"maxPrelayoutIterations"),0<=t)&&(this.Lg=t,this.invalidateLayout())}get maxIterations(){return this.Tg}set maxIterations(t){this.Tg!==t&&(Kt.t(t,"number",yi,"maxIterations"),0<=t)&&(this.Tg=t,this.invalidateLayout())}get epsilonDistance(){return this.Dg}set epsilonDistance(t){this.Dg!==t&&(Kt.t(t,"number",yi,"epsilonDistance"),0d||a===d&&o>g)&&t++,ca||d===a&&g>o)&&t++;if(v<=0)for(e=y[f].hr,s=0;sd||a===d&&r>c)&&t++,ga||d===a&&c>r)&&t++;for(x[f*b+f]=t,i=f+1;it-e),h=s>>1,1&s?l[t]=u[h]:l[t]=u[h-1]+u[h]>>1)}return this.Bh(a,o),l}Zy(i,s,n,a,r){if(i.component===n){i.component=s;let t=0,e=0;if(a)for(var o=i.destinationEdges;o.next();){var l=o.value,h=l.toVertex;t=i.layer-h.layer,e=this.linkMinLength(l),t===e&&this.Zy(h,s,n,a,r)}if(r)for(var u=i.sourceEdges;u.next();){var d=u.value,c=d.fromVertex;t=c.layer-i.layer,e=this.linkMinLength(d),t===e&&this.Zy(c,s,n,a,r)}}}KN(t,e,i,s,n){if(t.component===i){if(t.component=e,s)for(var a=t.destinationEdges;a.next();){var r=a.value.toVertex;this.KN(r,e,i,s,n)}if(n)for(var o=t.sourceEdges;o.next();){var l=o.value.fromVertex;this.KN(l,e,i,s,n)}}}removeCycles(){for(var t=this.network.edges.iterator;t.next();)t.value.rev=!1;switch(this.Jc){default:case 1:this.e3();break;case 0:this.s3();break;case 2:this.o3()}}o3(){var t=this.network,i=t.vertexes.iterator;let s=1/0;for(;i.next();){var e=i.value;s=Math.min(s,e.layer)}if(s<1/0){if(s<0)for(i.reset();i.next();)i.value.layer-=s;var n=[];for(i.reset();i.next();){var a=i.value,r=n[a.layer];void 0===r?n[a.layer]=[a]:r.push(a)}let e=0;for(let t=0;tl.index&&(e.reverseEdge(r),r.rev=!0)}}r3(t){for(var e=t.vertexes.iterator;e.next();){var i=e.value;if(i.ee)return i}return null}iD(t){for(var e=t.vertexes.iterator;e.next();){var i=e.value;if(i.ee){let t=!0;for(var s=i.destinationEdges;s.next();)if(s.value.toVertex.ee){t=!1;break}if(t)return i}}return null}eD(t){for(var e=t.vertexes.iterator;e.next();){var i=e.value;if(i.ee){let t=!0;for(var s=i.sourceEdges;s.next();)if(s.value.fromVertex.ee){t=!1;break}if(t)return i}}return null}l3(t){let i=null,s=0;for(var e=this.network.vertexes.iterator;e.next();){var n=e.value;if(n.ee){let t=0;for(var a=n.destinationEdges;a.next();)a.value.toVertex.ee&&t++;let e=0;for(var r=n.sourceEdges;r.next();)r.value.fromVertex.ee&&e++;(null===i||sn&&this.Zy(a,0,-1,!0,!1)}for(this.Zy(e,1,-1,!0,!0);0!==e.component;){let s=0,n=1/0,t=0,a=null;for(var l=this.network.vertexes.iterator;l.next();){var h=l.value;if(1===h.component){let e=0,i=!1;var u=h.Mo;r=u.length;for(let t=0;tt)&&!i&&(r=o,t=e)}}if(n<0){for(i.reset();i.next();){var m=i.value;1===m.component&&(m.layer-=a)}e.component=0}else r.component=0}}QO(){for(var d=this.network,e=[],t=d.edges.iterator;t.next();){var i=t.value;i.valid=!1,e.push(i)}for(let t=0;th&&0h&&0e[this.Fs]&&(this.Wy=e[t]-1,this.Fs=t),e[t]{t.index=this.yi[a],this.yi[a]++})}}}m3(){let e=null;for(var i=this.network.vertexes.iterator;i.next();){var t,s=i.value;s.near&&(null===e&&(e=new Map),s.layer===s.near.layer)&&((t=e.get(s.near)||[]).push(s),e.set(s.near,t))}for(let t=this.Lt;0<=t;t--)for(i.reset();i.next();){var n=i.value;n.layer===t&&-1===n.index&&this.aD(n,e)}}aD(t,i){if(!t.near){const l=t.layer;t.index=this.yi[l],this.yi[l]++,i&&(s=i.get(t),Array.isArray(s))&&s.forEach(t=>{t.index=this.yi[l],this.yi[l]++});var s,n=t.hr;let e=!0;for(;e;){e=!1;for(let t=0;tr.portFromColOffset&&(e=!0,n[t]=r,n[t+1]=a)}}for(let t=0;t{t.index=this.yi[h],this.yi[h]++});var n,a,r=i.Mo;let t=!0,e=0;for(;t;)for(t=!1,e=0;el.portToColOffset&&(t=!0,r[e]=l,r[e+1]=o)}for(e=0;e=o;s--)a=this.gs(s,-1,!1,-1)||a;for((n=this.countCrossings())>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=r;s>=o;s--)a=this.gs(s,1,!1,1)||a;for((n=this.countCrossings())>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,1,!1,1)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,-1,!1,-1)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=r;s>=o;s--)a=this.gs(s,0,!1,0)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,0,!1,0)||a;n>=t?this.ns(e):(t=n,e=this.ie())}break;default:for(r=this.Lt,o=0,l=t+1;(h=this.countCrossings())=o;s--)a=this.gs(s,-1,!1,-1)||a;for((n=this.countCrossings())>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=r;s>=o;s--)a=this.gs(s,1,!1,1)||a;for((n=this.countCrossings())>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,1,!1,1)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,-1,!1,-1)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=r;s>=o;s--)a=this.gs(s,0,!1,0)||a;for(n>=t?this.ns(e):(t=n,e=this.ie()),a=!0;a;)for(a=!1,s=o;s<=r;s++)a=this.gs(s,0,!1,0)||a;n>=t?this.ns(e):(t=n,e=this.ie())}}this.ns(e)}lk(t,e){Ht,Kt.r(t,Ni,"medianBarycenterCrossingReduction:unfixedLayer"),Kt.r(e,Ni,"medianBarycenterCrossingReduction:direction");let i=0,s=!1;var n,a=this.Vh(t),r=this.yi[t],o=this.tD(t,e),l=this.Jy(t,e);for(i=0;iw+1&&(t+=4*(u-w),e+=4*(u-(w+1)))}}var I=y[w].destinationEdges.iterator;if(p&&0<=v)for(;I.next();){var V=I.value;d=V.toVertex,V.valid&&d.layer!==f&&(n=this.linkStraightenWeight(V),a=V.portFromColOffset,r=V.portToColOffset,l=d.column,i+=(Math.abs(N+a-(l+r))+1)*n,s+=(Math.abs(F+a-(l+r))+1)*n)}for(I.reset();I.next();){var z=I.value;if(d=z.toVertex,z.valid&&d.layer===f){for(c=0;cw+1&&(t+=4*(u-(w+1)),e+=4*(u-w))}}var H=y[w+1].destinationEdges.iterator;if(p&&0<=v)for(;H.next();){var K=H.value;d=K.toVertex,K.valid&&d.layer!==f&&(n=this.linkStraightenWeight(K),a=K.portFromColOffset,r=K.portToColOffset,l=d.column,i+=(Math.abs(L+a-(l+r))+1)*n,s+=(Math.abs(B+a-(l+r))+1)*n)}for(H.reset();H.next();){var Y=H.value;if(d=Y.toVertex,Y.valid&&d.layer===f){for(c=0;c>1)+8*e}this.Wt*=8}if(2&this.cr){e=!0;let t=0;for(;e&&tw+this.nodeMinColumnSpace(m[g-1],!1)?x-1:x,0),i=(e=g+1>=f||m[g+1].column-x-1>A+this.nodeMinColumnSpace(m[g+1],!0)?x+1:x,0),s=0,n=0,a=0,r=0,o=0;if(c<=0)for(var P=m[g].sourceEdges.iterator;P.next();){var k=P.value,S=k.fromVertex;k.valid&&S.layer!==d&&(a=this.linkStraightenWeight(k),r=k.portFromColOffset,o=k.portToColOffset,k=S.column,i+=(Math.abs(x+o-(k+r))+1)*a,s+=(Math.abs(t+o-(k+r))+1)*a,n+=(Math.abs(e+o-(k+r))+1)*a)}if(0<=c)for(var M=m[g].destinationEdges.iterator;M.next();){var C=M.value,N=C.toVertex;C.valid&&N.layer!==d&&(a=this.linkStraightenWeight(C),r=C.portFromColOffset,o=C.portToColOffset,C=N.column,i+=(Math.abs(x+r-(C+o))+1)*a,s+=(Math.abs(t+r-(C+o))+1)*a,n+=(Math.abs(e+r-(C+o))+1)*a)}let l=0,h=0,u=0;w=p[m[g].index],A=v[m[g].index];-1!==w&&(l+=Math.abs(w-x),h+=Math.abs(w-t),u+=Math.abs(w-e)),-1!==A&&(l+=Math.abs(A-x),h+=Math.abs(A-t),u+=Math.abs(A-e)),s=l[a]?t=n:s<=l[a]&&(t=s)),t!==d&&(h=!0,u=!0,r[a].column=t)}return this.Bh(t,r),this.jy(),h}x3(){for(let t=0;t<=this.Wt;t++)for(;this.b3(t,1););this.jy()}b3(t,e){Ht,Kt.r(t,Ni,"packAux:column"),Kt.r(e,Ni,"packAux:direction");let i=!0;for(var s=this.network.vertexes.iterator;s.next();){var n=s.value,a=this.nodeMinColumnSpace(n,!0),r=this.nodeMinColumnSpace(n,!1);if(n.column-a<=t&&n.column+r>=t){i=!1;break}}let o=!1;if(i){if(0t&&(--l.column,o=!0)}if(e<0)for(s.reset();s.next();){var h=s.value;h.column=i&&(a[o.layer]=!0)}let u=!0,d=!1;for(s=0;s<=this.Lt;s++)u=u&&!(n[s]&&a[s]);if(u){if(0t&&(--c.column,d=!0)}if(e<0)for(r.reset();r.next();){var g=r.value;g.columns?this.ns(i):as?this.ns(i):a=t&&(n.component=this.rn)}for(this.rn++,e.reset();e.next();){var a=e.value;-1===a.component&&(this.KN(a,this.rn,-1,!0,!0),this.rn++)}let r=0;var o=[];for(r=0;r{var e=Kt.ct(),i=(h&&e.push(a.get(t)),u&&e.push(r.get(t)),d&&e.push(o.get(t)),c&&e.push(l.get(t)),e.sort((t,e)=>t-e),e.length),s=Math.floor((i-1)/2),i=Math.ceil((i-1)/2),s=(e[s]+e[i])/2;Kt.ot(e),t.pe=s})}M3(e,n){var i=e.length;for(let t=1;tt)&&n.add(u)}s++}i=t}}}}N3(t){if(null===t.node){t=t.getProperSourceVertexes();if(0t.zh-e.zh);r=(r-1)/2;for(let e=Math.floor(r),t=Math.ceil(r);e<=t;e++)if(l.Kn===l){var o=a[e];let t;t=n?o.getDestinationEdge(l):l.getDestinationEdge(o),!s.contains(t)&&i{o.set(t.key,t.value+l)})}}Kt.ot(n),Kt.ot(a)}L3(t,e,i,s){if(!t||0===t.count)return e[s]=0,1/(i[s]=0);let n=1/0,a=-1/0;return t.each(t=>{var e=t.key,t=t.value,e=90===this.C||270===this.C?e.width:e.height;ta&&(a=t+e)}),e[s]=n,(i[s]=a)-n}commitLayout(){this.qy(),this.commitNodes(),this.HN(),this.isRouting&&this.commitLinks()}qy(){if(this.setsPortSpots)for(var t=this.rk(!0),e=this.rk(!1),i=this.network.edges.iterator;i.next();){var s=i.value.link;null!==s&&(s.fromSpot=t,s.toSpot=e)}}rk(t){return 270===this.C?t?Z.MiddleTop:Z.MiddleBottom:90===this.C?t?Z.MiddleBottom:Z.MiddleTop:180===this.C?t?Z.MiddleLeft:Z.MiddleRight:t?Z.MiddleRight:Z.MiddleLeft}commitNodes(){this.on=[],this.Rs=[],this.Is=[],this.Gt=[];for(let t=0;t<=this.Lt;t++)this.on[t]=0,this.Rs[t]=0,this.Is[t]=0,this.Gt[t]=0;for(var i=this.network.vertexes.iterator;i.next();){var t=i.value,e=t.layer;this.on[e]=Math.max(this.on[e],this.nodeMinLayerSpace(t,!0)),this.Rs[e]=Math.max(this.Rs[e],this.nodeMinLayerSpace(t,!1))}let s=0;var n=this.Ds;for(let e=0;e<=this.Lt;e++){let t=n;this.on[e]+this.Rs[e]<=0&&(t=0),0=y.bounds.bottom?(e=y.bounds.y+y.bounds.height,b.insertPointAt(s++,l,e+c),b.insertPointAt(s++,l,e),b.insertPointAt(s++,l,e-d)):(b.insertPointAt(s++,l,h+c),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h-d)):270===this.C?h<=y.bounds.y?(e=y.bounds.y,b.insertPointAt(s++,l,e-d),b.insertPointAt(s++,l,e),b.insertPointAt(s++,l,e+c)):(b.insertPointAt(s++,l,h-d),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h+c)):0===this.C&&(l>=y.bounds.right?(e=y.bounds.x+y.bounds.width,b.insertPointAt(s++,e+c,h),b.insertPointAt(s++,e,h),b.insertPointAt(s++,e-d,h)):(b.insertPointAt(s++,l+c,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l-d,h)));else{b.insertPointAt(s++,r,o);let t=0;180===this.C||0===this.C?((180===this.C?l>=y.bounds.right:l<=y.bounds.x)&&(t=(0===this.C?-d:c)/2),b.insertPointAt(s++,r+t,h)):((270===this.C?h>=y.bounds.bottom:h<=y.bounds.y)&&(t=(90===this.C?-d:c)/2),b.insertPointAt(s++,l,o+t)),b.insertPointAt(s++,l,h)}else d=Math.max(10,this.on[n.layer]),c=Math.max(10,this.Rs[n.layer]),t?180===this.C?(b.insertPointAt(s++,l-d-S,h),b.insertPointAt(s++,Math.min(l-d+S/2,l),h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,Math.max(l+c-S/2,l),h),b.insertPointAt(s++,l+c+S,h)):90===this.C?(b.insertPointAt(s++,l,h+c+S),b.insertPointAt(s++,l,Math.max(h+c-S/2,h)),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,Math.min(h-d+S/2,h)),b.insertPointAt(s++,l,h-d-S)):270===this.C?(b.insertPointAt(s++,l,h-d-S),b.insertPointAt(s++,l,Math.min(h-d+S/2,h)),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,Math.max(h+c-S/2,h)),b.insertPointAt(s++,l,h+c+S)):(b.insertPointAt(s++,l+c+S,h),b.insertPointAt(s++,Math.max(l+c-S/2,l),h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,Math.min(l-d+S/2,l),h),b.insertPointAt(s++,l-d-S,h)):(180!==this.C&&90!==this.C&&this.C,b.insertPointAt(s++,l,h));y=n}if(null===p||A!==Z.None||i)if(r=b.getPoint(s-1).x,o=b.getPoint(s-1).y,l=b.getPoint(s).x,h=b.getPoint(s).y,i){var N=this.Rs[v.layer];let t=0;180===this.C||0===this.C?((t=o)>=v.bounds.y&&t<=v.bounds.bottom&&(180===this.C?l>=v.bounds.x:l<=v.bounds.right)&&(e=v.centerX+(180===this.C?-N:N),t=t=v.bounds.x&&t<=v.bounds.right&&(270===this.C?h>=v.bounds.y:h<=v.bounds.bottom)&&(e=v.centerY+(270===this.C?-N:N),t=t=v.bounds.x?(e=v.bounds.x+v.bounds.width,b.setPointAt(s-2,e,o),b.setPointAt(s-1,e+c,o)):90===this.C&&h<=v.bounds.bottom?(e=v.bounds.y,b.setPointAt(s-2,r,e),b.setPointAt(s-1,r,e-d)):270===this.C&&h>=v.bounds.y?(e=v.bounds.y+v.bounds.height,b.setPointAt(s-2,r,e),b.setPointAt(s-1,r,e+c)):0===this.C&&l<=v.bounds.right&&(e=v.bounds.x,b.setPointAt(s-2,e,o),b.setPointAt(s-1,e-d,o));else{d=Math.max(10,this.on[v.layer]),c=Math.max(10,this.Rs[v.layer]);let t=0;180===this.C||0===this.C?((180===this.C?l<=v.bounds.x:l>=v.bounds.right)&&(t=(0===this.C?c:-d)/2),b.insertPointAt(s++,l+t,o)):((270===this.C?h<=v.bounds.y:h>=v.bounds.bottom)&&(t=(90===this.C?c:-d)/2),b.insertPointAt(s++,r,h+t)),b.insertPointAt(s++,l,h)}}else{for(;null!==v&&v!==y;){n=null,a=null;for(var L=v.destinationEdges.iterator;L.next();){var D=L.value;if(D.link===x.link&&(n=D.toVertex,null!==(a=D.fromVertex).node&&(a=null),null===n.node))break}if(null===n)break;n!==y&&(r=b.getPoint(s-1).x,o=b.getPoint(s-1).y,l=n.centerX,h=n.centerY,i?180===this.C||0===this.C?(null!==a?a.centerY:o)!==h&&(u=this.Gt[n.layer]+this.ur.x,s===b.firstPickIndex+1&&(u=0===this.C?Math.max(u,r):Math.min(u,r)),b.insertPointAt(s++,u,o),b.insertPointAt(s++,u,h)):(null!==a?a.centerX:r)!==l&&(u=this.Gt[n.layer]+this.ur.y,s===b.firstPickIndex+1&&(u=90===this.C?Math.max(u,o):Math.min(u,o)),b.insertPointAt(s++,r,u),b.insertPointAt(s++,l,u)):(d=Math.max(10,this.on[n.layer]),c=Math.max(10,this.Rs[n.layer]),t?180===this.C?(b.insertPointAt(s++,l+c+S,h),b.insertPointAt(s++,Math.max(l+c-S/2,l),h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,Math.min(l-d+S/2,l),h),b.insertPointAt(s++,l-d-S,h)):90===this.C?(b.insertPointAt(s++,l,h-d-S),b.insertPointAt(s++,l,Math.min(h-d+S/2,h)),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,Math.max(h+c-S/2,h)),b.insertPointAt(s++,l,h+c+S)):270===this.C?(b.insertPointAt(s++,l,h+c+S),b.insertPointAt(s++,l,Math.max(h+c-S/2,h)),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,Math.min(h-d+S/2,h)),b.insertPointAt(s++,l,h-d-S)):(b.insertPointAt(s++,l-d-S,h),b.insertPointAt(s++,Math.min(l-d+S/2,l),h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,l,h),b.insertPointAt(s++,Math.max(l+c-S/2,l),h),b.insertPointAt(s++,l+c+S,h)):180===this.C?(b.insertPointAt(s++,l+c,h),b.insertPointAt(s++,l-d,h)):90===this.C?(b.insertPointAt(s++,l,h-d),b.insertPointAt(s++,l,h+c)):270===this.C?(b.insertPointAt(s++,l,h+c),b.insertPointAt(s++,l,h-d)):(b.insertPointAt(s++,l-d,h),b.insertPointAt(s++,l+c,h)))),v=n}i&&(r=b.getPoint(s-1).x,o=b.getPoint(s-1).y,l=b.getPoint(s).x,h=b.getPoint(s).y,180===this.C||0===this.C?o!==h&&(u=0===this.C?Math.min(Math.max((l+r)/2,this.Gt[y.layer]+this.ur.x),l):Math.max(Math.min((l+r)/2,this.Gt[y.layer]+this.ur.x),l),b.insertPointAt(s++,u,o),b.insertPointAt(s++,u,h)):r!==l&&(u=90===this.C?Math.min(Math.max((h+o)/2,this.Gt[y.layer]+this.ur.y),h):Math.max(Math.min((h+o)/2,this.Gt[y.layer]+this.ur.y),h),b.insertPointAt(s++,r,u),b.insertPointAt(s++,l,u)))}null!==w&&t&&4<=b.pointsCount&&(null!==f&&(k=A===Z.None?b.getLinkPointFromPoint(g,f,f.getDocumentPoint(Z.Center),b.getPoint(3),!0):b.getPoint(0),A===Z.None&&(w=b.getPoint(2),A=b.getPoint(3),90===this.direction||270===this.direction?(b.setPointAt(1,(k.x+w.x)/2,w.y),b.setPointAt(2,A.x,(w.y+A.y)/2)):(b.setPointAt(1,w.x,(k.y+w.y)/2),b.setPointAt(2,(w.x+A.x)/2,A.y))),k.isReal()||k.set(g.actualBounds.center),b.setPointAt(0,k.x,k.y)),null!==p)&&(w=P===Z.None?b.getLinkPointFromPoint(m,p,p.getDocumentPoint(Z.Center),b.getPoint(b.pointsCount-4),!1):b.getPoint(b.pointsCount-1),P===Z.None&&(A=b.getPoint(b.pointsCount-3),P=b.getPoint(b.pointsCount-4),90===this.direction||270===this.direction?(b.setPointAt(b.pointsCount-2,(w.x+A.x)/2,A.y),b.setPointAt(b.pointsCount-2,P.x,(A.y+P.y)/2)):(b.setPointAt(b.pointsCount-2,A.x,(w.y+A.y)/2),b.setPointAt(b.pointsCount-3,(A.x+P.x)/2,P.y))),w.isReal()||w.set(m.actualBounds.center),b.setPointAt(b.pointsCount-1,w.x,w.y)),b.commitRoute(),x.commit()}}}}ZO(){this.Wy=-1,this.Eg=0,this.Fs=0,this.sf=null,this.Bg=null,this.tu=null;for(let t=0;t=this.Xn.length){var s=[];for(let t=0;t{var e;return t instanceof D?!t.isLinkLabel&&"Comment"!==t.category:t instanceof Y&&null!==(e=t.fromNode)&&!e.isLinkLabel&&"Comment"!==e.category&&!(null===(e=t.toNode)||e.isLinkLabel||"Comment"===e.category)};return t instanceof G?(e.addParts(t.nodes,!0,i),e.addParts(t.links,!0,i)):t instanceof X?e.addParts(t.memberParts,!1,i):e.addParts(t.iterator,!1,i),e}doLayout(t){Ht,null===t&&Kt.n("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts"),null===this.network&&(this.network=this.makeNetwork(t)),52!==this.arrangement&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));let e=this.diagram;null===e&&t instanceof G&&(e=t),0===this.path&&null!==e?this.ms=e.isTreePathToChildren?1:2:this.ms=0===this.path?1:this.path,0t.level||(this.Y3(e.parent,e),0))}X3(t,e){if(null===e)return!1;Ht,Kt.s(t,et,tt,"isAncestor:a"),Ht,Kt.s(e,et,tt,"isAncestor:b");let i=e.parent;for(;null!==i&&i!==t;)i=i.parent;return i===t}Y3(t,s){if(null!==t&&null!==s){Ht,Kt.s(t,et,tt,"removeChild:p"),Ht,Kt.s(s,et,tt,"removeChild:c");var n=t.children;let i=0;for(let t=0;tk&&(ak&&(rt&&(t=s+e.width),s<0&&(t-=s),t;case 22:return e.width>i?e.width:i;case 23:return 2*e.focus.x>i?e.width:i+e.width-2*e.focus.x;case 24:case 25:var n=Math.min(0,s),a=Math.max(i,s+e.width);return Math.max(e.width,a-n);case 26:return e.width-e.focus.x+e.nodeSpacing/2+i;case 27:return Math.max(e.width,e.focus.x+e.nodeSpacing/2+i);default:return i}}JN(e,i,s){switch(Ht,Kt.s(e,et,tt,"calculateSubheight:v"),e.alignment){case 21:case 20:let t=i;return s+e.height>t&&(t=s+e.height),s<0&&(t-=s),t;case 22:return e.height>i?e.height:i;case 23:return 2*e.focus.y>i?e.height:i+e.height-2*e.focus.y;case 24:case 25:var n=Math.min(0,s),a=Math.max(i,s+e.height);return Math.max(e.height,a-n);case 26:return e.height-e.focus.y+e.nodeSpacing/2+i;case 27:return Math.max(e.height,e.focus.y+e.nodeSpacing/2+i);default:return i}}ZN(t,e,i){switch(Ht,Kt.it(t,Ei,"TreeAlignment"),t){case 20:case 21:e/=2,i/=2;break;case 22:i=e=0;break;case 23:break;default:Kt.n("Unhandled alignment value "+t.toString())}return new _(e,i)}of(t,e,i,s,n,a){Ht,Kt.s(t,et,tt,"shiftRelPosAlign:v"),Ht,Kt.it(e,Ei,"TreeAlignment");e=this.ZN(e,i,s);this.ru(t,e.x,e.y,n,a)}ru(t,e,i,s,n){if(Ht,Kt.s(t,et,tt,"shiftRelPos:v"),0!==e||0!==i){var a=t.children;for(let t=s;t<=n;t++){var r=a[t].X;r.x+=e,r.y+=i}}}wk(t,e,i){Ht,Kt.s(t,et,tt,"recordMidPoints:v"),Kt.t(e,"number",tt,"recordMidPoints:x"),Kt.t(i,"number",tt,"recordMidPoints:y");var s=t.parent;switch(this.ms){case 1:for(var n=t.sourceEdges;n.next();){var a=n.value;a.fromVertex===s&&a.relativePoint.e(e,i)}break;case 2:for(var r=t.destinationEdges;r.next();){var o=r.value;o.toVertex===s&&o.relativePoint.e(e,i)}break;default:Kt.n("Unhandled path value "+this.ms.toString())}}U3(A){if(Ht,Kt.s(A,et,tt,"layoutTreeBlock:v"),0===A.childrenCount){var P=A.parent;let t=!1,e=0,i;null!==P&&(e=P.angle,i=P.alignment,t=this.isBusAlignment(i));P=this.WN(A);A.X.e(0,0),A.kt.e(A.width,A.height),null===A.parent||null===A.comments||(180!==e&&270!==e||t)&&!P?A.ht.e(0,0):180===e&&!t||(90===e||270===e)&&P?A.ht.e(A.width-2*A.focus.x,0):A.ht.e(0,A.height-2*A.focus.y),A.Yg=null,void(A.Kg=null)}else{var k=this.orthoAngle(A),S=90===k||270===k;let i=0;var M=A.children,C=M.length;for(let t=0;tB&&(uB&&(ds&&(P=this.ZN(L,V-s,0),y=P.x,b=P.y,s=V,p=0):s=this.jN(A,s,p),p<0&&(y-=p,p=0),135n&&(D=this.ZN(L,0,z-n),y=D.x,b=D.y,n=z,v=0):n=this.JN(A,n,v),v<0&&(b-=v,v=0),y+=V+F);let x,w;if(0x[0].x?x[2].c(x[1]):x[1].c(x[2])),x[3].yx[0].x?x[3].c(x[2]):x[2].c(x[3])),w[0].e(p+V,0),w[1].e(w[0].x,z),w[2].yx[0].y?x[2].c(x[1]):x[1].c(x[2])),x[3].xx[0].y?x[3].c(x[2]):x[2].c(x[3])),w[0].e(0,v+z),w[1].e(V,w[0].y),w[2].xh;){var u=e[a++];s[r++].e(u.x,u.y+i)}var d=this.ye(r);for(n=0;nh;){var u=e[a++];s[r++].e(u.x+i,u.y)}var d=this.ye(r);for(n=0;nh;){var u=t[n++];s[r++].e(u.x,u.y)}var d=this.ye(r);for(n=0;nh;){var u=t[n++];s[r++].e(u.x,u.y)}var d=this.ye(r);for(n=0;ng&&d.xd.x&&gm&&d.yd.y&&mm.y+n.rowIndent&&(s=Math.min(s,Math.max(e.y,s-r.computeNodeIndent(n))))):22===n.alignment?(s=l.top+o.y,0===o.y&&e.ym.x+n.rowIndent&&(s=Math.min(s,Math.max(e.x,s-r.computeNodeIndent(n))))):22===n.alignment?(s=l.left+o.x,0===o.x&&e.xm.y+n.rowIndent&&(s=Math.min(s,Math.max(e.y,s-r.computeNodeIndent(n))))):22===n.alignment?(s=l.top+o.y,0===o.y&&e.ym.x+n.rowIndent&&(s=Math.min(s,Math.max(e.x,s-r.computeNodeIndent(n))))):22===n.alignment?(s=l.left+o.x,0===o.x&&e.x{t=t.matches?"dark":"light";t!==this.Ug&&(this.Ug=t,"system"===this.Dk)&&this.pw()};constructor(t){t&&Object.assign(this,t),t?.themeMap||(this.lu.set("light",{colors:{...qi.Light.colors},fonts:{...qi.Light.fonts},numbers:{...qi.Light.numbers},margins:{...qi.Light.margins},arrowheads:{...qi.Light.arrowheads}}),this.lu.set("dark",{colors:{...qi.Dark.colors},fonts:{...qi.Dark.fonts},numbers:{...qi.Dark.numbers},margins:{...qi.Dark.margins},arrowheads:{...qi.Dark.arrowheads}})),v.matchMedia&&(this.Ug=v.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")}get themeMap(){return this.lu}set themeMap(t){this.lu!==t&&(this.lu=t,this.pw())}get defaultTheme(){return this.Tk}set defaultTheme(t){this.Tk!==t&&(Kt.t(t,"string",ji,"defaultTheme"),this.Tk=t,this.pw())}get currentTheme(){return this.Dk}set currentTheme(t){this.Dk!==t&&(Kt.t(t,"string",ji,"currentTheme"),this.Dk=t,this.pw())}get changesDivBackground(){return this.Fk}set changesDivBackground(t){if(this.Fk!==t&&(this.Fk=t))for(const e of this.as)e.setDivBackground(this.findValue("div","","fill")),e.V("ThemeChanged",this)}get preferredColorScheme(){return this.Ug}addDiagram(t){return this.as.add(t),this.QN(t),this}removeDiagram(t){return this.as.delete(t),this.QN(t),this}qF(){0===this.as.size&&v.matchMedia&&v.matchMedia("(prefers-color-scheme: dark)")?.addEventListener("change",this.LD)}WF(){0===this.as.size&&v.matchMedia&&v.matchMedia("(prefers-color-scheme: dark)")?.removeEventListener("change",this.LD)}set(t,e){"system"===(t=""===t?this.Tk:t)&&(t=this.Ug);let i=this.lu.get(t);return i=i?this.TD(i,e):e,this.lu.set(t,i),this.pw(),this}findValue(t,e,i){return this.getValue(this.findTheme(this.currentTheme),t,e,i)||this.getValue(this.findTheme(this.defaultTheme),t,e,i)}getValue(t,e,i,n){if(t){null==i&&(i="");let s=t;const r=t=>{if(void 0!==s&&""!==t){if("number"==typeof t||!Array.isArray(t)&&!t.includes("."))return s[t];var e=Array.isArray(t)?t:t.split(".");for(let t=0;t{if(""===i||void 0!==(s=r(i)))return s=Array.isArray(s)&&"number"==typeof e?s[e%s.length]:r(e)};if(void 0===(s=o())&&"string"==typeof n&&0=qe.qd&&(l.GA(),f.inflate(l.cellWidth*l.zP,l.cellHeight*l.XP),l.fT(e,i,s,n,f,!1),p=l._i(s.x,s.y)),!l.Cy&&pqe.xo&&n._i(d,c)!==l-1&&(n._i(h-r,u)===l-1?(a=180,d=h-r,c=u):n._i(h+r,u)===l-1?(a=0,d=h+r,c=u):n._i(h,u-o)===l-1?(a=270,d=h,c=u-o):n._i(h,u+o)===l-1&&(a=90,d=h,c=u+o));l>qe.xo&&n._i(d,c)===l-1;)h=d,u=c,0===a?d+=r:90===a?c+=o:180===a?d-=r:c-=o,--l;if(i?l>qe.xo&&(180===a||0===a?h=Math.floor(h/r)*r+r/2:90!==a&&270!==a||(u=Math.floor(u/o)*o+o/2)):(h=Math.floor(h/r)*r+r/2,u=Math.floor(u/o)*o+o/2),l>qe.xo){let i=a,t=h,e=u;if(0===a?(i=90,e+=o):90===a?(i=180,t-=r):180===a?(i=270,e-=o):270===a&&(i=0,t+=r),n._i(t,e)===l-1)this.vd(s,n,t,e,i,!1);else{let t=h,e=u;0===a?(i=270,e-=o):90===a?(i=0,t+=r):180===a?(i=90,e+=o):270===a&&(i=180,t-=r),n._i(t,e)===l-1&&this.vd(s,n,t,e,i,!1)}}s.insertPointAt(s.pointsCount-2,h,u)}}st.prototype.initializeStandardTools=function(){this.ii("Action",new ct,this.mouseDownTools),this.ii("Relinking",new ot,this.mouseDownTools),this.ii("LinkReshaping",new lt,this.mouseDownTools),this.ii("Rotating",new ut,this.mouseDownTools),this.ii("Resizing",new ht,this.mouseDownTools),this.ii("Linking",new rt,this.mouseMoveTools),this.ii("Dragging",new d,this.mouseMoveTools),this.ii("DragSelecting",new mt,this.mouseMoveTools),this.ii("Panning",new ft,this.mouseMoveTools),this.ii("ContextMenu",new yt,this.mouseUpTools),this.ii("TextEditing",new At,this.mouseUpTools),this.ii("ClickCreating",new gt,this.mouseUpTools),this.ii("ClickSelecting",new dt,this.mouseUpTools)},G.xP("GraphLinksModel",ii),G.xP("TreeModel",si);var n=v.go,a={get version(){return G.version},Group:X,List:O,Set:N,Map:L,Point:_,Size:Yt,Rect:Q,Margin:I,Spot:Z,Geometry:W,PathFigure:S,PathSegment:A,InputEvent:C,DiagramEvent:B,ChangedEvent:E,Model:b,GraphLinksModel:oi,TreeModel:li,Binding:ai,ThemeBinding:ri,Transaction:R,UndoManager:U,CommandHandler:Gt,Tool:J,DraggingTool:d,DraggingInfo:Et,DraggingOptions:Ot,LinkingBaseTool:nt,LinkingTool:rt,RelinkingTool:ot,LinkReshapingTool:lt,ResizingTool:ht,RotatingTool:ut,ClickSelectingTool:dt,ActionTool:ct,ClickCreatingTool:gt,HTMLInfo:pt,ContextMenuTool:yt,DragSelectingTool:mt,PanningTool:ft,TextEditingTool:At,ToolManager:st,Animation:St,AnimationManager:kt,AnimationTrigger:Nt,Layer:Lt,Diagram:G,Palette:It,Overview:Vt,Brush:m,GraphObject:y,Panel:Xt,RowColumnDefinition:we,Shape:q,TextBlock:j,Picture:Le,Part:H,Adornment:K,Node:D,Link:Y,Placeholder:Xe,Layout:Ue,LayoutNetwork:_e,LayoutVertex:We,LayoutEdge:Qe,GridLayout:ti,PanelLayout:se,CircularLayout:gi,CircularNetwork:fi,CircularVertex:pi,CircularEdge:vi,ForceDirectedLayout:yi,ForceDirectedNetwork:bi,ForceDirectedVertex:xi,ForceDirectedEdge:wi,LayeredDigraphLayout:Ni,LayeredDigraphNetwork:Li,LayeredDigraphVertex:Di,LayeredDigraphEdge:Ti,TreeLayout:tt,TreeNetwork:zi,TreeVertex:et,TreeEdge:Gi,Themes:qi,ThemeManager:ji,Router:Hi,AnimationStyle:Pt,AutoScale:Dt,CycleMode:Tt,Flip:Ut,TextFormat:Se,ImageStretch:Ne,LayoutConditions:a,LinkAdjusting:Ie,Curve:ze,Routing:Ve,Orientation:jt,TextOverflow:ke,PortSpreading:Re,ScrollMode:Bt,CollapsePolicy:e,Sizing:xe,TriggerStart:Ct,Stretch:qt,ViewboxStretch:pe,Wrap:Pe,BrushType:ee,ColorSpace:i,GeometryStretch:k,GeometryType:P,SegmentType:M,BindingMode:ni,ChangeType:F,CircularArrangement:hi,CircularDirection:ui,CircularNodeDiameterFormula:ci,CircularSorting:di,GridAlignment:Ze,GridArrangement:Je,GridSorting:$e,LayeredDigraphAggressive:Ci,LayeredDigraphAlign:Pi,LayeredDigraphCycleRemove:ki,LayeredDigraphInit:Mi,LayeredDigraphLayering:Si,LayeredDigraphPack:s,TreeAlignment:Ei,TreeArrangement:Ii,TreeCompaction:Ri,TreeLayerStyle:Vi,TreePath:Bi,TreeSorting:Fi,TreeStyle:Oi,GestureMode:it,LinkingDirection:at,ReshapingBehavior:t,TextEditingAccept:bt,TextEditingStarting:xt,TextEditingState:wt,WheelMode:$};"object"==typeof n&&n.version&&Kt.ft("WARNING: a `go` object on the root object is already defined. "+("Debug"in n?"debug ":"")+"version: "+n.version+", replaced with version: "+a.version),G.prototype.go=a,((v.go=a).Debug=Ht).attachReadonlyWarnings(a)}(),"function"==typeof define&&define.amd&&define(("undefined"!=typeof global?global:self).go),"undefined"!=typeof module&&"object"==typeof module.exports&&(module.exports=("undefined"!=typeof global?global:self).go);const bino=go;class TopLeftBorderRadius extends bino.Shape{constructor(){super(),this._figure="TopLeftBorderRadius"}makeGeometry(){var t=new bino.Geometry,e=new bino.PathFigure(0,0,!0);return e.add(new bino.PathSegment(bino.PathSegment.Line,0,6)),e.add(new bino.PathSegment(bino.PathSegment.Arc,180,90,6,6,6,6)),t.add(e),t}}bino.Shape.defineFigureGenerator("TopLeftBorderRadius",t=>{return(new TopLeftBorderRadius).makeGeometry()});class BottomLeftBorderRadius extends bino.Shape{constructor(){super(),this._figure="BottomLeftBorderRadius"}makeGeometry(){var t=new bino.Geometry,e=new bino.PathFigure(0,0,!0);return e.add(new bino.PathSegment(bino.PathSegment.Arc,180,-90,6,0,6,6)),e.add(new bino.PathSegment(bino.PathSegment.Line,0,6)),t.add(e),t}}bino.Shape.defineFigureGenerator("BottomLeftBorderRadius",t=>{return(new BottomLeftBorderRadius).makeGeometry()});var $=bino.GraphObject.make;function addQueryParam(t,e){var i=new URL(window.location);i.searchParams.set(t,e),window.history.replaceState({},"",i)}function removeQueryParam(t){var e=new URL(window.location);e.searchParams.delete(t),window.history.replaceState({},"",e)}function decodeUrlSafeBase64ToUtf8(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");for(;e.length%4;)e+="=";t=atob(e),t=Uint8Array.from(t,t=>t.charCodeAt(0));return(new TextDecoder).decode(t)}function encodeUtf8ToUrlSafeBase64(t){t=(new TextEncoder).encode(t),t=String.fromCharCode(...t);let e=btoa(t);return e=e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}bino.useNonePhoto=function(t){return!t.hasImage&&!t.living&&null==t.birthDate&&null==t.marriageDate&&null==t.deathDate&&null==t.birthPlace&&null==t.marriagePlace&&null==t.deathPlace},bino.getRelativeDates=function(t,e){if(t.useNonePhoto)return"";var{living:i,birthDate:s,deathDate:n}=t,a=bino.calculateAge(s,n);let r=a;var o=bino.formatDate(t.birthDate,e&&t.living),e=bino.formatDate(t.marriageDate,e&&t.living),l=bino.formatDate(t.deathDate,!1);return o||l||e?o?l?(n.includes("after")?r=s.includes("after")?"~"+a:(s.includes("before")||s.includes("about"),a+"+"):n.includes("before")?r=s.includes("after")?a+"-":s.includes("before")?"~"+a:(s.includes("about"),a+"-"):n.includes("about")?r="~"+a:s.includes("after")?r=a+"-":s.includes("before")?r=a+"+":s.includes("about")&&(r="~"+a),t.deathAge&&(r=t.deathAge),String(r).includes("NaN")?e?o+` — ${e} — `+l:o+" — "+l:e?""+o+` — ${e} — ${l} (${r})`:""+o+` — ${l} (${r})`):(t.deathAge&&(r=t.deathAge),String(r).includes("NaN")?e?o+` — ${e} — `+(i?"Living":"Deceased"):o+" — "+(i?"Living":"Deceased"):e?o+` — ${e} — `+(i?"Living":"Deceased")+(i?` (${r})`:""):o+" — "+(i?"Living":"Deceased")+(i?` (${r})`:"")):(n=t.deathAge?` (${t.deathAge})`:"",e?l?` — ${e} — `+l+n:` — ${e} — `+(i?"Living":"Deceased")+n:" — "+l+n):i?"Living":"Deceased"},bino.convertCountryCode=function(t){if(!t)return t;var e=t.split(",").map(t=>t.trim());t.length<37&&(e[e.length-1]={USA:"United States of America",PHL:"Philippines",BHR:"Bahrain"}[e[e.length-1]]);let i=e.join(", ");return i=44<=i.length&&i.toLowerCase().includes("south caloocan")?i.replace("South Caloocan","S. Caloocan"):i},bino.calculateAge=function(t,e){t=new Date(t),e=e?new Date(e):new Date;let i=e.getFullYear()-t.getFullYear();var s=e.getMonth()-t.getMonth();return(s<0||0==s&&e.getDate()',beautician:'',beer:'',buysell:'',cattle:'',church:'',computer:'',dna:'',farming:'',"female-twin":'',government:'',househusband:'',housewife:'',intelligence:'',investigate:'',justice:'',"male-twin":'',manager:'',manufacturing:'',military:'',police:'',prelations:'',retail:'',sales:'',seaman:'',sergeant:'',software:'',train:'',book:'',fishery:'',skull:'',centennial:''},DARK_MARKERS={apparel:LIGHT_MARKERS.apparel,beautician:LIGHT_MARKERS.beautician,book:LIGHT_MARKERS.book,househusband:LIGHT_MARKERS.househusband,housewife:LIGHT_MARKERS.housewife,retail:LIGHT_MARKERS.retail,"female-twin":LIGHT_MARKERS["female-twin"],"male-twin":LIGHT_MARKERS["male-twin"],centennial:'',train:LIGHT_MARKERS.train.replace("#333333","#EAEAEA"),skull:LIGHT_MARKERS.skull.replace("#333333","#EAEAEA"),beer:LIGHT_MARKERS.beer.replace("#BD5C17","#B3825D"),buysell:LIGHT_MARKERS.buysell.replace("#333333","#EAEAEA"),cattle:LIGHT_MARKERS.cattle.replace("#BD5C17","#B3825D"),church:LIGHT_MARKERS.church.replace("#333333","#EAEAEA"),dna:LIGHT_MARKERS.dna.replace("#9831CF","#B73DF9"),intelligence:LIGHT_MARKERS.intelligence.replace("#4285F4","#4B8FFF"),justice:LIGHT_MARKERS.justice.replace("#4285F4","#4B8FFF"),farming:LIGHT_MARKERS.farming.replace("#259F31","#28BC36"),fishery:LIGHT_MARKERS.fishery.replace("#333333","#EAEAEA"),government:LIGHT_MARKERS.government.replace("#333333","#EDD5BB"),investigate:LIGHT_MARKERS.investigate.replace("#333333","#EAEAEA"),manufacturing:LIGHT_MARKERS.manufacturing.replace("#333333","#EAEAEA"),military:LIGHT_MARKERS.military.replace("#E99E0E","#FFB11B"),police:LIGHT_MARKERS.police.replace("#4285F4","#4B8FFF"),sales:LIGHT_MARKERS.sales.replace("#E99E0E","#FFB11B"),prelations:LIGHT_MARKERS.prelations.replace("#E99E0E","#FFB11B"),computer:LIGHT_MARKERS.computer.replace("#333333","#B6BFBF"),seaman:LIGHT_MARKERS.seaman.replace("#333333","#EAEAEA"),sergeant:LIGHT_MARKERS.sergeant.replace("#E99E0E","#FFB11B"),software:LIGHT_MARKERS.software.replace("#333333","#FFFFFF"),manager:LIGHT_MARKERS.manager.replace("#333333","#FFFFFF")};let MARKERS={};for(const[uS1,vS1]of Object.entries(isDark?DARK_MARKERS:LIGHT_MARKERS))MARKERS[uS1]="data:image/svg+xml;base64,"+btoa(vS1);var TREE_DATA=[{baptismDate:null,birthDate:"2025-03-15",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"80378400",lastName:"Argabioso",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Adanza",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Yeusef Loran",fid:"G1Q7-J85",height:0,width:0,paternal_siblings:[],father:"85203214",maternal_siblings:[],mother:"16057808",regular_siblings:[]},{baptismDate:"1995-05-27",birthDate:"1995-04-19",birthPlace:"Chinese General Hospital, Manila, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!0,hasImage:!0,key:"85203214",lastName:"Argabioso",living:!0,livingPlace:"Sangandaan, South Caloocan, PHL",marriageDate:"2024-06-15",marriagePlace:"St. John Bosco Parish Church, Makati, PHL",middleName:"Acosta",nickname:"Bino",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Arbyn",baptismPlace:"San Roque Cathedral Parish, South Caloocan, PHL",marker:"computer",marker3:"software",fid:"GQX8-CQP",child:"80378400",paternal_siblings:["70275697"],father:"50954818",maternal_siblings:["21719634","41448711"],mother:"50342947",regular_siblings:[]},{baptismDate:null,birthDate:"1965-10-09",birthPlace:"Maternity House, Poblacion, South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!0,hasImage:!0,key:"50954818",lastName:"Argabioso",living:!0,livingPlace:"Malolos, Bulacan, PHL",marriageDate:"2002-04-26",marriagePlace:"Regional Trial Court BR 226, Quezon City, PHL",middleName:"Saplala",nickname:"Olan",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Rolando",marker:"government",marker3:"justice",marker4:"prelations",fid:"GQJK-L51",child:"85203214",paternal_siblings:[],father:"96832424",maternal_siblings:[],mother:"82099124",regular_siblings:["4793299","48615922"]},{baptismDate:null,birthDate:"1932-10-13",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"2020-02-27",deathPlace:"Manila Memorial Park, Plaridel, Bulacan, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"96832424",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:"1963-01-23",marriagePlace:"Luisiana, Laguna, PHL",middleName:"Mia",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Marcial",marker:"beer",marker2:"prelations",fid:"GQJK-LCT",child:"50954818",paternal_siblings:[],father:"79164376",maternal_siblings:[],mother:"53221118",regular_siblings:["7663556","36448299","21653420","85278460"]},{baptismDate:null,birthDate:"about 1895",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"1972-10-27",deathPlace:"Municipal Cemetery, Majayjay, Laguna, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"79164376",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Lopecillo",nickname:"Bio",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Eusebio",marker:"farming",fid:"GHBZ-TM4",child:"96832424",maternal_siblings:["52063403","83646651"],mother:"17601526",paternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"about 1861",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"1951-08-30",deathPlace:"Catholic Cemetery, Majayjay, Laguna, PHL",gender:"F",hasDNA:!1,hasImage:!1,key:"17601526",lastName:"Lopecillo",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Estebana",fid:"GHB8-RCH",child:"79164376",paternal_siblings:[],father:"24157287",maternal_siblings:[],mother:"1093684",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"24157287",lastName:"Lopecillo",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Simplicio",fid:"G2HQ-YQS",child:"17601526",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"1093684",lastName:"Villarubin",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Gregoria",fid:"G2H7-Q75",child:"17601526",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"before 1910",birthPlace:null,deathAge:null,deathDate:"after 1936-10-13",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"53221118",lastName:"Mia",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Francisca",fid:"GHBZ-P5Q",child:"96832424",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1944-11-24",birthPlace:"San Rafael, Baruya, Lubao, Pampanga, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!0,hasImage:!0,key:"82099124",lastName:"Saplala",living:!0,livingPlace:"Malolos, Bulacan, PHL",marriageDate:"1963-01-23",marriagePlace:"Luisiana, Laguna, PHL",middleName:"Perez",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Lydia",marker:"retail",marker3:"sales",fid:"GHBZ-YVX",child:"50954818",paternal_siblings:[],father:"78763160",maternal_siblings:[],mother:"25174592",regular_siblings:["31493676","46768390"]},{baptismDate:null,birthDate:"1916-05-30",birthPlace:"Lubao, Pampanga, PHL",deathAge:null,deathDate:"1993-05-03",deathPlace:"Dinalupihan, Bataan, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"78763160",lastName:"Saplala",living:!1,livingPlace:null,marriageDate:"1937",marriagePlace:"Lubao, Pampanga, PHL",middleName:null,nickname:"Andong",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Fernando",marker:"military",marker2:"skull",fid:"GHB8-7T6",child:"82099124",paternal_siblings:[],father:"71728184",maternal_siblings:[],mother:"66525244",regular_siblings:["38373110","40891293"]},{baptismDate:null,birthDate:"before 1892",birthPlace:null,deathAge:null,deathDate:"after 1915-07",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"71728184",lastName:"Saplala",living:!1,livingPlace:null,marriageDate:"1902-09-17",marriagePlace:"Guagua, Pampanga, PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Estanislao",fid:"GNNH-JLM",child:"78763160",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"before 1892",birthPlace:null,deathAge:null,deathDate:"after 1916-05",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"66525244",lastName:"Sison",living:!1,livingPlace:null,marriageDate:"1902-09-17",marriagePlace:"Guagua, Pampanga, PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Adela",fid:"GJJX-1SG",child:"78763160",paternal_siblings:[],father:"12094064",maternal_siblings:[],mother:"14775735",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"12094064",lastName:"Sumangui",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Estanislao",child:"66525244",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"14775735",lastName:"Sison",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Florentina",child:"66525244",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1919-11-16",birthPlace:"Orani, Bataan, PHL",deathAge:null,deathDate:"1986-10-02",deathPlace:"Dinalupihan, Bataan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"25174592",lastName:"Perez",living:!1,livingPlace:null,marriageDate:"1937",marriagePlace:"Lubao, Pampanga, PHL",middleName:null,nickname:"Lucing",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Lucina",marker:"housewife",fid:"GHB8-GZL",child:"82099124",paternal_siblings:[],father:"65750680",maternal_siblings:[],mother:"40517733",regular_siblings:[]},{baptismDate:null,birthDate:"before 1913",birthPlace:null,deathAge:null,deathDate:"after 1952",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"65750680",lastName:"Perez",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Victor",marker:"fishery",fid:"GHB8-M8D",child:"25174592",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"40517733",lastName:"Gutierrez",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Genoveba",fid:"GHB8-M86",child:"25174592",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:"1971-09-05",birthDate:"1971-03-10",birthPlace:"The Family Clinic, Sampaloc, Manila, PHL",deathAge:null,deathDate:"2018-05-25",deathPlace:"Municipal Cemetery, Magdalena, Laguna, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"50342947",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:"2003-02-03",marriagePlace:"City Hall, Ermita, Manila, PHL",middleName:"Maramba",nickname:"Babycor",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Corazon",baptismPlace:"San Roque Cathedral Parish, South Caloocan, PHL",marker:"housewife",fid:"GQJK-G8W",child:"85203214",paternal_siblings:[],father:"80469632",maternal_siblings:[],mother:"58601193",regular_siblings:["4256552","77082334"]},{baptismDate:null,birthDate:"1948-07-06",birthPlace:"North General Hospital, España, Manila, PHL",deathAge:null,deathDate:"1979-06-07",deathPlace:"Monterey Park, Los Angeles, California, USA",gender:"M",hasDNA:!1,hasImage:!0,key:"80469632",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:"1966-03-26",marriagePlace:"Knox Methodist Church, Manila, PHL",middleName:"San Agustin",nickname:"Bhoy",prefix:null,suffix:"Jr.",vitalsCompleteAndVerified:!1,firstName:"Manuel",marker:"male-twin",marker2:"seaman",fid:"GHBD-7M4",child:"50342947",paternal_siblings:[],father:"59135880",maternal_siblings:[],mother:"54923824",regular_siblings:["41491264","54340914","12725118","73841862"]},{baptismDate:null,birthDate:"1913-11-10",birthPlace:"Orani, Bataan, PHL",deathAge:null,deathDate:"1994-11-20",deathPlace:"Forest Lawn, Covina, Los Angeles, California, USA",gender:"M",hasDNA:!1,hasImage:!0,key:"59135880",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:"1951-03-05",marriagePlace:"St. Paul's Methodist Church, Tondo, Manila, PHL",middleName:"Bongco",nickname:"Maning",prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Manuel",marker:"police",marker2:"investigate",fid:"GHBD-9L6",child:"80469632",paternal_siblings:[],father:"91699953",maternal_siblings:[],mother:"91567169",regular_siblings:["6375936","64329171"]},{baptismDate:null,birthDate:"about 1871",birthPlace:"Orani, Bataan, PHL",deathAge:null,deathDate:"1948-07-07",deathPlace:"Orani, Bataan, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"91699953",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Ligorio",fid:"GHB8-SQN",child:"59135880",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"before 1903",birthPlace:"Luzon, PHL",deathAge:null,deathDate:"after 1951-03-05",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"91567169",lastName:"Bongco",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Maximiana",fid:"GHB8-5K8",child:"59135880",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1925-12-21",birthPlace:"Philippine General Hospital, Ermita, Manila, PHL",deathAge:null,deathDate:"2008-10-09",deathPlace:"Forest Lawn, Covina, Los Angeles, California, USA",gender:"F",hasDNA:!1,hasImage:!0,key:"54923824",lastName:"San Agustin",living:!1,livingPlace:null,marriageDate:"1951-03-05",marriagePlace:"St. Paul's Methodist Church, Tondo, Manila, PHL",middleName:null,nickname:"Nati",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Natividad",marker:"housewife",fid:"GHB8-DXY",child:"80469632",paternal_siblings:[],father:"79826472",maternal_siblings:[],mother:"45640239",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"79826472",lastName:"San Agustin",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Vicente",fid:"GHB8-LCC",child:"54923824",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"45640239",lastName:null,living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Nena",fid:"GHB8-H7K",child:"54923824",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1943-01-28",birthPlace:"Azcarraga, Binondo, Manila, PHL",deathAge:null,deathDate:"1974-08-10",deathPlace:"Sangandaan Cemetery, South Caloocan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"58601193",lastName:"Maramba",living:!1,livingPlace:null,marriageDate:"1966-03-26",marriagePlace:"Knox Methodist Church, Manila, PHL",middleName:"Dumantay",nickname:"Lina",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Catalina",marker:"housewife",fid:"GHB8-J1B",child:"50342947",paternal_siblings:[],father:"51727808",maternal_siblings:[],mother:"30299840",regular_siblings:["95216770","55618304","42349252","95739264"]},{baptismDate:null,birthDate:"1903-04-22",birthPlace:"Santa Barbara, Pangasinan, PHL",deathAge:null,deathDate:"1969-12-12",deathPlace:"Sangandaan Cemetery, South Caloocan, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"51727808",lastName:"Maramba",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"Luzon, PHL",middleName:"Reyes",nickname:"Sotering",prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Sotero",marker:"police",marker2:"train",fid:"GHB8-GB6",child:"58601193",paternal_siblings:[],father:"51683352",maternal_siblings:[],mother:"50346650",regular_siblings:["28928680","392680","47386677","57182283"]},{baptismDate:null,birthDate:"about 1858",birthPlace:"Santa Barbara, Pangasinan, PHL",deathAge:null,deathDate:"after 1902-06",deathPlace:"Santa Barbara, Pangasinan, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"51683352",lastName:"Maramba",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Bautista",nickname:null,prefix:"Don",suffix:null,vitalsCompleteAndVerified:!1,firstName:"Miguel",marker:"government",fid:"LLQS-641",child:"51727808",paternal_siblings:[],father:"61599560",maternal_siblings:[],mother:"53643498",regular_siblings:["93051591"]},{baptismDate:null,birthDate:"from 1800 to 1858",birthPlace:null,deathAge:null,deathDate:null,deathPlace:"Santa Barbara, Pangasinan, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"61599560",lastName:"Maramba",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"B.",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Guillermo",marker:"sales",marker2:"cattle",fid:"LLQS-6YC",child:"51683352",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"from 1800 to 1858",birthPlace:null,deathAge:null,deathDate:null,deathPlace:"Santa Barbara, Pangasinan, PHL",gender:"F",hasDNA:!1,hasImage:!1,key:"53643498",lastName:"Bautista",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Garcia",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Maria",fid:"L281-614",child:"51683352",paternal_siblings:[],father:"85964364",maternal_siblings:[],mother:"89545654",regular_siblings:[]},{baptismDate:null,birthDate:"from 1735 to 1853",birthPlace:null,deathAge:null,deathDate:"after 1881",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"85964364",lastName:"Bautista",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:"Don",suffix:null,vitalsCompleteAndVerified:!1,firstName:"Agustin",marker:"government",fid:"GC7T-H59",child:"53643498",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"89545654",lastName:"Garcia",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:"Doña",suffix:null,vitalsCompleteAndVerified:!1,firstName:"Felipa",fid:"GC7T-1PK",child:"53643498",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"50346650",lastName:"Reyes",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Novilla",nickname:"Mitcher",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Mercedes",fid:"LLQS-6F1",child:"51727808",paternal_siblings:[],father:"23571091",maternal_siblings:[],mother:"90879248",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"23571091",lastName:"Reyes",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Gregorio",fid:"G7C3-B6P",child:"50346650",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"90879248",lastName:"Novilla",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Leocadia",fid:"G7C3-J9S",child:"50346650",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1918-04-19",birthPlace:"Luzon, PHL",deathAge:null,deathDate:"1990-04-16",deathPlace:"Sangandaan Cemetery, South Caloocan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"30299840",lastName:"Dumantay",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"Luzon, PHL",middleName:null,nickname:"Cresing",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Cresencia",marker:"apparel",marker2:"sales",fid:"GHBD-9LY",child:"58601193",maternal_siblings:[],mother:"78945712",paternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"before 1908",birthPlace:null,deathAge:"50+",deathDate:"after 1918-04-19",deathPlace:"Luzon, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"78945712",lastName:null,living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,fid:"GY85-YPS",firstName:"Unknown name",child:"30299840",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1994-12-16",birthPlace:"Dr. Jose Fabella Memorial Hospital, Manila, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!0,hasImage:!0,key:"16057808",lastName:"Adanza",living:!0,livingPlace:"Sangandaan, South Caloocan, PHL",marriageDate:"2024-06-15",marriagePlace:"St. John Bosco Parish Church, Makati, PHL",middleName:"Ajesta",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Mitchie",marker:"prelations",marker3:"housewife",fid:"GHB5-TWN",child:"80378400",paternal_siblings:[],father:"41741428",maternal_siblings:[],mother:"55859428",regular_siblings:["1031404"]},{baptismDate:null,birthDate:"1964-06-22",birthPlace:"Balingasag, Misamis Oriental, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"41741428",lastName:"Adanza",living:!0,livingPlace:"Sangandaan, South Caloocan, PHL",marriageDate:"1994-01-25",marriagePlace:"Santa Maria, Bulacan, PHL",middleName:"Elican",nickname:"Loloy",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Darne",marker:"manufacturing",marker2:"househusband",marker3:"prelations",fid:"GHB5-XTZ",child:"16057808",paternal_siblings:[],father:"32818992",maternal_siblings:[],mother:"18589217",regular_siblings:["78074094"]},{baptismDate:null,birthDate:"1938-02-26",birthPlace:"Balingasag, Misamis Oriental, PHL",deathAge:null,deathDate:"2018-09-28",deathPlace:"Balingasag, Misamis Oriental, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"32818992",lastName:"Adanza",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"Mindanao, PHL",middleName:"Ladera",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Nestor",marker:"farming",fid:"GH12-SVQ",child:"41741428",paternal_siblings:[],father:"64714771",maternal_siblings:[],mother:"58814600",regular_siblings:[]},{baptismDate:null,birthDate:"about 1909",birthPlace:"Dumaguete, Negros Oriental, PHL",deathAge:null,deathDate:"1990-11-03",deathPlace:"Balingasag, Misamis Oriental, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"64714771",lastName:"Adanza",living:!1,livingPlace:null,marriageDate:"1928-10-06",marriagePlace:"Balingasag, Misamis Oriental, PHL",middleName:"R.",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Felomino",marker:"farming",fid:"GH12-DRN",child:"32818992",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"about 1911",birthPlace:"Mindanao, PHL",deathAge:null,deathDate:"after 1990-11-03",deathPlace:"Balingasag, Misamis Oriental, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"58814600",lastName:"Ladera",living:!1,livingPlace:null,marriageDate:"1928-10-06",marriagePlace:"Balingasag, Misamis Oriental, PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Consuelo",fid:"GH12-3GN",child:"32818992",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1939-11-28",birthPlace:"Balingasag, Misamis Oriental, PHL",deathAge:null,deathDate:"2015-04-02",deathPlace:"Balingasag, Misamis Oriental, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"18589217",lastName:"Elican",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"Mindanao, PHL",middleName:"Acerto",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Rufa",marker:"farming",fid:"GH12-9F6",child:"41741428",paternal_siblings:[],father:"36360078",maternal_siblings:[],mother:"55588060",regular_siblings:[]},{baptismDate:null,birthDate:"before 1933",birthPlace:null,deathAge:null,deathDate:"after 1945-04-30",deathPlace:"Misamis Oriental, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"36360078",lastName:"Elican",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:"Sgt.",suffix:null,vitalsCompleteAndVerified:!1,firstName:"Cecelio",marker:"sergeant",fid:"GH12-9JZ",child:"18589217",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"55588060",lastName:"Acerto",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Jovita",fid:"GH12-35H",child:"18589217",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1974-04-13",birthPlace:"Sinamongan, Pilar, Capiz, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"55859428",lastName:"Ajesta",living:!0,livingPlace:"Manama, BHR",marriageDate:"1994-01-25",marriagePlace:"Santa Maria, Bulacan, PHL",middleName:"Vergara",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Mylen",marker:"beautician",marker2:"prelations",marker3:"manager",fid:"GHBR-FK3",child:"16057808",paternal_siblings:[],father:"17374654",maternal_siblings:[],mother:"64719992",regular_siblings:["44750858","57433236"]},{baptismDate:null,birthDate:"before 1953",birthPlace:"Binaobawan, Pilar, Capiz, PHL",deathAge:null,deathDate:"after 1980-02-26",deathPlace:"PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"17374654",lastName:"Ajesta",living:!1,livingPlace:null,marriageDate:"1962-08-05",marriagePlace:"Pilar, Capiz, PHL",middleName:"Badoles",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Napoleon Crispolon",fid:"GH12-Z3C",child:"55859428",paternal_siblings:[],father:"40943586",maternal_siblings:[],mother:"99295715",regular_siblings:[]},{baptismDate:null,birthDate:"about 1903",birthPlace:"Pilar, Capiz, PHL",deathAge:null,deathDate:"after 1922-02-15",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"40943586",lastName:"Ajesta",living:!1,livingPlace:null,marriageDate:"1922-02-15",marriagePlace:"Pontevedra, Capiz, PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Manuel",fid:"GH12-XX4",child:"17374654",paternal_siblings:[],father:"52727694",maternal_siblings:[],mother:"35729864",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"52727694",lastName:"Ajesta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Eustaquio",fid:"GKBR-M9Y",child:"40943586",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"35729864",lastName:"Bermudes",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Florencia",fid:"GKBR-7P7",child:"40943586",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"about 1904",birthPlace:null,deathAge:null,deathDate:"after 1922-02-15",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"99295715",lastName:"Badoles",living:!1,livingPlace:null,marriageDate:"1922-02-15",marriagePlace:"Pontevedra, Capiz, PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Ursula",fid:"GH12-HQN",child:"17374654",paternal_siblings:[],father:"95408617",maternal_siblings:[],mother:"78914496",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"95408617",lastName:"Badoles",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Pedro Benjamin",fid:"GKBT-9GD",child:"99295715",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"about 1852",birthPlace:"Panay, Capiz, PHL",deathAge:null,deathDate:"1922-01-08",deathPlace:"Panay, Capiz, PHL",gender:"F",hasDNA:!1,hasImage:!1,key:"78914496",lastName:"Billanes",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Leoncia",fid:"K2GJ-YY3",child:"99295715",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"1941-07-08",birthPlace:"Dulangan, Pilar, Capiz, PHL",deathAge:null,deathDate:"2020-02-16",deathPlace:"Catholic Cemetery, Santa Maria, Bulacan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"64719992",lastName:"Vergara",living:!1,livingPlace:null,marriageDate:"1962-08-05",marriagePlace:"Pilar, Capiz, PHL",middleName:"Borja",nickname:"Mamang",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Selma",marker:"farming",fid:"GH12-W17",child:"55859428",paternal_siblings:[],father:"27738578",maternal_siblings:[],mother:"47733294",regular_siblings:[]},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"27738578",lastName:"Vergara",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"PHL",middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Benigno",marker:"military",fid:"GH12-6YL",child:"64719992",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},{baptismDate:null,birthDate:"before 1896",birthPlace:"PHL",deathAge:null,deathDate:"after 1996-12-16",deathPlace:"Tuguegarao, Cagayan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"47733294",lastName:"Borja",living:!1,livingPlace:null,marriageDate:null,marriagePlace:"PHL",middleName:null,nickname:"Enor",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Enoria",marker:"centennial",fid:"GH12-DD8",child:"64719992",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]}],SIBLINGS_DATA={41491264:{baptismDate:null,birthDate:"1948-07-06",birthPlace:"Manila, PHL",deathAge:null,deathDate:"1948-07-07",deathPlace:"Manila, PHL",gender:"M",hasDNA:!1,hasImage:!1,key:"41491264",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"San Agustin",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Benjamin",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},95216770:{baptismDate:null,birthDate:"1946-12-27",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"95216770",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Dumantay",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Rodolfo",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},48615922:{baptismDate:null,birthDate:"1969-03-31",birthPlace:"South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"48615922",lastName:"Argabioso",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Saplala",nickname:"Dada",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Danilo",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},52063403:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"52063403",lastName:"Orillo",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Filomeno",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},44750858:{baptismDate:null,birthDate:"1964-08-05",birthPlace:null,deathAge:null,deathDate:"2023-01-23",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"44750858",lastName:"Ajesta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Vergara",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Roselyn",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},28928680:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"28928680",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Reyes",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Augustin",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},93051591:{baptismDate:null,birthDate:"1870-07-21",birthPlace:"Santa Barbara, Pangasinan, PHL",deathAge:null,deathDate:"1941-12-27",deathPlace:"Quezon City, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"93051591",lastName:"Maramba",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Bautista",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Daniel",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},38373110:{baptismDate:null,birthDate:"about 1907",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"38373110",lastName:"Saplala",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Hilaria",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},73841862:{baptismDate:null,birthDate:"1945-06-17",birthPlace:"Metro Manila, PHL",deathAge:null,deathDate:"2018-02-19",deathPlace:"South Caloocan, PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"73841862",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"San Agustin",nickname:"Vicky",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Victoria",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},85278460:{baptismDate:null,birthDate:"1919-10-18",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"1981-09-16",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"85278460",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Mia",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Leonor Rosario",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},64329171:{baptismDate:null,birthDate:"about 1905",birthPlace:null,deathAge:null,deathDate:"about 1983",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"64329171",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:"1932-06-01",marriagePlace:null,middleName:"Bongco",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Felipe",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},54340914:{baptismDate:null,birthDate:"1949-10-23",birthPlace:"Metro Manila, PHL",deathAge:null,deathDate:"before 2020",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"54340914",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"San Agustin",nickname:"Ben",prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Benjamin",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},4793299:{baptismDate:null,birthDate:"1963-12-14",birthPlace:"South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"4793299",lastName:"Argabioso",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Saplala",nickname:"Toni",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Antonio",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},77082334:{baptismDate:null,birthDate:"1968-02-21",birthPlace:"South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"77082334",lastName:"Acosta",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Maramba",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Susan",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},21653420:{baptismDate:null,birthDate:"1928-01-18",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"2009-05-23",deathPlace:"Majayjay, Laguna, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"21653420",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Mia",nickname:null,prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Celso",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},95739264:{baptismDate:null,birthDate:"before 1964-08-28",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"95739264",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Dumantay",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Becky",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},36448299:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:"before 2020",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"36448299",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Mia",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Amada",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},31493676:{baptismDate:null,birthDate:null,birthPlace:"Luzon, PHL",deathAge:null,deathDate:"about 2019",deathPlace:"Luzon, PHL",gender:"M",hasDNA:!1,hasImage:!0,key:"31493676",lastName:"Saplala",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Perez",nickname:null,prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Claro",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},21719634:{baptismDate:null,birthDate:"2008-08-01",birthPlace:"Maternity House, Poblacion, South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"21719634",lastName:"Ignacio",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Acosta",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Joshua Caleb",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},7663556:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:"before 2020",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"7663556",lastName:"Argabioso",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Mia",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Trinidad",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},4256552:{baptismDate:null,birthDate:"1966-11-07",birthPlace:"South Caloocan, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"4256552",lastName:"Acosta",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Maramba",nickname:"Manolo",prefix:null,suffix:"III",vitalsCompleteAndVerified:!1,firstName:"Manuel",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},47386677:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"47386677",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Reyes",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Juan",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},1031404:{baptismDate:null,birthDate:"2004-10-13",birthPlace:"Metro Manila, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!0,key:"1031404",lastName:"Adanza",living:!0,livingPlace:"Sangandaan, South Caloocan, PHL",marriageDate:null,marriagePlace:null,middleName:"Ajesta",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"DM",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},392680:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"392680",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Reyes",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Milagros",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},12725118:{baptismDate:null,birthDate:"1947-06-12",birthPlace:"Metro Manila, PHL",deathAge:null,deathDate:"2021-05-02",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"12725118",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"San Agustin",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Amelia",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},6375936:{baptismDate:null,birthDate:"1911-05-17",birthPlace:"Luzon, PHL",deathAge:null,deathDate:"1984-10-03",deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"6375936",lastName:"Acosta",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Bongco",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Isabel",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},83646651:{baptismDate:null,birthDate:"1903-11-17",birthPlace:"Majayjay, Laguna, PHL",deathAge:null,deathDate:"1993-04-22",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"83646651",lastName:"Orillo",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Gregorio",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},40891293:{baptismDate:null,birthDate:"about 1913",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"40891293",lastName:"Saplala",living:!0,livingPlace:null,marriageDate:"1930-03-29",marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Jose",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},41448711:{baptismDate:null,birthDate:"2004-08-05",birthPlace:"Amisola Maternity Hospital, Tondo, Manila, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"41448711",lastName:"Ignacio",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Acosta",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Ira Mae",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},78074094:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"78074094",lastName:"Adanza",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Elican",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Gloria",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},57433236:{baptismDate:null,birthDate:"1979-12-26",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"57433236",lastName:"Ajesta",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Vergara",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Cecil",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},70275697:{baptismDate:null,birthDate:"2003-11-05",birthPlace:"St. Luke's Medical Center, Quezon City, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"70275697",lastName:"Argabioso",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Martin",nickname:"Ryan",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Riand Nikole",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},46768390:{baptismDate:null,birthDate:"1946-03-02",birthPlace:"Luzon, PHL",deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!0,key:"46768390",lastName:"Saplala",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Perez",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Celia",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},57182283:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"57182283",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Reyes",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"José",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},55618304:{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"55618304",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:"Dumantay",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Larry",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]},42349252:{baptismDate:null,birthDate:"1928-04-20",birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"42349252",lastName:"Maramba",living:!0,livingPlace:null,marriageDate:"1953-02-08",marriagePlace:null,middleName:"Dumantay",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Aurora",paternal_siblings:[],maternal_siblings:[],regular_siblings:[]}},STORIES={"GQX8-CQP":{headline:"An Electronics-Engineering-graduate turned Software Engineer focused on recording his family's history.",headshot:"GQX8-CQP-2.lossy.webp",stories:`
Half Siblings from Mother's Side
  • @@ -506,14 +506,14 @@ Model data should not have any references to a Diagram or any part of a diagram,
- `},"GHBD-9L6":{headshot:"GHBD-9L6.signed.webp"},"GHB8-DXY":{gravemarker:"GHB8-DXY.lossy.webp"},"GHB8-J1B":{headshot:"GHB8-J1B.signed.webp"},"GHB8-GB6":{stories:` + `},"GHBD-9L6":{headshot:"GHBD-9L6.signed.webp"},"GHB8-DXY":{gravemarker:"GHB8-DXY.lossy.webp"},"GHB8-J1B":{headshot:"GHB8-J1B.signed.webp",gravemarker:"GHB8-GB6.lossy.webp"},"GHB8-GB6":{gravemarker:"GHB8-GB6.lossy.webp",stories:`
Hunt For Train Robbers

Sotero was once the Chief of Railroad Police for the Philippine National Railrod (PNR). While assigned there, armed bandits ambushed one of the train sets and netted more than $40,000 (P80,000).

Chief of Railroad Police: Sotero Maramba

Newspaper entry of the story.

- `},"LLQS-641":{stories:` + `},"GHBD-9LY":{gravemarker:"GHB8-GB6.lossy.webp"},"LLQS-641":{stories:`
Siblings
  • diff --git a/public/family/js/stories.js b/public/family/js/stories.js index b8d2d6a..5396389 100644 --- a/public/family/js/stories.js +++ b/public/family/js/stories.js @@ -506,8 +506,10 @@ var STORIES = { }, 'GHB8-J1B': { // Lola Lina headshot: 'GHB8-J1B.signed.webp', + gravemarker: 'GHB8-GB6.lossy.webp', }, 'GHB8-GB6': { // Sotero Maramba + gravemarker: 'GHB8-GB6.lossy.webp', stories: `
    Hunt For Train Robbers

    Sotero was once the Chief of Railroad Police for the Philippine National Railrod (PNR). While assigned there, armed bandits ambushed one of the train sets and netted more than $40,000 (P80,000).

    @@ -517,6 +519,9 @@ var STORIES = { ` }, + 'GHBD-9LY': { // Lola Cresencia + gravemarker: 'GHB8-GB6.lossy.webp', + }, 'LLQS-641' : { // Miguel Maramba stories: `
    Siblings