From 795b811c443afe520bfd7c3da4bb6ea81b92b746 Mon Sep 17 00:00:00 2001 From: arbyn-argabioso Date: Sat, 19 Oct 2024 03:27:02 +0800 Subject: [PATCH] Add new story --- public/family/js/family.js | 20 +++++++++++++++++ public/family/js/family.min.js | 40 +++++++++++++++++++++++++--------- public/family/js/stories.js | 20 +++++++++++++++++ 3 files changed, 70 insertions(+), 10 deletions(-) diff --git a/public/family/js/family.js b/public/family/js/family.js index 3811293..35ae525 100644 --- a/public/family/js/family.js +++ b/public/family/js/family.js @@ -2794,6 +2794,26 @@ for (const [key, svg] of Object.entries(isDark ? DARK_MARKERS : LIGHT_MARKERS)) Beautiful Engagement Ring

Mitchie's lab-grown Diamond engagement ring.

+ +
+
First Pregnancy
+

A compilation of reactions from Arbyn and Mitchie's relatives; and their close friends.

+
+
+

How Mitch and Arbyn found that they would be having a baby and how they announced it to their relatives.

+
+
+
+

Mitchie's high school best friends, BCHZ, finding out she was pregnant.

+
+
+
+

The Alviza family, a close family friend, finding out that Mitch was pregnant.

+
+
+
+

Reaction video of Mitch and Arbyn's mutual friends.

+
` } } diff --git a/public/family/js/family.min.js b/public/family/js/family.min.js index 45d3a9c..8ba56e3 100644 --- a/public/family/js/family.min.js +++ b/public/family/js/family.min.js @@ -1,19 +1,19 @@ !function(){const v="object"==typeof globalThis&&globalThis||"object"==typeof global&&global.global===global&&global||"object"==typeof self&&self.self===self&&self||{},Yt=(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),qt.n(i)}static s(e,i,s,n){if(!(e instanceof i)){let t=qt.hu(s);void 0!==n&&(t+="."+n),qt.Bi(e,i,t)}}static t(e,i,s,n){if(typeof e!==i){let t=qt.hu(s);void 0!==n&&(t+="."+n),qt.Bi(e,i,t)}}static r(e,i,s){if("number"!=typeof e||!isFinite(e)){let t=qt.hu(i);void 0!==s&&(t+="."+s),qt.n(t+" must be a real number type, and not NaN or Infinity: "+e)}}static it(t,e,i){t in e||qt.n(t+" is not a valid value in enumeration: "+i)}static Bi(t,e,i,s){e=" value is not an instance of "+qt.hu(e)+": ";let n=qt.hu(i);void 0!==s&&(n+="."+s),"string"==typeof t&&(t='"'+t+'"'),qt.n(n+e+t)}static G(t,e,i,s){let n=qt.hu(i);void 0!==s&&(n+="."+s),qt.n(n+" is not in the range "+e+": "+t)}static Ke(t){qt.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){qt.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)||qt.Bi(t,"Array",e,i)}static au(t,e,i){Array.isArray(t)?e>=t.length?t.push(i):t.splice(e,0,i):qt.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):qt.n("Cannot remove an object from an HTMLCollection or NodeList at "+e)}static Ik=[];static ct(){var t=qt.Ik.pop();return void 0===t?[]:t}static ot(t){t.length=0,qt.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:qt.Mt(t)&&t.constructor?qt.an(t.constructor):typeof t}static Yh(t,e){return null!=e&&""!==e&&(qt.Mt(t)&&e in t||t[e])?t[e]:null}static toString(t){let e=t;return qt.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)&&qt.G(t,"0 <= i < length",E,"elt:i"),e[t]}get(t){return this.elt(t)}setElt(t,e){Yt,qt.r(t,E,"setElt:i");var i=this.h;(t<0||t>=i.length)&&qt.G(t,"0 <= i < length",E,"setElt:i"),this.f&&qt.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",E,"insertAt:i"),this.f&&qt.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&&qt.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){Yt,qt.r(t,E,"removeAt:i");var e=this.h;(t<0||t>=e.length)&&qt.G(t,"0 <= i < length",E,"removeAt:i"),this.f&&qt.O(this,t),t===e.length-1?e.pop():e.splice(t,1),this.Ue()}removeRange(i,s){Yt,qt.r(i,E,"removeRange:from"),qt.r(s,E,"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 E;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 C{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()#"+C.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 E;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=C.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 E;for(const s of e.k)i.add(t(s[0]));return i.iterator}filter(t){var e=this.et,i=new E;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 C{et;constructor(t){super(),C.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){qt.n("This Set is read-only: "+this.toString())}has(t){return this.et.contains(t)}contains(t){return this.has(t)}delete(t){qt.n("This Set is read-only: "+this.toString())}remove(t){return this.delete(t)}clear(){qt.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 C;for(const i of this.et.k)e.add(t(i[0]));return e}filter(t){var e=new C;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 C;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 E;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 E;for(const s of e.k)i.add(t(s[1]));return i.iterator}filter(t){var e=this.et,i=new E;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 b{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 E;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 E;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){C.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()#"+C.ps(this)}set(t,e){return this.f&&qt.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&&qt.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 U&&this.S===t.x&&this.P===t.y}equalTo(t,e){return this.S===t&&this.P===e}equalsApprox(t){return I.p(this.S,t.x)&&I.p(this.P,t.y)}add(t){return Yt,qt.s(t,U,U,"add:p"),this.st(),this.S+=t.x,this.P+=t.y,this}subtract(t){return Yt,qt.s(t,U,U,"subtract:p"),this.st(),this.S-=t.x,this.P-=t.y,this}offset(t,e){return Yt,qt.r(t,U,"offset:dx"),qt.r(e,U,"offset:dy"),this.st(),this.S+=t,this.P+=e,this}rotate(i){if(Yt,qt.r(i,U,"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 Yt,qt.r(t,U,"scale:sx"),qt.r(e,U,"scale:sy"),this.st(),this.S*=t,this.P*=e,this}distanceSquaredPoint(t){Yt,qt.s(t,U,U,"distanceSquaredPoint:p");var e=t.x-this.S,t=t.y-this.P;return e*e+t*t}distanceSquared(t,e){Yt,qt.r(t,U,"distanceSquared:px"),qt.r(e,U,"distanceSquared:py");t-=this.S,e-=this.P;return t*t+e*e}normalize(){Yt,this.st();var t=this.S,e=this.P,i=Math.sqrt(t*t+e*e);return 0= 0",Xt,"setTo:w"),e<0&&qt.G(e,">= 0",Xt,"setTo:h"),this.st(),this.J=t,this.Z=e,this}set(t){return Yt,qt.s(t,Xt,Xt,"set:s"),this.st(),this.J=t.J,this.Z=t.Z,this}copy(){var t=new Xt;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)&&qt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Yt,this.f){let t="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),qt.n(t)}}static parse(s){if("string"!=typeof s)return new Xt;{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 Xt(e,i)}}static stringify(t){return Yt,qt.s(t,Xt),t.width.toString()+" "+t.height.toString()}static stringifyFixed(e){return qt.t(e,"number",Xt,"stringifyFixed:digits"),t=>t.width.toFixed(e)+" "+t.height.toFixed(e)}toString(){return"Size("+this.width+","+this.height+")"}equals(t){return t instanceof Xt&&this.J===t.width&&this.Z===t.height}equalTo(t,e){return this.J===t&&this.Z===e}equalsApprox(t){return I.p(this.J,t.width)&&I.p(this.Z,t.height)}inflate(t,e){Yt,qt.r(t,Xt,"inflate:w"),qt.r(e,Xt,"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){Yt,qt.t(t,"number",Xt,"width"),this.st(t),t<0&&qt.G(t,">= 0",Xt,"width"),this.J=t}get height(){return this.Z}set height(t){Yt,qt.t(t,"number",Xt,"height"),this.st(t),t<0&&qt.G(t,">= 0",Xt,"height"),this.Z=t}isReal(){return isFinite(this.width)&&isFinite(this.height)}static lf=new Xt(0,0).rt();static Bk=new Xt(1,1).rt();static nC=new Xt(6,6).rt();static du=new Xt(8,8).rt();static oC=new Xt(10,10).rt();static zk=new Xt(1/0,1/0).rt();static xw=new Xt(NaN,NaN).rt();static rC=[];static a(){var t=Xt.rC.pop();return void 0===t?new Xt:t}static o(t){Xt.rC.push(t)}}class J{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 U?(n=t.x,a=t.y,e instanceof U?(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 Xt?(this.S=n,this.P=a,this.J=e.width,this.Z=e.height):qt.n("Incorrect second argument supplied to Rect constructor "+e)):qt.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 Yt,qt.t(t,"number",J,"setTo:x"),qt.t(e,"number",J,"setTo:y"),qt.t(i,"number",J,"setTo:w"),qt.t(s,"number",J,"setTo:h"),i<0&&qt.G(i,">= 0",J,"setTo:w"),s<0&&qt.G(s,">= 0",J,"setTo:h"),this.st(),this.S=t,this.P=e,this.J=i,this.Z=s,this}set(t){return Yt,qt.s(t,J,J,"set:r"),this.st(),this.S=t.S,this.P=t.P,this.J=t.J,this.Z=t.Z,this}setPoint(t){return Yt,qt.s(t,U,J,"setPoint:p"),this.st(),this.S=t.x,this.P=t.y,this}setSize(t){return Yt,qt.s(t,Xt,J,"setSize:s"),this.st(),this.J=t.width,this.Z=t.height,this}copy(){var t=new J;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)&&qt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Yt,this.f){let t="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),qt.n(t)}}static parse(a){if("string"!=typeof a)return new J;{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 J(e,i,s,n)}}static stringify(t){return Yt,qt.s(t,J),t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString()}static stringifyFixed(e){return qt.t(e,"number",J,"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 J&&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 I.p(this.S,t.x)&&I.p(this.P,t.y)&&I.p(this.J,t.width)&&I.p(this.Z,t.height)}equalsApproxTo(t,e,i,s){return I.p(this.S,t)&&I.p(this.P,e)&&I.p(this.J,i)&&I.p(this.Z,s)}equalsApproxClose(t){return I.q(this.S,t.x)&&I.q(this.P,t.y)&&I.q(this.J,t.width)&&I.q(this.Z,t.height)}containsPoint(t){return Yt,qt.s(t,U,J,"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 Yt,qt.s(t,J,J,"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 Yt,qt.r(t,J,"contains:x"),qt.r(e,J,"contains:y"),void 0===i?i=0:qt.r(i,J,"contains:w"),void 0===s?s=0:qt.r(s,J,"contains:h"),(i<0||s<0)&&qt.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 Yt,qt.r(t,J,"offset:dx"),qt.r(e,J,"offset:dy"),this.st(),this.S+=t,this.P+=e,this}inflate(t,e){return Yt,qt.r(t,J,"inflate:w"),qt.r(e,J,"inflate:h"),this.bw(e,t,e,t)}addMargin(t){return Yt,qt.s(t,O,J,"addMargin:m"),this.bw(t.top,t.right,t.bottom,t.left)}subtractMargin(t){return Yt,qt.s(t,O,J,"subtractMargin:m"),this.bw(-t.top,-t.right,-t.bottom,-t.left)}grow(t,e,i,s){return Yt,qt.r(t,J,"grow:t"),qt.r(e,J,"grow:r"),qt.r(i,J,"grow:b"),qt.r(s,J,"grow:l"),this.bw(t,e,i,s)}bw(t,e,i,s){Yt,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 Yt,qt.s(t,J,J,"intersectRect:r"),this.lC(t.x,t.y,t.width,t.height)}intersect(t,e,i,s){return(Yt,qt.r(t,J,"intersect:x"),qt.r(e,J,"intersect:y"),qt.r(i,J,"intersect:w"),qt.r(s,J,"intersect:h"),i<0||s<0)&&qt.n("Rect.intersect:Width and height cannot be negative"),this.lC(t,e,i,s)}lC(t,e,i,s){Yt,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 Yt,qt.s(t,J,J,"intersectsRect:r"),this.intersects(t.x,t.y,t.width,t.height)}intersects(t,e,i,s){(Yt,qt.r(t,J,"intersects:x"),qt.r(e,J,"intersects:y"),qt.r(t,J,"intersects:w"),qt.r(e,J,"intersects:h"),i<0||s<0)&&qt.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",J,"width"),this.J=t}get height(){return this.Z}set height(t){Yt,qt.t(t,"number",J,"height"),this.st(t),t<0&&qt.G(t,">= 0",J,"height"),this.Z=t}get left(){return this.S}set left(t){Yt,qt.t(t,"number",J,"left"),this.st(t),this.S=t}get top(){return this.P}set top(t){Yt,qt.t(t,"number",J,"top"),this.st(t),this.P=t}get right(){return this.S+this.J}set right(t){Yt,qt.r(t,J,"right"),this.st(t),this.S+=t-(this.S+this.J)}get bottom(){return this.P+this.Z}set bottom(t){Yt,qt.r(t,J,"top"),this.st(t),this.P+=t-(this.P+this.Z)}get position(){return new U(this.S,this.P)}set position(t){Yt,qt.s(t,U,J,"position"),this.st(t),this.S=t.x,this.P=t.y}get size(){return new Xt(this.J,this.Z)}set size(t){Yt,qt.s(t,Xt,J,"size"),this.st(t),this.J=t.width,this.Z=t.height}get center(){return new U(this.S+this.J/2,this.P+this.Z/2)}set center(t){Yt,qt.s(t,U,J,"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){Yt,qt.r(t,J,"centerX"),this.st(t),this.S=t-this.J/2}get centerY(){return this.P+this.Z/2}set centerY(t){Yt,qt.r(t,J,"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 J(0,0,0,0).rt();static RD=new J(NaN,NaN,NaN,NaN).rt();static Yk=[];static a(){var t=J.Yk.pop();return void 0===t?new J:t}static H(t,e,i,s){var n=J.Yk.pop();return void 0===n?new J(t,e,i,s):n.e(t,e,i,s)}static o(t){J.Yk.push(t)}}class O{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):qt.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 Yt,qt.t(t,"number",O,"setTo:t"),qt.t(e,"number",O,"setTo:r"),qt.t(i,"number",O,"setTo:b"),qt.t(s,"number",O,"setTo:l"),this.st(),this.fn=t,this.cn=e,this.un=i,this.dn=s,this}set(t){return Yt,qt.s(t,O,O,"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 O;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)&&qt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Yt,this.f){let t="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),qt.n(t)}}static parse(a){if("string"!=typeof a)return new O;{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 O;let i=NaN;for(;""===r[t];)t++;if((a=r[t++])&&(i=parseFloat(a)),isNaN(i))return new O(e);let s=NaN;for(;""===r[t];)t++;if((a=r[t++])&&(s=parseFloat(a)),isNaN(s))return new O(e,i);let n=NaN;for(;""===r[t];)t++;return(a=r[t++])&&(n=parseFloat(a)),isNaN(n)?new O(e,i):new O(e,i,s,n)}}static stringify(t){return Yt,qt.s(t,O),t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}static stringifyFixed(e){return qt.t(e,"number",O,"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 O&&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 I.p(this.fn,t.top)&&I.p(this.cn,t.right)&&I.p(this.un,t.bottom)&&I.p(this.dn,t.left)}get top(){return this.fn}set top(t){Yt,qt.r(t,O,"top"),this.st(t),this.fn=t}get right(){return this.cn}set right(t){Yt,qt.r(t,O,"right"),this.st(t),this.cn=t}get bottom(){return this.un}set bottom(t){Yt,qt.r(t,O,"bottom"),this.st(t),this.un=t}get left(){return this.dn}set left(t){Yt,qt.r(t,O,"left"),this.st(t),this.dn=t}isReal(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)}static qg=new O(0,0,0,0).rt();static aC=new O(2,2,2,2).rt();static fC=[];static a(){var t=O.fC.pop();return void 0===t?new O:t}static o(t){O.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 Yt,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 Yt,qt.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)&&qt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Yt,this.f){let t="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),qt.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){Yt,this.kw(t,"x"),this.st(t),this.S=t}get y(){return this.P}set y(t){Yt,this.kw(t,"y"),this.st(t),this.P=t}get offsetX(){return this.Vs}set offsetX(t){Yt,this.Sw(t,"offsetX"),this.st(t),this.Vs=t}get offsetY(){return this.Bs}set offsetY(t){Yt,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 H{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 H;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=H.dC.pop();return void 0===t?new H:t}static o(t){H.dC.push(t)}static Hk="54a702f3e53909c447824c6706603faf4c"}const I={OD:"7da71ca0ad381e90",Gn:(Math.sqrt(2)-1)/3*4,gC:null,Cw:t=>{if(t<=0)return 0;let e=I.gC;if(null===e){e=[];for(let t=0;t<=2e3;t++)e[t]=Math.sqrt(t);I.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 I.zi(t,e,r,o,d,i,s)&&I.zi(t,e,r,o,d,n,a)?I.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,I.Aw(t,e,c,g,m,f,p,v,l,h,u,d)||I.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 U.direction(t,i,e,s)},gu:(t,e,i,s,n,a,r,o,l,h)=>{var u,d,c,g,m,f;return I.zi(t,e,r,o,l,i,s)&&I.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,I.gu(t,e,u,d,c,g,m,f,l,h),I.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 I.zi(t,e,r,o,l,i,s)&&I.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,I.Hn(t,e,u,d,c,g,m,f,l,h),I.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 I.zi(t,e,n,a,h,i,s)?I.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,I.vk(t,e,u,d,c,g,r,o,l,h)||I.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 I.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,I.qk(t,e,l,h,u,d,r,o),I.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 I.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,I.Wg(t,e,l,h,u,d,r,o),I.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(I.zi(n,a,u,d,p,r,o)&&I.zi(n,a,u,d,p,l,h))return!!I.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,A=(a+o)/2,r=(r+l)/2,o=(o+h)/2,l=(l+u)/2,h=(h+d)/2,x=(y+r)/2,b=(A+o)/2,r=(r+l)/2,o=(o+h)/2,w=(x+r)/2,P=(b+o)/2;let t=1/0,e=!1,i=0,s=0;return I.jg(n,a,y,A,x,b,w,P,c,g,m,f,p,v)&&(n=(v.x-c)*(v.x-c)+(v.y-g)*(v.y-g)){let g=0;if(I.zi(i,s,r,o,c,t,e)&&I.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(I.q(i,n)){let t=0,e=0;e=se?(l.e(i,e),!1):(l.e(i,h),!0)}if(I.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(I.p(i,n)&&I.p(s,a))return h.e(i,s),!1;if(I.q(r,t))return I.q(i,n)?(I.Sl(i,s,n,a,r,o,h),!1):(u=(a-s)/(n-i)*(r-i)+s,I.Sl(i,s,n,a,r,u,h));var u=(l-o)/(t-r);if(I.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(I.q(u,t))return I.Sl(i,s,n,a,r,o,h),!1;l=(t*i-u*r+o-s)/(t-u);if(I.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,I.Sl(i,s,n,a,l,r,h)},sE:(t,e,i,s,n)=>I.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 I.vn(t,e,t,s,n,a,r,o,l)&&(c=(l.x-n)*(l.x-n)+(l.y-a)*(l.y-a))I.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!!(J.contains(t,e,i,s,n,a)||J.contains(t,e,i,s,r,o)||I.uu(l,u,h,u,n,a,r,o)||I.uu(h,u,h,d,n,a,r,o)||I.uu(h,d,l,d,n,a,r,o)||I.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:I.cu(t,e,i,s,n,a)*I.cu(t,e,i,s,r,o)<=0&&I.cu(n,a,r,o,t,e)*I.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:qt.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 J(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 J(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(N)||(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 A(){var t=h.toLowerCase();return"c"===t||"s"===t||"q"===t||"t"===t?new U(2*c.x-d.x,2*c.y-d.y):new U(c.x,c.y)}const x=n.length,b=Be.xC(null);let w=!1,P=!1,S=!1,k=!0,M=null;const N=new RegExp("["+W.im+"]");for(;!(s>=x-1);)if(h=l,""!==(l=f())){let t=!(g=!0);switch(l.toUpperCase()){case"X":k=!0,w=!1,P=!1;break;case"M":for(M=v(),null===b.Ai||!0===k?(b.yu(M.x,M.y,w,!1,!P,S),k=!1):b.XD(M.x,M.y),u.c(c);!m();)M=v(),b.xr(M.x,M.y);break;case"L":for(;!m();)M=v(),b.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),b.xr(c.x,c.y);break;case"V":for(;!m();)c.e(c.x,(l===l.toLowerCase()?c.y:0)+parseFloat(f())),b.xr(c.x,c.y);g&&(t=!0);break;case"C":for(;!m();){var C=new U,L=(p(C),y()),D=v();b.br(C.x,C.y,L.x,L.y,D.x,D.y)}g&&(t=!0);break;case"S":for(;!m();){var T=A(),B=y(),H=v();b.br(T.x,T.y,B.x,B.y,H.x,H.y)}g&&(t=!0);break;case"Q":for(;!m();){var I=y(),K=v();b.Dw(I.x,I.y,K.x,K.y)}g&&(t=!0);break;case"T":for(;!m();){var G=A(),R=(d.c(G),v());b.Dw(G.x,G.y,R.x,R.y),d.c(R)}g&&(t=!0);break;case"B":for(;!m();){var z=parseFloat(f()),V=parseFloat(f());let t=parseFloat(f()),e=parseFloat(f());var Y=parseFloat(f());let i=Y,s=!1;m()||(i=parseFloat(f()),m())||(s=0!==parseFloat(f())),l===l.toLowerCase()&&(t+=c.x,e+=c.y),b.YD(z,V,t,e,Y,i,s)}g&&(t=!0);break;case"A":for(;!m();){var q=Math.abs(parseFloat(f())),X=Math.abs(parseFloat(f())),j=parseFloat(f());let t=!1,e=!1,i=0,s=0;var F=f();s=(i=1===F.length?(t=!!parseFloat(F),e=!!parseFloat(f()),parseFloat(f())):2===F.length?(t=!!parseFloat(F[0]),e=!!parseFloat(F[1]),parseFloat(f())):(t=!!parseFloat(F[0]),e=!!parseFloat(F[1]),parseFloat(F.slice(2))),parseFloat(f())),l===l.toLowerCase()&&(i=c.x+i,s=c.y+s),c.e(i,s),b.KD(q,X,j,t,e,i,s)}g&&(t=!0);break;case"Z":b.UD(),c.c(u);break;case"F":{let t="",e=1;for(;n[s+e];){if("0"===n[s+e])S=!0;else if(null===n[s+e].match(/[Uu]/)&&null!==n[s+e].match(N)){t=n[s+e];break}e++}t.match(/[Mm]/)?w=!0:b.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(N)){t=n[s+e];break}e++}t.match(/[Mm]/)?P=!0:b.HD(!1);break}default:"0"!==l&&"1"!==l&&qt.ft("Unknown geometry command: "+l)}if(t){qt.ft(`Bad geometry command: ${l}, next token: ${f()}, -string: `+e);break}}i=b.em;if(Be.bC(b),t)for(var Q=i.figures.iterator;Q.next();)Q.value.isFilled=!0;return i}static kC(e,i){var s=e.length,n=U.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)):(A=(n-i)*(n-i)+(a-s)*(a-s),x=U.a(),I.Sl(i,s,n,a,o,l,x),n=x.x,a=x.y,U.o(x),Math.sqrt(((n-i)*(n-i)+(a-s)*(a-s))/A))}}if(2!==this.type){var h=this.flattenedSegments,u=this.flattenedLengths,o=this.flattenedTotalLength,d=U.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=I.pC(0,0,eMath.sqrt(t*t+e*e),x=(t,e,i,s)=>(t*i+e*s)/(A(t,e)*A(i,s)),b=(t,e,i,s)=>(t*se?t:e),r=t>e?1:t/e,d=t>e?e/t:1,o=I.pC(0,0,h,w,w+a,!0),c=H.a();c.ti(),c.se(v,y),c.ys(this.gn,0,0),c.v(r,d),W.kC(o,c),H.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){Yt,qt.it(t,M,"SegmentType"),this.f&&qt.O(this,t),this.nt=t,this.Nt=!0}get endX(){return this.ne}set endX(t){Yt,qt.r(t,w,"endX"),this.f&&qt.O(this,t),this.ne=t,this.Nt=!0}get endY(){return this.oe}set endY(t){Yt,qt.r(t,w,"endY"),this.f&&qt.O(this,t),this.oe=t,this.Nt=!0}get point1X(){return this.gn}set point1X(t){Yt,qt.r(t,w,"point1X"),this.f&&qt.O(this,t),this.gn=t,this.Nt=!0}get point1Y(){return this.Pl}set point1Y(t){Yt,qt.r(t,w,"point1Y"),this.f&&qt.O(this,t),this.Pl=t,this.Nt=!0}get point2X(){return this.Nl}set point2X(t){Yt,qt.r(t,w,"point2X"),this.f&&qt.O(this,t),this.Nl=t,this.Nt=!0}get point2Y(){return this.kr}set point2Y(t){Yt,qt.r(t,w,"point2Y"),this.f&&qt.O(this,t),this.kr=t,this.Nt=!0}get centerX(){return this.gn}set centerX(t){Yt,qt.r(t,w,"centerX"),this.f&&qt.O(this,t),this.gn=t,this.Nt=!0}get centerY(){return this.Pl}set centerY(t){Yt,qt.r(t,w,"centerY"),this.f&&qt.O(this,t),this.Pl=t,this.Nt=!0}get radiusX(){return this.Nl}set radiusX(t){Yt,qt.r(t,w,"radiusX"),t<0&&qt.G(t,">= zero",w,"radiusX"),this.f&&qt.O(this,t),this.Nl=t,this.Nt=!0}get radiusY(){return this.kr}set radiusY(t){Yt,qt.r(t,w,"radiusY"),t<0&&qt.G(t,">= zero",w,"radiusY"),this.f&&qt.O(this,t),this.kr=t,this.Nt=!0}get startAngle(){return this.ne}set startAngle(t){Yt,qt.r(t,w,"startAngle"),this.f&&qt.O(this,t),(t%=360)<0&&(t+=360),this.ne=t,this.Nt=!0}get sweepAngle(){return this.oe}set sweepAngle(t){Yt,qt.r(t,w,"sweepAngle"),this.f&&qt.O(this,t),this.oe=t=(t=360=t.length?t.push(i):t.splice(e,0,i):qt.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):qt.n("Cannot remove an object from an HTMLCollection or NodeList at "+e)}static Ik=[];static ct(){var t=qt.Ik.pop();return void 0===t?[]:t}static ot(t){t.length=0,qt.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:qt.Mt(t)&&t.constructor?qt.an(t.constructor):typeof t}static Yh(t,e){return null!=e&&""!==e&&(qt.Mt(t)&&e in t||t[e])?t[e]:null}static toString(t){let e=t;return qt.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)&&qt.G(t,"0 <= i < length",E,"elt:i"),e[t]}get(t){return this.elt(t)}setElt(t,e){Yt,qt.r(t,E,"setElt:i");var i=this.h;(t<0||t>=i.length)&&qt.G(t,"0 <= i < length",E,"setElt:i"),this.f&&qt.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",E,"insertAt:i"),this.f&&qt.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&&qt.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){Yt,qt.r(t,E,"removeAt:i");var e=this.h;(t<0||t>=e.length)&&qt.G(t,"0 <= i < length",E,"removeAt:i"),this.f&&qt.O(this,t),t===e.length-1?e.pop():e.splice(t,1),this.Ue()}removeRange(i,s){Yt,qt.r(i,E,"removeRange:from"),qt.r(s,E,"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 E;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 C{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()#"+C.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 E;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=C.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 E;for(const s of e.k)i.add(t(s[0]));return i.iterator}filter(t){var e=this.et,i=new E;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 C{et;constructor(t){super(),C.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){qt.n("This Set is read-only: "+this.toString())}has(t){return this.et.contains(t)}contains(t){return this.has(t)}delete(t){qt.n("This Set is read-only: "+this.toString())}remove(t){return this.delete(t)}clear(){qt.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 C;for(const i of this.et.k)e.add(t(i[0]));return e}filter(t){var e=new C;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 C;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 E;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 b{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 E;for(const s of e.k)i.add(t(s[1]));return i.iterator}filter(t){var e=this.et,i=new E;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 x{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 E;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 E;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){C.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()#"+C.ps(this)}set(t,e){return this.f&&qt.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&&qt.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 U&&this.S===t.x&&this.P===t.y}equalTo(t,e){return this.S===t&&this.P===e}equalsApprox(t){return I.p(this.S,t.x)&&I.p(this.P,t.y)}add(t){return Yt,qt.s(t,U,U,"add:p"),this.st(),this.S+=t.x,this.P+=t.y,this}subtract(t){return Yt,qt.s(t,U,U,"subtract:p"),this.st(),this.S-=t.x,this.P-=t.y,this}offset(t,e){return Yt,qt.r(t,U,"offset:dx"),qt.r(e,U,"offset:dy"),this.st(),this.S+=t,this.P+=e,this}rotate(i){if(Yt,qt.r(i,U,"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 Yt,qt.r(t,U,"scale:sx"),qt.r(e,U,"scale:sy"),this.st(),this.S*=t,this.P*=e,this}distanceSquaredPoint(t){Yt,qt.s(t,U,U,"distanceSquaredPoint:p");var e=t.x-this.S,t=t.y-this.P;return e*e+t*t}distanceSquared(t,e){Yt,qt.r(t,U,"distanceSquared:px"),qt.r(e,U,"distanceSquared:py");t-=this.S,e-=this.P;return t*t+e*e}normalize(){Yt,this.st();var t=this.S,e=this.P,i=Math.sqrt(t*t+e*e);return 0= 0",Xt,"setTo:w"),e<0&&qt.G(e,">= 0",Xt,"setTo:h"),this.st(),this.J=t,this.Z=e,this}set(t){return Yt,qt.s(t,Xt,Xt,"set:s"),this.st(),this.J=t.J,this.Z=t.Z,this}copy(){var t=new Xt;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)&&qt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Yt,this.f){let t="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),qt.n(t)}}static parse(s){if("string"!=typeof s)return new Xt;{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 Xt(e,i)}}static stringify(t){return Yt,qt.s(t,Xt),t.width.toString()+" "+t.height.toString()}static stringifyFixed(e){return qt.t(e,"number",Xt,"stringifyFixed:digits"),t=>t.width.toFixed(e)+" "+t.height.toFixed(e)}toString(){return"Size("+this.width+","+this.height+")"}equals(t){return t instanceof Xt&&this.J===t.width&&this.Z===t.height}equalTo(t,e){return this.J===t&&this.Z===e}equalsApprox(t){return I.p(this.J,t.width)&&I.p(this.Z,t.height)}inflate(t,e){Yt,qt.r(t,Xt,"inflate:w"),qt.r(e,Xt,"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){Yt,qt.t(t,"number",Xt,"width"),this.st(t),t<0&&qt.G(t,">= 0",Xt,"width"),this.J=t}get height(){return this.Z}set height(t){Yt,qt.t(t,"number",Xt,"height"),this.st(t),t<0&&qt.G(t,">= 0",Xt,"height"),this.Z=t}isReal(){return isFinite(this.width)&&isFinite(this.height)}static lf=new Xt(0,0).rt();static Bk=new Xt(1,1).rt();static nC=new Xt(6,6).rt();static du=new Xt(8,8).rt();static oC=new Xt(10,10).rt();static zk=new Xt(1/0,1/0).rt();static xw=new Xt(NaN,NaN).rt();static rC=[];static a(){var t=Xt.rC.pop();return void 0===t?new Xt:t}static o(t){Xt.rC.push(t)}}class J{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 U?(n=t.x,a=t.y,e instanceof U?(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 Xt?(this.S=n,this.P=a,this.J=e.width,this.Z=e.height):qt.n("Incorrect second argument supplied to Rect constructor "+e)):qt.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 Yt,qt.t(t,"number",J,"setTo:x"),qt.t(e,"number",J,"setTo:y"),qt.t(i,"number",J,"setTo:w"),qt.t(s,"number",J,"setTo:h"),i<0&&qt.G(i,">= 0",J,"setTo:w"),s<0&&qt.G(s,">= 0",J,"setTo:h"),this.st(),this.S=t,this.P=e,this.J=i,this.Z=s,this}set(t){return Yt,qt.s(t,J,J,"set:r"),this.st(),this.S=t.S,this.P=t.P,this.J=t.J,this.Z=t.Z,this}setPoint(t){return Yt,qt.s(t,U,J,"setPoint:p"),this.st(),this.S=t.x,this.P=t.y,this}setSize(t){return Yt,qt.s(t,Xt,J,"setSize:s"),this.st(),this.J=t.width,this.Z=t.height,this}copy(){var t=new J;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)&&qt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Yt,this.f){let t="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),qt.n(t)}}static parse(a){if("string"!=typeof a)return new J;{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 J(e,i,s,n)}}static stringify(t){return Yt,qt.s(t,J),t.x.toString()+" "+t.y.toString()+" "+t.width.toString()+" "+t.height.toString()}static stringifyFixed(e){return qt.t(e,"number",J,"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 J&&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 I.p(this.S,t.x)&&I.p(this.P,t.y)&&I.p(this.J,t.width)&&I.p(this.Z,t.height)}equalsApproxTo(t,e,i,s){return I.p(this.S,t)&&I.p(this.P,e)&&I.p(this.J,i)&&I.p(this.Z,s)}equalsApproxClose(t){return I.q(this.S,t.x)&&I.q(this.P,t.y)&&I.q(this.J,t.width)&&I.q(this.Z,t.height)}containsPoint(t){return Yt,qt.s(t,U,J,"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 Yt,qt.s(t,J,J,"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 Yt,qt.r(t,J,"contains:x"),qt.r(e,J,"contains:y"),void 0===i?i=0:qt.r(i,J,"contains:w"),void 0===s?s=0:qt.r(s,J,"contains:h"),(i<0||s<0)&&qt.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 Yt,qt.r(t,J,"offset:dx"),qt.r(e,J,"offset:dy"),this.st(),this.S+=t,this.P+=e,this}inflate(t,e){return Yt,qt.r(t,J,"inflate:w"),qt.r(e,J,"inflate:h"),this.bw(e,t,e,t)}addMargin(t){return Yt,qt.s(t,O,J,"addMargin:m"),this.bw(t.top,t.right,t.bottom,t.left)}subtractMargin(t){return Yt,qt.s(t,O,J,"subtractMargin:m"),this.bw(-t.top,-t.right,-t.bottom,-t.left)}grow(t,e,i,s){return Yt,qt.r(t,J,"grow:t"),qt.r(e,J,"grow:r"),qt.r(i,J,"grow:b"),qt.r(s,J,"grow:l"),this.bw(t,e,i,s)}bw(t,e,i,s){Yt,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 Yt,qt.s(t,J,J,"intersectRect:r"),this.lC(t.x,t.y,t.width,t.height)}intersect(t,e,i,s){return(Yt,qt.r(t,J,"intersect:x"),qt.r(e,J,"intersect:y"),qt.r(i,J,"intersect:w"),qt.r(s,J,"intersect:h"),i<0||s<0)&&qt.n("Rect.intersect:Width and height cannot be negative"),this.lC(t,e,i,s)}lC(t,e,i,s){Yt,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 Yt,qt.s(t,J,J,"intersectsRect:r"),this.intersects(t.x,t.y,t.width,t.height)}intersects(t,e,i,s){(Yt,qt.r(t,J,"intersects:x"),qt.r(e,J,"intersects:y"),qt.r(t,J,"intersects:w"),qt.r(e,J,"intersects:h"),i<0||s<0)&&qt.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",J,"width"),this.J=t}get height(){return this.Z}set height(t){Yt,qt.t(t,"number",J,"height"),this.st(t),t<0&&qt.G(t,">= 0",J,"height"),this.Z=t}get left(){return this.S}set left(t){Yt,qt.t(t,"number",J,"left"),this.st(t),this.S=t}get top(){return this.P}set top(t){Yt,qt.t(t,"number",J,"top"),this.st(t),this.P=t}get right(){return this.S+this.J}set right(t){Yt,qt.r(t,J,"right"),this.st(t),this.S+=t-(this.S+this.J)}get bottom(){return this.P+this.Z}set bottom(t){Yt,qt.r(t,J,"top"),this.st(t),this.P+=t-(this.P+this.Z)}get position(){return new U(this.S,this.P)}set position(t){Yt,qt.s(t,U,J,"position"),this.st(t),this.S=t.x,this.P=t.y}get size(){return new Xt(this.J,this.Z)}set size(t){Yt,qt.s(t,Xt,J,"size"),this.st(t),this.J=t.width,this.Z=t.height}get center(){return new U(this.S+this.J/2,this.P+this.Z/2)}set center(t){Yt,qt.s(t,U,J,"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){Yt,qt.r(t,J,"centerX"),this.st(t),this.S=t-this.J/2}get centerY(){return this.P+this.Z/2}set centerY(t){Yt,qt.r(t,J,"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 J(0,0,0,0).rt();static RD=new J(NaN,NaN,NaN,NaN).rt();static Yk=[];static a(){var t=J.Yk.pop();return void 0===t?new J:t}static H(t,e,i,s){var n=J.Yk.pop();return void 0===n?new J(t,e,i,s):n.e(t,e,i,s)}static o(t){J.Yk.push(t)}}class O{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):qt.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 Yt,qt.t(t,"number",O,"setTo:t"),qt.t(e,"number",O,"setTo:r"),qt.t(i,"number",O,"setTo:b"),qt.t(s,"number",O,"setTo:l"),this.st(),this.fn=t,this.cn=e,this.un=i,this.dn=s,this}set(t){return Yt,qt.s(t,O,O,"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 O;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)&&qt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Yt,this.f){let t="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),qt.n(t)}}static parse(a){if("string"!=typeof a)return new O;{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 O;let i=NaN;for(;""===r[t];)t++;if((a=r[t++])&&(i=parseFloat(a)),isNaN(i))return new O(e);let s=NaN;for(;""===r[t];)t++;if((a=r[t++])&&(s=parseFloat(a)),isNaN(s))return new O(e,i);let n=NaN;for(;""===r[t];)t++;return(a=r[t++])&&(n=parseFloat(a)),isNaN(n)?new O(e,i):new O(e,i,s,n)}}static stringify(t){return Yt,qt.s(t,O),t.top.toString()+" "+t.right.toString()+" "+t.bottom.toString()+" "+t.left.toString()}static stringifyFixed(e){return qt.t(e,"number",O,"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 O&&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 I.p(this.fn,t.top)&&I.p(this.cn,t.right)&&I.p(this.un,t.bottom)&&I.p(this.dn,t.left)}get top(){return this.fn}set top(t){Yt,qt.r(t,O,"top"),this.st(t),this.fn=t}get right(){return this.cn}set right(t){Yt,qt.r(t,O,"right"),this.st(t),this.cn=t}get bottom(){return this.un}set bottom(t){Yt,qt.r(t,O,"bottom"),this.st(t),this.un=t}get left(){return this.dn}set left(t){Yt,qt.r(t,O,"left"),this.st(t),this.dn=t}isReal(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)}static qg=new O(0,0,0,0).rt();static aC=new O(2,2,2,2).rt();static fC=[];static a(){var t=O.fC.pop();return void 0===t?new O:t}static o(t){O.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 Yt,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 Yt,qt.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)&&qt.n("cannot thaw constant: "+this),this.f=!1,this}st(e){if(Yt,this.f){let t="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==e&&(t+=" to value: "+e),qt.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){Yt,this.kw(t,"x"),this.st(t),this.S=t}get y(){return this.P}set y(t){Yt,this.kw(t,"y"),this.st(t),this.P=t}get offsetX(){return this.Vs}set offsetX(t){Yt,this.Sw(t,"offsetX"),this.st(t),this.Vs=t}get offsetY(){return this.Bs}set offsetY(t){Yt,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 H{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 H;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=H.dC.pop();return void 0===t?new H:t}static o(t){H.dC.push(t)}static Hk="54a702f3e53909c447824c6706603faf4c"}const I={OD:"7da71ca0ad381e90",Gn:(Math.sqrt(2)-1)/3*4,gC:null,Cw:t=>{if(t<=0)return 0;let e=I.gC;if(null===e){e=[];for(let t=0;t<=2e3;t++)e[t]=Math.sqrt(t);I.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 I.zi(t,e,r,o,d,i,s)&&I.zi(t,e,r,o,d,n,a)?I.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,I.Aw(t,e,c,g,m,f,p,v,l,h,u,d)||I.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 U.direction(t,i,e,s)},gu:(t,e,i,s,n,a,r,o,l,h)=>{var u,d,c,g,m,f;return I.zi(t,e,r,o,l,i,s)&&I.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,I.gu(t,e,u,d,c,g,m,f,l,h),I.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 I.zi(t,e,r,o,l,i,s)&&I.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,I.Hn(t,e,u,d,c,g,m,f,l,h),I.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 I.zi(t,e,n,a,h,i,s)?I.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,I.vk(t,e,u,d,c,g,r,o,l,h)||I.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 I.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,I.qk(t,e,l,h,u,d,r,o),I.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 I.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,I.Wg(t,e,l,h,u,d,r,o),I.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(I.zi(n,a,u,d,p,r,o)&&I.zi(n,a,u,d,p,l,h))return!!I.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,A=(a+o)/2,r=(r+l)/2,o=(o+h)/2,l=(l+u)/2,h=(h+d)/2,b=(y+r)/2,x=(A+o)/2,r=(r+l)/2,o=(o+h)/2,w=(b+r)/2,P=(x+o)/2;let t=1/0,e=!1,i=0,s=0;return I.jg(n,a,y,A,b,x,w,P,c,g,m,f,p,v)&&(n=(v.x-c)*(v.x-c)+(v.y-g)*(v.y-g)){let g=0;if(I.zi(i,s,r,o,c,t,e)&&I.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(I.q(i,n)){let t=0,e=0;e=se?(l.e(i,e),!1):(l.e(i,h),!0)}if(I.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(I.p(i,n)&&I.p(s,a))return h.e(i,s),!1;if(I.q(r,t))return I.q(i,n)?(I.Sl(i,s,n,a,r,o,h),!1):(u=(a-s)/(n-i)*(r-i)+s,I.Sl(i,s,n,a,r,u,h));var u=(l-o)/(t-r);if(I.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(I.q(u,t))return I.Sl(i,s,n,a,r,o,h),!1;l=(t*i-u*r+o-s)/(t-u);if(I.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,I.Sl(i,s,n,a,l,r,h)},sE:(t,e,i,s,n)=>I.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 I.vn(t,e,t,s,n,a,r,o,l)&&(c=(l.x-n)*(l.x-n)+(l.y-a)*(l.y-a))I.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!!(J.contains(t,e,i,s,n,a)||J.contains(t,e,i,s,r,o)||I.uu(l,u,h,u,n,a,r,o)||I.uu(h,u,h,d,n,a,r,o)||I.uu(h,d,l,d,n,a,r,o)||I.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:I.cu(t,e,i,s,n,a)*I.cu(t,e,i,s,r,o)<=0&&I.cu(n,a,r,o,t,e)*I.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:qt.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 J(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 J(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=b-1||null!==n[s+1].match(N)||(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 A(){var t=h.toLowerCase();return"c"===t||"s"===t||"q"===t||"t"===t?new U(2*c.x-d.x,2*c.y-d.y):new U(c.x,c.y)}const b=n.length,x=Be.xC(null);let w=!1,P=!1,S=!1,k=!0,M=null;const N=new RegExp("["+W.im+"]");for(;!(s>=b-1);)if(h=l,""!==(l=f())){let t=!(g=!0);switch(l.toUpperCase()){case"X":k=!0,w=!1,P=!1;break;case"M":for(M=v(),null===x.Ai||!0===k?(x.yu(M.x,M.y,w,!1,!P,S),k=!1):x.XD(M.x,M.y),u.c(c);!m();)M=v(),x.xr(M.x,M.y);break;case"L":for(;!m();)M=v(),x.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),x.xr(c.x,c.y);break;case"V":for(;!m();)c.e(c.x,(l===l.toLowerCase()?c.y:0)+parseFloat(f())),x.xr(c.x,c.y);g&&(t=!0);break;case"C":for(;!m();){var C=new U,L=(p(C),y()),D=v();x.br(C.x,C.y,L.x,L.y,D.x,D.y)}g&&(t=!0);break;case"S":for(;!m();){var T=A(),B=y(),H=v();x.br(T.x,T.y,B.x,B.y,H.x,H.y)}g&&(t=!0);break;case"Q":for(;!m();){var I=y(),z=v();x.Dw(I.x,I.y,z.x,z.y)}g&&(t=!0);break;case"T":for(;!m();){var G=A(),R=(d.c(G),v());x.Dw(G.x,G.y,R.x,R.y),d.c(R)}g&&(t=!0);break;case"B":for(;!m();){var K=parseFloat(f()),V=parseFloat(f());let t=parseFloat(f()),e=parseFloat(f());var Y=parseFloat(f());let i=Y,s=!1;m()||(i=parseFloat(f()),m())||(s=0!==parseFloat(f())),l===l.toLowerCase()&&(t+=c.x,e+=c.y),x.YD(K,V,t,e,Y,i,s)}g&&(t=!0);break;case"A":for(;!m();){var q=Math.abs(parseFloat(f())),X=Math.abs(parseFloat(f())),j=parseFloat(f());let t=!1,e=!1,i=0,s=0;var F=f();s=(i=1===F.length?(t=!!parseFloat(F),e=!!parseFloat(f()),parseFloat(f())):2===F.length?(t=!!parseFloat(F[0]),e=!!parseFloat(F[1]),parseFloat(f())):(t=!!parseFloat(F[0]),e=!!parseFloat(F[1]),parseFloat(F.slice(2))),parseFloat(f())),l===l.toLowerCase()&&(i=c.x+i,s=c.y+s),c.e(i,s),x.KD(q,X,j,t,e,i,s)}g&&(t=!0);break;case"Z":x.UD(),c.c(u);break;case"F":{let t="",e=1;for(;n[s+e];){if("0"===n[s+e])S=!0;else if(null===n[s+e].match(/[Uu]/)&&null!==n[s+e].match(N)){t=n[s+e];break}e++}t.match(/[Mm]/)?w=!0:x.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(N)){t=n[s+e];break}e++}t.match(/[Mm]/)?P=!0:x.HD(!1);break}default:"0"!==l&&"1"!==l&&qt.ft("Unknown geometry command: "+l)}if(t){qt.ft(`Bad geometry command: ${l}, next token: ${f()}, +string: `+e);break}}i=x.em;if(Be.bC(x),t)for(var Q=i.figures.iterator;Q.next();)Q.value.isFilled=!0;return i}static kC(e,i){var s=e.length,n=U.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)):(A=(n-i)*(n-i)+(a-s)*(a-s),b=U.a(),I.Sl(i,s,n,a,o,l,b),n=b.x,a=b.y,U.o(b),Math.sqrt(((n-i)*(n-i)+(a-s)*(a-s))/A))}}if(2!==this.type){var h=this.flattenedSegments,u=this.flattenedLengths,o=this.flattenedTotalLength,d=U.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=I.pC(0,0,eMath.sqrt(t*t+e*e),b=(t,e,i,s)=>(t*i+e*s)/(A(t,e)*A(i,s)),x=(t,e,i,s)=>(t*se?t:e),r=t>e?1:t/e,d=t>e?e/t:1,o=I.pC(0,0,h,w,w+a,!0),c=H.a();c.ti(),c.se(v,y),c.ys(this.gn,0,0),c.v(r,d),W.kC(o,c),H.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){Yt,qt.it(t,M,"SegmentType"),this.f&&qt.O(this,t),this.nt=t,this.Nt=!0}get endX(){return this.ne}set endX(t){Yt,qt.r(t,w,"endX"),this.f&&qt.O(this,t),this.ne=t,this.Nt=!0}get endY(){return this.oe}set endY(t){Yt,qt.r(t,w,"endY"),this.f&&qt.O(this,t),this.oe=t,this.Nt=!0}get point1X(){return this.gn}set point1X(t){Yt,qt.r(t,w,"point1X"),this.f&&qt.O(this,t),this.gn=t,this.Nt=!0}get point1Y(){return this.Pl}set point1Y(t){Yt,qt.r(t,w,"point1Y"),this.f&&qt.O(this,t),this.Pl=t,this.Nt=!0}get point2X(){return this.Nl}set point2X(t){Yt,qt.r(t,w,"point2X"),this.f&&qt.O(this,t),this.Nl=t,this.Nt=!0}get point2Y(){return this.kr}set point2Y(t){Yt,qt.r(t,w,"point2Y"),this.f&&qt.O(this,t),this.kr=t,this.Nt=!0}get centerX(){return this.gn}set centerX(t){Yt,qt.r(t,w,"centerX"),this.f&&qt.O(this,t),this.gn=t,this.Nt=!0}get centerY(){return this.Pl}set centerY(t){Yt,qt.r(t,w,"centerY"),this.f&&qt.O(this,t),this.Pl=t,this.Nt=!0}get radiusX(){return this.Nl}set radiusX(t){Yt,qt.r(t,w,"radiusX"),t<0&&qt.G(t,">= zero",w,"radiusX"),this.f&&qt.O(this,t),this.Nl=t,this.Nt=!0}get radiusY(){return this.kr}set radiusY(t){Yt,qt.r(t,w,"radiusY"),t<0&&qt.G(t,">= zero",w,"radiusY"),this.f&&qt.O(this,t),this.kr=t,this.Nt=!0}get startAngle(){return this.ne}set startAngle(t){Yt,qt.r(t,w,"startAngle"),this.f&&qt.O(this,t),(t%=360)<0&&(t+=360),this.ne=t,this.Nt=!0}get sweepAngle(){return this.oe}set sweepAngle(t){Yt,qt.r(t,w,"sweepAngle"),this.f&&qt.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 Q{Ew;Xi;LC;Ys;Qk;km;Zn;Vw;_k;pn;yf;Bw;Ks;zw;Xw;Sm;Yw;constructor(t){this.Ew=new C,this.Xi=!1,this.LC=(new E).w(),this.Ys=-1,this.Qk=999,this.Ks=!1,this.km=null,this.Zn=0,this.Vw=!1,Yt,this.Vw=!0,this._k=23,this.pn=(new E).w(),this.yf=new E,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&&qt.Gg(this.Mm),this.Mm=-1}doWaitAfter(t){}findToolHandleAt(t,e){t=this.diagram.findObjectAt(t,t=>{for(;null!==t&&!(t.panel instanceof q);)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){qt.t(t,"string",_,"name"),this.Tt=t}get isEnabled(){return this.Xi}set isEnabled(t){qt.t(t,"boolean",_,"isEnabled"),this.Xi=t}get isActive(){return this.tS}set isActive(t){qt.t(t,"boolean",_,"isActive"),this.tS=t}get transactionResult(){return this.iS}set transactionResult(t){null!==t&&qt.t(t,"string",_,"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 _{FC;RC;IC;nS;oS;rS;lS;hS;aS;fS;Nm;Gh;constructor(t){super(),this.name="ToolManager",this.FC=new E,this.RC=new E,this.IC=new E,this.nS=850,this.oS=850,this.rS=new Xt(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){qt.it(t,$,"WheelMode"),this.hS=t}get gestureBehavior(){return this.aS}set gestureBehavior(t){qt.it(t,it,"GestureMode"),this.aS=t}initializeStandardTools(){}updateAdornments(t){var e,i=this.currentToolTip;i instanceof q&&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=(Yt,i.bu&&0!==i.transactionLevel&&qt.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=U.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=J.a(),h=e.selection.iterator;h.next();){var u=h.value;u instanceof D&&this.eF(e,u,l)}J.o(l)}}}iF(t,e){var i=this.diagram,e=e.part;!i.handlesDragDropForTopLevelParts||!e.isTopLevel||e instanceof j||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 X,!0,t=>t instanceof X,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 K||(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=J.a(),a=(this._D(t,e),e.x+e.width/2),r=e.y+e.height/2,o=(J.o(e),this.Cm),l=new L,h=U.a(),u=t.iterator;u.next();){var d,c=u.value;c instanceof X&&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)))}U.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 U}static Ww=new E;static St=null;static vh=null}st.prototype.doCancel=function(){null!==d.St&&d.St.doCancel(),_.prototype.doCancel.call(this)};class nt extends _{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 X({layerName:"Tool"}).add(new z({isPanelMain:!0,stroke:"blue"}).theme("stroke","tempLink"),new z({toArrow:"Standard",fill:"blue",stroke:"blue"}).theme("fill","tempLink").theme("stroke","tempLink")).ui(),this.qh=new z("Rectangle",{portId:"",fill:null,stroke:"magenta",strokeWidth:2,desiredSize:Xt.Bk}).theme("stroke","tempPort"),this.BS=new D({selectable:!1,layerName:"Tool"}).add(this.qh).ui(),this.Wh=new z("Rectangle",{portId:"",fill:null,stroke:"magenta",strokeWidth:2,desiredSize:Xt.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){qt.t(t,"number",nt,"portGravity"),0<=t&&(this.OS=t)}get isUnconnectedLinkValid(){return this.ES}set isUnconnectedLinkValid(t){qt.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){qt.s(t,X,nt,"temporaryLink"),t.ui(),this.VS=t}get temporaryFromNode(){return this.BS}set temporaryFromNode(t){qt.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;qt.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){qt.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;qt.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&&qt.s(t,X,nt,"originalLink"),this.XS=t}get originalFromNode(){return this.YS}set originalFromNode(t){null!==t&&qt.s(t,D,nt,"originalFromNode"),this.YS=t}get originalFromPort(){return this.KS}set originalFromPort(t){null!==t&&qt.s(t,y,nt,"originalFromPort"),this.KS=t}get originalToNode(){return this.US}set originalToNode(t){null!==t&&qt.s(t,D,nt,"originalToNode"),this.US=t}get originalToPort(){return this.GS}set originalToPort(t){null!==t&&qt.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&&qt.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=Xt.a()).width=e.naturalBounds.width*r,a.height=e.naturalBounds.height*r,s.desiredSize=a,Xt.o(a),n?(s.toSpot=e.toSpot,s.toEndSegmentLength=e.toEndSegmentLength):(s.fromSpot=e.fromSpot,s.fromEndSegmentLength=e.fromEndSegmentLength),i.locationSpot=Z.Center,r=U.a(),i.location=e.getDocumentPoint(Z.Center,r),U.o(r),s.angle=e.getDocumentAngle(),null!==this.portTargeted)&&this.portTargeted(t,e,i,s,n)}setNoTargetPortProperties(t,e,i){null!==e&&(e.desiredSize=Xt.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,U.a()),d=i.x-u.x,h=i.y-u.y,U.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 C).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 C).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 C).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&&qt.t(t,"function",nt,"linkValidation"),this.Fl=t}get portTargeted(){return this.qS}set portTargeted(t){null!==t&&qt.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&&qt.t(t,"object",rt,"archetypeLinkData"),t instanceof y&&qt.s(t,X,rt,"archetypeLinkData"),this.jS=t}get archetypeLabelNodeData(){return this.JS}set archetypeLabelNodeData(t){null!==t&&qt.t(t,"object",rt,"archetypeLabelNodeData"),t instanceof y&&qt.s(t,D,rt,"archetypeLabelNodeData"),this.JS=t}get direction(){return this.C}set direction(t){qt.it(t,at,"LinkingDirection"),this.C=t}get startObject(){return this.ZS}set startObject(t){null!==t&&qt.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 X?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 z("Diamond",{desiredSize:Xt.du,fill:"lightblue",stroke:"dodgerblue",cursor:this.linkingCursor,segmentIndex:0}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.QS=new z("Diamond",{desiredSize:Xt.du,fill:"lightblue",stroke:"dodgerblue",cursor:this.linkingCursor,segmentIndex:-1}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.ws=null,this._S=new J,t&&Object.assign(this,t)}updateAdornments(i){if(null!==i&&i instanceof X){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 q,e=(i.type=jt.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&&qt.s(t,y,ot,"fromHandleArchetype"),this.$S=t}get toHandleArchetype(){return this.QS}set toHandleArchetype(t){null!==t&&qt.s(t,y,ot,"toHandleArchetype"),this.QS=t}get handle(){return this.ws}set handle(t){if(null!==t&&(qt.s(t,y,ot,"handle"),!(t.part instanceof q)))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 q&&i.adornedPart instanceof X))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){qt.t(t,"number",ut,"snapAngleMultiple"),this.hM=t}get snapAngleEpsilon(){return this.aM}set snapAngleEpsilon(t){qt.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){qt.t(t,"number",ut,"handleAngle"),this.cM=t}get handleDistance(){return this.uM}set handleDistance(t){qt.t(t,"number",ut,"handleDistance"),this.uM=t}}class dt extends _{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 _{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 _{Ol;dM;Sf;gM;constructor(t){super(),this.name="ClickCreating",this.Ol=null,this.dM=!0,this.Sf=!1,this.gM=new U(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 Y?n.De()&&(n.ui(),null!==(a=n.copy()))&&s.add(a):null!==n&&(e=s.model.copyNodeData(n),qt.Mt(e))&&(s.model.addNodeData(e),a=s.findPartForData(e)),null!==a&&(i=U.H(t.x,t.y),this.isGridSnapEnabled&&this.diagram.mM(a,t,i),a.location=i,s.allowSelect&&(s.clearSelection(!0),a.isSelected=!0),U.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&&qt.t(t,"object",gt,"archetypeNodeData"),this.Ol=t}get isDoubleClick(){return this.dM}set isDoubleClick(t){qt.t(t,"boolean",gt,"isDoubleClick"),this.dM=t}get isGridSnapEnabled(){return this.Sf}set isGridSnapEnabled(t){qt.t(t,"boolean",gt,"isGridSnapEnabled"),this.Sf=t}}class mt extends _{Hh;pM;El;constructor(t){super(),this.name="DragSelecting",this.Hh=175,this.pM=!1,this.El=new Y({layerName:"Tool",selectable:!1}).add(new z("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){qt.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&&qt.s(t,HTMLElement,pt,"mainElement"),this.wM=t}get show(){return this.tx}set show(t){this.tx!==t&&(null!==t&&qt.t(t,"function",pt,"show"),this.tx=t)}get hide(){return this.ix}set hide(t){this.ix!==t&&(null!==t&&qt.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 _{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 U,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=qt.hn("div"),i=qt.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;",qt.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 q&&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 q&&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 q&&!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){Yt,t instanceof q||t instanceof pt||qt.n("showContextMenu:contextMenu must be an Adornment or HTMLInfo."),null!==e&&qt.s(e,y,yt,"showContextMenu:obj");var i,s,n=this.diagram;t!==this.currentContextMenu&&this.hideContextMenu(),t instanceof q?((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=qt.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=qt.hn("li")).className="goCXli",(r=qt.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){Yt,null===t||(t instanceof q||t instanceof pt)||qt.n("ContextMenuTool.currentContextMenu must be an Adornment or HTMLInfo."),this.bM=t,this.ex=t instanceof q?t.adornedPart:null}get defaultTouchContextMenu(){return!1===yt.MM&&null===yt.Au&&K.isUsingDOM()&&this.lF(),yt.Au}set defaultTouchContextMenu(t){Yt,null===t||(t instanceof q||t instanceof pt)||qt.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&&qt.s(t,y,yt,"currentObject"),this.kM=t}get mouseDownPoint(){return this.SM}}(At={})[At.LostFocus=1]="LostFocus",At[At.MouseDown=2]="MouseDown",At[At.Tab=3]="Tab",At[At.Enter=4]="Enter";(e={})[e.SingleClick=1]="SingleClick",e[e.SingleClickSelected=2]="SingleClickSelected",e[e.DoubleClick=3]="DoubleClick";var At,xt=e,bt=((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 wt extends _{Fe;PM;NM;Vl;jt;CM;AM;LM;rx;lx;constructor(t){super(),this.name="TextEditing",this.Fe=new V,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(K.isUsingDOM()){const u=qt.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 V&&s instanceof wt)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&&qt.s(t,V,wt,"textBlock"),this.PM=t}get currentTextEditor(){return this.LM}set currentTextEditor(t){this.LM=t}get defaultTextEditor(){return this.rx}set defaultTextEditor(t){Yt,t instanceof pt||qt.n("TextEditingTool.defaultTextEditor must be an HTMLInfo."),this.rx=t}get starting(){return this.NM}set starting(t){qt.it(t,xt,"TextEditingStarting"),this.NM=t}canStart(){var t,e;return!!this.isEnabled&&!(null===(t=this.diagram)||t.isReadOnly||wt.Af&&wt.Af!==this&&(wt.Af.acceptText(2),wt.Af)&&wt.Af!==this||!t.lastInput.left||this.isBeyondDragSize()||(e=t.lastInput.documentPoint,!(null!==(e=t.findObjectAt(e))&&e instanceof V&&e.editable&&e.part.canEdit()))||null===(e=e.part)||2===this.starting&&!e.isSelected||3===this.starting&&t.lastInput.clickCount<2)}doStart(){null!==(wt.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 V&&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 J(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(){wt.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){qt.s(t,V,wt,"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&&qt.t(t,"function",wt,"textValidation"),this.Vl=t}get minimumEditorScale(){return this.CM}set minimumEditorScale(t){null!==t&&qt.t(t,"number",wt,"minimumEditorScale"),this.CM=t}get selectsTextOnActivate(){return this.AM}set selectsTextOnActivate(t){null!==t&&qt.t(t,"boolean",wt,"selectsTextOnActivate"),this.AM=t}get state(){return this.jt}set state(t){this.jt!==t&&(qt.it(t,bt,"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 St{b;Di;Xi;Lr;$n;Eo;TM;DM;Vm;Mi;Lf;xn;Bm;Jh;hx;zm;ax;Tf;Nu;Xm;constructor(t){this.b=K.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 C,this.xn=new kt,this.Bm=new kt,(this.xn.bs=this).Jh=new C,this.hx=new C,this.zm=new C,this.Xm=new C,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 X&&(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){qt.t(t,"number",St,"duration"),t<1&&qt.G(t,">= 1",St,"duration"),this.Eo=t}get isAnimating(){return this.Di}get isTicking(){return this.Vm}get isInitial(){return this.Lr}set isInitial(t){qt.t(t,"boolean",St,"isInitial"),this.Lr=t}get defaultAnimation(){return this.xn}get activeAnimations(){return this.Jh}get initialAnimationStyle(){return this.Tf}set initialAnimationStyle(t){Yt,qt.it(t,Pt,"AnimationStyle"),this.Tf=t}static gx=new L;static defineAnimationEffect(t,e){St.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=St.gx,e=(t,e,i,s,n,a)=>{t.position=new U(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 J(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=St.BM(e,i,n,a,s)}),t.add("stroke",(t,e,i,s,n,a)=>{t.stroke=St.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=St.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 kt{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=kt.EaseInOutQuad,this.Ym=kt.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=U.To,this.we=new L,this.px=new L,this.If=new C,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()&&((Yt,void 0===e&&qt.n("addTemporaryPart: Required Diagram argument missing"),t.diagram===e&&qt.n("addTemporaryPart: Part already in Diagram, did you mean to pass in a copy?"),null!==this.b)&&this.b!==e&&qt.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 K?this.b=t:t instanceof y&&null!==t.diagram&&(this.b=t.diagram)),t instanceof Y){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 K&&"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 U&&!s.isReal()&&s.c(this.eA),n&&0===e.indexOf("position:")&&t instanceof Y?r.bx.location=this.Iu(t.location):n&&(r.bx[e]=this.Iu(i))}Iu(t){return t instanceof U||t instanceof Xt?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=St.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=St.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 Y&&(l.location=c.location),h.kx&&l instanceof Y&&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 j?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 U(n.x+n.width/2,n.y+n.height/2),t.position,!1),this.add(t,"scale",.01,t.scale,!1),t instanceof j&&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 j?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 j&&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){qt.t(t,"number",kt,"duration"),t<1&&qt.G(t,">= 1",kt,"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 Nt=e;class Ct{Te;mn;Ou;Ef;constructor(t,e,i){i&&(Yt,qt.it(i,Nt,"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 Ct(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){Yt,qt.it(t,Nt,"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){C.ji(this),this.b=null,this.It=new E,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 j&&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,K.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=A.initDiagramModel(),this.C1=null,this.themeManager=new Vi,this.Xo=!0,this.gA(),this.layout=new Qe,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 Gt(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 Ht)){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 E,this.setupRouters(),this.bs=new St,this.bs.Vo(this),this.wi=17,this.WM=!1,this.ju=!1,this.Cx="default",this.Jt=new E,this.ih=new L,this.Yf="default",this.resetRenderingHints(),this.GF(),this._t=1,this.lt=new U(NaN,NaN).w(),this.fx=new U(NaN,NaN),this.v=1,this.s0=1,this.Ax=new U(NaN,NaN).w(),this.Lx=NaN,this.Tx=1e-4,this.Dx=100,this.D=new H,this.Fx=new U(NaN,NaN).w(),this.Rx=new J(NaN,NaN,NaN,NaN).w(),this.Vf=new O(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 C,this._h=new C,this.zo=!1,this.sh=new L,this.qu=!0,this.jm=250,this.zf=-1,this.Jm=new O(16,16,16,16).w(),this.Tr=!1,this.Xf=!1,this.Yu=!0,this.e0=new N,(this.e0.diagram=this).jr=new N,(this.jr.diagram=this).ia=new N,(this.ia.diagram=this).Er=null,this.to=null,this.Hw=!1,this.HF(),this.Zr=new C,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 E,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 O(5).w(),this.lP=(new C).w(),this.h1=999999999,this.hP=(new C).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 C,this.uP=new C,this._l=null,this.aP=new Xt(8,8),this.fP=999,this.eS=1,this.sS=0,this.Ui={scale:1,position:new U,bounds:new J,canvasSize:new Xt,newCanvasSize:new Xt,isScroll:!1},this.Ui.canvasSize=this.Ui.canvasSize,this.Ui.newCanvasSize=this.Ui.newCanvasSize,this.Ui.isScroll=!1,this.a1=new J(NaN,NaN,NaN,NaN).w(),this.Hu=new Xt(NaN,NaN).w(),this.Qm=new J(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 Et,this.P1=null,this.N1=null,this.k1=!1,this.Mu=!1,this.commandHandler=new Kt,this.a0=null,this.f0=U.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 U,this.aA=500,this.i0=new U,this.r0=!1}static mA=void 0!==v.document;static isUsingDOM(){return K.mA}static useDOM(t){K.mA=!!t&&void 0!==v.document}static he=new WeakMap;clear(){this.animationManager.stopAnimation(),this.model.clear(),K.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 C).w(),this.hP=(new C).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 O(t/2):1.5)),this.c1=this._m,this.u1=new q(jt.Link).add(new z({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=qt.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),K.Pm()===this&&K.uA(null)):null===this.nh&&(this.eo=!1),(this.Ot=null)!==t?((e=K.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 qi)}bP(t){const a=this;if(K.isUsingDOM()){null==t&&qt.n("Diagram setup requires an argument DIV."),null!==a.Ot&&qt.n("Diagram has already completed setup."),"string"==typeof t?a.Ot=v.document.getElementById(t):t instanceof HTMLDivElement?a.Ot=t:qt.n("No DIV or DIV id supplied: "+t),null===a.Ot&&qt.n("Invalid DIV id; could not get element with id: "+t);t=K.he.get(a.Ot);if(t&&t!==this&&qt.n("Invalid div id; div already has a Diagram associated with it."),!a.Uf&&v.ResizeObserver){const s=v.ResizeObserver,n=qt.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="",K.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,K.isUsingDOM()&&(t=qt.hn("div"),i=qt.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=K.jF,t.addEventListener("pointerdown",K.JF),t.b=a,t.ZF=!0,t.$F=!0,a.g1=t,a.m1=i),a.Pu=qt.Rk(()=>{a.Tl=null,a.T()},300,!1),a.w1=qt.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 K&&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[qt.Os("7eba17a4ca3b1a8346")][qt.Os("78a118b7")](t.Y,K.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 Y)return e}else{e=this.DS(t,t=>t.part);if(e instanceof Y)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 Y&&t.canSelect():null,i)}aR(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=null),s instanceof E||s instanceof C||(s=new C),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 E||s instanceof C||(s=new C),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 Y&&(!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 E||n instanceof C||(n=new C),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 C,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 E||n instanceof C||(n=new C),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 Y&&(!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 E||n instanceof C)&&(a=n),n=!0),a instanceof E||a instanceof C||(a=new C),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 E||n instanceof C)&&(a=n),n=!0),a instanceof E||a instanceof C||(a=new C),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),qt.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=K.he.get(e);if(e)return e;let i=t.path;return(i=i||"function"!=typeof t.composedPath?i:t.composedPath())&&i[0]&&K.he.has(i[0])?K.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)&&K.he.get(s)&&(a=e,n=K.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,qt.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?(Yt,Yt.handleMessages&&qt.ft("NOT handled "+e.type+" "+t.toString()),!0):(Yt,Yt.handleMessages&&qt.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=K.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=K.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=K.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=K.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 U(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 U(e,t).Ge(this.D):new U(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=U.H(s,n),this.D.rs(t),e.documentPoint.c(t),U.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 U(NaN,NaN),e.isEnabled=i,this.Ps=!0,this);null!==t&&qt.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=J.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),J.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 j&&t.PA(!1)})}}MA(t,e){for(const i of t)!i.De()||i instanceof j||(i.tl()?(i.wt(1/0,1/0),i.vt()):e&&e.add(i));for(const s of t)if(s instanceof j){if(!s.isVisible())continue;this.L1(s)}}NP(t,e){this.MA(t,e);for(const s of t){var i;s instanceof X&&(i=s).isVisible()&&(i.tl()?(i.wt(1/0,1/0),i.vt()):e.add(i))}for(const n of t)n instanceof q&&n.isVisible()&&(n.tl()?(n.wt(1/0,1/0),n.vt()):e.add(n))}g0(t){var e=t instanceof K,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 j||n.tl()&&(n.wt(1/0,1/0),n.vt())}for(i.reset();i.next();){var a=i.value;s.has(a)&&a instanceof j&&a.isVisible()&&this.L1(a)}i.reset()}for(;i.next();){var r=i.value;r instanceof X&&s.has(r)&&r.isVisible()&&r.tl()&&(r.wt(1/0,1/0),r.vt())}}L1(t){for(var e=qt.ct(),i=qt.ct(),s=t.memberParts;s.next();){var n=s.value;n.isVisible()&&(n instanceof j?(n.Ko()||n.hs()||n.rh())&&this.L1(n):n instanceof X?(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=A.left,m=A.right),c.height>y&&(f=A.top,p=A.bottom)):(g=A.left,m=A.right,f=A.top,p=A.bottom),c.width+g+m),x=c.height+f+p,b=this.scale,I=b,w=o/bN+1&&(t=Math.max((M-N)*b+this.Ct,t)),v+a+1D+1&&(t=Math.max((c-D)*b+this.At,t)),y+r+1N+1&&(t=Math.max((M-N)*b+this.Ct,t)),v+1D+1&&(t=Math.max((c-D)*b+e,t)),y+1N+1&&(F=this.position.x*b)),this.ju)switch(this.Cx){case"negative":F=-(u.scrollWidth-F-u.clientWidth);break;case"reverse":F=u.scrollWidth-F-u.clientWidth}return u.scrollLeft=F,this.hasVerticalScrollbar&&this.allowVerticalScroll&&(y+1D+1&&(u.scrollTop=this.position.y*b)),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||(w=J.H(h,E,O,H),this.onViewportBoundsChanged(w,this.viewportBounds,I,n),J.o(w),!1)}add(e){qt.s(e,Y,K,"add:part");var i=e.diagram;if(i!==this){null!==i&&qt.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)&&qt.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 X&&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){qt.s(t,Y,K,"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),U.H(this.lt.x+t/i-t/s,this.lt.y+e/i-e/s));this.position=r,U.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=U.a(),I.vg(t.x,t.y,0,0,i.width,i.height,s),s.offset(-i.width,-i.height),n.part.location=s,U.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",K,"scrollHorizontalLineChange"),this.i1=t,this.i("scrollHorizontalLineChange",e,t))}get scrollVerticalLineChange(){return this.e1}set scrollVerticalLineChange(t){var e=this.e1;e!==t&&(qt.t(t,"number",K,"scrollVerticalLineChange"),t<0&&qt.G(t,">= 0",K,"scrollVerticalLineChange"),this.e1=t,this.i("scrollVerticalLineChange",e,t))}get lastInput(){return this.ia}set lastInput(t){Yt,qt.s(t,N,K,"lastInput"),this.ia=t}get previousInput(){return this.jr}set previousInput(t){Yt,qt.s(t,N,K,"previousInput"),this.jr=t}get firstInput(){return this.e0}set firstInput(t){Yt,qt.s(t,N,K,"firstInput"),this.e0=t}get currentCursor(){return this.Kx}set currentCursor(t){var e,i,s;""===t&&(t=this.Zm),this.Kx!==t&&(qt.t(t,"string",K,"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)&&(qt.t(t,"string",K,"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&&qt.t(t,"function",K,"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&&qt.t(t,"function",K,"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&&qt.t(t,"function",K,"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&&qt.t(t,"function",K,"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&&qt.t(t,"function",K,"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&&qt.t(t,"function",K,"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&&qt.t(t,"function",K,"mouseDragOver"),this.Ux=t,this.i("mouseDragOver",e,t))}get mouseDrop(){return this.Ur}set mouseDrop(t){var e=this.Ur;e!==t&&(Yt,null!==t&&qt.t(t,"function",K,"mouseDrop"),this.Ur=t,this.i("mouseDrop",e,t))}get handlesDragDropForTopLevelParts(){return this.Gx}set handlesDragDropForTopLevelParts(t){var e=this.Gx;e!==t&&(qt.t(t,"boolean",K,"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&&qt.t(t,"function",K,"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&&qt.t(t,"function",K,"mouseLeave"),this.Hr=t,this.i("mouseLeave",e,t))}get toolTip(){return this.vr}set toolTip(t){var e=this.vr;e!==t&&(Yt,null===t||(t instanceof q||t instanceof pt)||qt.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&&(Yt,t instanceof q||t instanceof pt||qt.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&&(qt.s(t,st,K,"toolManager"),(this.$M=t).diagram=this)}get defaultTool(){return this.QM}set defaultTool(t){var e=this.QM;e!==t&&(qt.s(t,_,K,"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)&&(qt.s(t,_,K,"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(qt.t(t,"number",K,"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",K,"maxSelectionCount")}get nodeSelectionAdornmentTemplate(){return this._m}set nodeSelectionAdornmentTemplate(t){var e=this._m;e!==t&&(qt.s(t,q,K,"nodeSelectionAdornmentTemplate"),this._m=t,this.i("nodeSelectionAdornmentTemplate",e,t))}get groupSelectionAdornmentTemplate(){return this.c1}set groupSelectionAdornmentTemplate(t){var e=this.c1;e!==t&&(qt.s(t,q,K,"groupSelectionAdornmentTemplate"),this.c1=t,this.i("groupSelectionAdornmentTemplate",e,t))}get linkSelectionAdornmentTemplate(){return this.u1}set linkSelectionAdornmentTemplate(t){var e=this.u1;e!==t&&(qt.s(t,q,K,"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&&(qt.t(t,"boolean",K,"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){qt.s(e,A,K,"model"),this.currentTool.doCancel(),i&&i.undoManager!==e.undoManager&&i.undoManager.isInTransaction&&qt.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&&(qt.s(t,Vi,A,"themeManager"),null!==e&&e.removeDiagram(this),null!==(this.C1=t))&&t.addDiagram(this)}initializePartManager(t){}static xP(t,e){K.cA.add(t,e)}static get licenseKey(){return K.IP.last()}static set licenseKey(t){K.IP.add(t.replace(/\s/g,""))}static get version(){return K.xR}static IP=new E;static xR="3.0.2";wR(t){t=K.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;qt.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 C&&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)):qt.G(t,"> 0",K,"minScale"))}get maxScale(){return this.Dx}set maxScale(t){qt.r(t,K,"maxScale");var e=this.Dx;e!==t&&(0 0",K,"maxScale"))}get zoomPoint(){return this.Fx}set zoomPoint(t){this.Fx.equals(t)||(qt.s(t,U,K,"zoomPoint"),t=t.L(),this.Fx=t)}get contentAlignment(){return this.Bf}set contentAlignment(t){var e=this.Bf;e.equals(t)||(qt.s(t,Z,K,"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)||(qt.s(t,Z,K,"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 O(t):qt.s(t,O,K,"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&&(qt.s(t,ei,K,"partManager"),null!==t.diagram&&qt.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 C,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=J.a(),e.computeBounds(t),t.unionRect(e.documentBounds),e.zA(t),J.o(t),e.qe=!0,e.maybeUpdate(),e.HA())},t)}}stopAutoScroll(){-1!==this.zf&&(qt.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=J.H(0,0,s.width*i,s.height*i),n=U.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(U.To)||(e=new U(e.x+n.x/i,e.y+n.y/i)),J.o(s),U.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 j&&(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 K.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 K.img+"data":a=s.getImageData(0,0,n.width,n.height);break;case K.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="",qt.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&&qt.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 Xt(1/0,1/0):new Xt(2e3,2e3));var o=t.position||null;let l=t.parts||null,h=(Array.isArray(l)&&(l=new E(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 O(h):h instanceof O||qt.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 Xt(t.width,t.height),this.v,this.lt,l,u,m,f),e.gi):(this.qu=!1,this.T1(p,h,new Xt(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 A=this.Jt.h,x=A.length;for(let t=0;tv?(a=v,R=y.width,y):(R=r.width,r)).height:(R=y.width*a,y.height*a):(a=v,R=y.width,y.height),null!==h?(R+=D,F+=T):h=new O(0),null!==r){let t=r.width,e=r.height;"SVG"!==i&&s&&!K.WA&&(Yt,R>t||F>e)&&(qt.ft("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(R)+"x"+Math.ceil(F)+" vs 2000x2000) Consider increasing the max size."),K.WA=!0),isNaN(t)&&(t=2e3),isNaN(e)&&(e=2e3),isFinite(t)&&(R=Math.min(R,t)),isFinite(e)&&(F=Math.min(F,e))}return t.width=Math.ceil(R),t.height=Math.ceil(F),"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 Xt(Math.ceil(R),Math.ceil(F)),a,k,l,u,m,f),e.gi):(this.qu=!1,this.T1(p,h,new Xt(Math.ceil(R),Math.ceil(F)),a,k,l,u,m,f),this.qu=!0,t.gi)}static Ju=null;static jA="5da73c80a36555d4038e4972187c3cae51fd22";static ww=!1;static Hk=()=>{if(void 0===K.jA[5]&&(H.prototype.rs=H.prototype.Pw),K.isUsingDOM()){var t=v.document.createElement("canvas"),e=t.getContext("2d"),i=qt.Os("7ca11abfd022028846"),s=(e[i]=qt.Os("398c3597c01238"),"7ca11abfd7330390"),n=[K.jA,qt.ww+"4ae6247590da4bb21c324ba3a84e385776",H.Hk+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",I.za];for(let t=1;t<5;t++)e[qt.Os(s)](qt.Os(n[t-1]),10,15*t+0);e[i]=qt.Os("39f046ebb36e4b");for(let t=1;t<5;t++)e[qt.Os(s)](qt.Os(n[t-1]),10,15*t+0);4===n.length&&"5"===n[0][0]&&"7"===n[3][0]||(H.prototype.rs=H.prototype.Pw),K.Ju=t}}}class Gt{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[qt.Os("76a715b2f73f148a")][qt.Os("72ba13b5")]||"",n=qt.Os;if(this.Ie=!0,K.isUsingDOM())if(K[n("76a115b6ed251eaf4692")])for(var a=K.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(qt[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 U(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&&qt.n("No div specified"),null===this.xt&&qt.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 C,i=t.selection.iterator;i.next();){var s=i.value;Y.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)K.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 E).addAll(i.iteratorValues),K.c0=a,K.A1=n.model.dataFormat}}n.V("ClipboardChanged",a)}pasteFromClipboard(){var s=new C,n=K.c0;if(null!==n){var a=this.diagram;if(K.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),qt.r(t,Kt,"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),qt.r(t,Kt,"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),qt.r(t,Kt,"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),qt.r(t,Kt,"resetZoom:newscale");var e=this.diagram;te.maxScale||(e.scale=t)}canResetZoom(t){void 0===t&&(t=this.defaultScale),qt.r(t,Kt,"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=J.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)&&qt.s(t,Y,Kt,"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{qt.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 q?this.$f(t.adornedPart,e):t instanceof X?(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 Y)&&(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 E;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 X||t instanceof Y&&i.push(t)});else for(var e=t.iterator;e.next();){var s=e.value;s instanceof X||s instanceof Y&&i.push(s)}var n=new C,a=i.length;for(let t=0;tt instanceof V&&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 V))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 V&&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))&&(Yt,qt.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 Ut),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 Ut),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 Ut),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 H),(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?U.distanceLineSegmentSquared(t.x,t.y,0,0,0,s.height)<=e||U.distanceLineSegmentSquared(t.x,t.y,0,s.height,s.width,s.height)<=e||U.distanceLineSegmentSquared(t.x,t.y,s.width,s.height,s.width,0)<=e||U.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){Yt,qt.s(t,U,y,"containsPoint:p");var e=U.a(),i=(e.c(t),this.D.Pt(e),this.actualBounds);if(!i.isReal())return U.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()||qt.n("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ri.toString()),this.ad(t,this.Ri),this.ro(!1),J.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 jt)),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===jt.Auto||t.type===jt.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===jt.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 _t&&(!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 V&&(t.font=this.font),t.currentElement=null,a=this.D,l=this instanceof jt,o=this instanceof jt&&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 jt)&&(isNaN(e.itemIndex)||(t.itemIndex=e.itemIndex.toString()),e instanceof Y)&&(t.className=qt.an(e),void 0!==e.key&&(t.key=e.key.toString()),e instanceof X)&&(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"+C.fu++,r=a.makeElement("clipPath",{id:o}),h=a.makeElement("rect",{x:t,y:e,width:i,height:s}),this instanceof jt&&(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 jt,r=this instanceof jt&&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 jt)s.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")");else if(this instanceof z){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 qt.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 A=this.diagram;null!==A&&-1===u.nc&&qt.Xh(()=>{A.redraw()},600)}}d?h.fillStyle=l:h.strokeStyle=l}}isContainedBy(t){return t instanceof jt&&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 jt?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&&qt.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=U.a()).setSpot(e,i,s,n,Z.Center),t.ys(this.qt,a.x,a.y),U.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===jt.Table?this.F0(i.getRowDefinition(this.row),i.getColumnDefinition(this.column),t):null!==i&&i.type===jt.Auto&&i.findMainElement()===this?this.Wo(2,t):1===e?null!==i?i.type===jt.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&&(Yt,qt.it(t,Vt,"Orientation"),null===this.Ut&&(this.Ut=new Xe),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){Yt,qt.t(t,"number",y,"segmentIndex"),t=Math.round(t);var e=this.segmentIndex;e!==t&&(null===this.Ut&&(this.Ut=new Xe),this.Ut.I0=t,this.u(),this.i("segmentIndex",e,t))}get segmentFraction(){return null!==this.Ut?this.Ut.O0:0}set segmentFraction(t){Yt,qt.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){Yt,qt.t(t,"number",y,"columnSpan"),t=Math.round(t);var e=this.columnSpan;e!==t&&(t<1&&qt.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){Yt,qt.r(t,y,"row"),t=Math.round(t);var e=this.ed;e!==t&&(t<0&&qt.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){Yt,qt.t(t,"number",y,"rowSpan"),t=Math.round(t);var e=this.rowSpan;e!==t&&(t<1&&qt.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&&qt.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)||(Yt,qt.s(t,Z,y,"alignmentFocus"),Yt,!t.isNoSpot()||t.isDefault()||t.isNone()&&this instanceof D||qt.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&&(Yt,null!==t&&qt.t(t,"string",y,"portId"),null===(e=this.part)||e instanceof D||qt.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 jt?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)||(Yt,qt.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&&(Yt,qt.t(t,"number",y,"toEndSegmentLength"),t<0&&qt.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&&(Yt,qt.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&&(Yt,null!==t&&qt.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&&(Yt,qt.t(t,"number",y,"toMaxLinks"),t<0&&qt.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)||(Yt,qt.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&&(Yt,qt.t(t,"number",y,"fromEndSegmentLength"),t<0&&qt.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&&(Yt,qt.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&&(Yt,null!==t&&qt.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&&(Yt,qt.t(t,"number",y,"fromMaxLinks"),t<0&&qt.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&&(qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&(Yt,null===t||(t instanceof q||t instanceof pt)||qt.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&&(Yt,t instanceof q||t instanceof pt||qt.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 jt?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()&&qt.n("Cannot add a Binding to a template that has already been copied: "+t),null===this.Ii&&(this.Ii=new E),this.Ii.add(t)}set(t){Yt;for(const e in t)!e.startsWith("_")&&-1===e.indexOf(".")||qt.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 K.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}qt.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),qt.Mt(i)||qt.n('GraphObject.make invoked object builder "'+t+'", but it did not return an Object')):s=v.go[t]),null===i&&(null!=s&&s.constructor||qt.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 K&&1{var e=2.76142374915397,i=2.761423749153969,e=new jt(jt.Auto,{isActionable:!0,enabledChanged:(t,e)=>{var i;t instanceof jt&&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 z("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 jt&&(s=e.findObject("ButtonBorder"))instanceof z&&(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 jt&&(s=e.findObject("ButtonBorder"))instanceof z&&(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 z("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:Xt.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 q?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 z("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:Xt.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 q?i.adornedPart:i)instanceof j){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 q(jt.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new U(0,2)}).add(new z("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 q(jt.Vertical,{background:"#f5f5f5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new U(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 z&&(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 z({name:"ButtonIcon",strokeWidth:2}).bindObject("geometryString","visible",t=>t?e._buttonExpandedFigure:e._buttonCollapsedFigure,void 0,n));t=e.findObject("ButtonBorder");return t instanceof z&&(t.stroke=null,t.fill="rgba(0, 0, 0, 0)"),e.click=(e,i)=>{if(i instanceof jt){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 Xt(14,14)});e.attach({"ButtonBorder.spot1":new Z(0,0,1,1),"ButtonBorder.spot2":new Z(1,1,-1,-1)});t=new z({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 jt&&(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 O(0,1,0,0)},t),e=new jt("Horizontal",{isActionable:!0,cursor:t.cursor,margin:new O(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 Ut{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=Xt.lf,this.Ar=Xt.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 Ut;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 Jt{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 _t(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(qt.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 _t{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=C.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 Jt("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"+C.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(K.img,t)),this.svg.appendChild(n),"url(#"+(a[i]=s)+")")}createRadialGradient(t,e,i,s,n,a){var r=new Jt("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});I.q(s,o)&&I.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(K.img,a,this.Je),this.dd(K.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&&qt.O(this,t),qt.r(t,m,"endRadius"),t<0&&qt.G(t,">= zero",m,"endRadius"),this.ep=t,this.Pn=null}get colorStops(){return this.An}set colorStops(t){this.f&&qt.O(this,t),Yt,qt.s(t,L,m,"colorStops"),this.An=t,this.Pn=null}get pattern(){return this.sp}set pattern(t){this.f&&qt.O(this,t),this.sp=t,this.Pn=null}static randomColor(t,e){void 0===t&&(t=128),(Yt,qt.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:qt.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&&(Yt,qt.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?(Yt,m.isValidColor(t)||qt.n('Color "'+t+'" is not a valid color string for '+e)):t instanceof m||qt.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=K.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 jt}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-A,0)),m.Zi=m.Zi+p,m.actual=m.at+p,g=Math.max(g-(p+(b?A:0)),0)),1!==w.columnSpan||0!==v&&4!==v||(x=(m=r.getColumnDefinition(e)).computeEffectiveSpacing(),b=0===m.at,(p=Math.max(y-m.actual,0))+(b?x:0)>c&&(p=Math.max(c-x,0)),m.Zi=m.Zi+p,m.actual=m.at+p,c=Math.max(c-(p+(b?x:0)),0)),(st||nt)&&w.oc())}}}qt.ot(q);let P=0,S=0;e=r.columnCount;for(let t=0;t=r.rowCount);t++)m=r.getRowDefinition(R.row+t),p=0,p=2===v||4===v?Math.max(m.minimum,0===B[R.row+t]?m.maximum:Math.min(B[R.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(R.column+t),p=0,p=2===v||5===v?Math.max(m.minimum,0===G[R.column+t]?m.maximum:Math.min(G[R.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;C.width+=yt.width,C.height+=yt.height;var bt=R.margin,wt=bt.right+bt.left,bt=bt.top+bt.bottom,Pt=(R.wt(C.width,C.height,e,i),R.measuredBounds),wt=Math.max(Pt.width+wt,0),Pt=Math.max(Pt.height+bt,0);let s=0;for(let t=0;t=r.rowCount);t++)m=r.getRowDefinition(R.row+t),s+=m.total||0;if(s=r.rowCount);t++){var Mt=(m=r.getRowDefinition(R.row+t)).at||0,Nt=kt(R,m,St);Yt,"number"!=typeof Nt&&qt.n(R+" spanAllocation does not return a number: "+Nt),m.actual=Math.min(m.maximum,Mt+Nt),m.at!==Mt&&(e-=m.at-Mt)}}for(;0Ct&&(m.actual=Math.min(m.maximum,Ct+e),m.at!==Ct)&&(e-=m.at-Ct),0===m.index)break;m=r.getRowDefinition(m.index-1)}}let n=0;for(let t=0;t=r.columnCount);t++)m=r.getColumnDefinition(R.column+t),n+=m.total||0;if(n=r.columnCount);t++){var Tt=(m=r.getColumnDefinition(R.column+t)).at||0,Bt=Dt(R,m,Lt);Yt,"number"!=typeof Bt&&qt.n(R+" spanAllocation does not return a number: "+Bt),m.actual=Math.min(m.maximum,Tt+Bt),m.at!==Tt&&(e-=m.at-Tt)}}for(;0Gt&&(m.actual=Math.min(m.maximum,Gt+e),m.at!==Gt)&&(e-=m.at-Gt),0===m.index)break;m=r.getColumnDefinition(m.index-1)}}}}qt.ot(X),Xt.o(yt),Xt.o(C),void 0!==B&&qt.ot(B),void 0!==G&&qt.ot(G);let Rt=0,Ft=0;var Et=r.desiredSize,Ot=r.maxSize;v=r.qs(!0),P=0;let Ht=S=0,It=0;e=r.columnCount;for(let t=0;t=m.rowCount);t++){var G=m.getRowDefinition(d+t);0!==G.at&&(N.height+=G.total)}for(let t=1;t=m.columnCount);t++){var R=m.getColumnDefinition(u+t);0!==R.at&&(N.width+=R.total)}var F=L.at+N.width,E=C.at+N.height,O=c,H=g,U=F,W=E,I=c,K=g;let t=F,e=E,i=(c+F>f.width&&(t=Math.max(f.width-c,0)),g+E>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,z=L.alignment,V=C.alignment,z.isSpot()&&(s=z.x,a=z.offsetX),V.isSpot()&&(n=V.y,r=V.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 z=T.margin,V=z.left+z.right,Y=z.top+z.bottom,q=T.F0(C,L,!1),F=(!isNaN(T.desiredSize.width)||2!==q&&5!==q||(o=Math.max(F-V,0)),!isNaN(T.desiredSize.height)||2!==q&&4!==q||(l=Math.max(E-Y,0)),T.maxSize),q=T.minSize,E=(o=Math.min(F.width,o),l=Math.min(F.height,l),o=Math.max(q.width,o),l=Math.max(q.height,l),o+V),F=l+Y;O+=U*s-E*s+a+z.left,H+=W*n-F*n+r+z.top,T.visible&&(J.contains(I,K,t,e,O,H,B.width,B.height)?T.vt(O,H,o,l):T.vt(O,H,o,l,new J(I,K,t,e)))}}}Xt.o(N);for(let t=0;te.graduatedMin+N&&(k=Math.floor((a-e.graduatedMin)/N),a-=k*N);var C=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,C)&&(a>e.graduatedMax&&(a=e.graduatedMax),null===P.graduatedSkip||P instanceof V&&!P.graduatedSkip(a,P)||P instanceof z&&!P.graduatedSkip(a,P))&&b<=(x=(x=(a-e.graduatedMin)*d/e.graduatedRange)>d?d:x)&&x<=w){let e=c[s][n],t=u[s][n];for(;si&&n= 0",jt,"padding"),t=new O(t)):(qt.s(t,O,jt,"padding"),t.left<0&&qt.G(t.left,">= 0",jt,"padding:value.left"),t.right<0&&qt.G(t.right,">= 0",jt,"padding:value.right"),t.top<0&&qt.G(t.top,">= 0",jt,"padding:value.top"),t.bottom<0&&qt.G(t.bottom,">= 0",jt,"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)||(Yt,qt.s(t,Z,jt,"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:O.qg}set defaultSeparatorPadding(t){"number"==typeof t?t=new O(t):(Yt,qt.s(t,O,jt,"defaultSeparatorPadding"));var e=this.defaultSeparatorPadding;e.equals(t)||(t=t.L(),null===this.B&&(this.B=new Ae),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 Ae),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 Ae),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)||qt.Bi(i,"Array",jt,"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),U.o(n)),U.o(k),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 jt?h:null,u=H.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),H.o(u)}}}}return void 0===t&&H.o(e),a}void 0===t&&H.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 jt&&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:U.H(e.x,e.y).Ge(this.D),h=o?i:U.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 jt?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)}}}U.o(c),U.o(g)}return a?d:t}}return!1}F2(t){let e=null;return e=null===(e=t instanceof z&&((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 z&&((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 qt.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 jt&&!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 Ae),this.B.Ze}get rowCount(){return null===this.B?0:this.Ze.length}getRowDefinition(t){Yt,qt.r(t,jt,"getRowDefinition:idx"),t<0&&qt.G(t,">= 0",jt,"getRowDefinition:idx"),t=Math.round(t);var e,i=this.Ze;return void 0===i[t]&&((e=new be).Pa(this),e.isRow=!0,i[e.index=t]=e,this.raiseChangedEvent(3,"rowdefs",this,null,e,null,t)),i[t]}removeRowDefinition(e){if(Yt,qt.r(e,jt,"removeRowDefinition:idx"),e<0&&qt.G(e,">= 0",jt,"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 be?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 Ae),this.B.$e}get columnCount(){return null===this.B?0:this.$e.length}getColumnDefinition(t){Yt,qt.r(t,jt,"getColumnDefinition:idx"),t<0&&qt.G(t,">= 0",jt,"getColumnDefinition:idx"),t=Math.round(t);var e,i=this.$e;return void 0===i[t]&&((e=new be).Pa(this),e.isRow=!1,i[e.index=t]=e,this.raiseChangedEvent(3,"coldefs",this,null,e,null,t)),i[t]}removeColumnDefinition(e){if(Yt,qt.r(e,jt,"removeColumnDefinition:idx"),e<0&&qt.G(e,">= 0",jt,"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 be?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 be(e)),this}addColumnDefinition(t,e){t=this.getColumnDefinition(t);return t&&t.J1(new be(e)),this}get rowSizing(){return null!==this.B?this.B.wp:3}set rowSizing(t){var e=this.rowSizing;e!==t&&(Yt,3!==t&&2!==t&&qt.n("Panel.rowSizing must be ProportionalExtra or None, not: "+t),null===this.B&&(this.B=new Ae),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&&(Yt,3!==t&&2!==t&&qt.n("Panel.columnSizing must be ProportionalExtra or None, not: "+t),null===this.B&&(this.B=new Ae),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)&&qt.n("Panel.topIndex must be greater than zero and a real number, not: "+t),null===this.B&&(this.B=new Ae),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)&&qt.n("Panel.leftIndex must be greater than zero and a real number, not: "+t),null===this.B&&(this.B=new Ae),this.B.kp=t,this.u(),this.i("leftIndex",e,t))}findRowForLocalY(t){if(t<0||this.type!==jt.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 E),a.no.add(n)),p.add(n)}}if(e instanceof jt&&e.type===jt.Table){if(0{if(i instanceof jt&&(i.type===jt.Auto||i.type===jt.Spot||i.type===jt.Graduated)&&i.elements.count<=1&&!(i instanceof Y)){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||(qt.ft("Auto, Spot, or Graduated Panel should not have zero or one elements: "+i.toString()+" in "+e.toString()),jt.AL=!0)}}),this}static AL=!1;copyTemplate(t){void 0===t&&(t=!1);var e=this.copy();return e.gI(e=>{e instanceof jt&&(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",be,"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&&(Yt,qt.t(t,"number",be,"width"),t<0&&qt.G(t,">= 0",be,"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&&(Yt,qt.t(t,"number",be,"minimum"),(t<0||!isFinite(t))&&qt.G(t,">= 0",be,"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&&(Yt,qt.t(t,"number",be,"maximum"),t<0&&qt.G(t,">= 0",be,"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)||(Yt,qt.s(t,Z,be,"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 O(t):null!==t&&(Yt,qt.s(t,O,be,"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)||qt.Bi(i,"Array",be,"separatorDashArray:value"),null!==i){var s=i.length;let e=0;for(let t=0;tu)return d=u,void qt.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(-b/2,-w/2),0===f&&A.ph(p,v),p.translate(b/2,w/2),p.rotate(-l),p.translate(-e,-i),u-=d,h-=d,0!==f){if(++g===P.length)return void qt.ot(P);m=P[g],a=m[0],l=m[1],o=m[2],h=m[3],d=f}}qt.ot(P)}}ph(n,a){var r=n instanceof _t;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+I.Gn*d,m-u,g+d,m-I.Gn*u,g+d,m),n.bezierCurveTo(g+d,m+I.Gn*u,g+I.Gn*d,m+u,g,m+u),n.bezierCurveTo(g-I.Gn*d,m+u,g-d,m+I.Gn*u,g-d,m),n.bezierCurveTo(g-d,m-I.Gn*u,g-I.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=U.a(),r=U.a(),o=U.a(),l=H.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),H.o(l),U.o(a),U.o(r),U.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||U.distanceSquared(d,h,0,-t)>=a||U.distanceSquared(d,h,0,t)>=a||U.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&&U.distanceLineSegmentSquared(n.x,n.y,l,s,o,s)>a&&U.distanceLineSegmentSquared(n.x,n.y,o,t,l,t)>a&&U.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=qt.ct(),y=(I.Hn(i,s,p.point1X,p.point1Y,p.point2X,p.point2Y,p.endX,p.endY,.8,v),w(v,n));if(qt.ot(v),y||(i=p.endX,s=p.endY,n.distanceSquared(i,s)>a))return!1;break;case 4:v=qt.ct(),y=(I.Wg(i,s,p.point1X,p.point1Y,p.endX,p.endY,.8,v),w(v,n));if(qt.ot(v),y||(i=p.endX,s=p.endY,n.distanceSquared(i,s)>a))return!1;break;case 5:case 6:{var A=5===p.type?p.Fo(g):p.Kh(g,i,s),x=A.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 b=qt.ct();for(let t=0;ta)return!0;return!1}}CI(e,i,s,n,a,r){if(0===e.width)return I.vn(e.x,e.y,e.x,e.y+e.height,i,s,n,a,r);if(0===e.height)return I.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",z,"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?qt.G(t,'"butt", "round", or "square"',z,"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?qt.G(t,'"miter", "bevel", or "round"',z,"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&&(Yt,qt.r(t,z,"strokeMiterLimit"),1<=t?(this.Ra(),this.Rt.Np=t,this.T(),null!==(e=this.part)&&e.gc(),this.i("strokeMiterLimit",i,t)):(Yt,qt.G(t,"value >= 1",z,"strokeWidth:value")))}get strokeDashArray(){return this.jo}set strokeDashArray(i){var t=this.jo;if(t!==i){if(null===i||Array.isArray(i)||qt.Bi(i,"Array",z,"strokeDashArray:value"),null!==i){var s=i.length;let e=0;for(let t=0;ti+1e-5||n.bounds.height>s+1e-5)&&qt.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 I.qn)i!==i.toLowerCase()&&(t=I.qn[i],e.add(i,t));return e.w(),e}static defineFigureGenerator(t,e){qt.t(t,"string",z,"defineFigureGenerator:name"),"string"==typeof e?(Yt,""!==e&&I.qn[e]||qt.n("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+e)):qt.t(e,"function",z,"defineFigureGenerator:func");var i=t.toLowerCase(),s=(Yt,""!==t&&t!==i||qt.n("Shape.defineFigureGenerator name must not be empty or all-lower-case: "+t),I.qn);s[t]=e,s[i]=t}static getArrowheadGeometries(){var t,e,i=new L;for(const s in I.$g)void 0===z.co[s]&&(t=W.parse(I.$g[s],!1),z.co[s]=t,(t=s.toLowerCase())!==s)&&(z.co[t]=s);for(const n in z.co)n!==n.toLowerCase()&&(e=z.co[n])instanceof W&&i.add(n,e);return i.w(),i}static defineArrowheadGeometry(t,e){qt.t(t,"string",z,"defineArrowheadGeometry:name");let i=null;i="string"==typeof e?(qt.t(e,"string",z,"defineArrowheadGeometry:pathstr"),W.parse(e,!1)):(qt.s(e,W,z,"defineArrowheadGeometry:pathstr"),e);var e=t.toLowerCase(),s=(Yt,""!==t&&"none"!==e&&t!==e||qt.n("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t),z.co);s[t]=i,s[e]=t}static co=new l;static K2=new l;static RL(t){let e=z.co[t];if(void 0===e){var i,s=t.toLowerCase();if("none"===s)return"None";if(void 0===(e=z.co[s])){let t=null;for(const n in I.$g)if(n.toLowerCase()===s){t=n;break}if(null!==t)return i=W.parse(I.$g[t],!1),z.co[t]=i,s!==t&&(z.co[s]=t),t}}return"string"==typeof e?e:e instanceof W?t:null}}class we{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 we;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,Se=((a={})[a.Clip=0]="Clip",a[a.Ellipsis=1]="Ellipsis",a),ke=((a={})[a.Trim=0]="Trim",a[a.None=1]="None",a);class V 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!==V.ab?V.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!==V.fb?V.fb(this,r):.8*r,this.VL(s+c,n+a,s+c+o,n+a,e,i),i instanceof _t)&&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 _t&&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===V.al?8*t.length:V.al.measureText(t).width}Op(){if(null!==this.uo)return this.uo;var t=this.Ln;let e=0;return null===V.al?e=16:void 0!==V.v2[t]&&V.XL<5e3?e=V.v2[t]:(e=1.3*V.al.measureText("M").width,V.v2[t]=e,V.XL++),this.uo=e}zL(t){if(null===V.al)return 6;let e=0;return void 0!==V.hb[t]&&V.U2<5e3?e=V.hb[t]:(e=V.al.measureText(V.Dp).width,V.hb[t]=e,V.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&&qt.Gg(this.Mm),this.Mm=-1}doWaitAfter(t){}findToolHandleAt(t,e){t=this.diagram.findObjectAt(t,t=>{for(;null!==t&&!(t.panel instanceof q);)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){qt.t(t,"string",_,"name"),this.Tt=t}get isEnabled(){return this.Xi}set isEnabled(t){qt.t(t,"boolean",_,"isEnabled"),this.Xi=t}get isActive(){return this.tS}set isActive(t){qt.t(t,"boolean",_,"isActive"),this.tS=t}get transactionResult(){return this.iS}set transactionResult(t){null!==t&&qt.t(t,"string",_,"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 _{FC;RC;IC;nS;oS;rS;lS;hS;aS;fS;Nm;Gh;constructor(t){super(),this.name="ToolManager",this.FC=new E,this.RC=new E,this.IC=new E,this.nS=850,this.oS=850,this.rS=new Xt(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){qt.it(t,$,"WheelMode"),this.hS=t}get gestureBehavior(){return this.aS}set gestureBehavior(t){qt.it(t,it,"GestureMode"),this.aS=t}initializeStandardTools(){}updateAdornments(t){var e,i=this.currentToolTip;i instanceof q&&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=(Yt,i.bu&&0!==i.transactionLevel&&qt.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=U.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=J.a(),h=e.selection.iterator;h.next();){var u=h.value;u instanceof D&&this.eF(e,u,l)}J.o(l)}}}iF(t,e){var i=this.diagram,e=e.part;!i.handlesDragDropForTopLevelParts||!e.isTopLevel||e instanceof j||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 X,!0,t=>t instanceof X,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 z||(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=J.a(),a=(this._D(t,e),e.x+e.width/2),r=e.y+e.height/2,o=(J.o(e),this.Cm),l=new L,h=U.a(),u=t.iterator;u.next();){var d,c=u.value;c instanceof X&&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)))}U.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 U}static Ww=new E;static St=null;static vh=null}st.prototype.doCancel=function(){null!==d.St&&d.St.doCancel(),_.prototype.doCancel.call(this)};class nt extends _{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 X({layerName:"Tool"}).add(new K({isPanelMain:!0,stroke:"blue"}).theme("stroke","tempLink"),new K({toArrow:"Standard",fill:"blue",stroke:"blue"}).theme("fill","tempLink").theme("stroke","tempLink")).ui(),this.qh=new K("Rectangle",{portId:"",fill:null,stroke:"magenta",strokeWidth:2,desiredSize:Xt.Bk}).theme("stroke","tempPort"),this.BS=new D({selectable:!1,layerName:"Tool"}).add(this.qh).ui(),this.Wh=new K("Rectangle",{portId:"",fill:null,stroke:"magenta",strokeWidth:2,desiredSize:Xt.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){qt.t(t,"number",nt,"portGravity"),0<=t&&(this.OS=t)}get isUnconnectedLinkValid(){return this.ES}set isUnconnectedLinkValid(t){qt.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){qt.s(t,X,nt,"temporaryLink"),t.ui(),this.VS=t}get temporaryFromNode(){return this.BS}set temporaryFromNode(t){qt.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;qt.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){qt.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;qt.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&&qt.s(t,X,nt,"originalLink"),this.XS=t}get originalFromNode(){return this.YS}set originalFromNode(t){null!==t&&qt.s(t,D,nt,"originalFromNode"),this.YS=t}get originalFromPort(){return this.KS}set originalFromPort(t){null!==t&&qt.s(t,y,nt,"originalFromPort"),this.KS=t}get originalToNode(){return this.US}set originalToNode(t){null!==t&&qt.s(t,D,nt,"originalToNode"),this.US=t}get originalToPort(){return this.GS}set originalToPort(t){null!==t&&qt.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&&qt.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=Xt.a()).width=e.naturalBounds.width*r,a.height=e.naturalBounds.height*r,s.desiredSize=a,Xt.o(a),n?(s.toSpot=e.toSpot,s.toEndSegmentLength=e.toEndSegmentLength):(s.fromSpot=e.fromSpot,s.fromEndSegmentLength=e.fromEndSegmentLength),i.locationSpot=Z.Center,r=U.a(),i.location=e.getDocumentPoint(Z.Center,r),U.o(r),s.angle=e.getDocumentAngle(),null!==this.portTargeted)&&this.portTargeted(t,e,i,s,n)}setNoTargetPortProperties(t,e,i){null!==e&&(e.desiredSize=Xt.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,U.a()),d=i.x-u.x,h=i.y-u.y,U.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 C).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 C).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 C).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&&qt.t(t,"function",nt,"linkValidation"),this.Fl=t}get portTargeted(){return this.qS}set portTargeted(t){null!==t&&qt.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&&qt.t(t,"object",rt,"archetypeLinkData"),t instanceof y&&qt.s(t,X,rt,"archetypeLinkData"),this.jS=t}get archetypeLabelNodeData(){return this.JS}set archetypeLabelNodeData(t){null!==t&&qt.t(t,"object",rt,"archetypeLabelNodeData"),t instanceof y&&qt.s(t,D,rt,"archetypeLabelNodeData"),this.JS=t}get direction(){return this.C}set direction(t){qt.it(t,at,"LinkingDirection"),this.C=t}get startObject(){return this.ZS}set startObject(t){null!==t&&qt.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 X?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 K("Diamond",{desiredSize:Xt.du,fill:"lightblue",stroke:"dodgerblue",cursor:this.linkingCursor,segmentIndex:0}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.QS=new K("Diamond",{desiredSize:Xt.du,fill:"lightblue",stroke:"dodgerblue",cursor:this.linkingCursor,segmentIndex:-1}).theme("fill","adornmentFill").theme("stroke","adornmentStroke"),this.ws=null,this._S=new J,t&&Object.assign(this,t)}updateAdornments(i){if(null!==i&&i instanceof X){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 q,e=(i.type=jt.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&&qt.s(t,y,ot,"fromHandleArchetype"),this.$S=t}get toHandleArchetype(){return this.QS}set toHandleArchetype(t){null!==t&&qt.s(t,y,ot,"toHandleArchetype"),this.QS=t}get handle(){return this.ws}set handle(t){if(null!==t&&(qt.s(t,y,ot,"handle"),!(t.part instanceof q)))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 q&&i.adornedPart instanceof X))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){qt.t(t,"number",ut,"snapAngleMultiple"),this.hM=t}get snapAngleEpsilon(){return this.aM}set snapAngleEpsilon(t){qt.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){qt.t(t,"number",ut,"handleAngle"),this.cM=t}get handleDistance(){return this.uM}set handleDistance(t){qt.t(t,"number",ut,"handleDistance"),this.uM=t}}class dt extends _{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 _{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 _{Ol;dM;Sf;gM;constructor(t){super(),this.name="ClickCreating",this.Ol=null,this.dM=!0,this.Sf=!1,this.gM=new U(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 Y?n.De()&&(n.ui(),null!==(a=n.copy()))&&s.add(a):null!==n&&(e=s.model.copyNodeData(n),qt.Mt(e))&&(s.model.addNodeData(e),a=s.findPartForData(e)),null!==a&&(i=U.H(t.x,t.y),this.isGridSnapEnabled&&this.diagram.mM(a,t,i),a.location=i,s.allowSelect&&(s.clearSelection(!0),a.isSelected=!0),U.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&&qt.t(t,"object",gt,"archetypeNodeData"),this.Ol=t}get isDoubleClick(){return this.dM}set isDoubleClick(t){qt.t(t,"boolean",gt,"isDoubleClick"),this.dM=t}get isGridSnapEnabled(){return this.Sf}set isGridSnapEnabled(t){qt.t(t,"boolean",gt,"isGridSnapEnabled"),this.Sf=t}}class mt extends _{Hh;pM;El;constructor(t){super(),this.name="DragSelecting",this.Hh=175,this.pM=!1,this.El=new Y({layerName:"Tool",selectable:!1}).add(new K("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){qt.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&&qt.s(t,HTMLElement,pt,"mainElement"),this.wM=t}get show(){return this.tx}set show(t){this.tx!==t&&(null!==t&&qt.t(t,"function",pt,"show"),this.tx=t)}get hide(){return this.ix}set hide(t){this.ix!==t&&(null!==t&&qt.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 _{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 U,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=qt.hn("div"),i=qt.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;",qt.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 q&&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 q&&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 q&&!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){Yt,t instanceof q||t instanceof pt||qt.n("showContextMenu:contextMenu must be an Adornment or HTMLInfo."),null!==e&&qt.s(e,y,yt,"showContextMenu:obj");var i,s,n=this.diagram;t!==this.currentContextMenu&&this.hideContextMenu(),t instanceof q?((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=qt.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=qt.hn("li")).className="goCXli",(r=qt.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){Yt,null===t||(t instanceof q||t instanceof pt)||qt.n("ContextMenuTool.currentContextMenu must be an Adornment or HTMLInfo."),this.bM=t,this.ex=t instanceof q?t.adornedPart:null}get defaultTouchContextMenu(){return!1===yt.MM&&null===yt.Au&&z.isUsingDOM()&&this.lF(),yt.Au}set defaultTouchContextMenu(t){Yt,null===t||(t instanceof q||t instanceof pt)||qt.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&&qt.s(t,y,yt,"currentObject"),this.kM=t}get mouseDownPoint(){return this.SM}}(At={})[At.LostFocus=1]="LostFocus",At[At.MouseDown=2]="MouseDown",At[At.Tab=3]="Tab",At[At.Enter=4]="Enter";(e={})[e.SingleClick=1]="SingleClick",e[e.SingleClickSelected=2]="SingleClickSelected",e[e.DoubleClick=3]="DoubleClick";var At,bt=e,xt=((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 wt extends _{Fe;PM;NM;Vl;jt;CM;AM;LM;rx;lx;constructor(t){super(),this.name="TextEditing",this.Fe=new V,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(z.isUsingDOM()){const u=qt.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 V&&s instanceof wt)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&&qt.s(t,V,wt,"textBlock"),this.PM=t}get currentTextEditor(){return this.LM}set currentTextEditor(t){this.LM=t}get defaultTextEditor(){return this.rx}set defaultTextEditor(t){Yt,t instanceof pt||qt.n("TextEditingTool.defaultTextEditor must be an HTMLInfo."),this.rx=t}get starting(){return this.NM}set starting(t){qt.it(t,bt,"TextEditingStarting"),this.NM=t}canStart(){var t,e;return!!this.isEnabled&&!(null===(t=this.diagram)||t.isReadOnly||wt.Af&&wt.Af!==this&&(wt.Af.acceptText(2),wt.Af)&&wt.Af!==this||!t.lastInput.left||this.isBeyondDragSize()||(e=t.lastInput.documentPoint,!(null!==(e=t.findObjectAt(e))&&e instanceof V&&e.editable&&e.part.canEdit()))||null===(e=e.part)||2===this.starting&&!e.isSelected||3===this.starting&&t.lastInput.clickCount<2)}doStart(){null!==(wt.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 V&&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 J(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(){wt.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){qt.s(t,V,wt,"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&&qt.t(t,"function",wt,"textValidation"),this.Vl=t}get minimumEditorScale(){return this.CM}set minimumEditorScale(t){null!==t&&qt.t(t,"number",wt,"minimumEditorScale"),this.CM=t}get selectsTextOnActivate(){return this.AM}set selectsTextOnActivate(t){null!==t&&qt.t(t,"boolean",wt,"selectsTextOnActivate"),this.AM=t}get state(){return this.jt}set state(t){this.jt!==t&&(qt.it(t,xt,"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 St{b;Di;Xi;Lr;$n;Eo;TM;DM;Vm;Mi;Lf;xn;Bm;Jh;hx;zm;ax;Tf;Nu;Xm;constructor(t){this.b=z.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 C,this.xn=new kt,this.Bm=new kt,(this.xn.bs=this).Jh=new C,this.hx=new C,this.zm=new C,this.Xm=new C,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 X&&(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){qt.t(t,"number",St,"duration"),t<1&&qt.G(t,">= 1",St,"duration"),this.Eo=t}get isAnimating(){return this.Di}get isTicking(){return this.Vm}get isInitial(){return this.Lr}set isInitial(t){qt.t(t,"boolean",St,"isInitial"),this.Lr=t}get defaultAnimation(){return this.xn}get activeAnimations(){return this.Jh}get initialAnimationStyle(){return this.Tf}set initialAnimationStyle(t){Yt,qt.it(t,Pt,"AnimationStyle"),this.Tf=t}static gx=new L;static defineAnimationEffect(t,e){St.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=St.gx,e=(t,e,i,s,n,a)=>{t.position=new U(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 J(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=St.BM(e,i,n,a,s)}),t.add("stroke",(t,e,i,s,n,a)=>{t.stroke=St.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=St.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 kt{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=kt.EaseInOutQuad,this.Ym=kt.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=U.To,this.we=new L,this.px=new L,this.If=new C,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()&&((Yt,void 0===e&&qt.n("addTemporaryPart: Required Diagram argument missing"),t.diagram===e&&qt.n("addTemporaryPart: Part already in Diagram, did you mean to pass in a copy?"),null!==this.b)&&this.b!==e&&qt.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 z?this.b=t:t instanceof y&&null!==t.diagram&&(this.b=t.diagram)),t instanceof Y){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 z&&"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 U&&!s.isReal()&&s.c(this.eA),n&&0===e.indexOf("position:")&&t instanceof Y?r.bx.location=this.Iu(t.location):n&&(r.bx[e]=this.Iu(i))}Iu(t){return t instanceof U||t instanceof Xt?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=St.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=St.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 Y&&(l.location=c.location),h.kx&&l instanceof Y&&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 j?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 U(n.x+n.width/2,n.y+n.height/2),t.position,!1),this.add(t,"scale",.01,t.scale,!1),t instanceof j&&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 j?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 j&&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){qt.t(t,"number",kt,"duration"),t<1&&qt.G(t,">= 1",kt,"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 Nt=e;class Ct{Te;mn;Ou;Ef;constructor(t,e,i){i&&(Yt,qt.it(i,Nt,"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 Ct(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){Yt,qt.it(t,Nt,"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){C.ji(this),this.b=null,this.It=new E,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 j&&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,z.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=A.initDiagramModel(),this.C1=null,this.themeManager=new Vi,this.Xo=!0,this.gA(),this.layout=new Qe,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 Gt(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 Ht)){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 E,this.setupRouters(),this.bs=new St,this.bs.Vo(this),this.wi=17,this.WM=!1,this.ju=!1,this.Cx="default",this.Jt=new E,this.ih=new L,this.Yf="default",this.resetRenderingHints(),this.GF(),this._t=1,this.lt=new U(NaN,NaN).w(),this.fx=new U(NaN,NaN),this.v=1,this.s0=1,this.Ax=new U(NaN,NaN).w(),this.Lx=NaN,this.Tx=1e-4,this.Dx=100,this.D=new H,this.Fx=new U(NaN,NaN).w(),this.Rx=new J(NaN,NaN,NaN,NaN).w(),this.Vf=new O(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 C,this._h=new C,this.zo=!1,this.sh=new L,this.qu=!0,this.jm=250,this.zf=-1,this.Jm=new O(16,16,16,16).w(),this.Tr=!1,this.Xf=!1,this.Yu=!0,this.e0=new N,(this.e0.diagram=this).jr=new N,(this.jr.diagram=this).ia=new N,(this.ia.diagram=this).Er=null,this.to=null,this.Hw=!1,this.HF(),this.Zr=new C,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 E,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 O(5).w(),this.lP=(new C).w(),this.h1=999999999,this.hP=(new C).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 C,this.uP=new C,this._l=null,this.aP=new Xt(8,8),this.fP=999,this.eS=1,this.sS=0,this.Ui={scale:1,position:new U,bounds:new J,canvasSize:new Xt,newCanvasSize:new Xt,isScroll:!1},this.Ui.canvasSize=this.Ui.canvasSize,this.Ui.newCanvasSize=this.Ui.newCanvasSize,this.Ui.isScroll=!1,this.a1=new J(NaN,NaN,NaN,NaN).w(),this.Hu=new Xt(NaN,NaN).w(),this.Qm=new J(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 Et,this.P1=null,this.N1=null,this.k1=!1,this.Mu=!1,this.commandHandler=new zt,this.a0=null,this.f0=U.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 U,this.aA=500,this.i0=new U,this.r0=!1}static mA=void 0!==v.document;static isUsingDOM(){return z.mA}static useDOM(t){z.mA=!!t&&void 0!==v.document}static he=new WeakMap;clear(){this.animationManager.stopAnimation(),this.model.clear(),z.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 C).w(),this.hP=(new C).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 O(t/2):1.5)),this.c1=this._m,this.u1=new q(jt.Link).add(new K({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=qt.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),z.Pm()===this&&z.uA(null)):null===this.nh&&(this.eo=!1),(this.Ot=null)!==t?((e=z.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 qi)}bP(t){const a=this;if(z.isUsingDOM()){null==t&&qt.n("Diagram setup requires an argument DIV."),null!==a.Ot&&qt.n("Diagram has already completed setup."),"string"==typeof t?a.Ot=v.document.getElementById(t):t instanceof HTMLDivElement?a.Ot=t:qt.n("No DIV or DIV id supplied: "+t),null===a.Ot&&qt.n("Invalid DIV id; could not get element with id: "+t);t=z.he.get(a.Ot);if(t&&t!==this&&qt.n("Invalid div id; div already has a Diagram associated with it."),!a.Uf&&v.ResizeObserver){const s=v.ResizeObserver,n=qt.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="",z.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,z.isUsingDOM()&&(t=qt.hn("div"),i=qt.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=z.jF,t.addEventListener("pointerdown",z.JF),t.b=a,t.ZF=!0,t.$F=!0,a.g1=t,a.m1=i),a.Pu=qt.Rk(()=>{a.Tl=null,a.T()},300,!1),a.w1=qt.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 z&&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[qt.Os("7eba17a4ca3b1a8346")][qt.Os("78a118b7")](t.Y,z.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 Y)return e}else{e=this.DS(t,t=>t.part);if(e instanceof Y)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 Y&&t.canSelect():null,i)}aR(t,e,i,s){void 0===e&&(e=null),void 0===i&&(i=null),s instanceof E||s instanceof C||(s=new C),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 E||s instanceof C||(s=new C),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 Y&&(!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 E||n instanceof C||(n=new C),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 C,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 E||n instanceof C||(n=new C),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 Y&&(!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 E||n instanceof C)&&(a=n),n=!0),a instanceof E||a instanceof C||(a=new C),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 E||n instanceof C)&&(a=n),n=!0),a instanceof E||a instanceof C||(a=new C),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),qt.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=z.he.get(e);if(e)return e;let i=t.path;return(i=i||"function"!=typeof t.composedPath?i:t.composedPath())&&i[0]&&z.he.has(i[0])?z.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)&&z.he.get(s)&&(a=e,n=z.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,qt.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?(Yt,Yt.handleMessages&&qt.ft("NOT handled "+e.type+" "+t.toString()),!0):(Yt,Yt.handleMessages&&qt.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=z.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=z.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=z.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=z.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 U(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 U(e,t).Ge(this.D):new U(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=U.H(s,n),this.D.rs(t),e.documentPoint.c(t),U.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 U(NaN,NaN),e.isEnabled=i,this.Ps=!0,this);null!==t&&qt.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=J.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),J.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 j&&t.PA(!1)})}}MA(t,e){for(const i of t)!i.De()||i instanceof j||(i.tl()?(i.wt(1/0,1/0),i.vt()):e&&e.add(i));for(const s of t)if(s instanceof j){if(!s.isVisible())continue;this.L1(s)}}NP(t,e){this.MA(t,e);for(const s of t){var i;s instanceof X&&(i=s).isVisible()&&(i.tl()?(i.wt(1/0,1/0),i.vt()):e.add(i))}for(const n of t)n instanceof q&&n.isVisible()&&(n.tl()?(n.wt(1/0,1/0),n.vt()):e.add(n))}g0(t){var e=t instanceof z,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 j||n.tl()&&(n.wt(1/0,1/0),n.vt())}for(i.reset();i.next();){var a=i.value;s.has(a)&&a instanceof j&&a.isVisible()&&this.L1(a)}i.reset()}for(;i.next();){var r=i.value;r instanceof X&&s.has(r)&&r.isVisible()&&r.tl()&&(r.wt(1/0,1/0),r.vt())}}L1(t){for(var e=qt.ct(),i=qt.ct(),s=t.memberParts;s.next();){var n=s.value;n.isVisible()&&(n instanceof j?(n.Ko()||n.hs()||n.rh())&&this.L1(n):n instanceof X?(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=A.left,m=A.right),c.height>y&&(f=A.top,p=A.bottom)):(g=A.left,m=A.right,f=A.top,p=A.bottom),c.width+g+m),b=c.height+f+p,x=this.scale,I=x,w=o/xN+1&&(t=Math.max((M-N)*x+this.Ct,t)),v+a+1D+1&&(t=Math.max((c-D)*x+this.At,t)),y+r+1N+1&&(t=Math.max((M-N)*x+this.Ct,t)),v+1D+1&&(t=Math.max((c-D)*x+e,t)),y+1N+1&&(F=this.position.x*x)),this.ju)switch(this.Cx){case"negative":F=-(u.scrollWidth-F-u.clientWidth);break;case"reverse":F=u.scrollWidth-F-u.clientWidth}return u.scrollLeft=F,this.hasVerticalScrollbar&&this.allowVerticalScroll&&(y+1D+1&&(u.scrollTop=this.position.y*x)),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||(w=J.H(h,E,O,H),this.onViewportBoundsChanged(w,this.viewportBounds,I,n),J.o(w),!1)}add(e){qt.s(e,Y,z,"add:part");var i=e.diagram;if(i!==this){null!==i&&qt.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)&&qt.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 X&&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){qt.s(t,Y,z,"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),U.H(this.lt.x+t/i-t/s,this.lt.y+e/i-e/s));this.position=r,U.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=U.a(),I.vg(t.x,t.y,0,0,i.width,i.height,s),s.offset(-i.width,-i.height),n.part.location=s,U.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",z,"scrollHorizontalLineChange"),this.i1=t,this.i("scrollHorizontalLineChange",e,t))}get scrollVerticalLineChange(){return this.e1}set scrollVerticalLineChange(t){var e=this.e1;e!==t&&(qt.t(t,"number",z,"scrollVerticalLineChange"),t<0&&qt.G(t,">= 0",z,"scrollVerticalLineChange"),this.e1=t,this.i("scrollVerticalLineChange",e,t))}get lastInput(){return this.ia}set lastInput(t){Yt,qt.s(t,N,z,"lastInput"),this.ia=t}get previousInput(){return this.jr}set previousInput(t){Yt,qt.s(t,N,z,"previousInput"),this.jr=t}get firstInput(){return this.e0}set firstInput(t){Yt,qt.s(t,N,z,"firstInput"),this.e0=t}get currentCursor(){return this.Kx}set currentCursor(t){var e,i,s;""===t&&(t=this.Zm),this.Kx!==t&&(qt.t(t,"string",z,"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)&&(qt.t(t,"string",z,"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&&qt.t(t,"function",z,"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&&qt.t(t,"function",z,"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&&qt.t(t,"function",z,"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&&qt.t(t,"function",z,"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&&qt.t(t,"function",z,"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&&qt.t(t,"function",z,"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&&qt.t(t,"function",z,"mouseDragOver"),this.Ux=t,this.i("mouseDragOver",e,t))}get mouseDrop(){return this.Ur}set mouseDrop(t){var e=this.Ur;e!==t&&(Yt,null!==t&&qt.t(t,"function",z,"mouseDrop"),this.Ur=t,this.i("mouseDrop",e,t))}get handlesDragDropForTopLevelParts(){return this.Gx}set handlesDragDropForTopLevelParts(t){var e=this.Gx;e!==t&&(qt.t(t,"boolean",z,"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&&qt.t(t,"function",z,"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&&qt.t(t,"function",z,"mouseLeave"),this.Hr=t,this.i("mouseLeave",e,t))}get toolTip(){return this.vr}set toolTip(t){var e=this.vr;e!==t&&(Yt,null===t||(t instanceof q||t instanceof pt)||qt.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&&(Yt,t instanceof q||t instanceof pt||qt.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&&(qt.s(t,st,z,"toolManager"),(this.$M=t).diagram=this)}get defaultTool(){return this.QM}set defaultTool(t){var e=this.QM;e!==t&&(qt.s(t,_,z,"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)&&(qt.s(t,_,z,"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(qt.t(t,"number",z,"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",z,"maxSelectionCount")}get nodeSelectionAdornmentTemplate(){return this._m}set nodeSelectionAdornmentTemplate(t){var e=this._m;e!==t&&(qt.s(t,q,z,"nodeSelectionAdornmentTemplate"),this._m=t,this.i("nodeSelectionAdornmentTemplate",e,t))}get groupSelectionAdornmentTemplate(){return this.c1}set groupSelectionAdornmentTemplate(t){var e=this.c1;e!==t&&(qt.s(t,q,z,"groupSelectionAdornmentTemplate"),this.c1=t,this.i("groupSelectionAdornmentTemplate",e,t))}get linkSelectionAdornmentTemplate(){return this.u1}set linkSelectionAdornmentTemplate(t){var e=this.u1;e!==t&&(qt.s(t,q,z,"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&&(qt.t(t,"boolean",z,"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){qt.s(e,A,z,"model"),this.currentTool.doCancel(),i&&i.undoManager!==e.undoManager&&i.undoManager.isInTransaction&&qt.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&&(qt.s(t,Vi,A,"themeManager"),null!==e&&e.removeDiagram(this),null!==(this.C1=t))&&t.addDiagram(this)}initializePartManager(t){}static xP(t,e){z.cA.add(t,e)}static get licenseKey(){return z.IP.last()}static set licenseKey(t){z.IP.add(t.replace(/\s/g,""))}static get version(){return z.xR}static IP=new E;static xR="3.0.2";wR(t){t=z.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;qt.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 C&&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)):qt.G(t,"> 0",z,"minScale"))}get maxScale(){return this.Dx}set maxScale(t){qt.r(t,z,"maxScale");var e=this.Dx;e!==t&&(0 0",z,"maxScale"))}get zoomPoint(){return this.Fx}set zoomPoint(t){this.Fx.equals(t)||(qt.s(t,U,z,"zoomPoint"),t=t.L(),this.Fx=t)}get contentAlignment(){return this.Bf}set contentAlignment(t){var e=this.Bf;e.equals(t)||(qt.s(t,Z,z,"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)||(qt.s(t,Z,z,"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 O(t):qt.s(t,O,z,"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&&(qt.s(t,ei,z,"partManager"),null!==t.diagram&&qt.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 C,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=J.a(),e.computeBounds(t),t.unionRect(e.documentBounds),e.zA(t),J.o(t),e.qe=!0,e.maybeUpdate(),e.HA())},t)}}stopAutoScroll(){-1!==this.zf&&(qt.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=J.H(0,0,s.width*i,s.height*i),n=U.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(U.To)||(e=new U(e.x+n.x/i,e.y+n.y/i)),J.o(s),U.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 j&&(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 z.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 z.img+"data":a=s.getImageData(0,0,n.width,n.height);break;case z.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="",qt.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&&qt.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 Xt(1/0,1/0):new Xt(2e3,2e3));var o=t.position||null;let l=t.parts||null,h=(Array.isArray(l)&&(l=new E(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 O(h):h instanceof O||qt.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 Xt(t.width,t.height),this.v,this.lt,l,u,m,f),e.gi):(this.qu=!1,this.T1(p,h,new Xt(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 A=this.Jt.h,b=A.length;for(let t=0;tv?(a=v,R=y.width,y):(R=r.width,r)).height:(R=y.width*a,y.height*a):(a=v,R=y.width,y.height),null!==h?(R+=D,F+=T):h=new O(0),null!==r){let t=r.width,e=r.height;"SVG"!==i&&s&&!z.WA&&(Yt,R>t||F>e)&&(qt.ft("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(R)+"x"+Math.ceil(F)+" vs 2000x2000) Consider increasing the max size."),z.WA=!0),isNaN(t)&&(t=2e3),isNaN(e)&&(e=2e3),isFinite(t)&&(R=Math.min(R,t)),isFinite(e)&&(F=Math.min(F,e))}return t.width=Math.ceil(R),t.height=Math.ceil(F),"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 Xt(Math.ceil(R),Math.ceil(F)),a,k,l,u,m,f),e.gi):(this.qu=!1,this.T1(p,h,new Xt(Math.ceil(R),Math.ceil(F)),a,k,l,u,m,f),this.qu=!0,t.gi)}static Ju=null;static jA="5da73c80a36555d4038e4972187c3cae51fd22";static ww=!1;static Hk=()=>{if(void 0===z.jA[5]&&(H.prototype.rs=H.prototype.Pw),z.isUsingDOM()){var t=v.document.createElement("canvas"),e=t.getContext("2d"),i=qt.Os("7ca11abfd022028846"),s=(e[i]=qt.Os("398c3597c01238"),"7ca11abfd7330390"),n=[z.jA,qt.ww+"4ae6247590da4bb21c324ba3a84e385776",H.Hk+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",I.za];for(let t=1;t<5;t++)e[qt.Os(s)](qt.Os(n[t-1]),10,15*t+0);e[i]=qt.Os("39f046ebb36e4b");for(let t=1;t<5;t++)e[qt.Os(s)](qt.Os(n[t-1]),10,15*t+0);4===n.length&&"5"===n[0][0]&&"7"===n[3][0]||(H.prototype.rs=H.prototype.Pw),z.Ju=t}}}class Gt{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[qt.Os("76a715b2f73f148a")][qt.Os("72ba13b5")]||"",n=qt.Os;if(this.Ie=!0,z.isUsingDOM())if(z[n("76a115b6ed251eaf4692")])for(var a=z.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(qt[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 U(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&&qt.n("No div specified"),null===this.xt&&qt.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 C,i=t.selection.iterator;i.next();){var s=i.value;Y.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)z.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 E).addAll(i.iteratorValues),z.c0=a,z.A1=n.model.dataFormat}}n.V("ClipboardChanged",a)}pasteFromClipboard(){var s=new C,n=z.c0;if(null!==n){var a=this.diagram;if(z.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),qt.r(t,zt,"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),qt.r(t,zt,"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),qt.r(t,zt,"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),qt.r(t,zt,"resetZoom:newscale");var e=this.diagram;te.maxScale||(e.scale=t)}canResetZoom(t){void 0===t&&(t=this.defaultScale),qt.r(t,zt,"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=J.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)&&qt.s(t,Y,zt,"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{qt.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 q?this.$f(t.adornedPart,e):t instanceof X?(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 Y)&&(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 E;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 X||t instanceof Y&&i.push(t)});else for(var e=t.iterator;e.next();){var s=e.value;s instanceof X||s instanceof Y&&i.push(s)}var n=new C,a=i.length;for(let t=0;tt instanceof V&&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 V))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 V&&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))&&(Yt,qt.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 Ut),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 Ut),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 Ut),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 H),(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?U.distanceLineSegmentSquared(t.x,t.y,0,0,0,s.height)<=e||U.distanceLineSegmentSquared(t.x,t.y,0,s.height,s.width,s.height)<=e||U.distanceLineSegmentSquared(t.x,t.y,s.width,s.height,s.width,0)<=e||U.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){Yt,qt.s(t,U,y,"containsPoint:p");var e=U.a(),i=(e.c(t),this.D.Pt(e),this.actualBounds);if(!i.isReal())return U.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()||qt.n("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ri.toString()),this.ad(t,this.Ri),this.ro(!1),J.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 jt)),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===jt.Auto||t.type===jt.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===jt.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 _t&&(!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 V&&(t.font=this.font),t.currentElement=null,a=this.D,l=this instanceof jt,o=this instanceof jt&&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 jt)&&(isNaN(e.itemIndex)||(t.itemIndex=e.itemIndex.toString()),e instanceof Y)&&(t.className=qt.an(e),void 0!==e.key&&(t.key=e.key.toString()),e instanceof X)&&(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"+C.fu++,r=a.makeElement("clipPath",{id:o}),h=a.makeElement("rect",{x:t,y:e,width:i,height:s}),this instanceof jt&&(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 jt,r=this instanceof jt&&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 jt)s.setAttributeNS(null,"transform","matrix("+n.m11+", "+n.m12+", "+n.m21+", "+n.m22+", "+n.dx+", "+n.dy+")");else if(this instanceof K){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 qt.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 A=this.diagram;null!==A&&-1===u.nc&&qt.Xh(()=>{A.redraw()},600)}}d?h.fillStyle=l:h.strokeStyle=l}}isContainedBy(t){return t instanceof jt&&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 jt?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&&qt.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=U.a()).setSpot(e,i,s,n,Z.Center),t.ys(this.qt,a.x,a.y),U.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===jt.Table?this.F0(i.getRowDefinition(this.row),i.getColumnDefinition(this.column),t):null!==i&&i.type===jt.Auto&&i.findMainElement()===this?this.Wo(2,t):1===e?null!==i?i.type===jt.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&&(Yt,qt.it(t,Vt,"Orientation"),null===this.Ut&&(this.Ut=new Xe),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){Yt,qt.t(t,"number",y,"segmentIndex"),t=Math.round(t);var e=this.segmentIndex;e!==t&&(null===this.Ut&&(this.Ut=new Xe),this.Ut.I0=t,this.u(),this.i("segmentIndex",e,t))}get segmentFraction(){return null!==this.Ut?this.Ut.O0:0}set segmentFraction(t){Yt,qt.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){Yt,qt.t(t,"number",y,"columnSpan"),t=Math.round(t);var e=this.columnSpan;e!==t&&(t<1&&qt.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){Yt,qt.r(t,y,"row"),t=Math.round(t);var e=this.ed;e!==t&&(t<0&&qt.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){Yt,qt.t(t,"number",y,"rowSpan"),t=Math.round(t);var e=this.rowSpan;e!==t&&(t<1&&qt.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&&qt.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)||(Yt,qt.s(t,Z,y,"alignmentFocus"),Yt,!t.isNoSpot()||t.isDefault()||t.isNone()&&this instanceof D||qt.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&&(Yt,null!==t&&qt.t(t,"string",y,"portId"),null===(e=this.part)||e instanceof D||qt.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 jt?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)||(Yt,qt.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&&(Yt,qt.t(t,"number",y,"toEndSegmentLength"),t<0&&qt.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&&(Yt,qt.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&&(Yt,null!==t&&qt.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&&(Yt,qt.t(t,"number",y,"toMaxLinks"),t<0&&qt.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)||(Yt,qt.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&&(Yt,qt.t(t,"number",y,"fromEndSegmentLength"),t<0&&qt.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&&(Yt,qt.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&&(Yt,null!==t&&qt.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&&(Yt,qt.t(t,"number",y,"fromMaxLinks"),t<0&&qt.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&&(qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&qt.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&&(Yt,null===t||(t instanceof q||t instanceof pt)||qt.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&&(Yt,t instanceof q||t instanceof pt||qt.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 jt?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()&&qt.n("Cannot add a Binding to a template that has already been copied: "+t),null===this.Ii&&(this.Ii=new E),this.Ii.add(t)}set(t){Yt;for(const e in t)!e.startsWith("_")&&-1===e.indexOf(".")||qt.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 z.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}qt.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),qt.Mt(i)||qt.n('GraphObject.make invoked object builder "'+t+'", but it did not return an Object')):s=v.go[t]),null===i&&(null!=s&&s.constructor||qt.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 z&&1{var e=2.76142374915397,i=2.761423749153969,e=new jt(jt.Auto,{isActionable:!0,enabledChanged:(t,e)=>{var i;t instanceof jt&&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 K("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 jt&&(s=e.findObject("ButtonBorder"))instanceof K&&(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 jt&&(s=e.findObject("ButtonBorder"))instanceof K&&(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 K("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:Xt.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 q?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 K("MinusLine",{name:"ButtonIcon",stroke:"#0a0a0a",strokeWidth:2,desiredSize:Xt.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 q?i.adornedPart:i)instanceof j){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 q(jt.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new U(0,2)}).add(new K("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 q(jt.Vertical,{background:"#f5f5f5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new U(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 K&&(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 K({name:"ButtonIcon",strokeWidth:2}).bindObject("geometryString","visible",t=>t?e._buttonExpandedFigure:e._buttonCollapsedFigure,void 0,n));t=e.findObject("ButtonBorder");return t instanceof K&&(t.stroke=null,t.fill="rgba(0, 0, 0, 0)"),e.click=(e,i)=>{if(i instanceof jt){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 Xt(14,14)});e.attach({"ButtonBorder.spot1":new Z(0,0,1,1),"ButtonBorder.spot2":new Z(1,1,-1,-1)});t=new K({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 jt&&(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 O(0,1,0,0)},t),e=new jt("Horizontal",{isActionable:!0,cursor:t.cursor,margin:new O(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 Ut{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=Xt.lf,this.Ar=Xt.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 Ut;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 Jt{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 _t(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(qt.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 _t{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=C.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 Jt("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"+C.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(z.img,t)),this.svg.appendChild(n),"url(#"+(a[i]=s)+")")}createRadialGradient(t,e,i,s,n,a){var r=new Jt("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});I.q(s,o)&&I.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(z.img,a,this.Je),this.dd(z.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&&qt.O(this,t),qt.r(t,m,"endRadius"),t<0&&qt.G(t,">= zero",m,"endRadius"),this.ep=t,this.Pn=null}get colorStops(){return this.An}set colorStops(t){this.f&&qt.O(this,t),Yt,qt.s(t,L,m,"colorStops"),this.An=t,this.Pn=null}get pattern(){return this.sp}set pattern(t){this.f&&qt.O(this,t),this.sp=t,this.Pn=null}static randomColor(t,e){void 0===t&&(t=128),(Yt,qt.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:qt.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&&(Yt,qt.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?(Yt,m.isValidColor(t)||qt.n('Color "'+t+'" is not a valid color string for '+e)):t instanceof m||qt.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=z.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 jt}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-A,0)),m.Zi=m.Zi+p,m.actual=m.at+p,g=Math.max(g-(p+(x?A:0)),0)),1!==w.columnSpan||0!==v&&4!==v||(b=(m=r.getColumnDefinition(e)).computeEffectiveSpacing(),x=0===m.at,(p=Math.max(y-m.actual,0))+(x?b:0)>c&&(p=Math.max(c-b,0)),m.Zi=m.Zi+p,m.actual=m.at+p,c=Math.max(c-(p+(x?b:0)),0)),(st||nt)&&w.oc())}}}qt.ot(q);let P=0,S=0;e=r.columnCount;for(let t=0;t=r.rowCount);t++)m=r.getRowDefinition(R.row+t),p=0,p=2===v||4===v?Math.max(m.minimum,0===B[R.row+t]?m.maximum:Math.min(B[R.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(R.column+t),p=0,p=2===v||5===v?Math.max(m.minimum,0===G[R.column+t]?m.maximum:Math.min(G[R.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;C.width+=yt.width,C.height+=yt.height;var xt=R.margin,wt=xt.right+xt.left,xt=xt.top+xt.bottom,Pt=(R.wt(C.width,C.height,e,i),R.measuredBounds),wt=Math.max(Pt.width+wt,0),Pt=Math.max(Pt.height+xt,0);let s=0;for(let t=0;t=r.rowCount);t++)m=r.getRowDefinition(R.row+t),s+=m.total||0;if(s=r.rowCount);t++){var Mt=(m=r.getRowDefinition(R.row+t)).at||0,Nt=kt(R,m,St);Yt,"number"!=typeof Nt&&qt.n(R+" spanAllocation does not return a number: "+Nt),m.actual=Math.min(m.maximum,Mt+Nt),m.at!==Mt&&(e-=m.at-Mt)}}for(;0Ct&&(m.actual=Math.min(m.maximum,Ct+e),m.at!==Ct)&&(e-=m.at-Ct),0===m.index)break;m=r.getRowDefinition(m.index-1)}}let n=0;for(let t=0;t=r.columnCount);t++)m=r.getColumnDefinition(R.column+t),n+=m.total||0;if(n=r.columnCount);t++){var Tt=(m=r.getColumnDefinition(R.column+t)).at||0,Bt=Dt(R,m,Lt);Yt,"number"!=typeof Bt&&qt.n(R+" spanAllocation does not return a number: "+Bt),m.actual=Math.min(m.maximum,Tt+Bt),m.at!==Tt&&(e-=m.at-Tt)}}for(;0Gt&&(m.actual=Math.min(m.maximum,Gt+e),m.at!==Gt)&&(e-=m.at-Gt),0===m.index)break;m=r.getColumnDefinition(m.index-1)}}}}qt.ot(X),Xt.o(yt),Xt.o(C),void 0!==B&&qt.ot(B),void 0!==G&&qt.ot(G);let Rt=0,Ft=0;var Et=r.desiredSize,Ot=r.maxSize;v=r.qs(!0),P=0;let Ht=S=0,It=0;e=r.columnCount;for(let t=0;t=m.rowCount);t++){var G=m.getRowDefinition(d+t);0!==G.at&&(N.height+=G.total)}for(let t=1;t=m.columnCount);t++){var R=m.getColumnDefinition(u+t);0!==R.at&&(N.width+=R.total)}var F=L.at+N.width,E=C.at+N.height,O=c,H=g,U=F,W=E,I=c,z=g;let t=F,e=E,i=(c+F>f.width&&(t=Math.max(f.width-c,0)),g+E>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,K=L.alignment,V=C.alignment,K.isSpot()&&(s=K.x,a=K.offsetX),V.isSpot()&&(n=V.y,r=V.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 K=T.margin,V=K.left+K.right,Y=K.top+K.bottom,q=T.F0(C,L,!1),F=(!isNaN(T.desiredSize.width)||2!==q&&5!==q||(o=Math.max(F-V,0)),!isNaN(T.desiredSize.height)||2!==q&&4!==q||(l=Math.max(E-Y,0)),T.maxSize),q=T.minSize,E=(o=Math.min(F.width,o),l=Math.min(F.height,l),o=Math.max(q.width,o),l=Math.max(q.height,l),o+V),F=l+Y;O+=U*s-E*s+a+K.left,H+=W*n-F*n+r+K.top,T.visible&&(J.contains(I,z,t,e,O,H,B.width,B.height)?T.vt(O,H,o,l):T.vt(O,H,o,l,new J(I,z,t,e)))}}}Xt.o(N);for(let t=0;te.graduatedMin+N&&(k=Math.floor((a-e.graduatedMin)/N),a-=k*N);var C=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,C)&&(a>e.graduatedMax&&(a=e.graduatedMax),null===P.graduatedSkip||P instanceof V&&!P.graduatedSkip(a,P)||P instanceof K&&!P.graduatedSkip(a,P))&&x<=(b=(b=(a-e.graduatedMin)*d/e.graduatedRange)>d?d:b)&&b<=w){let e=c[s][n],t=u[s][n];for(;si&&n= 0",jt,"padding"),t=new O(t)):(qt.s(t,O,jt,"padding"),t.left<0&&qt.G(t.left,">= 0",jt,"padding:value.left"),t.right<0&&qt.G(t.right,">= 0",jt,"padding:value.right"),t.top<0&&qt.G(t.top,">= 0",jt,"padding:value.top"),t.bottom<0&&qt.G(t.bottom,">= 0",jt,"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)||(Yt,qt.s(t,Z,jt,"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:O.qg}set defaultSeparatorPadding(t){"number"==typeof t?t=new O(t):(Yt,qt.s(t,O,jt,"defaultSeparatorPadding"));var e=this.defaultSeparatorPadding;e.equals(t)||(t=t.L(),null===this.B&&(this.B=new Ae),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 Ae),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 Ae),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)||qt.Bi(i,"Array",jt,"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),U.o(n)),U.o(k),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 jt?h:null,u=H.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),H.o(u)}}}}return void 0===t&&H.o(e),a}void 0===t&&H.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 jt&&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:U.H(e.x,e.y).Ge(this.D),h=o?i:U.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 jt?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)}}}U.o(c),U.o(g)}return a?d:t}}return!1}F2(t){let e=null;return e=null===(e=t instanceof K&&((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 K&&((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 qt.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 jt&&!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 Ae),this.B.Ze}get rowCount(){return null===this.B?0:this.Ze.length}getRowDefinition(t){Yt,qt.r(t,jt,"getRowDefinition:idx"),t<0&&qt.G(t,">= 0",jt,"getRowDefinition:idx"),t=Math.round(t);var e,i=this.Ze;return void 0===i[t]&&((e=new xe).Pa(this),e.isRow=!0,i[e.index=t]=e,this.raiseChangedEvent(3,"rowdefs",this,null,e,null,t)),i[t]}removeRowDefinition(e){if(Yt,qt.r(e,jt,"removeRowDefinition:idx"),e<0&&qt.G(e,">= 0",jt,"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 xe?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 Ae),this.B.$e}get columnCount(){return null===this.B?0:this.$e.length}getColumnDefinition(t){Yt,qt.r(t,jt,"getColumnDefinition:idx"),t<0&&qt.G(t,">= 0",jt,"getColumnDefinition:idx"),t=Math.round(t);var e,i=this.$e;return void 0===i[t]&&((e=new xe).Pa(this),e.isRow=!1,i[e.index=t]=e,this.raiseChangedEvent(3,"coldefs",this,null,e,null,t)),i[t]}removeColumnDefinition(e){if(Yt,qt.r(e,jt,"removeColumnDefinition:idx"),e<0&&qt.G(e,">= 0",jt,"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 xe?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 xe(e)),this}addColumnDefinition(t,e){t=this.getColumnDefinition(t);return t&&t.J1(new xe(e)),this}get rowSizing(){return null!==this.B?this.B.wp:3}set rowSizing(t){var e=this.rowSizing;e!==t&&(Yt,3!==t&&2!==t&&qt.n("Panel.rowSizing must be ProportionalExtra or None, not: "+t),null===this.B&&(this.B=new Ae),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&&(Yt,3!==t&&2!==t&&qt.n("Panel.columnSizing must be ProportionalExtra or None, not: "+t),null===this.B&&(this.B=new Ae),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)&&qt.n("Panel.topIndex must be greater than zero and a real number, not: "+t),null===this.B&&(this.B=new Ae),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)&&qt.n("Panel.leftIndex must be greater than zero and a real number, not: "+t),null===this.B&&(this.B=new Ae),this.B.kp=t,this.u(),this.i("leftIndex",e,t))}findRowForLocalY(t){if(t<0||this.type!==jt.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 E),a.no.add(n)),p.add(n)}}if(e instanceof jt&&e.type===jt.Table){if(0{if(i instanceof jt&&(i.type===jt.Auto||i.type===jt.Spot||i.type===jt.Graduated)&&i.elements.count<=1&&!(i instanceof Y)){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||(qt.ft("Auto, Spot, or Graduated Panel should not have zero or one elements: "+i.toString()+" in "+e.toString()),jt.AL=!0)}}),this}static AL=!1;copyTemplate(t){void 0===t&&(t=!1);var e=this.copy();return e.gI(e=>{e instanceof jt&&(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",xe,"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&&(Yt,qt.t(t,"number",xe,"width"),t<0&&qt.G(t,">= 0",xe,"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&&(Yt,qt.t(t,"number",xe,"minimum"),(t<0||!isFinite(t))&&qt.G(t,">= 0",xe,"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&&(Yt,qt.t(t,"number",xe,"maximum"),t<0&&qt.G(t,">= 0",xe,"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)||(Yt,qt.s(t,Z,xe,"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 O(t):null!==t&&(Yt,qt.s(t,O,xe,"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)||qt.Bi(i,"Array",xe,"separatorDashArray:value"),null!==i){var s=i.length;let e=0;for(let t=0;tu)return d=u,void qt.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(-x/2,-w/2),0===f&&A.ph(p,v),p.translate(x/2,w/2),p.rotate(-l),p.translate(-e,-i),u-=d,h-=d,0!==f){if(++g===P.length)return void qt.ot(P);m=P[g],a=m[0],l=m[1],o=m[2],h=m[3],d=f}}qt.ot(P)}}ph(n,a){var r=n instanceof _t;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+I.Gn*d,m-u,g+d,m-I.Gn*u,g+d,m),n.bezierCurveTo(g+d,m+I.Gn*u,g+I.Gn*d,m+u,g,m+u),n.bezierCurveTo(g-I.Gn*d,m+u,g-d,m+I.Gn*u,g-d,m),n.bezierCurveTo(g-d,m-I.Gn*u,g-I.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=U.a(),r=U.a(),o=U.a(),l=H.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),H.o(l),U.o(a),U.o(r),U.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||U.distanceSquared(d,h,0,-t)>=a||U.distanceSquared(d,h,0,t)>=a||U.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&&U.distanceLineSegmentSquared(n.x,n.y,l,s,o,s)>a&&U.distanceLineSegmentSquared(n.x,n.y,o,t,l,t)>a&&U.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=qt.ct(),y=(I.Hn(i,s,p.point1X,p.point1Y,p.point2X,p.point2Y,p.endX,p.endY,.8,v),w(v,n));if(qt.ot(v),y||(i=p.endX,s=p.endY,n.distanceSquared(i,s)>a))return!1;break;case 4:v=qt.ct(),y=(I.Wg(i,s,p.point1X,p.point1Y,p.endX,p.endY,.8,v),w(v,n));if(qt.ot(v),y||(i=p.endX,s=p.endY,n.distanceSquared(i,s)>a))return!1;break;case 5:case 6:{var A=5===p.type?p.Fo(g):p.Kh(g,i,s),b=A.length;if(0===b){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 x=qt.ct();for(let t=0;ta)return!0;return!1}}CI(e,i,s,n,a,r){if(0===e.width)return I.vn(e.x,e.y,e.x,e.y+e.height,i,s,n,a,r);if(0===e.height)return I.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",K,"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?qt.G(t,'"butt", "round", or "square"',K,"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?qt.G(t,'"miter", "bevel", or "round"',K,"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&&(Yt,qt.r(t,K,"strokeMiterLimit"),1<=t?(this.Ra(),this.Rt.Np=t,this.T(),null!==(e=this.part)&&e.gc(),this.i("strokeMiterLimit",i,t)):(Yt,qt.G(t,"value >= 1",K,"strokeWidth:value")))}get strokeDashArray(){return this.jo}set strokeDashArray(i){var t=this.jo;if(t!==i){if(null===i||Array.isArray(i)||qt.Bi(i,"Array",K,"strokeDashArray:value"),null!==i){var s=i.length;let e=0;for(let t=0;ti+1e-5||n.bounds.height>s+1e-5)&&qt.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 I.qn)i!==i.toLowerCase()&&(t=I.qn[i],e.add(i,t));return e.w(),e}static defineFigureGenerator(t,e){qt.t(t,"string",K,"defineFigureGenerator:name"),"string"==typeof e?(Yt,""!==e&&I.qn[e]||qt.n("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+e)):qt.t(e,"function",K,"defineFigureGenerator:func");var i=t.toLowerCase(),s=(Yt,""!==t&&t!==i||qt.n("Shape.defineFigureGenerator name must not be empty or all-lower-case: "+t),I.qn);s[t]=e,s[i]=t}static getArrowheadGeometries(){var t,e,i=new L;for(const s in I.$g)void 0===K.co[s]&&(t=W.parse(I.$g[s],!1),K.co[s]=t,(t=s.toLowerCase())!==s)&&(K.co[t]=s);for(const n in K.co)n!==n.toLowerCase()&&(e=K.co[n])instanceof W&&i.add(n,e);return i.w(),i}static defineArrowheadGeometry(t,e){qt.t(t,"string",K,"defineArrowheadGeometry:name");let i=null;i="string"==typeof e?(qt.t(e,"string",K,"defineArrowheadGeometry:pathstr"),W.parse(e,!1)):(qt.s(e,W,K,"defineArrowheadGeometry:pathstr"),e);var e=t.toLowerCase(),s=(Yt,""!==t&&"none"!==e&&t!==e||qt.n("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+t),K.co);s[t]=i,s[e]=t}static co=new l;static K2=new l;static RL(t){let e=K.co[t];if(void 0===e){var i,s=t.toLowerCase();if("none"===s)return"None";if(void 0===(e=K.co[s])){let t=null;for(const n in I.$g)if(n.toLowerCase()===s){t=n;break}if(null!==t)return i=W.parse(I.$g[t],!1),K.co[t]=i,s!==t&&(K.co[s]=t),t}}return"string"==typeof e?e:e instanceof W?t:null}}class we{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 we;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,Se=((a={})[a.Clip=0]="Clip",a[a.Ellipsis=1]="Ellipsis",a),ke=((a={})[a.Trim=0]="Trim",a[a.None=1]="None",a);class V 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!==V.ab?V.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!==V.fb?V.fb(this,r):.8*r,this.VL(s+c,n+a,s+c+o,n+a,e,i),i instanceof _t)&&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 _t&&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===V.al?8*t.length:V.al.measureText(t).width}Op(){if(null!==this.uo)return this.uo;var t=this.Ln;let e=0;return null===V.al?e=16:void 0!==V.v2[t]&&V.XL<5e3?e=V.v2[t]:(e=1.3*V.al.measureText("M").width,V.v2[t]=e,V.XL++),this.uo=e}zL(t){if(null===V.al)return 6;let e=0;return void 0!==V.hb[t]&&V.U2<5e3?e=V.hb[t]:(e=V.al.measureText(V.Dp).width,V.hb[t]=e,V.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=Xt.a(),this.G2(i,t,s),r+=s.height,Xt.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&&qt.t(t,"function",V,"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&&qt.t(t,"function",V,"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&&(Yt,qt.t(t,"number",V,"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&&(Yt,qt.t(t,"number",V,"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&&(qt.it(t,ke,"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&&(Yt,qt.t(t,"number",V,"maxLines"),(t=Math.floor(t))<=0&&qt.G(t,"> 0",V,"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&&(Yt,null===t||Array.isArray(t)||qt.Bi(t,"Array",V,"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=K.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 Ne{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 Ne;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 Ce=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=J.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 Ce?this.imageStretch=t:super.ci(t)}toString(){return"Picture("+this.source+")#"+C.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=""),qt.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||qt.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 C),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){Yt,this.Oa&&qt.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),qt.t(i,"string",Le,"source"),this.St=i;let e=Le.Up;if(K.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 A=Le.zI;if(!u){if(h.Sn&&void 0!==p&&4{var s="r"+e+","+i;let n=I.yr[s];return void 0===n&&((n=new W(2)).endX=e,n.endY=i,I.wr{var s="s"+e+","+i;let n=I.yr[s];return void 0===n&&((n=new W(2)).endX=e,n.endY=i,n.defaultStretch=6,I.wr{var a="rr"+e+","+i+","+(s=isNaN(s)||s<0?5:s)+","+(n=isNaN(n)?15:n),r=I.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 k(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))*I.Gn,h.add(new w(2,e-o,0)).add(new w(3,e,o,e-l,0,e,l)),u.offsetY=l,d.offsetX=-l):h.add(new w(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))*I.Gn,h.add(new w(2,e,i-o)).add(new w(3,e-o,i,e,i-l,e-l,i)),d.offsetX=-l,d.offsetY=-l):h.add(new w(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))*I.Gn,h.add(new w(2,o,i)).add(new w(3,0,i-o,l,i,0,i-l)),u.offsetX=l,d.offsetY=-l):h.add(new w(2,0,i)),1==(1&n)?(s=t*I.Gn,h.add(new w(2,0,t)).add(new w(3,t,0,0,s,s,0).close()),u.offsetX=s,u.offsetY=s):h.add(new w(2,0,0).close()),r.spot1=u,r.spot2=d,I.wr{var s=t?t.parameter1:NaN,t=t?t.parameter2:NaN;return Xi(0,e,i,s,t)}),Ge("Border","RoundedRectangle"),Ge("RoundedTopRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Xi(0,e,i,t,3)}),Ge("RoundedBottomRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Xi(0,e,i,t,12)}),Ge("RoundedLeftRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Xi(0,e,i,t,9)}),Ge("RoundedRightRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Xi(0,e,i,t,6)}),Ge("Ellipse",(t,e,i)=>{var s="e"+e+","+i;let n=I.yr[s];return void 0===n&&((n=new W(3)).endX=e,n.endY=i,n.spot1=Z.Kk,n.spot2=Z.Uk,I.wr{var s="c"+e+","+i;let n=I.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,I.wr(new W).add(new k(0,0).add(new w(2,e,.5*i)).add(new w(2,0,i).close())).setSpots(0,.25,.5,.75)),Ge("TriangleDown",(t,e,i)=>(new W).add(new k(0,0).add(new w(2,e,0)).add(new w(2,.5*e,i).close())).setSpots(.25,0,.75,.5)),Ge("TriangleLeft",(t,e,i)=>(new W).add(new k(e,i).add(new w(2,0,.5*i)).add(new w(2,e,0).close())).setSpots(.5,.25,1,.75)),Ge("TriangleUp",(t,e,i)=>(new W).add(new k(e,i).add(new w(2,0,i)).add(new w(2,.5*e,0).close())).setSpots(.25,.5,.75,1)),Ge("Triangle","TriangleUp"),Ge("Diamond",(t,e,i)=>(new W).add(new k(.5*e,0).add(new w(2,0,.5*i)).add(new w(2,.5*e,i)).add(new w(2,e,.5*i).close())).setSpots(.25,.25,.75,.75)),Ge("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}),Ge("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}),Ge("None","Rectangle"),Ge("BarH","Rectangle"),Ge("BarV","Rectangle"),Ge("MinusLine","LineH"),Ge("PlusLine",(t,e,i)=>(new W).add(new k(0,i/2,!1).add(new w(2,e,i/2)).add(new w(1,e/2,0)).add(new w(2,e/2,i)))),Ge("XLine",(t,e,i)=>(new W).add(new k(0,i,!1).add(new w(2,e,0)).add(new w(1,0,0)).add(new w(2,e,i)))),Ge("LineRight",(t,e,i)=>(new W).add(new k(.25*e,0,!1).add(new w(2,.75*e,.5*i)).add(new w(2,.25*e,i)))),Ge("LineDown",(t,e,i)=>(new W).add(new k(0,.25*i,!1).add(new w(2,.5*e,.75*i)).add(new w(2,e,.25*i)))),Ge("LineLeft",(t,e,i)=>(new W).add(new k(.75*e,0,!1).add(new w(2,.25*e,.5*i)).add(new w(2,.75*e,i)))),Ge("LineUp",(t,e,i)=>(new W).add(new k(0,.75*i,!1).add(new w(2,.5*e,.25*i)).add(new w(2,e,.75*i)))),Ge("Capsule",(t,e,i)=>{var s,n=new W;return enew k(t,e,!1,!1)),Qi=(t,e,i)=>t.add(new w(2,e,i)),Ui=(t,e,i)=>t.add(new w(1,e,i));Ge("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=ji(e,0),Qi(n,e,i),Ui(n,0,i),Qi(n,0,0)):5===s?(n=ji(0,0),Qi(n,e,0),Ui(n,e,i),Qi(n,0,i)):1===s?(n=ji(0,0),Qi(n,e,0),Ui(n,e,i)):2===s?(n=ji(e,0),Qi(n,e,i)):4===s?(n=ji(e,i),Qi(n,0,i)):8===s?(n=ji(0,i),Qi(n,0,0),Ui(n,e,i)):3===s?(n=ji(0,0),Qi(n,e,0),Qi(n,e,i)):6===s?(n=ji(e,0),Qi(n,e,i),Qi(n,0,i)):12===s?(n=ji(e,i),Qi(n,0,i),Qi(n,0,0)):9===s?(n=ji(0,i),Qi(n,0,0),Qi(n,e,0)):7===s?(n=ji(0,0),Qi(n,e,0),Qi(n,e,i),Qi(n,0,i)):14===s?(n=ji(e,0),Qi(n,e,i),Qi(n,0,i),Qi(n,0,0)):13===s?(n=ji(e,i),Qi(n,0,i),Qi(n,0,0),Qi(n,e,0)):11===s?(n=ji(0,i),Qi(n,0,0),Qi(n,e,0),Qi(n,e,i)):15===s?(n=ji(0,0),Qi(n,e,0),Qi(n,e,i),Qi(n,0,i),n.add(new w(2,0,0).close())):(n=ji(0,0),Ui(n,e,i)),t.add(n),t})}I.$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 Y extends jt{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 U(NaN,NaN).w(),this.er=null,this.Od=NaN,this.vM=-1,this.UL=new J,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=qt.an(this.constructor)+"#"+C.ps(this);return null!==this.data&&(t+="("+qt.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 Re: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 jt?n.il(t=>{o.partManager.LP(t,o)}):n instanceof Le&&o.OP(n):4===t&&"elements"===e&&(n instanceof jt?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){Yt,qt.t(t,"string",Y,"findAdornment:category");var e=this.tr;return null===e?null:e.getValue(t)}addAdornment(i,s){if(null!==s){Yt,qt.t(i,"string",Y,"addAdornment:category"),qt.s(s,q,Y,"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){Yt,qt.t(t,"string",Y,"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=qt.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){qt.t(e,"string",Y,"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&&qt.t(t,"function",Y,"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&&(qt.t(t,"number",Y,"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=J.a().c(e),e.ut(),e.x=t.x,e.y=t.y,e.w(),this.ad(i,e),J.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 H),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=U.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),U.o(r)}}get locationObject(){var t;return null===this.er&&(this instanceof q&&this.type!==jt.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:U.iC}set minLocation(t){var e=this.minLocation;e.equals(t)||(Yt,qt.s(t,U,Y,"minLocation"),t=t.L(),this.Qi(),this.E.Wp=t,this.i("minLocation",e,t))}get maxLocation(){return null!==this.E?this.E.jp:U.eC}set maxLocation(t){var e=this.maxLocation;e.equals(t)||(Yt,qt.s(t,U,Y,"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&&(Yt,qt.t(t,"string",Y,"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)||(Yt,qt.s(t,Z,Y,"locationSpot"),t.isSpot()||qt.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=U.H(t,e);this.move(t,i),U.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 U);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 J: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 z?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&&(Yt,qt.t(t,"boolean",Y,"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&&(Yt,qt.t(t,"boolean",Y,"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&&(Yt,qt.t(t,"boolean",Y,"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&&qt.t(t,"function",Y,"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&&(Yt,qt.t(t,"string",Y,"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&&(Yt,qt.s(t,q,Y,"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 X?(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&&qt.t(t,"function",Y,"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&&(Yt,qt.s(t,q,Y,"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&&(Yt,qt.t(t,"string",Y,"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:Xt.xw}set resizeCellSize(t){var e=this.resizeCellSize;e.equals(t)||(Yt,qt.s(t,Xt,Y,"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&&(Yt,qt.s(t,q,Y,"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&&(Yt,qt.t(t,"string",Y,"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)||((Yt,qt.s(t,Z,Y,"rotationSpot"),t===Z.Default)||t.isSpot()||qt.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&&(Yt,qt.t(t,"string",Y,"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){Yt,null!==e&&qt.s(e,j,Y,"containingGroup"),null===e||this!==e&&!e.isMemberOf(this)||(this===e&&qt.n("Cannot make a Group a member of itself: "+this.toString()),qt.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 j&&null!==s&&s.Zr.remove(this),null!==(this.kh=e)?e.$2(this):this instanceof j&&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 j)for(var t=new C,a=(Y.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 qt.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&&qt.t(t,"function",Y,"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 j&&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(Yt,qt.s(t,Y,Y,"findCommonContainingGroup:other"),this===t)return this.containingGroup;let e=this;for(;null!==e;){var i;e instanceof j&&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 j&&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&&(Yt,qt.t(t,"number",Y,"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 q))if(t.add(e),e instanceof D){if(i&&e instanceof j)for(var r=e.memberParts;r.next();){var o=r.value;Y.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)&&Y.ah(t,d,i,s,n,a)}if(1t instanceof je))instanceof je&&(null===this.Et?this.Et=o:(Yt,this.Et!==o&&qt.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 jt&&this.Et.isContainedBy(s))&&(this.Et=null),super.tc(t,e,i,s,n,a,r)}updateAdornments(){}Wf(){}}(Fe={})[Fe.None=0]="None",Fe[Fe.Evenly=1]="Evenly",Fe[Fe.Packed=2]="Packed";var Fe;class D extends Y{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 E,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 Ee: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 C),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&&(Yt,0!==t&&1!==t&&2!==t&&qt.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&&(Yt,qt.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:O.aC}set avoidableMargin(t){"number"==typeof t?t=new O(t):qt.s(t,O,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 C,e=new C;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;Yt,qt.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),Yt,null!==e&&qt.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),Yt,null!==e&&qt.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),Yt,null!==t&&qt.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 C).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 C).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),Yt,null!==t&&qt.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 C).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),Yt,null!==t&&qt.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 C).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),(Yt,qt.s(e,D,D,"findLinksBetween:othernode"),null!==i&&qt.t(i,"string",D,"findLinksBetween:pid"),null!==s)&&qt.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),(Yt,qt.s(e,D,D,"findLinksTo:othernode"),null!==i&&qt.t(i,"string",D,"findLinksTo:pid"),null!==s)&&qt.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&&qt.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&&qt.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&&qt.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?qt.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 E).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 E).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),qt.t(t,"number",D,"findTreeParts:level");var e=new C;return Y.ah(e,this,!1,t,!0),e}collapseTree(t){void 0===t&&(t=1),qt.r(t,D,"collapseTree:level"),t<1&&(t=1);var e,i=this.diagram;null===i||i.isCollapsingExpanding||(i.isCollapsingExpanding=!0,(e=new C).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),qt.r(t,D,"expandTree:level"),t<2&&(t=2);var e,i=this.diagram;null===i||i.isCollapsingExpanding||(i.isCollapsingExpanding=!0,(e=new C).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",X,"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&&(Yt,qt.t(t,"number",X,"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)||(Yt,qt.s(t,Z,X,"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&&(Yt,qt.t(t,"number",X,"toEndSegmentLength"),t<0&&qt.G(t,">= 0",X,"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&&(Yt,qt.t(t,"number",X,"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){Yt,qt.s(t,D,X,"getOtherNode:node");var e=this.fromNode;return t===e?this.toNode:e}getOtherPort(t){Yt,qt.s(t,y,X,"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);I.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),I.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 U),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 Ve).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 U),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),U.o(u),U.o(h)),l}var d,c=i.getDocumentPoint(this.Nb(s,n),U.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=U.a(),t=o.getDocumentPoint(this.Nb(d,!n),r),a&&(t=this.uN(c,t)),U.o(r)),this.getLinkPointFromPoint(e,i,c,t,n,l),U.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=U.a(),l=o.getDocumentPoint(Z.Center,e),U.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,U.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=H.a();if(u.set(i),d instanceof jt?e=d.Um(s,n,a,r,o,u):this.path===d?d instanceof z&&(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)}H.o(u)}}}}return void 0===t&&H.o(i),e||null!==this.background}void 0===t&&H.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.xze.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>ze.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>ze.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>ze.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){Yt,qt.s(t,U,X,"findClosestSegment:p");var e=t.x,i=t.y;let s=this.getPoint(0),n=this.getPoint(1),a=U.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,U.To)),m.br(P.x-a,P.y-r,S.x-a,S.y-r,t.x-a,t.y-r)}else{var k=U.a(),M=(k.c(this.getPoint(0)),U.a()),N=(M.c(k),this.computeCorner());let e=1,i=0;for(;e=s-1){if(k.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(;I.q(t.x,n.x)&&I.q(t.y,n.y);){if(s<=e)return s-1;n=this.getPoint(e++)}if(!I.q(t.x,n.x)&&!I.q(t.y,n.y))return e-1;let a=n;for(;I.q(t.x,n.x)&&I.q(n.x,a.x)&&(!i||(t.y>=n.y?n.y>=a.y:n.y<=a.y))||I.q(t.y,n.y)&&I.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(I.p(a.y,r.y)&&I.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(I.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=U.H(t,g);this.Rn(i,s,n,a,d,u),U.o(d),i.Dw(r.x+s,r.y+n,m+s,e+n),l.e(m,e)}}else if(I.p(a.x,r.x)&&I.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(I.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),U.H(d,t));this.Rn(i,s,n,a,h,u),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,A=t+r,x=h.y+o;10===this.curve?a.yu(A,x,!1,!1):a.br(s,v,A,v,A,x),s=A,n=x}}else if(I.p(l.x,h.x))if(l.yt-u))break;e--,t=Math.max(M-d,h.y)}var k=h.x-u+r,N=h.x+r,C=t+o;10===this.curve?a.yu(N,C,!1,!1):a.br(k,n,k,C,N,C),s=N,n=C}}}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=I.p(e.y,i.y),r=n.pointsCount;let o=n.getPoint(0);var l=U.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&&!I.p(o,l))return n.x=a,n.y=i,!0}else if(I.p(t,e)&&I.p(o,l)&&Math.min(a,r)o&&Math.min(i,s)t&&!I.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=ze.xo&&(e[t]=ze.gN)}}pO(t,e){return this._i(t,e)===ze.tn}isUnoccupied(n,a,r,o){if(!(n>this.Ka||n+rthis.Ua||a+othis.Ka||ethis.Ua||ithis.Ua||ethis.Ka||i=ze.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=ze.tn,g=ze.xo;for(this.Yt[u][d]=g;c===ze.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===ze.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!==ze.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]=ze.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 Ve{be;or;ds;jd;constructor(){C.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(Ve.prototype.MO)}kO(e){var t=this.or,i=this.be.portSpreading,s=U.a(),n=U.a(),a=U.a(),r=U.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(A)?(f=Math.abs(A)/u,u=Math.abs(A)):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(A)?(f=Math.abs(A)/l,l=Math.abs(A)):f=1}m=0}var b=x.Hd;if(2===i){var w=x._e.computeThickness();switch(w*=f,b.set(p),g){case 8:b.x=p.x+y/2+h/2-m-w/2;break;case 2:b.y=p.y+A/2+u/2-m-w/2;break;case 1:b.x=p.x+y/2-o/2+m+w/2;break;default:b.y=p.y+A/2-l/2+m+w/2}m+=w}else{let t=.5;1===i&&(t=(x.Jd+1)/(x.Lc+1)),b.x=p.x+y*t,b.y=p.y+A*t}}}U.o(s),U.o(n),U.o(a),U.o(r)}SO(e){for(let t=0;tt instanceof je);e instanceof je?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 X)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 je?null===this.Et?this.Et=n:this.Et!==n&&qt.n("Cannot insert a second Placeholder into the visual tree of a Group."):n instanceof jt&&(o=n.findInVisualTree(t=>t instanceof je))instanceof je&&(null===this.Et?this.Et=o:this.Et!==o&&qt.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 jt&&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!==jt.Spot&&this.isSubGraphExpanded){let t=this.resizeObject;t instanceof jt&&(t=t.findMainElement()),null===this.hi&&(this.hi=new J),t.getDocumentBounds(this.hi),t instanceof z&&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 X||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 X&&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&&(qt.t(t,"boolean",j,"computesBoundsAfterDrag"),this.z=2048^this.z,this.i("computesBoundsAfterDrag",e,t))}get computesBoundsIncludingLinks(){return 0!=(4096&this.z)}set computesBoundsIncludingLinks(t){qt.t(t,"boolean",j,"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){qt.t(t,"boolean",j,"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){qt.t(t,"boolean",j,"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){qt.t(t,"boolean",j,"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 j&&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 X)||this.computesBoundsIncludingLinks){let t=this.Et;(t=null===t?this:t).u()}}Z2(e){if(this.Zd.remove(e)){e instanceof j&&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 X)||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&&(qt.t(t,"boolean",j,"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&&qt.t(t,"function",j,"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=U.a(),h=(super.move(t,e),new C),u=this.findSubGraphParts().iterator;u.next();){var d=u.value;d instanceof X&&(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 X&&(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())}U.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 je extends y{ei;$d;constructor(t){super(),this.ei=O.qg,this.$d=new J(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,J.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 j||n instanceof q)||qt.n("Placeholder is not inside a Group or Adornment."),n instanceof j){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=U.a()).setRectSpot(a,n.locationSpot),n.location=r,U.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 z&&(t=u.strokeWidth);var d=u.getDocumentScale(),c=u.naturalBounds,g=(c.width+t)*d,c=(c.height+t)*d;l.type!==jt.Link&&(d="Selection"===l.category?Z.TopLeft:l.locationSpot,d=u.getDocumentPoint(d,U.a()),l.location=d,U.o(d)),isNaN(g)||isNaN(c)?(l=u.getDocumentPoint(Z.TopLeft,U.a()),(d=J.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),U.o(l),J.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 j&&!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=J.a(),i=this.computeMemberBounds(n),a=this.ei;return e instanceof j&&!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)),J.o(n),s&&e instanceof j&&e.computesBoundsIncludingLocation&&e.location.isReal()&&t.unionPoint(e.location),t}computeMemberBounds(n){if(this.part instanceof j){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 X&&(!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 O(t):qt.s(t,O,je,"padding");var e=this.ei;e.equals(t)||(t=t.L(),this.ei=t,this.i("padding",e,t),this.u())}}class Qe{b;da;Qd;Lr;_d;tg;zo;xl;ig;eg;ko;constructor(t){C.ji(this),this.b=null,this.da=null,this.Qd=!0,this.Lr=!0,this._d=!1,this.tg=new U(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){qt.gr(this,t)}toString(){let t=qt.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&&qt.s(t,K,Qe,"diagram"),this.b=t}get group(){return this.da}set group(t){this.da!==t&&(null!==t&&qt.s(t,j,Qe,"group"),null!==(this.da=t))&&(this.b=t.diagram)}get isOngoing(){return this.Qd}set isOngoing(t){this.Qd!==t&&(qt.t(t,"boolean",Qe,"isOngoing"),this.Qd=t)}get isInitial(){return this.Lr}set isInitial(t){qt.t(t,"boolean",Qe,"isInitial"),(this.Lr=t)||(this.eg=!0)}get isViewportSized(){return this._d}set isViewportSized(t){this._d!==t&&(qt.t(t,"boolean",Qe,"isViewportSized"),this._d=t)&&this.invalidateLayout()}get isRouting(){return this.zo}set isRouting(t){this.zo!==t&&(qt.t(t,"boolean",Qe,"isRouting"),this.zo=t)}get isRealtime(){return this.xl}set isRealtime(t){this.xl!==t&&(null!==t&&qt.t(t,"boolean",Qe,"isRealtime"),this.xl=t)}get isValidLayout(){return this.eg}set isValidLayout(t){this.eg===t||(qt.t(t,"boolean",Qe,"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&&qt.s(t,Ue,Qe,"network"),null!==(this.ko=t))&&(t.layout=this)}createNetwork(){return new Ue(this)}makeNetwork(t){var e=this.createNetwork();return t instanceof K?(e.addParts(t.nodes,!0),e.addParts(t.links,!0)):t instanceof j?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){Yt,null===t&&qt.n("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var e=new C;t instanceof K?(this.Ch(e,t.nodes,!0,this.sl,!0,!1,!0),this.Ch(e,t.parts,!0,this.sl,!0,!1,!0)):t instanceof j?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 X||(u.ensureBounds(),!this.sl(u))||(l=(h=u.measuredBounds).width,h=h.height,u.moveTo(s,n),u instanceof j&&(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 j&&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 j&&null===l.layout?this.Ch(t,l.memberParts,!1,s,n,a,r):(l.ensureBounds(),t.add(l))):a&&l instanceof X?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 J):!e&&t.margin.equalTo(0,0,0,0)?t.actualBounds:((e=e||new J).set(t.actualBounds),e.addMargin(t.margin),e)}get boundsComputation(){return this.ig}set boundsComputation(t){this.ig!==t&&(null!==t&&qt.t(t,"function",Qe,"boundsComputation"),this.ig=t,this.invalidateLayout())}collectParts(t){var e=new C;return t instanceof K?(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 j?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){qt.s(t,U,Qe,"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 Ue{le;So;In;Ay;Ly;constructor(t){C.ji(this),Yt,t||qt.n("LayoutNetwork constructor requires non-null Layout argument"),this.le=t,this.So=new C,this.In=new C,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 C,this.In=new C,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",V,"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&&(Yt,null===t||Array.isArray(t)||qt.Bi(t,"Array",V,"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=z.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 Ne{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 Ne;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 Ce=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=J.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 Ce?this.imageStretch=t:super.ci(t)}toString(){return"Picture("+this.source+")#"+C.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=""),qt.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||qt.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 C),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){Yt,this.Oa&&qt.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),qt.t(i,"string",Le,"source"),this.St=i;let e=Le.Up;if(z.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 A=Le.zI;if(!u){if(h.Sn&&void 0!==p&&4{var s="r"+e+","+i;let n=I.yr[s];return void 0===n&&((n=new W(2)).endX=e,n.endY=i,I.wr{var s="s"+e+","+i;let n=I.yr[s];return void 0===n&&((n=new W(2)).endX=e,n.endY=i,n.defaultStretch=6,I.wr{var a="rr"+e+","+i+","+(s=isNaN(s)||s<0?5:s)+","+(n=isNaN(n)?15:n),r=I.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 k(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))*I.Gn,h.add(new w(2,e-o,0)).add(new w(3,e,o,e-l,0,e,l)),u.offsetY=l,d.offsetX=-l):h.add(new w(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))*I.Gn,h.add(new w(2,e,i-o)).add(new w(3,e-o,i,e,i-l,e-l,i)),d.offsetX=-l,d.offsetY=-l):h.add(new w(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))*I.Gn,h.add(new w(2,o,i)).add(new w(3,0,i-o,l,i,0,i-l)),u.offsetX=l,d.offsetY=-l):h.add(new w(2,0,i)),1==(1&n)?(s=t*I.Gn,h.add(new w(2,0,t)).add(new w(3,t,0,0,s,s,0).close()),u.offsetX=s,u.offsetY=s):h.add(new w(2,0,0).close()),r.spot1=u,r.spot2=d,I.wr{var s=t?t.parameter1:NaN,t=t?t.parameter2:NaN;return Xi(0,e,i,s,t)}),Ge("Border","RoundedRectangle"),Ge("RoundedTopRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Xi(0,e,i,t,3)}),Ge("RoundedBottomRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Xi(0,e,i,t,12)}),Ge("RoundedLeftRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Xi(0,e,i,t,9)}),Ge("RoundedRightRectangle",(t,e,i)=>{t=t?t.parameter1:NaN;return Xi(0,e,i,t,6)}),Ge("Ellipse",(t,e,i)=>{var s="e"+e+","+i;let n=I.yr[s];return void 0===n&&((n=new W(3)).endX=e,n.endY=i,n.spot1=Z.Kk,n.spot2=Z.Uk,I.wr{var s="c"+e+","+i;let n=I.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,I.wr(new W).add(new k(0,0).add(new w(2,e,.5*i)).add(new w(2,0,i).close())).setSpots(0,.25,.5,.75)),Ge("TriangleDown",(t,e,i)=>(new W).add(new k(0,0).add(new w(2,e,0)).add(new w(2,.5*e,i).close())).setSpots(.25,0,.75,.5)),Ge("TriangleLeft",(t,e,i)=>(new W).add(new k(e,i).add(new w(2,0,.5*i)).add(new w(2,e,0).close())).setSpots(.5,.25,1,.75)),Ge("TriangleUp",(t,e,i)=>(new W).add(new k(e,i).add(new w(2,0,i)).add(new w(2,.5*e,0).close())).setSpots(.25,.5,.75,1)),Ge("Triangle","TriangleUp"),Ge("Diamond",(t,e,i)=>(new W).add(new k(.5*e,0).add(new w(2,0,.5*i)).add(new w(2,.5*e,i)).add(new w(2,e,.5*i).close())).setSpots(.25,.25,.75,.75)),Ge("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}),Ge("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}),Ge("None","Rectangle"),Ge("BarH","Rectangle"),Ge("BarV","Rectangle"),Ge("MinusLine","LineH"),Ge("PlusLine",(t,e,i)=>(new W).add(new k(0,i/2,!1).add(new w(2,e,i/2)).add(new w(1,e/2,0)).add(new w(2,e/2,i)))),Ge("XLine",(t,e,i)=>(new W).add(new k(0,i,!1).add(new w(2,e,0)).add(new w(1,0,0)).add(new w(2,e,i)))),Ge("LineRight",(t,e,i)=>(new W).add(new k(.25*e,0,!1).add(new w(2,.75*e,.5*i)).add(new w(2,.25*e,i)))),Ge("LineDown",(t,e,i)=>(new W).add(new k(0,.25*i,!1).add(new w(2,.5*e,.75*i)).add(new w(2,e,.25*i)))),Ge("LineLeft",(t,e,i)=>(new W).add(new k(.75*e,0,!1).add(new w(2,.25*e,.5*i)).add(new w(2,.75*e,i)))),Ge("LineUp",(t,e,i)=>(new W).add(new k(0,.75*i,!1).add(new w(2,.5*e,.25*i)).add(new w(2,e,.75*i)))),Ge("Capsule",(t,e,i)=>{var s,n=new W;return enew k(t,e,!1,!1)),Qi=(t,e,i)=>t.add(new w(2,e,i)),Ui=(t,e,i)=>t.add(new w(1,e,i));Ge("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=ji(e,0),Qi(n,e,i),Ui(n,0,i),Qi(n,0,0)):5===s?(n=ji(0,0),Qi(n,e,0),Ui(n,e,i),Qi(n,0,i)):1===s?(n=ji(0,0),Qi(n,e,0),Ui(n,e,i)):2===s?(n=ji(e,0),Qi(n,e,i)):4===s?(n=ji(e,i),Qi(n,0,i)):8===s?(n=ji(0,i),Qi(n,0,0),Ui(n,e,i)):3===s?(n=ji(0,0),Qi(n,e,0),Qi(n,e,i)):6===s?(n=ji(e,0),Qi(n,e,i),Qi(n,0,i)):12===s?(n=ji(e,i),Qi(n,0,i),Qi(n,0,0)):9===s?(n=ji(0,i),Qi(n,0,0),Qi(n,e,0)):7===s?(n=ji(0,0),Qi(n,e,0),Qi(n,e,i),Qi(n,0,i)):14===s?(n=ji(e,0),Qi(n,e,i),Qi(n,0,i),Qi(n,0,0)):13===s?(n=ji(e,i),Qi(n,0,i),Qi(n,0,0),Qi(n,e,0)):11===s?(n=ji(0,i),Qi(n,0,0),Qi(n,e,0),Qi(n,e,i)):15===s?(n=ji(0,0),Qi(n,e,0),Qi(n,e,i),Qi(n,0,i),n.add(new w(2,0,0).close())):(n=ji(0,0),Ui(n,e,i)),t.add(n),t})}I.$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 Y extends jt{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 U(NaN,NaN).w(),this.er=null,this.Od=NaN,this.vM=-1,this.UL=new J,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=qt.an(this.constructor)+"#"+C.ps(this);return null!==this.data&&(t+="("+qt.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 Re: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 jt?n.il(t=>{o.partManager.LP(t,o)}):n instanceof Le&&o.OP(n):4===t&&"elements"===e&&(n instanceof jt?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){Yt,qt.t(t,"string",Y,"findAdornment:category");var e=this.tr;return null===e?null:e.getValue(t)}addAdornment(i,s){if(null!==s){Yt,qt.t(i,"string",Y,"addAdornment:category"),qt.s(s,q,Y,"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){Yt,qt.t(t,"string",Y,"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=qt.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){qt.t(e,"string",Y,"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&&qt.t(t,"function",Y,"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&&(qt.t(t,"number",Y,"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=J.a().c(e),e.ut(),e.x=t.x,e.y=t.y,e.w(),this.ad(i,e),J.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 H),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=U.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),U.o(r)}}get locationObject(){var t;return null===this.er&&(this instanceof q&&this.type!==jt.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:U.iC}set minLocation(t){var e=this.minLocation;e.equals(t)||(Yt,qt.s(t,U,Y,"minLocation"),t=t.L(),this.Qi(),this.E.Wp=t,this.i("minLocation",e,t))}get maxLocation(){return null!==this.E?this.E.jp:U.eC}set maxLocation(t){var e=this.maxLocation;e.equals(t)||(Yt,qt.s(t,U,Y,"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&&(Yt,qt.t(t,"string",Y,"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)||(Yt,qt.s(t,Z,Y,"locationSpot"),t.isSpot()||qt.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=U.H(t,e);this.move(t,i),U.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 U);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 J: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 K?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&&(Yt,qt.t(t,"boolean",Y,"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&&(Yt,qt.t(t,"boolean",Y,"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&&(Yt,qt.t(t,"boolean",Y,"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&&qt.t(t,"function",Y,"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&&(Yt,qt.t(t,"string",Y,"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&&(Yt,qt.s(t,q,Y,"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 X?(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&&qt.t(t,"function",Y,"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&&(Yt,qt.s(t,q,Y,"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&&(Yt,qt.t(t,"string",Y,"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:Xt.xw}set resizeCellSize(t){var e=this.resizeCellSize;e.equals(t)||(Yt,qt.s(t,Xt,Y,"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&&(Yt,qt.s(t,q,Y,"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&&(Yt,qt.t(t,"string",Y,"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)||((Yt,qt.s(t,Z,Y,"rotationSpot"),t===Z.Default)||t.isSpot()||qt.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&&(Yt,qt.t(t,"string",Y,"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){Yt,null!==e&&qt.s(e,j,Y,"containingGroup"),null===e||this!==e&&!e.isMemberOf(this)||(this===e&&qt.n("Cannot make a Group a member of itself: "+this.toString()),qt.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 j&&null!==s&&s.Zr.remove(this),null!==(this.kh=e)?e.$2(this):this instanceof j&&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 j)for(var t=new C,a=(Y.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 qt.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&&qt.t(t,"function",Y,"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 j&&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(Yt,qt.s(t,Y,Y,"findCommonContainingGroup:other"),this===t)return this.containingGroup;let e=this;for(;null!==e;){var i;e instanceof j&&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 j&&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&&(Yt,qt.t(t,"number",Y,"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 q))if(t.add(e),e instanceof D){if(i&&e instanceof j)for(var r=e.memberParts;r.next();){var o=r.value;Y.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)&&Y.ah(t,d,i,s,n,a)}if(1t instanceof je))instanceof je&&(null===this.Et?this.Et=o:(Yt,this.Et!==o&&qt.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 jt&&this.Et.isContainedBy(s))&&(this.Et=null),super.tc(t,e,i,s,n,a,r)}updateAdornments(){}Wf(){}}(Fe={})[Fe.None=0]="None",Fe[Fe.Evenly=1]="Evenly",Fe[Fe.Packed=2]="Packed";var Fe;class D extends Y{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 E,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 Ee: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 C),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&&(Yt,0!==t&&1!==t&&2!==t&&qt.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&&(Yt,qt.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:O.aC}set avoidableMargin(t){"number"==typeof t?t=new O(t):qt.s(t,O,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 C,e=new C;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;Yt,qt.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),Yt,null!==e&&qt.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),Yt,null!==e&&qt.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),Yt,null!==t&&qt.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 C).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 C).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),Yt,null!==t&&qt.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 C).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),Yt,null!==t&&qt.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 C).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),(Yt,qt.s(e,D,D,"findLinksBetween:othernode"),null!==i&&qt.t(i,"string",D,"findLinksBetween:pid"),null!==s)&&qt.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),(Yt,qt.s(e,D,D,"findLinksTo:othernode"),null!==i&&qt.t(i,"string",D,"findLinksTo:pid"),null!==s)&&qt.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&&qt.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&&qt.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&&qt.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?qt.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 E).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 E).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),qt.t(t,"number",D,"findTreeParts:level");var e=new C;return Y.ah(e,this,!1,t,!0),e}collapseTree(t){void 0===t&&(t=1),qt.r(t,D,"collapseTree:level"),t<1&&(t=1);var e,i=this.diagram;null===i||i.isCollapsingExpanding||(i.isCollapsingExpanding=!0,(e=new C).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),qt.r(t,D,"expandTree:level"),t<2&&(t=2);var e,i=this.diagram;null===i||i.isCollapsingExpanding||(i.isCollapsingExpanding=!0,(e=new C).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",X,"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&&(Yt,qt.t(t,"number",X,"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)||(Yt,qt.s(t,Z,X,"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&&(Yt,qt.t(t,"number",X,"toEndSegmentLength"),t<0&&qt.G(t,">= 0",X,"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&&(Yt,qt.t(t,"number",X,"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){Yt,qt.s(t,D,X,"getOtherNode:node");var e=this.fromNode;return t===e?this.toNode:e}getOtherPort(t){Yt,qt.s(t,y,X,"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);I.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),I.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 U),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 Ve).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 U),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),U.o(u),U.o(h)),l}var d,c=i.getDocumentPoint(this.Nb(s,n),U.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=U.a(),t=o.getDocumentPoint(this.Nb(d,!n),r),a&&(t=this.uN(c,t)),U.o(r)),this.getLinkPointFromPoint(e,i,c,t,n,l),U.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=U.a(),l=o.getDocumentPoint(Z.Center,e),U.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,U.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=H.a();if(u.set(i),d instanceof jt?e=d.Um(s,n,a,r,o,u):this.path===d?d instanceof K&&(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)}H.o(u)}}}}return void 0===t&&H.o(i),e||null!==this.background}void 0===t&&H.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.xKe.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>Ke.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>Ke.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>Ke.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){Yt,qt.s(t,U,X,"findClosestSegment:p");var e=t.x,i=t.y;let s=this.getPoint(0),n=this.getPoint(1),a=U.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,U.To)),m.br(P.x-a,P.y-r,S.x-a,S.y-r,t.x-a,t.y-r)}else{var k=U.a(),M=(k.c(this.getPoint(0)),U.a()),N=(M.c(k),this.computeCorner());let e=1,i=0;for(;e=s-1){if(k.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(;I.q(t.x,n.x)&&I.q(t.y,n.y);){if(s<=e)return s-1;n=this.getPoint(e++)}if(!I.q(t.x,n.x)&&!I.q(t.y,n.y))return e-1;let a=n;for(;I.q(t.x,n.x)&&I.q(n.x,a.x)&&(!i||(t.y>=n.y?n.y>=a.y:n.y<=a.y))||I.q(t.y,n.y)&&I.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(I.p(a.y,r.y)&&I.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(I.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=U.H(t,g);this.Rn(i,s,n,a,d,u),U.o(d),i.Dw(r.x+s,r.y+n,m+s,e+n),l.e(m,e)}}else if(I.p(a.x,r.x)&&I.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(I.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),U.H(d,t));this.Rn(i,s,n,a,h,u),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,A=t+r,b=h.y+o;10===this.curve?a.yu(A,b,!1,!1):a.br(s,v,A,v,A,b),s=A,n=b}}else if(I.p(l.x,h.x))if(l.yt-u))break;e--,t=Math.max(M-d,h.y)}var k=h.x-u+r,N=h.x+r,C=t+o;10===this.curve?a.yu(N,C,!1,!1):a.br(k,n,k,C,N,C),s=N,n=C}}}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=I.p(e.y,i.y),r=n.pointsCount;let o=n.getPoint(0);var l=U.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&&!I.p(o,l))return n.x=a,n.y=i,!0}else if(I.p(t,e)&&I.p(o,l)&&Math.min(a,r)o&&Math.min(i,s)t&&!I.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=Ke.xo&&(e[t]=Ke.gN)}}pO(t,e){return this._i(t,e)===Ke.tn}isUnoccupied(n,a,r,o){if(!(n>this.Ka||n+rthis.Ua||a+othis.Ka||ethis.Ua||ithis.Ua||ethis.Ka||i=Ke.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=Ke.tn,g=Ke.xo;for(this.Yt[u][d]=g;c===Ke.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===Ke.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!==Ke.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]=Ke.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 Ve{be;or;ds;jd;constructor(){C.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(Ve.prototype.MO)}kO(e){var t=this.or,i=this.be.portSpreading,s=U.a(),n=U.a(),a=U.a(),r=U.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(A)?(f=Math.abs(A)/u,u=Math.abs(A)):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(A)?(f=Math.abs(A)/l,l=Math.abs(A)):f=1}m=0}var x=b.Hd;if(2===i){var w=b._e.computeThickness();switch(w*=f,x.set(p),g){case 8:x.x=p.x+y/2+h/2-m-w/2;break;case 2:x.y=p.y+A/2+u/2-m-w/2;break;case 1:x.x=p.x+y/2-o/2+m+w/2;break;default:x.y=p.y+A/2-l/2+m+w/2}m+=w}else{let t=.5;1===i&&(t=(b.Jd+1)/(b.Lc+1)),x.x=p.x+y*t,x.y=p.y+A*t}}}U.o(s),U.o(n),U.o(a),U.o(r)}SO(e){for(let t=0;tt instanceof je);e instanceof je?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 X)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 je?null===this.Et?this.Et=n:this.Et!==n&&qt.n("Cannot insert a second Placeholder into the visual tree of a Group."):n instanceof jt&&(o=n.findInVisualTree(t=>t instanceof je))instanceof je&&(null===this.Et?this.Et=o:this.Et!==o&&qt.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 jt&&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!==jt.Spot&&this.isSubGraphExpanded){let t=this.resizeObject;t instanceof jt&&(t=t.findMainElement()),null===this.hi&&(this.hi=new J),t.getDocumentBounds(this.hi),t instanceof K&&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 X||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 X&&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&&(qt.t(t,"boolean",j,"computesBoundsAfterDrag"),this.z=2048^this.z,this.i("computesBoundsAfterDrag",e,t))}get computesBoundsIncludingLinks(){return 0!=(4096&this.z)}set computesBoundsIncludingLinks(t){qt.t(t,"boolean",j,"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){qt.t(t,"boolean",j,"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){qt.t(t,"boolean",j,"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){qt.t(t,"boolean",j,"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 j&&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 X)||this.computesBoundsIncludingLinks){let t=this.Et;(t=null===t?this:t).u()}}Z2(e){if(this.Zd.remove(e)){e instanceof j&&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 X)||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&&(qt.t(t,"boolean",j,"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&&qt.t(t,"function",j,"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=U.a(),h=(super.move(t,e),new C),u=this.findSubGraphParts().iterator;u.next();){var d=u.value;d instanceof X&&(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 X&&(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())}U.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 je extends y{ei;$d;constructor(t){super(),this.ei=O.qg,this.$d=new J(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,J.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 j||n instanceof q)||qt.n("Placeholder is not inside a Group or Adornment."),n instanceof j){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=U.a()).setRectSpot(a,n.locationSpot),n.location=r,U.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 K&&(t=u.strokeWidth);var d=u.getDocumentScale(),c=u.naturalBounds,g=(c.width+t)*d,c=(c.height+t)*d;l.type!==jt.Link&&(d="Selection"===l.category?Z.TopLeft:l.locationSpot,d=u.getDocumentPoint(d,U.a()),l.location=d,U.o(d)),isNaN(g)||isNaN(c)?(l=u.getDocumentPoint(Z.TopLeft,U.a()),(d=J.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),U.o(l),J.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 j&&!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=J.a(),i=this.computeMemberBounds(n),a=this.ei;return e instanceof j&&!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)),J.o(n),s&&e instanceof j&&e.computesBoundsIncludingLocation&&e.location.isReal()&&t.unionPoint(e.location),t}computeMemberBounds(n){if(this.part instanceof j){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 X&&(!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 O(t):qt.s(t,O,je,"padding");var e=this.ei;e.equals(t)||(t=t.L(),this.ei=t,this.i("padding",e,t),this.u())}}class Qe{b;da;Qd;Lr;_d;tg;zo;xl;ig;eg;ko;constructor(t){C.ji(this),this.b=null,this.da=null,this.Qd=!0,this.Lr=!0,this._d=!1,this.tg=new U(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){qt.gr(this,t)}toString(){let t=qt.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&&qt.s(t,z,Qe,"diagram"),this.b=t}get group(){return this.da}set group(t){this.da!==t&&(null!==t&&qt.s(t,j,Qe,"group"),null!==(this.da=t))&&(this.b=t.diagram)}get isOngoing(){return this.Qd}set isOngoing(t){this.Qd!==t&&(qt.t(t,"boolean",Qe,"isOngoing"),this.Qd=t)}get isInitial(){return this.Lr}set isInitial(t){qt.t(t,"boolean",Qe,"isInitial"),(this.Lr=t)||(this.eg=!0)}get isViewportSized(){return this._d}set isViewportSized(t){this._d!==t&&(qt.t(t,"boolean",Qe,"isViewportSized"),this._d=t)&&this.invalidateLayout()}get isRouting(){return this.zo}set isRouting(t){this.zo!==t&&(qt.t(t,"boolean",Qe,"isRouting"),this.zo=t)}get isRealtime(){return this.xl}set isRealtime(t){this.xl!==t&&(null!==t&&qt.t(t,"boolean",Qe,"isRealtime"),this.xl=t)}get isValidLayout(){return this.eg}set isValidLayout(t){this.eg===t||(qt.t(t,"boolean",Qe,"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&&qt.s(t,Ue,Qe,"network"),null!==(this.ko=t))&&(t.layout=this)}createNetwork(){return new Ue(this)}makeNetwork(t){var e=this.createNetwork();return t instanceof z?(e.addParts(t.nodes,!0),e.addParts(t.links,!0)):t instanceof j?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){Yt,null===t&&qt.n("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var e=new C;t instanceof z?(this.Ch(e,t.nodes,!0,this.sl,!0,!1,!0),this.Ch(e,t.parts,!0,this.sl,!0,!1,!0)):t instanceof j?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 X||(u.ensureBounds(),!this.sl(u))||(l=(h=u.measuredBounds).width,h=h.height,u.moveTo(s,n),u instanceof j&&(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 j&&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 j&&null===l.layout?this.Ch(t,l.memberParts,!1,s,n,a,r):(l.ensureBounds(),t.add(l))):a&&l instanceof X?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 J):!e&&t.margin.equalTo(0,0,0,0)?t.actualBounds:((e=e||new J).set(t.actualBounds),e.addMargin(t.margin),e)}get boundsComputation(){return this.ig}set boundsComputation(t){this.ig!==t&&(null!==t&&qt.t(t,"function",Qe,"boundsComputation"),this.ig=t,this.invalidateLayout())}collectParts(t){var e=new C;return t instanceof z?(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 j?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){qt.s(t,U,Qe,"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 Ue{le;So;In;Ay;Ly;constructor(t){C.ji(this),Yt,t||qt.n("LayoutNetwork constructor requires non-null Layout argument"),this.le=t,this.So=new C,this.In=new C,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 C,this.In=new C,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 X&&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 j&&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 X&&(!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&&(Yt,qt.s(t,We,Ue,"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;Yt,qt.s(t,D,Ue,"addNode:node");let e=this.findVertex(t);return null===e&&((e=this.createVertex()).node=t,this.addVertex(e)),e}deleteVertex(i){if(null!==i&&(Yt,qt.s(i,We,Ue,"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&&(Yt,qt.s(t,D,Ue,"deleteNode:node"),null!==(t=this.findVertex(t)))&&this.deleteVertex(t)}findVertex(t){return null===t?null:(Yt,qt.s(t,D,Ue,"findVertex:node"),this.Ay.getValue(t))}addEdge(t){var e;null!==t&&(Yt,qt.s(t,Je,Ue,"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;Yt,qt.s(t,X,Ue,"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&&(Yt,qt.s(t,Je,Ue,"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&&(Yt,qt.s(t,X,Ue,"deleteLink:link"),null!==(t=this.findEdge(t)))&&this.deleteEdge(t)}findEdge(t){return null===t?null:(Yt,qt.s(t,X,Ue,"findEdge:link"),this.Ly.getValue(t))}linkVertexes(t,e,i){var s;return null!==t&&null!==e&&((Yt,qt.s(t,We,Ue,"linkVertexes:fromVertex"),qt.s(e,We,Ue,"linkVertexes:toVertex"),null!==i)&&qt.s(i,X,Ue,"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&&(Yt,qt.s(t,Je,Ue,"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=qt.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 E;for(i.add(t);0a-1||0n)&&(l.push(new J(0,f,n+r,v)),p=0,m=g,f+=v,v=0),v=Math.max(v,b),0);e=11===c?-A.width:0,11===(y.moveTo(m+e,f),c)?m-=x:m+=x,p++}l.push(new J(0,f,n+r,v)),J.o(h)}LO(i,s,n,a,r,o){var l=J.a();let h=Math.max(this.cellSize.width,1),e=0,u=0,d=0;var c=U.a();for(let t=0;t=e&&(s-=e),0),b=0;var w=Math.max(this.cellSize.height,1);let P=d=0,S=!0;var k=U.a();for(let e=0;en-1||0s){o.push(new J(0,S?y-d:y,s+a,P+d+r));for(let t=0;tb&&(R.width+=R.x-b,R.x=b)}J.o(l)}commitLayers(t,e){}get wrappingWidth(){return this.sg}set wrappingWidth(t){this.sg!==t&&(qt.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,qt.ft('No Group template found for category "'+e+'"'),qt.ft(" Using default group template")),n=i.OF):null===(n=i.nodeTemplateMap.getValue(e))&&null===(n=i.nodeTemplateMap.getValue(""))&&(ei.xT||(ei.xT=!0,qt.ft('No Node template found for category "'+e+'"'),qt.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,qt.ft('No Link template found for category "'+t+'"'),qt.ft(" Using default link template")),i=e.IF),i}yI(t,e,i){t instanceof X?(null!==e&&this.pT(e,t),null!==i&&this.mT(i,t)):t instanceof Y&&(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 C,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&&N.add(t.key.data,t.value.data)});var k=this.b.model;S(N,P,k)}}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 Y))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 j&&n instanceof j)for(var l=t.memberParts;l.next();){var h=l.value,h=this.Ib(h,e,i,s);h instanceof X||null!==h&&(h.containingGroup=n)}}else if(t instanceof X&&n instanceof X)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 X||(a=n.copyNodeData(s),qt.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 X||(t=a.copyNodeData(s)),qt.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,A=this.findLinkForData(y);null!==A&&(p=t.newValue,v=this.findNodeForKey(p),A.fromNode=v)}else if("linkToKey"===f){var x,b,w=t.object,P=this.findLinkForData(w);null!==P&&(x=t.newValue,b=this.findNodeForKey(x),P.toNode=b)}else if("linkFromPortId"===f){var S,k=t.object,M=this.findLinkForData(k);null!==M&&"string"==typeof(S=t.newValue)&&(M.fromPortId=S)}else if("linkToPortId"===f){var N,E=t.object,C=this.findLinkForData(E);null!==C&&"string"==typeof(N=t.newValue)&&(C.toPortId=N)}else if("nodeGroupKey"===f){var L,D,O=t.object,T=this.findPartForData(O);null!==T&&(void 0!==(L=t.newValue)&&(D=this.findNodeForKey(L))instanceof j?T.containingGroup=D:T.containingGroup=null)}else if("linkLabelKeys"===f){const B=t.object,G=this.findLinkForData(B);if(null!==G){const R=t.oldValue,F=t.newValue;Array.isArray(R)&&R.forEach(t=>{0<=F.indexOf(t)||null!==(t=this.findNodeForKey(t))&&(t.labeledLink=null)}),Array.isArray(F)&&F.forEach(t=>{t=this.findNodeForKey(t);null!==t&&(t.labeledLink=G)})}}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 C,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 X){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 q||(i=r.getGroupKeyForNodeData(e),(null===(n=a.findPartForKey(i))||n instanceof j)&&(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 j&&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 j&&(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 j)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 X&&(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 X){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){C.ji(this),void 0===t?t="":qt.t(t,"string",ai,"constructor:targetprop"),void 0===e?e=t:qt.t(e,"string",ai,"constructor:sourceprop"),void 0===i?i=null:null!==i&&qt.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 C,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 qt.t(i,"function",ai,"parseEnum:ctor"),t=>{let e=parseInt(t);return isNaN(e)&&null===(e=qt.Yh(i,t))?s:e}}ci(t){t in ni?this.mode=t:qt.gr(this,t)}static toString(t){return qt.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&&qt.O(this),qt.t(t,"number",ai,"targetId"),this.MN=t}get targetProperty(){return this.Ha}set targetProperty(t){this.f&&qt.O(this),qt.t(t,"string",ai,"targetProperty"),this.Ha=t}get sourceProperty(){return this.Lh}set sourceProperty(t){this.f&&qt.O(this),qt.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&&qt.O(this),null!==t&&qt.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&&qt.O(this),null!==t&&qt.t(t,"function",ai,"converter"),this.Fc=t}get backConverter(){return this.Ic}set backConverter(t){this.f&&qt.O(this),null!==t&&qt.t(t,"function",ai,"backConverter"),this.Ic=t}get mode(){return this.Rc}set mode(t){this.f&&qt.O(this),this.isToTheme&&2===t&&qt.n("Theme Bindings cannot be TwoWay."),qt.it(t,ni,"BindingMode"),this.Rc=t}makeTwoWay(t){return this.isToTheme&&qt.n("Theme Bindings cannot be TwoWay."),this.mode=2,t&&(qt.t(t,"function",ai,"makeTwoWay"),this.backConverter=t),this}ofObject(t){return this.f&&qt.O(this),void 0===t&&(t=""),Yt,qt.t(t,"string",ai,"ofObject:srcname"),this.sourceName=t,this}ofModel(){return this.f&&qt.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)&&qt.ft("Binding error: target property is the empty string: "+this.toString()),this.rd()&&this.PN&&""===i&&null===s&&null===this.Th&&qt.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 X&&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 j&&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 X&&(!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&&(Yt,qt.s(t,We,Ue,"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;Yt,qt.s(t,D,Ue,"addNode:node");let e=this.findVertex(t);return null===e&&((e=this.createVertex()).node=t,this.addVertex(e)),e}deleteVertex(i){if(null!==i&&(Yt,qt.s(i,We,Ue,"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&&(Yt,qt.s(t,D,Ue,"deleteNode:node"),null!==(t=this.findVertex(t)))&&this.deleteVertex(t)}findVertex(t){return null===t?null:(Yt,qt.s(t,D,Ue,"findVertex:node"),this.Ay.getValue(t))}addEdge(t){var e;null!==t&&(Yt,qt.s(t,Je,Ue,"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;Yt,qt.s(t,X,Ue,"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&&(Yt,qt.s(t,Je,Ue,"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&&(Yt,qt.s(t,X,Ue,"deleteLink:link"),null!==(t=this.findEdge(t)))&&this.deleteEdge(t)}findEdge(t){return null===t?null:(Yt,qt.s(t,X,Ue,"findEdge:link"),this.Ly.getValue(t))}linkVertexes(t,e,i){var s;return null!==t&&null!==e&&((Yt,qt.s(t,We,Ue,"linkVertexes:fromVertex"),qt.s(e,We,Ue,"linkVertexes:toVertex"),null!==i)&&qt.s(i,X,Ue,"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&&(Yt,qt.s(t,Je,Ue,"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=qt.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 E;for(i.add(t);0a-1||0n)&&(l.push(new J(0,f,n+r,v)),p=0,m=g,f+=v,v=0),v=Math.max(v,x),0);e=11===c?-A.width:0,11===(y.moveTo(m+e,f),c)?m-=b:m+=b,p++}l.push(new J(0,f,n+r,v)),J.o(h)}LO(i,s,n,a,r,o){var l=J.a();let h=Math.max(this.cellSize.width,1),e=0,u=0,d=0;var c=U.a();for(let t=0;t=e&&(s-=e),0),x=0;var w=Math.max(this.cellSize.height,1);let P=d=0,S=!0;var k=U.a();for(let e=0;en-1||0s){o.push(new J(0,S?y-d:y,s+a,P+d+r));for(let t=0;tx&&(R.width+=R.x-x,R.x=x)}J.o(l)}commitLayers(t,e){}get wrappingWidth(){return this.sg}set wrappingWidth(t){this.sg!==t&&(qt.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,qt.ft('No Group template found for category "'+e+'"'),qt.ft(" Using default group template")),n=i.OF):null===(n=i.nodeTemplateMap.getValue(e))&&null===(n=i.nodeTemplateMap.getValue(""))&&(ei.xT||(ei.xT=!0,qt.ft('No Node template found for category "'+e+'"'),qt.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,qt.ft('No Link template found for category "'+t+'"'),qt.ft(" Using default link template")),i=e.IF),i}yI(t,e,i){t instanceof X?(null!==e&&this.pT(e,t),null!==i&&this.mT(i,t)):t instanceof Y&&(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 C,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&&N.add(t.key.data,t.value.data)});var k=this.b.model;S(N,P,k)}}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 Y))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 j&&n instanceof j)for(var l=t.memberParts;l.next();){var h=l.value,h=this.Ib(h,e,i,s);h instanceof X||null!==h&&(h.containingGroup=n)}}else if(t instanceof X&&n instanceof X)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 X||(a=n.copyNodeData(s),qt.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 X||(t=a.copyNodeData(s)),qt.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,A=this.findLinkForData(y);null!==A&&(p=t.newValue,v=this.findNodeForKey(p),A.fromNode=v)}else if("linkToKey"===f){var b,x,w=t.object,P=this.findLinkForData(w);null!==P&&(b=t.newValue,x=this.findNodeForKey(b),P.toNode=x)}else if("linkFromPortId"===f){var S,k=t.object,M=this.findLinkForData(k);null!==M&&"string"==typeof(S=t.newValue)&&(M.fromPortId=S)}else if("linkToPortId"===f){var N,E=t.object,C=this.findLinkForData(E);null!==C&&"string"==typeof(N=t.newValue)&&(C.toPortId=N)}else if("nodeGroupKey"===f){var L,D,O=t.object,T=this.findPartForData(O);null!==T&&(void 0!==(L=t.newValue)&&(D=this.findNodeForKey(L))instanceof j?T.containingGroup=D:T.containingGroup=null)}else if("linkLabelKeys"===f){const B=t.object,G=this.findLinkForData(B);if(null!==G){const R=t.oldValue,F=t.newValue;Array.isArray(R)&&R.forEach(t=>{0<=F.indexOf(t)||null!==(t=this.findNodeForKey(t))&&(t.labeledLink=null)}),Array.isArray(F)&&F.forEach(t=>{t=this.findNodeForKey(t);null!==t&&(t.labeledLink=G)})}}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 C,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 X){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 q||(i=r.getGroupKeyForNodeData(e),(null===(n=a.findPartForKey(i))||n instanceof j)&&(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 j&&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 j&&(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 j)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 X&&(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 X){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){C.ji(this),void 0===t?t="":qt.t(t,"string",ai,"constructor:targetprop"),void 0===e?e=t:qt.t(e,"string",ai,"constructor:sourceprop"),void 0===i?i=null:null!==i&&qt.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 C,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 qt.t(i,"function",ai,"parseEnum:ctor"),t=>{let e=parseInt(t);return isNaN(e)&&null===(e=qt.Yh(i,t))?s:e}}ci(t){t in ni?this.mode=t:qt.gr(this,t)}static toString(t){return qt.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&&qt.O(this),qt.t(t,"number",ai,"targetId"),this.MN=t}get targetProperty(){return this.Ha}set targetProperty(t){this.f&&qt.O(this),qt.t(t,"string",ai,"targetProperty"),this.Ha=t}get sourceProperty(){return this.Lh}set sourceProperty(t){this.f&&qt.O(this),qt.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&&qt.O(this),null!==t&&qt.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&&qt.O(this),null!==t&&qt.t(t,"function",ai,"converter"),this.Fc=t}get backConverter(){return this.Ic}set backConverter(t){this.f&&qt.O(this),null!==t&&qt.t(t,"function",ai,"backConverter"),this.Ic=t}get mode(){return this.Rc}set mode(t){this.f&&qt.O(this),this.isToTheme&&2===t&&qt.n("Theme Bindings cannot be TwoWay."),qt.it(t,ni,"BindingMode"),this.Rc=t}makeTwoWay(t){return this.isToTheme&&qt.n("Theme Bindings cannot be TwoWay."),this.mode=2,t&&(qt.t(t,"function",ai,"makeTwoWay"),this.backConverter=t),this}ofObject(t){return this.f&&qt.O(this),void 0===t&&(t=""),Yt,qt.t(t,"string",ai,"ofObject:srcname"),this.sourceName=t,this}ofModel(){return this.f&&qt.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)&&qt.ft("Binding error: target property is the empty string: "+this.toString()),this.rd()&&this.PN&&""===i&&null===s&&null===this.Th&&qt.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 A||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 C;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 A||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,A.initDiagramModel=A.initDiagramModel=()=>new oi;class li extends A{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 E).addAll(e),i.addAll(s)):(3===this.arrangement&&s.reverse(),(i=new E).addAll(s),i.addAll(e))}var g=i.length;let m=u=0;for(let e=0;ea?(a=w,d=a*r,A):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){Yt,null===e&&qt.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 E;t.addAll(e.iterator);var s=new E,n=new E,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(U.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;U.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 U(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:qt.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 wi(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){Yt,qt.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=J.a(),this.Fw(this.network,i),s=this.arrangementOrigin,t=s.x-i.x,e=s.y-i.y,J.o(i));for(var i,s,n=J.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()}J.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){qt.s(t,Xt,yi,"arrangementSpacing"),this.Ts.equals(t)||(this.Ts.c(t),this.invalidateLayout())}get arrangesToOrigin(){return this.Ag}set arrangesToOrigin(t){this.Ag!==t&&(qt.t(t,"boolean",yi,"arrangesToOrigin"),this.Ag=t,this.invalidateLayout())}get setsPortSpots(){return this.zn}set setsPortSpots(t){this.zn!==t&&(qt.t(t,"boolean",yi,"setsPortSpots"),this.zn=t,this.invalidateLayout())}get comments(){return this.Ye}set comments(t){this.Ye!==t&&(qt.t(t,"boolean",yi,"comments"),this.Ye=t,this.invalidateLayout())}get maxPrelayoutIterations(){return this.Lg}set maxPrelayoutIterations(t){this.Lg!==t&&(qt.t(t,"number",yi,"maxPrelayoutIterations"),0<=t)&&(this.Lg=t,this.invalidateLayout())}get maxIterations(){return this.Tg}set maxIterations(t){this.Tg!==t&&(qt.t(t,"number",yi,"maxIterations"),0<=t)&&(this.Tg=t,this.invalidateLayout())}get epsilonDistance(){return this.Dg}set epsilonDistance(t){this.Dg!==t&&(qt.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*A+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){Yt,qt.r(t,Ci,"medianBarycenterCrossingReduction:unfixedLayer"),qt.r(e,Ci,"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;ib+1&&(t+=4*(u-b),e+=4*(u-(b+1)))}}var O=y[b].destinationEdges.iterator;if(p&&0<=v)for(;O.next();){var H=O.value;d=H.toVertex,H.valid&&d.layer!==f&&(n=this.linkStraightenWeight(H),a=H.portFromColOffset,r=H.portToColOffset,l=d.column,i+=(Math.abs(C+a-(l+r))+1)*n,s+=(Math.abs(G+a-(l+r))+1)*n)}for(O.reset();O.next();){var I=O.value;if(d=I.toVertex,I.valid&&d.layer===f){for(c=0;cb+1&&(t+=4*(u-(b+1)),e+=4*(u-b))}}var Y=y[b+1].destinationEdges.iterator;if(p&&0<=v)for(;Y.next();){var q=Y.value;d=q.toVertex,q.valid&&d.layer!==f&&(n=this.linkStraightenWeight(q),a=q.portFromColOffset,r=q.portToColOffset,l=d.column,i+=(Math.abs(L+a-(l+r))+1)*n,s+=(Math.abs(B+a-(l+r))+1)*n)}for(Y.reset();Y.next();){var X=Y.value;if(d=X.toVertex,X.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&&tb+this.nodeMinColumnSpace(m[g-1],!1)?x-1:x,0),i=(e=g+1>=f||m[g+1].column-x-1>w+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 S=P.value,k=S.fromVertex;S.valid&&k.layer!==d&&(a=this.linkStraightenWeight(S),r=S.portFromColOffset,o=S.portToColOffset,S=k.column,i+=(Math.abs(x+o-(S+r))+1)*a,s+=(Math.abs(t+o-(S+r))+1)*a,n+=(Math.abs(e+o-(S+r))+1)*a)}if(0<=c)for(var M=m[g].destinationEdges.iterator;M.next();){var N=M.value,C=N.toVertex;N.valid&&C.layer!==d&&(a=this.linkStraightenWeight(N),r=N.portFromColOffset,o=N.portToColOffset,N=C.column,i+=(Math.abs(x+r-(N+o))+1)*a,s+=(Math.abs(t+r-(N+o))+1)*a,n+=(Math.abs(e+r-(N+o))+1)*a)}let l=0,h=0,u=0;b=p[m[g].index],w=v[m[g].index];-1!==b&&(l+=Math.abs(b-x),h+=Math.abs(b-t),u+=Math.abs(b-e)),-1!==w&&(l+=Math.abs(w-x),h+=Math.abs(w-t),u+=Math.abs(w-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){Yt,qt.r(t,Ci,"packAux:column"),qt.r(e,Ci,"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=qt.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;qt.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)})}}qt.ot(n),qt.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,A.insertPointAt(s++,l,e+c),A.insertPointAt(s++,l,e),A.insertPointAt(s++,l,e-d)):(A.insertPointAt(s++,l,h+c),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h-d)):270===this.C?h<=y.bounds.y?(e=y.bounds.y,A.insertPointAt(s++,l,e-d),A.insertPointAt(s++,l,e),A.insertPointAt(s++,l,e+c)):(A.insertPointAt(s++,l,h-d),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h+c)):0===this.C&&(l>=y.bounds.right?(e=y.bounds.x+y.bounds.width,A.insertPointAt(s++,e+c,h),A.insertPointAt(s++,e,h),A.insertPointAt(s++,e-d,h)):(A.insertPointAt(s++,l+c,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l-d,h)));else{A.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),A.insertPointAt(s++,r+t,h)):((270===this.C?h>=y.bounds.bottom:h<=y.bounds.y)&&(t=(90===this.C?-d:c)/2),A.insertPointAt(s++,l,o+t)),A.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?(A.insertPointAt(s++,l-d-k,h),A.insertPointAt(s++,Math.min(l-d+k/2,l),h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,Math.max(l+c-k/2,l),h),A.insertPointAt(s++,l+c+k,h)):90===this.C?(A.insertPointAt(s++,l,h+c+k),A.insertPointAt(s++,l,Math.max(h+c-k/2,h)),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,Math.min(h-d+k/2,h)),A.insertPointAt(s++,l,h-d-k)):270===this.C?(A.insertPointAt(s++,l,h-d-k),A.insertPointAt(s++,l,Math.min(h-d+k/2,h)),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,Math.max(h+c-k/2,h)),A.insertPointAt(s++,l,h+c+k)):(A.insertPointAt(s++,l+c+k,h),A.insertPointAt(s++,Math.max(l+c-k/2,l),h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,Math.min(l-d+k/2,l),h),A.insertPointAt(s++,l-d-k,h)):(180!==this.C&&90!==this.C&&this.C,A.insertPointAt(s++,l,h));y=n}if(null===p||w!==Z.None||i)if(r=A.getPoint(s-1).x,o=A.getPoint(s-1).y,l=A.getPoint(s).x,h=A.getPoint(s).y,i){var C=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?-C:C),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?-C:C),t=t=v.bounds.x?(e=v.bounds.x+v.bounds.width,A.setPointAt(s-2,e,o),A.setPointAt(s-1,e+c,o)):90===this.C&&h<=v.bounds.bottom?(e=v.bounds.y,A.setPointAt(s-2,r,e),A.setPointAt(s-1,r,e-d)):270===this.C&&h>=v.bounds.y?(e=v.bounds.y+v.bounds.height,A.setPointAt(s-2,r,e),A.setPointAt(s-1,r,e+c)):0===this.C&&l<=v.bounds.right&&(e=v.bounds.x,A.setPointAt(s-2,e,o),A.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),A.insertPointAt(s++,l+t,o)):((270===this.C?h<=v.bounds.y:h>=v.bounds.bottom)&&(t=(90===this.C?c:-d)/2),A.insertPointAt(s++,r,h+t)),A.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=A.getPoint(s-1).x,o=A.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===A.firstPickIndex+1&&(u=0===this.C?Math.max(u,r):Math.min(u,r)),A.insertPointAt(s++,u,o),A.insertPointAt(s++,u,h)):(null!==a?a.centerX:r)!==l&&(u=this.Gt[n.layer]+this.ur.y,s===A.firstPickIndex+1&&(u=90===this.C?Math.max(u,o):Math.min(u,o)),A.insertPointAt(s++,r,u),A.insertPointAt(s++,l,u)):(d=Math.max(10,this.on[n.layer]),c=Math.max(10,this.Rs[n.layer]),t?180===this.C?(A.insertPointAt(s++,l+c+k,h),A.insertPointAt(s++,Math.max(l+c-k/2,l),h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,Math.min(l-d+k/2,l),h),A.insertPointAt(s++,l-d-k,h)):90===this.C?(A.insertPointAt(s++,l,h-d-k),A.insertPointAt(s++,l,Math.min(h-d+k/2,h)),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,Math.max(h+c-k/2,h)),A.insertPointAt(s++,l,h+c+k)):270===this.C?(A.insertPointAt(s++,l,h+c+k),A.insertPointAt(s++,l,Math.max(h+c-k/2,h)),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,Math.min(h-d+k/2,h)),A.insertPointAt(s++,l,h-d-k)):(A.insertPointAt(s++,l-d-k,h),A.insertPointAt(s++,Math.min(l-d+k/2,l),h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,Math.max(l+c-k/2,l),h),A.insertPointAt(s++,l+c+k,h)):180===this.C?(A.insertPointAt(s++,l+c,h),A.insertPointAt(s++,l-d,h)):90===this.C?(A.insertPointAt(s++,l,h-d),A.insertPointAt(s++,l,h+c)):270===this.C?(A.insertPointAt(s++,l,h+c),A.insertPointAt(s++,l,h-d)):(A.insertPointAt(s++,l-d,h),A.insertPointAt(s++,l+c,h)))),v=n}i&&(r=A.getPoint(s-1).x,o=A.getPoint(s-1).y,l=A.getPoint(s).x,h=A.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),A.insertPointAt(s++,u,o),A.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),A.insertPointAt(s++,r,u),A.insertPointAt(s++,l,u)))}null!==b&&t&&4<=A.pointsCount&&(null!==f&&(S=w===Z.None?A.getLinkPointFromPoint(g,f,f.getDocumentPoint(Z.Center),A.getPoint(3),!0):A.getPoint(0),w===Z.None&&(b=A.getPoint(2),w=A.getPoint(3),90===this.direction||270===this.direction?(A.setPointAt(1,(S.x+b.x)/2,b.y),A.setPointAt(2,w.x,(b.y+w.y)/2)):(A.setPointAt(1,b.x,(S.y+b.y)/2),A.setPointAt(2,(b.x+w.x)/2,w.y))),S.isReal()||S.set(g.actualBounds.center),A.setPointAt(0,S.x,S.y)),null!==p)&&(b=P===Z.None?A.getLinkPointFromPoint(m,p,p.getDocumentPoint(Z.Center),A.getPoint(A.pointsCount-4),!1):A.getPoint(A.pointsCount-1),P===Z.None&&(w=A.getPoint(A.pointsCount-3),P=A.getPoint(A.pointsCount-4),90===this.direction||270===this.direction?(A.setPointAt(A.pointsCount-2,(b.x+w.x)/2,w.y),A.setPointAt(A.pointsCount-2,P.x,(w.y+P.y)/2)):(A.setPointAt(A.pointsCount-2,w.x,(b.y+w.y)/2),A.setPointAt(A.pointsCount-3,(w.x+P.x)/2,P.y))),b.isReal()||b.set(m.actualBounds.center),A.setPointAt(A.pointsCount-1,b.x,b.y)),A.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 X&&null!==(e=t.fromNode)&&!e.isLinkLabel&&"Comment"!==e.category&&!(null===(e=t.toNode)||e.isLinkLabel||"Comment"===e.category)};return t instanceof K?(e.addParts(t.nodes,!0,i),e.addParts(t.links,!0,i)):t instanceof j?e.addParts(t.memberParts,!1,i):e.addParts(t.iterator,!1,i),e}doLayout(t){Yt,null===t&&qt.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 K&&(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;Yt,qt.s(t,et,tt,"isAncestor:a"),Yt,qt.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){Yt,qt.s(t,et,tt,"removeChild:p"),Yt,qt.s(s,et,tt,"removeChild:c");var n=t.children;let i=0;for(let t=0;tS&&(aS&&(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(Yt,qt.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(Yt,qt.it(t,Ri,"TreeAlignment"),t){case 20:case 21:e/=2,i/=2;break;case 22:i=e=0;break;case 23:break;default:qt.n("Unhandled alignment value "+t.toString())}return new U(e,i)}of(t,e,i,s,n,a){Yt,qt.s(t,et,tt,"shiftRelPosAlign:v"),Yt,qt.it(e,Ri,"TreeAlignment");e=this.ZN(e,i,s);this.ru(t,e.x,e.y,n,a)}ru(t,e,i,s,n){if(Yt,qt.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){Yt,qt.s(t,et,tt,"recordMidPoints:v"),qt.t(e,"number",tt,"recordMidPoints:x"),qt.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:qt.n("Unhandled path value "+this.ms.toString())}}U3(w){if(Yt,qt.s(w,et,tt,"layoutTreeBlock:v"),0===w.childrenCount){var P=w.parent;let t=!1,e=0,i;null!==P&&(e=P.angle,i=P.alignment,t=this.isBusAlignment(i));P=this.WN(w);w.X.e(0,0),w.kt.e(w.width,w.height),null===w.parent||null===w.comments||(180!==e&&270!==e||t)&&!P?w.ht.e(0,0):180===e&&!t||(90===e||270===e)&&P?w.ht.e(w.width-2*w.focus.x,0):w.ht.e(0,w.height-2*w.focus.y),w.Yg=null,void(w.Kg=null)}else{var S=this.orthoAngle(w),k=90===S||270===S;let i=0;var M=w.children,N=M.length;for(let t=0;tB&&(uB&&(ds&&(P=this.ZN(L,H-s,0),y=P.x,A=P.y,s=H,p=0):s=this.jN(w,s,p),p<0&&(y-=p,p=0),135n&&(D=this.ZN(L,0,I-n),y=D.x,A=D.y,n=I,v=0):n=this.JN(w,n,v),v<0&&(A-=v,v=0),y+=H+G);let x,b;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])),b[0].e(p+H,0),b[1].e(b[0].x,I),b[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])),b[0].e(0,v+I),b[1].e(H,b[0].y),b[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:{...zi.Light.colors},fonts:{...zi.Light.fonts},numbers:{...zi.Light.numbers},margins:{...zi.Light.margins},arrowheads:{...zi.Light.arrowheads}}),this.lu.set("dark",{colors:{...zi.Dark.colors},fonts:{...zi.Dark.fonts},numbers:{...zi.Dark.numbers},margins:{...zi.Dark.margins},arrowheads:{...zi.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&&(qt.t(t,"string",Vi,"defaultTheme"),this.Tk=t,this.pw())}get currentTheme(){return this.Dk}set currentTheme(t){this.Dk!==t&&(qt.t(t,"string",Vi,"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=ze.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&&pze.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>ze.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>ze.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>ze.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 wt,this.mouseUpTools),this.ii("ClickCreating",new gt,this.mouseUpTools),this.ii("ClickSelecting",new dt,this.mouseUpTools)},K.xP("GraphLinksModel",ii),K.xP("TreeModel",si);var n=v.go,a={get version(){return K.version},Group:j,List:E,Set:C,Map:L,Point:U,Size:Xt,Rect:J,Margin:O,Spot:Z,Geometry:W,PathFigure:k,PathSegment:w,InputEvent:N,DiagramEvent:B,ChangedEvent:R,Model:A,GraphLinksModel:oi,TreeModel:li,Binding:ai,ThemeBinding:ri,Transaction:F,UndoManager:Q,CommandHandler:Kt,Tool:_,DraggingTool:d,DraggingInfo:Rt,DraggingOptions:Et,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:wt,ToolManager:st,Animation:kt,AnimationManager:St,AnimationTrigger:Ct,Layer:Lt,Diagram:K,Palette:Ot,Overview:Ht,Brush:m,GraphObject:y,Panel:jt,RowColumnDefinition:be,Shape:z,TextBlock:V,Picture:Le,Part:Y,Adornment:q,Node:D,Link:X,Placeholder:je,Layout:Qe,LayoutNetwork:Ue,LayoutVertex:We,LayoutEdge:Je,GridLayout:ti,PanelLayout:se,CircularLayout:gi,CircularNetwork:fi,CircularVertex:pi,CircularEdge:vi,ForceDirectedLayout:yi,ForceDirectedNetwork:Ai,ForceDirectedVertex:xi,ForceDirectedEdge:bi,LayeredDigraphLayout:Ci,LayeredDigraphNetwork:Li,LayeredDigraphVertex:Di,LayeredDigraphEdge:Ti,TreeLayout:tt,TreeNetwork:Ii,TreeVertex:et,TreeEdge:Ki,Themes:zi,ThemeManager:Vi,Router:Yi,AnimationStyle:Pt,AutoScale:Dt,CycleMode:Tt,Flip:Qt,TextFormat:ke,ImageStretch:Ce,LayoutConditions:a,LinkAdjusting:Oe,Curve:Ie,Routing:He,Orientation:Vt,TextOverflow:Se,PortSpreading:Fe,ScrollMode:Bt,CollapsePolicy:e,Sizing:xe,TriggerStart:Nt,Stretch:zt,ViewboxStretch:pe,Wrap:Pe,BrushType:ee,ColorSpace:i,GeometryStretch:S,GeometryType:P,SegmentType:M,BindingMode:ni,ChangeType:G,CircularArrangement:hi,CircularDirection:ui,CircularNodeDiameterFormula:ci,CircularSorting:di,GridAlignment:Ze,GridArrangement:_e,GridSorting:$e,LayeredDigraphAggressive:Ni,LayeredDigraphAlign:Pi,LayeredDigraphCycleRemove:Si,LayeredDigraphInit:Mi,LayeredDigraphLayering:ki,LayeredDigraphPack:s,TreeAlignment:Ri,TreeArrangement:Oi,TreeCompaction:Fi,TreeLayerStyle:Hi,TreePath:Bi,TreeSorting:Gi,TreeStyle:Ei,GestureMode:it,LinkingDirection:at,ReshapingBehavior:t,TextEditingAccept:At,TextEditingStarting:xt,TextEditingState:bt,WheelMode:$};"object"==typeof n&&n.version&&qt.ft("WARNING: a `go` object on the root object is already defined. "+("Debug"in n?"debug ":"")+"version: "+n.version+", replaced with version: "+a.version),K.prototype.go=a,((v.go=a).Debug=Yt).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:'',"male-twin":'',manager:'',manufacturing:'',military:'',police:'',prelations:'',retail:'',sales:'',seaman:'',sergeant:'',software:'',train:'',book:'',fishery:'',skull:''},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"],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"),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[vL1,wL1]of Object.entries(isDark?DARK_MARKERS:LIGHT_MARKERS))MARKERS[vL1]="data:image/svg+xml;base64,"+btoa(wL1);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:"Yeuseff Loran",height:0,width:0},{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"},{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:"intelligence",marker3:"government",marker4:"prelations",fid:"GQJK-L51",child:"85203214"},{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"},{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"},{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"},{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"},{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"},{baptismDate:null,birthDate:"about 1905",birthPlace:null,deathAge:null,deathDate:"1936-04-25",deathPlace:"Luisiana, Laguna, PHL",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"},{baptismDate:null,birthDate:"about 1886",birthPlace:null,deathAge:null,deathDate:"1946-06-23",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"38670752",lastName:"Mia",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Francisco",fid:"GJJ8-MK1",child:"53221118"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"52051920",lastName:"Mia",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Santiago",fid:"GJJ8-HDC",child:"38670752"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"32552672",lastName:"Trobela",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Aniceta",fid:"GJJZ-54Z",child:"38670752"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"58054954",lastName:"Arco",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Gabina",fid:"GJJZ-65G",child:"53221118"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"38190203",lastName:"Arco",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Eleuterio",fid:"GJJ8-XXM",child:"58054954"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"12606761",lastName:"Villarante",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Sabina",fid:"GJJZ-1K6",child:"58054954"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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:null,prefix:null,suffix:"Jr.",vitalsCompleteAndVerified:!1,firstName:"Manuel",marker:"male-twin",marker2:"seaman",fid:"GHBD-7M4",child:"50342947"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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:null,middleName:"Reyes",nickname:"Sotering",prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Sotero",marker:"police",marker2:"train",fid:"GHB8-GB6",child:"58601193"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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:null,middleName:null,nickname:"Cresing",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Cresencia",marker:"apparel",marker2:"sales",fid:"GHBD-9LY",child:"58601193"},{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"},{baptismDate:null,birthDate:"1994-12-16",birthPlace:"Santa Cruz, 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"},{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"},{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:null,middleName:"Ladera",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Nestor",marker:"farming",fid:"GH12-SVQ",child:"41741428"},{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"},{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"},{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:null,middleName:"Acerto",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Rufa",marker:"farming",fid:"GH12-9F6",child:"41741428"},{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"},{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"},{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"},{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:"Capiz, PHL",middleName:"Badoles",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Napoleon Crispolon",fid:"GH12-Z3C",child:"55859428"},{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:"Emmanuel",fid:"GH12-XX4",child:"17374654"},{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"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"35729864",lastName:"Bermúdez",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"},{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"},{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"},{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:"Villanes",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"},{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:"Capiz, PHL",middleName:"Borja",nickname:"Mamang",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Selma",marker:"farming",fid:"GH12-W17",child:"55859428"},{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:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Benigno",marker:"military",fid:"GH12-6YL",child:"64719992"},{baptismDate:null,birthDate:"before 1896",birthPlace:"PHL",deathAge:null,deathDate:"after 1996-12-16",deathPlace:"PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"47733294",lastName:"Borja",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Enoria",fid:"GH12-DD8",child:"64719992"}],STORIES={"GQX8-CQP":{headline:"An Electronics-Engineering-graduate turned Software Engineer focused on recording his family's history.",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&&qt.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&&(qt.t(t,"boolean",li,"copiesParentKeyOfNodeData"),this.kg=t)}getParentKeyForNodeData(t){if(null!==t){var e=this.Bn;if(""!==e){e=A.Xt(t,e);if(void 0!==e){if(this.isKeyType(e))return e;qt.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)||qt.Bi(e,"number or string",li,"setParentKeyForNodeData:key"),null!==t&&""!==(i=this.Bn)&&(e=this.maybeEnsureLinkReference(e),this.containsNodeData(t)?(s=A.Xt(t,i))!==e&&(this.en(s,t),A.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):A.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=A.Xt(t,e))?"":"string"==typeof e?e:void qt.n("getParentLinkCategoryForNodeData found a non-string category for "+t+": "+e)}getLinkCategoryForData(t){return this.getParentLinkCategoryForNodeData(t)}setParentLinkCategoryForNodeData(e,i){if(qt.t(i,"string",li,"setParentLinkCategoryForNodeData:cat"),null!==e){var s=this.$a;if(""!==s)if(this.containsNodeData(e)){let t=A.Xt(e,s);(t=void 0===t?"":t)!==i&&(A.dt(e,s,i),this.Kt("parentLinkCategory",2,s,e,t,i),"string"==typeof s)&&this.updateTargetBindings(e,s)}else A.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===A.Xt(t,this.Bn)||A.dt(t,this.Bn,void 0),t)}setDataProperty(t,e,i){if((Yt,qt.t(t,"object",li,"setDataProperty:data"),qt.t(e,"string",li,"setDataProperty:propname"),""===e)&&qt.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=A.Xt(t,e);s!==i&&(A.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,A.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=qt.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 E).addAll(e),i.addAll(s)):(3===this.arrangement&&s.reverse(),(i=new E).addAll(s),i.addAll(e))}var g=i.length;let m=u=0;for(let e=0;ea?(a=w,d=a*r,A):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){Yt,null===e&&qt.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 E;t.addAll(e.iterator);var s=new E,n=new E,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(U.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;U.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 U(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:qt.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 wi(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){Yt,qt.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=J.a(),this.Fw(this.network,i),s=this.arrangementOrigin,t=s.x-i.x,e=s.y-i.y,J.o(i));for(var i,s,n=J.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()}J.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){qt.s(t,Xt,yi,"arrangementSpacing"),this.Ts.equals(t)||(this.Ts.c(t),this.invalidateLayout())}get arrangesToOrigin(){return this.Ag}set arrangesToOrigin(t){this.Ag!==t&&(qt.t(t,"boolean",yi,"arrangesToOrigin"),this.Ag=t,this.invalidateLayout())}get setsPortSpots(){return this.zn}set setsPortSpots(t){this.zn!==t&&(qt.t(t,"boolean",yi,"setsPortSpots"),this.zn=t,this.invalidateLayout())}get comments(){return this.Ye}set comments(t){this.Ye!==t&&(qt.t(t,"boolean",yi,"comments"),this.Ye=t,this.invalidateLayout())}get maxPrelayoutIterations(){return this.Lg}set maxPrelayoutIterations(t){this.Lg!==t&&(qt.t(t,"number",yi,"maxPrelayoutIterations"),0<=t)&&(this.Lg=t,this.invalidateLayout())}get maxIterations(){return this.Tg}set maxIterations(t){this.Tg!==t&&(qt.t(t,"number",yi,"maxIterations"),0<=t)&&(this.Tg=t,this.invalidateLayout())}get epsilonDistance(){return this.Dg}set epsilonDistance(t){this.Dg!==t&&(qt.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(b[f*A+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){Yt,qt.r(t,Ci,"medianBarycenterCrossingReduction:unfixedLayer"),qt.r(e,Ci,"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;ix+1&&(t+=4*(u-x),e+=4*(u-(x+1)))}}var O=y[x].destinationEdges.iterator;if(p&&0<=v)for(;O.next();){var H=O.value;d=H.toVertex,H.valid&&d.layer!==f&&(n=this.linkStraightenWeight(H),a=H.portFromColOffset,r=H.portToColOffset,l=d.column,i+=(Math.abs(C+a-(l+r))+1)*n,s+=(Math.abs(G+a-(l+r))+1)*n)}for(O.reset();O.next();){var I=O.value;if(d=I.toVertex,I.valid&&d.layer===f){for(c=0;cx+1&&(t+=4*(u-(x+1)),e+=4*(u-x))}}var Y=y[x+1].destinationEdges.iterator;if(p&&0<=v)for(;Y.next();){var q=Y.value;d=q.toVertex,q.valid&&d.layer!==f&&(n=this.linkStraightenWeight(q),a=q.portFromColOffset,r=q.portToColOffset,l=d.column,i+=(Math.abs(L+a-(l+r))+1)*n,s+=(Math.abs(B+a-(l+r))+1)*n)}for(Y.reset();Y.next();){var X=Y.value;if(d=X.toVertex,X.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&&tx+this.nodeMinColumnSpace(m[g-1],!1)?b-1:b,0),i=(e=g+1>=f||m[g+1].column-b-1>w+this.nodeMinColumnSpace(m[g+1],!0)?b+1:b,0),s=0,n=0,a=0,r=0,o=0;if(c<=0)for(var P=m[g].sourceEdges.iterator;P.next();){var S=P.value,k=S.fromVertex;S.valid&&k.layer!==d&&(a=this.linkStraightenWeight(S),r=S.portFromColOffset,o=S.portToColOffset,S=k.column,i+=(Math.abs(b+o-(S+r))+1)*a,s+=(Math.abs(t+o-(S+r))+1)*a,n+=(Math.abs(e+o-(S+r))+1)*a)}if(0<=c)for(var M=m[g].destinationEdges.iterator;M.next();){var N=M.value,C=N.toVertex;N.valid&&C.layer!==d&&(a=this.linkStraightenWeight(N),r=N.portFromColOffset,o=N.portToColOffset,N=C.column,i+=(Math.abs(b+r-(N+o))+1)*a,s+=(Math.abs(t+r-(N+o))+1)*a,n+=(Math.abs(e+r-(N+o))+1)*a)}let l=0,h=0,u=0;x=p[m[g].index],w=v[m[g].index];-1!==x&&(l+=Math.abs(x-b),h+=Math.abs(x-t),u+=Math.abs(x-e)),-1!==w&&(l+=Math.abs(w-b),h+=Math.abs(w-t),u+=Math.abs(w-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){Yt,qt.r(t,Ci,"packAux:column"),qt.r(e,Ci,"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=qt.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;qt.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)})}}qt.ot(n),qt.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,A.insertPointAt(s++,l,e+c),A.insertPointAt(s++,l,e),A.insertPointAt(s++,l,e-d)):(A.insertPointAt(s++,l,h+c),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h-d)):270===this.C?h<=y.bounds.y?(e=y.bounds.y,A.insertPointAt(s++,l,e-d),A.insertPointAt(s++,l,e),A.insertPointAt(s++,l,e+c)):(A.insertPointAt(s++,l,h-d),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h+c)):0===this.C&&(l>=y.bounds.right?(e=y.bounds.x+y.bounds.width,A.insertPointAt(s++,e+c,h),A.insertPointAt(s++,e,h),A.insertPointAt(s++,e-d,h)):(A.insertPointAt(s++,l+c,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l-d,h)));else{A.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),A.insertPointAt(s++,r+t,h)):((270===this.C?h>=y.bounds.bottom:h<=y.bounds.y)&&(t=(90===this.C?-d:c)/2),A.insertPointAt(s++,l,o+t)),A.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?(A.insertPointAt(s++,l-d-k,h),A.insertPointAt(s++,Math.min(l-d+k/2,l),h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,Math.max(l+c-k/2,l),h),A.insertPointAt(s++,l+c+k,h)):90===this.C?(A.insertPointAt(s++,l,h+c+k),A.insertPointAt(s++,l,Math.max(h+c-k/2,h)),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,Math.min(h-d+k/2,h)),A.insertPointAt(s++,l,h-d-k)):270===this.C?(A.insertPointAt(s++,l,h-d-k),A.insertPointAt(s++,l,Math.min(h-d+k/2,h)),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,Math.max(h+c-k/2,h)),A.insertPointAt(s++,l,h+c+k)):(A.insertPointAt(s++,l+c+k,h),A.insertPointAt(s++,Math.max(l+c-k/2,l),h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,Math.min(l-d+k/2,l),h),A.insertPointAt(s++,l-d-k,h)):(180!==this.C&&90!==this.C&&this.C,A.insertPointAt(s++,l,h));y=n}if(null===p||w!==Z.None||i)if(r=A.getPoint(s-1).x,o=A.getPoint(s-1).y,l=A.getPoint(s).x,h=A.getPoint(s).y,i){var C=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?-C:C),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?-C:C),t=t=v.bounds.x?(e=v.bounds.x+v.bounds.width,A.setPointAt(s-2,e,o),A.setPointAt(s-1,e+c,o)):90===this.C&&h<=v.bounds.bottom?(e=v.bounds.y,A.setPointAt(s-2,r,e),A.setPointAt(s-1,r,e-d)):270===this.C&&h>=v.bounds.y?(e=v.bounds.y+v.bounds.height,A.setPointAt(s-2,r,e),A.setPointAt(s-1,r,e+c)):0===this.C&&l<=v.bounds.right&&(e=v.bounds.x,A.setPointAt(s-2,e,o),A.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),A.insertPointAt(s++,l+t,o)):((270===this.C?h<=v.bounds.y:h>=v.bounds.bottom)&&(t=(90===this.C?c:-d)/2),A.insertPointAt(s++,r,h+t)),A.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===b.link&&(n=D.toVertex,null!==(a=D.fromVertex).node&&(a=null),null===n.node))break}if(null===n)break;n!==y&&(r=A.getPoint(s-1).x,o=A.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===A.firstPickIndex+1&&(u=0===this.C?Math.max(u,r):Math.min(u,r)),A.insertPointAt(s++,u,o),A.insertPointAt(s++,u,h)):(null!==a?a.centerX:r)!==l&&(u=this.Gt[n.layer]+this.ur.y,s===A.firstPickIndex+1&&(u=90===this.C?Math.max(u,o):Math.min(u,o)),A.insertPointAt(s++,r,u),A.insertPointAt(s++,l,u)):(d=Math.max(10,this.on[n.layer]),c=Math.max(10,this.Rs[n.layer]),t?180===this.C?(A.insertPointAt(s++,l+c+k,h),A.insertPointAt(s++,Math.max(l+c-k/2,l),h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,Math.min(l-d+k/2,l),h),A.insertPointAt(s++,l-d-k,h)):90===this.C?(A.insertPointAt(s++,l,h-d-k),A.insertPointAt(s++,l,Math.min(h-d+k/2,h)),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,Math.max(h+c-k/2,h)),A.insertPointAt(s++,l,h+c+k)):270===this.C?(A.insertPointAt(s++,l,h+c+k),A.insertPointAt(s++,l,Math.max(h+c-k/2,h)),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,Math.min(h-d+k/2,h)),A.insertPointAt(s++,l,h-d-k)):(A.insertPointAt(s++,l-d-k,h),A.insertPointAt(s++,Math.min(l-d+k/2,l),h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,l,h),A.insertPointAt(s++,Math.max(l+c-k/2,l),h),A.insertPointAt(s++,l+c+k,h)):180===this.C?(A.insertPointAt(s++,l+c,h),A.insertPointAt(s++,l-d,h)):90===this.C?(A.insertPointAt(s++,l,h-d),A.insertPointAt(s++,l,h+c)):270===this.C?(A.insertPointAt(s++,l,h+c),A.insertPointAt(s++,l,h-d)):(A.insertPointAt(s++,l-d,h),A.insertPointAt(s++,l+c,h)))),v=n}i&&(r=A.getPoint(s-1).x,o=A.getPoint(s-1).y,l=A.getPoint(s).x,h=A.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),A.insertPointAt(s++,u,o),A.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),A.insertPointAt(s++,r,u),A.insertPointAt(s++,l,u)))}null!==x&&t&&4<=A.pointsCount&&(null!==f&&(S=w===Z.None?A.getLinkPointFromPoint(g,f,f.getDocumentPoint(Z.Center),A.getPoint(3),!0):A.getPoint(0),w===Z.None&&(x=A.getPoint(2),w=A.getPoint(3),90===this.direction||270===this.direction?(A.setPointAt(1,(S.x+x.x)/2,x.y),A.setPointAt(2,w.x,(x.y+w.y)/2)):(A.setPointAt(1,x.x,(S.y+x.y)/2),A.setPointAt(2,(x.x+w.x)/2,w.y))),S.isReal()||S.set(g.actualBounds.center),A.setPointAt(0,S.x,S.y)),null!==p)&&(x=P===Z.None?A.getLinkPointFromPoint(m,p,p.getDocumentPoint(Z.Center),A.getPoint(A.pointsCount-4),!1):A.getPoint(A.pointsCount-1),P===Z.None&&(w=A.getPoint(A.pointsCount-3),P=A.getPoint(A.pointsCount-4),90===this.direction||270===this.direction?(A.setPointAt(A.pointsCount-2,(x.x+w.x)/2,w.y),A.setPointAt(A.pointsCount-2,P.x,(w.y+P.y)/2)):(A.setPointAt(A.pointsCount-2,w.x,(x.y+w.y)/2),A.setPointAt(A.pointsCount-3,(w.x+P.x)/2,P.y))),x.isReal()||x.set(m.actualBounds.center),A.setPointAt(A.pointsCount-1,x.x,x.y)),A.commitRoute(),b.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 X&&null!==(e=t.fromNode)&&!e.isLinkLabel&&"Comment"!==e.category&&!(null===(e=t.toNode)||e.isLinkLabel||"Comment"===e.category)};return t instanceof z?(e.addParts(t.nodes,!0,i),e.addParts(t.links,!0,i)):t instanceof j?e.addParts(t.memberParts,!1,i):e.addParts(t.iterator,!1,i),e}doLayout(t){Yt,null===t&&qt.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 z&&(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;Yt,qt.s(t,et,tt,"isAncestor:a"),Yt,qt.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){Yt,qt.s(t,et,tt,"removeChild:p"),Yt,qt.s(s,et,tt,"removeChild:c");var n=t.children;let i=0;for(let t=0;tS&&(aS&&(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(Yt,qt.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(Yt,qt.it(t,Ri,"TreeAlignment"),t){case 20:case 21:e/=2,i/=2;break;case 22:i=e=0;break;case 23:break;default:qt.n("Unhandled alignment value "+t.toString())}return new U(e,i)}of(t,e,i,s,n,a){Yt,qt.s(t,et,tt,"shiftRelPosAlign:v"),Yt,qt.it(e,Ri,"TreeAlignment");e=this.ZN(e,i,s);this.ru(t,e.x,e.y,n,a)}ru(t,e,i,s,n){if(Yt,qt.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){Yt,qt.s(t,et,tt,"recordMidPoints:v"),qt.t(e,"number",tt,"recordMidPoints:x"),qt.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:qt.n("Unhandled path value "+this.ms.toString())}}U3(w){if(Yt,qt.s(w,et,tt,"layoutTreeBlock:v"),0===w.childrenCount){var P=w.parent;let t=!1,e=0,i;null!==P&&(e=P.angle,i=P.alignment,t=this.isBusAlignment(i));P=this.WN(w);w.X.e(0,0),w.kt.e(w.width,w.height),null===w.parent||null===w.comments||(180!==e&&270!==e||t)&&!P?w.ht.e(0,0):180===e&&!t||(90===e||270===e)&&P?w.ht.e(w.width-2*w.focus.x,0):w.ht.e(0,w.height-2*w.focus.y),w.Yg=null,void(w.Kg=null)}else{var S=this.orthoAngle(w),k=90===S||270===S;let i=0;var M=w.children,N=M.length;for(let t=0;tB&&(uB&&(ds&&(P=this.ZN(L,H-s,0),y=P.x,A=P.y,s=H,p=0):s=this.jN(w,s,p),p<0&&(y-=p,p=0),135n&&(D=this.ZN(L,0,I-n),y=D.x,A=D.y,n=I,v=0):n=this.JN(w,n,v),v<0&&(A-=v,v=0),y+=H+G);let b,x;if(0b[0].x?b[2].c(b[1]):b[1].c(b[2])),b[3].yb[0].x?b[3].c(b[2]):b[2].c(b[3])),x[0].e(p+H,0),x[1].e(x[0].x,I),x[2].yb[0].y?b[2].c(b[1]):b[1].c(b[2])),b[3].xb[0].y?b[3].c(b[2]):b[2].c(b[3])),x[0].e(0,v+I),x[1].e(H,x[0].y),x[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:{...Ki.Light.colors},fonts:{...Ki.Light.fonts},numbers:{...Ki.Light.numbers},margins:{...Ki.Light.margins},arrowheads:{...Ki.Light.arrowheads}}),this.lu.set("dark",{colors:{...Ki.Dark.colors},fonts:{...Ki.Dark.fonts},numbers:{...Ki.Dark.numbers},margins:{...Ki.Dark.margins},arrowheads:{...Ki.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&&(qt.t(t,"string",Vi,"defaultTheme"),this.Tk=t,this.pw())}get currentTheme(){return this.Dk}set currentTheme(t){this.Dk!==t&&(qt.t(t,"string",Vi,"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=Ke.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&&pKe.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>Ke.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>Ke.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>Ke.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 wt,this.mouseUpTools),this.ii("ClickCreating",new gt,this.mouseUpTools),this.ii("ClickSelecting",new dt,this.mouseUpTools)},z.xP("GraphLinksModel",ii),z.xP("TreeModel",si);var n=v.go,a={get version(){return z.version},Group:j,List:E,Set:C,Map:L,Point:U,Size:Xt,Rect:J,Margin:O,Spot:Z,Geometry:W,PathFigure:k,PathSegment:w,InputEvent:N,DiagramEvent:B,ChangedEvent:R,Model:A,GraphLinksModel:oi,TreeModel:li,Binding:ai,ThemeBinding:ri,Transaction:F,UndoManager:Q,CommandHandler:zt,Tool:_,DraggingTool:d,DraggingInfo:Rt,DraggingOptions:Et,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:wt,ToolManager:st,Animation:kt,AnimationManager:St,AnimationTrigger:Ct,Layer:Lt,Diagram:z,Palette:Ot,Overview:Ht,Brush:m,GraphObject:y,Panel:jt,RowColumnDefinition:xe,Shape:K,TextBlock:V,Picture:Le,Part:Y,Adornment:q,Node:D,Link:X,Placeholder:je,Layout:Qe,LayoutNetwork:Ue,LayoutVertex:We,LayoutEdge:Je,GridLayout:ti,PanelLayout:se,CircularLayout:gi,CircularNetwork:fi,CircularVertex:pi,CircularEdge:vi,ForceDirectedLayout:yi,ForceDirectedNetwork:Ai,ForceDirectedVertex:bi,ForceDirectedEdge:xi,LayeredDigraphLayout:Ci,LayeredDigraphNetwork:Li,LayeredDigraphVertex:Di,LayeredDigraphEdge:Ti,TreeLayout:tt,TreeNetwork:Ii,TreeVertex:et,TreeEdge:zi,Themes:Ki,ThemeManager:Vi,Router:Yi,AnimationStyle:Pt,AutoScale:Dt,CycleMode:Tt,Flip:Qt,TextFormat:ke,ImageStretch:Ce,LayoutConditions:a,LinkAdjusting:Oe,Curve:Ie,Routing:He,Orientation:Vt,TextOverflow:Se,PortSpreading:Fe,ScrollMode:Bt,CollapsePolicy:e,Sizing:be,TriggerStart:Nt,Stretch:Kt,ViewboxStretch:pe,Wrap:Pe,BrushType:ee,ColorSpace:i,GeometryStretch:S,GeometryType:P,SegmentType:M,BindingMode:ni,ChangeType:G,CircularArrangement:hi,CircularDirection:ui,CircularNodeDiameterFormula:ci,CircularSorting:di,GridAlignment:Ze,GridArrangement:_e,GridSorting:$e,LayeredDigraphAggressive:Ni,LayeredDigraphAlign:Pi,LayeredDigraphCycleRemove:Si,LayeredDigraphInit:Mi,LayeredDigraphLayering:ki,LayeredDigraphPack:s,TreeAlignment:Ri,TreeArrangement:Oi,TreeCompaction:Fi,TreeLayerStyle:Hi,TreePath:Bi,TreeSorting:Gi,TreeStyle:Ei,GestureMode:it,LinkingDirection:at,ReshapingBehavior:t,TextEditingAccept:At,TextEditingStarting:bt,TextEditingState:xt,WheelMode:$};"object"==typeof n&&n.version&&qt.ft("WARNING: a `go` object on the root object is already defined. "+("Debug"in n?"debug ":"")+"version: "+n.version+", replaced with version: "+a.version),z.prototype.go=a,((v.go=a).Debug=Yt).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:'',"male-twin":'',manager:'',manufacturing:'',military:'',police:'',prelations:'',retail:'',sales:'',seaman:'',sergeant:'',software:'',train:'',book:'',fishery:'',skull:''},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"],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"),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[vL1,wL1]of Object.entries(isDark?DARK_MARKERS:LIGHT_MARKERS))MARKERS[vL1]="data:image/svg+xml;base64,"+btoa(wL1);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:"Yeuseff Loran",height:0,width:0},{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"},{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:"intelligence",marker3:"government",marker4:"prelations",fid:"GQJK-L51",child:"85203214"},{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"},{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"},{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"},{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"},{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"},{baptismDate:null,birthDate:"about 1905",birthPlace:null,deathAge:null,deathDate:"1936-04-25",deathPlace:"Luisiana, Laguna, PHL",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"},{baptismDate:null,birthDate:"about 1886",birthPlace:null,deathAge:null,deathDate:"1946-06-23",deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"38670752",lastName:"Mia",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Francisco",fid:"GJJ8-MK1",child:"53221118"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"52051920",lastName:"Mia",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Santiago",fid:"GJJ8-HDC",child:"38670752"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"32552672",lastName:"Trobela",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Aniceta",fid:"GJJZ-54Z",child:"38670752"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"58054954",lastName:"Arco",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Gabina",fid:"GJJZ-65G",child:"53221118"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"M",hasDNA:!1,hasImage:!1,key:"38190203",lastName:"Arco",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Eleuterio",fid:"GJJ8-XXM",child:"58054954"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"12606761",lastName:"Villarante",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Sabina",fid:"GJJZ-1K6",child:"58054954"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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:null,prefix:null,suffix:"Jr.",vitalsCompleteAndVerified:!1,firstName:"Manuel",marker:"male-twin",marker2:"seaman",fid:"GHBD-7M4",child:"50342947"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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:null,middleName:"Reyes",nickname:"Sotering",prefix:null,suffix:"Sr.",vitalsCompleteAndVerified:!1,firstName:"Sotero",marker:"police",marker2:"train",fid:"GHB8-GB6",child:"58601193"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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"},{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:null,middleName:null,nickname:"Cresing",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Cresencia",marker:"apparel",marker2:"sales",fid:"GHBD-9LY",child:"58601193"},{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"},{baptismDate:null,birthDate:"1994-12-16",birthPlace:"Santa Cruz, 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"},{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"},{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:null,middleName:"Ladera",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Nestor",marker:"farming",fid:"GH12-SVQ",child:"41741428"},{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"},{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"},{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:null,middleName:"Acerto",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Rufa",marker:"farming",fid:"GH12-9F6",child:"41741428"},{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"},{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"},{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"},{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:"Capiz, PHL",middleName:"Badoles",nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Napoleon Crispolon",fid:"GH12-Z3C",child:"55859428"},{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:"Emmanuel",fid:"GH12-XX4",child:"17374654"},{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"},{baptismDate:null,birthDate:null,birthPlace:null,deathAge:null,deathDate:null,deathPlace:null,gender:"F",hasDNA:!1,hasImage:!1,key:"35729864",lastName:"Bermúdez",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"},{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"},{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"},{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:"Villanes",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"},{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:"Capiz, PHL",middleName:"Borja",nickname:"Mamang",prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Selma",marker:"farming",fid:"GH12-W17",child:"55859428"},{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:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Benigno",marker:"military",fid:"GH12-6YL",child:"64719992"},{baptismDate:null,birthDate:"before 1896",birthPlace:"PHL",deathAge:null,deathDate:"after 1996-12-16",deathPlace:"PHL",gender:"F",hasDNA:!1,hasImage:!0,key:"47733294",lastName:"Borja",living:!1,livingPlace:null,marriageDate:null,marriagePlace:null,middleName:null,nickname:null,prefix:null,suffix:null,vitalsCompleteAndVerified:!1,firstName:"Enoria",fid:"GH12-DD8",child:"64719992"}],STORIES={"GQX8-CQP":{headline:"An Electronics-Engineering-graduate turned Software Engineer focused on recording his family's history.",stories:`
Half Siblings from Mother's Side
  • @@ -533,6 +533,26 @@ Model data should not have any references to a Diagram or any part of a diagram, Beautiful Engagement Ring

    Mitchie's lab-grown Diamond engagement ring.

    + +
    +
    First Pregnancy
    +

    A compilation of reactions from Arbyn and Mitchie's relatives; and their close friends.

    +
    +
    +

    How Mitch and Arbyn found that they would be having a baby and how they announced it to their relatives.

    +
    +
    +
    +

    Mitchie's high school best friends, BCHZ, finding out she was pregnant.

    +
    +
    +
    +

    The Alviza family, a close family friend, finding out that Mitch was pregnant.

    +
    +
    +
    +

    Reaction video of Mitch and Arbyn's mutual friends.

    +
    `}},TREE_KEYMAP={},TREE_FIDMAP={};for(const[i,xL1]of Object.entries(TREE_DATA))if(TREE_DATA[i].parent=TREE_DATA[i].child,null!=xL1.firstName){let t=TREE_DATA[i];if(TREE_DATA[i].useNonePhoto=bino.useNonePhoto(t),!STORIES[xL1.fid]||isPrivate&&xL1.living)TREE_DATA[i].hasStories=!1;else{let t=0;1==(t=xL1.marker4||xL1.marker3?4:xL1.marker2||xL1.marker&&xL1.hasDNA?3:xL1.marker&&!xL1.hasDNA||!xL1.marker&&xL1.hasDNA?2:1)&&(t=""),TREE_DATA[i]["marker"+t]="book",TREE_DATA[i].hasStories=!0}let e=(xL1.middleName||"").trim().split(" "),s="";if(""!=e[0])for(let t=0;t{TREE_KEYMAP[t.key]=t,(TREE_FIDMAP[t.fid]=t).generation=0}),n.filter(t=>!t.child).forEach(t=>{!function e(i,s){TREE_KEYMAP[i]&&(TREE_KEYMAP[i].generation=s,n.filter(t=>t.child===i).forEach(t=>{e(t.key,s+1)}))}(t.key,0)})}addGeneration(TREE_DATA);var treeToFid={},childToParents={};function setScrollPos(t,e){for(var i=document.querySelectorAll(t),s=0;s{return`${t.charAt(0)}${t.slice(1)}`}).join(" ")}function addPersonDetails(i){var t=document.getElementById("personDetailsDesc"),e=document.createElement("div");e.id="details-"+i.key;let s=STORIES[i.data.fid].headline;s=s&&s.replace(/\$\{([^}]+)\}/g,(t,e)=>void 0!==i.data[e]?i.data[e]:t);let n,a=(n=STORIES[i.data.fid].headshot||i.data.fid+".lossy.webp",""),r=(i.data.hasImage&&void 0!==i.data.fid&&(a+=`
    headshot
    `),!1);var o={farming:"Farmer",retail:"Divisoria Vendor",computer:"Information Technology",intelligence:"Intelligence Officer",government:"Government Official",software:"Software Engineer",book:"has stories","male-twin":"had a male twin",dna:"DNA-tested",military:"Military Veteran",housewife:"Housewife",fishery:"had a fishery",prelations:"PR Skills",skull:"Death March Survivor"};s&&(a=a+`

    ${s}

    `+'
    '),a+='
    ',i.data.hasDNA&&(a+=` ";var u=STORIES[i.data.fid].stories.replace(/\$\{([^}]+)\}/g,(t,e)=>void 0!==i.data[e]?i.data[e]:t);a+=u,e.innerHTML=a,t.appendChild(e)}function adjustBrightness(e,i){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let s="#";for(let t=1;t<7;t+=2){var n=parseInt(e.substr(t,2),16),n=Math.min(255,Math.max(0,Math.floor(n*(1+i/100))));s+=("0"+n.toString(16)).slice(-2)}return s}TREE_DATA.forEach(t=>{treeToFid[t.key]=t.fid,t.child&&(childToParents[t.child]?childToParents[t.child].push(t.key):childToParents[t.child]=[t.key])}),TREE_DATA.forEach(e=>{e.partner=null,e.child&&1t!==e.key))});const SOURCES={"Present and Direct Interactions - by Arbyn Argabioso":["TEMP-000:GHB5-TWN:parentChild","TEMP-000:GQX8-CQP:parentChild","GHB5-TWN:marker","GQJK-LCT:deathPlace","GQX8-CQP:marker","GQX8-CQP:marker3","GQJK-G8W:marker","GQJK-L51:marker","GQJK-L51:marker3","GHB5-XTZ:marker","GHB5-XTZ:marker2","GHB5-XTZ:marker3","GHBR-FK3:marker","GHBR-FK3:marker2","GHBR-FK3:marker3","GH12-W17:deathDate","GH12-W17:deathPlace","GH12-W17:living"],"SENTIMENTS OF LIVING RELATIVES":["GHBZ-TM4:birthPlace","GHB8-RCH:birthPlace","GHBZ-YVX:marker","GHBZ-YVX:marker3","GHB8-J1B:marker","GHBD-7M4:marker2","GHB8-J1B:deathDate","GH12-SVQ:firstName","GH12-SVQ:lastName","GH12-SVQ:birthPlace","GHBZ-P5Q:living","GHB8-7T6:middleName","GHB8-7T6:birthDate","GHB8-7T6:birthPlace","GHB8-7T6:deathDate","GHB8-7T6:deathPlace","GHB8-7T6:living","GHB8-7T6:marker","GHB8-GZL:middleName","GHB8-GZL:lastName","GHB8-GZL:birthDate","GHB8-GZL:birthPlace","GHB8-GZL:deathDate","GHB8-GZL:deathPlace","GHB8-GZL:living","GNNH-JLM:firstName","GNNH-JLM:lastName","GNNH-JLM:gender","GNNH-JLM:GHB8-7T6:parentChild","GJJX-1SG:firstName","GJJX-1SG:lastName","GJJX-1SG:gender","GJJX-1SG:GHB8-7T6:parentChild","GNNH-JLM:GJJX-1SG:partner","GHB8-M8D:firstName","GHB8-M8D:lastName","GHB8-M8D:gender","GHB8-M8D:GHB8-GZL:parentChild","GHB8-M86:firstName","GHB8-M86:lastName","GHB8-M86:gender","GHB8-M86:GHB8-GZL:parentChild","GHB8-M8D:GHB8-M86:partner","GH12-DRN:firstName","GH12-DRN:lastName","GH12-DRN:birthPlace","GH12-3GN:firstName","GH12-3GN:lastName","GH12-DRN:GH12-SVQ:parentChild","GH12-3GN:GH12-SVQ:parentChild","GH12-9JZ:firstName","GH12-9JZ:lastName","GH12-35H:firstName","GH12-35H:lastName","GH12-9JZ:GH12-9F6:parentChild","GH12-35H:GH12-9F6:parentChild","GH12-XX4:firstName","GH12-XX4:lastName","GH12-HQN:firstName","GH12-HQN:lastName","GH12-6YL:firstName","GH12-6YL:lastName","GH12-DD8:firstName","GH12-DD8:lastName","GH12-HQN:GH12-Z3C:parentChild","GH12-W17:marker","GH12-Z3C:living","GHBD-9LY:birthPlace","GHBD-9LY:marker","GHBD-9LY:marker2","LLQS-641:firstName","LLQS-641:GHB8-GB6:parentChild","TEMP-001:GHBD-9LY:parentChild"],"Existance of same-name son":["GHBD-9L6:suffix","GHB8-GB6:suffix"],"Existance of same-name father":["GHBD-7M4:suffix"],"PROBABLY NOT LIVING ANYMORE":["GHBZ-TM4:living","GHB8-RCH:living","G2HQ-YQS:living","G2H7-Q75:living","GNNH-JLM:living","GJJX-1SG:living","GHB8-M8D:living","GHB8-M86:living","GHB8-SQN:living","GHB8-5K8:living","GHB8-LCC:living","GHB8-H7K:living","LLQS-641:living","LLQS-6YC:living","L281-614:living","GC7T-H59:living","GC7T-1PK:living","LLQS-6F1:living","G7C3-B6P:living","G7C3-J9S:living","TEMP-001:living","GKBR-M9Y:living","GKBR-7P7:living","GKBT-9GD:living","K2GJ-YY3:living"],"https://drive.google.com/file/d/1B1umw_xm5i-AmNp9YzshX2DebSAhj3cz/view":["GQX8-CQP:birthPlace","GQX8-CQP:firstName","GQX8-CQP:middleName","GQX8-CQP:gender","GQX8-CQP:birthDate","GQJK-G8W:GQX8-CQP:parentChild","GQJK-G8W:gender","GQJK-G8W:firstName","GQJK-G8W:middleName","GQJK-G8W:lastName","GQJK-G8W:marker","GQJK-L51:GQX8-CQP:parentChild","GQJK-L51:gender","GQJK-L51:firstName","GQJK-L51:middleName","GQJK-L51:lastName","GQJK-L51:GQJK-G8W:partner"],"https://drive.google.com/file/d/1nJVXB-p0ZM0OUXsXK4TyI7JRwvbDln53/view":["GQX8-CQP:firstName","GQX8-CQP:middleName","GQX8-CQP:lastName","GQX8-CQP:birthDate","GQX8-CQP:baptismDate","GQJK-G8W:GQX8-CQP:parentChild","GQJK-G8W:gender","GQJK-G8W:firstName","GQJK-G8W:lastName","GQJK-G8W:birthPlace","GQJK-L51:GQX8-CQP:parentChild","GQJK-L51:gender","GQJK-L51:firstName","GQJK-L51:lastName","GQJK-L51:birthPlace","GQJK-L51:GQJK-G8W:partner"],"https://drive.google.com/file/d/1JugnGovmYL6q7yhPtoovnGNcoaKR2kYa/view?side=argabioso":["GQX8-CQP:GHB5-TWN:partner","GQX8-CQP:gender","GQX8-CQP:firstName","GQX8-CQP:middleName","GQX8-CQP:lastName","GQJK-G8W:GQX8-CQP:parentChild","GQJK-G8W:gender","GQJK-G8W:firstName","GQJK-G8W:middleName","GQJK-G8W:lastName","GQJK-L51:GQX8-CQP:parentChild","GQJK-L51:gender","GQJK-L51:firstName","GQJK-L51:middleName","GQJK-L51:lastName","GQJK-G8W:GQJK-L51:partner","GQX8-CQP:marriageDate","GQX8-CQP:marriagePlace"],"https://www.facebook.com/arbyn.argabioso/posts/pfbid02U3X7BU11Lb41vrbLQKrAyGe8oCEvd8SSqbY8rcCZ2MEQzcb3BUQJWL8UPhF1ZttYl":["GQX8-CQP:GHB5-TWN:partner"],"https://www.youtube.com/watch?v=LNkv-M1TMtg":["GQX8-CQP:GHB5-TWN:partner"],"https://drive.google.com/file/d/1degLEAa8cBBxJrRsWwz0t6wHh9vs29cH/view":["GQJK-L51:birthPlace","GQJK-L51:firstName","GQJK-L51:middleName","GQJK-L51:lastName","GQJK-L51:gender","GQJK-L51:birthDate","GQJK-LCT:GQJK-L51:parentChild","GQJK-LCT:gender","GQJK-LCT:firstName","GQJK-LCT:middleName","GQJK-LCT:lastName","GQJK-LCT:birthPlace","GHBZ-YVX:GQJK-L51:parentChild","GHBZ-YVX:gender","GHBZ-YVX:firstName","GHBZ-YVX:middleName","GHBZ-YVX:lastName","GHBZ-YVX:birthPlace","GQJK-LCT:GHBZ-YVX:partner","GQJK-LCT:marriageDate","GQJK-LCT:marriagePlace","GHBZ-YVX:marriageDate","GHBZ-YVX:marriagePlace"],"https://drive.google.com/file/d/1kMHiW0mbPuPGyGOBm08qY6yWgvnHd82K/view":["GQJK-L51:gender","GQJK-L51:firstName","GQJK-L51:middleName","GQJK-L51:lastName","GQJK-L51:birthDate","GQJK-L51:birthPlace","GQJK-LCT:GQJK-L51:parentChild","GQJK-LCT:gender","GQJK-LCT:firstName","GQJK-LCT:middleName","GQJK-LCT:lastName","GHBZ-YVX:GQJK-L51:parentChild","GHBZ-YVX:gender","GHBZ-YVX:firstName","GHBZ-YVX:middleName","GHBZ-YVX:lastName","GQJK-LCT:GHBZ-YVX:partner","GQJK-L51:marriagePlace","GQJK-L51:marriageDate"],"https://drive.google.com/file/d/1Zw8fzrh9ELRvIx1W7ncqT010edcT6hpK/view":["GQJK-L51:marker","GQJK-L51:marker3","GQJK-L51:firstName","GQJK-L51:lastName"],"https://drive.google.com/file/d/1C2TFs8kVvf6lWq-ANjEEG165f7bWUZCs/view?side=argabioso":["GQJK-LCT:GHBZ-YVX:partner","GQJK-LCT:marriagePlace","GQJK-LCT:gender","GQJK-LCT:firstName","GQJK-LCT:lastName","GHBZ-TM4:GQJK-LCT:parentChild","GHBZ-TM4:gender","GHBZ-TM4:firstName","GHBZ-TM4:lastName","GHBZ-P5Q:GQJK-LCT:parentChild","GHBZ-P5Q:gender","GHBZ-P5Q:firstName","GHBZ-P5Q:lastName","GHBZ-TM4:GHBZ-P5Q:partner","GQJK-LCT:marriageDate"],"https://drive.google.com/file/d/1tu21m1RMRjiTwPfzp1VrFENbPUhLsEKq/view":["GQJK-LCT:firstName","GQJK-LCT:lastName","GHBZ-TM4:firstName","GHBZ-TM4:lastName"],"https://drive.google.com/file/d/1x1M6Z1asZU99nMTdtKYdfDxY_w_s2Gnc/view":["GQJK-LCT:living","GQJK-LCT:firstName","GQJK-LCT:middleName","GQJK-LCT:lastName","GQJK-LCT:birthDate","GQJK-LCT:deathDate","GQJK-LCT:gender"],"https://drive.google.com/file/d/1SQy34nGR1Z5-AqNSZDInfkewArzP_xqp/view":["GHBZ-TM4:living","GHBZ-TM4:deathPlace","GHBZ-TM4:firstName","GHBZ-TM4:middleName","GHBZ-TM4:lastName","GHBZ-TM4:deathDate","GHBZ-TM4:gender","GHBZ-P5Q:living","GHBZ-TM4:birthDate","GHBZ-TM4:marker","GHBZ-TM4:birthPlace","GHB8-RCH:GHBZ-TM4:parentChild","GHB8-RCH:gender","GHB8-RCH:firstName","GHB8-RCH:lastName"],"https://drive.google.com/file/d/1yf_M5CJgnXsHGFvFmF5Uzfp4YrsAnfUY/view":["GHB8-RCH:living","GHB8-RCH:deathPlace","GHB8-RCH:firstName","GHB8-RCH:lastName","GHB8-RCH:gender","GHB8-RCH:deathDate","GHB8-RCH:birthDate","GHB8-RCH:birthPlace"],"https://drive.google.com/file/d/1_QL_-c5uIfBH8s0Y4ptLHaftJutdnW7Q/view":["G2HQ-YQS:GHB8-RCH:parentChild","G2HQ-YQS:firstName","G2HQ-YQS:lastName","G2HQ-YQS:gender","G2H7-Q75:GHB8-RCH:parentChild","G2H7-Q75:firstName","G2H7-Q75:lastName","G2H7-Q75:gender","G2HQ-YQS:G2H7-Q75:partner"],"https://www.familysearch.org/ark:/61903/1:1:66X6-LG3J":["G2HQ-YQS:GHB8-RCH:parentChild","G2HQ-YQS:firstName","G2HQ-YQS:lastName","G2HQ-YQS:gender","G2H7-Q75:GHB8-RCH:parentChild","G2H7-Q75:firstName","G2H7-Q75:lastName","G2H7-Q75:gender","G2HQ-YQS:G2H7-Q75:partner"],"https://drive.google.com/file/d/1Yy9S1Y4NOilHHulCeejkeeY1BUbzgRyn/view":["GHBZ-YVX:firstName","GHBZ-YVX:middleName","GHBZ-YVX:lastName","GHBZ-YVX:gender","GHBZ-YVX:birthDate","GHBZ-YVX:birthPlace","GHBZ-YVX:living","GHB8-GZL:GHBZ-YVX:parentChild","GHB8-GZL:gender","GHB8-GZL:firstName","GHB8-GZL:middleName","GHB8-GZL:lastName","GHB8-GZL:marker","GHB8-7T6:GHBZ-YVX:parentChild","GHB8-7T6:gender","GHB8-7T6:firstName","GHB8-7T6:middleName","GHB8-7T6:lastName","GHB8-7T6:marker","GHB8-7T6:GHB8-GZL:partner","GQJK-LCT:GHBZ-YVX:partner"],"https://drive.google.com/file/d/1C2TFs8kVvf6lWq-ANjEEG165f7bWUZCs/view?side=saplala":["GQJK-LCT:GHBZ-YVX:partner","GHBZ-YVX:marriagePlace","GHBZ-YVX:gender","GHBZ-YVX:firstName","GHBZ-YVX:lastName","GHB8-7T6:GHBZ-YVX:parentChild","GHB8-7T6:gender","GHB8-7T6:firstName","GHB8-7T6:lastName","GHB8-GZL:GHBZ-YVX:parentChild","GHB8-GZL:gender","GHB8-GZL:firstName","GHB8-GZL:lastName","GHB8-7T6:GHB8-GZL:partner","GHBZ-YVX:marriageDate"],"https://drive.google.com/file/d/1Db5lGDp-mhJH7LAXnuijFXBc1c1vA07j/view":["GQJK-G8W:birthPlace","GQJK-G8W:firstName","GQJK-G8W:middleName","GQJK-G8W:lastName","GQJK-G8W:birthDate","GHBD-7M4:GQJK-G8W:parentChild","GHBD-7M4:firstName","GHBD-7M4:middleName","GHBD-7M4:lastName","GHBD-7M4:birthPlace","GHBD-7M4:marker2","GHB8-J1B:GQJK-G8W:parentChild","GHB8-J1B:firstName","GHB8-J1B:middleName","GHB8-J1B:lastName","GHB8-J1B:birthPlace","GHBD-7M4:GHB8-J1B:partner","GHBD-7M4:marriageDate","GHBD-7M4:marriagePlace","GHB8-J1B:marriageDate","GHB8-J1B:marriagePlace"],"https://drive.google.com/file/d/1yqWECbcDTyhFig6IiK_AqPwXfL7gk0e0/view":["GQJK-G8W:firstName","GQJK-G8W:lastName","GQJK-G8W:birthDate","GQJK-G8W:baptismDate","GHBD-7M4:GQJK-G8W:parentChild","GHBD-7M4:gender","GHBD-7M4:firstName","GHBD-7M4:lastName","GHBD-7M4:birthPlace","GHB8-J1B:GQJK-G8W:parentChild","GHB8-J1B:gender","GHB8-J1B:firstName","GHB8-J1B:lastName","GHB8-J1B:birthPlace"],"https://drive.google.com/file/d/17vMMCyBJ2qOyjFYCtb7UWkIJrRymiz8_/view":["GQJK-G8W:gender","GQJK-G8W:firstName","GQJK-G8W:middleName","GQJK-G8W:lastName","GQJK-G8W:birthPlace","GHBD-7M4:GQJK-G8W:parentChild","GHBD-7M4:gender","GHBD-7M4:firstName","GHBD-7M4:lastName","GHB8-J1B:GQJK-G8W:parentChild","GHB8-J1B:gender","GHB8-J1B:firstName","GHB8-J1B:lastName","GHBD-7M4:GHB8-J1B:partner","GQJK-G8W:marriagePlace","GQJK-G8W:marriageDate"],"https://drive.google.com/file/d/1JArFl6_m-kuvyPf-LqDLU3_SapZzCvkt/view":["GQJK-G8W:living","GQJK-G8W:firstName","GQJK-G8W:lastName","GQJK-G8W:gender","GQJK-G8W:deathDate","GQJK-G8W:birthDate","GQJK-G8W:deathPlace"],"https://drive.google.com/file/d/1sIWWgh8zfcIYtQfk2rIm4iW97sGzgK-x/view":["GQJK-G8W:living","GQJK-G8W:firstName","GQJK-G8W:middleName","GQJK-G8W:lastName","GQJK-G8W:birthDate","GQJK-G8W:deathDate"],"https://drive.google.com/file/d/1_3rvIfv82-KWjBsaZawQV4lMFUYSB_NK/view?side=acosta":["GHBD-7M4:GHB8-J1B:partner","GHBD-7M4:marriagePlace","GHBD-7M4:gender","GHBD-7M4:firstName","GHBD-7M4:lastName","GHBD-7M4:suffix","GHBD-9L6:GHBD-7M4:parentChild","GHBD-9L6:gender","GHBD-9L6:firstName","GHBD-9L6:lastName","GHB8-DXY:GHBD-7M4:parentChild","GHB8-DXY:gender","GHB8-DXY:firstName","GHB8-DXY:lastName","GHBD-9L6:GHB8-DXY:partner","GHBD-7M4:marriageDate"],"https://drive.google.com/file/d/1zjeJs9azWMLnnEjulRpAnBi8Vno4H_9U/view?side=acosta":["GHBD-7M4:marriagePlace","GHBD-7M4:marriageDate","GHBD-7M4:firstName","GHBD-7M4:middleName","GHBD-7M4:lastName"],"https://drive.google.com/file/d/194CO9-EnmMLwhHPGe0qTO1d3G7HGtTZl/view":["GHBD-7M4:living","GHBD-7M4:firstName","GHBD-7M4:middleName","GHBD-7M4:lastName","GHBD-7M4:suffix","GHBD-7M4:birthDate","GHBD-7M4:birthPlace","GHBD-7M4:deathDate","GHBD-7M4:deathPlace","GHBD-9L6:GHBD-7M4:parentChild","GHBD-9L6:firstName","GHBD-9L6:lastName","GHBD-9L6:gender","GHBD-9L6:birthPlace","GHB8-DXY:GHBD-7M4:parentChild","GHB8-DXY:firstName","GHB8-DXY:gender","GHB8-DXY:birthPlace","GHBD-9L6:GHB8-DXY:partner"],"https://drive.google.com/file/d/1Yclt46UY9IV4Pp4xyfuZitegj4B5iXN7/view":["GHBD-7M4:living","GHBD-7M4:firstName","GHBD-7M4:middleName","GHBD-7M4:lastName","GHBD-7M4:deathDate","GHBD-7M4:deathPlace","GHBD-7M4:birthDate","GHBD-7M4:birthPlace"],"https://drive.google.com/file/d/1L4zy5f_l9gYFBQQ68WdVFLDunwFoKgru/view?side=acosta":["GHBD-9L6:GHB8-DXY:partner","GHB8-5K8:deathDate","GHBD-9L6:gender","GHBD-9L6:firstName","GHBD-9L6:middleName","GHBD-9L6:lastName","GHB8-SQN:GHBD-9L6:parentChild","GHB8-SQN:gender","GHB8-SQN:firstName","GHB8-SQN:lastName","GHB8-5K8:GHBD-9L6:parentChild","GHB8-5K8:gender","GHB8-5K8:firstName","GHB8-5K8:lastName","GHB8-SQN:GHB8-5K8:partner","GHBD-9L6:marriagePlace","GHBD-9L6:marriageDate"],"https://drive.google.com/file/d/16SOA-h6729Zochb7g906v_LH7Mej7dn6/view?side=acosta":["GHBD-9L6:GHB8-DXY:partner","GHBD-9L6:firstName","GHBD-9L6:middleName","GHBD-9L6:lastName","GHBD-9L6:GHBD-7M4:parentChild","GHB8-DXY:GHBD-7M4:parentChild","GHBD-7M4:firstName","GHBD-7M4:birthDate","GHBD-7M4:marker"],"https://drive.google.com/file/d/1JuyRHuSaar2p3RM0nUjWX-KPMAGjk2FK/view":["GHBD-9L6:living","GHBD-9L6:firstName","GHBD-9L6:middleName","GHBD-9L6:lastName","GHBD-9L6:birthDate","GHBD-9L6:gender","GHBD-9L6:deathDate","GHBD-9L6:birthPlace","GHBD-9L6:marker","GHBD-9L6:marker2","GHB8-DXY:GHBD-9L6:partner","GHB8-DXY:gender","GHB8-DXY:firstName","GHB8-DXY:lastName","GHB8-SQN:GHBD-9L6:parentChild","GHB8-SQN:gender","GHB8-SQN:lastName","GHB8-SQN:birthPlace","GHB8-5K8:GHBD-9L6:parentChild","GHB8-5K8:gender","GHB8-5K8:lastName","GHB8-5K8:birthPlace","GHB8-SQN:GHB8-5K8:partner","GHBD-9L6:deathPlace"],"https://drive.google.com/file/d/1MIuMf7Q89LU89gmeNNZlH8lgKeMUR_yU/view":["GHB8-SQN:living","GHB8-SQN:firstName","GHB8-SQN:lastName","GHB8-SQN:gender","GHB8-SQN:deathDate","GHB8-SQN:birthDate","GHB8-SQN:deathPlace","GHB8-5K8:firstName","GHB8-5K8:lastName","GHBD-9L6:firstName","GHBD-9L6:middleName","GHBD-9L6:lastName"],"https://drive.google.com/file/d/1AL6hsO1Snvv-_aOovfP88-w0oxPjQs4i/view":["GHB8-SQN:living","GHB8-SQN:deathPlace","GHB8-SQN:firstName","GHB8-SQN:lastName","GHB8-SQN:birthDate","GHB8-SQN:gender","GHB8-SQN:deathDate","GHB8-SQN:birthPlace","GHB8-DXY:firstName","GHB8-DXY:lastName"],"https://drive.google.com/file/d/1L4zy5f_l9gYFBQQ68WdVFLDunwFoKgru/view?side=san+agustin":["GHBD-9L6:GHB8-DXY:partner","GHB8-DXY:gender","GHB8-DXY:firstName","GHB8-DXY:lastName","GHB8-LCC:GHB8-DXY:parentChild","GHB8-LCC:gender","GHB8-LCC:firstName","GHB8-LCC:lastName","GHB8-H7K:GHB8-DXY:parentChild","GHB8-H7K:gender","GHB8-H7K:firstName","GHB8-LCC:GHB8-H7K:partner","GHB8-DXY:marriagePlace","GHB8-DXY:marriageDate"],"https://drive.google.com/file/d/19m_AfnmTfHEdEy_IsgSWB9g1tREZnoJp/view":["GHB8-DXY:living","GHB8-DXY:firstName","GHB8-DXY:lastName","GHB8-DXY:birthDate","GHB8-DXY:deathDate","GHB8-DXY:deathPlace"],"https://drive.google.com/file/d/10Z0kurjxNy0s7M0um4w5SxFMAFWA8Ivm/view":["GHB8-DXY:living","GHB8-DXY:firstName","GHB8-DXY:GHBD-9L6:partner","GHB8-DXY:birthDate","GHB8-DXY:deathDate"],"https://drive.google.com/file/d/1gKlJX95oRihP2yIJ9ukp-0gFKWAAGiIL/view":["GHB8-J1B:firstName","GHB8-J1B:lastName","GHB8-J1B:gender","GHB8-J1B:birthDate","GHB8-GB6:GHB8-J1B:parentChild","GHB8-GB6:gender","GHB8-GB6:firstName","GHB8-GB6:lastName","GHBD-9LY:GHB8-J1B:parentChild","GHBD-9LY:gender","GHBD-9LY:firstName","GHBD-9LY:lastName","GHB8-GB6:GHBD-9LY:partner"],"https://drive.google.com/file/d/1_3rvIfv82-KWjBsaZawQV4lMFUYSB_NK/view?side=maramba":["GHBD-7M4:GHB8-J1B:partner","GHB8-J1B:marriagePlace","GHB8-J1B:gender","GHB8-J1B:firstName","GHB8-J1B:middleName","GHB8-J1B:lastName","GHB8-GB6:GHB8-J1B:parentChild","GHB8-GB6:gender","GHB8-GB6:firstName","GHB8-GB6:lastName","GHBD-9LY:GHB8-J1B:parentChild","GHBD-9LY:gender","GHBD-9LY:firstName","GHBD-9LY:lastName","GHB8-GB6:GHBD-9LY:partner","GHB8-J1B:marriageDate"],"https://drive.google.com/file/d/1zjeJs9azWMLnnEjulRpAnBi8Vno4H_9U/view?side=maramba":["GHB8-J1B:marriagePlace","GHB8-J1B:marriageDate","GHB8-J1B:firstName","GHB8-J1B:middleName","GHB8-J1B:lastName"],"https://drive.google.com/file/d/1AeoNewX7fEeAaihfBI3Tz6kNA9ia0m-D/view":["GHB8-J1B:deathPlace","GHB8-GB6:deathPlace","GHBD-9LY:deathPlace","GHB8-J1B:living","GHB8-J1B:firstName","GHB8-GB6:living","GHB8-GB6:firstName","GHB8-GB6:middleName","GHB8-GB6:lastName","GHB8-GB6:suffix","GHB8-GB6:birthDate","GHB8-GB6:deathDate","GHBD-9LY:living","GHBD-9LY:firstName","GHBD-9LY:lastName","GHBD-9LY:birthDate","GHBD-9LY:deathDate"],"https://drive.google.com/file/d/15o0fdYYMYTzXQ3ikiMCOqy-YlfAND76C/view":["GHB8-GB6:firstName","GHB8-GB6:lastName","GHB8-GB6:marker","GHB8-GB6:marker2"],"https://drive.google.com/file/d/1jorhb44fg6jrJcUDctHNB2BhVGUwDki7/view":[],"https://drive.google.com/file/d/1Pn6Xvn7ucwnzTgNTcFBsQq9hzAnARp51/view":["GHB8-GB6:living","GHB8-GB6:firstName","GHB8-GB6:lastName","GHB8-GB6:deathDate","GHB8-GB6:gender","GHB8-GB6:birthDate","GHB8-GB6:marker2","GHB8-GB6:birthPlace","GHBD-9LY:GHB8-GB6:partner","GHBD-9LY:gender","GHBD-9LY:firstName","GHBD-9LY:lastName"],"https://drive.google.com/file/d/1PGx6mKequtCtKWRjEAdJ999OX78Rgmvq/view":["LLQS-641:firstName","LLQS-641:middleName","LLQS-641:lastName","LLQS-641:gender","LLQS-641:birthDate","LLQS-6YC:LLQS-641:parentChild","LLQS-6YC:firstName","LLQS-6YC:middleName","LLQS-6YC:lastName","L281-614:LLQS-641:parentChild","L281-614:firstName","L281-614:middleName","L281-614:lastName","LLQS-6YC:L281-614:partner","LLQS-6F1:LLQS-641:partner","LLQS-6F1:gender","LLQS-6F1:firstName","LLQS-6F1:lastName","LLQS-641:GHB8-GB6:parentChild","GHB8-GB6:firstName","GHB8-GB6:lastName"],"https://drive.google.com/file/d/1CNF4lEbL4vfjbhMnTOEk02KFDhaO-Xwa/view":["LLQS-641:prefix","LLQS-641:firstName","LLQS-641:lastName","LLQS-6YC:LLQS-641:parentChild","L281-614:LLQS-641:parentChild"],"https://drive.google.com/file/d/1Ik8lFHm_F4-FaKOs4qL4CNiq-Il2WfLR/view":["LLQS-641:firstName","LLQS-641:lastName","LLQS-641:marker"],"https://drive.google.com/file/d/1cIXCw6wvKrPjzTYfpAfS3ri_Ms8ihSAS/view":["LLQS-6YC:gender","LLQS-6YC:birthDate"],"https://drive.google.com/file/d/1dDJs3rrAsbMSo_qp6my6J-wxE676FMEa/view":["LLQS-6YC:gender","LLQS-6YC:firstName","LLQS-6YC:lastName","LLQS-6YC:marker","LLQS-6YC:marker2","LLQS-6YC:deathPlace","L281-614:firstName","L281-614:lastName","L281-614:gender","L281-614:deathPlace","GC7T-H59:L281-614:parentChild","GC7T-H59:firstName","GC7T-H59:lastName","GC7T-1PK:L281-614:parentChild","GC7T-1PK:firstName","GC7T-1PK:lastName","GC7T-H59:GC7T-1PK:partner"],"https://drive.google.com/file/d/1eURb38MuWvI0RVG9IaHxEzs-rOt0vBgb/view":["L281-614:gender","L281-614:birthDate","GC7T-H59:L281-614:parentChild","GC7T-H59:gender","GC7T-H59:firstName","GC7T-H59:lastName","GC7T-1PK:L281-614:parentChild","GC7T-1PK:gender","GC7T-1PK:firstName","GC7T-1PK:lastName","GC7T-H59:GC7T-1PK:partner"],"https://drive.google.com/file/d/1fU_c4Ew4h9R85zZLDe5QQR-R2DDHT1Mq/view":["GC7T-H59:birthDate"],"https://drive.google.com/file/d/1ReDCDspaaaXQ4JoLgYcEznm-bGxhzc54/view":["GC7T-H59:firstName","GC7T-H59:lastName","GC7T-H59:gender","GC7T-H59:prefix","GC7T-H59:marker","GC7T-H59:deathDate"],"https://drive.google.com/file/d/19s_gdN98AQ1sZ5lhqSf8GrpJJIpFhsdf/view":["GHB5-TWN:birthPlace","GHB5-TWN:firstName","GHB5-TWN:middleName","GHB5-TWN:lastName","GHB5-TWN:gender","GHB5-TWN:birthDate","GHB5-XTZ:GHB5-TWN:parentChild","GHB5-XTZ:gender","GHB5-XTZ:firstName","GHB5-XTZ:middleName","GHB5-XTZ:lastName","GHBR-FK3:GHB5-TWN:parentChild","GHBR-FK3:gender","GHBR-FK3:firstName","GHBR-FK3:middleName","GHBR-FK3:lastName","GHBR-FK3:marker","GHB5-XTZ:GHBR-FK3:partner","GHB5-XTZ:marriageDate","GHBR-FK3:marriageDate"],"https://drive.google.com/file/d/1JugnGovmYL6q7yhPtoovnGNcoaKR2kYa/view?side=adanza":["GHB5-TWN:GQX8-CQP:partner","GHB5-TWN:firstName","GHB5-TWN:middleName","GHB5-TWN:lastName","GHB5-TWN:gender","GHB5-XTZ:GHB5-TWN:parentChild","GHB5-XTZ:gender","GHB5-XTZ:firstName","GHB5-XTZ:middleName","GHB5-XTZ:lastName","GHBR-FK3:GHB5-TWN:parentChild","GHBR-FK3:gender","GHBR-FK3:firstName","GHBR-FK3:middleName","GHBR-FK3:lastName","GHB5-XTZ:GHBR-FK3:partner","GHB5-TWN:marriageDate","GHB5-TWN:marriagePlace"],"https://drive.google.com/file/d/1jYZqUHatNlvgDuyFw7jxSwgZsE6jy_9V/view":["GHB5-XTZ:firstName","GHB5-XTZ:middleName","GHB5-XTZ:lastName","GHB5-XTZ:gender","GHB5-XTZ:birthDate","GHB5-XTZ:birthPlace","GH12-9F6:GHB5-XTZ:parentChild","GH12-9F6:gender","GH12-9F6:firstName","GH12-9F6:lastName","GH12-SVQ:GHB5-XTZ:parentChild","GH12-SVQ:gender","GH12-SVQ:firstName","GH12-SVQ:lastName","GH12-9F6:GH12-SVQ:partner"],"https://drive.google.com/file/d/1rVr3RKFXqxPfw--yVwacLYGwyQFf6LzQ/view?side=adanza":["GHB5-XTZ:GHBR-FK3:partner","GHB5-XTZ:gender","GHB5-XTZ:firstName","GHB5-XTZ:lastName","GHB5-XTZ:birthPlace","GH12-SVQ:GHB5-XTZ:parentChild","GH12-SVQ:gender","GH12-SVQ:firstName","GH12-SVQ:lastName","GH12-9F6:GHB5-XTZ:parentChild","GH12-9F6:gender","GH12-9F6:firstName","GH12-9F6:lastName","GH12-9F6:GH12-SVQ:partner","GHB5-XTZ:marriagePlace","GHB5-XTZ:marriageDate"],"https://drive.google.com/file/d/1peIClAbyWzZV_kWcxPKAVBPDnVqFXG2Q/view":["GH12-SVQ:living","GH12-SVQ:firstName","GH12-SVQ:middleName","GH12-SVQ:lastName","GH12-SVQ:gender","GH12-SVQ:deathDate","GH12-SVQ:birthDate","GH12-SVQ:deathPlace","GH12-SVQ:marker","GH12-DRN:GH12-SVQ:parentChild","GH12-DRN:gender","GH12-DRN:firstName","GH12-DRN:lastName","GH12-3GN:GH12-SVQ:parentChild","GH12-3GN:gender","GH12-3GN:firstName","GH12-3GN:lastName"],"https://drive.google.com/file/d/1BK3uw-U_2ONst68_V7wUXFQWzzlu0pFc/view":["GH12-DRN:living","GH12-DRN:firstName","GH12-DRN:middleName","GH12-DRN:lastName","GH12-DRN:gender","GH12-DRN:birthDate","GH12-DRN:marker","GH12-DRN:deathDate","GH12-DRN:deathPlace","GH12-3GN:GH12-DRN:partner","GH12-3GN:gender","GH12-3GN:firstName","GH12-3GN:lastName","GH12-3GN:deathDate","GH12-DRN:GH12-SVQ:parentChild","GH12-SVQ:firstName","GH12-SVQ:lastName"],"https://drive.google.com/file/d/1J6wUo6AwrS5aO9LJWbh8CUReaRTkUEFF/view":["GHBR-FK3:firstName","GHBR-FK3:middleName","GHBR-FK3:lastName","GHBR-FK3:gender","GHBR-FK3:birthDate","GHBR-FK3:birthPlace","GH12-Z3C:GHBR-FK3:parentChild","GH12-Z3C:gender","GH12-Z3C:firstName","GH12-Z3C:lastName","GH12-W17:GHBR-FK3:parentChild","GH12-W17:gender","GH12-W17:firstName","GH12-W17:lastName","GH12-Z3C:GH12-W17:partner"],"https://drive.google.com/file/d/18MFv7G6xKBJj9M4ewH8a3GgcpFW4VSht/view":["GHBR-FK3:birthPlace","GHBR-FK3:firstName","GHBR-FK3:middleName","GHBR-FK3:lastName","GHBR-FK3:gender","GHBR-FK3:birthDate","GH12-Z3C:GHBR-FK3:parentChild","GH12-Z3C:gender","GH12-Z3C:firstName","GH12-Z3C:middleName","GH12-Z3C:lastName","GH12-W17:GHBR-FK3:parentChild","GH12-W17:gender","GH12-W17:firstName","GH12-W17:middleName","GH12-W17:lastName","GH12-Z3C:GH12-W17:partner","GH12-Z3C:marriageDate","GH12-Z3C:marriagePlace","GH12-W17:marriageDate","GH12-W17:marriagePlace"],"https://drive.google.com/file/d/1rVr3RKFXqxPfw--yVwacLYGwyQFf6LzQ/view?side=ajesta":["GHB5-XTZ:GHBR-FK3:partner","GHBR-FK3:gender","GHBR-FK3:firstName","GHBR-FK3:lastName","GHBR-FK3:birthPlace","GH12-Z3C:GHBR-FK3:parentChild","GH12-Z3C:gender","GH12-Z3C:firstName","GH12-Z3C:lastName","GH12-W17:GHBR-FK3:parentChild","GH12-W17:gender","GH12-W17:firstName","GH12-W17:lastName","GH12-W17:GH12-Z3C:partner","GHBR-FK3:marriagePlace","GHBR-FK3:marriageDate"],"https://drive.google.com/file/d/1u-7tnWjKdZ5-GrdLKuKi-NOAVvty25Qo/view":["GHBD-9L6:gender","GHBD-9L6:firstName","GHBD-9L6:lastName","GHBD-9L6:birthPlace","GHBD-9L6:marker2","GHB8-DXY:gender","GHB8-DXY:firstName","GHB8-DXY:lastName","GHB8-DXY:birthPlace","GHB8-DXY:marker","GHBD-9L6:GHB8-DXY:partner"],"https://drive.google.com/file/d/1g_6PxiUEuhW_jvUU3p8TySDi9u-7hlwG/view":["GNNH-JLM:firstName","GNNH-JLM:lastName","GNNH-JLM:gender","GJJX-1SG:firstName","GJJX-1SG:lastName","GJJX-1SG:gender","GNNH-JLM:GJJX-1SG:partner"],"https://drive.google.com/file/d/1n_6mEB9oGikZeRXw71-_buL1cIoT8X9p/view":["GHB8-GB6:gender","GHB8-GB6:firstName","GHB8-GB6:middleName","GHB8-GB6:lastName","GHBD-9LY:gender","GHBD-9LY:firstName","GHBD-9LY:lastName","GHB8-GB6:GHBD-9LY:partner"],"https://drive.google.com/file/d/1EZnFrq2uHZVgfDSItdUrxBqy7Wzkto7o/view":["LLQS-641:LLQS-6F1:partner","LLQS-641:firstName","LLQS-641:lastName","LLQS-641:gender","LLQS-6F1:firstName","LLQS-6F1:lastName","LLQS-6F1:gender","L281-614:LLQS-641:parentChild","L281-614:firstName","L281-614:lastName","L281-614:gender","G7C3-B6P:LLQS-6F1:parentChild","G7C3-B6P:firstName","G7C3-B6P:gender","G7C3-J9S:LLQS-6F1:parentChild","G7C3-J9S:firstName","G7C3-J9S:lastName","G7C3-J9S:gender","G7C3-B6P:G7C3-J9S:partner"],"https://www.familysearch.org/ark:/61903/1:1:HBP6-8VZM":["GHB8-M8D:firstName","GHB8-M8D:lastName","GHB8-M8D:gender","GHB8-M86:firstName","GHB8-M86:lastName","GHB8-M86:gender","GHB8-M8D:GHB8-M86:partner"],"https://www.familysearch.org/ark:/61903/1:1:6JG6-3YRH":["GH12-XX4:firstName","GH12-XX4:gender","GH12-HQN:firstName","GH12-HQN:lastName","GH12-HQN:gender","GKBR-M9Y:firstName","GKBR-M9Y:lastName","GKBR-7P7:firstName","GKBR-7P7:lastName","GKBR-7P7:gender","GKBT-9GD:firstName","GKBT-9GD:lastName","K2GJ-YY3:firstName","K2GJ-YY3:lastName","K2GJ-YY3:gender","GH12-XX4:GH12-HQN:partner","GKBT-9GD:GH12-HQN:parentChild","GKBR-M9Y:GH12-XX4:parentChild"],"https://www.familysearch.org/ark:/61903/1:1:HBBS-S7W2":["GHBZ-TM4:firstName","GHBZ-TM4:lastName","GHBZ-TM4:gender","GHBZ-P5Q:firstName","GHBZ-P5Q:lastName","GHBZ-P5Q:gender","GHBZ-TM4:GHBZ-P5Q:partner"],"https://drive.google.com/file/d/13-RZPCmG9h3jLf4L-8yMIl7Fi-jdiAbg/view":["GHBD-7M4:birthDate","GHBD-7M4:birthPlace"],"https://drive.google.com/file/d/1irYmUaWoR44n7p-33kxmaI0H9HkWqDrY/view?side=ajesta":["GH12-XX4:gender","GH12-XX4:firstName","GH12-XX4:lastName","GH12-XX4:birthDate","GKBR-M9Y:GH12-XX4:parentChild","GKBR-M9Y:gender","GKBR-M9Y:firstName","GKBR-M9Y:lastName","GKBR-7P7:GH12-XX4:parentChild","GKBR-7P7:gender","GKBR-7P7:firstName","GKBR-7P7:lastName","GKBR-M9Y:GKBR-7P7:partner","GH12-XX4:marriagePlace","GH12-XX4:marriageDate"],"https://drive.google.com/file/d/1irYmUaWoR44n7p-33kxmaI0H9HkWqDrY/view?side=badoles":["GH12-HQN:gender","GH12-HQN:firstName","GH12-HQN:lastName","GH12-HQN:birthDate","GKBT-9GD:GH12-HQN:parentChild","GKBT-9GD:gender","GKBT-9GD:firstName","GKBT-9GD:lastName","K2GJ-YY3:GH12-HQN:parentChild","K2GJ-YY3:gender","K2GJ-YY3:firstName","K2GJ-YY3:lastName","GKBT-9GD:K2GJ-YY3:partner","GH12-HQN:marriagePlace","GH12-HQN:marriageDate"],"https://drive.google.com/file/d/1BKgRfbr-OYGuVgyYOxQR-_QlBhZ9tfRg/view":["GH12-9JZ:firstName","GH12-9JZ:lastName","GH12-9JZ:deathDate","GH12-9JZ:marker","GH12-9JZ:prefix","GH12-9JZ:gender"]};var isChecking=isDebugging||"true"==window.location.get("check"),KEYS_IN_SOURCE="";for(const[JM1,KM1]of Object.entries(SOURCES))KEYS_IN_SOURCE+=KM1.toString();var KEYS_IN_SENTIMENT_SOURCE="";for(const[i,LM1]of Object.entries(SOURCES["SENTIMENTS OF LIVING RELATIVES"]))KEYS_IN_SENTIMENT_SOURCE+=LM1.toString();function isEmpty(t){return null==t||""===t.trim()}function checkPerPerson(s){let n=0,a=0,r=0;var o=[],l=["key","fid","vitalsCompleteAndVerified","useNonePhoto","generation","hasImage","hasDNA","height","width","parent","hasStories","detailsRow1","detailsRow2","detailsRow3","detailsRow4","basicName","fullName","nickname","living","livingPlace"];for(let t=1;t<=4;t++){var e=1==t?"marker":"marker"+t;if("book"==s[e]){l.push(e);break}}s.living&&(l.push("deathDate"),l.push("deathPlace"),l.push("deathAge"),a+=4,r+=4),null===s.deathAge&&(l.push("deathAge"),a+=1,r+=1);var t,i,h,u;for([t,i]of Object.entries(["prefix","middleName","lastName","suffix","birthDate","birthPlace","baptismDate","marriageDate","marriagePlace","deathDate","deathPlace","twin","marker","marker2","marker3","partner"]))isEmpty(s[i])&&l.push(i);for([h,u]of Object.entries(s)){var d;let t=s.fid+":"+h,e=null,i=("child"==h&&(d=treeToFid[u],t=`${d}:${s.fid}:parentChild`,e=s.fid+`:${d}:parentChild`),"partner"==h&&(d=treeToFid[u],t=`${d}:${s.fid}:partner`,e=s.fid+`:${d}:partner`),0);"hasImage"==h&&(i+=1),i=(i+=KEYS_IN_SOURCE.occurrences(t))+KEYS_IN_SOURCE.occurrences(e);var c=String(u),g=(isEmpty(c)&&0!=i&&(n+=1,console.invalid("Found source for empty field: "+(t||e))),c.includes("before")||c.includes("after")||c.includes("about")||c.includes("from"));g&&0!=i&&(n+=1,console.warning(`Found source for estimated field: ${t||e}. Value: `+c)),l.includes(h)||(a+=i,r+=1,i<=0?o.push(h):1e.sourcePercentage-t.sourcePercentage);for([d,c]of Object.entries(f)){var A=c.sourceCount,x=c.expectedSourceCount,b=c.unverifiedAttributes,w=""+String(A).padStart(2,"0"),P=""+String(x).padStart(2,"0");if(x<=A)p.push(c.fullName),console.valid(w+` / ${P} checks passed for `+c.fullName);else if(0null===t;function calculatePhotoScale(t){if(t.useNonePhoto)return.3;var{birthPlace:e,deathPlace:i,marriagePlace:s}=t;let n=[e,i,s].filter(isNull).length;switch(n=t.hasImage&&void 0!==t.fid?n:4*(n+1)){case 0:return.155256;case 1:return.134001;case 2:return.109788;case 3:return.091757;case 4:return.63904221;case 8:return.57759585;case 12:return.47322855;case 16:return.395508;default:return 1}return null==t.birthPlace&&null==t.deathPlace?t.hasImage?.0997876967625:.3955:null==t.birthPlace&&null!=t.deathPlace||null!=t.birthPlace&&null==t.deathPlace?t.hasImage?.1340006180575:.5311:null!=t.birthPlace&&null!=t.deathPlace?t.hasImage?.1482559999887:.5876:1}function marginConditions(t){new bino.Margin(2,0,0,2);return{fishery:new bino.Margin(2,0,0,2.7),prelations:new bino.Margin(3,0,0,2),intelligence:new bino.Margin(1.95,0,0,1.85),military:new bino.Margin(.9,0,0,1.1),sergeant:new bino.Margin(0,0,0,.35),housewife:new bino.Margin(1.8,0,0,1.5),househusband:new bino.Margin(1.8,0,0,1.5),farming:new bino.Margin(2.25,0,0,1.95),"male-twin":new bino.Margin(0,0,0,2),"female-twin":new bino.Margin(0,0,0,2),train:new bino.Margin(3,0,0,2),cattle:new bino.Margin(-.25,0,0,.75),sales:new bino.Margin(3,0,0,2.5)}[t]||new bino.Margin(2,0,0,2)}template.GenderBand=function(){return $(bino.Shape,{margin:new bino.Margin(0,0,0,ui.measure.node.height-1),figure:"Rectangle",stroke:null,strokeWidth:0},new bino.Binding("desiredSize","",function(t){return new bino.Size(ui.measure.genderBand.width,t.height)}),new bino.Binding("fill","",function(t){return"M"==t.gender.toUpperCase()?ui.color.male:ui.color.female}))},template.DNAMarker=function(){return $(bino.Panel,new bino.Binding("margin","",function(t){var e=ui.measure.marker.margin;return new bino.Margin(e,0,0,ui.measure.node.widths[t.generation]-(ui.measure.marker.width+ui.measure.marker.margin))}),new bino.Binding("visible","",function(t){return void 0!==t.hasDNA&&t.hasDNA}),$(bino.Shape,{figure:"Circle",stroke:null,width:ui.measure.marker.width-2},new bino.Binding("margin","",function(t){return new bino.Margin(1.2,0,0,1.2)}),new bino.Binding("fill","",function(t){return ui.color.marker.background.dna})),$(bino.Picture,{scale:ui.measure.marker.scale},new bino.Binding("source","",function(t){return void 0===t.hasDNA?"":MARKERS.dna}),new bino.Binding("margin","",function(t){return new bino.Margin(2,0,0,2)})))},template.FirstMarker=function(){return $(bino.Panel,new bino.Binding("margin","",function(t){let e=ui.measure.marker.margin+(ui.measure.marker.width+ui.measure.marker.margin)-3;return t.hasDNA||(e=ui.measure.marker.margin),new bino.Margin(e,0,0,ui.measure.node.widths[t.generation]-(ui.measure.marker.width+ui.measure.marker.margin))}),new bino.Binding("visible","",function(t){return void 0!==t.marker}),$(bino.Shape,{figure:"Circle",stroke:null,width:ui.measure.marker.width-2},new bino.Binding("margin","",function(t){return new bino.Margin(1.2,0,0,1.2)}),new bino.Binding("fill","",function(t){return void 0!==ui.color.marker.background[t.marker]?ui.color.marker.background[t.marker]:ui.color.marker.background.default})),$(bino.Picture,{scale:ui.measure.marker.scale},new bino.Binding("source","",function(t){return void 0===t.marker?"":MARKERS[t.marker]}),new bino.Binding("margin","",function(t){return marginConditions(t.marker)})))},template.SecondMarker=function(){return $(bino.Panel,new bino.Binding("margin","",function(t){var e=ui.measure.marker.margin+(ui.measure.marker.width+ui.measure.marker.margin)-3;return new bino.Margin(e,0,0,ui.measure.node.widths[t.generation]-(ui.measure.marker.width+ui.measure.marker.margin))}),new bino.Binding("visible","",function(t){return void 0!==t.marker2&&!t.hasDNA}),$(bino.Shape,{figure:"Circle",stroke:null,width:ui.measure.marker.width-2},new bino.Binding("margin","",function(t){return new bino.Margin(1.2,0,0,1.2)}),new bino.Binding("fill","",function(t){return void 0!==ui.color.marker.background[t.marker2]?ui.color.marker.background[t.marker2]:ui.color.marker.background.default})),$(bino.Picture,{scale:ui.measure.marker.scale},new bino.Binding("source","",function(t){return void 0===t.marker2?"":MARKERS[t.marker2]}),new bino.Binding("margin","",function(t){return marginConditions(t.marker2)})))},template.ThirdMarker=function(){return $(bino.Panel,new bino.Binding("margin","",function(t){var e=ui.measure.marker.margin+2*(ui.measure.marker.width+ui.measure.marker.margin-3);return new bino.Margin(e,0,0,ui.measure.node.widths[t.generation]-(ui.measure.marker.width+ui.measure.marker.margin))}),new bino.Binding("visible","",function(t){return void 0!==t.marker3}),$(bino.Shape,{figure:"Circle",stroke:null,width:ui.measure.marker.width-2},new bino.Binding("margin","",function(t){return new bino.Margin(1.2,0,0,1.2)}),new bino.Binding("fill","",function(t){return void 0!==ui.color.marker.background[t.marker3]?ui.color.marker.background[t.marker3]:ui.color.marker.background.default})),$(bino.Picture,{scale:ui.measure.marker.scale},new bino.Binding("source","",function(t){return void 0===t.marker3?"":MARKERS[t.marker3]}),new bino.Binding("margin","",function(t){return marginConditions(t.marker3)})))},template.FourthMarker=function(){return $(bino.Panel,new bino.Binding("margin","",function(t){var e=ui.measure.marker.margin+3*(ui.measure.marker.width+ui.measure.marker.margin-3);return new bino.Margin(e,0,0,ui.measure.node.widths[t.generation]-(ui.measure.marker.width+ui.measure.marker.margin))}),new bino.Binding("visible","",function(t){return void 0!==t.marker4}),$(bino.Shape,{figure:"Circle",stroke:null,width:ui.measure.marker.width-2},new bino.Binding("margin","",function(t){return new bino.Margin(1.2,0,0,1.2)}),new bino.Binding("fill","",function(t){return void 0!==ui.color.marker.background[t.marker4]?ui.color.marker.background[t.marker4]:ui.color.marker.background.default})),$(bino.Picture,{scale:ui.measure.marker.scale},new bino.Binding("source","",function(t){return void 0===t.marker4?"":MARKERS[t.marker4]}),new bino.Binding("margin","",function(t){return marginConditions(t.marker4)})))},template.Name=function(){return $(bino.TextBlock,{font:`700 ${ui.font.size.name}px Google Sans, sans-serif`,height:ui.font.size.name+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(ui.measure.node.padding,0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return(t.firstName.includes("known")?ui.color.node.nameless:ui.color.node).name}),new bino.Binding("text","",function(t){return t.fullName}))},template.DetailRow1=function(){return $(bino.Panel,$(bino.TextBlock,{font:`400 ${ui.font.size.details}px "Google Sans Text", sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(24+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.text}),new bino.Binding("text","",function(t){return t.detailsRow1.text||""})),$(bino.TextBlock,{font:`700 ${ui.font.size.details}px Google Sans, sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(24+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.letter}),new bino.Binding("text","",function(t){return t.detailsRow1.letter?""+t.detailsRow1.letter:""})))},template.DetailRow2=function(){return $(bino.Panel,$(bino.TextBlock,{font:`400 ${ui.font.size.details}px "Google Sans Text", sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-33}),new bino.Binding("margin","",function(t){t="M"==t.detailsRow2.letter||"M"==t.detailsRow3.letter?13:11;return new bino.Margin(39+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details+t)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.text}),new bino.Binding("text","",function(t){return t.detailsRow2.text?": "+t.detailsRow2.text:""})),$(bino.TextBlock,{font:`700 ${ui.font.size.details}px Google Sans, sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(39+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.letter}),new bino.Binding("text","",function(t){return t.detailsRow2.letter?""+t.detailsRow2.letter:""})))},template.DetailRow3=function(){return $(bino.Panel,$(bino.TextBlock,{font:`400 ${ui.font.size.details}px "Google Sans Text", sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-33}),new bino.Binding("margin","",function(t){t="M"==t.detailsRow2.letter||"M"==t.detailsRow3.letter?13:11;return new bino.Margin(54.5+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details+t)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.text}),new bino.Binding("text","",function(t){return t.detailsRow3.text?": "+t.detailsRow3.text:""})),$(bino.TextBlock,{font:`700 ${ui.font.size.details}px Google Sans, sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(54.5+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.letter}),new bino.Binding("text","",function(t){return t.detailsRow3.letter?""+t.detailsRow3.letter:""})))},template.DetailRow4=function(){return $(bino.Panel,$(bino.TextBlock,{font:`400 ${ui.font.size.details}px "Google Sans Text", sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-33}),new bino.Binding("margin","",function(t){t="M"==t.detailsRow2.letter||"M"==t.detailsRow3.letter?13:11;return new bino.Margin(70+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details+t)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.text}),new bino.Binding("text","",function(t){return t.detailsRow4.text?": "+t.detailsRow4.text:""})),$(bino.TextBlock,{font:`700 ${ui.font.size.details}px Google Sans, sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(70+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.letter}),new bino.Binding("text","",function(t){return t.detailsRow4.letter?""+t.detailsRow4.letter:""})))};var tree=$(bino.Diagram,"tree",{isReadOnly:!0,padding:ui.measure.padding,scale:ui.scale,layout:$(bino.TreeLayout,{angle:0,layerSpacing:Math.max(parseInt(4*ui.measure.node.margin),20),nodeSpacing:ui.measure.node.margin}),hasHorizontalScrollbar:!1,hasVerticalScrollbar:!1,allowHorizontalScroll:!0,allowSelect:!1,allowVerticalScroll:!0,allowZoom:!0});tree.nodeTemplate=$(bino.Node,{selectable:!1,click:(t,e)=>{showSidebar(e)},mouseEnter:(t,e)=>{STORIES[e.data.fid]&&(!isPrivate||isPrivate&&!e.data.living)&&(e.cursor="pointer")},mouseLeave:(t,e)=>{STORIES[e.data.fid]&&(!isPrivate||isPrivate&&!e.data.living)&&(e.cursor="")}},new bino.Binding("height","height"),new bino.Binding("width","width"),template.Node(),template.Photo(),template.Name(),template.DetailRow1(),template.DetailRow2(),template.DetailRow3(),template.DetailRow4(),template.DNAMarker(),template.FirstMarker(),template.SecondMarker(),template.ThirdMarker(),template.FourthMarker(),template.GenderBand(),template.CheckFill(),template.TopLeftBorderRadius(),template.BottomLeftBorderRadius()),tree.linkTemplate=template.Link();let model=$(bino.TreeModel);model.nodeDataArray=TREE_DATA,tree.model=model,window.onload=function(){for(let t=0;t{var t=window.location.get("id"),e=document.getElementById("personDetailsDesc");localStorage.setItem(`family-tree-id-${t}-scroll`,e.scrollTop),removeQueryParam("id")})}; \ No newline at end of file + `,r=!0)}a+="
    ";var u=STORIES[i.data.fid].stories.replace(/\$\{([^}]+)\}/g,(t,e)=>void 0!==i.data[e]?i.data[e]:t);a+=u,e.innerHTML=a,t.appendChild(e)}function adjustBrightness(e,i){4===e.length&&(e="#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]);let s="#";for(let t=1;t<7;t+=2){var n=parseInt(e.substr(t,2),16),n=Math.min(255,Math.max(0,Math.floor(n*(1+i/100))));s+=("0"+n.toString(16)).slice(-2)}return s}TREE_DATA.forEach(t=>{treeToFid[t.key]=t.fid,t.child&&(childToParents[t.child]?childToParents[t.child].push(t.key):childToParents[t.child]=[t.key])}),TREE_DATA.forEach(e=>{e.partner=null,e.child&&1t!==e.key))});const SOURCES={"Present and Direct Interactions - by Arbyn Argabioso":["TEMP-000:GHB5-TWN:parentChild","TEMP-000:GQX8-CQP:parentChild","GHB5-TWN:marker","GQJK-LCT:deathPlace","GQX8-CQP:marker","GQX8-CQP:marker3","GQJK-G8W:marker","GQJK-L51:marker","GQJK-L51:marker3","GHB5-XTZ:marker","GHB5-XTZ:marker2","GHB5-XTZ:marker3","GHBR-FK3:marker","GHBR-FK3:marker2","GHBR-FK3:marker3","GH12-W17:deathDate","GH12-W17:deathPlace","GH12-W17:living"],"SENTIMENTS OF LIVING RELATIVES":["GHBZ-TM4:birthPlace","GHB8-RCH:birthPlace","GHBZ-YVX:marker","GHBZ-YVX:marker3","GHB8-J1B:marker","GHBD-7M4:marker2","GHB8-J1B:deathDate","GH12-SVQ:firstName","GH12-SVQ:lastName","GH12-SVQ:birthPlace","GHBZ-P5Q:living","GHB8-7T6:middleName","GHB8-7T6:birthDate","GHB8-7T6:birthPlace","GHB8-7T6:deathDate","GHB8-7T6:deathPlace","GHB8-7T6:living","GHB8-7T6:marker","GHB8-GZL:middleName","GHB8-GZL:lastName","GHB8-GZL:birthDate","GHB8-GZL:birthPlace","GHB8-GZL:deathDate","GHB8-GZL:deathPlace","GHB8-GZL:living","GNNH-JLM:firstName","GNNH-JLM:lastName","GNNH-JLM:gender","GNNH-JLM:GHB8-7T6:parentChild","GJJX-1SG:firstName","GJJX-1SG:lastName","GJJX-1SG:gender","GJJX-1SG:GHB8-7T6:parentChild","GNNH-JLM:GJJX-1SG:partner","GHB8-M8D:firstName","GHB8-M8D:lastName","GHB8-M8D:gender","GHB8-M8D:GHB8-GZL:parentChild","GHB8-M86:firstName","GHB8-M86:lastName","GHB8-M86:gender","GHB8-M86:GHB8-GZL:parentChild","GHB8-M8D:GHB8-M86:partner","GH12-DRN:firstName","GH12-DRN:lastName","GH12-DRN:birthPlace","GH12-3GN:firstName","GH12-3GN:lastName","GH12-DRN:GH12-SVQ:parentChild","GH12-3GN:GH12-SVQ:parentChild","GH12-9JZ:firstName","GH12-9JZ:lastName","GH12-35H:firstName","GH12-35H:lastName","GH12-9JZ:GH12-9F6:parentChild","GH12-35H:GH12-9F6:parentChild","GH12-XX4:firstName","GH12-XX4:lastName","GH12-HQN:firstName","GH12-HQN:lastName","GH12-6YL:firstName","GH12-6YL:lastName","GH12-DD8:firstName","GH12-DD8:lastName","GH12-HQN:GH12-Z3C:parentChild","GH12-W17:marker","GH12-Z3C:living","GHBD-9LY:birthPlace","GHBD-9LY:marker","GHBD-9LY:marker2","LLQS-641:firstName","LLQS-641:GHB8-GB6:parentChild","TEMP-001:GHBD-9LY:parentChild"],"Existance of same-name son":["GHBD-9L6:suffix","GHB8-GB6:suffix"],"Existance of same-name father":["GHBD-7M4:suffix"],"PROBABLY NOT LIVING ANYMORE":["GHBZ-TM4:living","GHB8-RCH:living","G2HQ-YQS:living","G2H7-Q75:living","GNNH-JLM:living","GJJX-1SG:living","GHB8-M8D:living","GHB8-M86:living","GHB8-SQN:living","GHB8-5K8:living","GHB8-LCC:living","GHB8-H7K:living","LLQS-641:living","LLQS-6YC:living","L281-614:living","GC7T-H59:living","GC7T-1PK:living","LLQS-6F1:living","G7C3-B6P:living","G7C3-J9S:living","TEMP-001:living","GKBR-M9Y:living","GKBR-7P7:living","GKBT-9GD:living","K2GJ-YY3:living"],"https://drive.google.com/file/d/1B1umw_xm5i-AmNp9YzshX2DebSAhj3cz/view":["GQX8-CQP:birthPlace","GQX8-CQP:firstName","GQX8-CQP:middleName","GQX8-CQP:gender","GQX8-CQP:birthDate","GQJK-G8W:GQX8-CQP:parentChild","GQJK-G8W:gender","GQJK-G8W:firstName","GQJK-G8W:middleName","GQJK-G8W:lastName","GQJK-G8W:marker","GQJK-L51:GQX8-CQP:parentChild","GQJK-L51:gender","GQJK-L51:firstName","GQJK-L51:middleName","GQJK-L51:lastName","GQJK-L51:GQJK-G8W:partner"],"https://drive.google.com/file/d/1nJVXB-p0ZM0OUXsXK4TyI7JRwvbDln53/view":["GQX8-CQP:firstName","GQX8-CQP:middleName","GQX8-CQP:lastName","GQX8-CQP:birthDate","GQX8-CQP:baptismDate","GQJK-G8W:GQX8-CQP:parentChild","GQJK-G8W:gender","GQJK-G8W:firstName","GQJK-G8W:lastName","GQJK-G8W:birthPlace","GQJK-L51:GQX8-CQP:parentChild","GQJK-L51:gender","GQJK-L51:firstName","GQJK-L51:lastName","GQJK-L51:birthPlace","GQJK-L51:GQJK-G8W:partner"],"https://drive.google.com/file/d/1JugnGovmYL6q7yhPtoovnGNcoaKR2kYa/view?side=argabioso":["GQX8-CQP:GHB5-TWN:partner","GQX8-CQP:gender","GQX8-CQP:firstName","GQX8-CQP:middleName","GQX8-CQP:lastName","GQJK-G8W:GQX8-CQP:parentChild","GQJK-G8W:gender","GQJK-G8W:firstName","GQJK-G8W:middleName","GQJK-G8W:lastName","GQJK-L51:GQX8-CQP:parentChild","GQJK-L51:gender","GQJK-L51:firstName","GQJK-L51:middleName","GQJK-L51:lastName","GQJK-G8W:GQJK-L51:partner","GQX8-CQP:marriageDate","GQX8-CQP:marriagePlace"],"https://www.facebook.com/arbyn.argabioso/posts/pfbid02U3X7BU11Lb41vrbLQKrAyGe8oCEvd8SSqbY8rcCZ2MEQzcb3BUQJWL8UPhF1ZttYl":["GQX8-CQP:GHB5-TWN:partner"],"https://www.youtube.com/watch?v=LNkv-M1TMtg":["GQX8-CQP:GHB5-TWN:partner"],"https://drive.google.com/file/d/1degLEAa8cBBxJrRsWwz0t6wHh9vs29cH/view":["GQJK-L51:birthPlace","GQJK-L51:firstName","GQJK-L51:middleName","GQJK-L51:lastName","GQJK-L51:gender","GQJK-L51:birthDate","GQJK-LCT:GQJK-L51:parentChild","GQJK-LCT:gender","GQJK-LCT:firstName","GQJK-LCT:middleName","GQJK-LCT:lastName","GQJK-LCT:birthPlace","GHBZ-YVX:GQJK-L51:parentChild","GHBZ-YVX:gender","GHBZ-YVX:firstName","GHBZ-YVX:middleName","GHBZ-YVX:lastName","GHBZ-YVX:birthPlace","GQJK-LCT:GHBZ-YVX:partner","GQJK-LCT:marriageDate","GQJK-LCT:marriagePlace","GHBZ-YVX:marriageDate","GHBZ-YVX:marriagePlace"],"https://drive.google.com/file/d/1kMHiW0mbPuPGyGOBm08qY6yWgvnHd82K/view":["GQJK-L51:gender","GQJK-L51:firstName","GQJK-L51:middleName","GQJK-L51:lastName","GQJK-L51:birthDate","GQJK-L51:birthPlace","GQJK-LCT:GQJK-L51:parentChild","GQJK-LCT:gender","GQJK-LCT:firstName","GQJK-LCT:middleName","GQJK-LCT:lastName","GHBZ-YVX:GQJK-L51:parentChild","GHBZ-YVX:gender","GHBZ-YVX:firstName","GHBZ-YVX:middleName","GHBZ-YVX:lastName","GQJK-LCT:GHBZ-YVX:partner","GQJK-L51:marriagePlace","GQJK-L51:marriageDate"],"https://drive.google.com/file/d/1Zw8fzrh9ELRvIx1W7ncqT010edcT6hpK/view":["GQJK-L51:marker","GQJK-L51:marker3","GQJK-L51:firstName","GQJK-L51:lastName"],"https://drive.google.com/file/d/1C2TFs8kVvf6lWq-ANjEEG165f7bWUZCs/view?side=argabioso":["GQJK-LCT:GHBZ-YVX:partner","GQJK-LCT:marriagePlace","GQJK-LCT:gender","GQJK-LCT:firstName","GQJK-LCT:lastName","GHBZ-TM4:GQJK-LCT:parentChild","GHBZ-TM4:gender","GHBZ-TM4:firstName","GHBZ-TM4:lastName","GHBZ-P5Q:GQJK-LCT:parentChild","GHBZ-P5Q:gender","GHBZ-P5Q:firstName","GHBZ-P5Q:lastName","GHBZ-TM4:GHBZ-P5Q:partner","GQJK-LCT:marriageDate"],"https://drive.google.com/file/d/1tu21m1RMRjiTwPfzp1VrFENbPUhLsEKq/view":["GQJK-LCT:firstName","GQJK-LCT:lastName","GHBZ-TM4:firstName","GHBZ-TM4:lastName"],"https://drive.google.com/file/d/1x1M6Z1asZU99nMTdtKYdfDxY_w_s2Gnc/view":["GQJK-LCT:living","GQJK-LCT:firstName","GQJK-LCT:middleName","GQJK-LCT:lastName","GQJK-LCT:birthDate","GQJK-LCT:deathDate","GQJK-LCT:gender"],"https://drive.google.com/file/d/1SQy34nGR1Z5-AqNSZDInfkewArzP_xqp/view":["GHBZ-TM4:living","GHBZ-TM4:deathPlace","GHBZ-TM4:firstName","GHBZ-TM4:middleName","GHBZ-TM4:lastName","GHBZ-TM4:deathDate","GHBZ-TM4:gender","GHBZ-P5Q:living","GHBZ-TM4:birthDate","GHBZ-TM4:marker","GHBZ-TM4:birthPlace","GHB8-RCH:GHBZ-TM4:parentChild","GHB8-RCH:gender","GHB8-RCH:firstName","GHB8-RCH:lastName"],"https://drive.google.com/file/d/1yf_M5CJgnXsHGFvFmF5Uzfp4YrsAnfUY/view":["GHB8-RCH:living","GHB8-RCH:deathPlace","GHB8-RCH:firstName","GHB8-RCH:lastName","GHB8-RCH:gender","GHB8-RCH:deathDate","GHB8-RCH:birthDate","GHB8-RCH:birthPlace"],"https://drive.google.com/file/d/1_QL_-c5uIfBH8s0Y4ptLHaftJutdnW7Q/view":["G2HQ-YQS:GHB8-RCH:parentChild","G2HQ-YQS:firstName","G2HQ-YQS:lastName","G2HQ-YQS:gender","G2H7-Q75:GHB8-RCH:parentChild","G2H7-Q75:firstName","G2H7-Q75:lastName","G2H7-Q75:gender","G2HQ-YQS:G2H7-Q75:partner"],"https://www.familysearch.org/ark:/61903/1:1:66X6-LG3J":["G2HQ-YQS:GHB8-RCH:parentChild","G2HQ-YQS:firstName","G2HQ-YQS:lastName","G2HQ-YQS:gender","G2H7-Q75:GHB8-RCH:parentChild","G2H7-Q75:firstName","G2H7-Q75:lastName","G2H7-Q75:gender","G2HQ-YQS:G2H7-Q75:partner"],"https://drive.google.com/file/d/1Yy9S1Y4NOilHHulCeejkeeY1BUbzgRyn/view":["GHBZ-YVX:firstName","GHBZ-YVX:middleName","GHBZ-YVX:lastName","GHBZ-YVX:gender","GHBZ-YVX:birthDate","GHBZ-YVX:birthPlace","GHBZ-YVX:living","GHB8-GZL:GHBZ-YVX:parentChild","GHB8-GZL:gender","GHB8-GZL:firstName","GHB8-GZL:middleName","GHB8-GZL:lastName","GHB8-GZL:marker","GHB8-7T6:GHBZ-YVX:parentChild","GHB8-7T6:gender","GHB8-7T6:firstName","GHB8-7T6:middleName","GHB8-7T6:lastName","GHB8-7T6:marker","GHB8-7T6:GHB8-GZL:partner","GQJK-LCT:GHBZ-YVX:partner"],"https://drive.google.com/file/d/1C2TFs8kVvf6lWq-ANjEEG165f7bWUZCs/view?side=saplala":["GQJK-LCT:GHBZ-YVX:partner","GHBZ-YVX:marriagePlace","GHBZ-YVX:gender","GHBZ-YVX:firstName","GHBZ-YVX:lastName","GHB8-7T6:GHBZ-YVX:parentChild","GHB8-7T6:gender","GHB8-7T6:firstName","GHB8-7T6:lastName","GHB8-GZL:GHBZ-YVX:parentChild","GHB8-GZL:gender","GHB8-GZL:firstName","GHB8-GZL:lastName","GHB8-7T6:GHB8-GZL:partner","GHBZ-YVX:marriageDate"],"https://drive.google.com/file/d/1Db5lGDp-mhJH7LAXnuijFXBc1c1vA07j/view":["GQJK-G8W:birthPlace","GQJK-G8W:firstName","GQJK-G8W:middleName","GQJK-G8W:lastName","GQJK-G8W:birthDate","GHBD-7M4:GQJK-G8W:parentChild","GHBD-7M4:firstName","GHBD-7M4:middleName","GHBD-7M4:lastName","GHBD-7M4:birthPlace","GHBD-7M4:marker2","GHB8-J1B:GQJK-G8W:parentChild","GHB8-J1B:firstName","GHB8-J1B:middleName","GHB8-J1B:lastName","GHB8-J1B:birthPlace","GHBD-7M4:GHB8-J1B:partner","GHBD-7M4:marriageDate","GHBD-7M4:marriagePlace","GHB8-J1B:marriageDate","GHB8-J1B:marriagePlace"],"https://drive.google.com/file/d/1yqWECbcDTyhFig6IiK_AqPwXfL7gk0e0/view":["GQJK-G8W:firstName","GQJK-G8W:lastName","GQJK-G8W:birthDate","GQJK-G8W:baptismDate","GHBD-7M4:GQJK-G8W:parentChild","GHBD-7M4:gender","GHBD-7M4:firstName","GHBD-7M4:lastName","GHBD-7M4:birthPlace","GHB8-J1B:GQJK-G8W:parentChild","GHB8-J1B:gender","GHB8-J1B:firstName","GHB8-J1B:lastName","GHB8-J1B:birthPlace"],"https://drive.google.com/file/d/17vMMCyBJ2qOyjFYCtb7UWkIJrRymiz8_/view":["GQJK-G8W:gender","GQJK-G8W:firstName","GQJK-G8W:middleName","GQJK-G8W:lastName","GQJK-G8W:birthPlace","GHBD-7M4:GQJK-G8W:parentChild","GHBD-7M4:gender","GHBD-7M4:firstName","GHBD-7M4:lastName","GHB8-J1B:GQJK-G8W:parentChild","GHB8-J1B:gender","GHB8-J1B:firstName","GHB8-J1B:lastName","GHBD-7M4:GHB8-J1B:partner","GQJK-G8W:marriagePlace","GQJK-G8W:marriageDate"],"https://drive.google.com/file/d/1JArFl6_m-kuvyPf-LqDLU3_SapZzCvkt/view":["GQJK-G8W:living","GQJK-G8W:firstName","GQJK-G8W:lastName","GQJK-G8W:gender","GQJK-G8W:deathDate","GQJK-G8W:birthDate","GQJK-G8W:deathPlace"],"https://drive.google.com/file/d/1sIWWgh8zfcIYtQfk2rIm4iW97sGzgK-x/view":["GQJK-G8W:living","GQJK-G8W:firstName","GQJK-G8W:middleName","GQJK-G8W:lastName","GQJK-G8W:birthDate","GQJK-G8W:deathDate"],"https://drive.google.com/file/d/1_3rvIfv82-KWjBsaZawQV4lMFUYSB_NK/view?side=acosta":["GHBD-7M4:GHB8-J1B:partner","GHBD-7M4:marriagePlace","GHBD-7M4:gender","GHBD-7M4:firstName","GHBD-7M4:lastName","GHBD-7M4:suffix","GHBD-9L6:GHBD-7M4:parentChild","GHBD-9L6:gender","GHBD-9L6:firstName","GHBD-9L6:lastName","GHB8-DXY:GHBD-7M4:parentChild","GHB8-DXY:gender","GHB8-DXY:firstName","GHB8-DXY:lastName","GHBD-9L6:GHB8-DXY:partner","GHBD-7M4:marriageDate"],"https://drive.google.com/file/d/1zjeJs9azWMLnnEjulRpAnBi8Vno4H_9U/view?side=acosta":["GHBD-7M4:marriagePlace","GHBD-7M4:marriageDate","GHBD-7M4:firstName","GHBD-7M4:middleName","GHBD-7M4:lastName"],"https://drive.google.com/file/d/194CO9-EnmMLwhHPGe0qTO1d3G7HGtTZl/view":["GHBD-7M4:living","GHBD-7M4:firstName","GHBD-7M4:middleName","GHBD-7M4:lastName","GHBD-7M4:suffix","GHBD-7M4:birthDate","GHBD-7M4:birthPlace","GHBD-7M4:deathDate","GHBD-7M4:deathPlace","GHBD-9L6:GHBD-7M4:parentChild","GHBD-9L6:firstName","GHBD-9L6:lastName","GHBD-9L6:gender","GHBD-9L6:birthPlace","GHB8-DXY:GHBD-7M4:parentChild","GHB8-DXY:firstName","GHB8-DXY:gender","GHB8-DXY:birthPlace","GHBD-9L6:GHB8-DXY:partner"],"https://drive.google.com/file/d/1Yclt46UY9IV4Pp4xyfuZitegj4B5iXN7/view":["GHBD-7M4:living","GHBD-7M4:firstName","GHBD-7M4:middleName","GHBD-7M4:lastName","GHBD-7M4:deathDate","GHBD-7M4:deathPlace","GHBD-7M4:birthDate","GHBD-7M4:birthPlace"],"https://drive.google.com/file/d/1L4zy5f_l9gYFBQQ68WdVFLDunwFoKgru/view?side=acosta":["GHBD-9L6:GHB8-DXY:partner","GHB8-5K8:deathDate","GHBD-9L6:gender","GHBD-9L6:firstName","GHBD-9L6:middleName","GHBD-9L6:lastName","GHB8-SQN:GHBD-9L6:parentChild","GHB8-SQN:gender","GHB8-SQN:firstName","GHB8-SQN:lastName","GHB8-5K8:GHBD-9L6:parentChild","GHB8-5K8:gender","GHB8-5K8:firstName","GHB8-5K8:lastName","GHB8-SQN:GHB8-5K8:partner","GHBD-9L6:marriagePlace","GHBD-9L6:marriageDate"],"https://drive.google.com/file/d/16SOA-h6729Zochb7g906v_LH7Mej7dn6/view?side=acosta":["GHBD-9L6:GHB8-DXY:partner","GHBD-9L6:firstName","GHBD-9L6:middleName","GHBD-9L6:lastName","GHBD-9L6:GHBD-7M4:parentChild","GHB8-DXY:GHBD-7M4:parentChild","GHBD-7M4:firstName","GHBD-7M4:birthDate","GHBD-7M4:marker"],"https://drive.google.com/file/d/1JuyRHuSaar2p3RM0nUjWX-KPMAGjk2FK/view":["GHBD-9L6:living","GHBD-9L6:firstName","GHBD-9L6:middleName","GHBD-9L6:lastName","GHBD-9L6:birthDate","GHBD-9L6:gender","GHBD-9L6:deathDate","GHBD-9L6:birthPlace","GHBD-9L6:marker","GHBD-9L6:marker2","GHB8-DXY:GHBD-9L6:partner","GHB8-DXY:gender","GHB8-DXY:firstName","GHB8-DXY:lastName","GHB8-SQN:GHBD-9L6:parentChild","GHB8-SQN:gender","GHB8-SQN:lastName","GHB8-SQN:birthPlace","GHB8-5K8:GHBD-9L6:parentChild","GHB8-5K8:gender","GHB8-5K8:lastName","GHB8-5K8:birthPlace","GHB8-SQN:GHB8-5K8:partner","GHBD-9L6:deathPlace"],"https://drive.google.com/file/d/1MIuMf7Q89LU89gmeNNZlH8lgKeMUR_yU/view":["GHB8-SQN:living","GHB8-SQN:firstName","GHB8-SQN:lastName","GHB8-SQN:gender","GHB8-SQN:deathDate","GHB8-SQN:birthDate","GHB8-SQN:deathPlace","GHB8-5K8:firstName","GHB8-5K8:lastName","GHBD-9L6:firstName","GHBD-9L6:middleName","GHBD-9L6:lastName"],"https://drive.google.com/file/d/1AL6hsO1Snvv-_aOovfP88-w0oxPjQs4i/view":["GHB8-SQN:living","GHB8-SQN:deathPlace","GHB8-SQN:firstName","GHB8-SQN:lastName","GHB8-SQN:birthDate","GHB8-SQN:gender","GHB8-SQN:deathDate","GHB8-SQN:birthPlace","GHB8-DXY:firstName","GHB8-DXY:lastName"],"https://drive.google.com/file/d/1L4zy5f_l9gYFBQQ68WdVFLDunwFoKgru/view?side=san+agustin":["GHBD-9L6:GHB8-DXY:partner","GHB8-DXY:gender","GHB8-DXY:firstName","GHB8-DXY:lastName","GHB8-LCC:GHB8-DXY:parentChild","GHB8-LCC:gender","GHB8-LCC:firstName","GHB8-LCC:lastName","GHB8-H7K:GHB8-DXY:parentChild","GHB8-H7K:gender","GHB8-H7K:firstName","GHB8-LCC:GHB8-H7K:partner","GHB8-DXY:marriagePlace","GHB8-DXY:marriageDate"],"https://drive.google.com/file/d/19m_AfnmTfHEdEy_IsgSWB9g1tREZnoJp/view":["GHB8-DXY:living","GHB8-DXY:firstName","GHB8-DXY:lastName","GHB8-DXY:birthDate","GHB8-DXY:deathDate","GHB8-DXY:deathPlace"],"https://drive.google.com/file/d/10Z0kurjxNy0s7M0um4w5SxFMAFWA8Ivm/view":["GHB8-DXY:living","GHB8-DXY:firstName","GHB8-DXY:GHBD-9L6:partner","GHB8-DXY:birthDate","GHB8-DXY:deathDate"],"https://drive.google.com/file/d/1gKlJX95oRihP2yIJ9ukp-0gFKWAAGiIL/view":["GHB8-J1B:firstName","GHB8-J1B:lastName","GHB8-J1B:gender","GHB8-J1B:birthDate","GHB8-GB6:GHB8-J1B:parentChild","GHB8-GB6:gender","GHB8-GB6:firstName","GHB8-GB6:lastName","GHBD-9LY:GHB8-J1B:parentChild","GHBD-9LY:gender","GHBD-9LY:firstName","GHBD-9LY:lastName","GHB8-GB6:GHBD-9LY:partner"],"https://drive.google.com/file/d/1_3rvIfv82-KWjBsaZawQV4lMFUYSB_NK/view?side=maramba":["GHBD-7M4:GHB8-J1B:partner","GHB8-J1B:marriagePlace","GHB8-J1B:gender","GHB8-J1B:firstName","GHB8-J1B:middleName","GHB8-J1B:lastName","GHB8-GB6:GHB8-J1B:parentChild","GHB8-GB6:gender","GHB8-GB6:firstName","GHB8-GB6:lastName","GHBD-9LY:GHB8-J1B:parentChild","GHBD-9LY:gender","GHBD-9LY:firstName","GHBD-9LY:lastName","GHB8-GB6:GHBD-9LY:partner","GHB8-J1B:marriageDate"],"https://drive.google.com/file/d/1zjeJs9azWMLnnEjulRpAnBi8Vno4H_9U/view?side=maramba":["GHB8-J1B:marriagePlace","GHB8-J1B:marriageDate","GHB8-J1B:firstName","GHB8-J1B:middleName","GHB8-J1B:lastName"],"https://drive.google.com/file/d/1AeoNewX7fEeAaihfBI3Tz6kNA9ia0m-D/view":["GHB8-J1B:deathPlace","GHB8-GB6:deathPlace","GHBD-9LY:deathPlace","GHB8-J1B:living","GHB8-J1B:firstName","GHB8-GB6:living","GHB8-GB6:firstName","GHB8-GB6:middleName","GHB8-GB6:lastName","GHB8-GB6:suffix","GHB8-GB6:birthDate","GHB8-GB6:deathDate","GHBD-9LY:living","GHBD-9LY:firstName","GHBD-9LY:lastName","GHBD-9LY:birthDate","GHBD-9LY:deathDate"],"https://drive.google.com/file/d/15o0fdYYMYTzXQ3ikiMCOqy-YlfAND76C/view":["GHB8-GB6:firstName","GHB8-GB6:lastName","GHB8-GB6:marker","GHB8-GB6:marker2"],"https://drive.google.com/file/d/1jorhb44fg6jrJcUDctHNB2BhVGUwDki7/view":[],"https://drive.google.com/file/d/1Pn6Xvn7ucwnzTgNTcFBsQq9hzAnARp51/view":["GHB8-GB6:living","GHB8-GB6:firstName","GHB8-GB6:lastName","GHB8-GB6:deathDate","GHB8-GB6:gender","GHB8-GB6:birthDate","GHB8-GB6:marker2","GHB8-GB6:birthPlace","GHBD-9LY:GHB8-GB6:partner","GHBD-9LY:gender","GHBD-9LY:firstName","GHBD-9LY:lastName"],"https://drive.google.com/file/d/1PGx6mKequtCtKWRjEAdJ999OX78Rgmvq/view":["LLQS-641:firstName","LLQS-641:middleName","LLQS-641:lastName","LLQS-641:gender","LLQS-641:birthDate","LLQS-6YC:LLQS-641:parentChild","LLQS-6YC:firstName","LLQS-6YC:middleName","LLQS-6YC:lastName","L281-614:LLQS-641:parentChild","L281-614:firstName","L281-614:middleName","L281-614:lastName","LLQS-6YC:L281-614:partner","LLQS-6F1:LLQS-641:partner","LLQS-6F1:gender","LLQS-6F1:firstName","LLQS-6F1:lastName","LLQS-641:GHB8-GB6:parentChild","GHB8-GB6:firstName","GHB8-GB6:lastName"],"https://drive.google.com/file/d/1CNF4lEbL4vfjbhMnTOEk02KFDhaO-Xwa/view":["LLQS-641:prefix","LLQS-641:firstName","LLQS-641:lastName","LLQS-6YC:LLQS-641:parentChild","L281-614:LLQS-641:parentChild"],"https://drive.google.com/file/d/1Ik8lFHm_F4-FaKOs4qL4CNiq-Il2WfLR/view":["LLQS-641:firstName","LLQS-641:lastName","LLQS-641:marker"],"https://drive.google.com/file/d/1cIXCw6wvKrPjzTYfpAfS3ri_Ms8ihSAS/view":["LLQS-6YC:gender","LLQS-6YC:birthDate"],"https://drive.google.com/file/d/1dDJs3rrAsbMSo_qp6my6J-wxE676FMEa/view":["LLQS-6YC:gender","LLQS-6YC:firstName","LLQS-6YC:lastName","LLQS-6YC:marker","LLQS-6YC:marker2","LLQS-6YC:deathPlace","L281-614:firstName","L281-614:lastName","L281-614:gender","L281-614:deathPlace","GC7T-H59:L281-614:parentChild","GC7T-H59:firstName","GC7T-H59:lastName","GC7T-1PK:L281-614:parentChild","GC7T-1PK:firstName","GC7T-1PK:lastName","GC7T-H59:GC7T-1PK:partner"],"https://drive.google.com/file/d/1eURb38MuWvI0RVG9IaHxEzs-rOt0vBgb/view":["L281-614:gender","L281-614:birthDate","GC7T-H59:L281-614:parentChild","GC7T-H59:gender","GC7T-H59:firstName","GC7T-H59:lastName","GC7T-1PK:L281-614:parentChild","GC7T-1PK:gender","GC7T-1PK:firstName","GC7T-1PK:lastName","GC7T-H59:GC7T-1PK:partner"],"https://drive.google.com/file/d/1fU_c4Ew4h9R85zZLDe5QQR-R2DDHT1Mq/view":["GC7T-H59:birthDate"],"https://drive.google.com/file/d/1ReDCDspaaaXQ4JoLgYcEznm-bGxhzc54/view":["GC7T-H59:firstName","GC7T-H59:lastName","GC7T-H59:gender","GC7T-H59:prefix","GC7T-H59:marker","GC7T-H59:deathDate"],"https://drive.google.com/file/d/19s_gdN98AQ1sZ5lhqSf8GrpJJIpFhsdf/view":["GHB5-TWN:birthPlace","GHB5-TWN:firstName","GHB5-TWN:middleName","GHB5-TWN:lastName","GHB5-TWN:gender","GHB5-TWN:birthDate","GHB5-XTZ:GHB5-TWN:parentChild","GHB5-XTZ:gender","GHB5-XTZ:firstName","GHB5-XTZ:middleName","GHB5-XTZ:lastName","GHBR-FK3:GHB5-TWN:parentChild","GHBR-FK3:gender","GHBR-FK3:firstName","GHBR-FK3:middleName","GHBR-FK3:lastName","GHBR-FK3:marker","GHB5-XTZ:GHBR-FK3:partner","GHB5-XTZ:marriageDate","GHBR-FK3:marriageDate"],"https://drive.google.com/file/d/1JugnGovmYL6q7yhPtoovnGNcoaKR2kYa/view?side=adanza":["GHB5-TWN:GQX8-CQP:partner","GHB5-TWN:firstName","GHB5-TWN:middleName","GHB5-TWN:lastName","GHB5-TWN:gender","GHB5-XTZ:GHB5-TWN:parentChild","GHB5-XTZ:gender","GHB5-XTZ:firstName","GHB5-XTZ:middleName","GHB5-XTZ:lastName","GHBR-FK3:GHB5-TWN:parentChild","GHBR-FK3:gender","GHBR-FK3:firstName","GHBR-FK3:middleName","GHBR-FK3:lastName","GHB5-XTZ:GHBR-FK3:partner","GHB5-TWN:marriageDate","GHB5-TWN:marriagePlace"],"https://drive.google.com/file/d/1jYZqUHatNlvgDuyFw7jxSwgZsE6jy_9V/view":["GHB5-XTZ:firstName","GHB5-XTZ:middleName","GHB5-XTZ:lastName","GHB5-XTZ:gender","GHB5-XTZ:birthDate","GHB5-XTZ:birthPlace","GH12-9F6:GHB5-XTZ:parentChild","GH12-9F6:gender","GH12-9F6:firstName","GH12-9F6:lastName","GH12-SVQ:GHB5-XTZ:parentChild","GH12-SVQ:gender","GH12-SVQ:firstName","GH12-SVQ:lastName","GH12-9F6:GH12-SVQ:partner"],"https://drive.google.com/file/d/1rVr3RKFXqxPfw--yVwacLYGwyQFf6LzQ/view?side=adanza":["GHB5-XTZ:GHBR-FK3:partner","GHB5-XTZ:gender","GHB5-XTZ:firstName","GHB5-XTZ:lastName","GHB5-XTZ:birthPlace","GH12-SVQ:GHB5-XTZ:parentChild","GH12-SVQ:gender","GH12-SVQ:firstName","GH12-SVQ:lastName","GH12-9F6:GHB5-XTZ:parentChild","GH12-9F6:gender","GH12-9F6:firstName","GH12-9F6:lastName","GH12-9F6:GH12-SVQ:partner","GHB5-XTZ:marriagePlace","GHB5-XTZ:marriageDate"],"https://drive.google.com/file/d/1peIClAbyWzZV_kWcxPKAVBPDnVqFXG2Q/view":["GH12-SVQ:living","GH12-SVQ:firstName","GH12-SVQ:middleName","GH12-SVQ:lastName","GH12-SVQ:gender","GH12-SVQ:deathDate","GH12-SVQ:birthDate","GH12-SVQ:deathPlace","GH12-SVQ:marker","GH12-DRN:GH12-SVQ:parentChild","GH12-DRN:gender","GH12-DRN:firstName","GH12-DRN:lastName","GH12-3GN:GH12-SVQ:parentChild","GH12-3GN:gender","GH12-3GN:firstName","GH12-3GN:lastName"],"https://drive.google.com/file/d/1BK3uw-U_2ONst68_V7wUXFQWzzlu0pFc/view":["GH12-DRN:living","GH12-DRN:firstName","GH12-DRN:middleName","GH12-DRN:lastName","GH12-DRN:gender","GH12-DRN:birthDate","GH12-DRN:marker","GH12-DRN:deathDate","GH12-DRN:deathPlace","GH12-3GN:GH12-DRN:partner","GH12-3GN:gender","GH12-3GN:firstName","GH12-3GN:lastName","GH12-3GN:deathDate","GH12-DRN:GH12-SVQ:parentChild","GH12-SVQ:firstName","GH12-SVQ:lastName"],"https://drive.google.com/file/d/1J6wUo6AwrS5aO9LJWbh8CUReaRTkUEFF/view":["GHBR-FK3:firstName","GHBR-FK3:middleName","GHBR-FK3:lastName","GHBR-FK3:gender","GHBR-FK3:birthDate","GHBR-FK3:birthPlace","GH12-Z3C:GHBR-FK3:parentChild","GH12-Z3C:gender","GH12-Z3C:firstName","GH12-Z3C:lastName","GH12-W17:GHBR-FK3:parentChild","GH12-W17:gender","GH12-W17:firstName","GH12-W17:lastName","GH12-Z3C:GH12-W17:partner"],"https://drive.google.com/file/d/18MFv7G6xKBJj9M4ewH8a3GgcpFW4VSht/view":["GHBR-FK3:birthPlace","GHBR-FK3:firstName","GHBR-FK3:middleName","GHBR-FK3:lastName","GHBR-FK3:gender","GHBR-FK3:birthDate","GH12-Z3C:GHBR-FK3:parentChild","GH12-Z3C:gender","GH12-Z3C:firstName","GH12-Z3C:middleName","GH12-Z3C:lastName","GH12-W17:GHBR-FK3:parentChild","GH12-W17:gender","GH12-W17:firstName","GH12-W17:middleName","GH12-W17:lastName","GH12-Z3C:GH12-W17:partner","GH12-Z3C:marriageDate","GH12-Z3C:marriagePlace","GH12-W17:marriageDate","GH12-W17:marriagePlace"],"https://drive.google.com/file/d/1rVr3RKFXqxPfw--yVwacLYGwyQFf6LzQ/view?side=ajesta":["GHB5-XTZ:GHBR-FK3:partner","GHBR-FK3:gender","GHBR-FK3:firstName","GHBR-FK3:lastName","GHBR-FK3:birthPlace","GH12-Z3C:GHBR-FK3:parentChild","GH12-Z3C:gender","GH12-Z3C:firstName","GH12-Z3C:lastName","GH12-W17:GHBR-FK3:parentChild","GH12-W17:gender","GH12-W17:firstName","GH12-W17:lastName","GH12-W17:GH12-Z3C:partner","GHBR-FK3:marriagePlace","GHBR-FK3:marriageDate"],"https://drive.google.com/file/d/1u-7tnWjKdZ5-GrdLKuKi-NOAVvty25Qo/view":["GHBD-9L6:gender","GHBD-9L6:firstName","GHBD-9L6:lastName","GHBD-9L6:birthPlace","GHBD-9L6:marker2","GHB8-DXY:gender","GHB8-DXY:firstName","GHB8-DXY:lastName","GHB8-DXY:birthPlace","GHB8-DXY:marker","GHBD-9L6:GHB8-DXY:partner"],"https://drive.google.com/file/d/1g_6PxiUEuhW_jvUU3p8TySDi9u-7hlwG/view":["GNNH-JLM:firstName","GNNH-JLM:lastName","GNNH-JLM:gender","GJJX-1SG:firstName","GJJX-1SG:lastName","GJJX-1SG:gender","GNNH-JLM:GJJX-1SG:partner"],"https://drive.google.com/file/d/1n_6mEB9oGikZeRXw71-_buL1cIoT8X9p/view":["GHB8-GB6:gender","GHB8-GB6:firstName","GHB8-GB6:middleName","GHB8-GB6:lastName","GHBD-9LY:gender","GHBD-9LY:firstName","GHBD-9LY:lastName","GHB8-GB6:GHBD-9LY:partner"],"https://drive.google.com/file/d/1EZnFrq2uHZVgfDSItdUrxBqy7Wzkto7o/view":["LLQS-641:LLQS-6F1:partner","LLQS-641:firstName","LLQS-641:lastName","LLQS-641:gender","LLQS-6F1:firstName","LLQS-6F1:lastName","LLQS-6F1:gender","L281-614:LLQS-641:parentChild","L281-614:firstName","L281-614:lastName","L281-614:gender","G7C3-B6P:LLQS-6F1:parentChild","G7C3-B6P:firstName","G7C3-B6P:gender","G7C3-J9S:LLQS-6F1:parentChild","G7C3-J9S:firstName","G7C3-J9S:lastName","G7C3-J9S:gender","G7C3-B6P:G7C3-J9S:partner"],"https://www.familysearch.org/ark:/61903/1:1:HBP6-8VZM":["GHB8-M8D:firstName","GHB8-M8D:lastName","GHB8-M8D:gender","GHB8-M86:firstName","GHB8-M86:lastName","GHB8-M86:gender","GHB8-M8D:GHB8-M86:partner"],"https://www.familysearch.org/ark:/61903/1:1:6JG6-3YRH":["GH12-XX4:firstName","GH12-XX4:gender","GH12-HQN:firstName","GH12-HQN:lastName","GH12-HQN:gender","GKBR-M9Y:firstName","GKBR-M9Y:lastName","GKBR-7P7:firstName","GKBR-7P7:lastName","GKBR-7P7:gender","GKBT-9GD:firstName","GKBT-9GD:lastName","K2GJ-YY3:firstName","K2GJ-YY3:lastName","K2GJ-YY3:gender","GH12-XX4:GH12-HQN:partner","GKBT-9GD:GH12-HQN:parentChild","GKBR-M9Y:GH12-XX4:parentChild"],"https://www.familysearch.org/ark:/61903/1:1:HBBS-S7W2":["GHBZ-TM4:firstName","GHBZ-TM4:lastName","GHBZ-TM4:gender","GHBZ-P5Q:firstName","GHBZ-P5Q:lastName","GHBZ-P5Q:gender","GHBZ-TM4:GHBZ-P5Q:partner"],"https://drive.google.com/file/d/13-RZPCmG9h3jLf4L-8yMIl7Fi-jdiAbg/view":["GHBD-7M4:birthDate","GHBD-7M4:birthPlace"],"https://drive.google.com/file/d/1irYmUaWoR44n7p-33kxmaI0H9HkWqDrY/view?side=ajesta":["GH12-XX4:gender","GH12-XX4:firstName","GH12-XX4:lastName","GH12-XX4:birthDate","GKBR-M9Y:GH12-XX4:parentChild","GKBR-M9Y:gender","GKBR-M9Y:firstName","GKBR-M9Y:lastName","GKBR-7P7:GH12-XX4:parentChild","GKBR-7P7:gender","GKBR-7P7:firstName","GKBR-7P7:lastName","GKBR-M9Y:GKBR-7P7:partner","GH12-XX4:marriagePlace","GH12-XX4:marriageDate"],"https://drive.google.com/file/d/1irYmUaWoR44n7p-33kxmaI0H9HkWqDrY/view?side=badoles":["GH12-HQN:gender","GH12-HQN:firstName","GH12-HQN:lastName","GH12-HQN:birthDate","GKBT-9GD:GH12-HQN:parentChild","GKBT-9GD:gender","GKBT-9GD:firstName","GKBT-9GD:lastName","K2GJ-YY3:GH12-HQN:parentChild","K2GJ-YY3:gender","K2GJ-YY3:firstName","K2GJ-YY3:lastName","GKBT-9GD:K2GJ-YY3:partner","GH12-HQN:marriagePlace","GH12-HQN:marriageDate"],"https://drive.google.com/file/d/1BKgRfbr-OYGuVgyYOxQR-_QlBhZ9tfRg/view":["GH12-9JZ:firstName","GH12-9JZ:lastName","GH12-9JZ:deathDate","GH12-9JZ:marker","GH12-9JZ:prefix","GH12-9JZ:gender"]};var isChecking=isDebugging||"true"==window.location.get("check"),KEYS_IN_SOURCE="";for(const[JM1,KM1]of Object.entries(SOURCES))KEYS_IN_SOURCE+=KM1.toString();var KEYS_IN_SENTIMENT_SOURCE="";for(const[i,LM1]of Object.entries(SOURCES["SENTIMENTS OF LIVING RELATIVES"]))KEYS_IN_SENTIMENT_SOURCE+=LM1.toString();function isEmpty(t){return null==t||""===t.trim()}function checkPerPerson(s){let n=0,a=0,r=0;var o=[],l=["key","fid","vitalsCompleteAndVerified","useNonePhoto","generation","hasImage","hasDNA","height","width","parent","hasStories","detailsRow1","detailsRow2","detailsRow3","detailsRow4","basicName","fullName","nickname","living","livingPlace"];for(let t=1;t<=4;t++){var e=1==t?"marker":"marker"+t;if("book"==s[e]){l.push(e);break}}s.living&&(l.push("deathDate"),l.push("deathPlace"),l.push("deathAge"),a+=4,r+=4),null===s.deathAge&&(l.push("deathAge"),a+=1,r+=1);var t,i,h,u;for([t,i]of Object.entries(["prefix","middleName","lastName","suffix","birthDate","birthPlace","baptismDate","marriageDate","marriagePlace","deathDate","deathPlace","twin","marker","marker2","marker3","partner"]))isEmpty(s[i])&&l.push(i);for([h,u]of Object.entries(s)){var d;let t=s.fid+":"+h,e=null,i=("child"==h&&(d=treeToFid[u],t=`${d}:${s.fid}:parentChild`,e=s.fid+`:${d}:parentChild`),"partner"==h&&(d=treeToFid[u],t=`${d}:${s.fid}:partner`,e=s.fid+`:${d}:partner`),0);"hasImage"==h&&(i+=1),i=(i+=KEYS_IN_SOURCE.occurrences(t))+KEYS_IN_SOURCE.occurrences(e);var c=String(u),g=(isEmpty(c)&&0!=i&&(n+=1,console.invalid("Found source for empty field: "+(t||e))),c.includes("before")||c.includes("after")||c.includes("about")||c.includes("from"));g&&0!=i&&(n+=1,console.warning(`Found source for estimated field: ${t||e}. Value: `+c)),l.includes(h)||(a+=i,r+=1,i<=0?o.push(h):1e.sourcePercentage-t.sourcePercentage);for([d,c]of Object.entries(f)){var A=c.sourceCount,b=c.expectedSourceCount,x=c.unverifiedAttributes,w=""+String(A).padStart(2,"0"),P=""+String(b).padStart(2,"0");if(b<=A)p.push(c.fullName),console.valid(w+` / ${P} checks passed for `+c.fullName);else if(0null===t;function calculatePhotoScale(t){if(t.useNonePhoto)return.3;var{birthPlace:e,deathPlace:i,marriagePlace:s}=t;let n=[e,i,s].filter(isNull).length;switch(n=t.hasImage&&void 0!==t.fid?n:4*(n+1)){case 0:return.155256;case 1:return.134001;case 2:return.109788;case 3:return.091757;case 4:return.63904221;case 8:return.57759585;case 12:return.47322855;case 16:return.395508;default:return 1}return null==t.birthPlace&&null==t.deathPlace?t.hasImage?.0997876967625:.3955:null==t.birthPlace&&null!=t.deathPlace||null!=t.birthPlace&&null==t.deathPlace?t.hasImage?.1340006180575:.5311:null!=t.birthPlace&&null!=t.deathPlace?t.hasImage?.1482559999887:.5876:1}function marginConditions(t){new bino.Margin(2,0,0,2);return{fishery:new bino.Margin(2,0,0,2.7),prelations:new bino.Margin(3,0,0,2),intelligence:new bino.Margin(1.95,0,0,1.85),military:new bino.Margin(.9,0,0,1.1),sergeant:new bino.Margin(0,0,0,.35),housewife:new bino.Margin(1.8,0,0,1.5),househusband:new bino.Margin(1.8,0,0,1.5),farming:new bino.Margin(2.25,0,0,1.95),"male-twin":new bino.Margin(0,0,0,2),"female-twin":new bino.Margin(0,0,0,2),train:new bino.Margin(3,0,0,2),cattle:new bino.Margin(-.25,0,0,.75),sales:new bino.Margin(3,0,0,2.5)}[t]||new bino.Margin(2,0,0,2)}template.GenderBand=function(){return $(bino.Shape,{margin:new bino.Margin(0,0,0,ui.measure.node.height-1),figure:"Rectangle",stroke:null,strokeWidth:0},new bino.Binding("desiredSize","",function(t){return new bino.Size(ui.measure.genderBand.width,t.height)}),new bino.Binding("fill","",function(t){return"M"==t.gender.toUpperCase()?ui.color.male:ui.color.female}))},template.DNAMarker=function(){return $(bino.Panel,new bino.Binding("margin","",function(t){var e=ui.measure.marker.margin;return new bino.Margin(e,0,0,ui.measure.node.widths[t.generation]-(ui.measure.marker.width+ui.measure.marker.margin))}),new bino.Binding("visible","",function(t){return void 0!==t.hasDNA&&t.hasDNA}),$(bino.Shape,{figure:"Circle",stroke:null,width:ui.measure.marker.width-2},new bino.Binding("margin","",function(t){return new bino.Margin(1.2,0,0,1.2)}),new bino.Binding("fill","",function(t){return ui.color.marker.background.dna})),$(bino.Picture,{scale:ui.measure.marker.scale},new bino.Binding("source","",function(t){return void 0===t.hasDNA?"":MARKERS.dna}),new bino.Binding("margin","",function(t){return new bino.Margin(2,0,0,2)})))},template.FirstMarker=function(){return $(bino.Panel,new bino.Binding("margin","",function(t){let e=ui.measure.marker.margin+(ui.measure.marker.width+ui.measure.marker.margin)-3;return t.hasDNA||(e=ui.measure.marker.margin),new bino.Margin(e,0,0,ui.measure.node.widths[t.generation]-(ui.measure.marker.width+ui.measure.marker.margin))}),new bino.Binding("visible","",function(t){return void 0!==t.marker}),$(bino.Shape,{figure:"Circle",stroke:null,width:ui.measure.marker.width-2},new bino.Binding("margin","",function(t){return new bino.Margin(1.2,0,0,1.2)}),new bino.Binding("fill","",function(t){return void 0!==ui.color.marker.background[t.marker]?ui.color.marker.background[t.marker]:ui.color.marker.background.default})),$(bino.Picture,{scale:ui.measure.marker.scale},new bino.Binding("source","",function(t){return void 0===t.marker?"":MARKERS[t.marker]}),new bino.Binding("margin","",function(t){return marginConditions(t.marker)})))},template.SecondMarker=function(){return $(bino.Panel,new bino.Binding("margin","",function(t){var e=ui.measure.marker.margin+(ui.measure.marker.width+ui.measure.marker.margin)-3;return new bino.Margin(e,0,0,ui.measure.node.widths[t.generation]-(ui.measure.marker.width+ui.measure.marker.margin))}),new bino.Binding("visible","",function(t){return void 0!==t.marker2&&!t.hasDNA}),$(bino.Shape,{figure:"Circle",stroke:null,width:ui.measure.marker.width-2},new bino.Binding("margin","",function(t){return new bino.Margin(1.2,0,0,1.2)}),new bino.Binding("fill","",function(t){return void 0!==ui.color.marker.background[t.marker2]?ui.color.marker.background[t.marker2]:ui.color.marker.background.default})),$(bino.Picture,{scale:ui.measure.marker.scale},new bino.Binding("source","",function(t){return void 0===t.marker2?"":MARKERS[t.marker2]}),new bino.Binding("margin","",function(t){return marginConditions(t.marker2)})))},template.ThirdMarker=function(){return $(bino.Panel,new bino.Binding("margin","",function(t){var e=ui.measure.marker.margin+2*(ui.measure.marker.width+ui.measure.marker.margin-3);return new bino.Margin(e,0,0,ui.measure.node.widths[t.generation]-(ui.measure.marker.width+ui.measure.marker.margin))}),new bino.Binding("visible","",function(t){return void 0!==t.marker3}),$(bino.Shape,{figure:"Circle",stroke:null,width:ui.measure.marker.width-2},new bino.Binding("margin","",function(t){return new bino.Margin(1.2,0,0,1.2)}),new bino.Binding("fill","",function(t){return void 0!==ui.color.marker.background[t.marker3]?ui.color.marker.background[t.marker3]:ui.color.marker.background.default})),$(bino.Picture,{scale:ui.measure.marker.scale},new bino.Binding("source","",function(t){return void 0===t.marker3?"":MARKERS[t.marker3]}),new bino.Binding("margin","",function(t){return marginConditions(t.marker3)})))},template.FourthMarker=function(){return $(bino.Panel,new bino.Binding("margin","",function(t){var e=ui.measure.marker.margin+3*(ui.measure.marker.width+ui.measure.marker.margin-3);return new bino.Margin(e,0,0,ui.measure.node.widths[t.generation]-(ui.measure.marker.width+ui.measure.marker.margin))}),new bino.Binding("visible","",function(t){return void 0!==t.marker4}),$(bino.Shape,{figure:"Circle",stroke:null,width:ui.measure.marker.width-2},new bino.Binding("margin","",function(t){return new bino.Margin(1.2,0,0,1.2)}),new bino.Binding("fill","",function(t){return void 0!==ui.color.marker.background[t.marker4]?ui.color.marker.background[t.marker4]:ui.color.marker.background.default})),$(bino.Picture,{scale:ui.measure.marker.scale},new bino.Binding("source","",function(t){return void 0===t.marker4?"":MARKERS[t.marker4]}),new bino.Binding("margin","",function(t){return marginConditions(t.marker4)})))},template.Name=function(){return $(bino.TextBlock,{font:`700 ${ui.font.size.name}px Google Sans, sans-serif`,height:ui.font.size.name+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(ui.measure.node.padding,0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return(t.firstName.includes("known")?ui.color.node.nameless:ui.color.node).name}),new bino.Binding("text","",function(t){return t.fullName}))},template.DetailRow1=function(){return $(bino.Panel,$(bino.TextBlock,{font:`400 ${ui.font.size.details}px "Google Sans Text", sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(24+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.text}),new bino.Binding("text","",function(t){return t.detailsRow1.text||""})),$(bino.TextBlock,{font:`700 ${ui.font.size.details}px Google Sans, sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(24+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.letter}),new bino.Binding("text","",function(t){return t.detailsRow1.letter?""+t.detailsRow1.letter:""})))},template.DetailRow2=function(){return $(bino.Panel,$(bino.TextBlock,{font:`400 ${ui.font.size.details}px "Google Sans Text", sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-33}),new bino.Binding("margin","",function(t){t="M"==t.detailsRow2.letter||"M"==t.detailsRow3.letter?13:11;return new bino.Margin(39+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details+t)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.text}),new bino.Binding("text","",function(t){return t.detailsRow2.text?": "+t.detailsRow2.text:""})),$(bino.TextBlock,{font:`700 ${ui.font.size.details}px Google Sans, sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(39+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.letter}),new bino.Binding("text","",function(t){return t.detailsRow2.letter?""+t.detailsRow2.letter:""})))},template.DetailRow3=function(){return $(bino.Panel,$(bino.TextBlock,{font:`400 ${ui.font.size.details}px "Google Sans Text", sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-33}),new bino.Binding("margin","",function(t){t="M"==t.detailsRow2.letter||"M"==t.detailsRow3.letter?13:11;return new bino.Margin(54.5+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details+t)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.text}),new bino.Binding("text","",function(t){return t.detailsRow3.text?": "+t.detailsRow3.text:""})),$(bino.TextBlock,{font:`700 ${ui.font.size.details}px Google Sans, sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(54.5+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.letter}),new bino.Binding("text","",function(t){return t.detailsRow3.letter?""+t.detailsRow3.letter:""})))},template.DetailRow4=function(){return $(bino.Panel,$(bino.TextBlock,{font:`400 ${ui.font.size.details}px "Google Sans Text", sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-33}),new bino.Binding("margin","",function(t){t="M"==t.detailsRow2.letter||"M"==t.detailsRow3.letter?13:11;return new bino.Margin(70+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details+t)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.text}),new bino.Binding("text","",function(t){return t.detailsRow4.text?": "+t.detailsRow4.text:""})),$(bino.TextBlock,{font:`700 ${ui.font.size.details}px Google Sans, sans-serif`,height:ui.font.size.details+2},new bino.Binding("width","",function(t){return ui.measure.node.widths[t.generation]-94-15}),new bino.Binding("margin","",function(t){return new bino.Margin(70+parseInt(ui.measure.node.padding/2),0,0,ui.measure.node.height+ui.font.size.details)}),new bino.Binding("stroke","",function(t){return t.firstName.includes("nknown")?ui.color.node.nameless.details:ui.color.node.details.letter}),new bino.Binding("text","",function(t){return t.detailsRow4.letter?""+t.detailsRow4.letter:""})))};var tree=$(bino.Diagram,"tree",{isReadOnly:!0,padding:ui.measure.padding,scale:ui.scale,layout:$(bino.TreeLayout,{angle:0,layerSpacing:Math.max(parseInt(4*ui.measure.node.margin),20),nodeSpacing:ui.measure.node.margin}),hasHorizontalScrollbar:!1,hasVerticalScrollbar:!1,allowHorizontalScroll:!0,allowSelect:!1,allowVerticalScroll:!0,allowZoom:!0});tree.nodeTemplate=$(bino.Node,{selectable:!1,click:(t,e)=>{showSidebar(e)},mouseEnter:(t,e)=>{STORIES[e.data.fid]&&(!isPrivate||isPrivate&&!e.data.living)&&(e.cursor="pointer")},mouseLeave:(t,e)=>{STORIES[e.data.fid]&&(!isPrivate||isPrivate&&!e.data.living)&&(e.cursor="")}},new bino.Binding("height","height"),new bino.Binding("width","width"),template.Node(),template.Photo(),template.Name(),template.DetailRow1(),template.DetailRow2(),template.DetailRow3(),template.DetailRow4(),template.DNAMarker(),template.FirstMarker(),template.SecondMarker(),template.ThirdMarker(),template.FourthMarker(),template.GenderBand(),template.CheckFill(),template.TopLeftBorderRadius(),template.BottomLeftBorderRadius()),tree.linkTemplate=template.Link();let model=$(bino.TreeModel);model.nodeDataArray=TREE_DATA,tree.model=model,window.onload=function(){for(let t=0;t{var t=window.location.get("id"),e=document.getElementById("personDetailsDesc");localStorage.setItem(`family-tree-id-${t}-scroll`,e.scrollTop),removeQueryParam("id")})}; \ No newline at end of file diff --git a/public/family/js/stories.js b/public/family/js/stories.js index d47fa6d..ad08b88 100644 --- a/public/family/js/stories.js +++ b/public/family/js/stories.js @@ -519,6 +519,26 @@ var STORIES = { Beautiful Engagement Ring

    Mitchie's lab-grown Diamond engagement ring.

    + +
    +
    First Pregnancy
    +

    A compilation of reactions from Arbyn and Mitchie's relatives; and their close friends.

    +
    +
    +

    How Mitch and Arbyn found that they would be having a baby and how they announced it to their relatives.

    +
    +
    +
    +

    Mitchie's high school best friends, BCHZ, finding out she was pregnant.

    +
    +
    +
    +

    The Alviza family, a close family friend, finding out that Mitch was pregnant.

    +
    +
    +
    +

    Reaction video of Mitch and Arbyn's mutual friends.

    +
    ` } }