You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

675 lines
1.3 MiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9645],{75009:function(or,U,z){"use strict";z.d(U,{Z:function(){return Xg}});var B={};z.r(B),z.d(B,{GADDI:function(){return to},Stack:function(){return ni},breadthFirstSearch:function(){return ht},connectedComponent:function(){return Qe},cosineSimilarity:function(){return he},default:function(){return Ss},depthFirstSearch:function(){return xr},detectAllCycles:function(){return qt},detectAllDirectedCycle:function(){return Bt},detectAllUndirectedCycle:function(){return ft},detectCycle:function(){return br},detectDirectedCycle:function(){return lo},dijkstra:function(){return Hr},findAllPath:function(){return Gr},findShortestPath:function(){return qr},floydWarshall:function(){return Gn},getAdjMatrix:function(){return te},getDegree:function(){return St},getInDegree:function(){return Ct},getNeighbors:function(){return pe},getOutDegree:function(){return _t},iLouvain:function(){return rt},kCore:function(){return ae},kMeans:function(){return C},labelPropagation:function(){return $r},louvain:function(){return K},minimumSpanningTree:function(){return Ot},nodesCosineSimilarity:function(){return Ee},pageRank:function(){return pr}});var j={};z.r(j),z.d(j,{Line:function(){return ga},applyMatrix:function(){return _n},compare:function(){return Yi},distance:function(){return Va},floydWarshall:function(){return Ko},fractionToLine:function(){return Ao},getAdjMatrix:function(){return Li},getBBoxBoundLine:function(){return vo},getCircleCenterByPoints:function(){return Go},getCircleIntersectByPoint:function(){return Oo},getDegree:function(){return $o},getEllipseIntersectByPoint:function(){return Hi},getLineIntersect:function(){return Bo},getPointsCenter:function(){return as},getRectIntersectByPoint:function(){return _s},intersectBBox:function(){return Qo},invertMatrix:function(){return Fo},isPointInPolygon:function(){return ro},isPointsOverlap:function(){return _i},isPolygonsIntersect:function(){return zi},itemIntersectByLine:function(){return Pi},lerp:function(){return da},lerpArray:function(){return Fa},move:function(){return ho},pointLineDistance:function(){return Ui},pointLineSquareDist:function(){return Zi},pointRectSquareDist:function(){return no},rotate:function(){return Di},scale:function(){return Gi},scaleMatrix:function(){return Ms},squareDist:function(){return vi},translate:function(){return Mo}});var R={};z.r(R),z.d(R,{cloneBesidesImg:function(){return Uo},getAnimateCfgWithCallback:function(){return bo},getBBox:function(){return Eo},getComboBBox:function(){return us},getLabelPosition:function(){return Hu},getLetterWidth:function(){return Zs},getLoopCfgs:function(){return Yu},getTextSize:function(){return Ks},plainCombosToTrees:function(){return os},reconstructTree:function(){return ss},shouldRefreshEdge:function(){return $s},traverseTree:function(){return Ei},traverseTreeUp:function(){return Ki},truncateLabelByLength:function(){return io}});var A={};z.r(A),z.d(A,{calculationItemsBBox:function(){return $u},cloneEvent:function(){return cs},formatPadding:function(){return Cs},isNaN:function(){return xo},isViewportChanged:function(){return $i},processParallelEdges:function(){return Mf},uniqueId:function(){return Co}});var N={};z.r(N),z.d(N,{getClosedSpline:function(){return ls},getControlPoint:function(){return ca},getSpline:function(){return Os},getStarPath:function(){return Lo},paddedHull:function(){return Nf},pathToPoints:function(){return Eu},pointsToPolygon:function(){return Lf},roundedHull:function(){return ef}});var L={};z.r(L),z.d(L,{defaultSubjectColors:function(){return ol}});var y={};z.r(y),z.d(y,{isForce:function(){return _u}});var x={};z.r(x),z.d(x,{getColorSetsBySubjectColors:function(){return Bs},getColorsWithSubjectColor:function(){return vs},mixColor:function(){return gi}});var v={};z.r(v),z.d(v,{arrayToTextureData:function(){return Lc},attributesToTextureData:function(){return Gs},buildTextureData:function(){return Jf},buildTextureDataWithOneEdgeAttr:function(){return qf},buildTextureDataWithTwoEdgeAttr:function(){return Ac},proccessToFunc:function(){return hf},radialLayout:function(){return Dc}});var g={};z.r(g),z.d(g,{gpuDetector:function(){return Nc}});var d=z(67294),_=z(24561),E=function(c){var t=c.loadingTemplate,e=function(){return t||d.createElement(_.ZP,{viewBox:"0 0 400 180",width:200,height:90,speed:1},d.createElement("rect",{x:"20",y:"5",rx:"0",ry:"0",width:"1",height:"170"}),d.createElement("rect",{x:"20",y:"175",rx:"0",ry:"0",width:"360",height:"1"}),d.createElement("rect",{x:"40",y:"75",rx:"0",ry:"0",width:"35",height:"100"}),d.createElement("rect",{x:"80",y:"125",rx:"0",ry:"0",width:"35",height:"50"}),d.createElement("rect",{x:"120",y:"105",rx:"0",ry:"0",width:"35",height:"70"}),d.createElement("rect",{x:"160",y:"35",rx:"0",ry:"0",width:"35",height:"140"}),d.createElement("rect",{x:"200",y:"55",rx:"0",ry:"0",width:"35",height:"120"}),d.createElement("rect",{x:"240",y:"15",rx:"0",ry:"0",width:"35",height:"160"}),d.createElement("rect",{x:"280",y:"135",rx:"0",ry:"0",width:"35",height:"40"}),d.createElement("rect",{x:"320",y:"85",rx:"0",ry:"0",width:"35",height:"90"}))};return d.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:"#fff"}},e())},w=function(){var c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},c(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),T=function(c){w(t,c);function t(){var e=c!==null&&c.apply(this,arguments)||this;return e.state={hasError:!1},e.renderError=function(r){var n=e.props.errorTemplate;switch(r){default:return typeof n=="function"?n(r):n||d.createElement("h5",null,"\u7EC4\u4EF6\u51FA\u9519\u4E86\uFF0C\u8BF7\u6838\u67E5\u540E\u91CD\u8BD5\uFF1A ",r.message)}},e}return t.getDerivedStateFromError=function(e){return{hasError:!0,error:e}},t.getDerivedStateFromProps=function(e,r){return r.children!==e.children?{children:e.children,hasError:!1,error:void 0}:null},t.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):d.createElement(d.Fragment,null,this.props.children)},t}(d.Component),k=T,b=z(70655),m=z(49242),$={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(t){return Object.assign(this,t),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(t){var e=this,r=this.events;this.graph=t,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!0),(0,m.each)(r,function(n,a){t.on(a,n)}),document.addEventListener("visibilitychange",function(){e.keydown=!1})},unbind:function(t){var e=this.events,r=t.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&t.get("canvas").set("draggable",!1),(0,m.each)(e,function(n,a){t.off(a,n)}),t.get("canvas").set("draggable",r)},get:function(t){return this[t]},set:function(t,e){return this[t]=e,this}},W=function(){function c(){}return c.registerBehavior=function(t,e){if(!e)throw new Error("please specify handler for this behavior: ".concat(t));var r=(0,m.clone)($);Object.assign(r,e);var n=function(i){var o=this;Object.assign(this,this.getDefaultCfg(),i);var s=this.getEvents();this.events=null;var l={};s&&((0,m.each)(s,function(h,p){l[p]=(0,m.wrapBehavior)(o,h)}),this.events=l)};n.prototype=r,c.types[t]=n},c.hasBehavior=function(t){return!!c.types[t]},c.getBehavior=function(t){return c.types[t]},c.types={},c}(),X=W,H=X,Q=z(90494),q=z(31506),J=function(t,e){var r=t.nodes,n=t.edges,a=[],i={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(o,s){i[o.id]=s;var l=[];a.push(l)}),n&&n.forEach(function(o){var s=o.source,l=o.target,h=i[s],p=i[l];!h&&h!==0||!p&&p!==0||(a[h][p]=1,e||(a[p][h]=1))}),a},te=J,fe=function(t,e){return t===e},de=function(){function c(t,e){e===void 0&&(e=null),this.value=t,this.next=e}return c.prototype.toString=function(t){return t?t(this.value):"".concat(this.value)},c}(),Te=function(){function c(t){t===void 0&&(t=fe),this.head=null,this.tail=null,this.compare=t}return c.prototype.prepend=function(t){var e=new de(t,this.head);return this.head=e,this.tail||(this.tail=e),this},c.prototype.append=function(t){var e=new de(t);return this.head?(this.tail.next=e,this.tail=e,this):(this.head=e,this.tail=e,this)},c.prototype.delete=function(t){if(!this.head)return null;for(var e=null;this.head&&this.compare(this.head.value,t);)e=this.head,this.head=this.head.next;var r=this.head;if(r!==null)for(;r.next;)this.compare(r.next.value,t)?(e=r.next,r.next=r.next.next):r=r.next;return this.compare(this.tail.value,t)&&(this.tail=r),e},c.prototype.find=function(t){var e=t.value,r=e===void 0?void 0:e,n=t.callback,a=n===void 0?void 0:n;if(!this.head)return null;for(var i=this.head;i;){if(a&&a(i.value)||r!==void 0&&this.compare(i.value,r))return i;i=i.next}return null},c.prototype.deleteTail=function(){var t=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,t;for(var e=this.head;e.next;)e.next.next?e=e.next:e.next=null;return this.tail=e,t},c.prototype.deleteHead=function(){if(!this.head)return null;var t=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),t},c.prototype.fromArray=function(t){var e=this;return t.forEach(function(r){return e.append(r)}),this},c.prototype.toArray=function(){for(var t=[],e=this.head;e;)t.push(e),e=e.next;return t},c.prototype.reverse=function(){for(var t=this.head,e=null,r=null;t;)r=t.next,t.next=e,e=t,t=r;this.tail=this.head,this.head=e},c.prototype.toString=function(t){return t===void 0&&(t=void 0),this.toArray().map(function(e){return e.toString(t)}).toString()},c}(),Se=Te,Ie=function(){function c(){this.linkedList=new Se}return c.prototype.isEmpty=function(){return!this.linkedList.head},c.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},c.prototype.enqueue=function(t){this.linkedList.append(t)},c.prototype.dequeue=function(){var t=this.linkedList.deleteHead();return t?t.value:null},c.prototype.toString=function(t){return this.linkedList.toString(t)},c}(),be=Ie,pe=function(t,e,r){e===void 0&&(e=[]);var n=e.filter(function(s){return s.source===t||s.target===t});if(r==="target"){var a=function(l){return l.source===t};return n.filter(a).map(function(s){return s.target})}if(r==="source"){var i=function(l){return l.target===t};return n.filter(i).map(function(s){return s.source})}var o=function(l){return l.source===t?l.target:l.source};return n.map(o)},Me=function(t,e){return e.filter(function(r){return r.source===t})},De=function(t,e){return e.filter(function(r){return r.source===t||r.target===t})},Ue=function(t){t===void 0&&(t=0);var e="".concat(Math.random()).split(".")[1].substr(0,5),r="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(t,"-").concat(e).concat(r)};function nt(c){c===void 0&&(c={});var t=c,e=function(){},r=function(){var n={};return function(a){var i=a.next,o=i;return n[o]?!1:(n[o]=!0,!0)}}();return t.allowTraversal=c.allowTraversal||r,t.enter=c.enter||e,t.leave=c.leave||e,t}var Ze=function(t,e,r,n){n===void 0&&(n=!0);var a=nt(r),i=new be,o=t.edges,s=o===void 0?[]:o;i.enqueue(e);for(var l="",h=function(){var D=i.dequeue();a.enter({current:D,previous:l}),pe(D,s,n?"target":void 0).forEach(function(I){a.allowTraversal({previous:l,current:D,next:I})&&i.enqueue(I)}),a.leave({current:D,previous:l}),l=D};!i.isEmpty();)h()},ht=Ze,Rt=function(t){for(var e=t.nodes,r=e===void 0?[]:e,n=t.edges,a=n===void 0?[]:n,i=[],o={},s=[],l=function I(F){s.push(F),o[F.id]=!0;for(var Z=pe(F.id,a),ee=function(ce){var we=Z[ce];if(!o[we]){var Re=r.filter(function(Oe){return Oe.id===we});Re.length>0&&I(Re[0])}},se=0;se<Z.length;++se)ee(se)},h=0;h<r.length;h++){var p=r[h];if(!o[p.id]){l(p);for(var D=[];s.length>0;)D.push(s.pop());i.push(D)}}return i},tr=function(t){for(var e=t.nodes,r=e===void 0?[]:e,n=t.edges,a=n===void 0?[]:n,i=[],o={},s={},l={},h=[],p=0,D=function ee(se){s[se.id]=p,l[se.id]=p,p+=1,i.push(se),o[se.id]=!0;for(var oe=pe(se.id,a,"target").filter(function(Pe){return r.map(function(He){return He.id}).indexOf(Pe)>-1}),ce=function(He){var at=oe[He];if(!s[at]&&s[at]!==0){var qe=r.filter(function(yt){return yt.id===at});qe.length>0&&ee(qe[0]),l[se.id]=Math.min(l[se.id],l[at])}else o[at]&&(l[se.id]=Math.min(l[se.id],s[at]))},we=0;we<oe.length;we++)ce(we);if(l[se.id]===s[se.id]){for(var Re=[];i.length>0;){var Oe=i.pop();if(o[Oe.id]=!1,Re.push(Oe),Oe===se)break}Re.length>0&&h.push(Re)}},I=0,F=r;I<F.length;I++){var Z=F[I];!s[Z.id]&&s[Z.id]!==0&&D(Z)}return h};function Qe(c,t){return t?tr(c):Rt(c)}var lt=function(t){var e={},r=t.nodes,n=r===void 0?[]:r,a=t.edges,i=a===void 0?[]:a;return n.forEach(function(o){e[o.id]={degree:0,inDegree:0,outDegree:0}}),i.forEach(function(o){e[o.source].degree++,e[o.source].outDegree++,e[o.target].degree++,e[o.target].inDegree++}),e},St=lt,Ct=function(t,e){var r=lt(t);return r[e]?lt(t)[e].inDegree:0},_t=function(t,e){var r=lt(t);return r[e]?lt(t)[e].outDegree:0};function pt(c){c===void 0&&(c={});var t=c,e=function(){},r=function(){var n={};return function(a){var i=a.next;return n[i]?!1:(n[i]=!0,!0)}}();return t.allowTraversal=c.allowTraversal||r,t.enter=c.enter||e,t.leave=c.leave||e,t}function rr(c,t,e,r){r.enter({current:t,previous:e});var n=c.edges,a=n===void 0?[]:n;pe(t,a,"target").forEach(function(i){r.allowTraversal({previous:e,current:t,next:i})&&rr(c,i,t,r)}),r.leave({current:t,previous:e})}function xr(c,t,e){rr(c,t,"",pt(e))}var Vt=function(t){var e=null,r=t.nodes,n=r===void 0?[]:r,a={},i={},o={},s={};n.forEach(function(p){i[p.id]=p});for(var l={enter:function(D){var I=D.current,F=D.previous;if(o[I]){e={};for(var Z=I,ee=F;ee!==I;)e[Z]=ee,Z=ee,ee=a[ee];e[Z]=ee}else o[I]=I,delete i[I],a[I]=F},leave:function(D){var I=D.current;s[I]=I,delete o[I]},allowTraversal:function(D){var I=D.next;return e?!1:!s[I]}};Object.keys(i).length;){var h=Object.keys(i)[0];xr(t,h,l)}return e},ft=function(t,e,r){var n,a;r===void 0&&(r=!0);for(var i=[],o=Qe(t,!1),s=0,l=o;s<l.length;s++){var h=l[s];if(!!h.length)for(var p=h[0],D=p.id,I=[p],F=(n={},n[D]=p,n),Z=(a={},a[D]=new Set,a);I.length>0;)for(var ee=I.pop(),se=ee.id,oe=pe(se,t.edges),ce=function(Oe){var Pe,He=oe[Oe],at=t.nodes.find(function(lr){return lr.id===He});if(He===se)i.push((Pe={},Pe[He]=ee,Pe));else if(!(He in Z))F[He]=ee,I.push(at),Z[He]=new Set([ee]);else if(!Z[se].has(at)){for(var qe=!0,yt=[at,ee],Ft=F[se];Z[He].size&&!Z[He].has(Ft)&&(yt.push(Ft),Ft!==F[Ft.id]);)Ft=F[Ft.id];if(yt.push(Ft),e&&r?(qe=!1,yt.findIndex(function(lr){return e.indexOf(lr.id)>-1})>-1&&(qe=!0)):e&&!r&&yt.findIndex(function(lr){return e.indexOf(lr.id)>-1})>-1&&(qe=!1),qe){for(var yr={},fr=1;fr<yt.length;fr+=1)yr[yt[fr-1].id]=yt[fr];yt.length&&(yr[yt[yt.length-1].id]=yt[0]),i.push(yr)}Z[He].add(ee)}},we=0;we<oe.length;we+=1)ce(we)}return i},Bt=function(t,e,r){r===void 0&&(r=!0);for(var n=[],a=new Set,i=[],o=[],s={},l={},h=function(Ft){for(var yr=[Ft];yr.length>0;){var fr=yr.pop();a.has(fr)&&(a.delete(fr),i[fr.id].forEach(function(lr){yr.push(lr)}),i[fr.id].clear())}},p=function yt(Ft,yr,fr){var lr=!1;if(e&&r===!1&&e.indexOf(Ft.id)>-1)return lr;n.push(Ft),a.add(Ft);for(var Kt=fr[Ft.id],jr=0;jr<Kt.length;jr+=1){var Xr=s[Kt[jr]];if(Xr===yr){for(var er={},mr=1;mr<n.length;mr+=1)er[n[mr-1].id]=n[mr];n.length&&(er[n[n.length-1].id]=n[0]),o.push(er),lr=!0}else a.has(Xr)||yt(Xr,yr,fr)&&(lr=!0)}if(lr)h(Ft);else for(var jr=0;jr<Kt.length;jr+=1){var Xr=s[Kt[jr]];i[Xr.id].has(Ft)||i[Xr.id].add(Ft)}return n.pop(),lr},D=t.nodes,I=D===void 0?[]:D,F=0;F<I.length;F+=1){var Z=I[F],ee=Z.id;l[ee]=F,s[F]=Z}if(e&&r)for(var se=function(Ft){var yr=e[Ft];l[I[Ft].id]=l[yr],l[yr]=0,s[0]=I.find(function(fr){return fr.id===yr}),s[l[I[Ft].id]]=I[Ft]},F=0;F<e.length;F++)se(F);for(var oe=function(Ft){for(var yr,fr,lr=Infinity,Kt=0;Kt<Ft.length;Kt+=1)for(var jr=Ft[Kt],Xr=0;Xr<jr.length;Xr++){var er=l[jr[Xr].id];er<lr&&(lr=er,fr=Kt)}for(var mr=Ft[fr],kr=[],Kt=0;Kt<mr.length;Kt+=1){var Fr=mr[Kt];kr[Fr.id]=[];for(var Jr=0,fn=pe(Fr.id,t.edges,"target").filter(function(wa){return mr.map(function(ua){return ua.id}).indexOf(wa)>-1});Jr<fn.length;Jr++){var Vn=fn[Jr];Vn===Fr.id&&!(r===!1&&e.indexOf(Fr.id)>-1)?o.push((yr={},yr[Fr.id]=Fr,yr)):kr[Fr.id].push(l[Vn])}}return{component:mr,adjList:kr,minIdx:lr}},ce=0;ce<I.length;){var we=I.filter(function(yt){return l[yt.id]>=ce}),Re=tr({nodes:we,edges:t.edges}).filter(function(yt){return yt.length>1});if(Re.length===0)break;var Oe=oe(Re),Pe=Oe.minIdx,He=Oe.adjList,at=Oe.component;if(at.length>1){at.forEach(function(yt){i[yt.id]=new Set});var qe=s[Pe];if(e&&r&&e.indexOf(qe.id)===-1)return o;p(qe,qe,He),ce=Pe+1}else break}return o},qt=function(t,e,r,n){return n===void 0&&(n=!0),e?Bt(t,r,n):ft(t,r,n)},br=Vt,Ur=function(t,e,r){for(var n=Infinity,a,i=0;i<e.length;i++){var o=e[i].id;!r[o]&&t[o]<=n&&(n=t[o],a=e[i])}return a},Ae=function(t,e,r,n){var a=t.nodes,i=a===void 0?[]:a,o=t.edges,s=o===void 0?[]:o,l=[],h={},p={},D={};i.forEach(function(ce,we){var Re=ce.id;l.push(Re),p[Re]=Infinity,Re===e&&(p[Re]=0)});for(var I=i.length,F=function(we){var Re=Ur(p,i,h),Oe=Re.id;if(h[Oe]=!0,p[Oe]===Infinity)return"continue";var Pe=[];r?Pe=Me(Oe,s):Pe=De(Oe,s),Pe.forEach(function(He){var at=He.target,qe=He.source,yt=at===Oe?qe:at,Ft=n&&He[n]?He[n]:1;p[yt]>p[Re.id]+Ft?(p[yt]=p[Re.id]+Ft,D[yt]=[Re.id]):p[yt]===p[Re.id]+Ft&&D[yt].push(Re.id)})},Z=0;Z<I;Z++)F(Z);D[e]=[e];var ee={};for(var se in p)p[se]!==Infinity&&Sr(e,se,D,ee);var oe={};for(var se in ee)oe[se]=ee[se][0];return{length:p,path:oe,allPath:ee}},Hr=Ae;function Sr(c,t,e,r){if(c===t)return[c];if(r[t])return r[t];for(var n=[],a=0,i=e[t];a<i.length;a++){var o=i[a],s=Sr(c,o,e,r);if(!s)return;for(var l=0,h=s;l<h.length;l++){var p=h[l];(0,m.isArray)(p)?n.push((0,b.__spreadArray)((0,b.__spreadArray)([],p,!0),[t],!1)):n.push([p,t])}}return r[t]=n,r[t]}var qr=function(t,e,r,n,a){var i=Hr(t,e,n,a),o=i.length,s=i.path,l=i.allPath;return{length:o[r],path:s[r],allPath:l[r]}},Gr=function(t,e,r,n){var a;if(e===r)return[[e]];var i=t.edges,o=i===void 0?[]:i,s=[e],l=(a={},a[e]=!0,a),h=[],p=[],D=n?pe(e,o,"target"):pe(e,o);for(h.push(D);s.length>0&&h.length>0;){var I=h[h.length-1];if(I.length){var F=I.shift();F&&(s.push(F),l[F]=!0,D=n?pe(F,o,"target"):pe(F,o),h.push(D.filter(function(se){return!l[se]})))}else{var Z=s.pop();l[Z]=!1,h.pop();continue}if(s[s.length-1]===r){var ee=s.map(function(oe){return oe});p.push(ee);var Z=s.pop();l[Z]=!1,h.pop()}}return p},vn=function(t,e){for(var r=te(t,e),n=[],a=r.length,i=0;i<a;i+=1){n[i]=[];for(var o=0;o<a;o+=1)i===o?n[i][o]=0:r[i][o]===0||!r[i][o]?n[i][o]=Infinity:n[i][o]=r[i][o]}for(var s=0;s<a;s+=1)for(var i=0;i<a;i+=1)for(var o=0;o<a;o+=1)n[i][o]>n[i][s]+n[s][o]&&(n[i][o]=n[i][s]+n[s][o]);return n},Gn=vn,mn=function(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r="weight"),n===void 0&&(n=1e3);var a=t.nodes,i=a===void 0?[]:a,o=t.edges,s=o===void 0?[]:o,l={},h={};i.forEach(function(we,Re){var Oe=Ue();we.clusterId=Oe,l[Oe]={id:Oe,nodes:[we]},h[we.id]={node:we,idx:Re}});var p=te(t,e),D=[],I={};p.forEach(function(we,Re){var Oe=0,Pe=i[Re].id;I[Pe]={},we.forEach(function(He,at){if(!!He){Oe+=He;var qe=i[at].id;I[Pe][qe]=He}}),D.push(Oe)});for(var F=0,Z=function(){var Re=!1;if(i.forEach(function(Oe){var Pe={};Object.keys(I[Oe.id]).forEach(function(lr){var Kt=I[Oe.id][lr],jr=h[lr].node,Xr=jr.clusterId;Pe[Xr]||(Pe[Xr]=0),Pe[Xr]+=Kt});var He=-Infinity,at=[];if(Object.keys(Pe).forEach(function(lr){He<Pe[lr]?(He=Pe[lr],at=[lr]):He===Pe[lr]&&at.push(lr)}),!(at.length===1&&at[0]===Oe.clusterId)){var qe=at.indexOf(Oe.clusterId);if(qe>=0&&at.splice(qe,1),at&&at.length){Re=!0;var yt=l[Oe.clusterId],Ft=yt.nodes.indexOf(Oe);yt.nodes.splice(Ft,1);var yr=Math.floor(Math.random()*at.length),fr=l[at[yr]];fr.nodes.push(Oe),Oe.clusterId=fr.id}}}),!Re)return"break";F++};F<n;){var ee=Z();if(ee==="break")break}Object.keys(l).forEach(function(we){var Re=l[we];(!Re.nodes||!Re.nodes.length)&&delete l[we]});var se=[],oe={};s.forEach(function(we){var Re=we.source,Oe=we.target,Pe=we[r]||1,He=h[Re].node.clusterId,at=h[Oe].node.clusterId,qe="".concat(He,"---").concat(at);if(oe[qe])oe[qe].weight+=Pe,oe[qe].count++;else{var yt={source:He,target:at,weight:Pe,count:1};oe[qe]=yt,se.push(yt)}});var ce=[];return Object.keys(l).forEach(function(we){ce.push(l[we])}),{clusters:ce,clusterEdges:se}},$r=mn,gn=function(){function c(t){this.arr=t}return c.prototype.getArr=function(){return this.arr||[]},c.prototype.add=function(t){var e,r=t.arr;if(!((e=this.arr)===null||e===void 0?void 0:e.length))return new c(r);if(!(r==null?void 0:r.length))return new c(this.arr);if(this.arr.length===r.length){var n=[];for(var a in this.arr)n[a]=this.arr[a]+r[a];return new c(n)}},c.prototype.subtract=function(t){var e,r=t.arr;if(!((e=this.arr)===null||e===void 0?void 0:e.length))return new c(r);if(!(r==null?void 0:r.length))return new c(this.arr);if(this.arr.length===r.length){var n=[];for(var a in this.arr)n[a]=this.arr[a]-r[a];return new c(n)}},c.prototype.avg=function(t){var e=[];if(t!==0)for(var r in this.arr)e[r]=this.arr[r]/t;return new c(e)},c.prototype.negate=function(){var t=[];for(var e in this.arr)t[e]=-this.arr[e];return new c(t)},c.prototype.squareEuclideanDistance=function(t){var e,r=t.arr;if(!((e=this.arr)===null||e===void 0?void 0:e.length)||!(r==null?void 0:r.length))return 0;if(this.arr.length===r.length){var n=0;for(var a in this.arr)n+=Math.pow(this.arr[a]-t.arr[a],2);return n}},c.prototype.euclideanDistance=function(t){var e,r=t.arr;if(!((e=this.arr)===null||e===void 0?void 0:e.length)||!(r==null?void 0:r.length))return 0;if(this.arr.length===r.length){var n=0;for(var a in this.arr)n+=Math.pow(this.arr[a]-t.arr[a],2);return Math.sqrt(n)}else console.error("The two vectors are unequal in length.")},c.prototype.normalize=function(){var t=[],e=(0,m.clone)(this.arr);e.sort(function(i,o){return i-o});var r=e[e.length-1],n=e[0];for(var a in this.arr)t[a]=(this.arr[a]-n)/(r-n);return new c(t)},c.prototype.norm2=function(){var t;if(!((t=this.arr)===null||t===void 0?void 0:t.length))return 0;var e=0;for(var r in this.arr)e+=Math.pow(this.arr[r],2);return Math.sqrt(e)},c.prototype.dot=function(t){var e,r=t.arr;if(!((e=this.arr)===null||e===void 0?void 0:e.length)||!(r==null?void 0:r.length))return 0;if(this.arr.length===r.length){var n=0;for(var a in this.arr)n+=this.arr[a]*t.arr[a];return n}else console.error("The two vectors are unequal in length.")},c.prototype.equal=function(t){var e,r=t.arr;if(((e=this.arr)===null||e===void 0?void 0:e.length)!==(r==null?void 0:r.length))return!1;for(var n in this.arr)if(this.arr[n]!==r[n])return!1;return!0},c}(),Rr=gn,ct=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/,Wt=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/,Er=function(t,e){t===void 0&&(t=[]),e===void 0&&(e=100);var r={};t.forEach(function(a){!a.properties||Object.keys(a.properties).forEach(function(i){if(i==="id"||!"".concat(a.properties[i]).match(ct)&&!"".concat(a.properties[i]).match(Wt)&&isNaN(Number(a.properties[i]))){r.hasOwnProperty(i)&&delete r[i];return}r.hasOwnProperty(i)?r[i]+=1:r[i]=1})});var n=Object.keys(r).sort(function(a,i){return r[i]-r[a]});return n.length<e?n:n.slice(0,e)},Dr=function(t,e){return e.map(function(r){return t.hasOwnProperty(r)?t[r]:0})},Vr=function(t){for(var e=Er(t),r=[],n=0;n<t.length;n++)r[n]=Dr(t[n].properties,e);return r},pn=function(t,e){e===void 0&&(e=void 0);var r=[];return t.forEach(function(n){e===void 0&&r.push(n),n[e]!==void 0&&r.push(n[e])}),r},wn={getAllSortProperties:Er,getPropertyWeight:Vr,getAllProperties:pn},Sn;(function(c){c.EuclideanDistance="euclideanDistance"})(Sn||(Sn={}));var In=function(t,e,r){var n=[];(e==null?void 0:e.length)?n=e:(t.forEach(function(i){n=n.concat(Object.keys(i))}),n=(0,m.uniq)(n));var a={};return n.forEach(function(i){var o=[];t.forEach(function(s){s[i]!==void 0&&s[i]!==""&&o.push(s[i])}),o.length&&!(r==null?void 0:r.includes(i))&&(a[i]=(0,m.uniq)(o))}),a},$n=function(t,e,r){var n=In(t,e,r),a=[];if(!Object.keys(n).length)return a;var i=Object.values(n),o=i.every(function(s){return s.every(function(l){return typeof l=="number"})});return t.forEach(function(s,l){var h=[];Object.keys(n).forEach(function(p){var D=s[p],I=n[p],F=I.findIndex(function(se){return D===se}),Z=[];if(o)Z.push(D);else for(var ee=0;ee<I.length;ee++)ee===F?Z.push(1):Z.push(0);h=h.concat(Z)}),a[l]=h}),a},Zr=function(t,e,r,n){r===void 0&&(r=Sn.EuclideanDistance);var a=0;switch(r){case Sn.EuclideanDistance:a=new Rr(t).euclideanDistance(new Rr(e));break;default:break}return a},Pn={getAllKeyValueMap:In,oneHot:$n,getDistance:Zr},An=function(t,e,r,n){for(var a=e.length,i=2*n,o=0,s=0;s<a;s++)for(var l=t[s].clusterId,h=0;h<a;h++){var p=t[h].clusterId;if(l===p){var D=e[s][h]||0,I=r[s]||0,F=r[h]||0;o+=D-I*F/i}}return o*=1/i,o},ln=function(t,e){t===void 0&&(t=[]);for(var r=t.length,n=new Rr([]),a=0;a<r;a++)n=n.add(new Rr(e[a]));var i=n.avg(r);i.normalize();for(var o=0,a=0;a<r;a++){var s=new Rr(e[a]),l=s.squareEuclideanDistance(i);o+=l}var h=[];t.forEach(function(){h.push([])});for(var a=0;a<r;a++){var s=new Rr(e[a]);t[a].clusterInertial=0;for(var p=0;p<r;p++){if(a===p){h[a][p]=0;continue}var D=new Rr(e[p]);h[a][p]=s.squareEuclideanDistance(D),t[a].clusterInertial+=h[a][p]}}for(var I=0,F=2*r*o,a=0;a<r;a++)for(var Z=t[a].clusterId,p=0;p<r;p++){var ee=t[p].clusterId;if(!(a===p||Z!==ee)){var se=t[a].clusterInertial*t[p].clusterInertial/Math.pow(F,2)-h[a][p]/F;I+=se}}return Number(I.toFixed(4))},va=function(t,e,r,n,a,i,o,s,l){e===void 0&&(e=!1),r===void 0&&(r="weight"),n===void 0&&(n=1e-4),a===void 0&&(a=!1),i===void 0&&(i=void 0),o===void 0&&(o=[]),s===void 0&&(s=["id"]),l===void 0&&(l=1);var h=t.nodes,p=h===void 0?[]:h,D=t.edges,I=D===void 0?[]:D,F=[];if(a){p.forEach(function(er,mr){er.properties=er.properties||{},er.originIndex=mr});var Z=[];p.every(function(er){return er.hasOwnProperty("nodeType")})&&(Z=Array.from(new Set(p.map(function(er){return er.nodeType}))),p.forEach(function(er){er.properties.nodeType=Z.findIndex(function(mr){return mr===er.nodeType})}));var ee=pn(p,i);F=$n(ee,o,s)}var se=1,oe={},ce={};p.forEach(function(er,mr){var kr=String(se++);er.clusterId=kr,oe[kr]={id:kr,nodes:[er]},ce[er.id]={node:er,idx:mr}});var we=te(t,e),Re=[],Oe={},Pe=0;we.forEach(function(er,mr){var kr=0,Fr=p[mr].id;Oe[Fr]={},er.forEach(function(Jr,fn){if(!!Jr){kr+=Jr;var Vn=p[fn].id;Oe[Fr][Vn]=Jr,Pe+=Jr}}),Re.push(kr)}),Pe/=2;for(var He=Infinity,at=Infinity,qe=0,yt=[],Ft={};;){a&&p.every(function(er){return er.hasOwnProperty("properties")})?He=An(p,we,Re,Pe)+ln(p,F)*l:He=An(p,we,Re,Pe),qe===0&&(at=He,yt=p,Ft=oe);var yr=He>0&&He>at&&He-at<n;if(He>at&&(yt=p.map(function(er){return{node:er,clusterId:er.clusterId}}),Ft=(0,m.clone)(oe),at=He),yr||qe>100)break;qe++,Object.keys(oe).forEach(function(er){var mr=0;I.forEach(function(kr){var Fr=kr.source,Jr=kr.target,fn=ce[Fr].node.clusterId,Vn=ce[Jr].node.clusterId;(fn===er&&Vn!==er||Vn===er&&fn!==er)&&(mr=mr+(kr[r]||1))}),oe[er].sumTot=mr}),p.forEach(function(er,mr){var kr=oe[er.clusterId],Fr=0,Jr,fn=Re[mr]/(2*Pe),Vn=0,Tn=kr.nodes;Tn.forEach(function(Qa){var Ja=ce[Qa.id].idx;Vn+=we[mr][Ja]||0});var wa=Vn-kr.sumTot*fn,ua=Tn.filter(function(Qa){return Qa.id!==er.id}),fa=[];ua.forEach(function(Qa,Ja){fa[Ja]=F[Qa.originIndex]});var Ma=ln(ua,F)*l,ja=Oe[er.id];if(Object.keys(ja).forEach(function(Qa){var Ja=ce[Qa].node,oi=Ja.clusterId;if(oi!==er.clusterId){var Si=oe[oi],Ai=Si.nodes;if(!(!Ai||!Ai.length)){var la=0;Ai.forEach(function(pa){var ma=ce[pa.id].idx;la+=we[mr][ma]||0});var Ca=la-Si.sumTot*fn,Xn=Ai.concat([er]),Ta=[];Xn.forEach(function(pa,ma){Ta[ma]=F[pa.originIndex]});var Na=ln(Xn,F)*l,cn=Ca-wa;a&&(cn=Ca+Na-(wa+Ma)),cn>Fr&&(Fr=cn,Jr=Si)}}}),Fr>0){Jr.nodes.push(er);var Ra=er.clusterId;er.clusterId=Jr.id;var uo=kr.nodes.indexOf(er);kr.nodes.splice(uo,1);var Da=0,fo=0;I.forEach(function(Qa){var Ja=Qa.source,oi=Qa.target,Si=ce[Ja].node.clusterId,Ai=ce[oi].node.clusterId;(Si===Jr.id&&Ai!==Jr.id||Ai===Jr.id&&Si!==Jr.id)&&(Da=Da+(Qa[r]||1)),(Si===Ra&&Ai!==Ra||Ai===Ra&&Si!==Ra)&&(fo=fo+(Qa[r]||1))}),Jr.sumTot=Da,kr.sumTot=fo}})}var fr={},lr=0;Object.keys(Ft).forEach(function(er){var mr=Ft[er];if(!mr.nodes||!mr.nodes.length){delete Ft[er];return}var kr=String(lr+1);kr!==er&&(mr.id=kr,mr.nodes=mr.nodes.map(function(Fr){return{id:Fr.id,clusterId:kr}}),Ft[kr]=mr,fr[er]=kr,delete Ft[er],lr++)}),yt.forEach(function(er){var mr=er.node,kr=er.clusterId;!mr||(mr.clusterId=kr,mr.clusterId&&fr[mr.clusterId]&&(mr.clusterId=fr[mr.clusterId]))});var Kt=[],jr={};I.forEach(function(er){var mr=er.source,kr=er.target,Fr=er[r]||1,Jr=ce[mr].node.clusterId,fn=ce[kr].node.clusterId;if(!(!Jr||!fn)){var Vn="".concat(Jr,"---").concat(fn);if(jr[Vn])jr[Vn].weight+=Fr,jr[Vn].count++;else{var Tn={source:Jr,target:fn,weight:Fr,count:1};jr[Vn]=Tn,Kt.push(Tn)}}});var Xr=[];return Object.keys(Ft).forEach(function(er){Xr.push(Ft[er])}),{clusters:Xr,clusterEdges:Kt}},K=va,Dt=function(t,e,r,n,a,i,o,s){return e===void 0&&(e=!1),r===void 0&&(r="weight"),n===void 0&&(n=1e-4),a===void 0&&(a=void 0),i===void 0&&(i=[]),o===void 0&&(o=["id"]),s===void 0&&(s=1),K(t,e,r,n,!0,a,i,o,s)},rt=Dt,ne=function(t,e){var r;e===void 0&&(e=1);for(var n=(0,m.clone)(t),a=n.nodes,i=a===void 0?[]:a,o=n.edges,s=o===void 0?[]:o,l=function(){var D=St({nodes:i,edges:s}),I=Object.keys(D);I.sort(function(ee,se){var oe,ce;return((oe=D[ee])===null||oe===void 0?void 0:oe.degree)-((ce=D[se])===null||ce===void 0?void 0:ce.degree)});var F=I[0];if(!i.length||((r=D[F])===null||r===void 0?void 0:r.degree)>=e)return"break";var Z=i.findIndex(function(ee){return ee.id===F});i.splice(Z,1),s=s.filter(function(ee){return!(ee.source===F||ee.target===F)})};;){var h=l();if(h==="break")break}return{nodes:i,edges:s}},ae=ne,P=function(t,e,r){var n=[];switch(t){case Sn.EuclideanDistance:n=e[r];break;default:n=[];break}return n},S=function(t,e,r,n,a,i){e===void 0&&(e=3),r===void 0&&(r=void 0),n===void 0&&(n=[]),a===void 0&&(a=["id"]),i===void 0&&(i=Sn.EuclideanDistance);var o=t.nodes,s=o===void 0?[]:o,l=t.edges,h=l===void 0?[]:l,p={clusters:[{id:"0",nodes:s}],clusterEdges:[]};if(i===Sn.EuclideanDistance&&!s.every(function(kr){return kr.hasOwnProperty(r)}))return p;var D=[],I=[];if(i===Sn.EuclideanDistance&&(D=pn(s,r),I=$n(D,n,a)),!I.length)return p;for(var F=(0,m.uniq)(I.map(function(kr){return kr.join("")})),Z=Math.min(e,s.length,F.length),ee=0;ee<s.length;ee++)s[ee].originIndex=ee;for(var se=[],oe=[],ce=[],ee=0;ee<Z;ee++)if(ee===0){var we=Math.floor(Math.random()*s.length);switch(i){case Sn.EuclideanDistance:se[ee]=I[we];break;default:se[ee]=[];break}oe.push(we),ce[ee]=[s[we]],s[we].clusterId=String(ee)}else{for(var Re=-Infinity,Oe=0,Pe=function(Jr){if(!oe.includes(Jr)){for(var fn=0,Vn=0;Vn<se.length;Vn++){var Tn=0;switch(i){case Sn.EuclideanDistance:Tn=Zr(I[s[Jr].originIndex],se[Vn],i);break;default:break}fn+=Tn}var wa=fn/se.length;wa>Re&&!se.find(function(ua){return(0,m.isEqual)(ua,P(i,I,s[Jr].originIndex))})&&(Re=wa,Oe=Jr)}},He=0;He<s.length;He++)Pe(He);se[ee]=P(i,I,Oe),oe.push(Oe),ce[ee]=[s[Oe]],s[Oe].clusterId=String(ee)}for(var at=0;;){for(var ee=0;ee<s.length;ee++){var qe=0,yt=Infinity;if(!(at===0&&oe.includes(ee))){for(var Ft=0;Ft<se.length;Ft++){var yr=0;switch(i){case Sn.EuclideanDistance:yr=Zr(I[ee],se[Ft],i);break;default:break}yr<yt&&(yt=yr,qe=Ft)}if(s[ee].clusterId!==void 0)for(var fr=ce[Number(s[ee].clusterId)].length-1;fr>=0;fr--)ce[Number(s[ee].clusterId)][fr].id===s[ee].id&&ce[Number(s[ee].clusterId)].splice(fr,1);s[ee].clusterId=String(qe),ce[qe].push(s[ee])}}for(var lr=!1,ee=0;ee<ce.length;ee++){for(var Kt=ce[ee],jr=new Rr([]),Ft=0;Ft<Kt.length;Ft++)jr=jr.add(new Rr(I[Kt[Ft].originIndex]));var Xr=jr.avg(Kt.length);Xr.equal(new Rr(se[ee]))||(lr=!0,se[ee]=Xr.getArr())}if(at++,s.every(function(kr){return kr.clusterId!==void 0})&&lr||at>=1e3)break}var er=[],mr={};return h.forEach(function(kr){var Fr,Jr,fn=kr.source,Vn=kr.target,Tn=(Fr=s.find(function(Ma){return Ma.id===fn}))===null||Fr===void 0?void 0:Fr.clusterId,wa=(Jr=s.find(function(Ma){return Ma.id===Vn}))===null||Jr===void 0?void 0:Jr.clusterId,ua="".concat(Tn,"---").concat(wa);if(mr[ua])mr[ua].count++;else{var fa={source:Tn,target:wa,count:1};mr[ua]=fa,er.push(fa)}}),{clusters:ce,clusterEdges:er}},C=S,V=function(t,e){var r=new Rr(e),n=r.norm2(),a=new Rr(t),i=a.norm2(),o=r.dot(a),s=n*i,l=s?o/s:0;return l},he=V,xe=function(t,e,r,n,a){t===void 0&&(t=[]),r===void 0&&(r=void 0),n===void 0&&(n=[]),a===void 0&&(a=[]);var i=(0,m.clone)(t.filter(function(D){return D.id!==e.id})),o=t.findIndex(function(D){return D.id===e.id}),s=pn(t,r),l=$n(s,n,a),h=l[o],p=[];return i.forEach(function(D,I){if(D.id!==e.id){var F=l[I],Z=he(F,h);p.push(Z),D.cosineSimilarity=Z}}),i.sort(function(D,I){return I.cosineSimilarity-D.cosineSimilarity}),{allCosineSimilarity:p,similarNodes:i}},Ee=xe,Ne=function(){function c(t){this.count=t.length,this.parent={};for(var e=0,r=t;e<r.length;e++){var n=r[e];this.parent[n]=n}}return c.prototype.find=function(t){for(;this.parent[t]!==t;)t=this.parent[t];return t},c.prototype.union=function(t,e){var r=this.find(t),n=this.find(e);r!==n&&(r<n?(this.parent[e]!==e&&this.union(this.parent[e],t),this.parent[e]=this.parent[t]):(this.parent[t]!==t&&this.union(this.parent[t],e),this.parent[t]=this.parent[e]))},c.prototype.connected=function(t,e){return this.find(t)===this.find(e)},c}(),Et=Ne,st=function(t,e){return t-e},Pt=function(){function c(t){t===void 0&&(t=st),this.compareFn=t,this.list=[]}return c.prototype.getLeft=function(t){return 2*t+1},c.prototype.getRight=function(t){return 2*t+2},c.prototype.getParent=function(t){return t===0?null:Math.floor((t-1)/2)},c.prototype.isEmpty=function(){return this.list.length<=0},c.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},c.prototype.delMin=function(){var t=this.top(),e=this.list.pop();return this.list.length>0&&(this.list[0]=e,this.moveDown(0)),t},c.prototype.insert=function(t){if(t!==null){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},c.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var r=this.list[e];this.list[e]=this.list[t],this.list[t]=r,t=e,e=this.getParent(t)}},c.prototype.moveDown=function(t){var e,r=t,n=this.getLeft(t),a=this.getRight(t),i=this.list.length;n!==null&&n<i&&this.compareFn(this.list[r],this.list[n])>0?r=n:a!==null&&a<i&&this.compareFn(this.list[r],this.list[a])>0&&(r=a),t!==r&&(e=[this.list[r],this.list[t]],this.list[t]=e[0],this.list[r]=e[1],this.moveDown(r))},c}(),$t=Pt,Ht=function(t,e){var r=[],n=t.nodes,a=n===void 0?[]:n,i=t.edges,o=i===void 0?[]:i;if(a.length===0)return r;var s=a[0],l=new Set;l.add(s);var h=function(ee,se){return e?ee.weight-se.weight:0},p=new $t(h);for(De(s.id,o).forEach(function(Z){p.insert(Z)});!p.isEmpty();){var D=p.delMin(),I=D.source,F=D.target;l.has(I)&&l.has(F)||(r.push(D),l.has(I)||(l.add(I),De(I,o).forEach(function(Z){p.insert(Z)})),l.has(F)||(l.add(F),De(F,o).forEach(function(Z){p.insert(Z)})))}return r},Br=function(t,e){var r=[],n=t.nodes,a=n===void 0?[]:n,i=t.edges,o=i===void 0?[]:i;if(a.length===0)return r;var s=o.map(function(I){return I});e&&s.sort(function(I,F){return I.weight-F.weight});for(var l=new Et(a.map(function(I){return I.id}));s.length>0;){var h=s.shift(),p=h.source,D=h.target;l.connected(p,D)||(r.push(h),l.union(p,D))}return r},hn=function(t,e,r){var n={prim:Ht,kruskal:Br};return r?n[r](t,e):Br(t,e)},Ot=hn,Qt=function(t,e,r){typeof e!="number"&&(e=1e-6),typeof r!="number"&&(r=.85);for(var n=1,a=0,i=1e3,o=t.nodes,s=o===void 0?[]:o,l=t.edges,h=l===void 0?[]:l,p=s.length,D,I={},F={},Z=0;Z<p;++Z){var ee=s[Z],se=ee.id;I[se]=1/p,F[se]=1/p}for(var oe=St(t);i>0&&n>e;){a=0;for(var Z=0;Z<p;++Z){var ee=s[Z],se=ee.id;if(D=0,oe[ee.id].inDegree===0)I[se]=0;else{for(var ce=pe(se,h,"source"),we=0;we<ce.length;++we){var Re=ce[we],Oe=oe[Re].outDegree;Oe>0&&(D+=F[Re]/Oe)}I[se]=r*D,a+=I[se]}}a=(1-a)/p,n=0;for(var Z=0;Z<p;++Z){var ee=s[Z],se=ee.id;D=I[se]+a,n+=Math.abs(D-F[se]),F[se]=D}i-=1}return F},pr=Qt,en=-1,Nr=-1,ta="-1",kn="-1",En=-1,Rn="-1",Yn=function(){function c(t,e,r,n){t===void 0&&(t=en),e===void 0&&(e=Nr),r===void 0&&(r=Nr),n===void 0&&(n=ta),this.id=t,this.from=e,this.to=r,this.label=n}return c}(),bn=function(){function c(t,e){t===void 0&&(t=Nr),e===void 0&&(e=kn),this.id=t,this.label=e,this.edges=[],this.edgeMap={}}return c.prototype.addEdge=function(t){this.edges.push(t),this.edgeMap[t.id]=t},c}(),je=function(){function c(t,e,r){t===void 0&&(t=Nr),e===void 0&&(e=!0),r===void 0&&(r=!1),this.id=t,this.edgeIdAutoIncrease=e,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=r}return c.prototype.getNodeNum=function(){return this.nodes.length},c.prototype.addNode=function(t,e){if(!this.nodeMap[t]){var r=new bn(t,e);this.nodes.push(r),this.nodeMap[t]=r,this.nodeLabelMap[e]||(this.nodeLabelMap[e]=[]),this.nodeLabelMap[e].push(t)}},c.prototype.addEdge=function(t,e,r,n){if((this.edgeIdAutoIncrease||t===void 0)&&(t=this.counter++),!(this.nodeMap[e]&&this.nodeMap[r]&&this.nodeMap[r].edgeMap[t])){var a=new Yn(t,e,r,n);if(this.edges.push(a),this.edgeMap[t]=a,this.nodeMap[e].addEdge(a),this.edgeLabelMap[n]||(this.edgeLabelMap[n]=[]),this.edgeLabelMap[n].push(a),!this.directed){var i=new Yn(t,r,e,n);this.nodeMap[r].addEdge(i),this.edgeLabelMap[n].push(i)}}},c}(),Ce=function(){function c(t,e,r,n,a){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:r||kn,edgeLabel:n||ta,nodeLabel2:a||kn}}return c.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},c.prototype.notEqualTo=function(t){return!this.equalTo(t)},c}(),Xe=function(){function c(){this.rmpath=[],this.dfsEdgeList=[]}return c.prototype.equalTo=function(t){var e=this.dfsEdgeList.length,r=t.length;if(e!==r)return!1;for(var n=0;n<e;n++)if(this.dfsEdgeList[n]!==t[n])return!1;return!0},c.prototype.notEqualTo=function(t){return!this.equalTo(t)},c.prototype.pushBack=function(t,e,r,n,a){return this.dfsEdgeList.push(new Ce(t,e,r,n,a)),this.dfsEdgeList},c.prototype.toGraph=function(t,e){t===void 0&&(t=En),e===void 0&&(e=!1);var r=new je(t,!0,e);return this.dfsEdgeList.forEach(function(n){var a=n.fromNode,i=n.toNode,o=n.nodeEdgeNodeLabel,s=o.nodeLabel1,l=o.edgeLabel,h=o.nodeLabel2;s!==kn&&r.addNode(a,s),h!==kn&&r.addNode(i,h),s!==kn&&h!==s&&r.addEdge(void 0,a,i,l)}),r},c.prototype.buildRmpath=function(){this.rmpath=[];for(var t=void 0,e=this.dfsEdgeList.length,r=e-1;r>=0;r--){var n=this.dfsEdgeList[r],a=n.fromNode,i=n.toNode;a<i&&(t===void 0||i===t)&&(this.rmpath.push(r),t=a)}return this.rmpath},c.prototype.getNodeNum=function(){var t={};return this.dfsEdgeList.forEach(function(e){t[e.fromNode]||(t[e.fromNode]=!0),t[e.toNode]||(t[e.toNode]=!0)}),Object.keys(t).length},c}(),ut=function(){function c(t){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!t){for(;t;){var e=t.edge;this.edges.push(e),this.nodesUsed[e.from]=1,this.nodesUsed[e.to]=1,this.edgesUsed[e.id]=1,t=t.preNode}this.edges=this.edges.reverse()}}return c.prototype.hasNode=function(t){return this.nodesUsed[t.id]===1},c.prototype.hasEdge=function(t){return this.edgesUsed[t.id]===1},c}(),ot=function(){function c(t){var e=t.graphs,r=t.minSupport,n=r===void 0?2:r,a=t.minNodeNum,i=a===void 0?1:a,o=t.maxNodeNum,s=o===void 0?4:o,l=t.top,h=l===void 0?10:l,p=t.directed,D=p===void 0?!1:p,I=t.verbose,F=I===void 0?!1:I;this.graphs=e,this.dfsCode=new Xe,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=n,this.top=h,this.directed=D,this.counter=0,this.maxNodeNum=s,this.minNodeNum=i,this.verbose=F,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return c.prototype.findForwardRootEdges=function(t,e){var r=this,n=[],a=t.nodeMap;return e.edges.forEach(function(i){(r.directed||e.label<=a[i.to].label)&&n.push(i)}),n},c.prototype.findBackwardEdge=function(t,e,r,n){if(!this.directed&&e===r)return null;for(var a=t.nodeMap,i=a[r.to],o=i.edges,s=o.length,l=0;l<s;l++){var h=o[l];if(!(n.hasEdge(h)||h.to!==e.from)){if(this.directed){if(a[e.from].label<a[r.to].label||a[e.from].label===a[r.to].label&&e.label<=h.label)return h}else if(e.label<h.label||e.label===h.label&&a[e.to].label<=a[r.to].label)return h}}return null},c.prototype.findForwardPureEdges=function(t,e,r,n){for(var a=[],i=e.to,o=t.nodeMap[i].edges,s=o.length,l=0;l<s;l++){var h=o[l],p=t.nodeMap[h.to];r<=p.label&&!n.hasNode(p)&&a.push(h)}return a},c.prototype.findForwardRmpathEdges=function(t,e,r,n){for(var a=[],i=t.nodeMap,o=i[e.to].label,s=i[e.from],l=s.edges,h=l.length,p=0;p<h;p++){var D=l[p],I=i[D.to].label;e.to===D.to||r>I||n.hasNode(i[D.to])||(e.label<D.label||e.label===D.label&&o<=I)&&a.push(D)}return a},c.prototype.getSupport=function(t){var e={};return t.forEach(function(r){e[r.graphId]||(e[r.graphId]=!0)}),Object.keys(e).length},c.prototype.findMinLabel=function(t){var e=void 0;return Object.keys(t).forEach(function(r){var n=t[r],a=n.nodeLabel1,i=n.edgeLabel,o=n.nodeLabel2;if(!e){e={nodeLabel1:a,edgeLabel:i,nodeLabel2:o};return}(a<e.nodeLabel1||a===e.nodeLabel1&&i<e.edgeLabel||a===e.nodeLabel1&&i===e.edgeLabel&&o<e.nodeLabel2)&&(e={nodeLabel1:a,edgeLabel:i,nodeLabel2:o})}),e},c.prototype.isMin=function(){var t=this,e=this.dfsCode;if(this.verbose&&console.log("isMin checking",e),e.dfsEdgeList.length===1)return!0;var r=this.directed,n=e.toGraph(En,r),a=n.nodeMap,i=new Xe,o={};n.nodes.forEach(function(p){var D=t.findForwardRootEdges(n,p);D.forEach(function(I){var F=a[I.to],Z="".concat(p.label,"-").concat(I.label,"-").concat(F.label);o[Z]||(o[Z]={projected:[],nodeLabel1:p.label,edgeLabel:I.label,nodeLabel2:F.label});var ee={graphId:n.id,edge:I,preNode:null};o[Z].projected.push(ee)})});var s=this.findMinLabel(o);if(!!s){i.dfsEdgeList.push(new Ce(0,1,s.nodeLabel1,s.edgeLabel,s.nodeLabel2));var l=function p(D){for(var I=i.buildRmpath(),F=i.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,Z=i.dfsEdgeList[I[0]].toNode,ee={},se=!1,oe=0,ce=r?-1:0,we=function(jr){if(se)return"break";D.forEach(function(Xr){var er=new ut(Xr),mr=t.findBackwardEdge(n,er.edges[I[jr]],er.edges[I[0]],er);mr&&(ee[mr.label]||(ee[mr.label]={projected:[],edgeLabel:mr.label}),ee[mr.label].projected.push({graphId:n.id,edge:ee,preNode:Xr}),oe=i.dfsEdgeList[I[jr]].fromNode,se=!0)})},Re=I.length-1;Re>ce;Re--){var Oe=we(Re);if(Oe==="break")break}if(se){var Pe=t.findMinLabel(ee);i.dfsEdgeList.push(new Ce(Z,oe,kn,Pe.edgeLabel,kn));var He=i.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[He]!==i.dfsEdgeList[He]?!1:p(ee[Pe.edgeLabel].projected)}var at={};se=!1;var qe=0;D.forEach(function(Kt){var jr=new ut(Kt),Xr=t.findForwardPureEdges(n,jr.edges[I[0]],F,jr);Xr.length>0&&(se=!0,qe=Z,Xr.forEach(function(er){var mr="".concat(er.label,"-").concat(a[er.to].label);at[mr]||(at[mr]={projected:[],edgeLabel:er.label,nodeLabel2:a[er.to].label}),at[mr].projected.push({graphId:n.id,edge:er,preNode:Kt})}))});for(var yt=I.length,Ft=function(jr){if(se)return"break";var Xr=I[jr];D.forEach(function(er){var mr=new ut(er),kr=t.findForwardRmpathEdges(n,mr.edges[Xr],F,mr);kr.length>0&&(se=!0,qe=i.dfsEdgeList[Xr].fromNode,kr.forEach(function(Fr){var Jr="".concat(Fr.label,"-").concat(a[Fr.to].label);at[Jr]||(at[Jr]={projected:[],edgeLabel:Fr.label,nodeLabel2:a[Fr.to].label}),at[Jr].projected.push({graphId:n.id,edge:Fr,preNode:er})}))})},Re=0;Re<yt;Re++){var yr=Ft(Re);if(yr==="break")break}if(!se)return!0;var fr=t.findMinLabel(at);i.dfsEdgeList.push(new Ce(qe,Z+1,kn,fr.edgeLabel,fr.nodeLabel2));var lr=i.dfsEdgeList.length-1;return e.dfsEdgeList[lr]!==i.dfsEdgeList[lr]?!1:p(at["".concat(fr.edgeLabel,"-").concat(fr.nodeLabel2)].projected)},h="".concat(s.nodeLabel1,"-").concat(s.edgeLabel,"-").concat(s.nodeLabel2);return l(o[h].projected)}},c.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var t=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push((0,m.clone)(t))}},c.prototype.subGraphMining=function(t){var e=this,r=this.getSupport(t);if(!(r<this.minSupport)&&!!this.isMin()){this.report();var n=this.dfsCode.getNodeNum(),a=this.dfsCode.buildRmpath(),i=this.dfsCode.dfsEdgeList[a[0]].toNode,o=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,s={},l={};t.forEach(function(h){for(var p=e.graphs[h.graphId],D=p.nodeMap,I=new ut(h),F=a.length-1;F>=0;F--){var Z=e.findBackwardEdge(p,I.edges[a[F]],I.edges[a[0]],I);if(Z){var ee="".concat(e.dfsCode.dfsEdgeList[a[F]].fromNode,"-").concat(Z.label);l[ee]||(l[ee]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[a[F]].fromNode,edgeLabel:Z.label}),l[ee].projected.push({graphId:h.graphId,edge:Z,preNode:h})}}if(!(n>=e.maxNodeNum)){var se=e.findForwardPureEdges(p,I.edges[a[0]],o,I);se.forEach(function(ce){var we="".concat(i,"-").concat(ce.label,"-").concat(D[ce.to].label);s[we]||(s[we]={projected:[],fromNodeId:i,edgeLabel:ce.label,nodeLabel2:D[ce.to].label}),s[we].projected.push({graphId:h.graphId,edge:ce,preNode:h})});for(var oe=function(we){var Re=e.findForwardRmpathEdges(p,I.edges[a[we]],o,I);Re.forEach(function(Oe){var Pe="".concat(e.dfsCode.dfsEdgeList[a[we]].fromNode,"-").concat(Oe.label,"-").concat(D[Oe.to].label);s[Pe]||(s[Pe]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[a[we]].fromNode,edgeLabel:Oe.label,nodeLabel2:D[Oe.to].label}),s[Pe].projected.push({graphId:h.graphId,edge:Oe,preNode:h})})},F=0;F<a.length;F++)oe(F)}}),Object.keys(l).forEach(function(h){var p=l[h],D=p.toNodeId,I=p.edgeLabel;e.dfsCode.dfsEdgeList.push(new Ce(i,D,"-1",I,"-1")),e.subGraphMining(l[h].projected),e.dfsCode.dfsEdgeList.pop()}),Object.keys(s).forEach(function(h){var p=s[h],D=p.fromNodeId,I=p.edgeLabel,F=p.nodeLabel2;e.dfsCode.dfsEdgeList.push(new Ce(D,i+1,kn,I,F)),e.subGraphMining(s[h].projected),e.dfsCode.dfsEdgeList.pop()})}},c.prototype.generate1EdgeFrequentSubGraphs=function(){var t=this.graphs,e=this.directed,r=this.minSupport,n=this.frequentSize1Subgraphs,a={},i={},o={},s={};return Object.keys(t).forEach(function(l){var h=t[l],p=h.nodeMap;h.nodes.forEach(function(D,I){var F=D.label,Z="".concat(l,"-").concat(F);if(!o[Z]){var ee=a[F]||0;ee++,a[F]=ee}o[Z]={graphKey:l,label:F},D.edges.forEach(function(se){var oe=F,ce=p[se.to].label;if(!e&&oe>ce){var we=ce;ce=oe,oe=we}var Re=se.label,Oe="".concat(l,"-").concat(oe,"-").concat(Re,"-").concat(ce),Pe="".concat(oe,"-").concat(Re,"-").concat(ce);if(!i[Pe]){var He=i[Pe]||0;He++,i[Pe]=He}s[Oe]={graphId:l,nodeLabel1:oe,edgeLabel:Re,nodeLabel2:ce}})})}),Object.keys(a).forEach(function(l){var h=a[l];if(!(h<r)){var p={nodes:[],edges:[]};p.nodes.push({id:"0",label:l}),n.push(p)}}),n},c.prototype.run=function(){var t=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var e=this.graphs,r=this.directed,n={};Object.keys(e).forEach(function(a){var i=e[a],o=i.nodeMap;i.nodes.forEach(function(s){var l=t.findForwardRootEdges(i,s);l.forEach(function(h){var p=o[h.to],D="".concat(s.label,"-").concat(h.label,"-").concat(p.label);n[D]||(n[D]={projected:[],nodeLabel1:s.label,edgeLabel:h.label,nodeLabel2:p.label});var I={graphId:a,edge:h,preNode:null};n[D].projected.push(I)})})}),Object.keys(n).forEach(function(a){var i=n[a],o=i.projected,s=i.nodeLabel1,l=i.edgeLabel,h=i.nodeLabel2;t.dfsCode.dfsEdgeList.push(new Ce(0,1,s,l,h)),t.subGraphMining(o),t.dfsCode.dfsEdgeList.pop()})}},c}(),bt=function(t,e,r,n){var a={};return Object.keys(t).forEach(function(i,o){var s=t[i],l=new je(o,!0,e),h={};s.nodes.forEach(function(p,D){l.addNode(D,p[r]),h[p.id]=D}),s.edges.forEach(function(p,D){var I=h[p.source],F=h[p.target];l.addEdge(-1,I,F,p[n])}),l&&l.getNodeNum()&&(a[l.id]=l)}),a},Xt=function(t,e,r){var n=[];return t.forEach(function(a){var i={nodes:[],edges:[]};a.nodes.forEach(function(o){var s;i.nodes.push((s={id:"".concat(o.id)},s[e]=o.label,s))}),a.edges.forEach(function(o){var s;i.edges.push((s={source:"".concat(o.from),target:"".concat(o.to)},s[r]=o.label,s))}),n.push(i)}),n},wr="cluster",Wr=function(t){var e=t.graphs,r=t.directed,n=r===void 0?!1:r,a=t.nodeLabelProp,i=a===void 0?wr:a,o=t.edgeLabelProp,s=o===void 0?wr:o,l=bt(e,n,i,s),h=t.minSupport,p=t.maxNodeNum,D=t.minNodeNum,I=t.verbose,F=t.top,Z={graphs:l,minSupport:h,maxNodeNum:p,minNodeNum:D,top:F,verbose:I,directed:n},ee=new ot(Z);ee.run();var se=Xt(ee.frequentSubgraphs,i,s);return se},on=Wr,xn=function(t,e,r,n){r===void 0&&(r="cluster"),n===void 0&&(n=2);var a=[],i=t.nodes;return e.forEach(function(o,s){a.push(zn(i,o,s,r,n))}),a},zn=function(t,e,r,n,a){var i=[r],o=[],s={};return e.forEach(function(l,h){if(l<=a&&r!==h){i.push(h),o.push(t[h]);var p=t[h][n];s[p]?(s[p].count++,s[p].dists.push(l)):s[p]={count:1,dists:[l]}}}),Object.keys(s).forEach(function(l){s[l].dists=s[l].dists.sort(function(h,p){return h-p})}),{nodeIdx:r,nodeId:t[r].id,nodeIdxs:i,neighbors:o,neighborNum:i.length-1,nodeLabelCountMap:s}},Qn=function(t,e,r,n,a){var i=Math.ceil(r/e),o={},s=0;return n.forEach(function(l,h){for(var p=0,D=0,I=l.nodeIdxs,F=l.neighborNum-1;p<i;){for(var Z=I[1+Math.floor(Math.random()*F)],ee=0;(o["".concat(h,"-").concat(Z)]||o["".concat(Z,"-").concat(h)])&&(Z=Math.floor(Math.random()*e),ee++,!(ee>2*e)););if(ee<2*e&&(o["".concat(h,"-").concat(Z)]={start:h,end:Z,distance:a[h][Z]},p++,s++,s>=r))return o;if(D++,D>2*e)break}if(p<i){var se=i-p;i=(i+se)/(e-h-1)}}),o},ia=function(t,e,r,n){var a=r.nodes;return n||(n={}),Object.keys(t).forEach(function(i){var o,s;if(!(n&&n[i])){n[i]={nodes:[],edges:[]};var l=t[i],h=(o=e[l.start])===null||o===void 0?void 0:o.nodeIdxs,p=(s=e[l.end])===null||s===void 0?void 0:s.nodeIdxs;if(!(!h||!p)){var D=new Set(p),I=h.filter(function(oe){return D.has(oe)});if(!(!I||!I.length)){for(var F={},Z=I.length,ee=0;ee<Z;ee++){var se=a[I[ee]];n[i].nodes.push(se),F[se.id]=!0}r.edges.forEach(function(oe){F[oe.source]&&F[oe.target]&&n[i].edges.push(oe)})}}}}),n},Wa=function(t,e,r,n){var a,i,o={};t.nodes.forEach(function(l){o[l.id]=l});var s=0;return!((a=e==null?void 0:e.edges)===null||a===void 0?void 0:a.length)||((i=e==null?void 0:e.nodes)===null||i===void 0?void 0:i.length)<2?0:(t.edges.forEach(function(l){var h=o[l.source][r],p=o[l.target][r],D=e==null?void 0:e.nodes[0][r],I=e==null?void 0:e.nodes[1][r],F=e==null?void 0:e.edges[0][n];l[n]===F&&(h===D&&p===I||h===I&&p===D)&&s++}),s)},Ia=function(t,e,r){for(var n=Infinity,a=0,i=function(l){var h=t[l],p=Object.keys(h).sort(function(oe,ce){return h[oe]-h[ce]}),D=10,I=[];p.forEach(function(oe,ce){I[ce%D]||(I[ce%D]={graphs:[],totalCount:0,aveCount:0}),I[ce%D].graphs.push(oe),I[ce%D].totalCount+=h[oe]});var F=0,Z=[];I.forEach(function(oe){var ce=oe.totalCount/oe.graphs.length;oe.aveCount=ce,Z.push(ce);var we=0,Re=oe.length;oe.graphs.forEach(function(Oe,Pe){var He=h[Oe];oe.graphs.forEach(function(at,qe){Pe!==qe&&(we+=Math.abs(He-h[at]))})}),we/=Re*(Re-1)/2,F+=we}),F/=I.length;var ee=0;Z.forEach(function(oe,ce){Z.forEach(function(we,Re){ce!==Re&&(ee+=Math.abs(oe-we))}),ee/=Z.length*(Z.length-1)/2});var se=ee-F;n<se&&(n=se,a=l)},o=0;o<e;o++)i(o);return{structure:r[a],structureCountMap:t[a]}},Ba=function(t,e){var r={},n={};return t.forEach(function(a,i){r[a.id]={idx:i,node:a,degree:0,inDegree:0,outDegree:0};var o=a[e];n[o]||(n[o]=[]),n[o].push(a)}),{nodeMap:r,nodeLabelMap:n}},Ea=function(t,e,r){var n={},a={};return t.forEach(function(i,o){n["".concat(Ue)]={idx:o,edge:i};var s=i[e];a[s]||(a[s]=[]),a[s].push(i);var l=r[i.source];l&&(l.degree++,l.outDegree++);var h=r[i.target];h&&(h.degree++,h.inDegree++)}),{edgeMap:n,edgeLabelMap:a}},qa=function(t,e,r){var n=e.length,a={};return e.forEach(function(i,o){for(var s=r?0:o+1,l=t[o].id,h=s;h<n;h++)if(o!==h){var p=t[h].id,D=i[h];a["".concat(l,"-").concat(p)]=D,r||(a["".concat(p,"-").concat(l)]=D)}}),a},si=function(t,e,r,n,a,i,o,s,l,h,p){var D,I="".concat(e.id,"-").concat(r.id);if(h&&h[I])return h[I];var F=p?p[I]:void 0;if(!F){var Z=(D={},D[I]={start:n[e.id].idx,end:n[r.id].idx,distance:a},D);p=ia(Z,i,t,p),F=p[I]}return Wa(F,o,s,l)},_a=function(t,e,r,n){var a,i,o,s=(a=t[e])===null||a===void 0?void 0:a.degree,l=(i=t[e])===null||i===void 0?void 0:i.inDegree,h=(o=t[e])===null||o===void 0?void 0:o.outDegree;return t[e]===void 0&&(s=Infinity,l=Infinity,h=Infinity,n[e].forEach(function(p){var D=r[p.id].degree;s>D&&(s=D);var I=r[p.id].inDegree;l>I&&(l=I);var F=r[p.id].outDegree;h>F&&(h=F)}),t[e]={degree:s,inDegree:l,outDegree:h}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:l,minPatternNodeLabelOutDegree:h}},So=function(t,e,r,n,a,i,o){var s;if(r===void 0&&(r=!1),i===void 0&&(i="cluster"),o===void 0&&(o="cluster"),!(!t||!t.nodes)){var l=t.nodes.length;if(!!l){var h=Gn(t,r),p=Gn(e,r),D=qa(t.nodes,h,r),I=qa(e.nodes,p,r),F=Ba(t.nodes,i),Z=F.nodeMap,ee=F.nodeLabelMap,se=Ba(e.nodes,i),oe=se.nodeMap,ce=se.nodeLabelMap;Ea(t.edges,o,Z);var we=Ea(e.edges,o,oe).edgeLabelMap,Re=[];p==null||p.forEach(function(la){Re=Re.concat(la)}),a||(a=Math.max.apply(Math,(0,b.__spreadArray)((0,b.__spreadArray)([],Re,!1),[2],!1))),n||(n=a);var Oe=xn(t,h,i,n),Pe=xn(e,p,i,n),He=Math.min(100,l*(l-1)/2),at=Qn(n,l,He,Oe,h),qe=ia(at,Oe,t),yt=10,Ft=1,yr=1,fr=4,lr={graphs:qe,nodeLabelProp:i,edgeLabelProp:o,minSupport:Ft,minNodeNum:yr,maxNodeNum:fr,directed:r},Kt=on(lr).slice(0,yt),jr=Kt.length,Xr=[];Kt.forEach(function(la,Ca){Xr[Ca]={},Object.keys(qe).forEach(function(Xn){var Ta=qe[Xn],Na=Wa(Ta,la,i,o);Xr[Ca][Xn]=Na})});var er=Ia(Xr,jr,Kt),mr=er.structure,kr=er.structureCountMap,Fr=e.nodes[0],Jr=[],fn=(s=e.nodes[0])===null||s===void 0?void 0:s[i],Vn=-Infinity;e.nodes.forEach(function(la){var Ca=la[i],Xn=ee[Ca];(Xn==null?void 0:Xn.length)>Vn&&(Vn=Xn.length,Jr=Xn,fn=Ca,Fr=la)});var Tn={},wa={},ua={},fa={},Ma={},ja={};Object.keys(ce).forEach(function(la,Ca){Ma[la]=[],r&&(ja[la]=[]);var Xn=-Infinity,Ta=ce[la],Na={};Ta.forEach(function(xa){var Nn=I["".concat(Fr.id,"-").concat(xa.id)];if(Nn&&Ma[la].push(Nn),Xn<Nn&&(Xn=Nn),Na["".concat(Fr.id,"-").concat(xa.id)]={start:0,end:oe[xa.id].idx,distance:Nn},r){var Xa=I["".concat(xa.id,"-").concat(Fr.id)];Xa&&ja[la].push(Xa)}}),Ma[la]=Ma[la].sort(function(xa,Nn){return xa-Nn}),r&&(ja[la]=ja[la].sort(function(xa,Nn){return xa-Nn})),wa=ia(Na,Pe,e,wa);var cn=[];if(Object.keys(Na).forEach(function(xa){if(ua[xa]){cn.push(ua[xa]);return}var Nn=wa[xa];ua[xa]=Wa(Nn,mr,i,o),cn.push(ua[xa])}),cn=cn.sort(function(xa,Nn){return Nn-xa}),fa["".concat(Fr.id,"-").concat(la)]=cn,la!==fn)for(var pa=(Jr==null?void 0:Jr.length)||0,ma=function(Nn){var Xa=Jr[Nn],Ci=Oe[Z[Xa.id].idx],Ti=Ci.nodeLabelCountMap[la],uc=ce[la].length;if(!Ti||Ti.count<uc)return Jr.splice(Nn,1),"continue";for(var qc=!1,Po=0;Po<uc;Po++)if(Ti.dists[Po]>Ma[la][Po]){qc=!0;break}if(qc)return Jr.splice(Nn,1),"continue";var ws={};Ci.neighbors.forEach(function(ko){var Xs=D["".concat(Xa.id,"-").concat(ko.id)];ws["".concat(Xa.id,"-").concat(ko.id)]={start:Z[Xa.id].idx,end:Z[ko.id].idx,distance:Xs}}),qe=ia(ws,Oe,t,qe);var fu=[];Object.keys(ws).forEach(function(ko){if(kr[ko]){fu.push(kr[ko]);return}var Xs=qe[ko];kr[ko]=Wa(Xs,mr,i,o),fu.push(kr[ko])}),fu=fu.sort(function(ko,Xs){return Xs-ko});for(var Sf=!1,Po=0;Po<uc;Po++)if(fu[Po]<cn[Po]){Sf=!0;break}if(Sf)return Jr.splice(Nn,1),"continue"},Ua=pa-1;Ua>=0;Ua--)ma(Ua)});var Ra=[];Jr==null||Jr.forEach(function(la){for(var Ca=Z[la.id].idx,Xn=zn(t.nodes,h[Ca],Ca,i,a),Ta=Xn.neighbors,Na=Ta.length,cn=!1,pa=Na-1;pa>=0;pa--){if(Ta.length+1<e.nodes.length){cn=!0;return}var ma=Ta[pa],Ua=ma[i];if(!ce[Ua]||!ce[Ua].length){Ta.splice(pa,1);continue}if(!Ma[Ua]||!Ma[Ua].length){Ta.splice(pa,1);continue}var xa="".concat(la.id,"-").concat(ma.id),Nn=D[xa],Xa=Ma[Ua].length-1,Ci=Ma[Ua][Xa];if(Nn>Ci){Ta.splice(pa,1);continue}if(r){var Ti="".concat(ma.id,"-").concat(la.id),uc=D[Ti];Xa=ja[Ua].length-1;var qc=ja[Ua][Xa];if(uc>qc){Ta.splice(pa,1);continue}}var Po=kr[xa]?kr[xa]:si(t,la,ma,Z,Nn,Oe,mr,i,o,kr,qe),ws="".concat(Fr.id,"-").concat(Ua),fu=fa[ws][fa[ws].length-1];if(Po<fu){Ta.splice(pa,1);continue}var Sf=_a(Tn,Ua,oe,ce),ko=Sf.minPatternNodeLabelDegree,Xs=Sf.minPatternNodeLabelInDegree,Xu=Sf.minPatternNodeLabelOutDegree;if(Z[ma.id].degree<ko){Ta.splice(pa,1);continue}}cn||Ra.push({nodes:[la].concat(Ta)})});var uo=Hr(e,Fr.id,!1).length,Da={};r?(Object.keys(uo).forEach(function(la){var Ca=oe[la].node[i];Da[Ca]?Da[Ca].push(uo[la]):Da[Ca]=[uo[la]]}),Object.keys(Da).forEach(function(la){Da[la].sort(function(Ca,Xn){return Ca-Xn})})):Da=Ma;for(var fo=Ra.length,Qa=function(Ca){var Xn=Ra[Ca],Ta=Xn.nodes[0],Na={},cn={};Xn.nodes.forEach(function(hi,rs){cn[hi.id]={idx:rs,node:hi,degree:0,inDegree:0,outDegree:0};var eo=hi[i];Na[eo]?Na[eo]++:Na[eo]=1});var pa=[],ma={};t.edges.forEach(function(hi){cn[hi.source]&&cn[hi.target]&&(pa.push(hi),ma[hi[o]]?ma[hi[o]]++:ma[hi[o]]=1,cn[hi.source].degree++,cn[hi.target].degree++,cn[hi.source].outDegree++,cn[hi.target].inDegree++)});for(var Ua=Object.keys(we).length,xa=!1,Nn=0;Nn<Ua;Nn++){var Xa=Object.keys(we)[Nn];if(!ma[Xa]||ma[Xa]<we[Xa].length){xa=!0;break}}if(xa)return Ra.splice(Ca,1),"continue";var Ci=pa.length;if(Ci<e.edges.length)return Ra.splice(Ca,1),"break";for(var Ti=!1,uc=function(rs){var eo=pa[rs],cu=eo[o],fc=we[cu];if(!fc||!fc.length)return ma[cu]--,fc&&ma[cu]<fc.length?(Ti=!0,"break"):(pa.splice(rs,1),cn[eo.source].degree--,cn[eo.target].degree--,cn[eo.source].outDegree--,cn[eo.target].inDegree--,"continue");var ch=cn[eo.source].node[i],lh=cn[eo.target].node[i],hd=!1;if(fc.forEach(function(dh){var hh=oe[dh.source].node,vh=oe[dh.target].node;hh[i]===ch&&vh[i]===lh&&(hd=!0),!r&&hh[i]===lh&&vh[i]===ch&&(hd=!0)}),!hd)return ma[cu]--,fc&&ma[cu]<fc.length?(Ti=!0,"break"):(pa.splice(rs,1),cn[eo.source].degree--,cn[eo.target].degree--,cn[eo.source].outDegree--,cn[eo.target].inDegree--,"continue")},Nn=Ci-1;Nn>=0;Nn--){var qc=uc(Nn);if(qc==="break")break}if(Ti)return Ra.splice(Ca,1),"continue";Xn.edges=pa;var Po=Hr(Xn,Xn.nodes[0].id,!1).length;if(Object.keys(Po).reverse().forEach(function(hi){if(!(hi===Xn.nodes[0].id||Ti)){if(Po[hi]===Infinity){var rs=cn[hi].node[i];if(Na[rs]--,Na[rs]<ce[rs].length){Ti=!0;return}var eo=Xn.nodes.indexOf(cn[hi].node);Xn.nodes.splice(eo,1),cn[hi]=void 0;return}var cu=Z[hi].node[i];if(!Da[cu]||!Da[cu].length||Po[hi]>Da[cu][Da[cu].length-1]){var rs=cn[hi].node[i];if(Na[rs]--,Na[rs]<ce[rs].length){Ti=!0;return}var eo=Xn.nodes.indexOf(cn[hi].node);Xn.nodes.splice(eo,1),cn[hi]=void 0}}}),Ti)return Ra.splice(Ca,1),"continue";for(var ws=!0,fu=0;ws&&!Ti;){ws=!1;var Sf=r?cn[Ta.id].degree<oe[Fr.id].degree||cn[Ta.id].inDegree<oe[Fr.id].inDegree||cn[Ta.id].outDegree<oe[Fr.id].outDegree:cn[Ta.id].degree<oe[Fr.id].degree;if(Sf){Ti=!0;break}if(Na[Ta[i]]<ce[Ta[i]].length){Ti=!0;break}for(var ko=Xn.nodes.length,Xs=ko-1;Xs>=0;Xs--){var Xu=Xn.nodes[Xs],uh=cn[Xu.id].degree,Vg=cn[Xu.id].inDegree,Yg=cn[Xu.id].outDegree,Hg=Xu[i],dd=_a(Tn,Hg,oe,ce),fh=dd.minPatternNodeLabelDegree,Zg=dd.minPatternNodeLabelInDegree,Kg=dd.minPatternNodeLabelOutDegree,$g=r?uh<fh||Vg<Zg||Yg<Kg:uh<fh;if($g){if(Na[Xu[i]]--,Na[Xu[i]]<ce[Xu[i]].length){Ti=!0;break}Xn.nodes.splice(Xs,1),cn[Xu.id]=void 0,ws=!0}}if(Ti||!ws&&fu!==0)break;Ci=pa.length;for(var Ql=Ci-1;Ql>=0;Ql--){var Vu=pa[Ql];if(!cn[Vu.source]||!cn[Vu.target]){pa.splice(Ql,1);var Jl=Vu[o];if(ma[Jl]--,cn[Vu.source]&&(cn[Vu.source].degree--,cn[Vu.source].outDegree--),cn[Vu.target]&&(cn[Vu.target].degree--,cn[Vu.target].inDegree--),we[Jl]&&ma[Jl]<we[Jl].length){Ti=!0;break}ws=!0}}fu++}if(Ti||Ti||Xn.nodes.length<e.nodes.length||pa.length<e.edges.length)return Ra.splice(Ca,1),"continue"},Ja=fo-1;Ja>=0;Ja--){var oi=Qa(Ja);if(oi==="break")break}for(var Si=Ra.length,Ai=function(Ca){var Xn=Ra[Ca],Ta={};Xn.edges.forEach(function(pa){var ma="".concat(pa.source,"-").concat(pa.target,"-").concat(pa.label);Ta[ma]?Ta[ma]++:Ta[ma]=1});for(var Na=function(ma){var Ua=Ra[ma],xa={};Ua.edges.forEach(function(Xa){var Ci="".concat(Xa.source,"-").concat(Xa.target,"-").concat(Xa.label);xa[Ci]?xa[Ci]++:xa[Ci]=1});var Nn=!0;Object.keys(xa).length!==Object.keys(Ta).length?Nn=!1:Object.keys(Ta).forEach(function(Xa){xa[Xa]!==Ta[Xa]&&(Nn=!1)}),Nn&&Ra.splice(ma,1)},cn=Si-1;cn>Ca;cn--)Na(cn);Si=Ra.length},Ja=0;Ja<=Si-1;Ja++)Ai(Ja);return Ra}}},to=So,co=function(){function c(t){t===void 0&&(t=10),this.linkedList=new Se,this.maxStep=t}return Object.defineProperty(c.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),c.prototype.isEmpty=function(){return!this.linkedList.head},c.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},c.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},c.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},c.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},c.prototype.toArray=function(){return this.linkedList.toArray().map(function(t){return t.value})},c.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},c}(),ni=co,lo=br,Ss={getAdjMatrix:te,breadthFirstSearch:ht,connectedComponent:Qe,getDegree:St,getInDegree:Ct,getOutDegree:_t,detectCycle:br,detectDirectedCycle:lo,detectAllCycles:qt,detectAllDirectedCycle:Bt,detectAllUndirectedCycle:ft,depthFirstSearch:xr,dijkstra:Hr,findAllPath:Gr,findShortestPath:qr,floydWarshall:Gn,labelPropagation:$r,louvain:K,iLouvain:rt,kCore:ae,kMeans:C,cosineSimilarity:he,nodesCosineSimilarity:Ee,minimumSpanningTree:Ot,pageRank:pr,getNeighbors:pe,Stack:ni,GADDI:to},Ro=z(77160),mi=z(35600),ya=z(31437),_o=q.vs,Yi=function(t){return function(e,r){return e[t]-r[t]}},Fi=function(t,e,r){return t>=e&&t<=r},Bo=function(t,e,r,n){var a=1e-4,i={x:r.x-t.x,y:r.y-t.y},o={x:e.x-t.x,y:e.y-t.y},s={x:n.x-r.x,y:n.y-r.y},l=o.x*s.y-o.y*s.x,h=l*l,p=1/l,D=o.x*o.x+o.y*o.y,I=s.x*s.x+s.y*s.y;if(h>a*D*I){var F=(i.x*s.y-i.y*s.x)*p,Z=(i.x*o.y-i.y*o.x)*p;return!Fi(F,0,1)||!Fi(Z,0,1)?null:{x:t.x+F*o.x,y:t.y+F*o.y}}return null},_s=function(t,e){var r=t.x,n=t.y,a=t.width,i=t.height,o=r+a/2,s=n+i/2,l=[],h={x:o,y:s};l.push({x:r,y:n}),l.push({x:r+a,y:n}),l.push({x:r+a,y:n+i}),l.push({x:r,y:n+i}),l.push({x:r,y:n});for(var p=null,D=1;D<l.length&&(p=Bo(l[D-1],l[D],h,e),!p);D++);return p},Oo=function(t,e){var r=t.x,n=t.y,a=t.r,i=e.x,o=e.y,s=i-r,l=o-n;if(s*s+l*l<a*a)return null;var h=Math.atan(l/s);return{x:r+Math.abs(a*Math.cos(h))*Math.sign(s),y:n+Math.abs(a*Math.sin(h))*Math.sign(l)}},Hi=function(t,e){var r=t.rx,n=t.ry,a=t.x,i=t.y,o=e.x-a,s=e.y-i,l=Math.atan2(s/n,o/r);return l<0&&(l+=2*Math.PI),{x:a+r*Math.cos(l),y:i+n*Math.sin(l)}},_n=function(t,e,r){r===void 0&&(r=1);var n=[t.x,t.y,r];return(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]),Ro.transformMat3(n,n,e),{x:n[0],y:n[1]}},Fo=function(t,e,r){r===void 0&&(r=1),(!e||isNaN(e[0]))&&(e=[1,0,0,0,1,0,0,0,1]);var n=mi.invert([1,0,0,0,1,0,0,0,1],e);n||(n=[1,0,0,0,1,0,0,0,1]);var a=[t.x,t.y,r];return Ro.transformMat3(a,a,n),{x:a[0],y:a[1]}},Go=function(t,e,r){var n=t.x-e.x,a=t.y-e.y,i=t.x-r.x,o=t.y-r.y,s=(t.x*t.x-e.x*e.x-e.y*e.y+t.y*t.y)/2,l=(t.x*t.x-r.x*r.x-r.y*r.y+t.y*t.y)/2,h=a*i-n*o;return{x:-(o*s-a*l)/h,y:-(n*l-i*s)/h}},Va=function(t,e){var r=t.x-e.x,n=t.y-e.y;return Math.sqrt(r*r+n*n)},Ms=function(t,e){var r=[];return t.forEach(function(n){var a=[];n.forEach(function(i){a.push(i*e)}),r.push(a)}),r},Ko=function(t){for(var e=[],r=t.length,n=0;n<r;n+=1){e[n]=[];for(var a=0;a<r;a+=1)n===a?e[n][a]=0:t[n][a]===0||!t[n][a]?e[n][a]=Infinity:e[n][a]=t[n][a]}for(var i=0;i<r;i+=1)for(var n=0;n<r;n+=1)for(var a=0;a<r;a+=1)e[n][a]>e[n][i]+e[i][a]&&(e[n][a]=e[n][i]+e[i][a]);return e},Li=function(t,e){var r=t.nodes,n=t.edges,a=[],i={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(o,s){i[o.id]=s;var l=[];a.push(l)}),n&&n.forEach(function(o){var s=o.source,l=o.target,h=i[s],p=i[l];a[h][p]=1,e||(a[p][h]=1)}),a},Mo=function(t,e){t.translate(e.x,e.y)},ho=function(t,e,r,n){n===void 0&&(n={duration:500});var a=t.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var i=t.getCanvasBBox(),o=e.x-i.minX,s=e.y-i.minY;if(r){var l=o*a[0],h=s*a[4],p=0,D=0,I=0,F=0;t.animate(function(ee){return I=l*ee,F=h*ee,a=_o(a,[["t",I-p,F-D]]),p=I,D=F,{matrix:a}},n)}else{var Z=_o(a,[["t",o,s]]);t.setMatrix(Z)}},Gi=function(t,e){var r=t.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=e;(0,m.isArray)(e)||(n=[e,e]),(0,m.isArray)(e)&&e.length===1&&(n=[e[0],e[0]]),r=_o(r,[["s",n[0],n[1]]]),t.setMatrix(r)},Di=function(t,e){var r=t.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]),r=_o(r,[["r",e]]),t.setMatrix(r)},$o=function(t,e,r){for(var n=[],a=0;a<t;a++)n[a]=0;return r.forEach(function(i){i.source&&(n[e[i.source]]+=1),i.target&&(n[e[i.target]]+=1)}),n};function Ni(c,t,e){return(e[0]-c[0])*(t[1]-c[1])==(t[0]-c[0])*(e[1]-c[1])&&Math.min(c[0],t[0])<=e[0]&&e[0]<=Math.max(c[0],t[0])&&Math.min(c[1],t[1])<=e[1]&&e[1]<=Math.max(c[1],t[1])}var ro=function(t,e,r){var n=!1,a=t.length,i=1e-6;function o(p){return Math.abs(p)<i?0:p<0?-1:1}if(a<=2)return!1;for(var s=0;s<a;s++){var l=t[s],h=t[(s+1)%a];if(Ni(l,h,[e,r]))return!0;o(l[1]-r)>0!=o(h[1]-r)>0&&o(e-(r-l[1])*(l[0]-h[0])/(l[1]-h[1])-l[0])<0&&(n=!n)}return n},Qo=function(t,e){return!(e.minX>t.maxX||e.maxX<t.minX||e.minY>t.maxY||e.maxY<t.minY)},ns=function(t,e){var r=!1;return(0,m.each)(t,function(n){if(Bo(n.from,n.to,e.from,e.to))return r=!0,!1}),r},zi=function(t,e){var r=function(D){var I=D.map(function(Z){return Z[0]}),F=D.map(function(Z){return Z[1]});return{minX:Math.min.apply(null,I),maxX:Math.max.apply(null,I),minY:Math.min.apply(null,F),maxY:Math.max.apply(null,F)}},n=function(D){for(var I=[],F=D.length,Z=0;Z<F-1;Z++){var ee=D[Z],se=D[Z+1];I.push({from:{x:ee[0],y:ee[1]},to:{x:se[0],y:se[1]}})}if(I.length>1){var oe=D[0],ce=D[F-1];I.push({from:{x:ce[0],y:ce[1]},to:{x:oe[0],y:oe[1]}})}return I};if(t.length<2||e.length<2)return!1;var a=r(t),i=r(e);if(!Qo(a,i))return!1;var o=!1;if((0,m.each)(e,function(p){if(ro(t,p[0],p[1]))return o=!0,!1}),o||((0,m.each)(t,function(p){if(ro(e,p[0],p[1]))return o=!0,!1}),o))return!0;var s=n(t),l=n(e),h=!1;return(0,m.each)(l,function(p){if(ns(s,p))return h=!0,!1}),h},ga=function(){function c(t,e,r,n){this.x1=t,this.y1=e,this.x2=r,this.y2=n}return c.prototype.getBBox=function(){var t=Math.min(this.x1,this.x2),e=Math.min(this.y1,this.y2),r=Math.max(this.x1,this.x2),n=Math.max(this.y1,this.y2),a={x:t,y:e,minX:t,minY:e,maxX:r,maxY:n,width:r-t,height:n-e};return a},c}(),vo=function(t,e){var r={top:[t.minX,t.minY,t.maxX,t.minY],left:[t.minX,t.minY,t.minX,t.maxY],bottom:[t.minX,t.maxY,t.maxX,t.maxY],right:[t.maxX,t.minY,t.maxX,t.maxY]};return r[e]},Vs=function(t,e){var r=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),n=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),a=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(a){var i=r/a,o=n/a;if(i>=0&&i<=1&&o>=0&&o<=1)return i}return Number.POSITIVE_INFINITY},Pi=function(t,e){for(var r=["top","left","bottom","right"],n=t.getBBox(),a=0,i=[],o=0;o<4;o++){var s=vo(n,r[o]),l=s[0],h=s[1],p=s[2],D=s[3];i[o]=Bo({x:e.x1,y:e.y1},{x:e.x2,y:e.y2},{x:l,y:h},{x:p,y:D}),i[o]&&(a+=1)}return[i,a]},Ao=function(t,e){for(var r=["top","left","bottom","right"],n=t.getBBox(),a=Number.POSITIVE_INFINITY,i=0,o=0;o<4;o++){var s=vo(n,r[o]),l=s[0],h=s[1],p=s[2],D=s[3],I=Vs(e,new ga(l,h,p,D));I=Math.abs(I-.5),I>=0&&I<=1&&(i+=1,a=I<a?I:a)}return i===0?-1:a},as=function(t){var e=0,r=0;if(t.length>0){for(var n=0,a=t;n<a.length;n++){var i=a[n];e+=i.x,r+=i.y}e/=t.length,r/=t.length}return{x:e,y:r}},vi=function(t,e){return Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)},Zi=function(t,e){var r=e.x1,n=e.y1,a=e.x2-r,i=e.y2-n,o=t.x-r,s=t.y-n,l=o*a+s*i,h;l<=0?h=0:(o=a-o,s=i-s,l=o*a+s*i,l<=0?h=0:h=l*l/(a*a+i*i));var p=o*o+s*s-h;return p<0&&(p=0),p},_i=function(t,e,r){return r===void 0&&(r=.001),Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)<Math.pow(r,2)},no=function(t,e){var r=t.x<e.x,n=t.x>e.x+e.width,a=t.y>e.y+e.height,i=t.y<e.y,o=r||n||a||i;if(!o)return 0;if(a&&!r&&!n)return Math.pow(e.y+e.height-t.y,2);if(i&&!r&&!n)return Math.pow(t.y-e.y,2);if(r&&!a&&!i)return Math.pow(e.x-t.x,2);if(n&&!a&&!i)return Math.pow(e.x+e.width-t.x,2);var s=Math.min(Math.abs(e.x-t.x),Math.abs(e.x+e.width-t.x)),l=Math.min(Math.abs(e.y-t.y),Math.abs(e.y+e.height-t.y));return s*s+l*l},Ui=function(t,e){var r=t[0],n=t[1],a=t[2],i=t[3],o=e.x,s=e.y,l=[a-r,i-n];if(ya.exactEquals(l,[0,0]))return NaN;var h=[-l[1],l[0]];ya.normalize(h,h);var p=[o-r,s-n];return Math.abs(ya.dot(p,h))},da=function(t,e,r){return t+(e-t)*r},Fa=function(t,e,r){for(var n=Math.min(t.length,e.length),a=new Array(n),i=0;i<n;i++)a[i]=da(t[i],e[i],r);return a},Ya="rgb(95, 149, 255)",Ii="rgb(255, 255, 255)",Wi="rgb(0, 0, 0)",ao="rgb(247, 250, 255)",go="rgb(239, 244, 255)",po="rgb(253, 253, 253)",yo="rgb(250, 250, 250)",ji="rgb(224, 224, 224)",ka="rgb(234, 234, 234)",Ys="rgb(245, 245, 245)",_f="rgb(191, 213, 255)",mo="#4572d9",lu="rgb(223, 234, 255)",na={mainStroke:Ya,mainFill:go,activeStroke:Ya,activeFill:ao,inactiveStroke:_f,inactiveFill:ao,selectedStroke:Ya,selectedFill:Ii,highlightStroke:mo,highlightFill:lu,disableStroke:ji,disableFill:yo,edgeMainStroke:ji,edgeActiveStroke:Ya,edgeInactiveStroke:ka,edgeSelectedStroke:Ya,edgeHighlightStroke:Ya,edgeDisableStroke:Ys,comboMainStroke:ji,comboMainFill:po,comboActiveStroke:Ya,comboActiveFill:ao,comboInactiveStroke:ji,comboInactiveFill:po,comboSelectedStroke:Ya,comboSelectedFill:po,comboHighlightStroke:mo,comboHighlightFill:po,comboDisableStroke:ka,comboDisableFill:yo},an={version:"0.8.9",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:na.mainStroke,fill:go},size:20,color:na.mainStroke,linkPoints:{size:8,lineWidth:1,fill:na.activeFill,stroke:na.activeStroke}},nodeStateStyles:{active:{fill:na.activeFill,stroke:na.activeStroke,lineWidth:2,shadowColor:na.mainStroke,shadowBlur:10},selected:{fill:na.selectedFill,stroke:na.selectedStroke,lineWidth:4,shadowColor:na.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:na.highlightFill,stroke:na.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:na.inactiveFill,stroke:na.inactiveStroke,lineWidth:1},disable:{fill:na.disableFill,stroke:na.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:Wi,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:na.edgeMainStroke,lineAppendWidth:2},color:na.edgeMainStroke},edgeStateStyles:{active:{stroke:na.edgeActiveStroke,lineWidth:1},selected:{stroke:na.edgeSelectedStroke,lineWidth:2,shadowColor:na.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:na.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:na.edgeInactiveStroke,lineWidth:1},disable:{stroke:na.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:Wi,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:na.comboMainFill,lineWidth:1,stroke:na.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:na.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:na.comboActiveStroke,lineWidth:1,fill:na.comboActiveFill},selected:{stroke:na.comboSelectedStroke,lineWidth:2,fill:na.comboSelectedFill,shadowColor:na.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:na.comboHighlightStroke,lineWidth:2,fill:na.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:na.comboInactiveStroke,fill:na.comboInactiveFill,lineWidth:1},disable:{stroke:na.comboDisableStroke,fill:na.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},windowFontFamily:typeof window!="undefined"&&window.getComputedStyle&&document.body&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},Hs={" ":.3329986572265625,a:.5589996337890625,A:.6569992065429687,b:.58599853515625,B:.6769989013671875,c:.5469985961914062,C:.7279998779296875,d:.58599853515625,D:.705999755859375,e:.554998779296875,E:.63699951171875,f:.37299957275390627,F:.5769989013671875,g:.5909988403320312,G:.7479995727539063,h:.555999755859375,H:.7199996948242188,i:.255999755859375,I:.23699951171875,j:.26699981689453123,J:.5169998168945312,k:.5289993286132812,K:.6899993896484375,l:.23499908447265624,L:.5879989624023437,m:.854998779296875,M:.8819992065429687,n:.5589996337890625,N:.7189987182617188,o:.58599853515625,O:.7669998168945312,p:.58599853515625,P:.6419998168945312,q:.58599853515625,Q:.7669998168945312,r:.3649993896484375,R:.6759994506835938,s:.504998779296875,S:.6319992065429687,t:.354998779296875,T:.6189987182617187,u:.5599990844726562,U:.7139999389648437,v:.48199920654296874,V:.6389999389648438,w:.754998779296875,W:.929998779296875,x:.5089996337890625,X:.63699951171875,y:.4959991455078125,Y:.66199951171875,z:.48699951171875,Z:.6239990234375,"0":.6,"1":.40099945068359377,"2":.6,"3":.6,"4":.6,"5":.6,"6":.6,"7":.5469985961914062,"8":.6,"9":.6,"[":.3329986572265625,"]":.3329986572265625,",":.26399993896484375,".":.26399993896484375,";":.26399993896484375,":":.26399993896484375,"{":.3329986572265625,"}":.3329986572265625,"\\":.5,"|":.19499969482421875,"=":.604998779296875,"+":.604998779296875,"-":.604998779296875,_:.5,"`":.3329986572265625," ~":.8329986572265625,"!":.3329986572265625,"@":.8579986572265625,"#":.6,$:.6,"%":.9699996948242188,"^":.517999267578125,"&":.7259994506835937,"*":.505999755859375,"(":.3329986572265625,")":.3329986572265625,"<":.604998779296875,">":.604998779296875,"/":.5,"?":.53699951171875},Xi=Math.PI,zo=Math.sin,is=Math.cos,ui=zo(Xi/8),ai=is(Xi/8),Eo=function(t,e){var r=t.getBBox(),n={x:r.minX,y:r.minY},a={x:r.maxX,y:r.maxY};if(e){var i=e.getMatrix();i||(i=[1,0,0,0,1,0,0,0,1]),n=_n(n,i),a=_n(a,i)}var o=n.x,s=n.y,l=a.x,h=a.y;return{x:o,y:s,minX:o,minY:s,maxX:l,maxY:h,width:l-o,height:h-s}},Yu=function(t){var e=t.sourceNode||t.targetNode,r=e.get("group"),n=r.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var a=e.getKeyShape(),i=a.getBBox(),o=t.loopCfg||{},s=o.dist||Math.max(i.width,i.height)*2,l=o.position||an.defaultLoopPosition,h=[(i.minX+i.maxX)/2+n[6],(i.minY+i.maxY)/2+n[7]],p=[t.startPoint.x,t.startPoint.y],D=[t.endPoint.x,t.endPoint.y],I=i.height/2,F=i.width/2,Z=I,ee=I,se=Z*ui,oe=Z*ai,ce=ee*ui,we=ee*ai,Re=a.get("type"),Oe=Math.min(I/2,F/2),Pe=Math.min(I,F),He=(o==null?void 0:o.pointPadding)?Math.min(Pe,o==null?void 0:o.pointPadding):Oe;if(p[0]===D[0]&&p[1]===D[1]){switch(l){case"top":Re==="circle"?(p=[h[0]-se,h[1]-oe],D=[h[0]+ce,h[1]-we]):(p=[h[0]-He,h[1]-I],D=[h[0]+He,h[1]-I]);break;case"top-right":Z=I,ee=F,Re==="circle"?(se=Z*ui,oe=Z*ai,ce=ee*ui,we=ee*ai,p=[h[0]+se,h[1]-oe],D=[h[0]+we,h[1]-ce]):(p=[h[0]+F-He,h[1]-I],D=[h[0]+F,h[1]-I+He]);break;case"right":Z=F,ee=F,Re==="circle"?(se=Z*ui,oe=Z*ai,ce=ee*ui,we=ee*ai,p=[h[0]+oe,h[1]-se],D=[h[0]+we,h[1]+ce]):(p=[h[0]+F,h[1]-He],D=[h[0]+F,h[1]+He]);break;case"bottom-right":Z=F,ee=I,Re==="circle"?(se=Z*ui,oe=Z*ai,ce=ee*ui,we=ee*ai,p=[h[0]+oe,h[1]+se],D=[h[0]+ce,h[1]+we]):(p=[h[0]+F,h[1]+I-He],D=[h[0]+F-He,h[1]+I]);break;case"bottom":Z=I,ee=I,Re==="circle"?(se=Z*ui,oe=Z*ai,ce=ee*ui,we=ee*ai,p=[h[0]+se,h[1]+oe],D=[h[0]-ce,h[1]+we]):(p=[h[0]-He,h[1]+I],D=[h[0]+He,h[1]+I]);break;case"bottom-left":Z=I,ee=F,Re==="circle"?(se=Z*ui,oe=Z*ai,ce=ee*ui,we=ee*ai,p=[h[0]-se,h[1]+oe],D=[h[0]-we,h[1]+ce]):(p=[h[0]-F,h[1]+I-He],D=[h[0]-F+He,h[1]+I]);break;case"left":Z=F,ee=F,Re==="circle"?(se=Z*ui,oe=Z*ai,ce=ee*ui,we=ee*ai,p=[h[0]-oe,h[1]+se],D=[h[0]-we,h[1]-ce]):(p=[h[0]-F,h[1]-He],D=[h[0]-F,h[1]+He]);break;case"top-left":Z=F,ee=I,Re==="circle"?(se=Z*ui,oe=Z*ai,ce=ee*ui,we=ee*ai,p=[h[0]-oe,h[1]-se],D=[h[0]-ce,h[1]-we]):(p=[h[0]-F+He,h[1]-I],D=[h[0]-F,h[1]-I+He]);break;default:Z=F,ee=F,se=Z*ui,oe=Z*ai,ce=ee*ui,we=ee*ai,p=[h[0]-se,h[1]-oe],D=[h[0]+ce,h[1]-we]}if(o.clockwise===!1){var at=[p[0],p[1]];p=[D[0],D[1]],D=[at[0],at[1]]}}var qe=[p[0]-h[0],p[1]-h[1]],yt=(Z+s)/Z,Ft=(ee+s)/ee;o.clockwise===!1&&(yt=(ee+s)/ee,Ft=(Z+s)/Z);var yr=ya.scale([0,0],qe,yt),fr=[h[0]+yr[0],h[1]+yr[1]],lr=[D[0]-h[0],D[1]-h[1]],Kt=ya.scale([0,0],lr,Ft),jr=[h[0]+Kt[0],h[1]+Kt[1]];return t.startPoint={x:p[0],y:p[1]},t.endPoint={x:D[0],y:D[1]},t.controlPoints=[{x:fr[0],y:fr[1]},{x:jr[0],y:jr[1]}],t},Hu=function(t,e,r,n,a){var i=1e-4,o=[],s=t==null?void 0:t.getPoint(e);if(!s)return{x:0,y:0,angle:0};if(e<i)o=t.getStartTangent().reverse();else if(e>1-i)o=t.getEndTangent();else{var l=t==null?void 0:t.getPoint(e+i);o.push([s.x,s.y]),o.push([l.x,l.y])}var h=Math.atan2(o[1][1]-o[0][1],o[1][0]-o[0][0]);if(h<0&&(h+=Xi*2),r&&(s.x+=is(h)*r,s.y+=zo(h)*r),n){var p=h-Xi/2;h>1/2*Xi&&h<3*1/2*Xi&&(p-=Xi),s.x+=is(p)*n,s.y+=zo(p)*n}var D={x:s.x,y:s.y,angle:h};return a?(h>.5*Xi&&h<1.5*Xi&&(h-=Xi),(0,b.__assign)({rotate:h},D)):D},du=function c(t,e,r,n){if(n(t,e,r)===!1)return!1;if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!c(t.children[a],t,a,n))return!1}return!0},hu=function c(t,e,r,n){if(t&&t.children){for(var a=t.children.length-1;a>=0;a--)if(!c(t.children[a],t,a,n))return}return n(t,e,r)!==!1},Ei=function(t,e){typeof e=="function"&&du(t,null,-1,e)},Ki=function(t,e){typeof e=="function"&&hu(t,null,-1,e)},Zs=function(t,e){return e*(Hs[t]||1)},Ks=function(t,e){var r=0,n=new RegExp("[\u4E00-\u9FA5]+");return t.split("").forEach(function(a){n.test(a)?r+=e:r+=Zs(a,e)}),[r,e]},io=function(t,e){return typeof e!="number"||e<=0||e>=t.length?t:t.substring(0,e)+"..."},os=function(t,e){var r=[],n={},a={};t.forEach(function(s){a[s.id]=s}),t.forEach(function(s,l){var h=(0,m.clone)(s);h.itemType="combo",h.children=void 0,h.parentId===h.id?(console.warn("The parentId for combo ".concat(h.id," can not be the same as the combo's id")),delete h.parentId):h.parentId&&!a[h.parentId]&&(console.warn("The parent combo for combo ".concat(h.id," does not exist!")),delete h.parentId);var p=n[h.id];if(p){if(h.children=p.children,n[h.id]=h,p=h,!p.parentId){r.push(p);return}var D=n[p.parentId];if(D)D.children?D.children.push(h):D.children=[h];else{var I={id:p.parentId,children:[p]};n[p.parentId]=I,n[h.id]=h}return}if((0,m.isString)(s.parentId)){var F=n[s.parentId];if(F)F.children?F.children.push(h):F.children=[h],n[h.id]=h;else{var Z={id:s.parentId,children:[h]};n[Z.id]=Z,n[h.id]=h}}else r.push(h),n[h.id]=h});var i={};(e||[]).forEach(function(s){i[s.id]=s;var l=n[s.comboId];if(l){var h={id:s.id,comboId:s.comboId};l.children?l.children.push(h):l.children=[h],h.itemType="node",n[s.id]=h}});var o=0;return r.forEach(function(s){s.depth=o+10,Ei(s,function(l){var h,p=n[l.id].itemType;p==="node"?h=n[l.comboId]:h=n[l.parentId],h&&p==="node"?l.depth=o+1:l.depth=o+10,o<l.depth&&(o=l.depth);var D=i[l.id];return D&&(D.depth=l.depth),!0})}),r},ss=function(t,e,r){var n,a=t,i,o={root:{children:t}},s=!1,l="root";(t||[]).forEach(function(F){if(!s){if(F.id===e){i=F,F.itemType==="combo"?i.parentId=r:i.comboId=r,s=!0;return}Ei(F,function(Z){var ee;return o[Z.id]={children:(Z==null?void 0:Z.children)||[]},a=(ee=o[Z.parentId||Z.comboId||"root"])===null||ee===void 0?void 0:ee.children,Z&&(Z.removed||e===Z.id)&&a?(l=Z.parentId||Z.comboId||"root",i=Z,Z.itemType==="combo"?i.parentId=r:i.comboId=r,s=!0,!1):!0})}}),a=(n=o[l])===null||n===void 0?void 0:n.children;var h=a?a.indexOf(i):-1;if(h>-1&&a.splice(h,1),s||(i={id:e,itemType:"node",comboId:r},o[e]={children:void 0}),e){var p=!1;if(r){var D=0;(t||[]).forEach(function(F){p||Ei(F,function(Z){return r===Z.id?(p=!0,Z.children?Z.children.push(i):Z.children=[i],D=Z.depth,i.itemType==="node"?i.depth=D+2:i.depth=D+1,!1):!0})})}else(!r||!p)&&i.itemType!=="node"&&t.push(i);var I=i.depth;Ei(i,function(F){return F.itemType==="node"?I+=2:I+=1,F.depth=I,!0})}return t},us=function(t,e,r){var n={minX:Infinity,minY:Infinity,maxX:-Infinity,maxY:-Infinity,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!t||t.length===0){var a=r==null?void 0:r.getModel(),i=a||{},o=i.x,s=i.y,l=i.fixSize,h=i.collapsed,p=i.fixCollapseSize,D=h?p:l,I=(0,m.isArray)(D)?D:[D,D],F=I[0],Z=I[1],ee=[F/2,Z/2];return{minX:o-ee[0],minY:s-ee[1],maxX:o+ee[0],maxY:s+ee[1],x:o,y:s,width:F,height:Z}}return t.forEach(function(se){var oe=e.findById(se.id);if(!(!oe||!oe.isVisible())){oe.set("bboxCanvasCache",void 0);var ce=oe.getCanvasBBox();ce.x&&n.minX>ce.minX&&(n.minX=ce.minX),ce.y&&n.minY>ce.minY&&(n.minY=ce.minY),ce.x&&n.maxX<ce.maxX&&(n.maxX=ce.maxX),ce.y&&n.maxY<ce.maxY&&(n.maxY=ce.maxY)}}),n.x=(n.minX+n.maxX)/2,n.y=(n.minY+n.maxY)/2,n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,(r==null?void 0:r.getKeyShape().get("type"))==="circle"&&(n.width=Math.hypot(n.height,n.width),n.height=n.width),Object.keys(n).forEach(function(se){(n[se]===Infinity||n[se]===-Infinity)&&(n[se]=void 0)}),n},$s=function(t){var e=(0,m.isNumber)(t.x)||(0,m.isNumber)(t.y)||t.type||t.anchorPoints||t.size;return t.style&&(e=e||(0,m.isNumber)(t.style.r)||(0,m.isNumber)(t.style.width)||(0,m.isNumber)(t.style.height)||(0,m.isNumber)(t.style.rx)||(0,m.isNumber)(t.style.ry)),e},Uo=function(t){var e={};return Object.keys(t).forEach(function(r){var n=t[r];if((0,m.isObject)(n)&&!(0,m.isArray)(n)){var a={};Object.keys(n).forEach(function(i){var o=n[i];i==="img"&&!(0,m.isString)(o)||(a[i]=(0,m.clone)(o))}),e[r]=a}else e[r]=(0,m.clone)(n)}),e},bo=function(t){var e=t.animateCfg,r=t.callback,n;if(!e)n={duration:500,callback:r};else if(n=(0,m.clone)(e),e.callback){var a=e.callback;n.callback=function(){r(),a()}}else n.callback=r;return n},fs=function(t){if(!t)return console.error("G6 Error Tips: the data must be defined"),!1;var e=t.nodes,r=t.edges,n=t.combos,a=n===void 0?[]:n;if(!e&&!r){var i=!0;return Ei(t,function(D){return(0,m.isString)(D.id)?!0:(i=!1,!1)}),i}var o=(e||[]).find(function(D){return!(0,m.isString)(D.id)});if(o)return console.warn("G6 Warning Tips: missing 'id' property, or %c".concat(o.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1;var s=(e||[]).map(function(D){return D.id}),l=a==null?void 0:a.map(function(D){return D.id}),h=(0,b.__spreadArray)((0,b.__spreadArray)([],s,!0),l,!0),p=(r||[]).find(function(D){return!h.includes(D.source)||!h.includes(D.target)});return p?(console.warn("G6 Warning Tips: The source %c".concat(p.source,"%c or the target %c").concat(p.target,"%c of the edge do not exist in the nodes or combos."),"font-size: 20px; color: red;","","font-size: 20px; color: red;",""),!1):!0},Zu=function(t,e){if(t==="node"||t==="combo"){if(e.id&&!(0,m.isString)(e.id))return console.warn("G6 Warning Tips: missing 'id' property, or the 'id' %c".concat(e.id,"%c is not a string."),"font-size: 20px; color: red;",""),!1}else if(t==="edge"&&(!e.source||!e.target))return console.warn("G6 Warning Tips: missing 'source' or 'target' for the edge."),!1;return!0},vu=function(){function c(t){this.graph=t,this.destroyed=!1,this.modes=t.get("modes")||{default:[]},this.formatModes(),this.mode=t.get("defaultMode")||"default",this.currentBehaves=[],this.setMode(this.mode)}return c.prototype.formatModes=function(){var t=this.modes;(0,m.each)(t,function(e){(0,m.each)(e,function(r,n){(0,m.isString)(r)&&(e[n]={type:r})})})},c.prototype.setBehaviors=function(t){var e=this.graph,r=this.modes[t],n=[],a;(0,m.each)(r||[],function(i){var o=X.getBehavior(i.type||i);!o||(a=new o(i),a&&(a.bind(e),n.push(a)))}),this.currentBehaves=n},c.mergeBehaviors=function(t,e){return(0,m.each)(e,function(r){t.indexOf(r)<0&&((0,m.isString)(r)&&(r={type:r}),t.push(r))}),t},c.filterBehaviors=function(t,e){var r=[];return t.forEach(function(n){var a="";(0,m.isString)(n)?a=n:a=n.type,e.indexOf(a)<0&&r.push(n)}),r},c.prototype.setMode=function(t){var e=this,r=e.modes,n=e.graph,a=t,i=r[a];!i||(n.emit("beforemodechange",{mode:t}),(0,m.each)(this.currentBehaves,function(o){o.delegate&&o.delegate.remove(),o.unbind(n)}),this.setBehaviors(a),n.emit("aftermodechange",{mode:t}),this.mode=t)},c.prototype.getMode=function(){return this.mode},c.prototype.manipulateBehaviors=function(t,e,r){var n=this,a;if((0,m.isArray)(t)?a=t:a=[t],(0,m.isArray)(e))return(0,m.each)(e,function(o){n.modes[o]?r?n.modes[o]=c.mergeBehaviors(n.modes[o]||[],a):n.modes[o]=c.filterBehaviors(n.modes[o]||[],a):r&&(n.modes[o]=a)}),this;var i=e;return e||(i=this.mode),this.modes[i]||r&&(this.modes[i]=a),r?this.modes[i]=c.mergeBehaviors(this.modes[i]||[],a):this.modes[i]=c.filterBehaviors(this.modes[i]||[],a),this.formatModes(),this.setMode(this.mode),this},c.prototype.updateBehavior=function(t,e,r){(0,m.isString)(t)&&(t={type:t});var n=[];if(!r||r===this.mode||r==="default"){if(n=this.currentBehaves,!n||!n.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var a=n.length,i=0;i<a;i++){var o=n[i];if(o.type===t.type)return o.updateCfg(e),this;i===a-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}else{if(n=this.modes[r],!n||!n.length)return console.warn("Update behavior failed! There is no behaviors in this mode on the graph."),this;for(var s=n.length,i=0;i<s;i++){var o=n[i];if(o.type===t.type||o===t.type)return o===t.type&&(o={type:o}),Object.assign(o,e),n[i]=o,this;i===s-1&&console.warn("Update behavior failed! There is no such behavior in the mode")}}return this},c.prototype.destroy=function(){this.graph=null,this.modes=null,this.currentBehaves=null,this.destroyed=!0},c}(),gu=vu,pu=z(98190),Ku=function(c){(0,b.__extends)(t,c);function t(e,r){var n=c.call(this,e,r)||this;return n.item=r.item,n.canvasX=r.canvasX,n.canvasY=r.canvasY,n.wheelDelta=r.wheelDelta,n.detail=r.detail,n}return t}(pu.Event),Co=function(t){return"".concat(t,"-").concat(Math.random()).concat(Date.now())},Cs=function(t){if((0,m.isArray)(t))switch(t.length){case 4:return t;case 3:return t.push(t[1]),t;case 2:return t.concat(t);case 1:return[t[0],t[0],t[0],t[0]];default:return[0,0,0,0]}if((0,m.isNumber)(t))return[t,t,t,t];if((0,m.isString)(t)){var e=parseInt(t,10);return[e,e,e,e]}return[0,0,0,0]},cs=function(t){var e=new Ku(t.type,t);return e.clientX=t.clientX,e.clientY=t.clientY,e.x=t.x,e.y=t.y,e.target=t.target,e.currentTarget=t.currentTarget,e.bubbles=!0,e.item=t.item,e},$i=function(t){if(!t)return!1;for(var e=9,r=[1,0,0,0,1,0,0,0,1],n=0;n<e;n++)if(t[n]!==r[n])return!0;return!1},xo=function(t){return Number.isNaN(Number(t))},$u=function(t){for(var e=Infinity,r=-Infinity,n=Infinity,a=-Infinity,i=0;i<t.length;i++){var o=t[i],s=o.getBBox(),l=s.minX,h=s.minY,p=s.maxX,D=s.maxY;l<e&&(e=l),h<n&&(n=h),p>r&&(r=p),D>a&&(a=D)}var I=Math.floor(e),F=Math.floor(n),Z=Math.ceil(r)-Math.floor(e),ee=Math.ceil(a)-Math.floor(n);return{x:I,y:F,width:Z,height:ee,minX:e,minY:n,maxX:r,maxY:a}},Mf=function(t,e,r,n,a){e===void 0&&(e=15),r===void 0&&(r="quadratic"),n===void 0&&(n=void 0),a===void 0&&(a=void 0);for(var i=t.length,o=e*2,s=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],l={},h=[],p={},D=0;D<i;D++){var I=t[D],F=I.source,Z=I.target,ee="".concat(F,"-").concat(Z);if(!h[D]){l[ee]||(l[ee]=[]),h[D]=!0,l[ee].push(I);for(var se=0;se<i;se++)if(D!==se){var oe=t[se],ce=oe.source,we=oe.target;h[se]||(F===we&&Z===ce?(l[ee].push(oe),h[se]=!0,p["".concat(ce,"|").concat(we,"|").concat(l[ee].length-1)]=!0):F===ce&&Z===we&&(l[ee].push(oe),h[se]=!0))}}}for(var Re in l)for(var Oe=l[Re],Pe=Oe.length,He=0;He<Pe;He++){var at=Oe[He];if(at.source===at.target){a&&(at.type=a),at.loopCfg={position:s[He%8],dist:Math.floor(He/8)*20+50};continue}if(Pe===1&&n&&at.source!==at.target){at.type=n;continue}at.type=r;var qe=(He%2==0?1:-1)*(p["".concat(at.source,"|").concat(at.target,"|").concat(He)]?-1:1);Pe%2==1?at.curveOffset=qe*Math.ceil(He/2)*o:at.curveOffset=qe*(Math.floor(He/2)*o+e)}return t},Ts=z(31278),Cf=function(){function c(t){this.destroyed=!1,this.graph=t,this.destroyed=!1}return c.prototype.getViewCenter=function(){var t=this.getFormatPadding(),e=this.graph,r=this.graph.get("width"),n=e.get("height");return{x:(r-t[1]-t[3])/2+t[3],y:(n-t[0]-t[2])/2+t[0]}},c.prototype.fitCenter=function(t,e){var r=this.graph,n=r.get("group"),a,i=r.getNodes();if(i.length>r.get("optimizeThreshold")){var o=Infinity,s=Infinity,l=-Infinity,h=-Infinity;i.forEach(function(we){var Re=we.getModel(),Oe=Re.x,Pe=Re.y;o>Oe&&(o=Oe),s>Pe&&(s=Pe),l<Oe&&(l=Oe),h<Pe&&(h=Pe)});var p=n.getMatrix()||[1,0,0,0,1,0,0,0,1],D=_n({x:o,y:s},p),I=D.x,F=D.y,Z=_n({x:l,y:h},p),ee=Z.x,se=Z.y;a={minX:I,maxX:ee,minY:F,maxY:se,width:ee-I,height:se-F,x:I,y:F}}else a=n.getCanvasBBox();if(!(a.width===0||a.height===0)){var oe=this.getViewCenter(),ce={x:a.x+a.width/2,y:a.y+a.height/2};r.translate(oe.x-ce.x,oe.y-ce.y,t,e)}},c.prototype.animatedFitView=function(t,e,r,n,a,i,o,s){var l=this.graph;r=r||{duration:500,easing:"easeCubic"};var h=[1,0,0,0,1,0,0,0,1],p=n.x+a.x-i.x-n.minX,D=n.y+a.y-i.y-n.minY;if(!(xo(p)||xo(D))){var I=(0,Ts.vs)(h,[["t",p,D]]);if(!s){var F=bo({animateCfg:r,callback:function(){l.emit("viewportchange",{action:"translate",matrix:I})}});t.animate(function(we){return{matrix:Fa(e,I,we)}},F);return}var Z=l.get("minZoom"),ee=l.get("maxZoom"),se=o;Z&&o<Z?(se=Z,console.warn("fitview failed, ratio out of range, ratio: %f",o,"graph minzoom has been used instead")):ee&&o>ee&&(se=ee,console.warn("fitview failed, ratio out of range, ratio: %f",o,"graph maxzoom has been used instead"));var oe=(0,Ts.vs)(I,[["t",-a.x,-a.y],["s",se,se],["t",a.x,a.y]]),ce=bo({animateCfg:r,callback:function(){t.setMatrix(oe),l.emit("viewportchange",{action:"translate",matrix:I}),l.emit("viewportchange",{action:"zoom",matrix:oe})}});t.stopAnimate(),t.setMatrix(e),t.animate(function(we){return{matrix:Fa(e,oe,we)}},ce)}},c.prototype.fitView=function(t,e){var r=this.graph,n=this.getFormatPadding(),a=r.get("width"),i=r.get("height"),o=r.get("group"),s=o.getMatrix()||[1,0,0,0,1,0,0,0,1];o.resetMatrix();var l,h=r.getNodes();if(h.length>r.get("optimizeThreshold")){var p=Infinity,D=Infinity,I=-Infinity,F=-Infinity;h.forEach(function(Oe){var Pe=Oe.getModel(),He=Pe.x,at=Pe.y;p>He&&(p=He),D>at&&(D=at),I<He&&(I=He),F<at&&(F=at)}),l={minX:p,maxX:I,minY:D,maxY:F,width:I-p,height:F-D,x:p,y:D}}else l=o.getCanvasBBox();if(!(l.width===0||l.height===0)){var Z=this.getViewCenter(),ee={x:l.x+l.width/2,y:l.y+l.height/2},se=(a-n[1]-n[3])/l.width,oe=(i-n[0]-n[2])/l.height,ce=se;if(se>oe&&(ce=oe),t)this.animatedFitView(o,s,e,l,Z,ee,ce,!0);else{var we=Z.x-ee.x,Re=Z.y-ee.y;if(xo(we)||xo(Re))return;r.translate(we,Re),r.zoom(ce,Z)||console.warn("zoom failed, ratio out of range, ratio: %f",ce)}}},c.prototype.fitViewByRules=function(t,e,r){var n=t.onlyOutOfViewPort,a=n===void 0?!1:n,i=t.direction,o=i===void 0?"both":i,s=t.ratioRule,l=s===void 0?"min":s,h=this.graph,p=this.getFormatPadding(),D=h.get("width"),I=h.get("height"),F=h.get("group"),Z=F.getMatrix()||[1,0,0,0,1,0,0,0,1];F.resetMatrix();var ee,se=h.getNodes();if(se.length>h.get("optimizeThreshold")){var oe=Infinity,ce=Infinity,we=-Infinity,Re=-Infinity;se.forEach(function(fr){var lr=fr.getModel(),Kt=lr.x,jr=lr.y;oe>Kt&&(oe=Kt),ce>jr&&(ce=jr),we<Kt&&(we=Kt),Re<jr&&(Re=jr)}),ee={minX:oe,maxX:we,minY:ce,maxY:Re,width:we-oe,height:Re-ce,x:oe,y:ce}}else ee=F.getCanvasBBox();if(!(ee.width===0||ee.height===0)){var Oe=this.getViewCenter(),Pe={x:ee.x+ee.width/2,y:ee.y+ee.height/2},He=(D-p[1]-p[3])/ee.width,at=(I-p[0]-p[2])/ee.height,qe;if(o==="x"?qe=He:o==="y"?qe=at:qe=l==="max"?Math.max(He,at):Math.min(He,at),a&&(qe=qe<1?qe:1),e)this.animatedFitView(F,Z,r,ee,Oe,Pe,qe,!0);else{var yt=h.getZoom(),Ft=yt*qe,yr=h.get("minZoom");Ft<yr&&(Ft=yr,console.warn("fitview failed, ratio out of range, ratio: %f",qe,"graph minzoom has been used instead")),h.translate(Oe.x-Pe.x,Oe.y-Pe.y),h.zoomTo(Ft,Oe)}}},c.prototype.getFormatPadding=function(){var t=this.graph.get("fitViewPadding");return Cs(t)},c.prototype.focusPoint=function(t,e,r){var n=this,a=this.getViewCenter(),i=this.getPointByCanvas(a.x,a.y),o=this.graph.get("group").getMatrix();if(o||(o=[1,0,0,0,1,0,0,0,1]),e){var s=(i.x-t.x)*o[0],l=(i.y-t.y)*o[4],h=0,p=0,D=0,I=0;this.graph.get("canvas").animate(function(F){D=s*F,I=l*F,n.graph.translate(D-h,I-p),h=D,p=I},(0,b.__assign)({},r))}else this.graph.translate((i.x-t.x)*o[0],(i.y-t.y)*o[4])},c.prototype.getPointByCanvas=function(t,e){var r=this.graph.get("group").getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=Fo({x:t,y:e},r);return n},c.prototype.getPointByClient=function(t,e){var r=this.graph.get("canvas"),n=r.getPointByClient(t,e);return this.getPointByCanvas(n.x,n.y)},c.prototype.getClientByPoint=function(t,e){var r=this.graph.get("canvas"),n=this.getCanvasByPoint(t,e),a=r.getClientByPoint(n.x,n.y);return{x:a.x,y:a.y}},c.prototype.getCanvasByPoint=function(t,e){var r=this.graph.get("group").getMatrix();return r||(r=[1,0,0,0,1,0,0,0,1]),_n({x:t,y:e},r)},c.prototype.focus=function(t,e,r){if((0,m.isString)(t)&&(t=this.graph.findById(t)),t){var n=0,a=0;if(t.getType&&t.getType()==="edge"){var i=t.getSource().get("group").getMatrix(),o=t.getTarget().get("group").getMatrix();i&&o?(n=(i[6]+o[6])/2,a=(i[7]+o[7])/2):(i||o)&&(n=i?i[6]:o[6],a=i?i[7]:o[7])}else{var s=t.get("group"),l=s.getMatrix();l||(l=[1,0,0,0,1,0,0,0,1]),n=l[6],a=l[7]}this.focusPoint({x:n,y:a},e,r)}},c.prototype.focusItems=function(t,e,r,n){if(!!t.length){var a=this.graph,i=this.getFormatPadding(),o=a.get("width"),s=a.get("height"),l=a.get("group"),h=l.getMatrix()||[1,0,0,0,1,0,0,0,1];l.resetMatrix();for(var p={x:0,y:0,minX:Number.MAX_SAFE_INTEGER,minY:Number.MAX_SAFE_INTEGER,maxX:Number.MIN_SAFE_INTEGER,maxY:Number.MIN_SAFE_INTEGER,width:0,height:0},D=0,I=t;D<I.length;D++){var F=I[D],Z=F.getBBox();Z.minX<p.minX&&(p.minX=Z.minX),Z.minY<p.minY&&(p.minY=Z.minY),Z.maxX>p.maxX&&(p.maxX=Z.maxX),Z.maxY>p.maxY&&(p.maxY=Z.maxY)}if(p.x=p.minX,p.y=p.minY,p.width=p.maxX-p.minX,p.height=p.maxY-p.minY,!(p.width===0||p.height===0)){var ee=this.getViewCenter(),se={x:p.x+p.width/2,y:p.y+p.height/2},oe=(o-i[1]-i[3])/p.width,ce=(s-i[0]-i[2])/p.height,we=oe;oe>ce&&(we=ce),r?this.animatedFitView(l,h,n,p,ee,se,we,e):(a.translate(ee.x-se.x,ee.y-se.y),e&&!a.zoom(we,ee)&&console.warn("zoom failed, ratio out of range, ratio: %f",we))}}},c.prototype.changeSize=function(t,e){var r=this.graph;if(!(0,m.isNumber)(t)||!(0,m.isNumber)(e))throw Error("invalid canvas width & height, please make sure width & height type is number");r.set({width:t,height:e});var n=r.get("canvas");n.changeSize(t,e);var a=r.get("plugins");a.forEach(function(i){i.get("gridContainer")&&i.positionInit()})},c.prototype.destroy=function(){this.graph=null,this.destroyed=!1},c}(),u=Cf;function O(c){return O=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},O(c)}function ue(c){if(typeof c!="string")return c;var t=function(Pe){if(typeof Pe!="string")return Pe;try{return JSON.parse(Pe.trim())}catch(He){return Pe.trim()}},e=t(c);if(typeof e!="string")return e;for(var r=function(Pe){return Pe[Pe.length-1]},n=c.trim(),a=[],i=[],o=function(){for(var Pe=[],He=0;He<arguments.length;He++)Pe[He]=arguments[He];return Pe.some(function(at){return r(i)===at})},s=function(){return r(a)},l=null,h=0,p="";h<n.length;){var D=n[h],I=o('"',"'");if(!I&&!D.trim()){h+=1;continue}var F=n[h-1]==="\\",Z=o("}"),ee=o("]"),se=o(","),oe=s();if(I)if(r(i)===D&&!F){i.pop();var ce=t(p);oe.push(ce),l=ce,p=""}else p+=D;else if(ee&&D===",")p&&(oe.push(t(p)),p="");else if(Z&&D===":")i.push(","),p&&(oe.push(p),p="");else if(se&&D===",")p&&(oe.push(t(p)),p=""),i.pop();else if(D==="}"&&(Z||se)){p&&(oe.push(t(p)),p=""),se&&i.pop();for(var we={},Re=1;Re<oe.length;Re+=2)we[oe[Re-1]]=oe[Re];a.pop(),a.length&&r(a).push(we),i.pop(),l=we}else D==="]"&&ee?(p&&(oe.push(t(p)),p=""),a.pop(),a.length&&r(a).push(oe),i.pop(),l=oe):D==="{"?(a.push([]),i.push("}")):D==="["?(a.push([]),i.push("]")):D==='"'?i.push('"'):D==="'"?i.push("'"):p+=D;h+=1}return l||p}var ye=function(t){return t.split("-").reduce(function(e,r){return e+r.charAt(0).toUpperCase()+r.slice(1)})},_e=function(t){return function(e){for(var r=t.length,n=[],a=0,i="";a<r;)if(t[a]==="{"&&t[a+1]==="{")n.push(i),i="",a+=2;else if(t[a]==="}"&&t[a+1]==="}"){if(n.length){var o=n.pop();i=(0,m.get)(e,i,o.endsWith("=")?'"{'.concat(i,'}"'):i),n.push(o+i)}a+=2,i=""}else i+=t[a],a+=1;return n.push(i),n.map(function(s,l){return n[l-1]&&n[l-1].endsWith("=")?'"{'.concat(s,'}"'):s}).join("")}};function ke(c,t){var e={},r=c.getAttributeNames&&c.getAttributeNames()||[],n=c.children&&Array.from(c.children).map(function(o){return ke(o,t)}),a={},i=c.tagName?c.tagName.toLowerCase():"group";return i==="text"&&(e.text=c.innerText),a.type=i,i==="img"&&(a.type="image"),Array.from(r).forEach(function(o){var s=ye(o),l=c.getAttribute(o);try{if(s==="style"||s==="attrs"){var h=ue(l);e=(0,b.__assign)((0,b.__assign)({},e),h)}else a[s]=ue(l)}catch(p){if(s==="style")throw p;a[s]=l}}),a.attrs=e,t&&t.style&&a.name&&O(t.style[a.name])==="object"&&(a.attrs=(0,b.__assign)((0,b.__assign)({},a.attrs),t.style[a.name])),t&&t.style&&a.keyshape&&(a.attrs=(0,b.__assign)((0,b.__assign)({},a.attrs),t.style)),n.length&&(a.children=n),a}function Be(c,t,e){var r=c.attrs,n=r===void 0?{}:r,a={x:t.x||0,y:t.y||0,width:e.width||0,height:e.height||0},i,o;switch(c.type){case"maker":case"circle":n.r&&(o=2*n.r,i=2*n.r);break;case"text":n.text&&(o=Ks(n.text,n.fontSize||12)[0],i=16,a.y+=i,a.height=i,a.width=o,c.attrs=(0,b.__assign)({fontSize:12,fill:"#000"},n));break;default:n.width&&(o=n.width),n.height&&(i=n.height)}return i>=0&&(a.height=i),o>=0&&(a.width=o),n.marginTop&&(a.y+=n.marginTop),n.marginLeft&&(a.x+=n.marginLeft),a}function Ye(c,t){var e;t===void 0&&(t={x:0,y:0});var r=(0,b.__assign)({x:0,y:0,width:0,height:0},t);if((e=c.children)===null||e===void 0?void 0:e.length){var n=c.attrs,a=n===void 0?{}:n,i=a.marginTop,o=(0,b.__assign)({},t);i&&(o.y+=i);for(var s=0;s<c.children.length;s++){c.children[s].attrs.key="".concat(a.key||"root"," -").concat(s," ");var l=Ye(c.children[s],o);if(l.bbox){var h=l.bbox;l.attrs.next==="inline"?o.x+=l.bbox.width:o.y+=l.bbox.height,h.width+h.x>r.width&&(r.width=h.width+h.x),h.height+h.y>r.height&&(r.height=h.height+h.y)}}}return c.bbox=Be(c,t,r),c.attrs=(0,b.__assign)((0,b.__assign)({},c.attrs),c.bbox),c}function Je(c,t){var e,r,n,a,i=(c||{}).type,o=((t==null?void 0:t.attrs)||{}).key;if(o&&c&&(c.attrs.key=o),!c&&t)return{action:"delete",val:t,type:i,key:o};if(c&&!t)return{action:"add",val:c,type:i};if(!c&&!t)return{action:"same",type:i};var s=[];if(((e=c.children)===null||e===void 0?void 0:e.length)>0||((r=t.children)===null||r===void 0?void 0:r.length)>0)for(var l=Math.max((n=c.children)===null||n===void 0?void 0:n.length,(a=t.children)===null||a===void 0?void 0:a.length),h=t.children||[],p=c.children||[],D=0;D<l;D+=1)s.push(Je(p[D],h[D]));var I=Object.keys(t.attrs),F=Object.keys(c.attrs);return t.type!==c.type?{action:"restructure",nowTarget:c,formerTarget:t,key:o,children:s}:I.filter(function(Z){return Z!=="children"}).some(function(Z){return c.attrs[Z]!==t.attrs[Z]||!F.includes(Z)})?{action:"change",val:c,children:s,type:i,key:o}:{action:"same",children:s,type:i,key:o}}function dt(c){var t={},e=function(n){var a=typeof c=="function"?c(n):c,i=_e(a)(n),o=document.createElement("div");o.innerHTML=i;var s=o.children[0],l=Ye(ke(s,n));return o.remove(),l};return{draw:function(n,a){var i=e(n),o=a,s=function l(h){var p=h.attrs,D=p===void 0?{}:p,I=h.bbox,F=h.type,Z=h.children,ee=(0,b.__rest)(h,["attrs","bbox","type","children"]);if(h.type!=="group"){var se=a.addShape(h.type,(0,b.__assign)({attrs:D,origin:{bbox:I,type:F,children:Z}},ee));h.keyshape&&(o=se)}h.children&&h.children.forEach(function(oe){return l(oe)})};return s(i),t[n.id]=[i],o},update:function(n,a){t[n.id]||(t[n.id]=[]);var i=a.getContainer(),o=i.get("children"),s=e(n),l=t[n.id].pop(),h=Je(s,l),p=function F(Z){var ee;Z.type!=="group"&&i.addShape(Z.type,{attrs:Z.attrs}),((ee=Z.children)===null||ee===void 0?void 0:ee.length)&&Z.children.map(function(se){return F(se)})},D=function F(Z){var ee,se=o.find(function(oe){return oe.attrs.key===Z.attrs.key});se&&i.removeChild(se),((ee=Z.children)===null||ee===void 0?void 0:ee.length)&&Z.children.map(function(oe){return F(oe)})},I=function F(Z){var ee=Z.key;if(Z.type!=="group"){var se=o.find(function(ce){return ce.attrs.key===ee});switch(Z.action){case"change":if(se){var oe=Z.val.keyshape?a.getOriginStyle():{};se.attr((0,b.__assign)((0,b.__assign)({},oe),Z.val.attrs))}break;case"add":p(Z.val);break;case"delete":D(Z.val);break;case"restructure":D(Z.formerTarget),p(Z.nowTarget);break;default:break}}Z.children&&Z.children.forEach(function(ce){return F(ce)})};I(h),t[n.id].push(s)},getAnchorPoints:function(){return[[0,.5],[1,.5],[.5,1],[.5,0]]}}}var It={};function ir(c){return It[c]||(It[c]=(0,m.upperFirst)(c)),It[c]}var cr={defaultShapeType:"defaultType",className:null,getShape:function(t){var e=this,r=e[t]||e[e.defaultShapeType]||e["simple-circle"];return r},draw:function(t,e,r){var n=this.getShape(t);r.shapeMap={};var a=n.draw(e,r);return n.afterDraw&&n.afterDraw(e,r,a),a},baseUpdate:function(t,e,r,n){var a,i,o=this.getShape(t);o.update&&(o.mergeStyle=(a=o.getOptions)===null||a===void 0?void 0:a.call(o,e,n),(i=o.update)===null||i===void 0||i.call(o,e,r,n)),o.afterUpdate&&o.afterUpdate(e,r)},setState:function(t,e,r,n){var a=this.getShape(t);a.setState(e,r,n)},shouldUpdate:function(t){var e=this.getShape(t);return!!e.update},getControlPoints:function(t,e){var r=this.getShape(t);return r.getControlPoints(e)},getAnchorPoints:function(t,e){var r=this.getShape(t);return r.getAnchorPoints(e)}},nr={options:{},draw:function(t,e){return this.drawShape(t,e)},drawShape:function(){},afterDraw:function(){},afterUpdate:function(){},setState:function(){},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e=this.options.anchorPoints,r=t.anchorPoints||e;return r}},Or=function(){function c(){}return c.registerFactory=function(t,e){var r=ir(t),n=cr,a=(0,b.__assign)((0,b.__assign)({},n),e);return c[r]=a,a.className=r,a},c.getFactory=function(t){var e=ir(t);return c[e]},c.registerNode=function(t,e,r){var n=c.Node,a;if(typeof e=="string"||typeof e=="function"){var i=dt(e);a=(0,b.__assign)((0,b.__assign)({},n.getShape("single-node")),i)}else if(e.jsx){var o=e.jsx,i=dt(o);a=(0,b.__assign)((0,b.__assign)((0,b.__assign)({},n.getShape("single-node")),i),e)}else{n.getShape(r);var s=r?n.getShape(r):nr;a=(0,b.__assign)((0,b.__assign)({},s),e)}return a.type=t,a.itemType="node",n[t]=a,a},c.registerEdge=function(t,e,r){var n=c.Edge,a=r?n.getShape(r):nr,i=(0,b.__assign)((0,b.__assign)({},a),e);return i.type=t,i.itemType="edge",n[t]=i,i},c.registerCombo=function(t,e,r){var n=c.Combo,a=r?n.getShape(r):nr,i=(0,b.__assign)((0,b.__assign)({},a),e);return i.type=t,i.itemType="combo",n[t]=i,i},c}(),Cr=Or;Or.registerFactory("node",{defaultShapeType:"circle"}),Or.registerFactory("edge",{defaultShapeType:"line"}),Or.registerFactory("combo",{defaultShapeType:"circle"});var hr="bboxCache",rn="bboxCanvasCache",Jn=null,qn=function(){function c(t){this._cfg={},this.destroyed=!1,this.optimize=!1;var e={id:void 0,type:"item",model:{},group:void 0,animate:!1,visible:!0,locked:!1,event:!0,keyShape:void 0,states:[]};this._cfg=Object.assign(e,this.getDefaultCfg(),t);var r=this.get("model"),n=r.id,a=this.get("type");typeof n=="undefined"?n=Co(a):typeof n!="string"&&(n=String(n)),this.get("model").id=n,this.set("id",n);var i=t.group;i&&(i.set("item",this),i.set("id",n)),this.init(),this.draw();var o=r.shape||r.type||(a==="edge"?"line":"circle"),s=this.get("shapeFactory");if(s&&s[o]){var l=s[o].options;if(l&&l.stateStyles){var h=this.get("styles")||r.stateStyles;h=(0,m.deepMix)({},l.stateStyles,h),this.set("styles",h)}}}return c.prototype.calculateBBox=function(){var t=this.get("keyShape"),e=this.get("group"),r=Eo(t,e);return r.x=r.minX,r.y=r.minY,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.centerX=(r.minX+r.maxX)/2,r.centerY=(r.minY+r.maxY)/2,r},c.prototype.calculateCanvasBBox=function(){var t=this.get("keyShape"),e=this.get("group"),r=Eo(t,e);return r.x=r.minX,r.y=r.minY,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.centerX=(r.minX+r.maxX)/2,r.centerY=(r.minY+r.maxY)/2,r},c.prototype.drawInner=function(){var t=this,e=t.get("shapeFactory"),r=t.get("group"),n=t.get("model");r.clear();var a=n.visible;if(a!==void 0&&!a&&t.changeVisibility(a),!!e){t.updatePosition(n);var i=t.getShapeCfg(n),o=i.type,s=e.draw(o,i,r);s&&(t.set("keyShape",s),s.set("isKeyShape",!0),s.set("draggable",!0)),this.setOriginStyle(),this.set("currentShape",o),this.restoreStates(e,o)}},c.prototype.setOriginStyle=function(){var t=this.get("group"),e=t.get("children"),r=this.getKeyShape(),n=this,a=r.get("name");if(this.get("originStyle")){var I=this.get("originStyle");a&&!I[a]&&(I[a]={});for(var F=this.getCurrentStatesStyle(),Z=function(se){var oe=e[se],ce=oe.get("name"),we=oe.attr();if(ce&&ce!==a){var Re=F[ce];I[ce]||(I[ce]={}),Re?Object.keys(we).forEach(function(He){var at=we[He];at!==Re[He]&&(I[ce][He]=at)}):I[ce]=oe.get("type")!=="image"?(0,m.clone)(we):n.getShapeStyleByName(ce)}else{var Oe=oe.attr(),Pe={};Object.keys(F).forEach(function(He){var at=F[He];(He===a||!(0,m.isPlainObject)(at))&&(Pe[He]=at)}),Object.keys(Oe).forEach(function(He){var at=Oe[He];Pe[He]!==at&&(a?I[a][He]=at:I[He]=at)})}},o=0;o<e.length;o++)Z(o);delete I.path,delete I.matrix,delete I.x,delete I.y,I[a]&&(delete I[a].x,delete I[a].y,delete I[a].matrix,delete I[a].path),n.set("originStyle",I)}else{for(var i={},o=0;o<e.length;o++){var s=e[o],l=s.get("type"),h=s.get("name");if(h&&h!==a)i[h]=l!=="image"?(0,m.clone)(s.attr()):n.getShapeStyleByName(h),l==="text"&&i[h]&&(delete i[h].x,delete i[h].y,delete i[h].matrix);else{var p=n.getShapeStyleByName();if(delete p.path,delete p.matrix,!a)Object.assign(i,p);else if(h)i[a]=p;else{var D=Co("shape");s.set("name",D),t.shapeMap[D]=s,i[D]=l!=="image"?(0,m.clone)(s.attr()):n.getShapeStyleByName(h)}}}n.set("originStyle",i)}},c.prototype.restoreStates=function(t,e){var r=this,n=r.get("states");(0,m.each)(n,function(a){t.setState(e,a,!0,r)})},c.prototype.init=function(){var t=Cr.getFactory(this.get("type"));this.set("shapeFactory",t)},c.prototype.get=function(t){return this._cfg[t]},c.prototype.set=function(t,e){(0,m.isPlainObject)(t)?this._cfg=(0,b.__assign)((0,b.__assign)({},this._cfg),t):this._cfg[t]=e},c.prototype.getDefaultCfg=function(){return{}},c.prototype.clearCache=function(){this.set(hr,null),this.set(rn,null)},c.prototype.beforeDraw=function(){},c.prototype.afterDraw=function(){},c.prototype.afterUpdate=function(){},c.prototype.draw=function(){this.beforeDraw(),this.drawInner(),this.afterDraw()},c.prototype.getShapeStyleByName=function(t){var e=this.get("group"),r;if(t?r=e.shapeMap[t]:r=this.getKeyShape(),r){var n={};return(0,m.each)(r.attr(),function(a,i){(i!=="img"||(0,m.isString)(a))&&(n[i]=a)}),n}return{}},c.prototype.getShapeCfg=function(t,e){var r=this.get("styles");if(r){var n=t;return n.style=(0,b.__assign)((0,b.__assign)({},r),t.style),n}return t},c.prototype.getStateStyle=function(t){var e=this.get("styles"),r=e&&e[t];return r},c.prototype.getOriginStyle=function(){return this.get("originStyle")},c.prototype.getCurrentStatesStyle=function(){var t=this,e={},r=t.getStates();return!r||!r.length?this.get("originStyle"):((0,m.each)(t.getStates(),function(n){e=Object.assign(e,t.getStateStyle(n))}),e)},c.prototype.setState=function(t,e){var r=this.get("states"),n=this.get("shapeFactory"),a=t,i=t;(0,m.isString)(e)&&(a="".concat(t,":").concat(e),i="".concat(t,":"));var o=r;if((0,m.isBoolean)(e)){var s=r.indexOf(i);if(e){if(s>-1)return;r.push(a)}else s>-1&&r.splice(s,1)}else if((0,m.isString)(e)){var l=r.filter(function(D){return D.includes(i)});l.length>0&&this.clearStates(l),o=o.filter(function(D){return!D.includes(i)}),o.push(a),this.set("states",o)}if(n){var h=this.get("model"),p=h.type;n.setState(p,t,e,this)}},c.prototype.clearStates=function(t){var e=this,r=e.getStates(),n=e.get("shapeFactory"),a=e.get("model"),i=a.type;t||(t=r),(0,m.isString)(t)&&(t=[t]);var o=r.filter(function(s){return t.indexOf(s)===-1});e.set("states",o),t.forEach(function(s){n.setState(i,s,!1,e)})},c.prototype.setOptimize=function(t){this.optimize=t},c.prototype.getContainer=function(){return this.get("group")},c.prototype.getKeyShape=function(){return this.get("keyShape")},c.prototype.getModel=function(){return this.get("model")},c.prototype.getType=function(){return this.get("type")},c.prototype.getID=function(){return this.get("id")},c.prototype.isItem=function(){return!0},c.prototype.getStates=function(){return this.get("states")},c.prototype.hasState=function(t){var e=this.getStates();return e.indexOf(t)>=0},c.prototype.refresh=function(t){var e=this.get("model");this.updatePosition(e),this.updateShape(t),this.afterUpdate(),this.clearCache()},c.prototype.getUpdateType=function(t){},c.prototype.update=function(t,e){e===void 0&&(e=void 0);var r=this.get("model");if(e==="move")this.updatePosition(t);else{var n=r.visible,a=t.visible;n!==a&&a!==void 0&&this.changeVisibility(a);var i={x:r.x,y:r.y};t.x=isNaN(+t.x)?r.x:+t.x,t.y=isNaN(+t.y)?r.y:+t.y;var o=this.get("styles");if(t.stateStyles){var s=t.stateStyles;(0,m.mix)(o,s),delete t.stateStyles}Object.assign(r,t),(i.x!==t.x||i.y!==t.y)&&this.updatePosition(t),this.updateShape(e)}this.afterUpdate(),this.clearCache()},c.prototype.updateShape=function(t){var e=this.get("shapeFactory"),r=this.get("model"),n=r.type;if(e.shouldUpdate(n)&&n===this.get("currentShape")){var a=this.getShapeCfg(r,t);e.baseUpdate(n,a,this,t),t!=="move"&&this.setOriginStyle()}else this.draw();this.restoreStates(e,n)},c.prototype.updatePosition=function(t){var e=this.get("model"),r=isNaN(+t.x)?+e.x:+t.x,n=isNaN(+t.y)?+e.y:+t.y,a=this.get("group");if(isNaN(r)||isNaN(n))return!1;e.x=r,e.y=n;var i=a.getMatrix();return i&&i[6]===r&&i[7]===n?!1:(a.resetMatrix(),Mo(a,{x:r,y:n}),this.clearCache(),!0)},c.prototype.getBBox=function(){var t=this.get(hr);return t||(t=this.calculateBBox(),this.set(hr,t)),t},c.prototype.getCanvasBBox=function(){var t=this.get(rn);return t||(t=this.calculateCanvasBBox(),this.set(rn,t)),t},c.prototype.toFront=function(){var t=this.get("group");t.toFront()},c.prototype.toBack=function(){var t=this.get("group");t.toBack()},c.prototype.show=function(){this.changeVisibility(!0)},c.prototype.hide=function(){this.changeVisibility(!1)},c.prototype.changeVisibility=function(t){var e=this.get("group");t?e.show():e.hide(),this.set("visible",t)},c.prototype.isVisible=function(){return this.get("visible")},c.prototype.enableCapture=function(t){var e=this.get("group");e&&e.set("capture",t)},c.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),e=this.get("group");t&&e.stopAnimate(),e.shapeMap={},this.clearCache(),e.remove(),this._cfg=null,this.destroyed=!0}},c}(),Un=qn,Mn={source:"start",target:"end"},Cn="Node",Ga="Point",ei="Anchor",Ka=function(c){(0,b.__extends)(t,c);function t(){return c!==null&&c.apply(this,arguments)||this}return t.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},t.prototype.setEnd=function(e,r){var n=Mn[e]+Ga,a=e+Cn,i=this.get(a);i&&!i.destroyed&&i.removeEdge(this),(0,m.isPlainObject)(r)?(this.set(n,r),this.set(a,null)):r&&(r.addEdge(this),this.set(a,r),this.set(n,null))},t.prototype.getLinkPoint=function(e,r,n){var a=Mn[e]+Ga,i=e+Cn,o=this.get(a);if(!o){var s=this.get(i),l=e+ei,h=this.getPrePoint(e,n),p=r[l];(0,m.isNil)(p)||(o=s.getLinkPointByAnchor(p)),o=o||s.getLinkPoint(h),(0,m.isNil)(o.index)||this.set("".concat(e,"AnchorIndex"),o.index)}return o},t.prototype.getPrePoint=function(e,r){if(r&&r.length){var n=e==="source"?0:r.length-1;return r[n]}var a=e==="source"?"target":"source";return this.getEndPoint(a)},t.prototype.getEndPoint=function(e){var r=e+Cn,n=Mn[e]+Ga,a=this.get(r);return a&&!a.destroyed?a.get("model"):this.get(n)},t.prototype.getControlPointsByCenter=function(e){var r=this.getEndPoint("source"),n=this.getEndPoint("target"),a=this.get("shapeFactory"),i=e.type;return a.getControlPoints(i,{startPoint:r,endPoint:n})},t.prototype.getEndCenter=function(e){var r=e+Cn,n=Mn[e]+Ga,a=this.get(r);if(a){var i=a.getBBox();return{x:i.centerX,y:i.centerY}}return this.get(n)},t.prototype.init=function(){c.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},t.prototype.getShapeCfg=function(e,r){var n=this,a=n.get("linkCenter"),i=(r==null?void 0:r.includes("move"))?e:c.prototype.getShapeCfg.call(this,e);if(a)i.startPoint=n.getEndCenter("source"),i.endPoint=n.getEndCenter("target");else{var o=i.controlPoints||n.getControlPointsByCenter(i);i.startPoint=n.getLinkPoint("source",e,o),i.endPoint=n.getLinkPoint("target",e,o)}return i.sourceNode=n.get("sourceNode"),i.targetNode=n.get("targetNode"),i},t.prototype.getModel=function(){var e=this.get("model"),r=this.get("source".concat(Cn)),n=this.get("target".concat(Cn));return r?delete e["source".concat(Cn)]:e.source=this.get("start".concat(Ga)),n?delete e["target".concat(Cn)]:e.target=this.get("end".concat(Ga)),!(0,m.isString)(e.source)&&!(0,m.isPlainObject)(e.source)&&(e.source=e.source.getID()),!(0,m.isString)(e.target)&&!(0,m.isPlainObject)(e.target)&&(e.target=e.target.getID()),e},t.prototype.setSource=function(e){this.setEnd("source",e),this.set("source",e)},t.prototype.setTarget=function(e){this.setEnd("target",e),this.set("target",e)},t.prototype.getSource=function(){return this.get("source")},t.prototype.getTarget=function(){return this.get("target")},t.prototype.updatePosition=function(){return!1},t.prototype.update=function(e,r){r===void 0&&(r=void 0);var n=this.get("model"),a=n.visible,i=e.visible;a!==i&&i!==void 0&&this.changeVisibility(i);var o=this.get("source"),s=this.get("target");if(!(!o||o.destroyed||!s||s.destroyed)){var l=this.get("styles");if(e.stateStyles){var h=e.stateStyles;(0,m.mix)(l,h),delete e.stateStyles}Object.assign(n,e),this.updateShape(r),this.afterUpdate(),this.clearCache()}},t.prototype.destroy=function(){var e=this.get("source".concat(Cn)),r=this.get("target".concat(Cn));e&&!e.destroyed&&e.removeEdge(this),r&&!r.destroyed&&r.removeEdge(this),c.prototype.destroy.call(this)},t}(Un),$a=Ka,Ha="anchorPointsCache",fi="bboxCache",bi=function(c){(0,b.__extends)(t,c);function t(){return c!==null&&c.apply(this,arguments)||this}return t.prototype.getNearestPoint=function(e,r){for(var n=0,a=e[0],i=Va(e[0],r),o=0;o<e.length;o++){var s=e[o],l=Va(s,r);l<i&&(a=s,i=l,n=o)}return a.anchorIndex=n,a},t.prototype.getDefaultCfg=function(){return{type:"node",edges:[]}},t.prototype.getEdges=function(){return this.get("edges")},t.prototype.getInEdges=function(){var e=this;return this.get("edges").filter(function(r){return r.get("target")===e})},t.prototype.getOutEdges=function(){var e=this;return this.get("edges").filter(function(r){return r.get("source")===e})},t.prototype.getNeighbors=function(e){var r=this,n=this.get("edges");if(e==="target"){var a=function(l){return l.getSource()===r};return n.filter(a).map(function(s){return s.getTarget()})}if(e==="source"){var i=function(l){return l.getTarget()===r};return n.filter(i).map(function(s){return s.getSource()})}var o=function(l){return l.getSource()===r?l.getTarget():l.getSource()};return n.map(o)},t.prototype.getLinkPointByAnchor=function(e){var r=this.getAnchorPoints();return r[e]},t.prototype.getLinkPoint=function(e){var r=this.get("keyShape"),n=r.get("type"),a=this.get("type"),i,o,s=this.getBBox();a==="combo"?(i=s.centerX||(s.maxX+s.minX)/2,o=s.centerY||(s.maxY+s.minY)/2):(i=s.centerX,o=s.centerY);var l=this.getAnchorPoints(),h;switch(n){case"circle":h=Oo({x:i,y:o,r:s.width/2},e);break;case"ellipse":h=Hi({x:i,y:o,rx:s.width/2,ry:s.height/2},e);break;default:h=_s(s,e)}var p=h;return l.length&&(p||(p=e),p=this.getNearestPoint(l,p)),p||(p={x:i,y:o}),p},t.prototype.getAnchorPoints=function(){var e=this.get(Ha);if(!e){e=[];var r=this.get("shapeFactory"),n=this.getBBox(),a=this.get("model"),i=this.getShapeCfg(a),o=a.type,s=r.getAnchorPoints(o,i)||[];(0,m.each)(s,function(l,h){var p={x:n.minX+l[0]*n.width,y:n.minY+l[1]*n.height,anchorIndex:h};e.push(p)}),this.set(Ha,e)}return e},t.prototype.addEdge=function(e){this.get("edges").push(e)},t.prototype.lock=function(){this.set("locked",!0)},t.prototype.unlock=function(){this.set("locked",!1)},t.prototype.hasLocked=function(){return this.get("locked")},t.prototype.removeEdge=function(e){var r=this.getEdges(),n=r.indexOf(e);n>-1&&r.splice(n,1)},t.prototype.clearCache=function(){this.set(fi,null),this.set(Ha,null)},t.prototype.getUpdateType=function(e){var r,n,a,i,o;if(!!e){var s=!(0,m.isNil)(e.x),l=!(0,m.isNil)(e.y),h=Object.keys(e);if(h.length===1&&(s||l)||h.length===2&&s&&l)return"move";if((0,m.isNumber)(e.x)||(0,m.isNumber)(e.y)||e.type||e.anchorPoints||e.size||(e==null?void 0:e.style)&&(((r=e==null?void 0:e.style)===null||r===void 0?void 0:r.r)||((n=e==null?void 0:e.style)===null||n===void 0?void 0:n.width)||((a=e==null?void 0:e.style)===null||a===void 0?void 0:a.height)||((i=e==null?void 0:e.style)===null||i===void 0?void 0:i.rx)||((o=e==null?void 0:e.style)===null||o===void 0?void 0:o.ry)))return"bbox|label";var p=h.includes("label")||h.includes("labelCfg");return p?"style|label":"style"}},t.prototype.setState=function(e,r){var n=this;if(this.optimize){c.prototype.setState.call(this,e,r);return}this.runWithBBoxAffected(function(){return c.prototype.setState.call(n,e,r)})},t.prototype.clearStates=function(e){var r=this;if(this.optimize){c.prototype.clearStates.call(this,e);return}this.runWithBBoxAffected(function(){return c.prototype.clearStates.call(r,e)})},t.prototype.runWithBBoxAffected=function(e){var r=["r","width","height","rx","ry","lineWidth"],n=this.getKeyShape().attr(),a={};Object.keys(this.getKeyShape().attr()).forEach(function(l){r.includes(l)&&(a[l]=n[l])}),e();for(var i=this.getKeyShape().attr(),o=0;o<r.length;o++){var s=r[o];if(i[s]!==a[s]){this.clearCache(),this.getEdges().forEach(function(l){return l.refresh()});break}}},t}(Un),ha=bi,Oa="bboxCache",Jo="bboxCanvasCache",Wo="sizeCache",oo="anchorPointsCache",Qs=function(c){(0,b.__extends)(t,c);function t(){return c!==null&&c.apply(this,arguments)||this}return t.prototype.getDefaultCfg=function(){return{type:"combo",nodes:[],edges:[],combos:[]}},t.prototype.getShapeCfg=function(e){var r=this.get("styles"),n=this.get("bbox");if(r&&n){var a=e,i=(0,m.isNumber)(e.size)?[e.size,e.size]:e.size,o=(0,m.isNumber)(e.fixSize)?[e.fixSize,e.fixSize]:e.fixSize,s=i||o||an.defaultCombo.size,l={r:(Math.max(n.width,n.height)||Math.max(s[0],s[1]))/2,width:n.width||s[0],height:n.height||s[1]};a.style=(0,b.__assign)((0,b.__assign)((0,b.__assign)({},r),e.style),l);var h=e.padding||an.defaultCombo.padding;return(0,m.isNumber)(h)?(l.r+=h,l.width+=h*2,l.height+=h*2):(l.r=l.r+Math.max.apply(Math,h),l.width+=h[1]+h[3]||h[1]*2,l.height+=h[0]+h[2]||h[0]*2),this.set(Wo,l),a}return e},t.prototype.calculateCanvasBBox=function(){if(!this.destroyed){var e=this.get("keyShape"),r=this.get("group"),n=Eo(e,r);n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2;var a=this.get(Oa)||{},i=a.x,o=a.x;return n.width=n.maxX-n.minX,n.height=n.maxY-n.minY,n.centerX=(n.minX+n.maxX)/2,n.centerY=(n.minY+n.maxY)/2,n.x=n.minX,n.y=n.minY,(n.x!==i||n.y!==o)&&this.set(oo,null),n}},t.prototype.getChildren=function(){var e=this;return{nodes:e.getNodes(),combos:e.getCombos()}},t.prototype.getNodes=function(){var e=this;return e.get("nodes")},t.prototype.getCombos=function(){var e=this;return e.get("combos")},t.prototype.addChild=function(e){var r=this,n=e.getType();switch(n){case"node":r.addNode(e);break;case"combo":r.addCombo(e);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},t.prototype.addCombo=function(e){var r=this;return r.get("combos").push(e),!0},t.prototype.addNode=function(e){var r=this;return r.get("nodes").push(e),!0},t.prototype.removeChild=function(e){var r=this,n=e.getType();switch(n){case"node":r.removeNode(e);break;case"combo":r.removeCombo(e);break;default:return console.warn("Only node or combo items are allowed to be added into a combo"),!1}return!0},t.prototype.removeCombo=function(e){if(!!e){var r=this.getCombos(),n=r.indexOf(e);return n>-1?(r.splice(n,1),!0):!1}},t.prototype.removeNode=function(e){if(!!e){var r=this.getNodes(),n=r.indexOf(e);return n>-1?(r.splice(n,1),!0):!1}},t.prototype.getUpdateType=function(e){},t.prototype.getBBox=function(){this.set(Jo,null);var e=this.calculateCanvasBBox();return e},t.prototype.clearCache=function(){this.set(Oa,null),this.set(Jo,null),this.set(oo,null)},t.prototype.destroy=function(){if(!this.destroyed){var e=this.get("animate"),r=this.get("group");e&&r.stopAnimate(),r.shapeMap={},this.clearCache(),this.set(Wo,null),this.set("bbox",null),r.remove(),this._cfg=null,this.destroyed=!0}},t}(ha),Tf=Qs,Qu="node",Ju="edge",cc="vedge",yu="combo",If="default",Of="Mapper",qo="stateStyles",Af=function(){function c(t){var e=this;this.edgeToBeUpdateMap={},this.throttleRefresh=(0,m.throttle)(function(r){var n=e.graph;if(!(!n||n.get("destroyed"))){var a=e.edgeToBeUpdateMap;if(!!a){var i=Object.values(a);!i.length||(i.forEach(function(o){var s=o.edge;if(!(!s||s.destroyed)){var l=s.getSource(),h=s.getTarget();!l||l.destroyed||!h||h.destroyed||s.refresh(o.updateType)}}),e.edgeToBeUpdateMap={})}}},16,{trailing:!0,leading:!0}),this.graph=t,this.destroyed=!1}return c.prototype.addItem=function(t,e){var r=this.graph,n=t===cc?Ju:t,a=r.get("".concat(n,"Group"))||r.get("group"),i=(0,m.upperFirst)(n),o=null,s=r.get(n+(0,m.upperFirst)(qo))||{},l=r.get(If+i);e[qo]&&(s=e[qo]),l&&(0,m.each)(l,function(Oe,Pe){(0,m.isObject)(Oe)&&!(0,m.isArray)(Oe)?e[Pe]=(0,m.deepMix)({},Oe,e[Pe]):(0,m.isArray)(Oe)?e[Pe]=e[Pe]||(0,m.clone)(l[Pe]):e[Pe]=e[Pe]||l[Pe]});var h=r.get(n+Of);if(h){var p=h(e);p[qo]&&(s=p[qo],delete p[qo]),(0,m.each)(p,function(Oe,Pe){(0,m.isObject)(Oe)&&!(0,m.isArray)(Oe)?e[Pe]=(0,m.deepMix)({},e[Pe],Oe):e[Pe]=p[Pe]||e[Pe]})}if(r.emit("beforeadditem",{type:t,model:e}),t===Ju||t===cc){var D=void 0,I=void 0;if(D=e.source,I=e.target,D&&(0,m.isString)(D)&&(D=r.findById(D)),I&&(0,m.isString)(I)&&(I=r.findById(I)),!D||!I){console.warn("The source or target node of edge ".concat(e.id," does not exist!"));return}D.getType&&D.getType()==="combo"&&(e.isComboEdge=!0),I.getType&&I.getType()==="combo"&&(e.isComboEdge=!0),o=new $a({model:e,source:D,target:I,styles:s,linkCenter:r.get("linkCenter"),group:a.addGroup()})}else if(t===Qu)o=new ha({model:e,styles:s,group:a.addGroup()});else if(t===yu){var F=e.children,Z=us(F,r),ee=void 0,se=void 0;if(isNaN(Z.x)?isNaN(e.x)&&(ee=Math.random()*100):ee=Z.x,isNaN(Z.y)?isNaN(e.y)&&(se=Math.random()*100):se=Z.y,isNaN(e.x)||isNaN(e.y))e.x=ee,e.y=se;else{var oe=e.x-ee,ce=e.y-se;this.updateComboSucceeds(e.id,oe,ce,F)}var we=a.addGroup();we.setZIndex(e.depth),o=new Tf({model:e,styles:s,animate:r.get("animate"),bbox:e.collapsed?us([],r):Z,group:we}),!e.collapsed&&o.getKeyShape().get("type")==="circle"&&(Z.width=Math.hypot(Z.height,Z.width),Z.height=Z.width,o.set("bbox",Z),o.refresh());var Re=o.getModel();(F||[]).forEach(function(Oe){var Pe=r.findById(Oe.id);o.addChild(Pe),Oe.depth=Re.depth+2})}if(o)return o.setOptimize(r.getNodes().length>r.get("optimizeThreshold")),r.get("".concat(t,"s")).push(o),r.get("itemMap")[o.get("id")]=o,r.emit("afteradditem",{item:o,model:e}),o},c.prototype.updateItem=function(t,e){var r=this,n,a,i=this.graph;if((0,m.isString)(t)&&(t=i.findById(t)),!(!t||t.destroyed)){var o="";t.getType&&(o=t.getType());var s=i.get(o+Of),l=t.getModel(),h=l.x,p=l.y,D=t.getUpdateType(e);if(s){var I=(0,m.deepMix)({},l,e),F=s(I),Z=(0,m.deepMix)({},l,F,e);F[qo]&&(t.set("styles",Z[qo]),delete Z[qo]),(0,m.each)(Z,function(qe,yt){e[yt]=qe})}else(0,m.each)(e,function(qe,yt){l[yt]&&(0,m.isObject)(qe)&&!(0,m.isArray)(qe)&&(e[yt]=(0,b.__assign)((0,b.__assign)({},l[yt]),e[yt]))});if(i.emit("beforeupdateitem",{item:t,cfg:e}),o===Ju){if(e.source){var ee=e.source;(0,m.isString)(ee)&&(ee=i.findById(ee)),t.setSource(ee)}if(e.target){var se=e.target;(0,m.isString)(se)&&(se=i.findById(se)),t.setTarget(se)}t.update(e)}else if(o===Qu){t.update(e,D);var oe=t.getEdges();D==="move"?(0,m.each)(oe,function(qe){r.edgeToBeUpdateMap[qe.getID()]={edge:qe,updateType:D},r.throttleRefresh()}):(D==null?void 0:D.includes("bbox"))&&(0,m.each)(oe,function(qe){qe.refresh(D)})}else if(o===yu){if(t.update(e,D),!isNaN(e.x)||!isNaN(e.y)){var ce=e.x-h||0,we=e.y-p||0;this.updateComboSucceeds(l.id,ce,we)}var Re=t.getEdges(),Oe=(D==null?void 0:D.includes("bbox"))||D==="move";if(Oe&&o===yu){var Pe=t.get("shapeFactory"),He=l.type||"circle",at=l.animate===void 0||e.animate===void 0?(a=(n=Pe[He])===null||n===void 0?void 0:n.options)===null||a===void 0?void 0:a.animate:l.animate||e.animate;at?setTimeout(function(){if(!(!t||t.destroyed)){var qe=t.getKeyShape();!qe||qe.destroyed||(0,m.each)(Re,function(yt){yt&&!yt.destroyed&&yt.refresh()})}},201):(0,m.each)(Re,function(qe){qe.refresh()})}}t.setOptimize(i.getNodes().length>i.get("optimizeThreshold")),i.emit("afterupdateitem",{item:t,cfg:e})}},c.prototype.updateCombo=function(t,e,r){var n=this,a,i,o=this.graph;if((0,m.isString)(t)&&(t=o.findById(t)),!(!t||t.destroyed)){var s=t.getModel(),l=us(e,o,t),h=l.x,p=l.y;t.set("bbox",l);var D=h,I=p;r?(D=isNaN(s.x)?h:s.x,I=isNaN(s.y)?p:s.y):(D=isNaN(h)?s.x:h,I=isNaN(p)?s.y:p),t.update({x:D,y:I});var F=t.get("shapeFactory"),Z=s.type||"circle",ee=s.animate===void 0?(i=(a=F[Z])===null||a===void 0?void 0:a.options)===null||i===void 0?void 0:i.animate:s.animate;ee?setTimeout(function(){if(!(!t||t.destroyed)){var se=t.getKeyShape();!se||se.destroyed||(t.getShapeCfg(s),n.updateComboEdges(t))}},201):this.updateComboEdges(t)}},c.prototype.updateComboEdges=function(t){for(var e,r,n=t.getEdges()||[],a=0;a<n.length;a++){var i=n[a];!(i==null?void 0:i.destroyed)&&!((e=i==null?void 0:i.getSource())===null||e===void 0?void 0:e.destroyed)&&!((r=i==null?void 0:i.getTarget())===null||r===void 0?void 0:r.destroyed)&&i.refresh()}},c.prototype.collapseCombo=function(t,e){e===void 0&&(e=!0);var r=this.graph;(0,m.isString)(t)&&(t=r.findById(t));var n=t.getChildren();n.nodes.forEach(function(a){r.hideItem(a,e)}),n.combos.forEach(function(a){r.hideItem(a,e)})},c.prototype.updateComboSucceeds=function(t,e,r,n){var a=this;n===void 0&&(n=[]);var i=this.graph;if(!(!e&&!r)){var o=n;if(!(o==null?void 0:o.length)){var s=i.get("comboTrees");s==null||s.forEach(function(l){Ei(l,function(h){return h.id===t?(o=h.children,!1):!0})})}o==null||o.forEach(function(l){var h=i.findById(l.id);if(h){var p=h.getModel();a.updateItem(l.id,{x:(p.x||0)+e,y:(p.y||0)+r})}})}},c.prototype.expandCombo=function(t,e){e===void 0&&(e=!0);var r=this.graph;(0,m.isString)(t)&&(t=r.findById(t));var n=t.getChildren(),a=new Set;n.nodes.forEach(function(i){r.showItem(i,e),i.getEdges().forEach(function(o){return a.add(o)})}),n.combos.forEach(function(i){i.getModel().collapsed?i.show():r.showItem(i,e),i.getEdges().forEach(function(o){return a.add(o)})}),a.forEach(function(i){return i.refresh()})},c.prototype.removeItem=function(t){var e=this,r=this.graph;if((0,m.isString)(t)&&(t=r.findById(t)),!(!t||t.destroyed)){var n=(0,m.clone)(t.getModel()),a="";t.getType&&(a=t.getType()),r.emit("beforeremoveitem",{item:n,type:a});var i=r.get("".concat(a,"s")),o=i.indexOf(t);if(o>-1&&i.splice(o,1),a===Ju){var s=r.get("v".concat(a,"s")),l=s.indexOf(t);l>-1&&s.splice(l,1)}var h=t.get("id"),p=r.get("itemMap");delete p[h];var D=r.get("comboTrees"),I=t.get("id");if(a===Qu){var F=t.getModel().comboId;if(D&&F){var Z=D,ee=!1;D.forEach(function(Oe){ee||Ei(Oe,function(Pe){if(Pe.id===I&&Z){var He=Z.indexOf(Pe);return Z.splice(He,1),ee=!0,!1}return Z=Pe.children,!0})})}for(var se=t.getEdges(),oe=se.length-1;oe>=0;oe--)r.removeItem(se[oe],!1);F&&r.updateCombo(F)}else if(a===yu){var ce=t.getModel().parentId,we,Re=!1;(D||[]).forEach(function(Pe){Re||Ei(Pe,function(He){return He.id===I?(we=He,Re=!0,!1):!0})}),we.removed=!0,we&&we.children&&we.children.forEach(function(Pe){e.removeItem(Pe.id)});for(var se=t.getEdges(),oe=se.length;oe>=0;oe--)r.removeItem(se[oe],!1);ce&&r.updateCombo(ce)}t.destroy(),r.emit("afterremoveitem",{item:n,type:a})}},c.prototype.setItemState=function(t,e,r){var n=this.graph,a=e;(0,m.isString)(r)&&(a="".concat(e,":").concat(r)),!(t.hasState(a)===r&&r||(0,m.isString)(r)&&t.hasState(a))&&(n.emit("beforeitemstatechange",{item:t,state:a,enabled:r}),t.setState(e,r),n.autoPaint(),n.emit("afteritemstatechange",{item:t,state:a,enabled:r}))},c.prototype.priorityState=function(t,e){var r=this.graph,n=t;(0,m.isString)(t)&&(n=r.findById(t)),this.setItemState(n,e,!1),this.setItemState(n,e,!0)},c.prototype.clearItemStates=function(t,e){var r=this.graph;(0,m.isString)(t)&&(t=r.findById(t)),r.emit("beforeitemstatesclear",{item:t,states:e}),t.clearStates(e),r.emit("afteritemstatesclear",{item:t,states:e})},c.prototype.refreshItem=function(t){var e=this.graph;(0,m.isString)(t)&&(t=e.findById(t)),e.emit("beforeitemrefresh",{item:t}),t.refresh(),e.emit("afteritemrefresh",{item:t})},c.prototype.addCombos=function(t,e){var r=this,n=this.graph;(t||[]).forEach(function(i){Ki(i,function(o){var s;return e.forEach(function(l){l.id===o.id&&(l.children=o.children,l.depth=o.depth,s=l)}),s&&r.addItem("combo",s),!0})});var a=n.get("comboGroup");a&&a.sort()},c.prototype.changeItemVisibility=function(t,e){var r=this,n=this.graph;if((0,m.isString)(t)&&(t=n.findById(t)),!t){console.warn("The item to be shown or hidden does not exist!");return}if(n.emit("beforeitemvisibilitychange",{item:t,visible:e}),t.changeVisibility(e),t.getType&&t.getType()===Qu){var a=t.getEdges();(0,m.each)(a,function(h){e&&!(h.get("source").isVisible()&&h.get("target").isVisible())||r.changeItemVisibility(h,e)})}else if(t.getType&&t.getType()===yu){var i=n.get("comboTrees"),o=t.get("id"),s=[],l=!1;(i||[]).forEach(function(p){l||!p.children||p.children.length===0||Ei(p,function(D){return D.id===o?(s=D.children,l=!0,!1):!0})}),s&&(!e||e&&!t.getModel().collapsed)&&s.forEach(function(p){var D=n.findById(p.id);r.changeItemVisibility(D,e)});var a=t.getEdges();(0,m.each)(a,function(p){e&&!(p.get("source").isVisible()&&p.get("target").isVisible())||r.changeItemVisibility(p,e)})}return n.emit("afteritemvisibilitychange",{item:t,visible:e}),t},c.prototype.destroy=function(){this.graph=null,this.destroyed=!0},c}(),lc=Af,el=function(){function c(t){this.graph=t,this.destroyed=!1}return c.prototype.updateState=function(t,e,r){var n=this.graph.get("states"),a=e;(0,m.isString)(r)&&(a="".concat(e,":").concat(r)),n[a]||(n[a]=[]),r?n[a].push(t):n[a]=n[a].filter(function(i){return i!==t}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:n})},c.prototype.updateStates=function(t,e,r){var n=this.graph.get("states"),a=(0,m.isString)(e)?[e]:e;a.forEach(function(i){var o=i;n[o]||(n[o]=[]),(0,m.isString)(r)&&(o="".concat(i,":").concat(r)),r?n[o].push(t):n[o]=n[o].filter(function(s){return s!==t})}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:e})},c.prototype.destroy=function(){this.graph=null,this.destroyed=!0},c}(),Is=el,mu=z(80389),Qr=function(t,e){return!t||!e?t:t.replace(/\\?\{([^{}]+)\}/g,function(r,n){if(r.charAt(0)==="\\")return r.slice(1);var a=e[n];return a===0&&(a="0"),a||""})},Os=function(t){var e=[];if(t.length<2)throw new Error("point length must largn than 2, now it's ".concat(t.length));for(var r=0,n=t;r<n.length;r++){var a=n[r],i=a.x,o=a.y;e.push(i),e.push(o)}var s=(0,mu.e9)(e);return s.unshift(["M",t[0].x,t[0].y]),s},ca=function(t,e,r,n){r===void 0&&(r=0),n===void 0&&(n=0);var a={x:(1-r)*t.x+r*e.x,y:(1-r)*t.y+r*e.y},i=[0,0];ya.normalize(i,[e.x-t.x,e.y-t.y]),(!i||!i[0]&&!i[1])&&(i=[0,0]);var o=[-i[1]*n,i[0]*n];return a.x+=o[0],a.y+=o[1],a},Lf=function(t,e){var r=t.length;if(!r)return"";for(var n="",a="",i=0;i<r;i++){var o=t[i];i===0?a="M{x} {y}":a="L{x} {y}",n+=Qr(a,o)}return e&&(n+="Z"),n},Eu=function(t){var e=[];return t.forEach(function(r){var n=r[0];if(n!=="A")for(var a=1;a<r.length;a=a+2)e.push([r[a],r[a+1]]);else{var i=r.length;e.push([r[i-2],r[i-1]])}}),e},ls=function(t){if(t.length<2)throw new Error("point length must largn than 2, now it's ".concat(t.length));var e=t[0],r=t[1],n=t[t.length-1],a=t[t.length-2];t.unshift(n),t.unshift(a),t.push(e),t.push(r);for(var i=[],o=1;o<t.length-2;o+=1){var s=t[o-1].x,l=t[o-1].y,h=t[o].x,p=t[o].y,D=t[o+1].x,I=t[o+1].y,F=o!==t.length-2?t[o+2].x:D,Z=o!==t.length-2?t[o+2].y:I,ee=h+(D-s)/6,se=p+(I-l)/6,oe=D-(F-h)/6,ce=I-(Z-p)/6;i.push(["C",ee,se,oe,ce,D,I])}return i.unshift(["M",n.x,n.y]),i},Df=function(t,e){return ya.scale([0,0],ya.normalize([0,0],t),e)},bu=function(t,e){var r=[t[1]-e[1],e[0]-t[0]],n=Math.sqrt(r[0]*r[0]+r[1]*r[1]);if(n===0)throw new Error("p0 should not be equal to p1");return[r[0]/n,r[1]/n]},qu=function(t,e){return[e[0]-t[0],e[1]-t[1]]};function ef(c,t){var e=function(p){var D=[p[0][0],p[0][1]-t],I=[p[0][0],p[0][1]+t];return"M ".concat(D," A ").concat(t,",").concat(t,",0,0,0,").concat(I," A ").concat(t,",").concat(t,",0,0,0,").concat(D)},r=function(p){var D=ya.scale([0,0],bu(p[0],p[1]),t),I=ya.scale([0,0],D,-1),F=ya.add([0,0],p[0],D),Z=ya.add([0,0],p[1],D),ee=ya.add([0,0],p[1],I),se=ya.add([0,0],p[0],I);return"M ".concat(F," L ").concat(Z," A ").concat([t,t,"0,0,0",ee].join(",")," L ").concat(se," A ").concat([t,t,"0,0,0",F].join(","))};if(!c||c.length<1)return"";if(c.length===1)return e(c);if(c.length===2)return r(c);for(var n=new Array(c.length),a=0;a<n.length;++a){var i=a===0?c[c.length-1]:c[a-1],o=c[a],s=ya.scale([0,0],bu(i,o),t);n[a]=[ya.add([0,0],i,s),ya.add([0,0],o,s)]}var l="A ".concat([t,t,"0,0,0,"].join(","));return n=n.map(function(h,p){var D="";return p===0&&(D="M ".concat(n[n.length-1][1]," ")),D+="".concat(l+h[0]," L ").concat(h[1]),D}),n.join(" ")}function Nf(c,t){var e=c.length,r=function(h){var p=[h[0][0],h[0][1]-t],D=[h[0][0],h[0][1]+t];return"M ".concat(p," A ").concat([t,t,"0,0,0",D].join(",")," A ").concat([t,t,"0,0,0",p].join(","))},n=function(h){var p=qu(h[0],h[1]),D=Df(p,t),I=ya.add([0,0],h[0],ya.scale([0,0],D,-1)),F=ya.add([0,0],h[1],D),Z=1.2*t,ee=Df(ya.normalize([0,0],p),Z),se=ya.scale([0,0],ee,-1),oe=ya.add([0,0],I,se),ce=ya.add([0,0],F,se),we=ya.add([0,0],I,ee);return"M ".concat(I," C ").concat([oe,ce,F].join(",")," S ").concat([we,I].join(",")," Z")};if(!c||e<1)return"";if(e===1)return r(c);if(e===2)return n(c);for(var a=c.map(function(l,h){var p=c[(h+1)%e];return{p:l,v:ya.normalize([0,0],qu(l,p))}}),i=0;i<a.length;++i){var o=i>0?i-1:e-1,s=ya.normalize([0,0],ya.add([0,0],a[o].v,ya.scale([0,0],a[i].v,-1)));a[i].p=ya.add([0,0],a[i].p,ya.scale([0,0],s,t))}return a.map(function(l){var h=l.p;return{x:h[0],y:h[1]}})}var Lo=function(t,e){for(var r=[],n=0;n<5;n++){var a=Math.cos((18+72*n)/180*Math.PI)*t,i=Math.sin((18+72*n)/180*Math.PI)*t,o=Math.cos((54+72*n)/180*Math.PI)*e,s=Math.sin((54+72*n)/180*Math.PI)*e;n===0?r.push(["M",a,-i]):r.push(["L",a,-i]),r.push(["L",o,-s])}return r.push(["Z"]),r},Pf=function(t,e,r){return(t.y-r.y)*(e.x-r.x)-(t.x-r.x)*(e.y-r.y)},kf=function(t){var e=t.map(function(p){return{x:p.getModel().x,y:p.getModel().y}});e.sort(function(p,D){return p.x===D.x?p.y-D.y:p.x-D.x});for(var r={},n=e.length-1;n>=0;n--){var a=e[n],i=a.x,o=a.y;r["".concat(i,"-").concat(o)]&&e.splice(n,1),r["".concat(i,"-").concat(o)]=!0}if(e.length===1)return e;for(var s=[],n=0;n<e.length;n++){for(;s.length>=2&&Pf(s[s.length-2],s[s.length-1],e[n])<=0;)s.pop();s.push(e[n])}for(var l=[],n=e.length-1;n>=0;n--){for(;l.length>=2&&Pf(l[l.length-2],l[l.length-1],e[n])<=0;)l.pop();l.push(e[n])}l.pop(),s.pop();var h=s.concat(l);return h},xi={maxRoutingIterations:100,maxMarchingIterations:100,pixelGroupSize:2,edgeR0:10,edgeR1:10,nodeR0:5,nodeR1:10,morphBuffer:5,threshold:.001,skip:16,nodeInfluenceFactor:1,edgeInfluenceFactor:1,negativeNodeInfluenceFactor:-.5};function tf(c,t,e){var r=!1,n=function(s,l){return t.cells[s+l*t.width]},a=function(s,l){var h=0;return n(s-1,l-1)>=e&&(h+=1),n(s,l-1)>e&&(h+=2),n(s-1,l)>e&&(h+=4),n(s,l)>e&&(h+=8),h},i=function(s,l){for(var h=s,p=l,D,I,F=0;F<t.width*t.height;F++){if(D=h,I=p,c.findIndex(function(ee){return ee.x===h&&ee.y===p})>-1){if(!(c[0].x!==h||c[0].y!==p))return!0}else c.push({x:h,y:p});var Z=a(h,p);switch(Z){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:h++;break;case 12:case 14:case 4:h--;break;case 6:D===0&&(I===-1?h-=1:h+=1);break;case 1:case 13:case 5:p--;break;case 9:D===1&&(I===0?p-=1:p+=1);break;case 10:case 8:case 11:p++;break;default:return console.warn("Marching squares invalid state: ".concat(Z)),!0}}};this.march=function(){for(var o=0;o<t.width&&!r;o+=1)for(var s=0;s<t.height&&!r;s+=1)n(o,s)>e&&a(o,s)!==15&&(r=i(o,s));return r}}var As=function(t,e,r){var n=Math.ceil(t/r),a=Math.ceil(e/r),i=new Float32Array(Math.max(0,n*a)).fill(0);return{cells:i,width:n,height:a}},rf=function(t,e,r){var n=null,a=Number.POSITIVE_INFINITY;return e.forEach(function(i){var o={x:t.getModel().x,y:t.getModel().y},s={x:i.getModel().x,y:i.getModel().y},l=vi(o,s),h=new ga(o.x,o.y,s.x,s.y),p=r.reduce(function(D,I){return Ao(I,h)>0?D+1:D},0);l*Math.pow(p+1,2)<a&&(n=i,a=l*Math.pow(p+1,2))}),n},nf=function(t,e){var r=Number.POSITIVE_INFINITY,n=null;return t.forEach(function(a){var i=Ao(a,e);i>=0&&i<r&&(n=a,r=i)}),n},dc=function(t,e,r,n){var a=[],i=[];i.push(t);for(var o=!0,s=0,l=function(I,F){var Z=!1;return F.forEach(function(ee){Z||(_i(I,{x:ee.x1,y:ee.y1})||_i(I,{x:ee.x2,y:ee.y2}))&&(Z=!0)}),Z},h=function(I,F){for(var Z=0,ee=F;Z<ee.length;Z++){var se=ee[Z],oe=se.getBBox(),ce=[[oe.x,oe.y],[oe.x+oe.width,oe.y],[oe.x,oe.y+oe.height],[oe.x+oe.width,oe.y+oe.height]];if(ro(ce,I.x,I.y))return!0}return!1};o&&s<r;){o=!1;for(var p=function(){var I=i.pop(),F=nf(e,I);if(F){var Z=Pi(F,I),ee=Z[0],se=Z[1];if(se===2){var oe=function(we){for(var Re=n,Oe=xu(F,Re,ee,we),Pe=l(Oe,i)||l(Oe,a),He=h(Oe,e);!Pe&&He&&Re>=1;)Re/=1.5,Oe=xu(F,Re,ee,we),Pe=l(Oe,i)||l(Oe,a),He=h(Oe,e);Oe&&!Pe&&(!we||!He)&&(i.push(new ga(I.x1,I.y1,Oe.x,Oe.y)),i.push(new ga(Oe.x,Oe.y,I.x2,I.y2)),o=!0)};oe(!0),o||oe(!1)}}o||a.push(I),s+=1};!o&&i.length;)p()}for(;i.length;)a.push(i.pop());return a};function hc(c,t,e,r,n){var a=rf(c,e,t);if(a===null)return[];var i=function(p){for(var D=[];p.length>0;){var I=p.pop();if(p.length===0){D.push(I);break}var F=p.pop(),Z=new ga(I.x1,I.y1,F.x2,F.y2),ee=nf(t,Z);ee?(D.push(I),p.push(F)):p.push(Z)}return D},o=new ga(c.getModel().x,c.getModel().y,a.getModel().x,a.getModel().y),s=dc(o,t,r,n),l=i(s);return l}var vc=function(t,e,r){var n=Object.assign(xi,r),a=as(t.map(function(oe){return{x:oe.getModel().x,y:oe.getModel().y}}));t=t.sort(function(oe,ce){return vi({x:oe.getModel().x,y:oe.getModel().y},a)-vi({x:ce.getModel().x,y:ce.getModel().y},a)});var i=[],o=[];t.forEach(function(oe){var ce=hc(oe,e,i,n.maxRoutingIterations,n.morphBuffer);ce.forEach(function(we){o.push(we)}),i.push(oe)});for(var s=af(t,o,n.nodeR0),l=As(s.width,s.height,n.pixelGroupSize),h=[],p=[],D=0;D<n.maxMarchingIterations;D++)if(gc(t,e,o,s,l,n),h=[],p=[],!!new tf(h,l,n.threshold).march()){var I=h.map(function(oe){return{x:Math.round(oe.x*n.pixelGroupSize+s.minX),y:Math.round(oe.y*n.pixelGroupSize+s.minY)}});if(I){var F=I.length;if(n.skip>1)for(F=Math.floor(I.length/n.skip);F<3&&n.skip>1;)n.skip-=1,F=Math.floor(I.length/n.skip);for(var Z=0,ee=0;ee<F;ee+=1,Z+=n.skip)p.push({x:I[Z].x,y:I[Z].y})}var se=function(){for(var ce=0,we=t;ce<we.length;ce++){var Re=we[ce],Oe=p.map(function(Pe){return[Pe.x,Pe.y]});if(!ro(Oe,Re.getBBox().centerX,Re.getBBox().centerY))return!1}return!0};if(p&&se())return p;if(n.threshold*=.9,D<=n.maxMarchingIterations*.5)n.memberInfluenceFactor*=1.2,n.edgeInfluenceFactor*=1.2;else if(n.nonMemberInfluenceFactor!==0&&e.length>0)n.nonMemberInfluenceFactor*=.8;else break}return p};function af(c,t,e){var r={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY,width:0,height:0,x:0,y:0},n=[];c.forEach(function(s){n.push(s.getBBox())}),t.forEach(function(s){n.push(s.getBBox())});for(var a=0,i=n;a<i.length;a++){var o=i[a];r.minX=(o.minX<r.minX?o.minX:r.minX)-e,r.minY=(o.minY<r.minY?o.minY:r.minY)-e,r.maxX=(o.maxX>r.maxX?o.maxX:r.maxX)+e,r.maxY=(o.maxY>r.maxY?o.maxY:r.maxY)+e}return r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.x=r.minX,r.y=r.minY,r}function gc(c,t,e,r,n,a){function i(I,F){var Z=Math.floor((I-F)/a.pixelGroupSize);return Z<0?0:Z}function o(I,F){return I*a.pixelGroupSize+F}var s=(a.nodeR0-a.nodeR1)*(a.nodeR0-a.nodeR1),l=(a.edgeR0-a.edgeR1)*(a.edgeR0-a.edgeR1),h=function(F,Z){var ee=Math.min(i(F.minX,Z+r.minX),n.width),se=Math.min(i(F.minY,Z+r.minY),n.height),oe=Math.min(i(F.maxX,-Z+r.minX),n.width),ce=Math.min(i(F.maxY,-Z+r.minY),n.height);return[ee,se,oe,ce]},p=function(F,Z){for(var ee=F.getBBox(),se=h(ee,a.nodeR1),oe=se[0],ce=se[1],we=se[2],Re=se[3],Oe=ce;Oe<Re;Oe+=1)for(var Pe=oe;Pe<we;Pe+=1)if(!(Z<0&&n[Pe+Oe*n.width]<=0)){var He=o(Pe,r.minX),at=o(Oe,r.minY),qe=no({x:He,y:at},{x:ee.minX,y:ee.minY,width:ee.width,height:ee.height});if(qe<Math.pow(a.nodeR1,2)){var yt=Math.sqrt(qe)-a.nodeR1;n.cells[Pe+Oe*n.width]+=Z*yt*yt}}},D=function(F,Z){for(var ee=F.getBBox(),se=h(ee,a.edgeR1),oe=se[0],ce=se[1],we=se[2],Re=se[3],Oe=ce;Oe<Re;Oe+=1)for(var Pe=oe;Pe<we;Pe+=1)if(!(Z<0&&n.cells[Pe+Oe*n.width]<=0)){var He=o(Pe,r.minX),at=o(Oe,r.minY),qe=Zi({x:He,y:at},F);if(qe<Math.pow(a.edgeR1,2)){var yt=Math.sqrt(qe)-a.edgeR1;n.cells[Pe+Oe*n.width]+=Z*yt*yt}}};a.nodeInfluenceFactor&&c.forEach(function(I){p(I,a.nodeInfluenceFactor/s)}),a.edgeInfluenceFactor&&e.forEach(function(I){D(I,a.edgeInfluenceFactor/l)}),a.negativeNodeInfluenceFactor&&t.forEach(function(I){p(I,a.negativeNodeInfluenceFactor/s)})}function xu(c,t,e,r){var n=c.getBBox(),a=e[0],i=e[1],o=e[2],s=e[3],l={topLeft:{x:n.minX-t,y:n.minY-t},topRight:{x:n.maxX+t,y:n.minY-t},bottomLeft:{x:n.minX-t,y:n.maxY+t},bottomRight:{x:n.maxX+t,y:n.maxY+t}},h=n.height*n.width;function p(F,Z){return n.width*((F.y-n.minY+(Z.y-n.minY))*.5)}if(i){if(a)return r?l.topLeft:l.bottomRight;if(o)return r?l.bottomLeft:l.topRight;var D=p(i,s);return D<h*.5?i.y>s.y?r?l.topLeft:l.bottomRight:r?l.topRight:l.bottomLeft:i.y<s.y?r?l.bottomLeft:l.topRight:r?l.bottomRight:l.topLeft}if(s){if(a)return r?l.topRight:l.bottomLeft;if(o)return r?l.bottomRight:l.topLeft}var I=p(a,o);return I<h*.5?a.x>o.x?r?l.topLeft:l.bottomRight:r?l.bottomLeft:l.topRight:a.x<o.x?r?l.topRight:l.bottomLeft:r?l.bottomRight:l.topLeft}var pc=function(){function c(t,e){this.cfg=(0,m.deepMix)(this.getDefaultCfg(),e),this.graph=t,this.id=this.cfg.id,this.group=this.cfg.group,this.members=this.cfg.members.map(function(r){return(0,m.isString)(r)?t.findById(r):r}),this.nonMembers=this.cfg.nonMembers.map(function(r){return(0,m.isString)(r)?t.findById(r):r}),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()}return c.prototype.getDefaultCfg=function(){return{id:"g6-hull",type:"round-convex",members:[],nonMembers:[],style:{fill:"lightblue",stroke:"blue",opacity:.2},padding:10}},c.prototype.setPadding=function(){var t=this.members.length&&this.members[0].getKeyShape().getCanvasBBox().width/2;this.padding=this.cfg.padding>0?this.cfg.padding+t:10+t,this.cfg.bubbleCfg={nodeR0:this.padding-t,nodeR1:this.padding-t,morphBuffer:this.padding-t}},c.prototype.setType=function(){this.type=this.cfg.type,this.members.length<3&&(this.type="round-convex"),this.type!=="round-convex"&&this.type!=="smooth-convex"&&this.type!=="bubble"&&(console.warn("The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default."),this.type="round-convex")},c.prototype.calcPath=function(t,e){var r,n,a;switch(this.type){case"round-convex":r=kf(t),a=ef(r.map(function(i){return[i.x,i.y]}),this.padding),n=(0,mu.tr)(a);break;case"smooth-convex":r=kf(t),r.length===2?(a=ef(r.map(function(i){return[i.x,i.y]}),this.padding),n=(0,mu.tr)(a)):r.length>2&&(a=Nf(r.map(function(i){return[i.x,i.y]}),this.padding),n=ls(a));break;case"bubble":r=vc(t,e,this.cfg.bubbleCfg),n=r.length>=2&&ls(r);break;default:}return n},c.prototype.render=function(){this.group.addShape("path",{attrs:(0,b.__assign)({path:this.path},this.cfg.style),id:this.id,name:this.cfg.id,capture:!1}),this.group.toBack()},c.prototype.addMember=function(t){if(!!t){(0,m.isString)(t)&&(t=this.graph.findById(t)),this.members.push(t);var e=this.nonMembers.indexOf(t);return e>-1&&this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},c.prototype.addNonMember=function(t){if(!!t){(0,m.isString)(t)&&(t=this.graph.findById(t)),this.nonMembers.push(t);var e=this.members.indexOf(t);return e>-1&&this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0}},c.prototype.removeMember=function(t){if(!!t){(0,m.isString)(t)&&(t=this.graph.findById(t));var e=this.members.indexOf(t);return e>-1?(this.members.splice(e,1),this.updateData(this.members,this.nonMembers),!0):!1}},c.prototype.removeNonMember=function(t){if(!!t){(0,m.isString)(t)&&(t=this.graph.findById(t));var e=this.nonMembers.indexOf(t);return e>-1?(this.nonMembers.splice(e,1),this.updateData(this.members,this.nonMembers),!0):!1}},c.prototype.updateData=function(t,e){var r=this;this.group.findById(this.id).remove(),t&&(this.members=t.map(function(n){return(0,m.isString)(n)?r.graph.findById(n):n})),e&&(this.nonMembers=e.map(function(n){return(0,m.isString)(n)?r.graph.findById(n):n})),this.path=this.calcPath(this.members,this.nonMembers),this.render()},c.prototype.updateStyle=function(t){var e=this.group.findById(this.id);e.attr((0,b.__assign)({},t))},c.prototype.updateCfg=function(t){var e=this;this.cfg=(0,m.deepMix)(this.cfg,t),this.id=this.cfg.id,this.group=this.cfg.group,t.members&&(this.members=this.cfg.members.map(function(r){return(0,m.isString)(r)?e.graph.findById(r):r})),t.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map(function(r){return(0,m.isString)(r)?e.graph.findById(r):r})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},c.prototype.contain=function(t){var e=this,r;(0,m.isString)(t)?r=this.graph.findById(t):r=t;var n,a=r.getKeyShape();if(r.get("type")==="path")n=Eu(a.attr("path"));else{var i=a.getCanvasBBox();n=[[i.minX,i.minY],[i.maxX,i.minY],[i.maxX,i.maxY],[i.minX,i.maxY]]}return n=n.map(function(o){var s=e.graph.getPointByCanvas(o[0],o[1]);return[s.x,s.y]}),zi(n,Eu(this.path))},c.prototype.destroy=function(){this.group.remove(),this.cfg=null},c}(),Rf=pc,ds=q.vs,tl="node",Do=function(c){(0,b.__extends)(t,c);function t(e){var r=c.call(this)||this;return r.sortCombos=(0,m.debounce)(function(){var n=r.get("comboSorted");if(!(!r||r.destroyed||n)){r.set("comboSorted",!0);var a=[],i={},o=r.get("comboTrees");(o||[]).forEach(function(l){Ei(l,function(h){return a[h.depth]?a[h.depth].push(h.id):a[h.depth]=[h.id],i[h.id]=h.depth,!0})});var s=r.getEdges().concat(r.get("vedges"));(s||[]).forEach(function(l){var h=l.getModel(),p=i[h.source]||0,D=i[h.target]||0,I=Math.max(p,D);a[I]?a[I].push(h.id):a[I]=[h.id]}),a.forEach(function(l){if(!(!l||!l.length))for(var h=l.length-1;h>=0;h--){var p=r.findById(l[h]);p&&p.toFront()}})}},500,!1),r.cfg=(0,m.deepMix)(r.getDefaultCfg(),e),r.init(),r.animating=!1,r.destroyed=!1,r.cfg.enabledStack&&(r.undoStack=new ni(r.cfg.maxStep),r.redoStack=new ni(r.cfg.maxStep)),r}return t.prototype.init=function(){this.initCanvas();var e=new u(this),r=new gu(this),n=new lc(this),a=new Is(this);this.set({viewController:e,modeController:r,itemController:n,stateController:a}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},t.prototype.initGroups=function(){var e=this.get("canvas");if(!!e){var r=e.get("el"),n=(r||{}).id,a=n===void 0?"g6":n,i=e.addGroup({id:"".concat(a,"-root"),className:an.rootContainerClassName});if(this.get("groupByTypes")){var o=i.addGroup({id:"".concat(a,"-edge"),className:an.edgeContainerClassName}),s=i.addGroup({id:"".concat(a,"-node"),className:an.nodeContainerClassName}),l=i.addGroup({id:"".concat(a,"-combo"),className:an.comboContainerClassName});l.toBack(),this.set({nodeGroup:s,edgeGroup:o,comboGroup:l})}var h=i.addGroup({id:"".concat(a,"-delegate"),className:an.delegateContainerClassName});this.set({delegateGroup:h}),this.set("group",i)}},t.prototype.getDefaultCfg=function(){return{container:void 0,width:void 0,height:void 0,renderer:"canvas",modes:{},plugins:[],data:{},fitViewPadding:10,minZoom:.02,maxZoom:10,event:!0,groupByTypes:!0,directed:!1,autoPaint:!0,nodes:[],edges:[],combos:[],vedges:[],itemMap:{},linkCenter:!1,defaultNode:{},defaultEdge:{},nodeStateStyles:{},edgeStateStyles:{},states:{},animate:!1,animateCfg:{onFrame:void 0,duration:500,easing:"easeLinear"},callback:void 0,enabledStack:!1,maxStep:10,tooltips:[],optimizeThreshold:1e3}},t.prototype.set=function(e,r){return(0,m.isPlainObject)(e)?this.cfg=(0,b.__assign)((0,b.__assign)({},this.cfg),e):this.cfg[e]=r,e==="enabledStack"&&r&&!this.undoStack&&!this.redoStack&&(this.undoStack=new ni(this.cfg.maxStep),this.redoStack=new ni(this.cfg.maxStep)),this},t.prototype.get=function(e){var r;return(r=this.cfg)===null||r===void 0?void 0:r[e]},t.prototype.getGroup=function(){return this.get("group")},t.prototype.getContainer=function(){return this.get("container")},t.prototype.getMinZoom=function(){return this.get("minZoom")},t.prototype.setMinZoom=function(e){return this.set("minZoom",e)},t.prototype.getMaxZoom=function(){return this.get("maxZoom")},t.prototype.setMaxZoom=function(e){return this.set("maxZoom",e)},t.prototype.getWidth=function(){return this.get("width")},t.prototype.getHeight=function(){return this.get("height")},t.prototype.clearItemStates=function(e,r){(0,m.isString)(e)&&(e=this.findById(e));var n=this.get("itemController");r||(r=e.get("states")),n.clearItemStates(e,r);var a=this.get("stateController");a.updateStates(e,r,!1)},t.prototype.node=function(e){typeof e=="function"&&this.set("nodeMapper",e)},t.prototype.edge=function(e){typeof e=="function"&&this.set("edgeMapper",e)},t.prototype.combo=function(e){typeof e=="function"&&this.set("comboMapper",e)},t.prototype.findById=function(e){return this.get("itemMap")[e]},t.prototype.find=function(e,r){var n,a=this.get("".concat(e,"s"));return(0,m.each)(a,function(i,o){if(r(i,o))return n=i,n}),n},t.prototype.findAll=function(e,r){var n=[];return(0,m.each)(this.get("".concat(e,"s")),function(a,i){r(a,i)&&n.push(a)}),n},t.prototype.findAllByState=function(e,r,n){return n?this.findAll(e,function(a){return a.hasState(r)&&n(a)}):this.findAll(e,function(a){return a.hasState(r)})},t.prototype.translate=function(e,r,n,a){var i=this,o=this.get("group"),s=(0,m.clone)(o.getMatrix());if(s||(s=[1,0,0,0,1,0,0,0,1]),n){var l=bo({animateCfg:a,callback:function(){return i.emit("viewportchange",{action:"translate",matrix:o.getMatrix()})}});ho(o,{x:o.getCanvasBBox().x+e,y:o.getCanvasBBox().y+r},n,l||{duration:500,easing:"easeCubic"})}else s=ds(s,[["t",e,r]]),o.setMatrix(s),this.emit("viewportchange",{action:"translate",matrix:s}),this.autoPaint()},t.prototype.moveTo=function(e,r,n,a){var i=this.get("group");ho(i,{x:e,y:r},n,a||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:i.getMatrix()})},t.prototype.fitView=function(e,r,n,a){e&&this.set("fitViewPadding",e);var i=this.get("viewController");r?i.fitViewByRules(r,n,a):i.fitView(n,a),this.autoPaint()},t.prototype.fitCenter=function(e,r){var n=this.get("viewController");n.fitCenter(e,r),this.autoPaint()},t.prototype.addBehaviors=function(e,r){var n=this.get("modeController");return n.manipulateBehaviors(e,r,!0),this},t.prototype.removeBehaviors=function(e,r){var n=this.get("modeController");return n.manipulateBehaviors(e,r,!1),this},t.prototype.updateBehavior=function(e,r,n){var a=this.get("modeController");return a.updateBehavior(e,r,n),this},t.prototype.zoom=function(e,r,n,a){var i=this,o=this.get("group"),s=(0,m.clone)(o.getMatrix())||[1,0,0,0,1,0,0,0,1],l=this.get("minZoom"),h=this.get("maxZoom"),p=this.getZoom()||1,D=p*e,I=e,F=!1;if(l&&D<l?(I=l/p,F=!0):h&&D>h&&(I=h/p,F=!0),r?s=ds(s,[["t",-r.x,-r.y],["s",I,I],["t",r.x,r.y]]):s=ds(s,[["s",I,I]]),n){var Z=(0,m.clone)(o.getMatrix());Z||(Z=[1,0,0,0,1,0,0,0,1]);var ee=Z[0],se=ee*I,oe=bo({animateCfg:a,callback:function(){return i.emit("viewportchange",{action:"zoom",matrix:o.getMatrix()})}});o.animate(function(ce){if(ce===1)Z=s;else{var we=da(ee,se,ce)/Z[0];r?Z=ds(Z,[["t",-r.x,-r.y],["s",we,we],["t",r.x,r.y]]):Z=ds(Z,[["s",we,we]])}return{matrix:Z}},oe)}else o.setMatrix(s),this.emit("viewportchange",{action:"zoom",matrix:s}),this.autoPaint();return!F},t.prototype.zoomTo=function(e,r,n,a){var i=e/this.getZoom();return this.zoom(i,r,n,a)},t.prototype.focusItem=function(e,r,n){var a=this.get("viewController"),i=!1;r?i=!0:r===void 0&&(i=this.get("animate"));var o={};n?o=n:n===void 0&&(o=this.get("animateCfg")),a.focus(e,i,o),this.autoPaint()},t.prototype.focusItems=function(e,r,n,a){var i=this.get("viewController");i.focusItems(e,r,n,a)},t.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},t.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},t.prototype.getPointByClient=function(e,r){var n=this.get("viewController");return n.getPointByClient(e,r)},t.prototype.getClientByPoint=function(e,r){var n=this.get("viewController");return n.getClientByPoint(e,r)},t.prototype.getPointByCanvas=function(e,r){var n=this.get("viewController");return n.getPointByCanvas(e,r)},t.prototype.getCanvasByPoint=function(e,r){var n=this.get("viewController");return n.getCanvasByPoint(e,r)},t.prototype.getGraphCenterPoint=function(){var e=this.get("group").getCanvasBBox();return{x:(e.minX+e.maxX)/2,y:(e.minY+e.maxY)/2}},t.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},t.prototype.showItem=function(e,r){r===void 0&&(r=!0);var n=this.get("itemController"),a=n.changeItemVisibility(e,!0);if(r&&this.get("enabledStack")){var i=a.getID(),o=a.getType(),s={},l={};switch(o){case"node":s.nodes=[{id:i,visible:!1}],l.nodes=[{id:i,visible:!0}];break;case"edge":s.nodes=[{id:i,visible:!1}],l.edges=[{id:i,visible:!0}];break;case"combo":s.nodes=[{id:i,visible:!1}],l.combos=[{id:i,visible:!0}];break;default:break}this.pushStack("visible",{before:s,after:l})}},t.prototype.hideItem=function(e,r){r===void 0&&(r=!0);var n=this.get("itemController"),a=n.changeItemVisibility(e,!1);if(r&&this.get("enabledStack")){var i=a.getID(),o=a.getType(),s={},l={};switch(o){case"node":s.nodes=[{id:i,visible:!0}],l.nodes=[{id:i,visible:!1}];break;case"edge":s.nodes=[{id:i,visible:!0}],l.edges=[{id:i,visible:!1}];break;case"combo":s.nodes=[{id:i,visible:!0}],l.combos=[{id:i,visible:!1}];break;default:break}this.pushStack("visible",{before:s,after:l})}},t.prototype.refreshItem=function(e){var r=this.get("itemController");r.refreshItem(e)},t.prototype.setAutoPaint=function(e){var r=this;r.set("autoPaint",e);var n=r.get("canvas");n.set("autoDraw",e)},t.prototype.remove=function(e,r){r===void 0&&(r=!0),this.removeItem(e,r)},t.prototype.removeItem=function(e,r){r===void 0&&(r=!0);var n=e;if((0,m.isString)(e)&&(n=this.findById(e)),!n&&(0,m.isString)(e))console.warn("The item ".concat(e," to be removed does not exist!"));else if(n){var a="";if(n.getType&&(a=n.getType()),r&&this.get("enabledStack")){var i=(0,b.__assign)((0,b.__assign)({},n.getModel()),{itemType:a}),o={};switch(a){case"node":{o.nodes=[i],o.edges=[];for(var s=n.getEdges(),l=s.length-1;l>=0;l--)o.edges.push((0,b.__assign)((0,b.__assign)({},s[l].getModel()),{itemType:"edge"}));break}case"edge":o.edges=[i];break;case"combo":o.combos=[i];break;default:break}this.pushStack("delete",{before:o,after:{}})}if(a==="node"){var h=n.getModel();h.comboId&&this.updateComboTree(n,void 0,!1)}var p=this.get("itemController");if(p.removeItem(n),a==="combo"){var D=ss(this.get("comboTrees"));this.set("comboTrees",D)}}},t.prototype.innerAddItem=function(e,r,n){if(!Zu(e,r))return!1;if(r.id&&this.findById(r.id)){console.warn("This item exists already. Be sure the id %c".concat(r.id,"%c is unique."),"font-size: 20px; color: red;","");return}var a,i=this.get("comboTrees")||[];if(e==="combo"){var o=this.get("itemMap"),s=!1;if(i.forEach(function(F){s||Ki(F,function(Z){if(r.parentId===Z.id){s=!0;var ee=(0,b.__assign)({id:r.id,depth:Z.depth+2},r);Z.children?Z.children.push(ee):Z.children=[ee],r.depth=ee.depth,a=n.addItem(e,r)}var se=o[Z.id];return s&&se&&se.getType&&se.getType()==="combo"&&n.updateCombo(se,Z.children),!0})}),!s){var l=(0,b.__assign)({id:r.id,depth:0},r);r.depth=l.depth,i.push(l),a=n.addItem(e,r)}this.set("comboTrees",i),r.collapsed&&(this.collapseCombo(a,!1),this.updateCombo(a))}else if(e==="node"&&(0,m.isString)(r.comboId)&&i){var h=this.findById(r.comboId);h&&h.getType&&h.getType()!=="combo"&&console.warn("'".concat(r.comboId,"' is not a id of a combo in the graph, the node will be added without combo.")),a=n.addItem(e,r);var p=this.get("itemMap"),D=!1,I=!1;i.forEach(function(F){I||D||Ki(F,function(Z){if(Z.id===r.id)return I=!0,!1;if(r.comboId===Z.id&&!I){D=!0;var ee=(0,m.clone)(r);ee.itemType="node",Z.children?Z.children.push(ee):Z.children=[ee],ee.depth=Z.depth+1}return D&&p[Z.id].getType&&p[Z.id].getType()==="combo"&&n.updateCombo(p[Z.id],Z.children),!0})})}else a=n.addItem(e,r);if(e==="node"&&r.comboId||e==="combo"&&r.parentId){var h=this.findById(r.comboId||r.parentId);h&&h.getType&&h.getType()==="combo"&&h.addChild(a)}return a},t.prototype.addItem=function(e,r,n,a){n===void 0&&(n=!0),a===void 0&&(a=!0);var i=this.get("comboSorted");this.set("comboSorted",i&&!a);var o=this.get("itemController"),s=this.innerAddItem(e,r,o);if(s===!1||s===!0)return s;var l=this.get("combos");if(l&&l.length>0&&this.sortCombos(),this.autoPaint(),n&&this.get("enabledStack")){var h=(0,b.__assign)((0,b.__assign)({},s.getModel()),{itemType:e}),p={};switch(e){case"node":p.nodes=[h];break;case"edge":p.edges=[h];break;case"combo":p.combos=[h];break;default:break}this.pushStack("add",{before:{},after:p})}return s},t.prototype.addItems=function(e,r,n){e===void 0&&(e=[]),r===void 0&&(r=!0),n===void 0&&(n=!0);var a=this.get("comboSorted");this.set("comboSorted",a&&!n);for(var i=this.get("itemController"),o=[],s=0;s<e.length;s++){var l=e[s];l.type!=="edge"&&l.type!=="vedge"?o.push(this.innerAddItem(l.type,l.model,i)):o.push(void 0)}for(var s=0;s<e.length;s++){var l=e[s];(l.type==="edge"||l.type==="vedge")&&(o[s]=this.innerAddItem(l.type,l.model,i))}if(n){var h=this.get("combos");h&&h.length>0&&this.sortCombos()}if(this.autoPaint(),r&&this.get("enabledStack")){for(var p={nodes:[],edges:[],combos:[]},s=0;s<e.length;s++){var D=e[s].type,I=o[s];if(!!I&&I!==!0){var F=(0,b.__assign)((0,b.__assign)({},I.getModel()),{itemType:D});switch(D){case"node":p.nodes.push(F);break;case"edge":p.edges.push(F);break;case"combo":p.combos.push(F);break;default:break}}}this.pushStack("addItems",{before:{},after:p})}return o},t.prototype.add=function(e,r,n,a){return n===void 0&&(n=!0),a===void 0&&(a=!0),this.addItem(e,r,n,a)},t.prototype.updateItem=function(e,r,n){var a=this;n===void 0&&(n=!0);var i=this.get("itemController"),o;(0,m.isString)(e)?o=this.findById(e):o=e;var s=n&&this.get("enabledStack"),l;s&&(l=(0,m.clone)(o.getModel()));var h="";o.getType&&(h=o.getType());var p=(0,b.__spreadArray)([],o.getStates(),!0);if(h==="combo"&&(0,m.each)(p,function(Z){return a.setItemState(o,Z,!1)}),i.updateItem(o,r),h==="combo"&&(0,m.each)(p,function(Z){return a.setItemState(o,Z,!0)}),s){var D={nodes:[],edges:[],combos:[]},I={nodes:[],edges:[],combos:[]},F=(0,b.__assign)({id:l.id},r);switch(h){case"node":D.nodes.push(l),I.nodes.push(F);break;case"edge":D.edges.push(l),I.edges.push(F);break;case"combo":D.combos.push(l),I.combos.push(F);break;default:break}this.pushStack("update",{before:D,after:I})}},t.prototype.update=function(e,r,n){n===void 0&&(n=!0),this.updateItem(e,r,n)},t.prototype.setItemState=function(e,r,n){(0,m.isString)(e)&&(e=this.findById(e));var a=this.get("itemController");a.setItemState(e,r,n);var i=this.get("stateController");i.updateState(e,r,n)},t.prototype.priorityState=function(e,r){var n=this.get("itemController");n.priorityState(e,r)},t.prototype.data=function(e){fs(e),this.set("data",e)},t.prototype.render=function(){var e=this;this.set("comboSorted",!1);var r=this.get("data");if(this.get("enabledStack")&&this.clearStack(),!r)throw new Error("data must be defined first");var n=r.nodes,a=n===void 0?[]:n,i=r.edges,o=i===void 0?[]:i,s=r.combos,l=s===void 0?[]:s;if(this.clear(!0),this.emit("beforerender"),e.addItems(a.map(function(ee){return{type:"node",model:ee}}),!1,!1),(l==null?void 0:l.length)!==0){var h=os(l,a);this.set("comboTrees",h),e.addCombos(l)}e.addItems(o.map(function(ee){return{type:"edge",model:ee}}),!1,!1);var p=e.get("animate");(e.get("fitView")||e.get("fitCenter"))&&e.set("animate",!1);var D=e.get("layoutController");if(D){if(D.layout(I),this.destroyed)return}else I();function I(){(e.get("comboTrees")||[]).forEach(function(ee){Ki(ee,function(se){var oe=e.findById(se.id);return oe.getType()==="combo"&&se.collapsed&&(e.collapseCombo(se.id,!1),e.updateCombo(oe)),!0})}),e.get("fitView")?e.fitView():e.get("fitCenter")&&e.fitCenter(),e.autoPaint(),e.emit("afterrender"),(e.get("fitView")||e.get("fitCenter"))&&e.set("animate",p),setTimeout(function(){var ee;(ee=e.getCombos())===null||ee===void 0||ee.forEach(function(se){se.set("animate",!0)})},0)}if(!this.get("groupByTypes"))if(l&&l.length!==0)this.sortCombos();else if(r.nodes&&r.edges&&r.nodes.length<r.edges.length){var F=this.getNodes();F.forEach(function(ee){ee.toFront()})}else{var Z=this.getEdges();Z.forEach(function(ee){ee.toBack()})}},t.prototype.read=function(e){this.data(e),this.render()},t.prototype.diffItems=function(e,r,n){var a=this,i,o=this.get("itemMap");(0,m.each)(n,function(s){if(i=o[s.id],i){if(a.get("animate")&&e===tl){var l=i.getContainer().getMatrix();l||(l=[1,0,0,0,1,0,0,0,1]),i.set("originAttrs",{x:l[6],y:l[7]})}a.updateItem(i,s,!1)}else i=a.addItem(e,s,!1);i&&r["".concat(e,"s")].push(i)})},t.prototype.changeData=function(e,r){var n=this,a;r===void 0&&(r=!0);var i=this,o=e||i.get("data");if(!fs(o))return this;this.emit("beforechangedata"),r&&this.get("enabledStack")&&this.pushStack("changedata",{before:i.save(),after:o}),this.set("comboSorted",!1),this.removeHulls(),this.getNodes().map(function(oe){return i.clearItemStates(oe)}),this.getEdges().map(function(oe){return i.clearItemStates(oe)});var s=this.get("canvas"),l=s.get("localRefresh");s.set("localRefresh",!1),i.get("data")||(i.data(o),i.render());var h=this.get("itemMap"),p={nodes:[],edges:[]},D=o.combos;if(D){var I=os(D,o.nodes);this.set("comboTrees",I)}else this.set("comboTrees",[]);this.diffItems("node",p,o.nodes),(0,m.each)(h,function(oe,ce){h[ce].getModel().depth=0,!(oe.getType&&oe.getType()==="edge")&&(oe.getType&&oe.getType()==="combo"?(delete h[ce],oe.destroy()):p.nodes.indexOf(oe)<0&&(delete h[ce],i.remove(oe,!1)))});for(var F=this.getCombos(),Z=F.length,ee=Z-1;ee>=0;ee--)F[ee].destroyed&&F.splice(ee,1);D&&(i.addCombos(D),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",p,o.edges),(0,m.each)(h,function(oe,ce){oe.getType&&(oe.getType()==="node"||oe.getType()==="combo")||p.edges.indexOf(oe)<0&&(delete h[ce],i.remove(oe,!1))}),(this.get("comboTrees")||[]).forEach(function(oe){Ki(oe,function(ce){var we=n.findById(ce.id);return we.getType()==="combo"&&ce.collapsed&&n.collapseCombo(ce.id,!1),!0})}),this.set({nodes:p.nodes,edges:p.edges});var se=this.get("layoutController");return se&&(se.changeData(function(){setTimeout(function(){var oe;(oe=i.getCombos())===null||oe===void 0||oe.forEach(function(ce){ce.set("animate",!0)})},0)}),i.get("animate")&&!se.getLayoutType()?(i.positionsAnimate(),(a=i.getCombos())===null||a===void 0||a.forEach(function(oe){return oe.set("animate",!0)})):i.autoPaint()),setTimeout(function(){s.set("localRefresh",l)},16),this.set("data",o),this.emit("afterchangedata"),this},t.prototype.addCombos=function(e){var r=this,n=r.get("comboTrees"),a=this.get("itemController");a.addCombos(n,e)},t.prototype.createCombo=function(e,r,n){var a=this;n===void 0&&(n=!0);var i=this.get("itemController");this.set("comboSorted",!1);var o="",s;if(!!e){if((0,m.isString)(e))o=e,s={id:e};else{if(o=e.id,!o){console.warn("Create combo failed. Please assign a unique string id for the adding combo.");return}s=e}var l=n&&this.get("enabledStack"),h={nodes:[],combos:[]};l&&r.forEach(function(se){var oe=a.findById(se),ce=oe.getType();if(!(ce!=="node"&&ce!=="combo")){var we=oe.getModel();h["".concat(ce,"s")].push({id:se,parentId:ce==="node"?we.comboId:we.parentId})}});var p=this.get("comboTrees"),D=new Set(r),I=new Map;p&&(p.forEach(function(se){Ki(se,function(oe,ce,we){if(D.has(oe.id)){if(ce){var Re=a.findById(ce.id),Oe=a.findById(oe.id);ce.children.splice(we,1),Re.removeChild(Oe),i.updateCombo(Re,ce.children)}oe.itemType==="combo"&&I.set(oe.id,oe)}return!0})}),p=p.filter(function(se){return!D.has(se.id)}),this.set("comboTrees",p));var F={nodes:[],combos:[]},Z=r.map(function(se){var oe=a.findById(se),ce=oe.getModel(),we="";oe.getType&&(we=oe.getType());var Re=I.get(se)||{id:oe.getID(),itemType:we};return we==="combo"?(Re.parentId=o,ce.parentId=o):we==="node"&&(Re.comboId=o,ce.comboId=o),l&&F["".concat(we,"s")].push({id:ce.id,parentId:o}),Re});s.children=Z,this.addItem("combo",s,!1),this.set("comboSorted",!1),p&&(p.forEach(function(se){Ei(se,function(oe){return oe.id===o?(oe.itemType="combo",oe.children=Z,!1):!0})}),this.sortCombos()),l&&(F.combos.push(s),this.pushStack("createCombo",{before:h,after:F}));var ee=this.findById(o);!ee.getModel().parentId&&ee.getChildren().combos.length&&this.updateComboTree(ee,void 0,!1)}},t.prototype.uncombo=function(e,r){var n=this,a,i;r===void 0&&(r=!0);var o=this,s=e;if((0,m.isString)(e)&&(s=this.findById(e)),!s||s.getType&&s.getType()!=="combo"){console.warn("The item is not a combo!");return}var l=s.getModel(),h=s.getModel().parentId,p=o.get("comboTrees");p||(p=[]);var D=this.get("itemMap"),I=s.get("id"),F,Z=[],ee=this.get("combos"),se=this.findById(h),oe=r&&this.get("enabledStack"),ce={};if(oe&&(ce=(0,m.clone)(l),ce.children=[]),p.forEach(function(Pe){F||Ki(Pe,function(He){var at;if(He.id===I){F=He;var qe=s.getEdges().map(function(yr){return yr.getID()});qe.forEach(function(yr){n.removeItem(yr,!1)});var yt=ee.indexOf(s);ee.splice(yt,1),delete D[I];var Ft=(0,m.clone)(s.getModel());s.destroy(),n.emit("afterremoveitem",{item:Ft,type:"combo"})}if(h&&F&&He.id===h){se.removeCombo(s),Z=He.children;var yt=Z.indexOf(F);return yt!==-1&&Z.splice(yt,1),(at=F.children)===null||at===void 0||at.forEach(function(fr){var lr=n.findById(fr.id),Kt=lr.getModel();lr.getType&&lr.getType()==="combo"?(fr.parentId=h,delete fr.comboId,Kt.parentId=h,delete Kt.comboId):lr.getType&&lr.getType()==="node"&&(fr.comboId=h,Kt.comboId=h),se.addChild(lr),Z.push(fr)}),n.updateCombo(se),!1}return!0})}),!h&&F){var we=p.indexOf(F);p.splice(we,1),(a=F.children)===null||a===void 0||a.forEach(function(Pe){Pe.parentId=void 0;var He=n.findById(Pe.id).getModel();delete He.parentId,delete He.comboId,Pe.itemType!=="node"&&p.push(Pe)})}if(oe){var Re={nodes:[],combos:[]},Oe={nodes:[],combos:[]};(i=F.children)===null||i===void 0||i.forEach(function(Pe){var He=n.findById(Pe.id),at=He.getType();at!=="node"&&at!=="combo"||(Re["".concat(at,"s")].push({id:Pe.id,parentId:I}),Oe["".concat(at,"s")].push({id:Pe.id,parentId:h}))}),Re.combos.push(ce),this.pushStack("uncombo",{before:Re,after:Oe})}},t.prototype.updateCombos=function(e){var r=this;e===void 0&&(e=!1);var n=this,a=this.get("comboTrees"),i=n.get("itemController"),o=n.get("itemMap");(a||[]).forEach(function(s){Ki(s,function(l){var h;if(!l)return!0;var p=o[l.id];if(((h=p==null?void 0:p.getType)===null||h===void 0?void 0:h.call(p))==="combo"){var D=(0,b.__spreadArray)([],p.getStates(),!0);(0,m.each)(D,function(I){return r.setItemState(p,I,!1)}),i.updateCombo(p,l.children,e),(0,m.each)(D,function(I){return r.setItemState(p,I,!0)})}return!0})}),n.sortCombos()},t.prototype.updateCombo=function(e){var r=this,n=this,a=e,i;if((0,m.isString)(e)&&(a=this.findById(e)),!a||a.getType&&a.getType()!=="combo"){console.warn("The item to be updated is not a combo!");return}i=a.get("id");var o=this.get("comboTrees"),s=n.get("itemController"),l=n.get("itemMap");(o||[]).forEach(function(h){Ki(h,function(p){if(!p)return!0;var D=l[p.id];if(i===p.id&&D&&D.getType&&D.getType()==="combo"){var I=(0,b.__spreadArray)([],D.getStates(),!0);(0,m.each)(I,function(F){D.getStateStyle(F)&&r.setItemState(D,F,!1)}),s.updateCombo(D,p.children),(0,m.each)(I,function(F){D.getStateStyle(F)&&r.setItemState(D,F,!0)}),i&&(i=p.parentId)}return!0})})},t.prototype.updateComboTree=function(e,r,n){n===void 0&&(n=!0);var a=this;this.set("comboSorted",!1);var i;(0,m.isString)(e)?i=a.findById(e):i=e;var o=i.getModel(),s=o.comboId||o.parentId,l="";if(i.getType&&(l=i.getType()),r&&l==="combo"){var h=this.get("comboTrees"),p=!0,D;if((h||[]).forEach(function(oe){D||Ei(oe,function(ce){if(!D)return ce.id===i.getID()&&(D=ce),!0})}),Ei(D,function(oe){return oe.id===r?(p=!1,!1):!0}),!p){console.warn("Failed to update the combo tree! The parentId points to a descendant of the combo!");return}}if(n&&this.get("enabledStack")){var I={},F={};l==="combo"?(I.combos=[{id:o.id,parentId:o.parentId}],F.combos=[{id:o.id,parentId:r}]):l==="node"&&(I.nodes=[{id:o.id,parentId:o.comboId}],F.nodes=[{id:o.id,parentId:r}]),this.pushStack("updateComboTree",{before:I,after:F})}if(o.parentId||o.comboId){var Z=this.findById(o.parentId||o.comboId);Z&&Z.removeChild(i)}if(l==="combo"?o.parentId=r:l==="node"&&(o.comboId=r),r){var ee=this.findById(r);ee&&ee.addChild(i)}if(s){var ee=this.findById(s);ee&&ee.removeChild(i)}var se=ss(this.get("comboTrees"),o.id,r);this.set("comboTrees",se),this.updateCombos()},t.prototype.save=function(){var e=[],r=[],n=[];return(0,m.each)(this.get("nodes"),function(a){e.push(a.getModel())}),(0,m.each)(this.get("edges"),function(a){r.push(a.getModel())}),(0,m.each)(this.get("combos"),function(a){n.push(a.getModel())}),{nodes:e,edges:r,combos:n}},t.prototype.changeSize=function(e,r){var n=this.get("viewController");return n.changeSize(e,r),this},t.prototype.refresh=function(){var e=this;if(e.emit("beforegraphrefresh"),e.get("animate"))e.positionsAnimate();else{var r=e.get("nodes"),n=e.get("edges"),a=e.get("edges");(0,m.each)(r,function(i){i.refresh()}),(0,m.each)(n,function(i){i.refresh()}),(0,m.each)(a,function(i){i.refresh()})}e.emit("aftergraphrefresh"),e.autoPaint()},t.prototype.getNodes=function(){return this.get("nodes")},t.prototype.getEdges=function(){return this.get("edges")},t.prototype.getCombos=function(){return this.get("combos")},t.prototype.getComboChildren=function(e){if((0,m.isString)(e)&&(e=this.findById(e)),!e||e.getType&&e.getType()!=="combo"){console.warn("The combo does not exist!");return}return e.getChildren()},t.prototype.positionsAnimate=function(e){var r=this;r.emit("beforeanimate");var n=r.get("animateCfg"),a=n.onFrame,i=e?r.getNodes().concat(r.getCombos()):r.getNodes(),o=i.map(function(l){var h=l.getModel();return{id:h.id,x:h.x,y:h.y}});r.stopAnimate();var s=r.get("canvas");r.animating=!0,s.animate(function(l){(0,m.each)(o,function(h){var p=r.findById(h.id);if(!(!p||p.destroyed)){var D=p.get("originAttrs"),I=p.get("model"),F=p.getContainer().getMatrix();if(D==null&&(F&&(D={x:F[6],y:F[7]}),p.set("originAttrs",D||0)),a){var Z=a(p,l,h,D||{x:0,y:0});p.set("model",Object.assign(I,Z))}else D?(I.x=D.x+(h.x-D.x)*l,I.y=D.y+(h.y-D.y)*l):(I.x=h.x,I.y=h.y)}}),r.refreshPositions(e)},{duration:n.duration,easing:n.easing,callback:function(){(0,m.each)(i,function(h){h.set("originAttrs",null)}),n.callback&&n.callback(),r.emit("afteranimate"),r.animating=!1}})},t.prototype.refreshPositions=function(e){var r=this;r.emit("beforegraphrefreshposition");var n=r.get("nodes"),a=r.get("edges"),i=r.get("vedges"),o=r.get("combos"),s,l={},h=function(D){(0,m.each)(D,function(I){s=I.getModel();var F=I.get("originAttrs");if(!(F&&s.x===F.x&&s.y===F.y)){var Z=I.updatePosition({x:s.x,y:s.y});l[s.id]=Z,s.comboId&&(l[s.comboId]=l[s.comboId]||Z),s.parentId&&(l[s.parentId]=l[s.parentId]||Z)}})};h(o),h(n),o&&o.length!==0&&(e&&h(o),r.updateCombos()),(0,m.each)(a,function(p){var D=p.getSource().getModel(),I=p.getTarget();if(!(0,m.isPlainObject)(I)){var F=I.getModel();(l[D.id]||l[F.id]||p.getModel().isComboEdge)&&p.refresh()}}),(0,m.each)(i,function(p){p.refresh()}),r.emit("aftergraphrefreshposition"),r.autoPaint()},t.prototype.stopAnimate=function(){this.isAnimating()&&this.get("canvas").stopAnimate()},t.prototype.isAnimating=function(){return this.animating},t.prototype.getZoom=function(){var e=this.get("group").getMatrix();return e?e[0]:1},t.prototype.getCurrentMode=function(){var e=this.get("modeController");return e.getMode()},t.prototype.setMode=function(e){var r=this.get("modeController");return r.setMode(e),this},t.prototype.clear=function(e){var r;return e===void 0&&(e=!1),(r=this.get("canvas"))===null||r===void 0||r.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],vedges:[],groups:[],combos:[],comboTrees:[]}),e||this.emit("afterrender"),this},t.prototype.updateLayout=function(e,r,n,a){var i=this;e===void 0&&(e={}),a===void 0&&(a=!0);var o=this.get("layoutController");if((0,m.isString)(e)&&(e={type:e}),r){var s=n;s||(r==="begin"?s={x:0,y:0}:s={x:this.getWidth()/2,y:this.getHeight()/2}),s=this.getPointByCanvas(s.x,s.y);var l=["force","gForce","fruchterman","force2"];l.includes(e.type)||!e.type&&l.includes(o==null?void 0:o.layoutType)?e.center=[s.x,s.y]:this.once("afterlayout",function(D){var I=i.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];s.x=s.x*I[0]+I[6],s.y=s.y*I[0]+I[7];var F=i.getGroup().getCanvasBBox(),Z=F.minX,ee=F.maxX,se=F.minY,oe=F.maxY,ce={x:(Z+ee)/2,y:(se+oe)/2};r==="begin"&&(ce.x=Z,ce.y=se),i.translate(s.x-ce.x,s.y-ce.y)})}var h=(0,b.__assign)({},this.get("layout")),p={};Object.assign(p,h,e),e.pipes&&!e.type?delete p.type:!e.pipes&&p.type&&delete p.pipes,this.set("layout",p),!!o&&(o.isLayoutTypeSame(p)&&p.gpuEnabled===h.gpuEnabled?o.updateLayoutCfg(p):o.changeLayout(p),a&&this.get("enabledStack")&&this.pushStack("layout",{before:h,after:p}))},t.prototype.destroyLayout=function(){var e=this.get("layoutController");e==null||e.destroyLayout()},t.prototype.layout=function(){var e,r=this.get("layoutController"),n=this.get("layout");if(!(!n||!r)){if(n.workerEnabled){r.layout();return}((e=r.layoutMethods)===null||e===void 0?void 0:e.length)?r.relayout(!0):r.layout()}},t.prototype.collapseCombo=function(e,r){var n=this;if(r===void 0&&(r=!0),!this.destroyed){if((0,m.isString)(e)&&(e=this.findById(e)),!e){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"expand",item:e});var a=e.getModel(),i=this.get("itemController");i.collapseCombo(e,r),a.collapsed=!0;var o=this.getEdges().concat(this.get("vedges")),s=[],l=this.get("comboTrees"),h=!1;(l||[]).forEach(function(D){h||Ei(D,function(I){if(h&&I.depth<=a.depth)return!1;if(a.id===I.id&&(h=!0),h){var F=n.findById(I.id);F&&F.getType&&F.getType()==="combo"&&(s=s.concat(F.getNodes()),s=s.concat(F.getCombos()))}return!0})});var p={};o.forEach(function(D){var I=D.getModel(),F=I.isVEdge,Z=I.size,ee=Z===void 0?1:Z;if(!(D.isVisible()&&!F)){var se=D.getSource(),oe=D.getTarget(),ce=null,we;if(se.getModel().id===a.id||s.includes(se)&&!s.includes(oe)?(ce=oe,we=!1):(oe.getModel().id===a.id||!s.includes(se)&&s.includes(oe))&&(ce=se,we=!0),ce){if(F){n.removeItem(D,!1);return}for(var Re=ce.getModel();!ce.isVisible();){var Oe=Re.parentId,Pe=Re.comboId,He=Oe||Pe;if(ce=n.findById(He),!ce||!He)return;Re=ce.getModel()}var at=Re.id,qe=we?{source:at,target:a.id,size:ee,isVEdge:!0}:{source:a.id,target:at,size:ee,isVEdge:!0},yt="".concat(qe.source,"-").concat(qe.target);if(p[yt]){p[yt].size+=ee;return}p[yt]=qe}}}),this.addItems(Object.values(p).map(function(D){return{type:"vedge",model:D}}),!1),this.emit("aftercollapseexpandcombo",{action:"collapse",item:e})}},t.prototype.expandCombo=function(e,r){var n=this;if(r===void 0&&(r=!0),(0,m.isString)(e)&&(e=this.findById(e)),!e||e.getType&&e.getType()!=="combo"){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"expand",item:e});var a=e.getModel(),i=this.get("itemController");i.expandCombo(e,r),a.collapsed=!1;var o=this.getEdges().concat(this.get("vedges")),s=[],l=this.get("comboTrees"),h=!1;(l||[]).forEach(function(D){h||Ei(D,function(I){if(h&&I.depth<=a.depth)return!1;if(a.id===I.id&&(h=!0),h){var F=n.findById(I.id);F&&F.getType&&F.getType()==="combo"&&(s=s.concat(F.getNodes()),s=s.concat(F.getCombos()))}return!0})});var p={};o.forEach(function(D){if(!(D.isVisible()&&!D.getModel().isVEdge)){var I=D.getSource(),F=D.getTarget(),Z=I.get("id"),ee=F.get("id"),se=null,oe;if(Z===a.id||s.includes(I)&&!s.includes(F)?(se=F,oe=!1):ee===a.id||!s.includes(I)&&s.includes(F)?(se=I,oe=!0):s.includes(I)&&s.includes(F)&&I.isVisible()&&F.isVisible()&&D.show(),se){var ce=D.getModel(),we=ce.isVEdge,Re=ce.size,Oe=Re===void 0?1:Re;if(we){n.removeItem(D,!1);return}for(var Pe=se.getModel();!se.isVisible();){var He=Pe.parentId,at=Pe.comboId,qe=He||at;if(se=n.findById(qe),!se||!qe)return;Pe=se.getModel()}for(var yt=Pe.id,Ft=oe?F:I,yr=Ft.getModel();!Ft.isVisible();){var fr=yr.parentId,lr=yr.comboId,Kt=fr||lr;if(Ft=n.findById(Kt),!Ft||!Kt)return;if(yr.comboId===a.id||yr.parentId===a.id)break;yr=Ft.getModel()}var jr=yr.id;if(yt){var Xr=oe?{source:yt,target:jr,isVEdge:!0,size:Oe}:{source:jr,target:yt,isVEdge:!0,size:Oe},er="".concat(Xr.source,"-").concat(Xr.target);if(p[er]){p[er].size+=Oe;return}p[er]=Xr}}}}),this.addItems(Object.values(p).map(function(D){return{type:"vedge",model:D}}),!1),this.emit("aftercollapseexpandcombo",{action:"expand",item:e})},t.prototype.collapseExpandCombo=function(e,r){if(r===void 0&&(r=!0),(0,m.isString)(e)&&(e=this.findById(e)),!(!e||e.getType&&e.getType()!=="combo")){for(var n=e.getModel(),a=this.findById(n.parentId);a;){var i=a.getModel();if(i.collapsed){console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),a=void 0;return}a=this.findById(i.parentId)}var o=n.collapsed;o?this.expandCombo(e,r):this.collapseCombo(e,r),this.updateCombo(e)}},t.prototype.getNeighbors=function(e,r){var n=e;return(0,m.isString)(e)&&(n=this.findById(e)),n.getNeighbors(r)},t.prototype.getNodeDegree=function(e,r,n){r===void 0&&(r=void 0),n===void 0&&(n=!1);var a=e;(0,m.isString)(e)&&(a=this.findById(e));var i=this.get("degrees");(!i||n)&&(i=St(this.save()),this.set("degrees",i));var o=i[a.getID()],s=0;if(!o)return 0;switch(r){case"in":s=o.inDegree;break;case"out":s=o.outDegree;break;case"all":s=o;break;default:s=o.degree;break}return s},t.prototype.getUndoStack=function(){return this.undoStack},t.prototype.getRedoStack=function(){return this.redoStack},t.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},t.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear(),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack}))},t.prototype.pushStack=function(e,r,n){if(e===void 0&&(e="update"),n===void 0&&(n="undo"),!this.get("enabledStack")){console.warn("\u8BF7\u5148\u542F\u7528 undo & redo \u529F\u80FD\uFF0C\u5728\u5B9E\u4F8B\u5316 Graph \u65F6\u5019\u914D\u7F6E enabledStack: true !");return}var a=r?(0,m.clone)(r):{before:{},after:(0,m.clone)(this.save())};n==="redo"?this.redoStack.push({action:e,data:a}):this.undoStack.push({action:e,data:a}),this.emit("stackchange",{action:e,stackType:n,undoStack:this.undoStack,redoStack:this.redoStack})},t.prototype.getAdjMatrix=function(e,r){e===void 0&&(e=!0),r===void 0&&(r=this.get("directed"));var n=this.get("adjMatrix");return(!n||!e)&&(n=te(this.save(),r),this.set("adjMatrix",n)),n},t.prototype.getShortestPathMatrix=function(e,r){e===void 0&&(e=!0),r===void 0&&(r=this.get("directed"));var n=this.get("adjMatrix"),a=this.get("shortestPathMatrix");return(!n||!e)&&(n=te(this.save(),r),this.set("adjMatrix",n)),(!a||!e)&&(a=Gn(this.save(),r),this.set("shortestPathMatrix",a)),a},t.prototype.on=function(e,r,n){return c.prototype.on.call(this,e,r,n)},t.prototype.destroy=function(){var e,r,n,a,i;this.clear(),this.clearStack(),(e=this.get("itemController"))===null||e===void 0||e.destroy(),(r=this.get("modeController"))===null||r===void 0||r.destroy(),(n=this.get("viewController"))===null||n===void 0||n.destroy(),(a=this.get("stateController"))===null||a===void 0||a.destroy(),(i=this.get("canvas"))===null||i===void 0||i.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null},t.prototype.createHull=function(e){if(!e.members||e.members.length<1){console.warn("Create hull failed! The members is empty.");return}var r=this.get("hullGroup"),n=this.get("hullMap");if(n||(n={},this.set("hullMap",n)),(!r||r.get("destroyed"))&&(r=this.get("group").addGroup({id:"hullGroup"}),r.toBack(),this.set("hullGroup",r)),n[e.id])return console.warn("Existed hull id."),n[e.id];var a=r.addGroup({id:"".concat(e.id,"-container")}),i=new Rf(this,(0,b.__assign)((0,b.__assign)({},e),{group:a})),o=i.id;return n[o]=i,i},t.prototype.getHulls=function(){return this.get("hullMap")},t.prototype.getHullById=function(e){return this.get("hullMap")[e]},t.prototype.removeHull=function(e){var r,n;(0,m.isString)(e)?n=this.getHullById(e):n=e,(r=this.get("hullMap"))===null||r===void 0||delete r[n.id],n.destroy()},t.prototype.removeHulls=function(){var e=this.getHulls();!e||!Object.keys(e).length||(Object.keys(e).forEach(function(r){var n=e[r];n.destroy()}),this.set("hullMap",{}))},t}(Q.Z),Bf=Do;function hs(c){return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(c)}var Ls=q.vs,yc="-shape",wu="-label",Ds=["startArrow","endArrow"],mc={lineWidth:1,stroke:void 0,fill:void 0,lineAppendWidth:1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,x:0,y:0,r:10,width:20,height:20,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},rl={lineWidth:1,stroke:"#000",lineDash:void 0,startArrow:!1,endArrow:!1,opacity:void 0,strokeOpacity:void 0,fillOpacity:void 0,shadowColor:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0},of={edge:rl,node:mc,combo:mc},Ff="-label-bg",Gf={options:{labelCfg:{style:{fontFamily:an.windowFontFamily}},descriptionCfg:{style:{fontFamily:an.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(t){return{}},getOptions:function(t,e){return e==="move"||(e==null?void 0:e.includes("bbox"))?t:(0,m.deepMix)({},this.options,this.getCustomConfig(t)||{},t)},draw:function(t,e){e.shapeMap={},this.mergeStyle=this.getOptions(t);var r=this.drawShape(t,e);if(r.set("className",this.itemType+yc),e.shapeMap[this.itemType+yc]=r,t.label){var n=this.drawLabel(t,e);n.set("className",this.itemType+wu),e.shapeMap[this.itemType+wu]=n}return r},afterDraw:function(t,e,r){},drawShape:function(t,e){return null},drawLabel:function(t,e){var r=(this.mergeStyle||this.getOptions(t)||{}).labelCfg,n=r||{},a=this.getLabelStyle(t,n,e),i=a.rotate;delete a.rotate;var o=e.addShape("text",{attrs:a,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(e.shapeMap["text-shape"]=o,!isNaN(i)&&i!==""){var s=o.getBBox(),l=[1,0,0,0,1,0,0,0,1];if(a.rotateCenter)switch(a.rotateCenter){case"center":l=Ls(l,[["t",-s.width/2,-s.height/2],["r",i],["t",s.width/2,s.height/2]]);break;case"lefttop":l=Ls(l,[["t",-a.x,-a.y],["r",i],["t",a.x,a.y]]);break;case"leftcenter":l=Ls(l,[["t",-a.x,-a.y-s.height/2],["r",i],["t",a.x,a.y+s.height/2]]);break;default:l=Ls(l,[["t",-s.width/2,-s.height/2],["r",i],["t",s.width/2,s.height/2]]);break}else l=Ls(l,[["t",-a.x,-a.y-s.height/2],["r",i],["t",a.x,a.y+s.height/2]]);o.setMatrix(l)}if(a.background){var h=this.drawLabelBg(t,e,o),p=this.itemType+Ff;h.set("classname",p),e.shapeMap[p]=h,o.toFront()}return o},drawLabelBg:function(t,e,r){var n=this.options.labelCfg,a=(0,m.mix)({},n,t.labelCfg),i=this.getLabelBgStyleByPosition(r,a),o=e.addShape("rect",{name:"text-bg-shape",attrs:i,labelRelated:!0});return e.shapeMap["text-bg-shape"]=o,o},getLabelStyleByPosition:function(t,e,r){return{text:t.label}},getLabelBgStyleByPosition:function(t,e){return{}},getLabelStyle:function(t,e,r){var n=this.getLabelStyleByPosition(t,e,r),a="".concat(this.itemType,"Label"),i=an[a]?an[a].style:null;return(0,b.__assign)((0,b.__assign)((0,b.__assign)({},i),n),e.style)},getShapeStyle:function(t){return t.style},update:function(t,e,r){this.updateShapeStyle(t,e,r),this.updateLabel(t,e,r)},updateShapeStyle:function(t,e,r){var n,a=e.getContainer(),i=e.getKeyShape(),o=(0,m.mix)({},i.attr(),t.style),s=function(p){var D,I=o[p];if((0,m.isPlainObject)(I)){var F=((n=a.shapeMap)===null||n===void 0?void 0:n[p])||a.find(function(Z){return Z.get("name")===p});F==null||F.attr(I)}else i.attr((D={},D[p]=I,D))};for(var l in o)s(l)},updateLabel:function(t,e,r){var n,a;if(t.label||t.label===""){var i=e.getContainer(),o=(this.mergeStyle||this.getOptions({},r)||{}).labelCfg,s=o===void 0?{}:o,l=this.itemType+wu,h=i.shapeMap[l]||i.find(function(we){return we.get("className")===l}),p=this.itemType+Ff,D=i.shapeMap[p]||i.find(function(we){return we.get("className")===p});if(h){(!r||r==="bbox|label"||this.itemType==="edge"&&r!=="style")&&(s=(0,m.deepMix)(s,t.labelCfg));var F=this.getLabelStyleByPosition(t,s,i),Z=(n=t.labelCfg)===null||n===void 0?void 0:n.style,ee=(0,b.__assign)((0,b.__assign)({},F),Z),se=ee.rotate;if(delete ee.rotate,!isNaN(se)&&se!==""){var oe=[1,0,0,0,1,0,0,0,1];oe=Ls(oe,[["t",-ee.x,-ee.y],["r",se],["t",ee.x,ee.y]]),ee.matrix=oe,h.attr(ee)}else((a=h.getMatrix())===null||a===void 0?void 0:a[4])!==1&&h.resetMatrix(),h.attr(ee);if(!D)ee.background&&(D=this.drawLabelBg(t,i,h),D.set("classname",p),i.shapeMap[p]=D,h.toFront());else if(ee.background){var ce=this.getLabelBgStyleByPosition(h,s);D.attr(ce)}else i.removeChild(D)}else{var I=this.drawLabel(t,i);I.set("className",l),i.shapeMap[l]=I}}},afterUpdate:function(t,e){},setState:function(t,e,r){var n,a,i,o=r.get("keyShape");if(!(!o||o.destroyed)){var s=r.getType(),l=(0,m.isBoolean)(e)?t:"".concat(t,":").concat(e),h=this.getStateStyle(l,r),p=r.getStateStyle(l);if(!(!p&&!h)){var D=(0,m.mix)({},p||h),I=r.getContainer(),F={x:1,y:1,cx:1,cy:1,matrix:1};if(s==="combo"&&(F.r=1,F.width=1,F.height=1),e){var Z=function(Kt){var jr,Xr=D[Kt];if((0,m.isPlainObject)(Xr)&&!Ds.includes(Kt)){var er=((i=I.shapeMap)===null||i===void 0?void 0:i[Kt])||I.find(function(mr){return mr.get("name")===Kt});er==null||er.attr(Xr)}else o.attr((jr={},jr[Kt]=Xr,jr))};for(var ee in D)Z(ee)}else{var se=Uo(r.getCurrentStatesStyle()),oe=r.getModel(),ce=(0,m.mix)({},oe.style,Uo(r.getOriginStyle())),we=o.get("name"),Re=o.attr(),Oe={};Object.keys(Re).forEach(function(lr){if(lr!=="img"){var Kt=Re[lr];Kt&&hs(Kt)==="object"?Oe[lr]=(0,m.clone)(Kt):Oe[lr]=Kt}});var Pe={},He=function(Kt){var jr=D[Kt];if((0,m.isPlainObject)(jr)&&!Ds.includes(Kt)){var Xr=I.shapeMap[Kt]||I.find(function(kr){return kr.get("name")===Kt});if(Xr){var er=Uo(Xr.attr());(0,m.each)(jr,function(kr,Fr){if(Kt===we&&Oe[Fr]&&!F[Fr]){delete Oe[Fr];var Jr=ce[Kt][Fr]||of[s][Fr];o.attr(Fr,Jr)}else if(er[Fr]||er[Fr]===0){delete er[Fr];var fn=ce[Kt][Fr]||of[s][Fr];Xr.attr(Fr,fn)}}),Pe[Kt]=er}}else if(Oe[Kt]&&!F[Kt]){delete Oe[Kt];var mr=ce[Kt]||(ce[we]?ce[we][Kt]:void 0)||of[s][Kt];o.attr(Kt,mr)}};for(var at in D)He(at);we?Pe[we]=Oe:(0,m.mix)(Pe,Oe);for(var ee in se)if(!F[ee]){var qe=se[ee];(!(0,m.isPlainObject)(qe)||Ds.includes(ee))&&(we?((0,m.mix)(ce[we],(a={},a[ee]=qe,a)),delete ce[ee]):(0,m.mix)(ce,(n={},n[ee]=qe,n)),delete se[ee])}var yt={};(0,m.deepMix)(yt,ce,Pe,se);var Ft=!1,yr=function(Kt){var jr,Xr,er=yt[Kt];if((0,m.isPlainObject)(er)&&!Ds.includes(Kt)){var mr=I.shapeMap[Kt]||I.find(function(Fr){return Fr.get("name")===Kt});mr&&((mr.get("type")==="text"||mr.get("labelRelated"))&&(delete er.x,delete er.y,delete er.matrix),Kt===we&&(s==="combo"&&(delete er.r,delete er.width,delete er.height),Ft=!0),mr.attr(er))}else if(!Ft){var kr=er||of[s][Kt];s==="combo"?we||o.attr((jr={},jr[Kt]=kr,jr)):o.attr((Xr={},Xr[Kt]=kr,Xr))}};for(var fr in yt)yr(fr)}}}},getStateStyle:function(t,e){var r=e.getModel(),n=e.getType(),a=this.getOptions(r),i=a.stateStyles,o=a.style,s=o===void 0?{}:o,l=r.stateStyles?r.stateStyles[t]:i&&i[t];return n==="combo"?(0,m.clone)(l):(0,m.mix)({},s,l)},getControlPoints:function(t){return t.controlPoints},getAnchorPoints:function(t){var e,r,n=(t==null?void 0:t.anchorPoints)||((e=this.getCustomConfig(t))===null||e===void 0?void 0:e.anchorPoints)||((r=this.options)===null||r===void 0?void 0:r.anchorPoints);return n}},Ec={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:an.nodeLabel.offset,getSize:function(t){var e,r=((e=this.mergeStyle)===null||e===void 0?void 0:e.size)||t.size||this.getOptions({}).size||an.defaultNode.size;return(0,m.isArray)(r)&&r.length===1&&(r=[r[0],r[0]]),(0,m.isArray)(r)||(r=[r,r]),r},getLabelStyleByPosition:function(t,e){var r=e.maxLength,n=t.label;r&&(n=io(n,r));var a=e.position||this.labelPosition;if(a==="center")return{x:0,y:0,text:n,textBaseline:"middle",textAlign:"center"};var i=e.offset;(0,m.isNil)(i)&&(i=this.offset);var o=this.getSize(t),s;switch(a){case"top":s={x:0,y:-o[1]/2-i,textBaseline:"bottom",textAlign:"center"};break;case"bottom":s={x:0,y:o[1]/2+i,textBaseline:"top",textAlign:"center"};break;case"left":s={x:-o[0]/2-i,y:0,textBaseline:"middle",textAlign:"right"};break;default:s={x:o[0]/2+i,y:0,textBaseline:"middle",textAlign:"left"};break}return s.text=n,s},getLabelBgStyleByPosition:function(t,e){var r;if(!t)return{};var n=(r=e.style)===null||r===void 0?void 0:r.background;if(!n)return{};var a=t.getBBox(),i=Cs(n.padding),o=a.width+i[1]+i[3],s=a.height+i[0]+i[2];return(0,b.__assign)((0,b.__assign)({x:a.minX-i[3],y:a.minY-i[0]},n),{width:o,height:s})},drawShape:function(t,e){var r=this.shapeType,n=this.getShapeStyle(t),a=e.addShape(r,{attrs:n,draggable:!0,name:"node-shape"});return e.shapeMap["node-shape"]=a,a},updateLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=e.shapeMap["link-point-left"]||e.find(function(yt){return yt.get("className")==="link-point-left"}),a=e.shapeMap["link-point-right"]||e.find(function(yt){return yt.get("className")==="link-point-right"}),i=e.shapeMap["link-point-top"]||e.find(function(yt){return yt.get("className")==="link-point-top"}),o=e.shapeMap["link-point-bottom"]||e.find(function(yt){return yt.get("className")==="link-point-bottom"}),s;n&&(s=n.attr()),a&&!s&&(s=a.attr()),i&&!s&&(s=i.attr()),o&&!s&&(s=o.attr()),s||(s=r);var l=(0,m.mix)({},s,t.linkPoints),h=l.fill,p=l.stroke,D=l.lineWidth,I=l.size/2;I||(I=l.r);var F=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},Z=F.left,ee=F.right,se=F.top,oe=F.bottom,ce=this.getSize(t),we=ce[0],Re=ce[1],Oe={r:I,fill:h,stroke:p,lineWidth:D};if(n)!Z&&Z!==void 0?(n.remove(),delete e.shapeMap["link-point-left"]):n.attr((0,b.__assign)((0,b.__assign)({},Oe),{x:-we/2,y:0}));else if(Z){var Pe="link-point-left";e.shapeMap[Pe]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},Oe),{x:-we/2,y:0}),className:Pe,name:Pe,isAnchorPoint:!0})}if(a)!ee&&ee!==void 0&&(a.remove(),delete e.shapeMap["link-point-right"]),a.attr((0,b.__assign)((0,b.__assign)({},Oe),{x:we/2,y:0}));else if(ee){var He="link-point-right";e.shapeMap[He]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},Oe),{x:we/2,y:0}),className:He,name:He,isAnchorPoint:!0})}if(i)!se&&se!==void 0&&(i.remove(),delete e.shapeMap["link-point-top"]),i.attr((0,b.__assign)((0,b.__assign)({},Oe),{x:0,y:-Re/2}));else if(se){var at="link-point-top";e.shapeMap[at]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},Oe),{x:0,y:-Re/2}),className:at,name:at,isAnchorPoint:!0})}if(o)!oe&&oe!==void 0?(o.remove(),delete e.shapeMap["link-point-bottom"]):o.attr((0,b.__assign)((0,b.__assign)({},Oe),{x:0,y:Re/2}));else if(oe){var qe="link-point-bottom";e.shapeMap[qe]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},Oe),{x:0,y:Re/2}),className:qe,name:qe,isAnchorPoint:!0})}},updateShape:function(t,e,r,n,a){var i=e.get("keyShape");i.attr((0,b.__assign)({},r)),this.updateLabel(t,e,a),n&&this.updateIcon(t,e)},updateIcon:function(t,e){var r=this,n=e.getContainer(),a=(this.mergeStyle||this.getOptions(t)).icon,i=t.icon?t.icon:{show:void 0,text:void 0},o=i.show,s=i.text,l=n.shapeMap["".concat(this.type,"-icon")]||n.find(function(se){return se.get("name")==="".concat(r.type,"-icon")});if(l)if(o||o===void 0){var h=(0,m.mix)({},l.attr(),a),p=h.width,D=p===void 0?20:p,I=h.height,F=I===void 0?20:I;(h.fontFamily==="iconfont"||h.hasOwnProperty("text"))&&(D=0,F=0),l.attr((0,b.__assign)((0,b.__assign)({},h),{x:-D/2,y:-F/2}))}else l.remove(),delete n.shapeMap["".concat(this.type,"-icon")];else if(o){var Z="".concat(this.type,"-icon");if(s)n.shapeMap[Z]=n.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:Z,name:Z});else{var D=a.width,F=a.height;n.shapeMap[Z]=n.addShape("image",{attrs:(0,b.__assign)((0,b.__assign)({},a),{x:-D/2,y:-F/2}),className:Z,name:Z})}var ee=n.shapeMap["node-label"]||n.find(function(se){return se.get("name")==="node-label"});ee&&ee.toFront()}}},sf=(0,b.__assign)((0,b.__assign)({},Gf),Ec);Cr.registerNode("single-node",sf);var uf="edge-shape";function nl(c){var t=c;return c==="start"?t="end":c==="end"&&(t="start"),t}var al={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:an.defaultEdge.size,style:{x:0,y:0,stroke:an.defaultEdge.style.stroke,lineAppendWidth:an.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:an.edgeLabel.style.fill,fontSize:an.edgeLabel.style.fontSize,fontFamily:an.windowFontFamily}},stateStyles:(0,b.__assign)({},an.edgeStateStyles)},getPath:function(t){var e=[];return(0,m.each)(t,function(r,n){n===0?e.push(["M",r.x,r.y]):e.push(["L",r.x,r.y])}),e},getShapeStyle:function(t){var e=this.options.style,r={stroke:t.color},n=(0,m.mix)({},e,r,t.style),a=t.size||an.defaultEdge.size;t=this.getPathPoints(t);var i=t.startPoint,o=t.endPoint,s=this.getControlPoints(t),l=[i];s&&(l=l.concat(s)),l.push(o);var h=this.getPath(l),p=(0,m.mix)({},an.defaultEdge.style,{stroke:an.defaultEdge.color,lineWidth:a,path:h},n);return p},updateShapeStyle:function(t,e,r){var n,a=e.getContainer(),i=((n=e.getKeyShape)===null||n===void 0?void 0:n.call(e))||a.shapeMap["edge-shape"],o=t.size;t=this.getPathPoints(t);var s=t.startPoint,l=t.endPoint,h=this.getControlPoints(t),p=[s];h&&(p=p.concat(h)),p.push(l);var D=i.attr(),I=t.style||{};I.stroke===void 0&&(I.stroke=t.color);var F=t.sourceNode,Z=t.targetNode,ee={radius:I.radius};h||(ee={source:F,target:Z,offset:I.offset,radius:I.radius});var se=this.getPath(p,ee),oe={};r==="move"?oe={path:se}:(D.endArrow&&I.endArrow===!1&&(t.style.endArrow={path:""}),D.startArrow&&I.startArrow===!1&&(t.style.startArrow={path:""}),oe=(0,b.__assign)({},t.style),oe.lineWidth===void 0&&(oe.lineWdith=((0,m.isNumber)(o)?o:o==null?void 0:o[0])||D.lineWidth),oe.path===void 0&&(oe.path=se),oe.stroke===void 0&&(oe.stroke=D.stroke||t.color)),i&&i.attr(oe)},getLabelStyleByPosition:function(t,e,r){var n=e.position||this.labelPosition,a={},i=r==null?void 0:r.shapeMap[uf],o;n==="start"?o=0:n==="end"?o=1:o=.5;var s=e.refX||this.refX,l=e.refY||this.refY;if(t.startPoint.x===t.endPoint.x&&t.startPoint.y===t.endPoint.y)return a.x=t.startPoint.x+s,a.y=t.startPoint.y+l,a.text=t.label,a;var h;(0,m.isNil)(e.autoRotate)?h=this.labelAutoRotate:h=e.autoRotate;var p=Hu(i,o,s,l,h);return a.x=p.x,a.y=p.y,a.rotate=p.rotate,a.textAlign=this._getTextAlign(n,p.angle),a.text=t.label,a},getLabelBgStyleByPosition:function(t,e){if(!t)return{};var r=t.getBBox(),n=e.style&&e.style.background;if(!n)return{};var a=n.padding,i=r.width+a[1]+a[3],o=r.height+a[0]+a[2],s=(0,b.__assign)((0,b.__assign)({},n),{width:i,height:o,x:r.minX-a[3],y:r.minY-a[0],matrix:[1,0,0,0,1,0,0,0,1]}),l;return(0,m.isNil)(e.autoRotate)?l=this.labelAutoRotate:l=e.autoRotate,l&&(s.matrix=t.attr("matrix")||[1,0,0,0,1,0,0,0,1]),s},_getTextAlign:function(t,e){var r="center";return e?(e=e%(Math.PI*2),t!=="center"&&(e>=0&&e<=Math.PI/2||e>=3/2*Math.PI&&e<2*Math.PI?r=t:r=nl(t)),r):t},getControlPoints:function(t){return t.controlPoints},getPathPoints:function(t){return t},drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("path",{className:uf,name:uf,attrs:r});return e.shapeMap[uf]=n,n},drawLabel:function(t,e){var r=this.options.labelCfg,n=(0,m.deepMix)({},r,t.labelCfg),a=this.getLabelStyle(t,n,e),i=a.rotate;delete a.rotate;var o=e.addShape("text",{attrs:a,name:"text-shape",labelRelated:!0});if(e.shapeMap["text-shape"]=o,!isNaN(i)&&i!==""&&o.rotateAtStart(i),a.background){var s=this.drawLabelBg(t,e,o,a,i),l=this.itemType+Ff;s.set("classname",l),e.shapeMap[l]=s,o.toFront()}return o},drawLabelBg:function(t,e,r,n,a){var i=this.options.labelCfg,o=(0,m.deepMix)({},i,t.labelCfg),s=this.getLabelBgStyleByPosition(r,o),l=e.addShape("rect",{name:"text-bg-shape",attrs:s,labelRelated:!0});return e.shapeMap["text-bg-shape"]=l,l}},bc=(0,b.__assign)((0,b.__assign)({},Gf),al);Cr.registerEdge("single-edge",bc),Cr.registerEdge("line",{getControlPoints:function(){}},"single-edge"),Cr.registerEdge("spline",{getPath:function(t){var e=Os(t);return e}},"single-edge"),Cr.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(t){var e=t.startPoint,r=t.endPoint,n={x:(e.x+r.x)/2,y:(e.y+r.y)/2},a,i;if(t.controlPoints!==void 0){if(i=t.controlPoints[0],a=Go(e,i,r),e.x<=r.x&&e.y>r.y?this.clockwise=a.x>i.x?0:1:e.x<=r.x&&e.y<r.y?this.clockwise=a.x>i.x?1:0:e.x>r.x&&e.y<=r.y?this.clockwise=a.y<i.y?0:1:this.clockwise=a.y<i.y?1:0,(i.x-e.x)/(i.y-e.y)==(r.x-e.x)/(r.y-e.y))return[]}else{t.curveOffset===void 0&&(t.curveOffset=this.curveOffset),(0,m.isArray)(t.curveOffset)&&(t.curveOffset=t.curveOffset[0]),t.curveOffset<0?this.clockwise=0:this.clockwise=1;var o={x:r.x-e.x,y:r.y-e.y},s=Math.atan2(o.y,o.x);i={x:t.curveOffset*Math.cos(-Math.PI/2+s)+n.x,y:t.curveOffset*Math.sin(-Math.PI/2+s)+n.y},a=Go(e,i,r)}var l=Va(e,a),h=[{x:l,y:l}];return h},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),t.length===2?e.push(["L",t[1].x,t[1].y]):e.push(["A",t[1].x,t[1].y,0,0,this.clockwise,t[2].x,t[2].y]),e}},"single-edge"),Cr.registerEdge("quadratic",{curvePosition:.5,curveOffset:-20,getControlPoints:function(t){var e=t.controlPoints;if(!e||!e.length){var r=t.startPoint,n=t.endPoint;t.curveOffset===void 0&&(t.curveOffset=this.curveOffset),t.curvePosition===void 0&&(t.curvePosition=this.curvePosition),(0,m.isArray)(this.curveOffset)&&(t.curveOffset=t.curveOffset[0]),(0,m.isArray)(this.curvePosition)&&(t.curvePosition=t.curveOffset[0]);var a=ca(r,n,t.curvePosition,t.curveOffset);e=[a]}return e},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),e.push(["Q",t[1].x,t[1].y,t[2].x,t[2].y]),e}},"single-edge"),Cr.registerEdge("cubic",{curvePosition:[1/2,1/2],curveOffset:[-20,20],getControlPoints:function(t){var e=t.controlPoints;if(t.curveOffset===void 0&&(t.curveOffset=this.curveOffset),t.curvePosition===void 0&&(t.curvePosition=this.curvePosition),(0,m.isNumber)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),(0,m.isNumber)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]),!e||!e.length||e.length<2){var r=t.startPoint,n=t.endPoint,a=ca(r,n,t.curvePosition[0],t.curveOffset[0]),i=ca(r,n,t.curvePosition[1],t.curveOffset[1]);e=[a,i]}return e},getPath:function(t){var e=[];return e.push(["M",t[0].x,t[0].y]),e.push(["C",t[1].x,t[1].y,t[2].x,t[2].y,t[3].x,t[3].y]),e}},"single-edge"),Cr.registerEdge("cubic-vertical",{curvePosition:[1/2,1/2],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(t){var e=t.startPoint,r=t.endPoint;t.curvePosition===void 0&&(t.curvePosition=this.curvePosition),t.curveOffset===void 0&&(t.curveOffset=this.curveOffset),t.minCurveOffset===void 0&&(t.minCurveOffset=this.minCurveOffset),(0,m.isNumber)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),(0,m.isNumber)(t.minCurveOffset)&&(t.minCurveOffset=[t.minCurveOffset,-t.minCurveOffset]),(0,m.isNumber)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]);var n=r.y-e.y,a=[0,0];t.curveOffset?a=t.curveOffset:Math.abs(n)<Math.abs(t.minCurveOffset[0])&&(a=t.minCurveOffset);var i={x:e.x,y:e.y+n*this.curvePosition[0]+a[0]},o={x:r.x,y:r.y-n*this.curvePosition[1]+a[1]};return[i,o]}},"cubic"),Cr.registerEdge("cubic-horizontal",{curvePosition:[1/2,1/2],minCurveOffset:[0,0],curveOffset:void 0,getControlPoints:function(t){var e=t.startPoint,r=t.endPoint;t.curvePosition===void 0&&(t.curvePosition=this.curvePosition),t.curveOffset===void 0&&(t.curveOffset=this.curveOffset),t.minCurveOffset===void 0&&(t.minCurveOffset=this.minCurveOffset),(0,m.isNumber)(t.curveOffset)&&(t.curveOffset=[t.curveOffset,-t.curveOffset]),(0,m.isNumber)(t.minCurveOffset)&&(t.minCurveOffset=[t.minCurveOffset,-t.minCurveOffset]),(0,m.isNumber)(t.curvePosition)&&(t.curvePosition=[t.curvePosition,1-t.curvePosition]);var n=r.x-e.x,a=[0,0];t.curveOffset?a=t.curveOffset:Math.abs(n)<Math.abs(t.minCurveOffset[0])&&(a=t.minCurveOffset);var i={x:e.x+n*this.curvePosition[0]+a[0],y:e.y},o={x:r.x-n*this.curvePosition[1]+a[1],y:r.y},s=[i,o];return s}},"cubic"),Cr.registerEdge("loop",{getPathPoints:function(t){return Yu(t)},getControlPoints:function(t){return t.controlPoints},afterDraw:function(t){t.controlPoints=void 0},afterUpdate:function(t){t.controlPoints=void 0}},"cubic");var Js={itemType:"combo",shapeType:"single-combo",labelPosition:"top",refX:an.comboLabel.refX,refY:an.comboLabel.refY,options:{style:{stroke:an.defaultCombo.style.stroke,fill:an.defaultCombo.style.fill,lineWidth:an.defaultCombo.style.lineWidth},labelCfg:{style:{fill:an.comboLabel.style.fill,fontSize:an.comboLabel.style.fontSize,fontFamily:an.windowFontFamily}},stateStyles:(0,b.__assign)({},an.comboStateStyles),collapsedSubstituteIcon:{show:!1,img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ"}},getSize:function(t){var e=(0,m.clone)(t.size||this.options.size||an.defaultCombo.size);return(0,m.isArray)(e)&&e.length===1&&(e=[e[0],e[0]]),(0,m.isArray)(e)||(e=[e,e]),e},getLabelStyleByPosition:function(t,e){var r=e.position||this.labelPosition,n=t.style,a=t.padding||this.options.padding;(0,m.isArray)(a)&&(a=Math.max.apply(Math,a));var i=e.refX,o=e.refY;(0,m.isNil)(i)&&(i=this.refX),(0,m.isNil)(o)&&(o=this.refY);var s=this.getSize(t),l=Math.max(n.r,s[0]/2)||s[0]/2,h=l+a,p;switch(r){case"top":p={x:0,y:-h-o,textBaseline:"bottom",textAlign:"center"};break;case"bottom":p={x:0,y:h+o,textBaseline:"bottom",textAlign:"center"};break;case"left":p={x:-h+i,y:0,textAlign:"left"};break;case"center":p={x:0,y:0,text:t.label,textAlign:"center"};break;default:p={x:h+i,y:0,textAlign:"right"};break}return p.text=t.label,p},drawShape:function(t,e){var r=this.shapeType,n=this.getShapeStyle(t),a=e.addShape(r,{attrs:n,draggable:!0,name:"combo-shape"});return a},updateCollapsedIcon:function(t,e,r){var n=t.collapsed,a=t.collapsedSubstituteIcon,i=a===void 0?{}:a,o=Object.assign({},this.options.collapsedSubstituteIcon,i),s=o.show,l=o.img,h=o.width,p=o.height,D=e.getContainer(),I=D.find(function(se){return se.get("name")==="combo-collapsed-substitute-icon"}),F=I&&!I.destroyed,Z=e.get("keyShape");if(n&&s){if(F)I.show();else{var ee={width:h||r.r*2||r.width,height:p||r.r*2||r.height};I=D.addShape("image",{attrs:(0,b.__assign)({img:l,x:-ee.width/2,y:-ee.height/2},ee),name:"combo-collapsed-substitute-icon",draggable:!0})}Z.hide()}else F&&(I.hide(),Z.show())},updateShape:function(t,e,r){var n=this,a=e.get("keyShape"),i=e.get("animate"),o=i&&(t.animate===void 0?this.options.animate:t.animate);o&&a.animate?(t.collapsed||this.updateCollapsedIcon(t,e,r),a.animate(r,{duration:200,easing:"easeLinear",callback:function(){t.collapsed&&n.updateCollapsedIcon(t,e,r)}})):(a.attr((0,b.__assign)({},r)),this.updateCollapsedIcon(t,e,r)),this.updateLabel(t,e)}},il=(0,b.__assign)((0,b.__assign)({},Gf),Js);Cr.registerCombo("single-combo",il),Cr.registerCombo("circle",{options:{size:[an.defaultCombo.size[0],an.defaultCombo.size[0]],padding:Math.max.apply(Math,an.defaultCombo.padding),animate:!0,style:{stroke:an.defaultCombo.style.stroke,fill:an.defaultCombo.style.fill,lineWidth:an.defaultCombo.style.lineWidth},labelCfg:{style:{fill:an.comboLabel.style.fill,fontSize:an.comboLabel.style.fontSize},refX:0,refY:0},stateStyles:(0,b.__assign)({},an.comboStateStyles),collapsedSubstituteIcon:{show:!1,img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ"}},shapeType:"circle",labelPosition:"top",drawShape:function(t,e){var r=this.getShapeStyle(t);delete r.height,delete r.width;var n=e.addShape("circle",{attrs:r,className:"circle-combo",name:"circle-combo",draggable:!0});return n},getShapeStyle:function(t){var e=this.options.style,r=t.padding||this.options.padding;(0,m.isArray)(r)&&(r=Math.max.apply(Math,r));var n={stroke:t.color},a=(0,m.mix)({},e,n,t.style),i=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize,o;if(i)o=(0,m.isNumber)(i)?i/2:i[0]/2;else{var s=this.getSize(t);!(0,m.isNumber)(a.r)||isNaN(a.r)?o=s[0]/2||an.defaultCombo.style.r:o=Math.max(a.r,s[0]/2)||s[0]/2}a.r=o+r;var l=(0,b.__assign)({x:0,y:0},a);return t.style?t.style.r=o:t.style={r:o},l},update:function(t,e){var r=this.getSize(t),n=t.padding||this.options.padding;(0,m.isArray)(n)&&(n=Math.max.apply(Math,n));var a=(0,m.clone)(t.style),i=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize,o;i?o=(0,m.isNumber)(i)?i/2:i[0]/2:o=Math.max(a.r,r[0]/2)||r[0]/2,a.r=o+n;var s=e.get("sizeCache");s&&(s.r=a.r);var l={stroke:t.color},h=e.get("keyShape"),p=(0,m.mix)({},h.attr(),l,a);t.style?t.style.r=o:t.style={r:o},this.updateShape(t,e,p,!0)}},"single-combo"),Cr.registerCombo("rect",{options:{size:[40,5],padding:[25,20,15,20],animate:!0,style:{radius:0,stroke:an.defaultCombo.style.stroke,fill:an.defaultCombo.style.fill,lineWidth:an.defaultCombo.style.lineWidth},labelCfg:{style:{fill:an.comboLabel.style.fill,fontSize:an.comboLabel.style.fontSize,fontFamily:an.windowFontFamily}},anchorPoints:[[0,.5],[1,.5]],stateStyles:(0,b.__assign)({},an.comboStateStyles),collapsedSubstituteIcon:{show:!1,img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ"}},shapeType:"rect",labelPosition:"top",drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("rect",{attrs:r,className:"rect-combo",name:"rect-combo",draggable:!0});return n},getLabelStyleByPosition:function(t,e){var r=e.position||this.labelPosition,n=t.style,a=t.padding||this.options.padding;(0,m.isNumber)(a)&&(a=[a,a,a,a]);var i=e.refX,o=e.refY;(0,m.isNil)(i)&&(i=this.refX),(0,m.isNil)(o)&&(o=this.refY);var s=-n.width/2-a[3],l=n.width/2+a[1],h=-n.height/2-a[0],p=n.height/2+a[2],D;switch(r){case"top":D={x:s+i,y:h+o,textBaseline:"top",textAlign:"left"};break;case"bottom":D={x:0,y:p+o,textBaseline:"top",textAlign:"center"};break;case"left":D={x:s+o,y:0,textAlign:"left"};break;case"center":D={x:0,y:0,text:t.label,textAlign:"center"};break;case"top-center":D={x:0,y:h+o,textBaseline:"top",textAlign:"center"};break;default:D={x:l+i,y:0,textAlign:"right"};break}return D.text=t.label,D},getShapeStyle:function(t){var e=this.options.style,r=t.padding||this.options.padding;(0,m.isNumber)(r)&&(r=[r,r,r,r]);var n={stroke:t.color},a=(0,m.mix)({},e,n,t.style),i=this.getSize(t),o,s,l=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize;l?(0,m.isNumber)(l)?(o=l,s=l):(o=l[0],s=l[1]):(!(0,m.isNumber)(a.width)||isNaN(a.width)?o=i[0]||an.defaultCombo.style.width:o=Math.max(a.width,i[0])||i[0],!(0,m.isNumber)(a.height)||isNaN(a.height)?s=i[1]||an.defaultCombo.style.height:s=Math.max(a.height,i[1])||i[1]);var h=-o/2-r[3],p=-s/2-r[0];a.width=o+r[1]+r[3],a.height=s+r[0]+r[2];var D=(0,b.__assign)({x:h,y:p},a);return t.style?(t.style.width=o,t.style.height=s):t.style={width:o,height:s},D},update:function(t,e){var r=this.getSize(t),n=t.padding||this.options.padding;(0,m.isNumber)(n)&&(n=[n,n,n,n]);var a=(0,m.clone)(t.style),i,o,s=t.collapsed&&t.fixCollapseSize?t.fixCollapseSize:t.fixSize;s?(0,m.isNumber)(s)?(i=s,o=s):(i=s[0],o=s[1]):(i=Math.max(a.width,r[0])||r[0],o=Math.max(a.height,r[1])||r[1]),a.width=i+n[1]+n[3],a.height=o+n[0]+n[2];var l=e.get("sizeCache");l&&(l.width=a.width,l.height=a.height),a.x=-i/2-n[3],a.y=-o/2-n[0];var h={stroke:t.color},p=e.get("keyShape"),D=(0,m.mix)({},p.attr(),h,a);t.style?(t.style.width=i,t.style.height=o):t.style={width:i,height:o},this.updateShape(t,e,D,!1)}},"single-combo"),Cr.registerNode("simple-circle",{options:{size:an.defaultNode.size,style:{x:0,y:0,stroke:an.defaultNode.style.stroke,fill:an.defaultNode.style.fill,lineWidth:an.defaultNode.style.lineWidth},labelCfg:{style:{fill:an.nodeLabel.style.fill,fontSize:an.nodeLabel.style.fontSize,fontFamily:an.windowFontFamily}},stateStyles:(0,b.__assign)({},an.nodeStateStyles)},shapeType:"simple-circle",labelPosition:"center",shapeMap:{},drawShape:function(t,e){var r=this.getShapeStyle(t),n="".concat(this.type,"-keyShape"),a=e.addShape("circle",{attrs:r,className:"".concat(this.type,"-keyShape"),name:n,draggable:!0});return e.shapeMap[n]=a,a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,m.deepMix)({},e,r),a=this.getSize(t),i=a[0]/2,o=(0,b.__assign)({x:0,y:0,r:i},n);return o},update:function(t,e,r){var n=this.getSize(t),a={stroke:t.color,r:n[0]/2},i=e.get("keyShape"),o=(0,m.deepMix)({},i.attr(),a,t.style);this.updateShape(t,e,o,!0,r)}},"single-node"),Cr.registerNode("simple-rect",{options:{size:[100,30],style:{radius:0,stroke:an.defaultNode.style.stroke,fill:an.defaultNode.style.fill,lineWidth:an.defaultNode.style.lineWidth},labelCfg:{style:{fill:an.nodeLabel.style.fill,fontSize:an.nodeLabel.style.fontSize,fontFamily:an.windowFontFamily}},anchorPoints:[[0,.5],[1,.5]],stateStyles:(0,b.__assign)({},an.nodeStateStyles)},shapeType:"simple-rect",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return n},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,m.mix)({},e,r),a=this.getSize(t),i=n.width||a[0],o=n.height||a[1],s=(0,b.__assign)({x:-i/2,y:-o/2,width:i,height:o},n);return s},update:function(t,e,r){var n=e.getContainer(),a=(this.mergeStyle||this.getOptions(t)).style,i=this.getSize(t),o=e.get("keyShape");t.size||(i[0]=o.attr("width")||a.width,i[1]=o.attr("height")||a.height);var s={stroke:t.color,x:-i[0]/2,y:-i[1]/2,width:i[0],height:i[1]},l=(0,m.mix)({},a,o.attr(),s);l=(0,m.mix)(l,t.style),this.updateShape(t,e,l,!1,r)}},"single-node"),Cr.registerNode("image",{options:{img:"https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ",size:200,labelCfg:{style:{fontFamily:an.windowFontFamily}},clipCfg:{show:!1,type:"circle",r:50,rx:50,ry:35,width:50,height:35,points:[[30,12],[12,30],[30,48],[48,30]],path:[["M",25,25],["L",50,25],["A",12.5,12.5,0,1,1,50,50],["A",12.5,12.5,0,1,0,50,50],["L",25,75],["Z"]],x:0,y:0}},shapeType:"image",labelPosition:"bottom",drawShape:function(t,e){var r=this.shapeType,n=this.getShapeStyle(t);delete n.fill;var a=e.addShape(r,{attrs:n,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return this.drawClip(t,a),a},drawClip:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).clipCfg;if(!!r.show){var n=r.type,a=r.x,i=r.y,o=r.style;if(n==="circle"){var s=r.r;e.setClip({type:"circle",attrs:(0,b.__assign)({r:s,x:a,y:i},o)})}else if(n==="rect"){var l=r.width,h=r.height,p=a-l/2,D=i-h/2;e.setClip({type:"rect",attrs:(0,b.__assign)({x:p,y:D,width:l,height:h},o)})}else if(n==="ellipse"){var I=r.rx,F=r.ry;e.setClip({type:"ellipse",attrs:(0,b.__assign)({x:a,y:i,rx:I,ry:F},o)})}else if(n==="polygon"){var Z=r.points;e.setClip({type:"polygon",attrs:(0,b.__assign)({points:Z},o)})}else if(n==="path"){var ee=r.path;e.setClip({type:"path",attrs:(0,b.__assign)({path:ee},o)})}}},getShapeStyle:function(t){var e=this.mergeStyle||this.getOptions(t),r=e.style,n=e.img,a=this.getSize(t),i=a[0],o=a[1];r&&(i=r.width||a[0],o=r.height||a[1]);var s=(0,b.__assign)({x:-i/2,y:-o/2,width:i,height:o,img:n},r);return s},updateShapeStyle:function(t,e){var r=e.getContainer(),n="".concat(this.itemType,"-shape"),a=r.shapeMap[n]||r.find(function(o){return o.get("className")===n})||e.getKeyShape(),i=this.getShapeStyle(t);a&&!a.destroyed&&a.attr(i)}},"single-node");var xc={triangle:function(t,e,r){t===void 0&&(t=10),e===void 0&&(e=15),r===void 0&&(r=0);var n=r*2,a="M ".concat(n,",0 L ").concat(n+e,",-").concat(t/2," L ").concat(n+e,",").concat(t/2," Z");return a},vee:function(t,e,r){t===void 0&&(t=15),e===void 0&&(e=20),r===void 0&&(r=0);var n=r*2,a="M ".concat(n,",0 L ").concat(n+e,",-").concat(t/2,`
  2. L `).concat(n+2*e/3,",0 L ").concat(n+e,",").concat(t/2," Z");return a},circle:function(t,e){t===void 0&&(t=5),e===void 0&&(e=0);var r=e*2,n="M ".concat(r,`, 0
  3. a `).concat(t,",").concat(t," 0 1,0 ").concat(t*2,`,0
  4. a `).concat(t,",").concat(t," 0 1,0 ").concat(-t*2,",0");return n},rect:function(t,e,r){t===void 0&&(t=10),e===void 0&&(e=10),r===void 0&&(r=0);var n=r*2,a="M ".concat(n,",").concat(-t/2,`
  5. L `).concat(n+e,",").concat(-t/2,`
  6. L `).concat(n+e,",").concat(t/2,`
  7. L `).concat(n,",").concat(t/2," Z");return a},diamond:function(t,e,r){t===void 0&&(t=15),e===void 0&&(e=15),r===void 0&&(r=0);var n=r*2,a="M ".concat(n,`,0
  8. L `).concat(n+e/2,",").concat(-t/2,`
  9. L `).concat(n+e,`,0
  10. L `).concat(n+e/2,",").concat(t/2," Z");return a},triangleRect:function(t,e,r,n,a,i){t===void 0&&(t=15),e===void 0&&(e=15),r===void 0&&(r=15),n===void 0&&(n=3),a===void 0&&(a=5),i===void 0&&(i=0);var o=i*2,s=o+e+a,l="M ".concat(o,",0 L ").concat(o+e,",-").concat(t/2," L ").concat(o+e,",").concat(t/2,` Z
  11. M `).concat(s,", -").concat(r/2,`
  12. L `).concat(s+n," -").concat(r/2,`
  13. L `).concat(s+n," ").concat(r/2,`
  14. L `).concat(s," ").concat(r/2,`
  15. Z`);return l}},Su={collapse:function(t,e,r){return[["M",t-r,e],["a",r,r,0,1,0,r*2,0],["a",r,r,0,1,0,-r*2,0],["M",t-r+4,e],["L",t+r-4,e]]},expand:function(t,e,r){return[["M",t-r,e],["a",r,r,0,1,0,r*2,0],["a",r,r,0,1,0,-r*2,0],["M",t-r+4,e],["L",t-r+2*r-4,e],["M",t-r+r,e-r+4],["L",t,e+r-4]]},upTriangle:function(t,e,r){var n=r*Math.cos(Math.PI/6),a=r*Math.sin(Math.PI/6);return[["M",t-n,e+a],["L",t+n,e+a],["L",t,e-r],["Z"]]},downTriangle:function(t,e,r){var n=r*Math.cos(Math.PI/6),a=r*Math.sin(Math.PI/6);return[["M",t-n,e-a],["L",t+n,e-a],["L",t,e+r],["Z"]]}},jo=Cr,ol=["#5F95FF","#61DDAA","#65789B","#F6BD16","#7262FD","#78D3F8","#9661BC","#F6903D","#008685","#F08BB4"],_u=function(t){return t==="force"||t==="g6force"||t==="gForce"||t==="force2"},sl=q.vs,ul=(0,b.__assign)((0,b.__assign)((0,b.__assign)((0,b.__assign)((0,b.__assign)((0,b.__assign)((0,b.__assign)({},A),R),N),j),L),y),{transform:sl,mat3:mi}),ki=ul,fl=function(){function c(t){this.graph=t,this.layoutCfg=t.get("layout")||{},this.layoutType=this.getLayoutType(),this.layoutMethods=[],this.initLayout()}return c.prototype.initLayout=function(){},c.prototype.getLayoutType=function(){return this.getLayoutCfgType(this.layoutCfg)},c.prototype.getLayoutCfgType=function(t){var e=t.type;if(e)return e;var r=t.pipes;return Array.isArray(r)?r.map(function(n){return(n==null?void 0:n.type)||""}):null},c.prototype.isLayoutTypeSame=function(t){var e=this.getLayoutCfgType(t),r=Array.isArray(this.layoutType),n=Array.isArray(e);return r&&n?this.layoutType.every(function(a,i){return a===e[i]}):Array.isArray(e)||Array.isArray(this.layoutType)?!1:(t==null?void 0:t.type)===this.layoutType},c.prototype.refreshLayout=function(){var t=this,e=t.graph,r=t.layoutType,n=t.layoutCfg,a=n===void 0?{}:n;if(!!e){var i=a.animate,o=i===void 0&&(r==="force"||r==="force2"),s=_u(r)&&(i||o);e.get("animate")&&!s?e.positionsAnimate(r==="comboCombined"):e.refreshPositions(r==="comboCombined")}},c.prototype.changeLayout=function(t){var e=t.disableTriggerLayout,r=(0,b.__rest)(t,["disableTriggerLayout"]);this.layoutCfg=r,this.layoutType=r.type||this.layoutType,!e&&this.layout()},c.prototype.changeData=function(t){this.layout(t)},c.prototype.destoryLayoutMethods=function(){var t=this.layoutMethods,e=[];return t==null||t.forEach(function(r){var n,a=(n=r.getType)===null||n===void 0?void 0:n.call(r);a&&e.push(a),r.destroy()}),this.layoutMethods=[],e},c.prototype.destroyLayout=function(){this.destoryLayoutMethods();var t=this.graph;t&&!t.get("destroyed")&&t.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0},c.prototype.setDataFromGraph=function(){for(var t,e=[],r=[],n=[],a=[],i=[],o=[],s=[],l=this.graph.getNodes(),h=this.graph.getEdges(),p=this.graph.getCombos(),D=l.length,I=0;I<D;I++){var F=l[I];if(!(!F||F.destroyed)){var Z=F.getModel();if(!F.isVisible()){r.push(Z);continue}e.push(Z)}}for(var ee=h.length,I=0;I<ee;I++){var se=h[I];if(!(!se||se.destroyed)){var Z=se.getModel();if(!se.isVisible()){a.push(Z);continue}Z.isComboEdge?i.push(Z):n.push(Z)}}for(var oe=p.length,I=0;I<oe;I++){var ce=p[I];if(!ce.destroyed){var Z=ce.getModel();if(!ce.isVisible()){s.push(Z);continue}o.push(Z)}}return{nodes:e,hiddenNodes:r,edges:n,hiddenEdges:a,combos:o,hiddenCombos:s,comboEdges:i,vedges:(t=this.graph.get("vedges"))===null||t===void 0?void 0:t.map(function(we){return we.getModel()})}},c.prototype.relayout=function(t){var e=this,r=this,n=r.graph,a=r.layoutMethods,i=r.layoutCfg;if(!(!n||n.get("destroyed"))){var o=Promise.resolve();if(t){this.data=this.setDataFromGraph();var s=this.data.nodes;if(!s)return!1;o=this.initPositions(i.center,s)}n.emit("beforelayout"),a==null||a.forEach(function(l,h){var p=i[h]||i;o=o.then(function(){var D,I=e.execLayoutMethod(p,h);return h===a.length-1&&((D=i.onAllLayoutEnd)===null||D===void 0||D.call(i)),I})})}},c.prototype.filterLayoutData=function(t,e){var r=t.nodes,n=t.edges,a=(0,b.__rest)(t,["nodes","edges"]);if(!r)return t;var i,o;(0,m.isFunction)(e==null?void 0:e.nodesFilter)?i=e.nodesFilter:i=function(){return!0};var s=r.filter(i);if((0,m.isFunction)(e==null?void 0:e.edgesFilter))o=e.edgesFilter;else{var l=s.reduce(function(h,p){return h[p.id]=!0,h},{});o=function(p){return l[p.source]&&l[p.target]}}return(0,b.__assign)({nodes:s,edges:n.filter(o)},a)},c.prototype.getLayoutBBox=function(t){var e=this.graph,r=(0,m.groupBy)(e.getNodes(),function(i){return i.getModel().layoutOrder}),n=Object.values(r).map(function(i){var o=$u(i);return o.size=[o.width,o.height],o}),a=Object.values((0,m.groupBy)(t,"layoutOrder"));return{groupNodes:a,layoutNodes:n}},c.prototype.layoutAnimate=function(){},c.prototype.moveToZero=function(){var t=this.graph,e=t.get("data"),r=e.nodes;if(!(r[0].x===void 0||r[0].x===null||xo(r[0].x))){for(var n=[0,0],a=r.length,i=0;i<a;i++){var o=r[i];n[0]+=o.x,n[1]+=o.y}n[0]/=r.length,n[1]/=r.length;for(var i=0;i<a;i++){var o=r[i];o.x-=n[0],o.y-=n[1]}}},c.prototype.initPositions=function(t,e){var r;return(0,b.__awaiter)(this,void 0,void 0,function(){var n,a,i;return(0,b.__generator)(this,function(o){return n=this.graph,(e==null?void 0:e.length)?(a=e.filter(function(s){return xo(s.x)||xo(s.y)}),i=a?a.length:0,i?[2,(r=this.initWithPreset)===null||r===void 0?void 0:r.call(this,function(){},function(){var s=n.get("width")*.85,l=n.get("height")*.85,h=Math.ceil(Math.sqrt(i)*(s/l)),p=Math.ceil(i/h),D=s/(h-1),I=l/(p-1);(!isFinite(D)||!D)&&(D=0),(!isFinite(I)||!D)&&(I=0);for(var F=t[0]-s/2,Z=t[1]-l/2,ee=!0,se=0;se<i;se++){var oe=a[se];xo(+oe.x)&&(ee=!1,oe.x=se%h*D+F),xo(+oe.y)&&(ee=!1,oe.y=Math.floor(se/h)*I+Z)}})]:[2]):[2,Promise.resolve()]})})},c.prototype.destroy=function(){this.graph=null,this.destoryLayoutMethods(),this.destroyed=!0},c}(),wc=fl,Mu=function(){function c(t){this.graph=t,this.destroyed=!1,this.initEvents()}return c}(),ff=Mu,To=jo.registerNode,Sc=jo.registerEdge,qs=jo.registerCombo,Ns=H.registerBehavior,Kr=an,Cu={version:an.version,AbstractGraph:Bf,BaseGlobal:Kr,Util:ki,Shape:jo,Node:ha,Edge:$a,Combo:Tf,Hull:Rf,registerNode:jo.registerNode,registerEdge:jo.registerEdge,registerCombo:jo.registerCombo,registerBehavior:H.registerBehavior,Arrow:xc,Marker:Su,AbstractLayout:wc,AbstractEvent:ff},_c=z(10369),so=z(70375),Ps=z(71597),zf=z(6767),ks=z.n(zf),eu=z(21997),tu=2,Tu=.16,Mc=.05,Cc=.05,Tc=.15,Uf=5,Wf=4,jf=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function cf(c,t,e){var r;return Math.round(c.h)>=60&&Math.round(c.h)<=240?r=e?Math.round(c.h)-tu*t:Math.round(c.h)+tu*t:r=e?Math.round(c.h)+tu*t:Math.round(c.h)-tu*t,r<0?r+=360:r>=360&&(r-=360),r}function Xf(c,t,e){if(c.h===0&&c.s===0)return c.s;var r;return e?r=c.s-Tu*t:t===Wf?r=c.s+Tu:r=c.s+Mc*t,r>1&&(r=1),e&&t===Uf&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function Vf(c,t,e){var r;return e?r=c.v+Cc*t:r=c.v-Tc*t,r>1&&(r=1),Number(r.toFixed(2))}function Iu(c){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=[],r=(0,eu.Z)(c),n=Uf;n>0;n-=1){var a=r.toHsv(),i=(0,eu.Z)({h:cf(a,n,!0),s:Xf(a,n,!0),v:Vf(a,n,!0)}).toHexString();e.push(i)}e.push(r.toHexString());for(var o=1;o<=Wf;o+=1){var s=r.toHsv(),l=(0,eu.Z)({h:cf(s,o),s:Xf(s,o),v:Vf(s,o)}).toHexString();e.push(l)}return t.theme==="dark"?jf.map(function(h){var p=h.index,D=h.opacity,I=eu.Z.mix(t.backgroundColor||"#141414",e[p],D*100).toHexString();return I}):e}var Rs={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Oi={},gt={};Object.keys(Rs).forEach(function(c){Oi[c]=Iu(Rs[c]),Oi[c].primary=Oi[c][5],gt[c]=Iu(Rs[c],{theme:"dark",backgroundColor:"#141414"}),gt[c].primary=gt[c][5]});var cl=Oi.red,Ou=Oi.volcano,Yf=Oi.gold,ll=Oi.orange,Ic=Oi.yellow,dl=Oi.lime,hl=Oi.green,lf=Oi.cyan,Hf=Oi.blue,Oc=Oi.geekblue,Zf=Oi.purple,Mi=Oi.magenta,Au=Oi.grey,gi=function(t,e,r){var n=ks()(t),a=ks()(e);return ks()([(1-r)*n.red()+r*a.red(),(1-r)*n.green()+r*a.green(),(1-r)*n.blue()+r*a.blue()]).rgb()},Lu=function(t,e,r){e===void 0&&(e="#fff"),r===void 0&&(r="rgb(150, 150, 150)");var n=gi(e,t,.05).rgb().toString(),a=gi(e,t,.1).rgb().toString(),i=gi(e,t,.2).rgb().toString(),o=gi(e,t,.4).rgb().toString(),s=gi(e,r,.02).rgb().toString(),l=gi(e,r,.05).rgb().toString(),h=gi(e,r,.1).rgb().toString(),p=gi(e,r,.2).rgb().toString(),D=gi(e,r,.3).rgb().toString(),I=Iu(t,{theme:"default",backgroundColor:e}),F=ks()(t).hex().toLowerCase(),Z=I.indexOf(F),ee=t;return Z!==-1&&(ee=I[Z+1]),{mainStroke:t,mainFill:a,activeStroke:t,activeFill:n,inactiveStroke:o,inactiveFill:n,selectedStroke:t,selectedFill:e,highlightStroke:ee,highlightFill:i,disableStroke:D,disableFill:l,edgeMainStroke:D,edgeActiveStroke:t,edgeInactiveStroke:p,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:h,comboMainStroke:D,comboMainFill:s,comboActiveStroke:t,comboActiveFill:n,comboInactiveStroke:D,comboInactiveFill:s,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:ee,comboHighlightFill:s,comboDisableStroke:p,comboDisableFill:l}},Xo=function(t,e,r){e===void 0&&(e="#fff"),r===void 0&&(r="#777");var n=gi(e,t,.2).rgb().toString(),a=gi(e,t,.3).rgb().toString(),i=gi(e,t,.6).rgb().toString(),o=gi(e,t,.8).rgb().toString(),s=gi(e,r,.2).rgb().toString(),l=gi(e,r,.25).rgb().toString(),h=gi(e,r,.3).rgb().toString(),p=gi(e,r,.4).rgb().toString(),D=gi(e,r,.5).rgb().toString(),I=Iu(t,{theme:"dark",backgroundColor:e}),F=ks()(t).hex().toLowerCase(),Z=I.indexOf(F),ee=t;return Z!==-1&&(ee=I[Z+1]),{mainStroke:o,mainFill:n,activeStroke:t,activeFill:a,inactiveStroke:o,inactiveFill:n,selectedStroke:t,selectedFill:n,highlightStroke:t,highlightFill:i,disableStroke:D,disableFill:l,edgeMainStroke:r,edgeActiveStroke:t,edgeInactiveStroke:r,edgeSelectedStroke:t,edgeHighlightStroke:t,edgeDisableStroke:h,comboMainStroke:p,comboMainFill:l,comboActiveStroke:t,comboActiveFill:s,comboInactiveStroke:p,comboInactiveFill:l,comboSelectedStroke:t,comboSelectedFill:s,comboHighlightStroke:ee,comboHighlightFill:l,comboDisableStroke:p,comboDisableFill:s}},vs=function(t,e,r,n){return e===void 0&&(e="#fff"),r===void 0&&(r="default"),n===void 0&&(n="rgb(150, 150, 150)"),r==="default"?Lu(t,e,"rgb(150, 150, 150)"):Xo(t,e,"#777")},Bs=function(t,e,r,n){e===void 0&&(e="#fff"),r===void 0&&(r="default"),n===void 0&&(n="rgb(150, 150, 150)");var a=[];return t.forEach(function(i){a.push(vs(i,e,r,n))}),a},gs="rgb(95, 149, 255)",ru="rgb(255, 255, 255)",ps="rgb(0, 0, 0)",ra=vs(gs,ru),wo={version:"0.8.9",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",delegateContainerClassName:"delegate-container",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#000",fontSize:12,textAlign:"center",textBaseline:"middle"},offset:4},defaultNode:{type:"circle",style:{lineWidth:1,stroke:ra.mainStroke,fill:ra.mainFill},size:20,color:ra.mainStroke,linkPoints:{size:8,lineWidth:1,fill:ra.activeFill,stroke:ra.activeStroke}},nodeStateStyles:{active:{fill:ra.activeFill,stroke:ra.activeStroke,lineWidth:2,shadowColor:ra.mainStroke,shadowBlur:10},selected:{fill:ra.selectedFill,stroke:ra.selectedStroke,lineWidth:4,shadowColor:ra.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:ra.highlightFill,stroke:ra.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:ra.inactiveFill,stroke:ra.inactiveStroke,lineWidth:1},disable:{fill:ra.disableFill,stroke:ra.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:ps,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:ra.edgeMainStroke,lineAppendWidth:2},color:ra.edgeMainStroke},edgeStateStyles:{active:{stroke:ra.edgeActiveStroke,lineWidth:1},selected:{stroke:ra.edgeSelectedStroke,lineWidth:2,shadowColor:ra.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:ra.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:ra.edgeInactiveStroke,lineWidth:1},disable:{stroke:ra.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:ps,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:ra.comboMainFill,lineWidth:1,stroke:ra.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:ra.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:ra.comboActiveStroke,lineWidth:1,fill:ra.comboActiveFill},selected:{stroke:ra.comboSelectedStroke,lineWidth:2,fill:ra.comboSelectedFill,shadowColor:ra.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:ra.comboHighlightStroke,lineWidth:2,fill:ra.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:ra.comboInactiveStroke,fill:ra.comboInactiveFill,lineWidth:1},disable:{stroke:ra.comboDisableStroke,fill:ra.comboDisableFill,lineWidth:1}},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]},textWaterMarkerConfig:{width:150,height:100,compatible:!1,text:{x:0,y:60,lineHeight:20,rotate:20,fontSize:14,fontFamily:"Microsoft YaHei",fill:"rgba(0, 0, 0, 0.1)",baseline:"Middle"}},imageWaterMarkerConfig:{width:150,height:130,compatible:!1,image:{x:0,y:0,width:30,height:20,rotate:0}},waterMarkerImage:"https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg"},Fs=z(57817),df=ki.cloneEvent,Du=ki.isViewportChanged,Kf=function(c){(0,b.__extends)(t,c);function t(e){var r=c.call(this,e)||this;return r.extendEvents=[],r.dragging=!1,r.mousedown=!1,r.preItem=null,r.destroy(),r.graph=e,r.destroyed=!1,r.initEvents(),r}return t.prototype.initEvents=function(){var e=this,r=e.graph,n=e.extendEvents,a=n===void 0?[]:n,i=r.get("canvas"),o=i.get("el"),s=(0,m.wrapBehavior)(this,"onCanvasEvents"),l=(0,m.wrapBehavior)(this,"onExtendEvents"),h=(0,m.wrapBehavior)(this,"onWheelEvent");i.off("*").on("*",s),this.canvasHandler=s,a.push((0,Fs.Z)(o,"wheel",h)),typeof window!="undefined"&&(a.push((0,Fs.Z)(window,"keydown",l)),a.push((0,Fs.Z)(window,"keyup",l)),a.push((0,Fs.Z)(window,"focus",l))),this.resetHandler&&r.off("afterchangedata",this.resetHandler),this.resetHandler=(0,m.wrapBehavior)(this,"resetStatus"),r.on("afterchangedata",this.resetHandler)},t.getItemRoot=function(e){for(;e&&!e.get("item");)e=e.get("parent");return e},t.prototype.onCanvasEvents=function(e){var r=this,n=this.graph,a=n.get("canvas"),i=e.target,o=e.type;switch(o){case"drag":this.onCanvasEvents(Object.assign({},e,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},e,{type:"mouseup"}));break;case"mousedown":this.mousedown=!0;break;case"dragend":case"mouseup":setTimeout(function(){return r.mousedown=!1});break;case"click":if(!this.mousedown)return;break;default:break}e.canvasX=e.x,e.canvasY=e.y;var s={x:e.canvasX,y:e.canvasY},l=n.get("group"),h=l.getMatrix();if(h||(h=[1,0,0,0,1,0,0,0,1]),Du(h)&&(s=n.getPointByClient(e.clientX,e.clientY)),e.x=s.x,e.y=s.y,e.currentTarget=n,i===a){(o==="mousemove"||o==="mouseleave")&&this.handleMouseMove(e,"canvas"),e.target=a,e.item=null,n.emit(o,e),n.emit("canvas:".concat(o),e);return}var p=t.getItemRoot(i);if(!p){n.emit(o,e);return}var D=p.get("item");if(!D.destroyed){var I=D.getType();if(e.target=i,e.item=D,e.canvasX===e.x&&e.canvasY===e.y){var F=n.getCanvasByPoint(e.x,e.y);e.canvasX=F.x,e.canvasY=F.y}e.name&&!e.name.includes(":")?(n.emit("".concat(I,":").concat(o),e),n.emit(o,e)):e.name&&n.emit(e.name,e),o==="dragstart"&&(this.dragging=!0),o==="dragend"&&(this.dragging=!1),o==="mousemove"&&this.handleMouseMove(e,I)}},t.prototype.onExtendEvents=function(e){this.graph.emit(e.type,e)},t.prototype.onWheelEvent=function(e){(0,m.isNil)(e.wheelDelta)&&(e.wheelDelta=-e.detail),this.graph.emit("wheel",e)},t.prototype.handleMouseMove=function(e,r){var n=this,a=n.graph,i=n.preItem,o=a.get("canvas"),s=e.target===o?null:e.item;e=df(e),i&&i!==s&&!i.destroyed&&(e.item=i,this.emitCustomEvent(i.getType(),"mouseleave",e),this.dragging&&this.emitCustomEvent(i.getType(),"dragleave",e)),s&&i!==s&&(e.item=s,this.emitCustomEvent(r,"mouseenter",e),this.dragging&&this.emitCustomEvent(r,"dragenter",e)),this.preItem=s},t.prototype.emitCustomEvent=function(e,r,n){n.type=r,this.graph.emit("".concat(e,":").concat(r),n)},t.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},t.prototype.destroy=function(){var e=this,r=e.graph,n=e.canvasHandler,a=e.extendEvents,i=r.get("canvas");i.off("*",n),(0,m.each)(a,function(o){o.remove()}),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},t}(ff),$f=Kf,ea=z(67320),Io=z(81746),nu=z.n(Io),Qf=ki.traverseTree,hf=function(t,e){var r;return t?(0,m.isNumber)(t)?r=function(a){return t}:r=t:r=function(a){return e||1},r},Jf=function(t,e){var r=[],n=[],a={},i=0;for(i=0;i<t.length;i++){var o=t[i];a[o.id]=i,r.push(o.x),r.push(o.y),r.push(0),r.push(0),n.push([])}for(i=0;i<e.length;i++){var s=e[i];n[a[s.source]].push(a[s.target]),n[a[s.target]].push(a[s.source])}var l=0;for(i=0;i<t.length;i++){var h=r.length,p=n[i],D=p.length;r[i*4+2]=h,r[i*4+3]=p.length,l=Math.max(l,p.length);for(var I=0;I<D;++I){var F=p[I];r.push(+F)}}for(;r.length%4!=0;)r.push(0);return{array:new Float32Array(r),maxEdgePerVetex:l}},qf=function(t,e,r){var n=[],a=[],i={},o=0;for(o=0;o<t.length;o++){var s=t[o];i[s.id]=o,n.push(s.x),n.push(s.y),n.push(0),n.push(0),a.push([])}for(o=0;o<e.length;o++){var l=e[o];a[i[l.source]].push(i[l.target]),a[i[l.source]].push(r(l)),a[i[l.target]].push(i[l.source]),a[i[l.target]].push(r(l))}var h=0;for(o=0;o<t.length;o++){var p=n.length,D=a[o],I=D.length;n[o*4+2]=p,n[o*4+3]=I/2,h=Math.max(h,I/2);for(var F=0;F<I;++F){var Z=D[F];n.push(+Z)}}for(;n.length%4!=0;)n.push(0);return{array:new Float32Array(n),maxEdgePerVetex:h}},Ac=function(t,e,r,n){var a=[],i=[],o={},s=0;for(s=0;s<t.length;s++){var l=t[s];o[l.id]=s,a.push(l.x),a.push(l.y),a.push(0),a.push(0),i.push([])}for(s=0;s<e.length;s++){var h=e[s];i[o[h.source]].push(o[h.target]),i[o[h.source]].push(r(h)),i[o[h.source]].push(n(h)),i[o[h.source]].push(0),i[o[h.target]].push(o[h.source]),i[o[h.target]].push(r(h)),i[o[h.target]].push(n(h)),i[o[h.target]].push(0)}var p=0;for(s=0;s<t.length;s++){var D=a.length,I=i[s],F=I.length;a[s*4+2]=D+1048576*F/4,a[s*4+3]=0,p=Math.max(p,F/4);for(var Z=0;Z<F;++Z){var ee=I[Z];a.push(+ee)}}for(;a.length%4!=0;)a.push(0);return{array:new Float32Array(a),maxEdgePerVetex:p}},Gs=function(t,e){var r=[],n=t.length,a={};return e.forEach(function(i){t.forEach(function(o,s){if(a[i[o]]===void 0&&(a[i[o]]=Object.keys(a).length),r.push(a[i[o]]),s===n-1)for(;r.length%4!=0;)r.push(0)})}),{array:new Float32Array(r),count:Object.keys(a).length}},Lc=function(t){for(var e=[],r=t.length,n=t[0].length,a=function(s){t.forEach(function(l,h){if(e.push(l[s]),h===r-1)for(;e.length%4!=0;)e.push(0)})},i=0;i<n;i++)a(i);return new Float32Array(e)},Dc=function(t,e){var r=["V","TB","BT"],n={x:Infinity,y:Infinity},a={x:-Infinity,y:-Infinity},i="x",o="y";e&&r.indexOf(e)>=0&&(o="x",i="y");var s=0;Qf(t,function(p){return s++,p.x>a.x&&(a.x=p.x),p.x<n.x&&(n.x=p.x),p.y>a.y&&(a.y=p.y),p.y<n.y&&(n.y=p.y),!0});var l=Math.PI*2/s,h=a[o]-n[o];return h===0||Qf(t,function(p){var D=(p[o]-n[o])/h*(Math.PI*2-l)+l,I=Math.abs(i==="x"?p.x-t.x:p.y-t.y);return p.x=I*Math.cos(D),p.y=I*Math.sin(D),!0}),t},Nc=function c(){return typeof window=="undefined"||typeof document=="undefined"?{}:{canvas:!!window.CanvasRenderingContext2D,webgl:function(){try{var t=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(t.getContext("webgl")||t.getContext("experimental-webgl")))}catch(e){return!1}}(),workers:!!window.Worker,fileapi:window.File&&window.FileReader&&window.FileList&&window.Blob,getWebGLErrorMessage:function(){var e=document.createElement("div");return e.id="webgl-error-message",e.style.fontFamily="monospace",e.style.fontSize="13px",e.style.fontWeight="normal",e.style.textAlign="center",e.style.background="#fff",e.style.color="#000",e.style.padding="1.5em",e.style.width="400px",e.style.margin="5em auto 0",this.webgl||(e.innerHTML=window.WebGLRenderingContext?['Your graphics card does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br />','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join(`
  16. `):['Your browser does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" rel="external nofollow" rel="external nofollow" style="color:#000">WebGL</a>.<br/>','Find out how to get it <a href="http://get.webgl.org/" rel="external nofollow" rel="external nofollow" style="color:#000">here</a>.'].join(`
  17. `)),e},addGetWebGLMessage:function(e){e=e||{};var r=e.parent!==void 0?e.parent:document.body,n=e.id!==void 0?e.id:"oldie",a=c().getWebGLErrorMessage();a.id=n,r.appendChild(a)}}},Pc=(0,b.__assign)((0,b.__assign)((0,b.__assign)((0,b.__assign)({},ki),x),v),g),Vo=Pc,vl=Vo.radialLayout,kc=function(){function c(t){this.type=t.type,this.radial=t.radial,this.config=t}return c.prototype.init=function(t){var e=this;if(this.data=t,this.radial){this.layoutMethod=function(r){var n=nu()[e.type](r,e.config);return vl(n),n};return}this.layoutMethod=function(r){return nu()[e.type](r,e.config)}},c.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},c.prototype.layout=function(t){return this.init(t),this.execute()},c}(),Rc=kc;(0,ea.registerLayout)("grid",ea.GridLayout),(0,ea.registerLayout)("random",ea.RandomLayout),(0,ea.registerLayout)("force",ea.ForceLayout),(0,ea.registerLayout)("circular",ea.CircularLayout),(0,ea.registerLayout)("dagre",ea.DagreLayout),(0,ea.registerLayout)("dagreCompound",ea.DagreCompoundLayout),(0,ea.registerLayout)("radial",ea.RadialLayout),(0,ea.registerLayout)("concentric",ea.ConcentricLayout),(0,ea.registerLayout)("mds",ea.MDSLayout),(0,ea.registerLayout)("fruchterman",ea.FruchtermanLayout),(0,ea.registerLayout)("fruchterman-gpu",ea.FruchtermanGPULayout),(0,ea.registerLayout)("gForce",ea.GForceLayout),(0,ea.registerLayout)("force2",ea.Force2Layout),(0,ea.registerLayout)("gForce-gpu",ea.GForceGPULayout),(0,ea.registerLayout)("comboForce",ea.ComboForceLayout),(0,ea.registerLayout)("comboCombined",ea.ComboCombinedLayout),(0,ea.registerLayout)("forceAtlas2",ea.ForceAtlas2Layout);var gl=function(t,e){e.isCustomLayout=!0,ea.Layouts[t]=(0,ea.registerLayout)(t,e)},Bc=function(){function c(t,e){var r=t.toString(),n=new Blob(["importScripts('".concat(e,"');(").concat(r,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(n))}return c}(),Fc=Bc,Gc=function(t){t===void 0&&(t="https://unpkg.com/@antv/layout@latest/dist/layout.min.js");function e(){var n={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};layout.registerLayout("grid",layout.GridLayout),layout.registerLayout("random",layout.RandomLayout),layout.registerLayout("force",layout.ForceLayout),layout.registerLayout("force2",layout.Force2Layout),layout.registerLayout("circular",layout.CircularLayout),layout.registerLayout("dagre",layout.DagreLayout),layout.registerLayout("dagreCompound",layout.DagreCompoundLayout),layout.registerLayout("radial",layout.RadialLayout),layout.registerLayout("concentric",layout.ConcentricLayout),layout.registerLayout("mds",layout.MDSLayout),layout.registerLayout("fruchterman",layout.FruchtermanLayout),layout.registerLayout("fruchterman-gpu",layout.FruchtermanGPULayout),layout.registerLayout("gForce",layout.GForceLayout),layout.registerLayout("gForce-gpu",layout.GForceGPULayout),layout.registerLayout("comboForce",layout.ComboForceLayout),layout.registerLayout("comboCombined",layout.ComboCombinedLayout),layout.registerLayout("forceAtlas2",layout.ForceAtlas2Layout);function a(o){var s=o.data.type;return s===n.RUN||s===n.GPURUN}function i(o){var s=this,l=o.data.type;switch(l){case n.RUN:{var h=o.data,p=h.nodes,D=h.edges,I=h.layoutCfg,F=I===void 0?{}:I,Z=F.type,ee=layout.getLayoutByName(Z);if(!ee){this.postMessage({type:n.ERROR,message:"layout ".concat(Z," not found")});break}var se;F.onLayoutEnd=function(){s.postMessage({type:n.END,nodes:p}),se==null||se.destroy()},se=new ee(F),se.init({nodes:p,edges:D}),se.execute();break}case n.GPURUN:{var oe=o.data,ce=oe.nodes,D=oe.edges,we=oe.layoutCfg,F=we===void 0?{}:we,Re=oe.canvas,Z=F.type,ee=layout.getLayoutByName(Z);if(!ee){this.postMessage({type:n.ERROR,message:"layout ".concat(Z," not found")});break}if(Z.split("-")[1]!=="gpu"){this.postMessage({type:n.ERROR,message:"layout ".concat(Z," does not support GPU")});break}var Oe=new ee(F);Oe.init({nodes:ce,edges:D}),Oe.executeWithWorker(Re,this);break}default:break}}onmessage=function(s){a(s)&&i(s)}}var r=new Fc(e,t);return r},zs={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};function Nu(c){return Nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nu(c)}var au=function(t){return setTimeout(t,16)},Pu=function(t){return clearTimeout(t)},Us={requestAnimationFrame:function(t){var e=typeof window!="undefined"&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||au;return e(t)},cancelAnimationFrame:function(t){var e=typeof window!="undefined"&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||Pu;return e(t)}},vf=["fruchterman","gForce"],ec=["force","grid","circular"],gf=function(c){(0,b.__extends)(t,c);function t(e){var r=c.call(this,e)||this;return r.graph=e,r.layoutCfg=e.get("layout")||{},r.layoutType=r.getLayoutType(),r.worker=null,r.workerData={},r.initLayout(),r}return t.prototype.initLayout=function(){},t.prototype.getWorker=function(){return this.worker?this.worker:(typeof Worker=="undefined"?(console.warn("Web worker is not supported in current browser."),this.worker=null):this.worker=Gc(this.layoutCfg.workerScriptURL),this.worker)},t.prototype.stopWorker=function(){var e=this.workerData;!this.worker||(this.worker.terminate(),this.worker=null,e.requestId&&(Us.cancelAnimationFrame(e.requestId),e.requestId=null),e.requestId2&&(Us.cancelAnimationFrame(e.requestId2),e.requestId2=null))},t.prototype.execLayoutMethod=function(e,r){var n=this;return new Promise(function(a,i){return(0,b.__awaiter)(n,void 0,void 0,function(){var o,s,l,h,p,D,I,F,Z,D,ee;return(0,b.__generator)(this,function(se){switch(se.label){case 0:if(o=this.graph,!o||o.get("destroyed"))return[2];s=e.type,e.onLayoutEnd=function(){o.emit("aftersublayout",{type:s}),a()},s&&this.isGPU&&(ku(s)?s="".concat(s,"-gpu"):console.warn("The '".concat(s,"' layout does not support GPU calculation for now, it will run in CPU."))),ki.isForce(s)?(l=e.onTick,h=e.animate,p=h===void 0&&(s==="force"||s==="force2"),D=function(){l&&l(),(h||p)&&o.refreshPositions()},e.tick=D):(s==="comboForce"||s==="comboCombined")&&(e.comboTrees=o.get("comboTrees")),I=!1;try{F=new ea.Layouts[s](e),this.layoutMethods[r]&&this.layoutMethods[r].destroy(),this.layoutMethods[r]=F}catch(oe){console.warn("The layout method: '".concat(s,"' does not exist! Please specify it first.")),i()}return I=F.enableTick,I&&(Z=e.onTick,D=function(){Z&&Z(),o.refreshPositions()},F.tick=D),ee=this.filterLayoutData(this.data,e),mf(ee,r),F.init(ee),o.emit("beforesublayout",{type:s}),[4,F.execute()];case 1:return se.sent(),F.isCustomLayout&&e.onLayoutEnd&&e.onLayoutEnd(),[2]}})})})},t.prototype.updateLayoutMethod=function(e,r){var n=this;return new Promise(function(a,i){return(0,b.__awaiter)(n,void 0,void 0,function(){var o,s,l;return(0,b.__generator)(this,function(h){switch(h.label){case 0:return o=this.graph,s=r==null?void 0:r.type,r.onLayoutEnd=function(){o.emit("aftersublayout",{type:s}),a()},l=this.filterLayoutData(this.data,r),e.init(l),e.updateCfg(r),o.emit("beforesublayout",{type:s}),[4,e.execute()];case 1:return h.sent(),e.isCustomLayout&&r.onLayoutEnd&&r.onLayoutEnd(),[2]}})})})},t.prototype.layout=function(e){var r=this,n,a=this.graph;if(!(!a||a.get("destroyed"))){this.data=this.setDataFromGraph();var i=this.data,o=i.nodes,s=i.hiddenNodes;if(!o)return!1;var l=a.get("width"),h=a.get("height"),p={};Object.assign(p,{width:l,height:h,center:[l/2,h/2]},this.layoutCfg),this.layoutCfg=p;var D=p.type,I=!1;(n=this.layoutMethods)===null||n===void 0||n.forEach(function(Re){var Oe;return I=!!((Oe=Re.nodes)===null||Oe===void 0?void 0:Oe.length)||I});var F=this.destoryLayoutMethods();a.emit("beforelayout");var Z=Promise.resolve();I&&D&&(F==null?void 0:F.length)===1&&F[0]===D?this.tweakInit():Z=this.initPositions(p.center,o);var ee=this.initPositions(p.center,s);ee.then(),this.isGPU=iu(p,D);var se=p.onLayoutEnd,oe=p.layoutEndFormatted,ce=p.adjust;if(oe||(p.layoutEndFormatted=!0,p.onAllLayoutEnd=function(){return(0,b.__awaiter)(r,void 0,void 0,function(){return(0,b.__generator)(this,function(Re){switch(Re.label){case 0:return se&&se(o),this.refreshLayout(),ce&&p.pipes?[4,this.adjustPipesBox(this.data,ce)]:[3,2];case 1:Re.sent(),this.refreshLayout(),Re.label=2;case 2:return a.emit("afterlayout"),[2]}})})}),this.stopWorker(),p.workerEnabled&&this.layoutWithWorker(this.data,e))return!0;var we=!1;return p.type?(we=!0,Z=Z.then(function(){return(0,b.__awaiter)(r,void 0,void 0,function(){return(0,b.__generator)(this,function(Re){switch(Re.label){case 0:return[4,this.execLayoutMethod(p,0)];case 1:return[2,Re.sent()]}})})})):p.pipes&&(we=!0,p.pipes.forEach(function(Re,Oe){Z=Z.then(function(){return(0,b.__awaiter)(r,void 0,void 0,function(){return(0,b.__generator)(this,function(Pe){switch(Pe.label){case 0:return[4,this.execLayoutMethod(Re,Oe)];case 1:return[2,Pe.sent()]}})})})})),we?Z.then(function(){p.onAllLayoutEnd&&p.onAllLayoutEnd(),e&&e()}).catch(function(Re){console.warn("graph layout failed,",Re)}):(a.refreshPositions(),e==null||e()),!1}},t.prototype.tweakInit=function(){var e=this,r=e.data,n=e.graph,a=r.nodes,i=r.edges;if(!!(a==null?void 0:a.length)){var o={};a.forEach(function(h){var p=h.x,D=h.y;!isNaN(p)&&!isNaN(D)&&(o[h.id]={x:p,y:D},h.mass=h.mass||2)}),i.forEach(function(h){var p=h.source,D=h.target,I=o[p],F=o[D];!I&&F?o[p]={x:F.x+(Math.random()-.5)*80,y:F.y+(Math.random()-.5)*80}:!F&&I&&(o[D]={x:I.x+(Math.random()-.5)*80,y:I.y+(Math.random()-.5)*80})});var s=n.get("width"),l=n.get("height");a.forEach(function(h){var p=o[h.id]||{x:s/2+(Math.random()-.5)*20,y:l/2+(Math.random()-.5)*20};h.x=p.x,h.y=p.y})}},t.prototype.initWithPreset=function(e,r){var n=this;return new Promise(function(a,i){return(0,b.__awaiter)(n,void 0,void 0,function(){var o,s,l,h,p,D,I;return(0,b.__generator)(this,function(F){switch(F.label){case 0:return o=this,s=o.layoutCfg,l=o.data,h=s.preset,!(h==null?void 0:h.type)||!ea.Layouts[h==null?void 0:h.type]?(r==null||r(),a(),[2,!1]):(p=iu(h,h.type),D=p?"".concat(h.type,"-gpu"):h.type,I=new ea.Layouts[D](h),delete s.preset,I.init(l),[4,I.execute()]);case 1:return F.sent(),e==null||e(),a(),[2,!0]}})})})},t.prototype.layoutWithWorker=function(e,r){var n=this,a=this,i=a.layoutCfg,o=a.graph,s=this.getWorker(),l=this.workerData;if(!s)return!1;l.requestId=null,l.requestId2=null,l.currentTick=null,l.currentTickData=null,o.emit("beforelayout");var h=Promise.resolve(),p=!1;if(i.type)p=!0,h=h.then(function(){return n.runWebworker(s,e,i)});else if(i.pipes){p=!0;for(var D=function(se){h=h.then(function(){return n.runWebworker(s,e,se)})},I=0,F=i.pipes;I<F.length;I++){var Z=F[I];D(Z)}}return p&&h.then(function(){i.onAllLayoutEnd&&i.onAllLayoutEnd(),r==null||r()}).catch(function(ee){console.error("layout failed",ee)}),!0},t.prototype.runWebworker=function(e,r,n){var a=this,i=this.isGPU,o=this.filterLayoutData(r,n),s=o.nodes,l=o.edges,h=document.createElement("canvas"),p=i&&typeof window!="undefined"&&window.navigator&&!navigator.gpu&&"OffscreenCanvas"in window&&"transferControlToOffscreen"in h,D=tc(n,function(F){return typeof F!="function"});if(!p)e.postMessage({type:zs.RUN,nodes:s,edges:l,layoutCfg:D});else{var I=h.transferControlToOffscreen();D.type="".concat(D.type,"-gpu"),e.postMessage({type:zs.GPURUN,nodes:s,edges:l,layoutCfg:D,canvas:I},[I])}return new Promise(function(F,Z){e.onmessage=function(ee){a.handleWorkerMessage(F,Z,ee,o,n)}})},t.prototype.handleWorkerMessage=function(e,r,n,a,i){var o=this,s=o.graph,l=o.workerData,h=n.data,p=h.type,D=function(){i.onTick&&i.onTick()};switch(p){case zs.TICK:l.currentTick=h.currentTick,l.currentTickData=h,l.requestId||(l.requestId=Us.requestAnimationFrame(function(){Ws(a,h),s.refreshPositions(),D(),h.currentTick===h.totalTicks?e():l.currentTick===h.totalTicks&&(l.requestId2=Us.requestAnimationFrame(function(){Ws(a,l.currentTickData),s.refreshPositions(),l.requestId2=null,D(),e()})),l.requestId=null}));break;case zs.END:l.currentTick==null&&(Ws(a,h),e());break;case zs.GPUEND:l.currentTick==null&&(yf(a,h),e());break;case zs.ERROR:console.warn("Web-Worker layout error!",h.message),r();break;default:r();break}},t.prototype.updateLayoutCfg=function(e){var r=this,n=this,a=n.graph,i=n.layoutMethods;if(!(!a||a.get("destroyed"))){var o=e.disableTriggerLayout,s=(0,b.__rest)(e,["disableTriggerLayout"]),l=(0,m.mix)({},this.layoutCfg,s);if(this.layoutCfg=l,!o){if(!(i==null?void 0:i.length)){this.layout();return}if(this.data=this.setDataFromGraph(),this.stopWorker(),!(s.workerEnabled&&this.layoutWithWorker(this.data,null))){a.emit("beforelayout");var h=Promise.resolve(),p=!1;(i==null?void 0:i.length)===1?(p=!0,h=h.then(function(){return(0,b.__awaiter)(r,void 0,void 0,function(){return(0,b.__generator)(this,function(D){switch(D.label){case 0:return[4,this.updateLayoutMethod(i[0],l)];case 1:return[2,D.sent()]}})})})):(i==null?void 0:i.length)&&(p=!0,i.forEach(function(D,I){var F=l.pipes[I];h=h.then(function(){return(0,b.__awaiter)(r,void 0,void 0,function(){return(0,b.__generator)(this,function(Z){switch(Z.label){case 0:return[4,this.updateLayoutMethod(D,F)];case 1:return[2,Z.sent()]}})})})})),p&&h.then(function(){l.onAllLayoutEnd&&l.onAllLayoutEnd()}).catch(function(D){console.warn("layout failed",D)})}}}},t.prototype.adjustPipesBox=function(e,r){var n=this;return new Promise(function(a){var i=e.nodes;(i==null?void 0:i.length)||a(),ec.includes(r)||(console.warn("The adjust type ".concat(r," is not supported yet, please assign it with 'force', 'grid', or 'circular'.")),a());var o={center:n.layoutCfg.center,nodeSize:function(F){return Math.max(F.height,F.width)},preventOverlap:!0,onLayoutEnd:function(){}},s=n.getLayoutBBox(i),l=s.groupNodes,h=s.layoutNodes,p=(0,m.clone)(h);o.onLayoutEnd=function(){h==null||h.forEach(function(I,F){var Z,ee,se,oe=I.x-((Z=p[F])===null||Z===void 0?void 0:Z.x),ce=I.y-((ee=p[F])===null||ee===void 0?void 0:ee.y);(se=l[F])===null||se===void 0||se.forEach(function(we){we.x+=oe,we.y+=ce})}),a()};var D=new ea.Layouts[r](o);D.layout({nodes:h})})},t.prototype.destroy=function(){this.destoryLayoutMethods();var e=this.worker;e&&(e.terminate(),this.worker=null),this.destroyed=!0,this.graph.set("layout",void 0),this.layoutCfg=void 0,this.layoutType=void 0,this.layoutMethods=void 0,this.graph=null},t}(wc),pf=gf;function Ws(c,t){for(var e=c.nodes,r=t.nodes,n=e.length,a=0;a<n;a++){var i=e[a];i.x=r[a].x,i.y=r[a].y}}function tc(c,t){var e={};return c&&Nu(c)==="object"?(Object.keys(c).forEach(function(r){c.hasOwnProperty(r)&&t(c[r])&&(e[r]=c[r])}),e):c}function yf(c,t){for(var e=c.nodes,r=t.vertexEdgeData,n=e.length,a=0;a<n;a++){var i=e[a],o=r[4*a],s=r[4*a+1];i.x=o,i.y=s}}function mf(c,t){var e;if(!!((e=c==null?void 0:c.nodes)===null||e===void 0?void 0:e.length)){var r=c.nodes;r.forEach(function(n){n.layoutOrder=t})}}function ku(c){return vf.includes(c)}function iu(c,t){var e=t;t&&t.split("-")[1]==="gpu"&&(e=t.split("-")[0],c.gpuEnabled=!0);var r=!1;return c.gpuEnabled&&(r=!0,Nc().webgl||(console.warn("Your browser does not support webGL or GPGPU. The layout will run in CPU."),r=!1)),r&&!ku(e)&&(console.warn("The '".concat(e,"' layout does not support GPU calculation for now, it will run in CPU.")),r=!1),r}var Aa=z(6056),ou=function(t){var e=t.clone();return Ru(t,e),e},Ru=function c(t,e){var r;t.isGroup()&&e.isGroup()&&((r=t.get("children"))===null||r===void 0||r.forEach(function(o,s){var l=e.get("children")[s];c(o,l)}));var n=t.get("type"),a=e.get("type");if(!(n!=="image"||a!=="image")){var i=t.get("clipShape");i&&e.setClip({type:i.get("type"),attrs:i.attr()})}},js=q.vs,zc="svg",Bu=function(c){(0,b.__extends)(t,c);function t(e){var r=c.call(this,e)||this,n=r.get("defaultNode");return n||r.set("defaultNode",{type:"circle"}),n.type||(n.type="circle",r.set("defaultNode",n)),r.destroyed=!1,r}return t.prototype.initLayoutController=function(){var e=new pf(this);this.set({layoutController:e})},t.prototype.initEventController=function(){var e=new $f(this);this.set({eventController:e})},t.prototype.initCanvas=function(){var e=this.get("container");if(typeof e=="string"&&(e=document.getElementById(e),this.set("container",e)),!e)throw new Error("invalid container");var r=e.clientWidth,n=e.clientHeight,a=this.get("width")||r,i=this.get("height")||n;!this.get("width")&&!this.get("height")&&(this.set("width",r),this.set("height",n));var o=this.get("renderer"),s;if(o===zc)s=new Ps.Canvas({container:e,width:a,height:i});else{var l={container:e,width:a,height:i},h=this.get("pixelRatio");h&&(l.pixelRatio=h,window.devicePixelRatio=h),s=new so.Canvas(l)}this.set("canvas",s)},t.prototype.initPlugins=function(){var e=this;(0,m.each)(e.get("plugins"),function(r){!r.destroyed&&r.initPlugin&&r.initPlugin(e)})},t.prototype.downloadImageWatermark=function(e,r,n,a){return(0,b.__awaiter)(this,void 0,void 0,function(){var i,o,s;return(0,b.__generator)(this,function(l){switch(l.label){case 0:return i=e.style.backgroundImage,o=i.slice(5,i.length-2),s=new Image,s.src=o,[4,new Promise(function(h){s.onload=function(){var p=r.createPattern(s,"repeat");r.rect(0,0,n,a),r.fillStyle=p,r.fill(),h("")}})];case 1:return l.sent(),[2]}})})},t.prototype.asyncToDataUrl=function(e,r,n,a,i,o){var s=this,l=document.querySelector(".g6-graph-watermarker"),h=this.get("canvas"),p=h.getRenderer(),D=o||h.get("el"),I="";e||(e="image/png"),setTimeout(function(){return(0,b.__awaiter)(s,void 0,void 0,function(){var F,Z,ee,se,oe,ce,we,Re,Oe,Pe;return(0,b.__generator)(this,function(He){switch(He.label){case 0:return p!=="svg"?[3,1]:(F=D.cloneNode(!0),Z=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),ee=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",Z),ee.replaceChild(F,ee.documentElement),se=new XMLSerializer().serializeToString(ee),I="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(se)),[3,4]);case 1:return oe=void 0,ce=D.getContext("2d"),we=a||this.get("width"),Re=i||this.get("height"),Oe=void 0,l?[4,this.downloadImageWatermark(l,ce,we,Re)]:[3,3];case 2:He.sent(),He.label=3;case 3:if(r){Pe=typeof window!="undefined"?window.devicePixelRatio:1;try{oe=ce.getImageData(0,0,we*Pe,Re*Pe),Oe=ce.globalCompositeOperation,ce.globalCompositeOperation="destination-over",ce.fillStyle=r,ce.fillRect(0,0,we,Re)}catch(at){console.error("Download image failed. Out of memory at ImageData creation")}}I=D.toDataURL(e),r&&(ce.clearRect(0,0,we,Re),ce.putImageData(oe,0,0),ce.globalCompositeOperation=Oe),He.label=4;case 4:return n&&n(I),[2]}})})},16)},t.prototype.toDataURL=function(e,r){var n=this.get("canvas"),a=n.getRenderer(),i=n.get("el");e||(e="image/png");var o="";if(a==="svg"){var s=i.cloneNode(!0),l=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),h=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",l);h.replaceChild(s,h.documentElement);var p=new XMLSerializer().serializeToString(h);o="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(p))}else{var D=void 0,I=i.getContext("2d"),F=Math.max(this.get("width"),500),Z=Math.max(this.get("height"),500),ee=void 0;if(r){var se=typeof window!="undefined"&&window.devicePixelRatio||1;try{D=I.getImageData(0,0,F*se,Z*se),ee=I.globalCompositeOperation,I.globalCompositeOperation="destination-over",I.fillStyle=r,I.fillRect(0,0,F,Z)}catch(oe){console.error("Download image failed. Out of memory at ImageData creation")}}o=i.toDataURL(e),r&&(I.clearRect(0,0,F,Z),I.putImageData(D,0,0),I.globalCompositeOperation=ee)}return o},t.prototype.toFullDataURL=function(e,r,n){var a=this.get("group").getCanvasBBox(),i=a.height,o=a.width,s=this.get("renderer"),l=(0,Aa.Z)('<div id="virtual-image"></div>'),h=n?n.backgroundColor:void 0,p=n?n.padding:void 0;p?(0,m.isNumber)(p)&&(p=[p,p,p,p]):p=[0,0,0,0];var D=i+p[0]+p[2],I=o+p[1]+p[3],F={container:l,height:D,width:I,quickHit:!0},Z=s==="svg"?new Ps.Canvas(F):new so.Canvas(F),ee=this.get("group"),se=ee.clone(),oe=(0,m.clone)(se.getMatrix());oe||(oe=[1,0,0,0,1,0,0,0,1]);var ce=(a.maxX+a.minX)/2,we=(a.maxY+a.minY)/2;oe=js(oe,[["t",-ce,-we],["t",o/2+p[3],i/2+p[0]]]),se.resetMatrix(),se.setMatrix(oe),Z.add(se);var Re=Z.get("el"),Oe="";r||(r="image/png"),setTimeout(function(){if(s==="svg"){var Pe=Re.cloneNode(!0),He=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),at=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",He);at.replaceChild(Pe,at.documentElement);var qe=new XMLSerializer().serializeToString(at);Oe="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(qe))}else{var yt=void 0,Ft=Re.getContext("2d"),yr=void 0;if(h){var fr=typeof window!="undefined"?window.devicePixelRatio:1;try{yt=Ft.getImageData(0,0,I*fr,D*fr),yr=Ft.globalCompositeOperation,Ft.globalCompositeOperation="destination-over",Ft.fillStyle=h,Ft.fillRect(0,0,I,D)}catch(lr){console.error("Download image failed. Out of memory at ImageData creation")}}Oe=Re.toDataURL(r),h&&(Ft.clearRect(0,0,I,D),Ft.putImageData(yt,0,0),Ft.globalCompositeOperation=yr)}e&&e(Oe)},16)},t.prototype.downloadFullImage=function(e,r,n){var a=this,i=this.get("group").getCanvasBBox(),o=i.height,s=i.width,l=this.get("renderer"),h=(0,Aa.Z)('<div id="virtual-image"></div>'),p=document.querySelector(".g6-graph-watermarker"),D=n?n.backgroundColor:void 0,I=n?n.padding:void 0;I?(0,m.isNumber)(I)&&(I=[I,I,I,I]):I=[0,0,0,0];var F=o+I[0]+I[2],Z=s+I[1]+I[3];if(p){var ee=this.get("graphWaterMarker").cfg||{},se=ee.width,oe=ee.height;F=Math.ceil(F/oe)*oe,Z=Math.ceil(Z/se)*se}var ce={container:h,height:F,width:Z},we=l==="svg"?new Ps.Canvas(ce):new so.Canvas(ce),Re=this.get("group"),Oe=ou(Re),Pe=(0,m.clone)(Oe.getMatrix());Pe||(Pe=[1,0,0,0,1,0,0,0,1]);var He=(i.maxX+i.minX)/2,at=(i.maxY+i.minY)/2;Pe=js(Pe,[["t",-He,-at],["t",s/2+I[3],o/2+I[0]]]),Oe.resetMatrix(),Oe.setMatrix(Pe),we.add(Oe);var qe=we.get("el");r||(r="image/png"),this.asyncToDataUrl(r,D,function(yt){var Ft=document.createElement("a"),yr=(e||"graph")+(l==="svg"?".svg":".".concat(r.split("/")[1]));a.dataURLToImage(yt,l,Ft,yr);var fr=document.createEvent("MouseEvents");fr.initEvent("click",!1,!1),Ft.dispatchEvent(fr)},Z,F,qe)},t.prototype.downloadImage=function(e,r,n){var a=this,i=this;i.stopAnimate();var o=i.get("canvas"),s=o.getRenderer();r||(r="image/png");var l=(e||"graph")+(s==="svg"?".svg":r.split("/")[1]),h=document.createElement("a");i.asyncToDataUrl(r,n,function(p){a.dataURLToImage(p,s,h,l);var D=document.createEvent("MouseEvents");D.initEvent("click",!1,!1),h.dispatchEvent(D)})},t.prototype.dataURLToImage=function(e,r,n,a){if(!e||e==="data:"){console.error("Download image failed. The graph is too large or there is invalid attribute values in graph items");return}if(typeof window!="undefined")if(window.Blob&&window.URL&&r!=="svg"){var i=e.split(","),o="";if(i&&i.length>0){var s=i[0].match(/:(.*?);/);s&&s.length>=2&&(o=s[1])}for(var l=atob(i[1]),h=l.length,p=new Uint8Array(h);h--;)p[h]=l.charCodeAt(h);var D=new Blob([p],{type:o});window.navigator.msSaveBlob?window.navigator.msSaveBlob(D,a):n.addEventListener("click",function(){n.download=a,n.href=window.URL.createObjectURL(D)})}else n.addEventListener("click",function(){n.download=a,n.href=e})},t.prototype.addPlugin=function(e){var r=this;e.destroyed||(r.get("plugins").push(e),e.initPlugin(r))},t.prototype.removePlugin=function(e){var r=this.get("plugins"),n=r.indexOf(e);n>=0&&(e.destroyPlugin(),r.splice(n,1))},t.prototype.setImageWaterMarker=function(e,r){e===void 0&&(e=wo.waterMarkerImage);var n=this.get("container");(0,m.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var a=this.get("graphWaterMarker"),i=(0,m.deepMix)({},wo.imageWaterMarkerConfig,r),o=i.width,s=i.height,l=i.compatible,h=i.image;if(!e){var p=l?n:document.querySelector(".g6-graph-watermarker");p&&(p.style.cssText=void 0),a&&a.clear();return}if(a)a.clear();else{var D={container:n,width:o,height:s,capture:!1},I=this.get("pixelRatio");I&&(D.pixelRatio=I,window.devicePixelRatio=I),a=new so.Canvas(D),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var F=a.get("context"),Z=h.rotate,ee=h.x,se=h.y;F.rotate(-Z*Math.PI/180);var oe=new Image;oe.crossOrigin="anonymous",oe.src=e,oe.onload=function(){if(F.drawImage(oe,ee,se,h.width,h.height),F.rotate(Z*Math.PI/180),l)n.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var ce=document.querySelector(".g6-graph-watermarker");ce||(ce=document.createElement("div"),ce.className="g6-graph-watermarker"),ce.className="g6-graph-watermarker",a.destroyed||(ce.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;"),n.appendChild(ce))}}},t.prototype.setTextWaterMarker=function(e,r){var n=this.get("container");(0,m.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var a=this.get("graphWaterMarker"),i=(0,m.deepMix)({},wo.textWaterMarkerConfig,r),o=i.width,s=i.height,l=i.compatible,h=i.text;if(!(e==null?void 0:e.length)){var p=l?n:document.querySelector(".g6-graph-watermarker");p&&(p.style.cssText=void 0),a&&a.clear();return}if(a)a.clear();else{var D={container:n,width:o,height:s,capture:!1},I=this.get("pixelRatio");I&&(D.pixelRatio=I,window.devicePixelRatio=I),a=new so.Canvas(D),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var F=a.get("context"),Z=h.rotate,ee=h.fill,se=h.fontFamily,oe=h.fontSize,ce=h.baseline,we=h.x,Re=h.y,Oe=h.lineHeight;F.rotate(-Z*Math.PI/180),F.font="".concat(oe,"px ").concat(se),F.fillStyle=ee,F.textBaseline=ce;for(var Pe=(0,m.isString)(e)?[e]:e,He=Pe.length-1;He>=0;He--)F.fillText(Pe[He],we,Re+He*Oe);if(F.rotate(Z*Math.PI/180),l)n.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var at=document.querySelector(".g6-graph-watermarker");at||(at=document.createElement("div"),at.className="g6-graph-watermarker"),at.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:99;"),n.appendChild(at)}},t.prototype.destroy=function(){var e,r,n,a;(0,m.each)(this.get("plugins"),function(h){h.destroyPlugin()});var i=this.get("tooltips");if(i)for(var o=0;o<i.length;o++){var s=i[o];if(!!s){var l=s.parentElement;!l||l.removeChild(s)}}(e=this.get("eventController"))===null||e===void 0||e.destroy(),(r=this.get("layoutController"))===null||r===void 0||r.destroy(),(n=this.get("graphWaterMarker"))===null||n===void 0||n.destroy(),(a=document.querySelector(".g6-graph-watermarker"))===null||a===void 0||a.remove(),c.prototype.destroy.call(this)},t}(Bf),ys=Bu,Uc=Vo.radialLayout,su=Vo.traverseTree,pl=function(c){(0,b.__extends)(t,c);function t(e){var r=c.call(this,e)||this;return r.layoutAnimating=!1,r.set("removeList",[]),r.set("layoutMethod",r.getLayout()),r}return t.prototype.getLayout=function(){var e=this.get("layout");return e?typeof e=="function"?e:(e.type||(e.type="dendrogram"),e.direction||(e.direction=e.type==="indented"?"LR":"TB"),e.radial?function(r){var n=nu()[e.type](r,e);return Uc(n),n}:function(r){return nu()[e.type](r,e)}):null},t.indexOfChild=function(e,r){var n=-1;return(0,m.each)(e,function(a,i){if(r===a.id)return n=i,!1}),n},t.prototype.getDefaultCfg=function(){var e=c.prototype.getDefaultCfg.call(this);return e.animate=!0,e},t.prototype.innerAddChild=function(e,r,n){var a=this,i=e.data;i&&(i.x=e.x,i.y=e.y,i.depth=e.depth);var o=a.addItem("node",i,!1);if(r){if(o.set("parent",r),n){var s=r.get("originAttrs");if(s)o.set("originAttrs",s);else{var l=r.getModel();o.set("originAttrs",{x:l.x,y:l.y})}}var h=r.get("children");h?h.push(o):r.set("children",[o]),a.addItem("edge",{source:r.get("id"),target:o.get("id"),id:"".concat(r.get("id"),":").concat(o.get("id"))},!1)}return(0,m.each)(e.children||[],function(p){a.innerAddChild(p,o,n)}),a.emit("afteraddchild",{item:o,parent:r}),o},t.prototype.innerUpdateChild=function(e,r,n){var a=this,i=a.findById(e.id);if(!i){a.innerAddChild(e,r,n);return}(0,m.each)(e.children||[],function(F){a.innerUpdateChild(F,i,n)});var o=i.get("children");if(o){var s=o.length;if(s>0)for(var l=o.length-1;l>=0;l--){var h=o[l].getModel();t.indexOfChild(e.children||[],h.id)===-1&&(a.innerRemoveChild(h.id,{x:e.x,y:e.y},n),o.splice(l,1))}}var p,D;i.get("originAttrs")&&(p=i.get("originAttrs").x,D=i.get("originAttrs").y);var I=i.getModel();n&&i.set("originAttrs",{x:I.x,y:I.y}),i.set("model",Object.assign(I,e.data)),(p!==e.x||D!==e.y)&&i.updatePosition({x:e.x,y:e.y})},t.prototype.innerRemoveChild=function(e,r,n){var a=this,i=a.findById(e);if(!!i)if((0,m.each)(i.get("children"),function(s){a.innerRemoveChild(s.getModel().id,r,n)}),n){var o=i.getModel();i.set("to",r),i.set("originAttrs",{x:o.x,y:o.y}),a.get("removeList").push(i)}else a.removeItem(i,!1)},t.prototype.changeData=function(e,r){r===void 0&&(r=!0);var n=this;this.getNodes().map(function(a){return n.clearItemStates(a)}),this.getEdges().map(function(a){return n.clearItemStates(a)}),r&&this.get("enabledStack")&&this.pushStack("changedata",{before:n.get("originData"),after:e||n.get("data")}),e?(n.data(e),n.render(!1)):n.layout(this.get("fitView"))},t.prototype.changeLayout=function(e){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");var r=this;r.updateLayout(e)},t.prototype.updateLayout=function(e,r,n,a){a===void 0&&(a=!0);var i=this;if(!e){console.warn("layout cannot be null");return}if(a&&this.get("enabledStack")&&this.pushStack("layout",{before:i.get("layout"),after:e}),i.set("layout",e),i.set("layoutMethod",i.getLayout()),i.layout(),r){var o=n;o||(r==="begin"?o={x:0,y:0}:o={x:this.getWidth()/2,y:this.getHeight()/2}),o=this.getPointByCanvas(o.x,o.y);var s=this.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];o.x=o.x*s[0]+s[6],o.y=o.y*s[0]+s[7];var l=this.getGroup().getCanvasBBox(),h=l.minX,p=l.maxX,D=l.minY,I=l.maxY,F={x:(h+p)/2,y:(D+I)/2};r==="begin"&&(F.x=h,F.y=D),this.translate(o.x-F.x,o.y-F.y)}},t.prototype.refreshLayout=function(e){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");var r=this;r.layout(e)},t.prototype.layout=function(e){var r=this,n=this,a=n.get("data"),i=n.get("layoutMethod"),o=n.get("layout"),s=a;if(o==null?void 0:o.excludeInvisibles){a=(0,m.clone)(n.get("data"));var l={};su(a,function(D){var I=D.children;if(!(I==null?void 0:I.length))return!0;for(var F=I.length-1;F>=0;F--){var Z=r.findById(I[F].id),ee=Z?!Z.isVisible():I[F].visible===!1;ee&&(l[D.id]=l[D.id]||[],l[D.id].push({idx:F,child:I.splice(F,1)[0]}))}}),s=i?i(a,n.get("layout")):a,su(s,function(D){var I=l[D.id];if(I==null?void 0:I.length)for(var F=I.length-1;F>=0;F--){var Z=I[F],ee=Z.idx,se=Z.child;D.children.splice(ee,0,se)}})}else s=i?i(a,n.get("layout")):a;var h=n.get("animate");if(n.emit("beforerefreshlayout",{data:a,layoutData:s}),n.emit("beforelayout"),n.innerUpdateChild(s,void 0,h),e){var p=n.get("viewController");p.fitView()}h?n.layoutAnimate(s):(n.refresh(),n.paint()),n.emit("afterrefreshlayout",{data:a,layoutData:s}),n.emit("afterlayout")},t.prototype.addChild=function(e,r,n){n===void 0&&(n=!0);var a=this;a.emit("beforeaddchild",{model:e,parent:r}),(0,m.isString)(r)||(r=r.get("id"));var i=a.findDataById(r);if(i){i.children||(i.children=[]),i.children.push(e);var o=a.findById(r);o.refresh(),a.changeData(void 0,n)}},t.prototype.updateChildren=function(e,r,n){n===void 0&&(n=!0);var a=this,i=a.findById(r);if(!r||!i){console.warn("Update children failed! There is no node with id '".concat(r,"'"));return}var o=a.findDataById(r);o.children=e,i.refresh(),a.changeData(void 0,n)},t.prototype.updateChild=function(e,r,n){n===void 0&&(n=!0);var a=this;if(!r||!a.findById(r)){a.changeData(e,n);return}var i=a.findDataById(r),o=a.findById(e.id);if(i.children||(i.children=[]),!o)i.children.push(e);else{var s=t.indexOfChild(i.children,e.id);s>-1&&(i.children[s]=e)}var l=a.findById(r);l==null||l.refresh(),a.changeData(void 0,n)},t.prototype.removeChild=function(e,r){r===void 0&&(r=!0);var n=this,a=n.findById(e),i;if(a?i=a==null?void 0:a.get("parent"):i=n.getNodes().find(function(p){var D=p.getModel().children||[];return!!D.find(function(I){return I.id===e})}),i&&!i.destroyed){var o=i.get("id"),s=n.findDataById(o),l=s&&s.children||[],h=t.indexOfChild(l,e);l.splice(h,1),i.refresh()}n.changeData(void 0,r)},t.prototype.findDataById=function(e,r){var n=this;if(r||(r=n.get("data")),e===r.id)return r;var a=null;return(0,m.each)(r.children||[],function(i){if(i.id===e)return a=i,!1;if(a=n.findDataById(e,i),a)return!1}),a},t.prototype.layoutAnimate=function(e,r){var n=this,a=this.get("animateCfg");n.emit("beforeanimate",{data:e}),n.getEdges().forEach(function(i){var o=i.get("model");o.sourceAnchor||(o.sourceAnchor=i.get("sourceAnchorIndex"))}),this.get("canvas").animate(function(i){su(e,function(o){var s=n.findById(o.id);if(s){var l=s.get("originAttrs"),h=s.get("model");if(l||(l={x:h.x,y:h.y},s.set("originAttrs",l)),r){var p=r(s,i,l,e);s.set("model",Object.assign(h,p))}else h.x=l.x+(o.x-l.x)*i,h.y=l.y+(o.y-l.y)*i}return!0}),(0,m.each)(n.get("removeList"),function(o){var s=o.getModel(),l=o.get("originAttrs"),h=o.get("to");s.x=l.x+(h.x-l.x)*i,s.y=l.y+(h.y-l.y)*i}),n.refreshPositions()},{duration:a.duration,easing:a.ease,callback:function(){(0,m.each)(n.getNodes(),function(o){o.set("originAttrs",null)}),(0,m.each)(n.get("removeList"),function(o){n.removeItem(o,!1)}),n.set("removeList",[]),a.callback&&a.callback(),n.emit("afteranimate",{data:e})},delay:a.delay})},t.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},t.prototype.isLayoutAnimating=function(){return this.layoutAnimating},t.prototype.render=function(e){e===void 0&&(e=!0);var r=this,n=r.get("data");if(!n||!(0,m.isObject)(n)||!Object.keys(n).length)throw new Error("data must be defined first");r.clear(),e&&this.get("enabledStack")&&this.clearStack(),r.emit("beforerender"),r.layout(this.get("fitView")),r.emit("afterrender")},t.prototype.save=function(){return this.get("data")},t.prototype.data=function(e){c.prototype.data.call(this,e),this.set("originData",JSON.parse(JSON.stringify(e)))},t}(ys),yl=pl,Kn=z(45442),ms=function(){function c(t){this._cfgs=(0,m.deepMix)(this.getDefaultCfgs(),t),this._events={},this.destroyed=!1}return c.prototype.getDefaultCfgs=function(){return{}},c.prototype.initPlugin=function(t){var e=this;e.set("graph",t);var r=e.getEvents(),n={};(0,m.each)(r,function(a,i){var o=(0,m.wrapBehavior)(e,a);n[i]=o,t.on(i,o)}),this._events=n,this.init()},c.prototype.getEvents=function(){return{}},c.prototype.get=function(t){var e;return(e=this._cfgs)===null||e===void 0?void 0:e[t]},c.prototype.set=function(t,e){this._cfgs[t]=e},c.prototype.destroy=function(){},c.prototype.destroyPlugin=function(){this.destroy();var t=this.get("graph"),e=this._events;(0,m.each)(e,function(r,n){t.off(n,r)}),this._events=null,this._cfgs=null,this.destroyed=!0},c}(),Qi=ms,Wc=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),rc="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",ml=function(c){Wc(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{img:rc,follow:!0}},t.prototype.init=function(){var e=this.get("graph"),r=e.get("container"),n=e.get("canvas").get("el"),a=this.get("img")||rc;a.includes("url(")||(a='url("'.concat(a,'")'));var i=(0,Aa.Z)(`<div class='g6-grid-container' style="position:absolute;overflow:hidden;z-index: -1;"></div>`),o=(0,Aa.Z)(`<div
  18. class='g6-grid'
  19. style='position:absolute;
  20. background-image: `.concat(a,`;
  21. user-select: none
  22. '></div>`));this.set("container",i),this.set("gridContainer",o),this.positionInit(),i.appendChild(o),r.insertBefore(i,n)},t.prototype.positionInit=function(){var e=this.get("graph"),r=e.get("minZoom"),n=e.get("width"),a=e.get("height");(0,Kn.Z)(this.get("container"),{width:"".concat(n,"px"),height:"".concat(a,"px")});var i=n*80/r,o=a*80/r;(0,Kn.Z)(this.get("gridContainer"),{width:"".concat(i,"px"),height:"".concat(o,"px"),left:"-".concat(i/2,"px"),top:"-".concat(o/2,"px")})},t.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},t.prototype.updateGrid=function(e){var r=this.get("gridContainer"),n=e.matrix;n||(n=[1,0,0,0,1,0,0,0,1]);var a=this.get("follow"),i="matrix(".concat(n[0],", ").concat(n[1],", ").concat(n[3],", ").concat(n[4],", ").concat(a?n[6]:"0",", ").concat(a?n[7]:"0",")");(0,Kn.Z)(r,{transform:i})},t.prototype.getContainer=function(){return this.get("container")},t.prototype.destroy=function(){var e=this.get("graph"),r=e.get("container"),n=this.get("container");r.removeChild(n)},t}(Qi),jc=ml,El=z(38186),pi=z.n(El),Xc=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();typeof document!="undefined"&&pi()(`
  23. .g6-component-contextmenu {
  24. border: 1px solid #e2e2e2;
  25. border-radius: 4px;
  26. font-size: 12px;
  27. color: #545454;
  28. background-color: rgba(255, 255, 255, 0.9);
  29. padding: 10px 8px;
  30. box-shadow: rgb(174, 174, 174) 0px 0px 10px;
  31. }
  32. .g6-contextmenu-ul {
  33. padding: 0;
  34. margin: 0;
  35. list-style: none;
  36. }
  37. `);var uu=function(c){Xc(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(r){return`
  38. <ul class='g6-contextmenu-ul'>
  39. <li>\u83DC\u5355\u98791</li>
  40. <li>\u83DC\u5355\u98792</li>
  41. </ul>
  42. `},shouldBegin:function(r){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},t.prototype.getEvents=function(){return this.get("trigger")==="click"?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},t.prototype.init=function(){var e=this.get("className"),r=(0,Aa.Z)("<div class=".concat(e||"g6-component-contextmenu","></div>"));(0,Kn.Z)(r,{top:"0px",position:"absolute",visibility:"hidden"});var n=this.get("container");n||(n=this.get("graph").get("container")),(0,m.isString)(n)&&(n=document.getElementById(n)),n.appendChild(r),this.set("menu",r)},t.prototype.onMenuShow=function(e){var r=this;e.preventDefault();var n=this.get("itemTypes");if(e.item){if(e.item&&e.item.getType&&n.indexOf(e.item.getType())===-1){r.onMenuHide();return}}else if(n.indexOf("canvas")===-1){r.onMenuHide();return}var a=this.get("shouldBegin");if(!!a(e)){var i=this.get("menu"),o=this.get("getContent"),s=this.get("graph"),l=o(e,s);(0,m.isString)(l)?i.innerHTML=l:i.innerHTML=l.outerHTML,this.removeMenuEventListener();var h=this.get("handleMenuClick");if(h){var p=function(He){h(He.target,e.item,s)};this.set("handleMenuClickWrapper",p),i.addEventListener("click",p)}var D=s.get("width"),I=s.get("height"),F=i.getBoundingClientRect(),Z=this.get("offsetX")||0,ee=this.get("offsetY")||0,se=s.getContainer().offsetTop,oe=s.getContainer().offsetLeft,ce=e.canvasX+oe+Z,we=e.canvasY+se+ee;ce+F.width>D&&(ce=e.canvasX-F.width-Z+oe),we+F.height>I&&(we=e.canvasY-F.height-ee+se),(0,Kn.Z)(i,{top:"".concat(we,"px"),left:"".concat(ce,"px"),visibility:"visible"});var Re=this.get("trigger")==="click",Oe=function(He){if(Re){Re=!1;return}r.onMenuHide()};document.body.addEventListener("click",Oe),this.set("handler",Oe)}},t.prototype.removeMenuEventListener=function(){var e=this.get("handleMenuClickWrapper"),r=this.get("handler");if(e){var n=this.get("menu");n.removeEventListener("click",e),this.set("handleMenuClickWrapper",null)}r&&document.body.removeEventListener("click",r)},t.prototype.onMenuHide=function(){var e=this.get("menu");e&&(0,Kn.Z)(e,{visibility:"hidden"}),this.removeMenuEventListener()},t.prototype.destroy=function(){var e=this.get("menu");if(this.removeMenuEventListener(),e){var r=this.get("container");r||(r=this.get("graph").get("container")),(0,m.isString)(r)&&(r=document.getElementById(r)),r.removeChild(e)}},t}(Qi),Es=uu,Vc=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),Fu=function(){return Fu=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Fu.apply(this,arguments)},Gu=Math.max,Yc=q.vs,Ji="default",bs="keyShape",ci="delegate",Ri="svg",Ef=function(c){Vc(t,c);function t(e){var r=c.call(this,e)||this;return r.handleUpdateCanvas=(0,m.debounce)(function(n){var a=r;a.destroyed||a.updateCanvas()},100,!1),r}return t.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",type:"default",padding:50,size:[200,120],delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0,hideEdge:!1}},t.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},t.prototype.disableRefresh=function(){this.set("refresh",!1)},t.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},t.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},t.prototype.initViewport=function(){var e=this,r=this._cfgs,n=r.size,a=r.graph;if(!this.destroyed){var i=this.get("canvas"),o=i.get("container"),s=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,l=navigator.userAgent.toLowerCase().indexOf("safari")>-1,h=(0,Aa.Z)(`
  43. <div
  44. class=`.concat(r.viewportClassName,`
  45. style='position:absolute;
  46. left:0;
  47. top:0;
  48. box-sizing:border-box;
  49. outline: 2px solid #1980ff;
  50. cursor:move'
  51. draggable=`).concat(!(l||s),`
  52. </div>`)),p=0,D=0,I=!1,F=0,Z=0,ee=0,se=0,oe=0,ce=0,we=l||s?"mousedown":"dragstart";h.addEventListener(we,function(He){var at,qe;if(He.dataTransfer){var yt=new Image;yt.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",(qe=(at=He.dataTransfer).setDragImage)===null||qe===void 0||qe.call(at,yt,0,0);try{He.dataTransfer.setData("text/html","view-port-minimap")}catch(yr){He.dataTransfer.setData("text","view-port-minimap")}}if(r.refresh=!1,He.target===h){var Ft=h.style;F=parseInt(Ft.left,10),Z=parseInt(Ft.top,10),ee=parseInt(Ft.width,10),se=parseInt(Ft.height,10),!(ee>n[0]||se>n[1])&&(ce=a.getZoom(),oe=e.get("ratio"),I=!0,p=He.clientX,D=He.clientY)}},!1);var Re=function(at){if(!(!I||(0,m.isNil)(at.clientX)||(0,m.isNil)(at.clientY))){var qe=p-at.clientX,yt=D-at.clientY;(F-qe<0||F-qe+ee>=n[0])&&(qe=0),(Z-yt<0||Z-yt+se>=n[1])&&(yt=0),F-=qe,Z-=yt,(0,Kn.Z)(h,{left:"".concat(F,"px"),top:"".concat(Z,"px")}),a.translate(qe*ce/oe,yt*ce/oe),p=at.clientX,D=at.clientY}};!l&&!s&&h.addEventListener("drag",Re,!1);var Oe=function(){I=!1,r.refresh=!0},Pe=l||s?"mouseup":"dragend";h.addEventListener(Pe,Oe,!1),o.addEventListener("mouseleave",Oe),o.addEventListener("mouseup",Oe),(l||s)&&o.addEventListener("mousemove",Re,!1),this.set("viewport",h),o.appendChild(h)}},t.prototype.updateViewport=function(){if(!this.destroyed){var e=this.get("ratio"),r=this.get("totaldx"),n=this.get("totaldy"),a=this.get("graph"),i=this.get("size"),o=a.get("canvas").get("el"),s=a.get("width")||o.scrollWidth||500,l=a.get("height")||o.scrollHeight||500,h=a.getPointByCanvas(0,0),p=a.getPointByCanvas(s,l),D=this.get("viewport");D||this.initViewport();var I=(p.x-h.x)*e,F=(p.y-h.y)*e,Z=h.x*e+r,ee=h.y*e+n,se=Z+I,oe=ee+F;Z<0&&(I+=Z,Z=0),se>i[0]&&(I=I-(se-i[0])),ee<0&&(F+=ee,ee=0),oe>i[1]&&(F=F-(oe-i[1])),this.set("ratio",e);var ce="".concat(Z,"px"),we="".concat(ee,"px");(0,Kn.Z)(D,{left:ce,top:we,width:"".concat(I,"px"),height:"".concat(F,"px")})}},t.prototype.updateGraphShapes=function(){var e=this._cfgs.graph,r=this.get("canvas"),n=e.get("group");if(!n.destroyed){r.clear();var a;this.get("hideEdge")?(a=r.addGroup(),n.get("children").forEach(function(o){o.get("id").includes("-edge")||a.add(o.clone())})):(a=n.clone(),a.resetMatrix(),r.add(a));var i=e.get("renderer");i===Ri&&this.updateVisible(a)}},t.prototype.updateVisible=function(e){var r=this;if(!e.isGroup()&&!e.get("visible"))e.hide();else{var n=e.get("children");if(!n||!n.length)return;n.forEach(function(a){a.get("visible")||a.hide(),r.updateVisible(a)})}},t.prototype.updateKeyShapes=function(){var e=this,r=this._cfgs.graph,n=this.get("canvas"),a=n.get("children")[0]||n.addGroup();this.get("hideEdge")||(0,m.each)(r.getEdges(),function(s){e.updateOneEdgeKeyShape(s,a)}),(0,m.each)(r.getNodes(),function(s){e.updateOneNodeKeyShape(s,a)});var i=r.getCombos();if(i&&i.length){var o=a.find(function(s){return s.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){e.destroyed||((0,m.each)(i,function(s){e.updateOneComboKeyShape(s,o)}),o==null||o.sort(),o==null||o.toBack(),e.updateCanvas())},250)}this.clearDestroyedShapes()},t.prototype.updateOneComboKeyShape=function(e,r){if(!this.destroyed){var n=this.get("itemMap")||{},a=n[e.get("id")],i=e.getBBox(),o=e.get("keyShape").clone(),s=o.attr(),l={x:i.centerX,y:i.centerY};a?l=Object.assign(s,l):(a=o,r.add(a));var h=a.get("type");(h==="rect"||h==="image")&&(l.x=i.minX,l.y=i.minY),a.attr(l),e.isVisible()?a.show():a.hide(),a.exist=!0;var p=e.getModel().depth;isNaN(p)||a.set("zIndex",p),n[e.get("id")]=a,this.set("itemMap",n)}},t.prototype.updateOneNodeKeyShape=function(e,r){var n=this.get("itemMap")||{},a=n[e.get("id")],i=e.getBBox(),o=e.get("keyShape").clone(),s=o.attr(),l={x:i.centerX,y:i.centerY};a?(l=Object.assign(s,l),a.toFront()):(a=o,r.add(a));var h=a.get("type");(h==="rect"||h==="image")&&(l.x=i.minX,l.y=i.minY),a.attr(l),e.isVisible()?a.show():a.hide(),a.exist=!0;var p=e.getModel().depth;isNaN(p)||a.set("zIndex",p),n[e.get("id")]=a,this.set("itemMap",n)},t.prototype.updateDelegateShapes=function(){var e=this,r=this._cfgs.graph,n=this.get("canvas"),a=n.get("children")[0]||n.addGroup();this.get("hideEdge")||(0,m.each)(r.getEdges(),function(s){e.updateOneEdgeKeyShape(s,a)}),(0,m.each)(r.getNodes(),function(s){e.updateOneNodeDelegateShape(s,a)});var i=r.getCombos();if(i&&i.length){var o=a.find(function(s){return s.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){e.destroyed||((0,m.each)(i,function(s){e.updateOneComboKeyShape(s,o)}),o==null||o.sort(),o==null||o.toBack(),e.updateCanvas())},250)}this.clearDestroyedShapes()},t.prototype.clearDestroyedShapes=function(){var e=this.get("itemMap")||{},r=Object.keys(e);if(!(!r||r.length===0))for(var n=r.length-1;n>=0;n--){var a=e[r[n]],i=a.exist;a.exist=!1,i||(a.remove(),delete e[r[n]])}},t.prototype.updateOneEdgeKeyShape=function(e,r){var n=this.get("itemMap")||{},a=n[e.get("id")];if(a){var i=e.get("keyShape").attr("path");a.attr("path",i)}else a=e.get("keyShape").clone(),r.add(a);e.isVisible()?a.show():a.hide(),a.exist=!0,n[e.get("id")]=a,this.set("itemMap",n)},t.prototype.updateOneNodeDelegateShape=function(e,r){var n=this.get("delegateStyle"),a=this.get("itemMap")||{},i=a[e.get("id")],o=e.getBBox();if(i){var s={x:o.minX,y:o.minY,width:o.width,height:o.height};i.attr(s),i.toFront()}else i=r.addShape("rect",{attrs:Fu({x:o.minX,y:o.minY,width:o.width,height:o.height},n),name:"minimap-node-shape"});e.isVisible()?i.show():i.hide(),i.exist=!0,a[e.get("id")]=i,this.set("itemMap",a)},t.prototype.init=function(){this.initContainer(),this.get("graph").on("afterupdateitem",this.handleUpdateCanvas),this.get("graph").on("afteritemstatechange",this.handleUpdateCanvas),this.get("graph").on("afteradditem",this.handleUpdateCanvas),this.get("graph").on("afterremoveitem",this.handleUpdateCanvas),this.get("graph").on("afterrender",this.handleUpdateCanvas),this.get("graph").on("afterlayout",this.handleUpdateCanvas)},t.prototype.initContainer=function(){var e=this,r=e.get("graph"),n=e.get("size"),a=e.get("className"),i=e.get("container"),o=(0,Aa.Z)("<div class='".concat(a,"' style='width: ").concat(n[0],"px; height: ").concat(n[1],"px; overflow: hidden'></div>"));(0,m.isString)(i)&&(i=document.getElementById(i)),i?i.appendChild(o):r.get("container").appendChild(o),e.set("container",o);var s=(0,Aa.Z)('<div class="g6-minimap-container" style="position: relative;"></div>');o.appendChild(s),s.addEventListener("dragenter",function(p){p.preventDefault()}),s.addEventListener("dragover",function(p){p.preventDefault()});var l,h=r.get("renderer");h===Ri?l=new Ps.Canvas({container:s,width:n[0],height:n[1]}):l=new so.Canvas({container:s,width:n[0],height:n[1]}),e.set("canvas",l),e.updateCanvas()},t.prototype.updateCanvas=function(){if(!this.destroyed){var e=this.get("refresh");if(!!e){var r=this.get("graph");if(!r.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var n=this.get("size"),a=this.get("canvas"),i=this.get("type"),o=this.get("padding");if(!a.destroyed){switch(i){case Ji:this.updateGraphShapes();break;case bs:this.updateKeyShapes();break;case ci:this.updateDelegateShapes();break;default:break}var s=a.get("children")[0];if(!!s){s.resetMatrix();var l=s.getCanvasBBox(),h=r.get("canvas").getCanvasBBox(),p=r.getZoom()||1,D=h.width/p,I=h.height/p;Number.isFinite(l.width)&&(D=Gu(l.width,D),I=Gu(l.height,I)),D+=2*o,I+=2*o;var F=Math.min(n[0]/D,n[1]/I),Z=[1,0,0,0,1,0,0,0,1],ee=0,se=0;Number.isFinite(l.minX)&&(ee=-l.minX),Number.isFinite(l.minY)&&(se=-l.minY);var oe=(n[0]-(D-2*o)*F)/2,ce=(n[1]-(I-2*o)*F)/2;Z=Yc(Z,[["t",ee,se],["s",F,F],["t",oe,ce]]),s.setMatrix(Z),this.set("ratio",F),this.set("totaldx",oe+ee*F),this.set("totaldy",ce+se*F),this.set("dx",oe),this.set("dy",ce),this.updateViewport()}}}}}},t.prototype.getCanvas=function(){return this.get("canvas")},t.prototype.getViewport=function(){return this.get("viewport")},t.prototype.getContainer=function(){return this.get("container")},t.prototype.destroy=function(){var e;(e=this.get("canvas"))===null||e===void 0||e.destroy();var r=this.get("container");(r==null?void 0:r.parentNode)&&r.parentNode.removeChild(r)},t}(Qi),bl=Ef,Hc=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();function Yo(c,t,e){var r=c.x-t.x,n=c.y-t.y;return!e||Math.abs(r)>e||Math.abs(n)>e?Math.sqrt(r*r+n*n):e}function xl(c,t){return c.x*t.x+c.y*t.y}function nc(c,t){var e=(t.source.y-t.target.y)/(t.source.x-t.target.x),r=(e*e*t.source.x+e*(c.y-t.source.y)+c.x)/(e*e+1),n=e*(r-t.source.x)+t.source.y;return{x:r,y:n}}var wl=function(c){Hc(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{edgeBundles:[],edgePoints:[],K:.1,lambda:.1,divisions:1,divRate:2,cycles:6,iterations:90,iterRate:.6666667,bundleThreshold:.6,eps:1e-6,onLayoutEnd:function(){},onTick:function(){}}},t.prototype.init=function(){var e=this.get("graph"),r=this.get("onTick"),n=function(){r&&r(),e.refreshPositions()};this.set("tick",n)},t.prototype.bundling=function(e){var r=this;if(r.set("data",e),!r.isTicking()){var n=e.edges||[],a=e.nodes||[],i={},o=!1;if(a.forEach(function(we){(we.x===null||!we.y===null||we.x===void 0||!we.y===void 0)&&(o=!0),i[we.id]=we}),o)throw new Error("please layout the graph or assign x and y for nodes first");r.set("nodeIdMap",i);var s=r.get("divisions"),l=r.get("divRate"),h=r.divideEdges(s);r.set("edgePoints",h);var p=r.getEdgeBundles();r.set("edgeBundles",p);for(var D=r.get("cycles"),I=r.get("iterations"),F=r.get("iterRate"),Z=r.get("lambda"),ee=0;ee<D;ee++){for(var se=function(Re){var Oe=[];n.forEach(function(Pe,He){if(Pe.source!==Pe.target){var at=i[Pe.source],qe=i[Pe.target];Oe[He]=r.getEdgeForces({source:at,target:qe},He,s,Z);for(var yt=0;yt<s+1;yt++)h[He][yt].x+=Oe[He][yt].x,h[He][yt].y+=Oe[He][yt].y}})},oe=0;oe<I;oe++)se(oe);Z=Z/2,s*=l,I*=F,h=r.divideEdges(s),r.set("edgePoints",h)}n.forEach(function(we,Re){we.source!==we.target&&(we.type="polyline",we.controlPoints=h[Re].slice(1,h[Re].length-1))});var ce=r.get("graph");ce.refresh()}},t.prototype.updateBundling=function(e){var r=this,n=e.data;if(n&&r.set("data",n),r.get("ticking")&&r.set("ticking",!1),Object.keys(e).forEach(function(i){r.set(i,e[i])}),e.onTick){var a=this.get("graph");r.set("tick",function(){e.onTick(),a.refresh()})}r.bundling(n)},t.prototype.divideEdges=function(e){var r=this,n=r.get("data").edges,a=r.get("nodeIdMap"),i=r.get("edgePoints");return(!i||i===void 0)&&(i=[]),n.forEach(function(o,s){var l;(!i[s]||i[s]===void 0)&&(i[s]=[]);var h=a[o.source],p=a[o.target];if(e===1)i[s].push({x:h.x,y:h.y}),i[s].push({x:.5*(h.x+p.x),y:.5*(h.y+p.y)}),i[s].push({x:p.x,y:p.y});else{var D=0;((l=i[s])===null||l===void 0?void 0:l.length)?D=r.getEdgeLength(i[s]):D=Yo({x:h.x,y:h.y},{x:p.x,y:p.y});var I=D/(e+1),F=I,Z=[{x:h.x,y:h.y}];i[s].forEach(function(ee,se){if(se!==0){for(var oe=Yo(ee,i[s][se-1]);oe>F;){var ce=F/oe,we={x:i[s][se-1].x,y:i[s][se-1].y};we.x+=ce*(ee.x-i[s][se-1].x),we.y+=ce*(ee.y-i[s][se-1].y),Z.push(we),oe-=F,F=I}F-=oe}}),Z.push({x:p.x,y:p.y}),i[s]=Z}}),i},t.prototype.getEdgeLength=function(e){var r=0;return e.forEach(function(n,a){a!==0&&(r+=Yo(n,e[a-1]))}),r},t.prototype.getEdgeBundles=function(){var e=this,r=e.get("data"),n=r.edges||[],a=e.get("bundleThreshold"),i=e.get("nodeIdMap"),o=e.get("edgeBundles");return o||(o=[]),n.forEach(function(s,l){(!o[l]||o[l]===void 0)&&(o[l]=[])}),n.forEach(function(s,l){var h=i[s.source],p=i[s.target];n.forEach(function(D,I){if(!(I<=l)){var F=i[D.source],Z=i[D.target],ee=e.getBundleScore({source:h,target:p},{source:F,target:Z});ee>=a&&(o[l].push(I),o[I].push(l))}})}),o},t.prototype.getBundleScore=function(e,r){var n=this;e.vx=e.target.x-e.source.x,e.vy=e.target.y-e.source.y,r.vx=r.target.x-r.source.x,r.vy=r.target.y-r.source.y,e.length=Yo({x:e.source.x,y:e.source.y},{x:e.target.x,y:e.target.y}),r.length=Yo({x:r.source.x,y:r.source.y},{x:r.target.x,y:r.target.y});var a=n.getAngleScore(e,r),i=n.getScaleScore(e,r),o=n.getPositionScore(e,r),s=n.getVisibilityScore(e,r);return a*i*o*s},t.prototype.getAngleScore=function(e,r){var n=xl({x:e.vx,y:e.vy},{x:r.vx,y:r.vy});return n/(e.length*r.length)},t.prototype.getScaleScore=function(e,r){var n=(e.length+r.length)/2,a=2/(n/Math.min(e.length,r.length)+Math.max(e.length,r.length)/n);return a},t.prototype.getPositionScore=function(e,r){var n=(e.length+r.length)/2,a={x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2},i={x:(r.source.x+r.target.x)/2,y:(r.source.y+r.target.y)/2},o=Yo(a,i);return n/(n+o)},t.prototype.getVisibilityScore=function(e,r){var n=this.getEdgeVisibility(e,r),a=this.getEdgeVisibility(r,e);return n<a?n:a},t.prototype.getEdgeVisibility=function(e,r){var n=nc(r.source,e),a=nc(r.target,e),i={x:(n.x+a.x)/2,y:(n.y+a.y)/2},o={x:(e.source.x+e.target.x)/2,y:(e.source.y+e.target.y)/2};return Math.max(0,1-2*Yo(i,o)/Yo(n,a))},t.prototype.getEdgeForces=function(e,r,n,a){for(var i=this,o=i.get("edgePoints"),s=i.get("K"),l=s/(Yo(e.source,e.target)*(n+1)),h=[{x:0,y:0}],p=1;p<n;p++){var D={x:0,y:0},I=i.getSpringForce({pre:o[r][p-1],cur:o[r][p],next:o[r][p+1]},l),F=i.getElectrostaticForce(p,r);D.x=a*(I.x+F.x),D.y=a*(I.y+F.y),h.push(D)}return h.push({x:0,y:0}),h},t.prototype.getSpringForce=function(e,r){var n=e.pre.x+e.next.x-2*e.cur.x,a=e.pre.y+e.next.y-2*e.cur.y;return n*=r,a*=r,{x:n,y:a}},t.prototype.getElectrostaticForce=function(e,r){var n=this,a=n.get("eps"),i=n.get("edgeBundles"),o=n.get("edgePoints"),s=i[r],l={x:0,y:0};return s.forEach(function(h){var p={x:o[h][e].x-o[r][e].x,y:o[h][e].y-o[r][e].y};if(Math.abs(p.x)>a||Math.abs(p.y)>a){var D=Yo(o[h][e],o[r][e]),I=1/D;l.x+=p.x*I,l.y+=p.y*I}}),l},t.prototype.isTicking=function(){return this.get("ticking")},t.prototype.getSimulation=function(){return this.get("forceSimulation")},t.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),c.prototype.destroy.call(this)},t}(Qi),Sl=wl,_l=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),ac=function(){return ac=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},ac.apply(this,arguments)},zu=.05,bf={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:.1,fill:"#ccc"},xf=function(c){_l(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{trigger:"mousemove",d:1.5,r:300,delegateStyle:(0,m.clone)(bf),showLabel:!1,maxD:5,minD:0,scaleRBy:"unset",scaleDBy:"unset",showDPercent:!0}},t.prototype.getEvents=function(){var e;switch(this.get("trigger")){case"click":e={click:"magnify"};break;case"drag":e={click:"createDelegate"};break;default:e={mousemove:"magnify"};break}return e},t.prototype.init=function(){var e=this,r=e.get("r");e.set("cachedMagnifiedModels",[]),e.set("cachedOriginPositions",{}),e.set("r2",r*r);var n=e.get("d");e.set("molecularParam",(n+1)*r)},t.prototype.createDelegate=function(e){var r=this,n=this,a=n.get("delegate");(!a||a.destroyed)&&(n.magnify(e),a=n.get("delegate"),a.on("dragstart",function(i){n.set("delegateCenterDiff",{x:a.attr("x")-i.x,y:a.attr("y")-i.y})}),a.on("drag",function(i){n.magnify(i)}),this.get("scaleDBy")==="wheel"&&a.on("mousewheel",function(i){r.scaleDByWheel(i)}),this.get("scaleRBy")==="wheel"&&a.on("mousewheel",function(i){n.scaleRByWheel(i)}))},t.prototype.scaleRByWheel=function(e){var r=this;if(!(!e||!e.originalEvent)){e.preventDefault&&e.preventDefault();var n=r.get("graph"),a,i=r.get("delegate"),o=i?{x:i.attr("x"),y:i.attr("y")}:void 0,s=o||n.getPointByClient(e.clientX,e.clientY);e.originalEvent.wheelDelta<0?a=1-zu:a=1/(1-zu);var l=r.get("maxR"),h=r.get("minR"),p=r.get("r");(p>(l||n.get("height"))&&a>1||p<(h||n.get("height")*.05)&&a<1)&&(a=1),p*=a,r.set("r",p),r.set("r2",p*p);var D=r.get("d");r.set("molecularParam",(D+1)*p),r.set("delegateCenterDiff",void 0),r.magnify(e,s)}},t.prototype.scaleRByDrag=function(e){var r=this;if(!!e){var n=r.get("dragPrePos"),a=r.get("graph"),i,o=a.getPointByClient(e.clientX,e.clientY);e.x-n.x<0?i=1-zu:i=1/(1-zu);var s=r.get("maxR"),l=r.get("minR"),h=r.get("r");(h>(s||a.get("height"))&&i>1||h<(l||a.get("height")*.05)&&i<1)&&(i=1),h*=i,r.set("r",h),r.set("r2",h*h);var p=r.get("d");r.set("molecularParam",(p+1)*h),r.magnify(e,o),r.set("dragPrePos",{x:e.x,y:e.y})}},t.prototype.scaleDByWheel=function(e){var r=this;if(!(!e&&!e.originalEvent)){e.preventDefault&&e.preventDefault();var n=0;e.originalEvent.wheelDelta<0?n=-.1:n=.1;var a=r.get("d"),i=a+n,o=r.get("maxD"),s=r.get("minD");if(i<o&&i>s){r.set("d",i);var l=r.get("r");r.set("molecularParam",(i+1)*l);var h=r.get("delegate"),p=h?{x:h.attr("x"),y:h.attr("y")}:void 0;r.set("delegateCenterDiff",void 0),r.magnify(e,p)}}},t.prototype.scaleDByDrag=function(e){var r=this,n=r.get("dragPrePos"),a=e.x-n.x>0?.1:-.1,i=r.get("d"),o=i+a,s=r.get("maxD"),l=r.get("minD");if(o<s&&o>l){r.set("d",o);var h=r.get("r");r.set("molecularParam",(o+1)*h),r.magnify(e)}r.set("dragPrePos",{x:e.x,y:e.y})},t.prototype.magnify=function(e,r){var n=this;n.restoreCache();var a=n.get("graph"),i=n.get("cachedMagnifiedModels"),o=n.get("cachedOriginPositions"),s=n.get("showLabel"),l=n.get("r"),h=n.get("r2"),p=n.get("d"),D=n.get("molecularParam"),I=a.getNodes(),F=I.length,Z=r?{x:r.x,y:r.y}:{x:e.x,y:e.y};n.get("dragging")&&(n.get("trigger")==="mousemove"||n.get("trigger")==="click")&&(Z=n.get("cacheCenter"));var ee=n.get("delegateCenterDiff");ee&&(Z.x+=ee.x,Z.y+=ee.y),n.updateDelegate(Z,l);for(var se=0;se<F;se++){var oe=I[se].getModel(),ce=oe.x,we=oe.y;if(!(isNaN(ce)||isNaN(we))){var Re=(ce-Z.x)*(ce-Z.x)+(we-Z.y)*(we-Z.y);if(!isNaN(Re)&&Re<h&&Re!==0){var Oe=Math.sqrt(Re),Pe=D*Oe/(p*Oe+l),He=(ce-Z.x)/Oe,at=(we-Z.y)/Oe;if(oe.x=He*Pe+Z.x,oe.y=at*Pe+Z.y,o[oe.id]||(o[oe.id]={x:ce,y:we,texts:[]}),i.push(oe),s&&2*Oe<l)for(var qe=I[se],yt=qe.getContainer(),Ft=yt.getChildren(),yr=Ft.length,fr=0;fr<yr;fr++){var lr=Ft[fr];lr.get("type")==="text"&&(o[oe.id].texts.push({visible:lr.get("visible"),shape:lr}),lr.set("visible",!0))}}}}a.refreshPositions()},t.prototype.restoreCache=function(){for(var e=this,r=e.get("cachedMagnifiedModels"),n=e.get("cachedOriginPositions"),a=r.length,i=0;i<a;i++){var o=r[i],s=o.id,l=n[s];o.x=l.x,o.y=l.y;for(var h=l.texts.length,p=0;p<h;p++){var D=l.texts[p];D.shape.set("visible",D.visible)}}e.set("cachedMagnifiedModels",[]),e.set("cachedOriginPositions",{})},t.prototype.updateParams=function(e){var r=this,n=e.r,a=e.d,i=e.trigger,o=e.minD,s=e.maxD,l=e.minR,h=e.maxR,p=e.scaleDBy,D=e.scaleRBy;isNaN(e.r)||(r.set("r",n),r.set("r2",n*n)),isNaN(a)||r.set("d",a),isNaN(s)||r.set("maxD",s),isNaN(o)||r.set("minD",o),isNaN(h)||r.set("maxR",h),isNaN(l)||r.set("minR",l);var I=r.get("d"),F=r.get("r");if(r.set("molecularParam",(I+1)*F),(i==="mousemove"||i==="click"||i==="drag")&&r.set("trigger",i),p==="drag"||p==="wheel"||p==="unset"){r.set("scaleDBy",p),r.get("delegate").remove(),r.get("delegate").destroy();var Z=r.get("dPercentText");Z&&(Z.remove(),Z.destroy())}if(D==="drag"||D==="wheel"||D==="unset"){r.set("scaleRBy",D),r.get("delegate").remove(),r.get("delegate").destroy();var Z=r.get("dPercentText");Z&&(Z.remove(),Z.destroy())}},t.prototype.updateDelegate=function(e,r){var n=this,a=this,i=a.get("graph"),o=a.get("delegate");if(!o||o.destroyed){var s=i.get("group"),l=a.get("delegateStyle")||bf;o=s.addShape("circle",{attrs:ac({r:r/1.5,x:e.x,y:e.y},l),name:"lens-shape",draggable:!0}),this.get("trigger")!=="drag"&&(this.get("scaleRBy")==="wheel"?o.on("mousewheel",function(F){a.scaleRByWheel(F)}):this.get("scaleRBy")==="drag"&&(o.on("dragstart",function(F){a.set("dragging",!0),a.set("cacheCenter",{x:F.x,y:F.y}),a.set("dragPrePos",{x:F.x,y:F.y})}),o.on("drag",function(F){a.scaleRByDrag(F)}),o.on("dragend",function(F){a.set("dragging",!1)})),this.get("scaleDBy")==="wheel"?o.on("mousewheel",function(F){n.scaleDByWheel(F)}):this.get("scaleDBy")==="drag"&&(o.on("dragstart",function(F){a.set("dragging",!0),a.set("cacheCenter",{x:F.x,y:F.y}),a.set("dragPrePos",{x:F.x,y:F.y})}),o.on("drag",function(F){n.scaleDByDrag(F)}),o.on("dragend",function(F){a.set("dragging",!1)})))}else o.attr({x:e.x,y:e.y,r:r/1.5});if(a.get("showDPercent")){var h=Math.round((a.get("d")-a.get("minD"))/(a.get("maxD")-a.get("minD"))*100),p=a.get("dPercentText"),D=e.y+r/1.5+16;if(!p||p.destroyed){var I=i.get("group");p=I.addShape("text",{attrs:{text:"".concat(h,"%"),x:e.x,y:D,fill:"#aaa",stroke:"#fff",lineWidth:1,fontSize:12}}),a.set("dPercentText",p)}else p.attr({text:"".concat(h,"%"),x:e.x,y:D})}a.set("delegate",o)},t.prototype.clear=function(){var e=this.get("graph");this.restoreCache(),e.refreshPositions();var r=this.get("delegate");r&&!r.destroyed&&(r.remove(),r.destroy());var n=this.get("dPercentText");n&&!n.destroyed&&(n.remove(),n.destroy())},t.prototype.destroy=function(){this.clear()},t}(Qi),Zc=xf,Ml=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),ic=.05;typeof document!="undefined"&&pi()(`
  53. .g6-component-toolbar {
  54. position: absolute;
  55. list-style-type: none;
  56. padding: 6px;
  57. left: 0px;
  58. top: 0px;
  59. background-color: rgba(255, 255, 255, 0.9);
  60. border: 1px solid #e2e2e2;
  61. border-radius: 4px;
  62. font-size: 12px;
  63. color: #545454;
  64. margin: 0;
  65. }
  66. .g6-component-toolbar li {
  67. float: left;
  68. text-align: center;
  69. width: 35px;
  70. height: 24px;
  71. cursor: pointer;
  72. list-style-type:none;
  73. list-style: none;
  74. margin-left: 0px;
  75. }
  76. .g6-component-toolbar li .icon {
  77. opacity: 0.7;
  78. }
  79. .g6-component-toolbar li .icon:hover {
  80. opacity: 1;
  81. }
  82. `);var Kc=function(t){if(!t)return[];if(t.composedPath)return t.composedPath();for(var e=[],r=t.target;r;){if(e.push(r),r.tagName==="HTML")return e.push(document,window),e;r=r.parentElement}return e},wf=function(c){Ml(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{handleClick:void 0,getContent:function(r){return`
  83. <ul class='g6-component-toolbar'>
  84. <li code='redo'>
  85. <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
  86. <path d="M256 682.666667c0-102.741333 66.730667-213.333333 213.333333-213.333334 107.008 0 190.762667 56.576 230.570667 125.354667L611.968 682.666667H853.333333v-241.365334l-91.562666 91.562667C704.768 448.469333 601.130667 384 469.333333 384c-196.096 0-298.666667 150.229333-298.666666 298.666667h85.333333z" fill="" p-id="2041"></path>
  87. </svg>
  88. </li>
  89. <li code='undo'>
  90. <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
  91. <path d="M170.666667 682.666667h241.365333l-87.936-87.978667C363.904 525.909333 447.658667 469.333333 554.666667 469.333333c146.602667 0 213.333333 110.592 213.333333 213.333334h85.333333c0-148.437333-102.570667-298.666667-298.666666-298.666667-131.797333 0-235.392 64.469333-292.48 148.821333L170.666667 441.301333V682.666667z" fill="" p-id="2764"></path>
  92. </svg>
  93. </li>
  94. <li code='zoomOut'>
  95. <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
  96. <path d="M658.432 428.736a33.216 33.216 0 0 1-33.152 33.152H525.824v99.456a33.216 33.216 0 0 1-66.304 0V461.888H360.064a33.152 33.152 0 0 1 0-66.304H459.52V296.128a33.152 33.152 0 0 1 66.304 0V395.52H625.28c18.24 0 33.152 14.848 33.152 33.152z m299.776 521.792a43.328 43.328 0 0 1-60.864-6.912l-189.248-220.992a362.368 362.368 0 0 1-215.36 70.848 364.8 364.8 0 1 1 364.8-364.736 363.072 363.072 0 0 1-86.912 235.968l192.384 224.64a43.392 43.392 0 0 1-4.8 61.184z m-465.536-223.36a298.816 298.816 0 0 0 298.432-298.432 298.816 298.816 0 0 0-298.432-298.432A298.816 298.816 0 0 0 194.24 428.8a298.816 298.816 0 0 0 298.432 298.432z"></path>
  97. </svg>
  98. </li>
  99. <li code='zoomIn'>
  100. <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24">
  101. <path d="M639.936 416a32 32 0 0 1-32 32h-256a32 32 0 0 1 0-64h256a32 32 0 0 1 32 32z m289.28 503.552a41.792 41.792 0 0 1-58.752-6.656l-182.656-213.248A349.76 349.76 0 0 1 480 768 352 352 0 1 1 832 416a350.4 350.4 0 0 1-83.84 227.712l185.664 216.768a41.856 41.856 0 0 1-4.608 59.072zM479.936 704c158.784 0 288-129.216 288-288S638.72 128 479.936 128a288.32 288.32 0 0 0-288 288c0 158.784 129.216 288 288 288z" p-id="3853"></path>
  102. </svg>
  103. </li>
  104. <li code='realZoom'>
  105. <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">
  106. <path d="M384 320v384H320V320h64z m256 0v384H576V320h64zM512 576v64H448V576h64z m0-192v64H448V384h64z m355.968 576H92.032A28.16 28.16 0 0 1 64 931.968V28.032C64 12.608 76.608 0 95.168 0h610.368L896 192v739.968a28.16 28.16 0 0 1-28.032 28.032zM704 64v128h128l-128-128z m128 192h-190.464V64H128v832h704V256z"></path>
  107. </svg>
  108. </li>
  109. <li code='autoZoom'>
  110. <svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="24">
  111. <path d="M684.288 305.28l0.128-0.64-0.128-0.64V99.712c0-19.84 15.552-35.904 34.496-35.712a35.072 35.072 0 0 1 34.56 35.776v171.008h170.944c19.648 0 35.84 15.488 35.712 34.432a35.072 35.072 0 0 1-35.84 34.496h-204.16l-0.64-0.128a32.768 32.768 0 0 1-20.864-7.552c-1.344-1.024-2.816-1.664-3.968-2.816-0.384-0.32-0.512-0.768-0.832-1.088a33.472 33.472 0 0 1-9.408-22.848zM305.28 64a35.072 35.072 0 0 0-34.56 35.776v171.008H99.776A35.072 35.072 0 0 0 64 305.216c0 18.944 15.872 34.496 35.84 34.496h204.16l0.64-0.128a32.896 32.896 0 0 0 20.864-7.552c1.344-1.024 2.816-1.664 3.904-2.816 0.384-0.32 0.512-0.768 0.768-1.088a33.024 33.024 0 0 0 9.536-22.848l-0.128-0.64 0.128-0.704V99.712A35.008 35.008 0 0 0 305.216 64z m618.944 620.288h-204.16l-0.64 0.128-0.512-0.128c-7.808 0-14.72 3.2-20.48 7.68-1.28 1.024-2.752 1.664-3.84 2.752-0.384 0.32-0.512 0.768-0.832 1.088a33.664 33.664 0 0 0-9.408 22.912l0.128 0.64-0.128 0.704v204.288c0 19.712 15.552 35.904 34.496 35.712a35.072 35.072 0 0 0 34.56-35.776V753.28h170.944c19.648 0 35.84-15.488 35.712-34.432a35.072 35.072 0 0 0-35.84-34.496z m-593.92 11.52c-0.256-0.32-0.384-0.768-0.768-1.088-1.088-1.088-2.56-1.728-3.84-2.688a33.088 33.088 0 0 0-20.48-7.68l-0.512 0.064-0.64-0.128H99.84a35.072 35.072 0 0 0-35.84 34.496 35.072 35.072 0 0 0 35.712 34.432H270.72v171.008c0 19.84 15.552 35.84 34.56 35.776a35.008 35.008 0 0 0 34.432-35.712V720l-0.128-0.64 0.128-0.704a33.344 33.344 0 0 0-9.472-22.848zM512 374.144a137.92 137.92 0 1 0 0.128 275.84A137.92 137.92 0 0 0 512 374.08z"></path>
  112. </svg>
  113. </li>
  114. </ul>
  115. `},zoomSensitivity:2}},t.prototype.init=function(){var e=this,r=this.get("graph"),n=this.get("getContent"),a=n(r),i=a;(0,m.isString)(a)&&(i=(0,Aa.Z)(a));var o=this.get("className");i.setAttribute("class",o||"g6-component-toolbar");var s=this.get("container");s||(s=this.get("graph").get("container")),(0,m.isString)(s)&&(s=document.getElementById(s)),s.appendChild(i),this.set("toolBar",i);var l=this.get("handleClick");i.addEventListener("click",function(p){var D=Kc(p).filter(function(F){return F.nodeName==="LI"});if(D.length!==0){var I=D[0].getAttribute("code");!I||(l?l(I,r):e.handleDefaultOperator(I))}});var h=this.get("position");h&&(0,Kn.Z)(i,{top:"".concat(h.y,"px"),left:"".concat(h.x,"px")}),this.bindUndoRedo()},t.prototype.bindUndoRedo=function(){var e=this.get("graph"),r=document.querySelector('.g6-component-toolbar li[code="undo"]'),n=document.querySelector('.g6-component-toolbar li[code="undo"] svg'),a=document.querySelector('.g6-component-toolbar li[code="redo"]'),i=document.querySelector('.g6-component-toolbar li[code="redo"] svg');!r||!n||!a||!i||(r.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4"),a.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4"),e.on("stackchange",function(o){var s=o.undoStack,l=o.redoStack,h=s.length,p=l.length;h===0?(r.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4")):(r.removeAttribute("style"),n.removeAttribute("style")),p===0?(a.setAttribute("style","cursor: not-allowed"),i.setAttribute("style","opacity: 0.4")):(a.removeAttribute("style"),i.removeAttribute("style"))}))},t.prototype.undo=function(){var e=this.get("graph"),r=e.getUndoStack();if(!(!r||r.length===0)){var n=r.pop();if(n){var a=n.action;e.pushStack(a,(0,m.clone)(n.data),"redo");var i=n.data.before;if(a==="add"&&(i=n.data.after),!i)return;switch(a){case"visible":{Object.keys(i).forEach(function(p){var D=i[p];!D||D.forEach(function(I){var F=e.findById(I.id);I.visible?e.showItem(F,!1):e.hideItem(F,!1)})});break}case"render":case"update":Object.keys(i).forEach(function(p){var D=i[p];!D||D.forEach(function(I){var F=e.findById(I.id);delete I.id,e.updateItem(F,I,!1),F.getType()==="combo"&&e.updateCombo(F)})});break;case"changedata":e.changeData(i,!1);break;case"delete":{Object.keys(i).forEach(function(p){var D=i[p];!D||D.forEach(function(I){var F=I.itemType;delete I.itemType,e.addItem(F,I,!1)})});break}case"add":Object.keys(i).forEach(function(p){var D=i[p];!D||D.forEach(function(I){e.removeItem(I.id,!1)})});break;case"updateComboTree":Object.keys(i).forEach(function(p){var D=i[p];!D||D.forEach(function(I){e.updateComboTree(I.id,I.parentId,!1)})});break;case"createCombo":var o=n.data.after.combos,s=o[o.length-1];Object.keys(i).forEach(function(p){var D=i[p];!D||D.forEach(function(I){e.updateComboTree(I.id,I.parentId,!1)})}),e.removeItem(s.id,!1);break;case"uncombo":var l=i.combos[i.combos.length-1],h=i.nodes.concat(i.combos).map(function(p){return p.id}).filter(function(p){return p!==l.id});e.createCombo(l,h,!1);break;case"layout":e.updateLayout(i,void 0,void 0,!1);break;default:}}}},t.prototype.redo=function(){var e=this.get("graph"),r=e.getRedoStack();if(!(!r||r.length===0)){var n=r.pop();if(n){var a=n.action,i=n.data.after;if(e.pushStack(a,(0,m.clone)(n.data)),a==="delete"&&(i=n.data.before),!i)return;switch(a){case"visible":{Object.keys(i).forEach(function(h){var p=i[h];!p||p.forEach(function(D){var I=e.findById(D.id);D.visible?e.showItem(I,!1):e.hideItem(I,!1)})});break}case"render":case"update":Object.keys(i).forEach(function(h){var p=i[h];!p||p.forEach(function(D){var I=e.findById(D.id);delete D.id,e.updateItem(I,D,!1),I.getType()==="combo"&&e.updateCombo(I)})});break;case"changedata":e.changeData(i,!1);break;case"delete":i.edges&&i.edges.forEach(function(h){e.removeItem(h.id,!1)}),i.nodes&&i.nodes.forEach(function(h){e.removeItem(h.id,!1)}),i.combos&&i.combos.forEach(function(h){e.removeItem(h.id,!1)});break;case"add":{Object.keys(i).forEach(function(h){var p=i[h];!p||p.forEach(function(D){var I=D.itemType;delete D.itemType,e.addItem(I,D,!1)})});break}case"updateComboTree":Object.keys(i).forEach(function(h){var p=i[h];!p||p.forEach(function(D){e.updateComboTree(D.id,D.parentId,!1)})});break;case"createCombo":var o=i.combos[i.combos.length-1];e.createCombo(o,o.children.map(function(h){return h.id}),!1);break;case"uncombo":var s=n.data.before.combos,l=s[s.length-1];e.uncombo(l.id,!1);break;case"layout":e.updateLayout(i,void 0,void 0,!1);break;default:}}}},t.prototype.zoomOut=function(){var e=this.get("graph"),r=e.getZoom(),n=1/(1-ic*this.get("zoomSensitivity")),a=this.get("maxZoom")||e.get("maxZoom");n*r>a||e.zoomTo(r*n)},t.prototype.zoomIn=function(){var e=this.get("graph"),r=e.getZoom(),n=1-ic*this.get("zoomSensitivity"),a=this.get("minZoom")||e.get("minZoom");n*r<a||e.zoomTo(r*n)},t.prototype.realZoom=function(){var e=this.get("graph");e.zoomTo(1)},t.prototype.autoZoom=function(){var e=this.get("graph");e.fitView([20,20])},t.prototype.handleDefaultOperator=function(e){switch(e){case"redo":this.redo();break;case"undo":this.undo();break;case"zoomOut":this.zoomOut();break;case"zoomIn":this.zoomIn();break;case"realZoom":this.realZoom();break;case"autoZoom":this.autoZoom();break;default:}},t.prototype.destroy=function(){var e=this.get("toolBar");if(e){var r=this.get("container");r||(r=this.get("graph").get("container")),(0,m.isString)(r)&&(r=document.getElementById(r)),r.removeChild(e)}var n=this.get("handleClick");n&&e.removeEventListener("click",n)},t}(Qi),ve=wf,We=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();typeof document!="undefined"&&pi()(`
  116. .g6-component-tooltip {
  117. border: 1px solid #e2e2e2;
  118. border-radius: 4px;
  119. font-size: 12px;
  120. color: #545454;
  121. background-color: rgba(255, 255, 255, 0.9);
  122. padding: 10px 8px;
  123. box-shadow: rgb(174, 174, 174) 0px 0px 10px;
  124. }
  125. .tooltip-type {
  126. padding: 0;
  127. margin: 0;
  128. }
  129. .tooltip-id {
  130. color: #531dab;
  131. }
  132. `);var it=function(c){We(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,getContent:function(r){return`
  133. <h4 class='tooltip-type'>\u7C7B\u578B\uFF1A`.concat(r.item.getType(),`</h4>
  134. <span class='tooltip-id'>ID\uFF1A`).concat(r.item.getID(),`</span>
  135. `)},shouldBegin:function(r){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},t.prototype.getEvents=function(){return this.get("trigger")==="click"?{"node:click":"onClick","edge:click":"onClick","combo:click":"onClick","canvas:click":"onMouseLeave",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave",drag:"onMouseLeave"}:{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove","edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove","combo:mouseenter":"onMouseEnter","combo:mouseleave":"onMouseLeave","combo:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave",contextmenu:"onMouseLeave","node:drag":"onMouseLeave"}},t.prototype.init=function(){var e=this,r=e.get("className")||"g6-component-tooltip",n=(0,Aa.Z)("<div class='".concat(r,"'></div>")),a=e.get("container");a||(a=e.get("graph").get("container")),(0,m.isString)(a)&&(a=document.getElementById(a)),(0,Kn.Z)(n,{position:"absolute",visibility:"hidden",display:"none"}),a.appendChild(n),e.get("trigger")!=="click"&&(n.addEventListener("mouseenter",function(i){(0,Kn.Z)(n,{visibility:"visible",display:"unset"})}),n.addEventListener("mouseleave",function(i){e.hideTooltip()})),e.set("tooltip",n)},t.prototype.onClick=function(e){var r=this.get("itemTypes");if(!(e.item&&e.item.getType&&r.indexOf(e.item.getType())===-1)){var n=e.item,a=this.get("graph");this.currentTarget===n?(this.currentTarget=null,this.hideTooltip(),a.emit("tooltipchange",{item:e.item,action:"hide"})):(this.currentTarget=n,this.showTooltip(e),a.emit("tooltipchange",{item:e.item,action:"show"}))}},t.prototype.onMouseEnter=function(e){var r=this.get("itemTypes");if(!(e.item&&e.item.getType&&r.indexOf(e.item.getType())===-1)){var n=e.item,a=this.get("graph");this.currentTarget=n,this.showTooltip(e),a.emit("tooltipchange",{item:e.item,action:"show"})}},t.prototype.onMouseMove=function(e){var r=this.get("itemTypes");e.item&&e.item.getType&&r.indexOf(e.item.getType())===-1||!this.currentTarget||e.item!==this.currentTarget||this.showTooltip(e)},t.prototype.onMouseLeave=function(){this.hideTooltip();var e=this.get("graph");e.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},t.prototype.clearContainer=function(){var e=this.get("tooltip");e&&(e.innerHTML="")},t.prototype.showTooltip=function(e){if(!!e.item){var r=this.get("itemTypes");if(!(e.item.getType&&r.indexOf(e.item.getType())===-1)){var n=this.get("tooltip"),a=this.get("getContent"),i=a(e);(0,m.isString)(i)?n.innerHTML=i:(this.clearContainer(),n.appendChild(i)),this.updatePosition(e)}}},t.prototype.hideTooltip=function(){var e=this.get("tooltip");e&&(0,Kn.Z)(e,{visibility:"hidden",display:"none"})},t.prototype.updatePosition=function(e){var r=this.get("shouldBegin"),n=this.get("tooltip");if(!r(e)){(0,Kn.Z)(n,{visibility:"hidden",display:"none"});return}var a=this.get("graph"),i=a.get("width"),o=a.get("height"),s=this.get("offsetX")||0,l=this.get("offsetY")||0,h=a.getPointByClient(e.clientX,e.clientY),p=this.get("fixToNode"),D=e.item;if(D.getType&&D.getType()==="node"&&p&&(0,m.isArray)(p)&&p.length>=2){var I=D.getBBox();h={x:I.minX+I.width*p[0],y:I.minY+I.height*p[1]}}var F=a.getCanvasByPoint(h.x,h.y),Z=F.x,ee=F.y,se=a.getContainer(),oe={x:Z+se.offsetLeft+s,y:ee+se.offsetTop+l};(0,Kn.Z)(n,{visibility:"visible",display:"unset"});var ce=n.getBoundingClientRect();Z+ce.width+s>i&&(oe.x-=ce.width+s),ee+ce.height+l>o&&(oe.y-=ce.height+l,oe.y<0&&(oe.y=0)),(0,Kn.Z)(n,{left:"".concat(oe.x,"px"),top:"".concat(oe.y,"px")})},t.prototype.hide=function(){this.onMouseLeave()},t.prototype.destroy=function(){var e=this.get("tooltip");if(e){var r=this.get("container");r||(r=this.get("graph").get("container")),(0,m.isString)(r)&&(r=document.getElementById(r)),r.removeChild(e)}},t}(Qi),Zt=it,dr=z(86429),Yt=function(c,t,e){if(e||arguments.length===2)for(var r=0,n=t.length,a;r<n;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return c.concat(a||Array.prototype.slice.call(t))};function ar(c){return(0,m.map)(c,function(t,e){var r=e===0?"M":"L",n=t[0],a=t[1];return[r,n,a]})}function Mr(c){return ar(c)}function Ir(c){if(c.length<=2)return Mr(c);var t=[];(0,m.each)(c,function(i){(0,m.isEqual)(i,t.slice(t.length-2))||t.push(i[0],i[1])});var e=mu.e9(t,!1),r=(0,m.head)(c),n=r[0],a=r[1];return e.unshift(["M",n,a]),e}function Ar(c,t,e,r){r===void 0&&(r=!0);var n=new dr.bJ({values:c}),a=new dr.WD({values:(0,m.map)(c,function(o,s){return s})}),i=(0,m.map)(c,function(o,s){return[a.scale(s)*t,e-n.scale(o)*e]});return r?Ir(i):Mr(i)}function Tr(c,t,e,r){r===void 0&&(r=5);for(var n=new dr.bJ({values:c}),a=new dr.WD({values:(0,m.map)(c,function(D,I){return I})}),i=(0,m.map)(c,function(D,I){return[a.scale(I)*t,e-n.scale(D)*e]}),o=[],s=0;s<i.length;s++){var l=i[s],h={x:l[0],y:l[1],y0:e,size:r},p=M(h);o.push.apply(o,p)}return G(o)}function zr(c,t){var e=new dr.bJ({values:c}),r=Math.max(0,e.min);return t-e.scale(r)*t}function f(c,t,e,r){var n=Yt([],c,!0),a=zr(r,e);return n.push(["L",t,a]),n.push(["L",0,a]),n.push(["Z"]),n}function M(c){var t=c.x,e=c.y,r=c.y0,n=c.size,a,i;(0,m.isArray)(e)?(a=e[0],i=e[1]):(a=r,i=e);var o,s;(0,m.isArray)(t)?(o=t[0],s=t[1]):(o=t-n/2,s=t+n/2);var l=[{x:o,y:a},{x:o,y:i}];return l.push({x:s,y:i},{x:s,y:a}),l}function G(c,t){t===void 0&&(t=!0);var e=[],r=c[0];e.push(["M",r.x,r.y]);for(var n=1,a=c.length;n<a;n++)e.push(["L",c[n].x,c[n].y]);return t&&(e.push(["L",r.x,r.y]),e.push(["z"])),e}var Y=function(){return Y=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Y.apply(this,arguments)},re={stroke:"#C5C5C5",strokeOpacity:.85},ie={fill:"#CACED4",opacity:.85},le=function(){function c(t){var e=t.x,r=e===void 0?0:e,n=t.y,a=n===void 0?0:n,i=t.width,o=i===void 0?200:i,s=t.height,l=s===void 0?26:s,h=t.smooth,p=h===void 0?!0:h,D=t.isArea,I=D===void 0?!1:D,F=t.data,Z=F===void 0?[]:F,ee=t.lineStyle,se=t.areaStyle,oe=t.group,ce=t.interval,we=ce===void 0?null:ce;this.group=oe,this.x=r,this.y=a,this.width=o,this.height=l,this.data=Z,this.smooth=p,this.isArea=I,this.lineStyle=Object.assign({},re,ee),this.areaStyle=Object.assign({},ie,se),this.intervalConfig=we,this.renderLine()}return c.prototype.renderLine=function(){var t=this,e=t.x,r=t.y,n=t.width,a=t.height,i=t.barWidth,o=t.data,s=t.smooth,l=t.isArea,h=t.lineStyle,p=t.areaStyle,D=this.group.addGroup({name:"trend-group"});if(o){var I=Ar(o,n,a,s);if(D.addShape("path",{attrs:Y({path:I},h),name:"trend-line"}),l){var F=f(I,n,a,o);D.addShape("path",{attrs:Y({path:F},p),name:"trend-area"})}}this.intervalConfig&&D.addShape("path",{attrs:Y({path:Tr(this.intervalConfig.data,n,a,this.intervalConfig.style.barWidth)},this.intervalConfig.style),name:"trend-interval"}),D.move(e,r)},c.prototype.destory=function(){this.group.destroy()},c}(),ge=le,me=function(){return me=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},me.apply(this,arguments)},Le={fill:"#1890ff",stroke:"#1890ff",type:"trend",radius:2,opacity:1,cursor:"ew-resize",highLightFill:"#0050b3"},ze={fill:"#fff",stroke:"#1890ff",radius:2,opacity:1,cursor:"ew-resize"},Fe=function(){function c(t){var e=t.group,r=t.name,n=t.type,a=t.x,i=a===void 0?0:a,o=t.y,s=o===void 0?0:o,l=t.width,h=l===void 0?2:l,p=t.height,D=p===void 0?24:p,I=t.style,F=I===void 0?{}:I;this.group=e,this.name=r,this.handleType=n,this.x=i,this.y=s,this.width=h,this.height=D,n==="trend"?this.style=me(me({},Le),F):n==="simple"&&(this.style=me(me({},ze),F)),this.renderHandle()}return c.prototype.setX=function(t){this.setXY(t,void 0)},c.prototype.setY=function(t){this.setXY(void 0,t)},c.prototype.setXY=function(t,e){(0,m.isNumber)(t)&&(this.x=t),(0,m.isNumber)(e)&&(this.y=e),this.updateXY()},c.prototype.renderHandle=function(){var t=this,e=t.width,r=t.height,n=t.style,a=t.name,i=n.fill,o=n.stroke,s=n.radius,l=n.opacity,h=n.cursor;this.handleGroup=this.group.addGroup(),this.handleType==="trend"?(this.verticalLine=this.handleGroup.addShape("rect",{attrs:{x:0,y:0,width:e,height:r,fill:i,stroke:o,radius:s,opacity:l,cursor:h},name:"".concat(a,"-handler")}),this.topCircle=this.handleGroup.addShape("circle",{attrs:{x:e/2,y:0,r:2*e,fill:i,stroke:o,radius:s,opacity:l,cursor:h,lineAppendWidth:12},name:"".concat(a,"-handler")}),this.bottomCircle=this.handleGroup.addShape("circle",{attrs:{x:e/2,y:r,r:2*e,fill:i,stroke:o,radius:s,opacity:l,cursor:h},name:"".concat(a,"-handler")})):this.handleType==="simple"&&(this.topCircle=this.handleGroup.addShape("circle",{attrs:{x:e/2,y:r/2,r:2*e,fill:i,stroke:o,radius:s,opacity:l,cursor:h,lineWidth:2},name:"".concat(a,"-handler")})),this.updateXY(),this.handleType==="trend"?this.bindTrendEvents():this.handleType==="simple"&&this.bindSimpleEvents()},c.prototype.bindSimpleEvents=function(){var t=this,e=this.name;this.handleGroup.on("".concat(e,"-handler:mouseenter"),function(){var r=t.style.highLightFill;t.topCircle.attr("fill",r)}),this.handleGroup.on("".concat(e,"-handler:mouseleave"),function(){var r=t.style.fill;t.topCircle.attr("fill",r)})},c.prototype.bindTrendEvents=function(){var t=this,e=this.name;this.handleGroup.on("".concat(e,"-handler:mouseenter"),function(){var r=t.style.highLightFill;t.verticalLine.attr("fill",r),t.topCircle.attr("fill",r),t.bottomCircle.attr("fill",r)}),this.handleGroup.on("".concat(e,"-handler:mouseleave"),function(){var r=t.style.fill;t.verticalLine.attr("fill",r),t.topCircle.attr("fill",r),t.bottomCircle.attr("fill",r)})},c.prototype.show=function(){this.handleGroup.show()},c.prototype.hide=function(){this.handleGroup.hide()},c.prototype.updateXY=function(){this.handleGroup.setMatrix([1,0,0,0,1,0,this.x,this.y,1])},c}(),tt=Fe,Mt="timebarstartplay",sr="timebarendplay",Tt="valuechange",Nt="timebarConfigChanged",Lt="playPauseBtn",_r="nextStepBtn",Yr="preStepBtn",Pr=function(){return Pr=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Pr.apply(this,arguments)},dn=function(){function c(t){this.config=(0,m.deepMix)({},t),this.init()}return c.prototype.update=function(t){this.config=(0,m.deepMix)({},this.config,t),this.updateElement(),this.renderMarker()},c.prototype.init=function(){this.initElement(),this.renderMarker()},c.prototype.initElement=function(){var t=this.config,e=t.group,r=t.style,n=r.scale,a=n===void 0?1:n,i=r.offsetX,o=i===void 0?0:i,s=r.offsetY,l=s===void 0?0:s,h=this.config.x+o,p=this.config.y+l,D=e.addGroup({name:Lt});this.startMarkerGroup=D.addGroup({name:Lt}),this.circle=e.addShape("circle",{attrs:Pr({x:h,y:p,r:this.config.r*a},r),name:Lt}),this.startMarker=this.startMarkerGroup.addShape("path",{attrs:{path:this.getStartMarkerPath(h,p,a),fill:r.stroke||"#aaa"},name:"start-marker"}),this.pauseMarkerGroup=D.addGroup({name:Lt});var I=.25*this.config.r*a,F=.5*this.config.r*Math.sqrt(3)*a;this.pauseLeftMarker=this.pauseMarkerGroup.addShape("rect",{attrs:{x:h-.375*this.config.r*a,y:p-F/2,width:I,height:F,fill:r.stroke||"#aaa",lineWidth:0}}),this.pauseRightMarker=this.pauseMarkerGroup.addShape("rect",{attrs:{x:h+1/8*this.config.r*a,y:p-F/2,width:I,height:F,fill:r.stroke||"#aaa",lineWidth:0}})},c.prototype.updateElement=function(){var t=this.config.style,e=t.scale,r=e===void 0?1:e,n=t.offsetX,a=n===void 0?0:n,i=t.offsetY,o=i===void 0?0:i,s=this.config.x+a,l=this.config.y+o;this.circle.attr("x",s),this.circle.attr("y",l),this.circle.attr("r",this.config.r*r),this.startMarker.attr("path",this.getStartMarkerPath(s,l,r));var h=.25*this.config.r*r,p=.5*this.config.r*Math.sqrt(3)*r;this.pauseLeftMarker.attr("x",s-(1/4+1/8)*this.config.r*r),this.pauseLeftMarker.attr("y",l-p/2),this.pauseLeftMarker.attr("width",h),this.pauseLeftMarker.attr("height",p),this.pauseRightMarker.attr("x",s+1/8*this.config.r*r),this.pauseRightMarker.attr("y",l-p/2),this.pauseRightMarker.attr("width",h),this.pauseRightMarker.attr("height",p)},c.prototype.renderMarker=function(){this.config.isPlay?(this.startMarkerGroup.hide(),this.pauseMarkerGroup.show()):(this.startMarkerGroup.show(),this.pauseMarkerGroup.hide())},c.prototype.getStartMarkerPath=function(t,e,r){var n=.5*this.config.r*Math.sqrt(3)*r;return[["M",t-n/Math.sqrt(3)/2,e-n/2],["L",t+n/Math.sqrt(3),e],["L",t-n/Math.sqrt(3)/2,e+n/2]]},c}(),sn=dn,tn=function(){return tn=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},tn.apply(this,arguments)},Bn=q.vs,Fn="#aaa",za="green",Wn={fill:"#aaa",fillOpacity:.35,stroke:"#aaa"},ti={fill:"#fff"},La={fill:"green"},oa={pointer:{fill:"#aaa",lineWidth:0},scroller:{stroke:"#aaa",fill:"#aaa",lineWidth:1,lineAppendWidth:5,cursor:"pointer"},text:{fill:"#aaa",textBaseline:"top"}},Za={check:{stroke:"green",lineWidth:3},box:{fill:"#fff",stroke:"#aaa",lineWidth:2,radius:3,width:12,height:12},text:{fill:"#aaa",fontSize:12,textBaseline:"top"}},ri={speed:1,loop:!1,fill:"#fff",stroke:"#fff",hideTimeTypeController:!1,preBtnStyle:{fill:"#aaa",stroke:"#aaa"},nextBtnStyle:{fill:"#aaa",stroke:"#aaa"},playBtnStyle:{fill:"#aaa",stroke:"#aaa",fillOpacity:.05},speedControllerStyle:oa,timeTypeControllerStyle:Za},li=110,ii=50,Pa={SINGLE:"single",RANGE:"range"},Hn=function(){function c(t){this.controllerCfg=(0,m.deepMix)({},ri,t),this.group=t.group,this.controllerGroup=this.group.addGroup({name:"controller-group"}),this.speedAxisY=[],this.currentSpeed=this.controllerCfg.speed,this.currentType=this.controllerCfg.defaultTimeType||Pa.RANGE,this.fontFamily=t.fontFamily||"Arial, sans-serif",this.init()}return c.prototype.init=function(){this.renderPlayButton()},c.prototype.getNextMarkerPath=function(t,e,r){return[["M",t,e-r],["L",t+r,e],["L",t,e+r],["Z",t,e-r],["M",t,e],["L",t-r,e-r],["L",t-r,e+r],["Z"]]},c.prototype.getPreMarkerPath=function(t,e,r){return[["M",t,e-r],["L",t-r,e],["L",t,e+r],["L",t,e-r],["M",t,e],["L",t+r,e-r],["L",t+r,e+r],["Z"]]},c.prototype.renderPlayButton=function(){var t=this.controllerCfg,e=t.width,r=t.height,n=t.x,a=t.y,i=t.hideTimeTypeController,o=t.fill,s=o===void 0?Fn:o,l=t.stroke,h=l===void 0?za:l,p=t.containerStyle,D=p===void 0?{}:p,I=tn(tn({},Wn),t.playBtnStyle||{}),F=tn(tn({},ti),t.preBtnStyle||{}),Z=tn(tn({},La),t.nextBtnStyle||{}),ee=r/2-5,se=a+10,oe=this.controllerGroup.addShape("rect",{attrs:tn({x:n,y:se,width:e,height:r,stroke:h,fill:s},D),name:"container-rect"});this.playButton?this.playButton.update({x:e/2,y:se,r:ee}):this.playButton=new sn({group:this.controllerGroup,x:e/2,y:se+ee+5,r:ee,isPlay:this.isPlay,style:I});var ce=F.offsetX||0,we=F.offsetY||0,Re=(F.scale||1)*ee;this.controllerGroup.addShape("path",{attrs:tn({path:this.getPreMarkerPath(e/2-5*ee+ce,se+ee+5+we,Re*.5)},F),name:Yr});var Oe=Z.offsetX||0,Pe=Z.offsetY||0,He=(Z.scale||1)*ee;this.controllerGroup.addShape("path",{attrs:tn({path:this.getNextMarkerPath(e/2+5*ee+Oe,se+ee+5+Pe,He*.5)},Z),name:_r}),oe.toBack(),this.renderSpeedBtn(),i||this.renderToggleTime(),this.bindEvent();var at=this.controllerCfg.scale,qe=at===void 0?1:at,yt=this.controllerGroup.getCanvasBBox(),Ft=(yt.maxX+yt.minX)/2,yr=(yt.maxY+yt.minY)/2,fr=Bn([1,0,0,0,1,0,0,0,1],[["t",-Ft,-yr],["s",qe,qe],["t",Ft,yr]]);this.controllerGroup.setMatrix(fr)},c.prototype.renderSpeedBtn=function(){var t=this.controllerCfg,e=t.y,r=t.width,n=t.hideTimeTypeController,a=tn(tn({},oa),this.controllerCfg.speedControllerStyle||{}),i=a.scroller,o=i===void 0?{}:i,s=a.text,l=s===void 0?{}:s,h=a.pointer,p=h===void 0?{}:h,D=a.scale,I=D===void 0?1:D,F=a.offsetX,Z=F===void 0?0:F,ee=a.offsetY,se=ee===void 0?0:ee,oe=this.controllerGroup.addGroup({name:"speed-group"});this.speedGroup=oe;var ce=[],we=5;this.speedAxisY=[19,22,26,32,39];for(var Re=0;Re<5;Re++){var Oe=e+this.speedAxisY[Re],Pe=r-(n?ii:li);oe.addShape("line",{attrs:tn({x1:Pe,x2:Pe+15,y1:Oe,y2:Oe},o),speed:we,name:"speed-rect"}),this.speedAxisY[Re]=Oe,ce.push(we),we=we-1}this.speedText=oe.addShape("text",{attrs:tn({x:r-(n?ii:li)+20,y:this.speedAxisY[0]+4,text:"1.0X",fontFamily:this.fontFamily||"Arial, sans-serif"},l),name:"speed-text"}),this.speedPoint=oe.addShape("path",{attrs:tn({path:this.getPointerPath(r-(n?ii:li),0),matrix:[1,0,0,0,1,0,0,this.speedAxisY[4],1]},p),name:"speed-pointer"});var He=this.speedGroup.getCanvasBBox(),at=(He.maxX+He.minX)/2,qe=(He.maxY+He.minY)/2,yt=this.speedGroup.getMatrix()||[1,0,0,0,1,0,0,0,1];yt=Bn(yt,[["t",-at,-qe],["s",I,I],["t",at+Z*I,qe+se*I]]),this.speedGroup.setMatrix(yt)},c.prototype.getPointerPath=function(t,e){return[["M",t,e],["L",t-10,e-4],["L",t-10,e+4],["Z"]]},c.prototype.renderToggleTime=function(){var t,e,r=this.controllerCfg,n=r.width,a=r.defaultTimeType,i=tn(tn({},Za),this.controllerCfg.timeTypeControllerStyle||{}),o=i.scale,s=o===void 0?1:o,l=i.offsetX,h=l===void 0?0:l,p=i.offsetY,D=p===void 0?0:p,I=i.box,F=I===void 0?{}:I,Z=i.check,ee=Z===void 0?{}:Z,se=i.text,oe=se===void 0?{}:se;this.toggleGroup=this.controllerGroup.addGroup({name:"toggle-group"});var ce=a===Pa.SINGLE;this.toggleGroup.addShape("rect",{attrs:tn({x:n-ii,y:this.speedAxisY[0]+3.5},F),isChecked:ce,name:"toggle-model"}),this.checkedIcon=this.toggleGroup.addShape("path",{attrs:tn({path:[["M",n-ii+3,this.speedAxisY[1]+6],["L",n-ii+7,this.speedAxisY[1]+10],["L",n-ii+12,this.speedAxisY[1]+4]]},ee),capture:!1,name:"check-icon"}),ce||this.checkedIcon.hide(),this.checkedText=this.toggleGroup.addShape("text",{attrs:tn({text:ce?((t=this.controllerCfg)===null||t===void 0?void 0:t.timeRangeControllerText)||"\u65F6\u95F4\u8303\u56F4":((e=this.controllerCfg)===null||e===void 0?void 0:e.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4",x:n-ii+15,y:this.speedAxisY[0]+4,fontFamily:typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif"},oe),name:"checked-text"});var we=this.toggleGroup.getCanvasBBox(),Re=(we.maxX+we.minX)/2,Oe=(we.maxY+we.minY)/2,Pe=this.toggleGroup.getMatrix()||[1,0,0,0,1,0,0,0,1];Pe=Bn(Pe,[["t",-Re,-Oe],["s",s,s],["t",Re+h*s,Oe+D*s]]),this.toggleGroup.setMatrix(Pe)},c.prototype.bindEvent=function(){var t=this;this.speedGroup.on("speed-rect:click",function(e){var r=e.target.attr("y1"),n=t.speedPoint.attr("matrix"),a=t.speedAxisY.indexOf(n[7]||0),i=t.speedAxisY.indexOf(r),o=t.speedAxisY[i]-t.speedAxisY[a];n=Bn(n,[["t",0,o]]),t.speedPoint.setMatrix(n),t.currentSpeed=t.speedAxisY.length-i,t.speedText.attr("text","".concat(t.currentSpeed,".0X")),t.group.emit(Nt,{speed:t.currentSpeed,type:t.currentType})}),this.speedGroup.on("mousewheel",function(e){e.preventDefault();var r=t.speedPoint.attr("matrix")||[1,0,0,0,1,0,0,0,1],n=r[7],a=t.speedAxisY.indexOf(n);if(a===-1){var i=Infinity;t.speedAxisY.forEach(function(s,l){var h=Math.abs(s-n);i>h&&(i=h,a=l)})}e.originalEvent.deltaY>0?a=Math.max(0,a-1):a=Math.min(t.speedAxisY.length-1,a+1);var o=t.speedAxisY[a]-n;r=Bn(r,[["t",0,o]]),t.speedPoint.setMatrix(r),t.currentSpeed=t.speedAxisY.length-a,t.speedText.attr("text","".concat(t.currentSpeed,".0X")),t.group.emit(Nt,{speed:t.currentSpeed,type:t.currentType})}),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",function(e){var r,n,a=e.target.get("isChecked");a?(t.checkedIcon.hide(),t.checkedText.attr("text",((n=t.controllerCfg)===null||n===void 0?void 0:n.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4"),t.currentType=Pa.RANGE):(t.checkedIcon.show(),t.checkedText.attr("text",((r=t.controllerCfg)===null||r===void 0?void 0:r.timeRangeControllerText)||"\u65F6\u95F4\u8303\u56F4"),t.currentType=Pa.SINGLE),e.target.set("isChecked",!a),t.group.emit(Nt,{type:t.currentType,speed:t.currentSpeed})})},c.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},c}(),Bi=Hn,Ln=function(){return Ln=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Ln.apply(this,arguments)},On=q.vs,sa={fill:"#416180",opacity:.05},ba={fill:"#416180",opacity:.15,radius:5},yi={fill:"#5B8FF9",opacity:.3,cursor:"grab"},Ho=2,Uu={width:Ho,height:24},et={textBaseline:"middle",fill:"#000",opacity:.45},Jt={textAlign:"center",textBaseline:"top",fill:"#607889",opacity:.35},jt={lineWidth:1,stroke:"#ccc"},nn=function(){function c(t){var e=this;this.prevX=0,this.onMouseDown=function(kr){return function(Fr){e.currentHandler=kr;var Jr=Fr.originalEvent;Jr.stopPropagation(),Jr.preventDefault(),e.prevX=(0,m.get)(Jr,"touches.0.pageX",Jr.pageX);var fn=e.canvas.get("container");fn.addEventListener("mousemove",e.onMouseMove),fn.addEventListener("mouseup",e.onMouseUp),fn.addEventListener("mouseleave",e.onMouseUp),fn.addEventListener("touchmove",e.onMouseMove),fn.addEventListener("touchend",e.onMouseUp),fn.addEventListener("touchcancel",e.onMouseUp)}},this.onMouseMove=function(kr){kr.stopPropagation(),kr.preventDefault();var Fr=(0,m.get)(kr,"touches.0.pageX",kr.pageX),Jr=Fr-e.prevX,fn=e.adjustOffsetRange(Jr/e.width);e.updateStartEnd(fn),e.updateUI(),e.prevX=Fr},this.onMouseUp=function(){e.currentHandler&&(e.currentHandler=void 0);var kr=e.canvas.get("container");kr&&(kr.removeEventListener("mousemove",e.onMouseMove),kr.removeEventListener("mouseup",e.onMouseUp),kr.removeEventListener("mouseleave",e.onMouseUp),kr.removeEventListener("touchmove",e.onMouseMove),kr.removeEventListener("touchend",e.onMouseUp),kr.removeEventListener("touchcancel",e.onMouseUp))};var r=t.x,n=r===void 0?0:r,a=t.y,i=a===void 0?0:a,o=t.width,s=o===void 0?100:o,l=t.height,h=t.padding,p=h===void 0?10:h,D=t.trendCfg,I=t.controllerCfg,F=I===void 0?{speed:1}:I,Z=t.backgroundStyle,ee=Z===void 0?{}:Z,se=t.foregroundStyle,oe=se===void 0?{}:se,ce=t.handlerStyle,we=ce===void 0?{}:ce,Re=t.textStyle,Oe=Re===void 0?{}:Re,Pe=t.start,He=Pe===void 0?0:Pe,at=t.end,qe=at===void 0?1:at,yt=t.minText,Ft=yt===void 0?"":yt,yr=t.maxText,fr=yr===void 0?"":yr,lr=t.group,Kt=t.graph,jr=t.canvas,Xr=t.tick,er=Xr===void 0?{tickLabelStyle:{},tickLineStyle:{},tickLabelFormatter:function(Fr){return Fr},ticks:[]}:Xr,mr=t.type;this.graph=Kt,this.canvas=jr,this.group=lr,this.timeBarType=mr,this.x=n,this.y=i,this.width=s,this.height=l,this.padding=p,this.ticks=er.ticks,this.trendCfg=D,this.controllerCfg=F,this.currentSpeed=F.speed||1,this.tickLabelFormatter=er.tickLabelFormatter,mr==="trend"?this.backgroundStyle=Ln(Ln({},sa),ee):mr==="simple"&&(this.backgroundStyle=Ln(Ln({},ba),ee)),this.foregroundStyle=Ln(Ln({},yi),oe),this.handlerStyle=Ln(Ln({},Uu),we),this.textStyle=Ln(Ln({},et),Oe),this.tickLabelStyle=Ln(Ln({},Jt),er.tickLabelStyle),this.tickLineStyle=Ln(Ln({},jt),er.tickLineStyle),this.currentMode=F.defaultTimeType||Pa.RANGE,this.start=He,this.end=qe,this.minText=Ft,this.maxText=fr,this.fontFamily=typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif",this.renderSlider()}return c.prototype.update=function(t){var e=t.x,r=t.y,n=t.width,a=t.height,i=t.minText,o=t.maxText,s=t.start,l=t.end;this.start=Math.min(1,Math.max(s,0)),this.end=Math.min(1,Math.max(l,0)),(0,m.assign)(this,{x:e,y:r,width:n,height:a,minText:i,maxText:o}),this.updateUI()},c.prototype.setText=function(t,e){this.minTextShape.attr("text",t),this.maxTextShape.attr("text",e)},c.prototype.renderSlider=function(){var t=this,e=this,r=e.width,n=e.height,a=e.timeBarType;if(a==="trend"&&(0,m.size)((0,m.get)(this.trendCfg,"data"))){var i=new ge(Ln(Ln({x:this.x,y:this.y,width:r,height:n},this.trendCfg),{group:this.group}));this.trendComponent=i}var o=this.group.addGroup({name:"slider-group"});o.addShape("rect",{attrs:Ln({x:0,y:0,width:r,height:n},this.backgroundStyle),name:"background"});var s=this.group.addGroup();a==="trend"?(this.minTextShape=s.addShape("text",{attrs:Ln({x:0,y:n/2+this.y,textAlign:"right",text:this.minText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"min-text-shape"}),this.maxTextShape=s.addShape("text",{attrs:Ln({y:n/2+this.y,textAlign:"left",text:this.maxText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"max-text-shape"})):(this.minTextShape=s.addShape("text",{attrs:Ln({x:0,y:this.y-10,textAlign:"center",text:this.minText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"min-text-shape"}),this.maxTextShape=s.addShape("text",{attrs:Ln({y:this.y-10,textAlign:"center",text:this.maxText,silent:!1,fontFamily:this.fontFamily||"Arial, sans-serif",stroke:"#fff",lineWidth:5},this.textStyle),capture:!1,name:"max-text-shape"})),this.foregroundShape=this.group.addGroup().addShape("rect",{attrs:Ln({x:0,y:this.y,height:n},this.foregroundStyle),name:"foreground-shape"}),this.foregroundShape.on("mousedown",function(se){se.target.attr("cursor","grabbing")}),this.foregroundShape.on("mouseup",function(se){se.target.attr("cursor",t.foregroundStyle.cursor||"grab")});var l=(0,m.get)(this.handlerStyle,"width",2),h=(0,m.get)(this.handlerStyle,"height",24),p=this.group.addGroup({name:"minHandlerShape"});this.minHandlerShape=new tt({name:"minHandlerShape",group:p,type:a,x:this.x,y:this.y,width:l,height:h,style:this.handlerStyle});var D=this.group.addGroup({name:"maxHandlerShape"});this.maxHandlerShape=new tt({name:"maxHandlerShape",group:D,type:a,x:this.x,y:this.y,width:l,height:h,style:this.handlerStyle});var I=this.ticks,F=r/(I.length-1);this.tickPosList=[],this.textList&&this.textList.length&&this.textList.forEach(function(se){se.destroy()});var Z=-Infinity,ee=this.tickLabelStyle.rotate;delete this.tickLabelStyle.rotate,this.textList=I.map(function(se,oe){t.tickPosList.push(t.x+oe*F);var ce;t.tickLabelFormatter?(ce=t.tickLabelFormatter(se),!(0,m.isString)(ce)&&ce&&(ce=se.date)):ce=se.date;var we=t.x+oe*F,Re=t.y+n+5,Oe=t.group.addShape("text",{attrs:Ln({x:we,y:Re,text:ce,fontFamily:t.fontFamily||"Arial, sans-serif"},t.tickLabelStyle),name:"tick-label"});if((0,m.isNumber)(ee)&&oe!==I.length-1){var Pe=On([1,0,0,0,1,0,0,0,1],[["t",-we,-Re],["r",ee],["t",we-5,Re+2]]);Oe.attr({textAlign:"left",matrix:Pe})}oe===0?Oe.attr({textAlign:"left"}):oe!==I.length-1&&Oe.attr({textAlign:"right"});var He=t.group.addShape("line",{attrs:Ln({x1:t.x+oe*F,y1:t.y+n+2,x2:t.x+oe*F,y2:t.y+n+6},t.tickLineStyle),name:"tick-line"});He.toBack();var at=Oe.getBBox();return at.minX>Z?(Oe.show(),He.show(),Z=at.minX+at.width+10):(Oe.hide(),He.hide()),Oe}),this.controllerBtnGroup=new Bi(Ln({group:this.group,x:this.x,y:this.y+n+25,width:r,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),o.move(this.x,this.y),this.bindEvents(),this.currentMode===Pa.SINGLE&&(this.minHandlerShape.hide(),this.foregroundShape.hide(),this.minTextShape.hide())},c.prototype.bindEvents=function(){var t=this,e=this.group.find(function(n){return n.get("name")==="minHandlerShape"});e&&(e.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),e.on("minHandlerShape-handler:touchstart",this.onMouseDown(this.minHandlerShape)));var r=this.group.find(function(n){return n.get("name")==="maxHandlerShape"});r&&(r.on("maxHandlerShape-handler:mousedown",this.onMouseDown(this.maxHandlerShape)),r.on("maxHandlerShape-handler:touchstart",this.onMouseDown(this.maxHandlerShape))),this.foregroundShape.on("mousedown",this.onMouseDown(this.foregroundShape)),this.foregroundShape.on("touchstart",this.onMouseDown(this.foregroundShape)),this.group.on("".concat(Lt,":click"),function(){t.isPlay=!t.isPlay,t.currentHandler=t.maxHandlerShape,t.changePlayStatus()}),this.group.on("".concat(_r,":click"),function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(.01),t.updateUI()}),this.group.on("".concat(Yr,":click"),function(){t.currentHandler=t.maxHandlerShape,t.updateStartEnd(-.01),t.updateUI()}),this.group.on(Nt,function(n){var a=n.type,i=n.speed;t.currentSpeed=i,t.currentMode=a,a===Pa.SINGLE?(t.minHandlerShape.hide(),t.foregroundShape.hide(),t.minTextShape.hide()):a===Pa.RANGE&&(t.minHandlerShape.show(),t.foregroundShape.show(),t.minTextShape.show())})},c.prototype.adjustTickIndex=function(t){for(var e=0;e<this.tickPosList.length-1;e++)if(this.tickPosList[e]<=t&&t<=this.tickPosList[e+1])return Math.abs(this.tickPosList[e]-t)<Math.abs(t-this.tickPosList[e+1])?e:e+1;return 0},c.prototype.adjustOffsetRange=function(t){switch(this.currentHandler){case this.minHandlerShape:{var e=0-this.start,r=1-this.start;return Math.min(r,Math.max(e,t))}case this.maxHandlerShape:{var e=0-this.end,r=1-this.end;return Math.min(r,Math.max(e,t))}case this.foregroundShape:{var e=0-this.start,r=1-this.end;return Math.min(r,Math.max(e,t))}default:return 0}},c.prototype.updateStartEnd=function(t){var e=this.ticks[this.adjustTickIndex(this.start*this.width)],r=this.ticks[this.adjustTickIndex(this.end*this.width)];if(!this.currentHandler){this.minText=this.tickLabelFormatter?this.tickLabelFormatter(e):e==null?void 0:e.date,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(r):r==null?void 0:r.date;return}switch(this.currentHandler){case this.minHandlerShape:this.maxText=this.maxTextShape.attr("text"),this.start+=t,this.minText=this.tickLabelFormatter?this.tickLabelFormatter(e):e.date;break;case this.maxHandlerShape:this.minText=this.minTextShape.attr("text"),this.end+=t,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(r):r.date;break;case this.foregroundShape:this.start+=t,this.end+=t,this.minText=this.tickLabelFormatter?this.tickLabelFormatter(e):e.date,this.maxText=this.tickLabelFormatter?this.tickLabelFormatter(r):r.date;break;default:break}},c.prototype.updateUI=function(){var t=this;this.start<0&&(this.start=0),this.end>1&&(this.end=1);var e=this.x+this.start*this.width,r=this.x+this.end*this.width;this.foregroundShape.attr("x",e),this.foregroundShape.attr("width",r-e);var n=(0,m.get)(this.handlerStyle,"width",Ho);this.setText(this.minText,this.maxText);var a=this.dodgeText([e,r]),i=a[0],o=a[1];this.minHandlerShape.setX(e-n/2),(0,m.each)(i,function(s,l){return t.minTextShape.attr(l,s)}),this.maxHandlerShape.setX(r-n/2),(0,m.each)(o,function(s,l){return t.maxTextShape.attr(l,s)}),this.currentMode===Pa.RANGE?this.graph.emit(Tt,{value:[this.start,this.end].sort()}):this.currentMode===Pa.SINGLE&&this.graph.emit(Tt,{value:[this.end,this.end]})},c.prototype.dodgeText=function(t){var e,r,n=2,a=(0,m.get)(this.handlerStyle,"width",Ho),i=this.minTextShape,o=this.maxTextShape,s=t[0],l=t[1],h=!1;s>l&&(e=[l,s],s=e[0],l=e[1],r=[o,i],i=r[0],o=r[1],h=!0);var p=i.getBBox(),D=o.getBBox(),I=null,F=null;return this.timeBarType==="trend"?(I=s-p.width<this.x+n?{x:s+a/2+n,textAlign:"left"}:{x:s-a/2-n,textAlign:"right"},F=l+D.width>this.x+this.width?{x:l-a/2-n,textAlign:"right"}:{x:l+a/2+n,textAlign:"left"}):this.timeBarType==="simple"&&(I=i.attr("x")>p.width?{x:s,textAlign:"center"}:{x:s,textAlign:"left"},F=o.attr("x")>this.width-D.width?{x:l,textAlign:"right"}:{x:l,textAlign:"center"}),h?[F,I]:[I,F]},c.prototype.startPlay=function(){var t=this;return typeof window!="undefined"?window.requestAnimationFrame(function(){var e=t,r=e.ticks,n=e.width,a=t.currentSpeed,i=n/r.length,o=i/((10-a)*1e3/60),s=t.adjustOffsetRange(o/t.width);t.updateStartEnd(s),t.updateUI(),t.isPlay&&(t.playHandler=t.startPlay())}):void 0},c.prototype.changePlayStatus=function(t){t===void 0&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(Mt,null)):this.playHandler&&(typeof window!="undefined"&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit(sr,null))},c.prototype.destory=function(){this.graph.off(Tt,function(){});var t=this.group,e=t.find(function(n){return n.get("name")==="minHandlerShape"});e&&(e.off("minHandlerShape-handler:mousedown"),e.off("minHandlerShape-handler:touchstart"),e.destroy());var r=t.find(function(n){return n.get("name")==="maxHandlerShape"});r&&(r.off("maxHandlerShape-handler:mousedown"),r.off("maxHandlerShape-handler:touchstart"),r.destroy()),this.foregroundShape.off("mousedown"),this.foregroundShape.off("touchstart"),this.foregroundShape.destroy(),t.off("".concat(Lt,":click")),t.off("".concat(_r,":click")),t.off("".concat(Yr,":click")),t.off(Nt),t.destroy(),this.trendComponent&&this.trendComponent.destory()},c}(),aa=nn,$e={opacity:.5,fill:"#000"},Ge={opacity:.5,fill:"#000",r:5},mt={fill:"#fff",fontSize:12},Gt=function(){function c(t){var e=t.x,r=e===void 0?0:e,n=t.y,a=n===void 0?0:n,i=t.container,o=t.text,s=t.padding,l=s===void 0?[4,4,4,4]:s,h=t.className,p=h===void 0?"g6-component-timebar-tooltip":h,D=t.backgroundColor,I=D===void 0?"#000":D,F=t.textColor,Z=F===void 0?"#fff":F,ee=t.opacity,se=ee===void 0?.8:ee,oe=t.fontSize,ce=oe===void 0?12:oe;this.container=i,this.className=p,this.backgroundColor=I,this.textColor=Z,this.x=r,this.y=a,this.text=o,this.padding=l,this.opacity=se,this.fontSize=ce,this.render()}return c.prototype.render=function(){var t=this,e=t.className,r=t.x,n=t.y,a=t.backgroundColor,i=t.textColor,o=t.text,s=t.padding,l=t.opacity,h=t.fontSize,p=t.container,D=(0,Aa.Z)("<div class='".concat(e,`' style="position: absolute; width: fit-content; height: fit-content; opacity: `).concat(l,'"></div>'));(0,m.isString)(p)&&(p=document.getElementById(p)),p.appendChild(D),t.parentHeight=p.offsetHeight,t.parentWidth=p.offsetWidth,(0,Kn.Z)(D,{visibility:"hidden",top:0,left:0});var I=(0,Aa.Z)(`
  136. <div style='position: absolute; white-space:nowrap; background-color: `.concat(a,"; font-size: ").concat(h,"px; border-radius: 4px; width: fit-content; height: fit-content; color: ").concat(i,"; padding: ").concat(s[0],"px ").concat(s[1],"px ").concat(s[2],"px ").concat(s[3],"px'></div>"));I.innerHTML=o,D.appendChild(I),t.backgroundDOM=I;var F=(0,Aa.Z)("<div style='position: absolute; width: 0px; height: 0px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 10px solid ".concat(a,"'></div>"));D.appendChild(F),t.arrowDOM=F,t.container=D},c.prototype.show=function(t){var e=this,r=t.text,n=t.x,a=t.y,i=t.clientX,o=t.clientY;e.backgroundDOM.innerHTML=r;var s=e.backgroundDOM.offsetWidth,l=e.backgroundDOM.offsetHeight,h=e.arrowDOM.offsetWidth,p=e.arrowDOM.offsetHeight;(0,Kn.Z)(e.container,{top:"".concat(-l-p,"px"),left:"".concat(n,"px"),visibility:"visible"}),(0,Kn.Z)(e.backgroundDOM,{marginLeft:"".concat(-s/2,"px")}),(0,Kn.Z)(e.arrowDOM,{marginLeft:"".concat(-h/2,"px"),top:"".concat(l,"px")});var D=n-s/2,I=n+s/2;D<0?(0,Kn.Z)(e.backgroundDOM,{marginLeft:"".concat(-s/2-D,"px")}):I>e.parentWidth&&(0,Kn.Z)(e.backgroundDOM,{marginLeft:"".concat(-s/2-I+e.parentWidth+12,"px")})},c.prototype.hide=function(){(0,Kn.Z)(this.container,{top:0,left:0,visibility:"hidden"})},c}(),Ut=Gt,wt=function(){return wt=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},wt.apply(this,arguments)},xt=q.vs,At={fill:"#5B8FF9"},Ke={fill:"#e6e8e9"},vt=function(){function c(t){this.frameCount=0,this.fontFamily="Arial, sans-serif";var e=t.graph,r=t.canvas,n=t.group,a=t.width,i=t.height,o=t.padding,s=t.data,l=t.start,h=t.end,p=t.x,D=p===void 0?0:p,I=t.y,F=I===void 0?0:I,Z=t.tickLabelFormatter,ee=t.selectedTickStyle,se=ee===void 0?At:ee,oe=t.unselectedTickStyle,ce=oe===void 0?Ke:oe,we=t.tooltipBackgroundColor,Re=t.tooltipFomatter,Oe=t.tickLabelStyle,Pe=t.controllerCfg,He=Pe===void 0?{speed:1}:Pe;this.graph=e,this.group=n,this.sliceGroup=n.addGroup({name:"slice-group"}),this.canvas=r,this.width=a,this.height=i,this.padding=o,this.data=s,this.start=l,this.end=h,this.tickLabelFormatter=Z,this.tickLabelStyle=Oe||{},this.selectedTickStyle=se,this.unselectedTickStyle=ce,this.controllerCfg=He,this.currentSpeed=He.speed||1,this.x=D,this.y=F,this.tooltipBackgroundColor=we,this.tooltipFomatter=Re,this.fontFamily=typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif",this.renderSlices(),this.initEvent()}return c.prototype.renderSlices=function(){var t=this,e=this,r=e.width,n=e.height,a=e.padding,i=e.data,o=e.start,s=e.end,l=e.tickLabelFormatter,h=e.selectedTickStyle,p=e.unselectedTickStyle,D=e.tickLabelStyle,I=r-2*a,F=10,Z=4,ee=3*a+Z+F,se=n-ee-2*a,oe=2,ce=i.length,we=(I-oe*(ce-1))/ce;this.tickWidth=we;var Re=this.sliceGroup,Oe=[],Pe=[],He=Math.round(ce*o),at=Math.round(ce*s);this.startTickRectId=He,this.endTickRectId=at;var qe=D.rotate;delete D.rotate,i.forEach(function(Ft,yr){var fr=yr>=He&&yr<=at,lr=fr?h:p,Kt=Re.addShape("rect",{attrs:wt({x:a+yr*(we+oe),y:a,width:we,height:se},lr),draggable:!0,name:"tick-rect-".concat(yr)}),jr=Re.addShape("rect",{attrs:{x:a+yr*we+oe*(2*yr-1)/2,y:a,width:yr===0||yr===ce-1?we+oe/2:we+oe,height:se,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(yr)});jr.toFront();var Xr=Kt.getBBox(),er=(Xr.minX+Xr.maxX)/2;Oe.push({rect:Kt,pickRect:jr,value:Ft.date,x:er,y:Xr.minY});var mr;if(l?(mr=l(Ft),!(0,m.isString)(mr)&&mr&&(mr=Ft.date)):yr%Math.round(ce/10)==0&&(mr=Ft.date),mr){Pe.push(mr);var kr=Xr.maxY+a*2;Re.addShape("line",{attrs:{stroke:"#BFBFBF",x1:er,y1:kr,x2:er,y2:kr+Z},name:"tick-line"});var Fr=kr+Z+a,Jr=Re.addShape("text",{attrs:wt({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:er,y:Fr,textAlign:"center",text:mr,textBaseline:"top",fontSize:10,fontFamily:t.fontFamily||"Arial, sans-serif"},D),capture:!1,name:"tick-label"}),fn=Jr.getBBox();if(fn.maxX>r?Jr.attr("textAlign","right"):fn.minX<0&&Jr.attr("textAlign","left"),(0,m.isNumber)(qe)&&Pe.length!==10){var Vn=xt([1,0,0,0,1,0,0,0,1],[["t",-er,-Fr],["r",qe],["t",er-5,Fr+2]]);Jr.attr({textAlign:"left",matrix:Vn})}Pe.length===1?Jr.attr({textAlign:"left"}):Pe.length===10&&Jr.attr({textAlign:"right"})}}),this.tickRects=Oe;var yt=this.group;this.currentSpeed=1,this.controllerBtnGroup=new Bi(wt({group:yt,x:this.x,y:this.y+n+5,width:r,height:40,hideTimeTypeController:!0,speed:this.currentSpeed,fontFamily:this.fontFamily||"Arial, sans-serif"},this.controllerCfg))},c.prototype.initEvent=function(){var t=this,e=this.sliceGroup;e.on("click",function(h){var p=h.target;if(!(p.get("type")!=="rect"||!p.get("name"))){var D=parseInt(p.get("name").split("-")[2],10);if(!isNaN(D)){var I=t.tickRects,F=t.unselectedTickStyle;I.forEach(function(oe){oe.rect.attr(F)});var Z=t.selectedTickStyle;I[D].rect.attr(Z),t.startTickRectId=D,t.endTickRectId=D;var ee=I.length,se=D/ee;t.graph.emit(Tt,{value:[se,se]})}}}),e.on("dragstart",function(h){var p=t.tickRects,D=t.unselectedTickStyle;p.forEach(function(oe){oe.rect.attr(D)});var I=h.target,F=parseInt(I.get("name").split("-")[2],10),Z=t.selectedTickStyle;p[F].rect.attr(Z),t.startTickRectId=F;var ee=p.length,se=F/ee;t.graph.emit(Tt,{value:[se,se]}),t.dragging=!0}),e.on("dragover",function(h){if(!!t.dragging&&h.target.get("type")==="rect"){for(var p=parseInt(h.target.get("name").split("-")[2],10),D=t.startTickRectId,I=t.tickRects,F=t.selectedTickStyle,Z=t.unselectedTickStyle,ee=0;ee<I.length;ee++){var se=ee>=D&&ee<=p?F:Z;I[ee].rect.attr(se)}var oe=I.length;t.endTickRectId=p;var ce=D/oe,we=p/oe;t.graph.emit(Tt,{value:[ce,we]})}}),e.on("drop",function(h){if(!!t.dragging&&(t.dragging=!1,h.target.get("type")==="rect")){var p=t.startTickRectId,D=parseInt(h.target.get("name").split("-")[2],10);if(!(D<p)){var I=t.selectedTickStyle,F=t.tickRects;F[D].rect.attr(I),t.endTickRectId=D;var Z=F.length,ee=p/Z,se=D/Z;t.graph.emit(Tt,{value:[ee,se]})}}});var r=this,n=r.tooltipBackgroundColor,a=r.tooltipFomatter,i=r.canvas,o=new Ut({container:i.get("container"),backgroundColor:n}),s=this.tickRects;s.forEach(function(h){var p=h.pickRect;p.on("mouseenter",function(D){var I=D.target;if(I.get("type")==="rect"){var F=parseInt(I.get("name").split("-")[2],10),Z=i.getClientByPoint(s[F].x,s[F].y);o.show({x:s[F].x,y:s[F].y,clientX:Z.x,clientY:Z.y,text:a?a(s[F].value):s[F].value})}}),p.on("mouseleave",function(D){o.hide()})});var l=this.group;l.on("".concat(Lt,":click"),function(){t.isPlay=!t.isPlay,t.changePlayStatus()}),l.on("".concat(_r,":click"),function(){t.updateStartEnd(1)}),l.on("".concat(Yr,":click"),function(){t.updateStartEnd(-1)}),l.on(Nt,function(h){var p=h.type,D=h.speed;t.currentSpeed=D})},c.prototype.changePlayStatus=function(t){t===void 0&&(t=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(Mt,null)):this.playHandler&&(typeof window!="undefined"&&window.cancelAnimationFrame(this.playHandler),t&&this.graph.emit(sr,null))},c.prototype.startPlay=function(){var t=this;return typeof window!="undefined"?window.requestAnimationFrame(function(){var e=t.currentSpeed;t.frameCount%(60/e)==0&&(t.frameCount=0,t.updateStartEnd(1)),t.frameCount++,t.isPlay&&(t.playHandler=t.startPlay())}):void 0},c.prototype.updateStartEnd=function(t){var e=this,r=this.tickRects,n=r.length,a=this.unselectedTickStyle,i=this.selectedTickStyle,o=e.endTickRectId;if(t>0?e.endTickRectId++:(r[e.endTickRectId].rect.attr(a),e.endTickRectId--),o!==e.startTickRectId)e.endTickRectId<e.startTickRectId&&(e.startTickRectId=e.endTickRectId);else{for(var s=e.startTickRectId;s<=e.endTickRectId-1;s++)r[s].rect.attr(a);e.startTickRectId=e.endTickRectId}if(r[e.endTickRectId]){r[e.endTickRectId].rect.attr(i);var l=e.startTickRectId/n,h=e.endTickRectId/n;this.graph.emit(Tt,{value:[l,h]})}},c.prototype.destory=function(){var t=this.sliceGroup;t.off("click"),t.off("dragstart"),t.off("dragover"),t.off("drop"),this.tickRects.forEach(function(e){var r=e.pickRect;r.off("mouseenter"),r.off("mouseleave")}),this.tickRects.length=0,t.off("".concat(Lt,":click")),t.off("".concat(_r,":click")),t.off("".concat(Yr,":click")),t.off(Nt),this.sliceGroup.destroy()},c}(),Ve=vt,kt=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),zt=function(){return zt=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},zt.apply(this,arguments)},vr=function(c,t){var e={};for(var r in c)Object.prototype.hasOwnProperty.call(c,r)&&t.indexOf(r)<0&&(e[r]=c[r]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(c);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(c,r[n])&&(e[r[n]]=c[r[n]]);return e},gr=4,ur=26,Lr=function(c){kt(t,c);function t(e){var r=c.call(this,e)||this;return r.afterrenderListener=function(n){return r.filterData({})},r.valueChangeListener=(0,m.throttle)(function(n){return r.filterData(n)},200,{trailing:!0,leading:!0}),r.changeData=function(n){var a=r.get("graph");r.cacheGraphData=a.get("data"),r.filterData({})},r}return t.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-component-timebar",padding:10,type:"trend",trend:{data:[],isArea:!1,smooth:!0},controllerCfg:{speed:1,loop:!1},slider:{start:.1,end:.9,minText:"min",maxText:"max"},tick:{start:.1,end:.9,data:[]},textStyle:{},filterEdge:!1,filterItemTypes:["node"],containerCSS:{}}},t.prototype.initContainer=function(){var e=this.get("graph"),r=this._cfgs,n=r.width,a=r.height,i=this.get("className")||"g6-component-timebar",o=this.get("container"),s=this.get("graph").get("container"),l;o?((0,m.isString)(o)&&(o=document.getElementById(o)),l=o):(l=(0,Aa.Z)("<div class='".concat(i,"'></div>")),(0,Kn.Z)(l,{position:"relative"})),s.appendChild(l),this.set("timeBarContainer",l);var h,p=e.get("renderer");p==="SVG"?h=new Ps.Canvas({container:l,width:n,height:a}):h=new so.Canvas({container:l,width:n,height:a}),this.get("containerCSS")&&(0,Kn.Z)(l,this.get("containerCSS")),this.set("canvas",h)},t.prototype.init=function(){this.initContainer();var e=this.get("canvas"),r=e.addGroup({name:"timebar-group"});this.set("timeBarGroup",r),this.renderTrend(),this.initEvent();var n=typeof window!="undefined"&&window.getComputedStyle(document.body,null).getPropertyValue("font-family")||"Arial, sans-serif";this.set("fontFamily",n)},t.prototype.play=function(){this.togglePlay(!0)},t.prototype.pause=function(){this.togglePlay(!1)},t.prototype.togglePlay=function(e){var r=this.get("timebar");!r||(r.isPlay=!!e,r.changePlayStatus())},t.prototype.renderTrend=function(){var e=this,r=this._cfgs,n=r.width,a=r.x,i=r.y,o=r.padding,s=r.type,l=r.trend,h=r.slider,p=r.controllerCfg,D=r.textStyle,I=r.tick,F=r.backgroundStyle,Z=r.foregroundStyle,ee=l.data,se=vr(l,["data"]),oe=n-2*o,ce=s==="trend"?ur:gr,we=this.get("graph"),Re=this.get("timeBarGroup"),Oe=this.get("canvas"),Pe=null;if(s==="trend"||s==="simple"){var He=this.get("getValue");Pe=new aa(zt(zt({graph:we,canvas:Oe,group:Re,type:s,x:a+o,y:s==="trend"?i+o:i+o+15,width:oe,height:ce,padding:o,backgroundStyle:F,foregroundStyle:Z,trendCfg:zt(zt({},se),{data:ee.map(function(qe){return(He==null?void 0:He(qe))||qe.value})})},h),{tick:{ticks:ee,tickLabelFormatter:I.tickLabelFormatter,tickLabelStyle:I.tickLabelStyle,tickLineStyle:I.tickLineStyle},handlerStyle:zt(zt({},h.handlerStyle),{height:h.height||ce}),controllerCfg:p,textStyle:D}))}else s==="tick"&&(Pe=new Ve(zt({graph:we,canvas:Oe,group:Re,x:a+o,y:i+o,width:n,height:42,padding:2,controllerCfg:p},I)));var at=function qe(){var yt=e.get("timebar");yt.draggingHandler=!1,yt.isPlay&&(yt.isPlay=!1,yt.currentHandler=yt.maxHandlerShape,yt.changePlayStatus()),document.removeEventListener("mouseup",qe)};Oe.on("mousedown",function(qe){(qe.target.get("name")==="maxHandlerShape-handler"||qe.target.get("name")==="minHandlerShape-handler"||qe.target===Pe.foregroundShape)&&document.addEventListener("mouseup",at)}),this.set("timebar",Pe)},t.prototype.filterData=function(e){var r,n=e.value;if(!n){n=[];var a=this._cfgs.type;!a||a==="trend"||a==="simple"?(n[0]=this._cfgs.slider.start,n[1]=this._cfgs.slider.end):a==="tick"&&(n[0]=this._cfgs.tick.start,n[1]=this._cfgs.tick.end)}var i=null,o=this._cfgs.type;if(o==="trend"||o==="simple"?i=this._cfgs.trend.data:o==="tick"&&(i=this._cfgs.tick.data),!i||i.length===0){console.warn("\u8BF7\u914D\u7F6E TimeBar \u7EC4\u4EF6\u7684\u6570\u636E");return}var s=this.get("rangeChange"),l=this.get("graph"),h=Math.round(i.length*n[0]),p=Math.round(i.length*n[1]);p=p>=i.length?i.length-1:p,h=h>=i.length?i.length-1:h;var D=(r=this._cfgs.tick)===null||r===void 0?void 0:r.tickLabelFormatter,I=D?D(i[h]):i[h].date,F=D?D(i[p]):i[p].date;if(o!=="tick"){var Z=this.get("timebar");Z.setText(I,F)}if(s)s(l,I,F);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&this.cacheGraphData.nodes.length===0)&&(this.cacheGraphData=l.get("data"));var ee=this.get("filterItemTypes"),se=this.get("changeData"),oe=this.get("getDate"),ce=this.get("shouldIgnore"),we=i[h].date,Re=i[p].date;if(se||se===void 0){var Oe=this.cacheGraphData.nodes,Pe=this.cacheGraphData.edges,He={},at={};l.getNodes().forEach(function(qe){return He[qe.getID()]=!0}),l.getEdges().forEach(function(qe){return at[qe.getID()]=!0}),ee.includes("node")&&(Oe==null||Oe.forEach(function(qe){var yt=+((oe==null?void 0:oe(qe))||qe.date),Ft=yt>=we&&yt<=Re||(ce==null?void 0:ce("node",qe,{min:we,max:Re})),yr=He[qe.id];yr&&!Ft?(l.removeItem(qe.id),He[qe.id]=!1):!yr&&Ft&&(l.addItem("node",qe),He[qe.id]=!0)}),Pe==null||Pe.forEach(function(qe){var yt=He[qe.source]&&He[qe.target]||(ce==null?void 0:ce("edge",qe,{min:we,max:Re})),Ft=!!l.findById(qe.id);Ft&&!yt?(l.removeItem(qe.id),at[qe.id]=!1):!Ft&&yt?(l.addItem("edge",qe),at[qe.id]=!0):Ft||(at[qe.id]=!1)})),(this.get("filterEdge")||ee.includes("edge"))&&(Pe==null||Pe.filter(function(qe){var yt=+((oe==null?void 0:oe(qe))||qe.date),Ft=yt>=we&&yt<=Re||(ce==null?void 0:ce("edge",qe,{min:we,max:Re})),yr=He[qe.source]&&He[qe.target],fr=Ft&&yr,lr=at[qe.id];lr&&!fr?(at[qe.id]=!1,l.removeItem(qe.id)):!lr&&fr&&(at[qe.id]=!0,l.addItem("edge",qe))}))}else ee.includes("node")&&l.getNodes().forEach(function(qe){var yt=qe.getModel();if(!(ce==null?void 0:ce("node",yt,{min:we,max:Re}))){var Ft=+((oe==null?void 0:oe(yt))||yt.date);Ft<we||Ft>Re?l.hideItem(qe):l.showItem(qe)}}),(this.get("filterEdge")||ee.includes("edge"))&&l.getEdges().forEach(function(qe){var yt=qe.getModel();if(!(ce==null?void 0:ce("edge",yt,{min:i[h].date,max:i[p].date}))){var Ft=+((oe==null?void 0:oe(yt))||yt.date);if(Ft<i[h].date||Ft>i[p].date)l.hideItem(qe);else{var yr=qe.getSource().isVisible(),fr=qe.getTarget().isVisible();yr&&fr&&l.showItem(qe)}}})}},t.prototype.initEvent=function(){var e=this.get("graph");e.on("afterchangedata",this.changeData),e.on("afterrender",this.afterrenderListener),e.on(Tt,this.valueChangeListener)},t.prototype.destroy=function(){var e=this.get("graph");e.off("afterchangedata",this.changeData),e.off("afterrender",this.afterrenderListener),e.off(Tt,this.valueChangeListener);var r=this.get("timebar");r&&r.destory&&r.destory(),c.prototype.destroy.call(this);var n=this.get("timeBarContainer");if(n){var a=this.get("container");a||(a=this.get("graph").get("container")),(0,m.isString)(a)&&(a=document.getElementById(a)),a.removeChild(n)}},t}(Qi),yn=Lr,Zn=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),un=ki.applyMatrix;function Dn(c,t){var e,r;if(c.naturalWidth)e=c.naturalWidth,r=c.naturalHeight;else{var n=new Image;n.src=c.src,n.onload=function(){t&&t(n.width,n.height)}}return[e,r]}var jn=function(c){Zn(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},t.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},t.prototype.disableRefresh=function(){this.set("refresh",!1)},t.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},t.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},t.prototype.initViewport=function(){var e=this,r=this._cfgs,n=r.graph;if(!this.destroyed){var a=this.get("container");(0,m.isString)(a)&&(a=document.getElementById(a));var i=(0,Aa.Z)("<div class=".concat(r.viewportClassName,`
  137. style='position:absolute;
  138. left:0;
  139. top:0;
  140. box-sizing:border-box;
  141. border: 2px solid #1980ff;
  142. cursor:move'
  143. </div>`)),o=0,s=0,l=!1,h=0,p=0,D=0,I=0,F=0,Z=0;a.addEventListener("mousedown",function(ee){if(r.refresh=!1,ee.target===i){var se=i.style;D=parseInt(se.width,10),I=parseInt(se.height,10);var oe=e.get("width"),ce=e.get("height");D>oe||I>ce||(Z=n.getZoom(),F=e.get("ratio"),l=!0,o=ee.clientX,s=ee.clientY)}},!1),a.addEventListener("mousemove",function(ee){if(!(!l||(0,m.isNil)(ee.clientX)||(0,m.isNil)(ee.clientY))){var se=e.get("width"),oe=e.get("height"),ce=i.style;h=parseInt(ce.left,10),p=parseInt(ce.top,10),D=parseInt(ce.width,10),I=parseInt(ce.height,10);var we=o-ee.clientX,Re=s-ee.clientY;h-we<0?we=h:h-we+D>=se&&(we=0),p-Re<0?Re=p:p-Re+I>=oe&&(Re=0),h-=we,p-=Re,(0,Kn.Z)(i,{left:"".concat(h,"px"),top:"".concat(p,"px")}),n.translate(we*Z/F,Re*Z/F),o=ee.clientX,s=ee.clientY}},!1),a.addEventListener("mouseleave",function(){l=!1,r.refresh=!0},!1),a.addEventListener("mouseup",function(){l=!1,r.refresh=!0},!1),this.set("viewport",i),a.appendChild(i)}},t.prototype.updateViewport=function(){if(!this.destroyed){var e=this.get("ratio"),r=this.get("width"),n=this.get("height"),a=this.get("graph"),i=a.get("width"),o=a.get("height"),s=i/o,l=a.getGroup(),h=l.getCanvasBBox(),p=[(h.minX+h.maxX)/2,(h.minY+h.maxY)/2],D=[h.maxX-h.minX,h.maxY-h.minY],I={centerX:p[0],centerY:p[1],width:0,height:0,minX:0,minY:0};h[0]/h[1]>s?(I.width=D[0],I.height=I.width/s):(I.height=D[1],I.width=I.height*s),I.minX=p[0]-I.width/2,I.minY=p[1]-I.height/2;var F=l.getMatrix();F||(F=[1,0,0,0,1,0,0,0,1]);var Z=mi.invert([1,0,0,0,1,0,0,0,1],F),ee=un({x:I.minX,y:I.minY},Z),se=a.getCanvasByPoint(ee.x,ee.y),oe=this.get("viewport");oe||this.initViewport();var ce=i/I.width,we=ce*r,Re=ce*n,Oe=r*-se.x/I.width,Pe=n*-se.y/I.height,He=Oe+we,at=Pe+Re;Oe<0&&(we+=Oe,Oe=0),He>r&&(we=we-(He-r)),Pe<0&&(Re+=Pe,Pe=0),at>n&&(Re=Re-(at-n)),this.set("ratio",e);var qe="".concat(Oe,"px"),yt="".concat(Pe,"px");(0,Kn.Z)(oe,{left:qe,top:yt,width:"".concat(we,"px"),height:"".concat(Re,"px")})}},t.prototype.init=function(){this.initContainer()},t.prototype.initContainer=function(){var e=this,r=e.get("graph"),n=r.get("width"),a=r.get("height"),i=a/n,o=e.get("className"),s=e.get("container"),l=e.get("width"),h=e.get("height");!l&&!h&&(l=200),l?(h=i*l,e.set("height",h)):(l=1/i*h,e.set("width",l));var p=(0,Aa.Z)("<div class='".concat(o,"' style='width: ").concat(l,"px; height: ").concat(h,"px; overflow: hidden; position: relative;'></div>"));(0,m.isString)(s)&&(s=document.getElementById(s)),s?s.appendChild(p):r.get("container").appendChild(p),e.set("container",p);var D=(0,Aa.Z)('<div class="g6-minimap-container" style="position: relative; width: 100%; height: 100%; text-align: center; display: table;"></div>');p.appendChild(D);var I=(0,Aa.Z)('<span style="display: table-cell; vertical-align: middle; "></span>');D.appendChild(I),e.set("containerDOM",D),e.set("containerSpan",I);var F=(0,Aa.Z)('<img alt="" src="'.concat(this.get("graphImg"),'" style="display: inline-block; user-select: none;" draggable="false" />'));e.set("imgDOM",F),e.updateImgSize(),I.appendChild(F),e.updateCanvas()},t.prototype.updateImgSize=function(){var e=this,r=e.get("imgDOM"),n=e.get("width"),a=e.get("height");r.onload=function(){var i=Dn(r);i[0]>i[1]?r.width=n:r.height=a}},t.prototype.updateCanvas=function(){var e=this.get("refresh");if(!!e){var r=this.get("graph");if(!r.get("destroyed")){this.get("viewportChange")&&(this.set("viewportChange",!1),this.updateViewport());var n=this.get("width"),a=r.get("canvas").getCanvasBBox(),i=a.width,o=n/i;this.set("ratio",o),this.updateViewport()}}},t.prototype.getViewport=function(){return this.get("viewport")},t.prototype.getContainer=function(){return this.get("container")},t.prototype.updateGraphImg=function(e){var r=this,n=r.get("imgDOM");n.remove(),r.set("graphImg",e);var a=(0,Aa.Z)('<img alt="" src="'.concat(e,'" style="display: inline-block;" ondragstart="return false;" onselectstart="return false;"/>'));r.set("imgDOM",a),a.src=e,r.updateImgSize();var i=r.get("containerSpan");i.appendChild(a),r.updateCanvas()},t.prototype.destroy=function(){var e=this.get("container");e.parentNode.removeChild(e)},t}(Qi),Sa=jn,di=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),qi=function(){return qi=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},qi.apply(this,arguments)},Cl=ki.distance,No=.05,Tl={stroke:"#000",strokeOpacity:.8,lineWidth:2,fillOpacity:1,fill:"#fff"},es=function(c){di(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{type:"both",trigger:"mousemove",r:60,delegateStyle:(0,m.clone)(Tl),showLabel:"edge",scaleRBy:"wheel"}},t.prototype.getEvents=function(){var e;switch(this.get("trigger")){case"click":e={click:"filter"};break;case"drag":e={click:"createDelegate"};break;default:e={mousemove:"filter"};break}return e},t.prototype.init=function(){var e=this,r=e.get("showLabel"),n=r==="node"||r==="both",a=r==="edge"||r==="both";e.set("showNodeLabel",n),e.set("showEdgeLabel",a);var i=e.get("shouldShow");i||e.set("shouldShow",function(){return!0})},t.prototype.createDelegate=function(e){var r=this,n=r.get("delegate");(!n||n.destroyed)&&(r.filter(e),n=r.get("delegate"),n.on("dragstart",function(a){}),n.on("drag",function(a){r.filter(a)}),this.get("scaleRBy")==="wheel"&&n.on("mousewheel",function(a){r.scaleRByWheel(a)}))},t.prototype.scaleRByWheel=function(e){var r=this;if(!(!e||!e.originalEvent)){e.preventDefault&&e.preventDefault();var n=r.get("graph"),a,i=r.get("delegate"),o=i?{x:i.attr("x"),y:i.attr("y")}:void 0,s=o||n.getPointByClient(e.clientX,e.clientY);e.originalEvent.wheelDelta<0?a=1-No:a=1/(1-No);var l=r.get("maxR"),h=r.get("minR"),p=r.get("r");(p>(l||n.get("height"))&&a>1||p<(h||n.get("height")*.05)&&a<1)&&(a=1),p*=a,r.set("r",p),r.filter(e)}},t.prototype.filter=function(e){var r=this,n=r.get("graph"),a=n.getNodes(),i={},o=r.get("r"),s=r.get("type"),l={x:e.x,y:e.y};r.updateDelegate(l,o);var h=r.get("shouldShow"),p=r.get("vShapes");p&&p.forEach(function(se){se.remove(),se.destroy()}),p=[],a.forEach(function(se){var oe=se.getModel(),ce=oe.x,we=oe.y;Cl({x:ce,y:we},l)<o&&(i[oe.id]=se)});var D=n.getEdges(),I=[];D.forEach(function(se){var oe=se.getModel(),ce=oe.source,we=oe.target;h(oe)&&(s==="only-source"||s==="one"?i[ce]&&!i[we]&&I.push(se):s==="only-target"||s==="one"?i[we]&&!i[ce]&&I.push(se):s==="both"&&i[ce]&&i[we]&&I.push(se))});var F=r.get("showNodeLabel"),Z=r.get("showEdgelabel"),ee=n.get("group");I.forEach(function(se){var oe=se.get("group").get("children");oe.forEach(function(ce){var we=ce.get("type"),Re=ee.addShape(we,{attrs:ce.attr()});p.push(Re),F&&we==="text"&&Re.set("visible",!0)})}),Object.keys(i).forEach(function(se){var oe=i[se],ce=oe.get("group").clone();if(ee.add(ce),p.push(ce),Z)for(var we=ce.get("children"),Re=0;Re<we.length;Re++){var Oe=we[Re];Oe.get("type")==="text"&&Oe.set("visible",!0)}}),r.set("vShapes",p)},t.prototype.updateParams=function(e){var r=this,n=e.r,a=e.trigger,i=e.minR,o=e.maxR,s=e.scaleRBy,l=e.showLabel,h=e.shouldShow;if(isNaN(e.r)||r.set("r",n),isNaN(o)||r.set("maxR",o),isNaN(i)||r.set("minR",i),(a==="mousemove"||a==="click")&&r.set("trigger",a),s==="wheel"||s==="unset"){r.set("scaleRBy",s),r.get("delegate").remove(),r.get("delegate").destroy();var p=r.get("dPercentText");p&&(p.remove(),p.destroy())}(l==="node"||l==="both")&&r.set("showNodeLabel",!0),(l==="edge"||l==="both")&&r.set("showEdgeLabel",!0),h&&r.set("shouldShow",h)},t.prototype.updateDelegate=function(e,r){var n=this,a=n.get("graph"),i=n.get("delegate");if(!i||i.destroyed){var o=a.get("group"),s=n.get("delegateStyle")||Tl;i=o.addShape("circle",{attrs:qi({r,x:e.x,y:e.y},s),name:"lens-shape",draggable:!0}),this.get("trigger")!=="drag"&&this.get("scaleRBy")==="wheel"&&i.on("mousewheel",function(l){n.scaleRByWheel(l)})}else i.attr({x:e.x,y:e.y,r});n.set("delegate",i)},t.prototype.clear=function(){var e=this,r=e.get("vShapes");r&&r.forEach(function(a){a.remove(),a.destroy()}),r=[],e.set("vShapes",r);var n=e.get("delegate");n&&!n.destroyed&&(n.remove(),n.destroy())},t.prototype.destroy=function(){this.clear()},t}(Qi),kl=es,gh=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),ph=ki.pointLineDistance,yh={stroke:"#FA8C16",lineWidth:1},mh=function(c){gh(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{line:yh,itemAlignType:"center",tolerance:5,horizontalLines:{},verticalLines:{},alignLines:[]}},t.prototype.init=function(){},t.prototype.getEvents=function(){return{"node:dragstart":"onDragStart","node:drag":"onDrag","node:dragend":"onDragEnd"}},t.prototype.onDragStart=function(){this.initBoxLine()},t.prototype.onDrag=function(e){var r=e.item,n=r.get("delegateShape")||r,a=n.getBBox(),i=r.getModel(),o=i.x-a.x,s=i.y-a.y;this.show({x:a.minX+o,y:a.minY+s},{width:a.width,height:a.height})},t.prototype.onDragEnd=function(){this.destory()},t.prototype.initBoxLine=function(){var e=this._cfgs,r=e.horizontalLines,n=e.verticalLines,a=e.itemAlignType,i=this.get("graph"),o=i.getNodes();o.forEach(function(s){var l=s.getBBox(),h=s.get("id");a===!0||a==="horizontal"?(r["".concat(h,"tltr")]=[l.minX,l.minY,l.maxX,l.minY,s],r["".concat(h,"lcrc")]=[l.minX,l.centerY,l.maxX,l.centerY,s],r["".concat(h,"blbr")]=[l.minX,l.maxY,l.maxX,l.maxY,s]):a==="center"&&(r["".concat(h,"lcrc")]=[l.minX,l.centerY,l.maxX,l.centerY,s]),a===!0||a==="vertical"?(n["".concat(h,"tlbl")]=[l.minX,l.minY,l.minX,l.maxY,s],n["".concat(h,"tcbc")]=[l.centerX,l.minY,l.centerX,l.maxY,s],n["".concat(h,"trbr")]=[l.maxX,l.minY,l.maxX,l.maxY,s]):a==="center"&&(n["".concat(h,"tcbc")]=[l.centerX,l.minY,l.centerX,l.maxY,s])})},t.prototype.show=function(e,r){var n=(0,m.mix)({},e);return this.itemAlign(e,r,n),e},t.prototype.itemAlign=function(e,r,n){var a=this,i=this._cfgs,o=i.horizontalLines,s=i.verticalLines,l=i.tolerance,h={x:n.x+r.width/2,y:n.y},p={x:n.x+r.width/2,y:n.y+r.height/2},D={x:n.x+r.width/2,y:n.y+r.height},I={x:n.x,y:n.y+r.height/2},F={x:n.x+r.width,y:n.y+r.height/2},Z=[],ee=[],se=null;if(this.clearAlignLine(),(0,m.each)(o,function(ce){ce[4].isVisible&&(Z.push(a.getLineDisObject(ce,h)),Z.push(a.getLineDisObject(ce,p)),Z.push(a.getLineDisObject(ce,D)))}),(0,m.each)(s,function(ce){ce[4].isVisible&&(ee.push(a.getLineDisObject(ce,I)),ee.push(a.getLineDisObject(ce,p)),ee.push(a.getLineDisObject(ce,F)))}),Z.sort(function(ce,we){return ce.dis-we.dis}),ee.sort(function(ce,we){return ce.dis-we.dis}),Z.length!==0&&Z[0].dis<l){e.y=Z[0].line[1]-Z[0].point.y+n.y,se={type:"item",horizontals:[Z[0]]};for(var oe=1;oe<3;oe++)Z[0].dis===Z[oe].dis&&se.horizontals.push(Z[oe])}if(ee.length!==0&&ee[0].dis<l){e.x=ee[0].line[0]-ee[0].point.x+n.x,se?se.verticals=[ee[0]]:se={type:"item",verticals:[ee[0]]};for(var oe=1;oe<3;oe++)ee[0].dis===ee[oe].dis&&se.verticals.push(ee[oe])}se&&(se.bbox=r,this.addAlignLine(se))},t.prototype.addAlignLine=function(e){var r=e.bbox,n=e.type,a=e.horizontals,i=e.verticals,o=this._cfgs,s=o.line,l=o.alignLines,h=this.get("graph"),p=h.get("group");n==="item"&&(a&&(0,m.each)(a,function(D){var I=D.line,F=D.point,Z=(I[0]+I[2])/2,ee,se;F.x<Z?(ee=F.x-r.width/2,se=Math.max(I[0],I[2])):(ee=F.x+r.width/2,se=Math.min(I[0],I[2]));var oe=(0,m.mix)({x1:ee,y1:I[1],x2:se,y2:I[1]},s),ce=p.addShape("line",{attrs:oe,capture:!1});l.push(ce)}),i&&(0,m.each)(i,function(D){var I=D.line,F=D.point,Z=(I[1]+I[3])/2,ee,se;F.y<Z?(ee=F.y-r.height/2,se=Math.max(I[1],I[3])):(ee=F.y+r.height/2,se=Math.min(I[1],I[3]));var oe=(0,m.mix)({x1:I[0],y1:ee,x2:I[0],y2:se},s),ce=p.addShape("line",{attrs:oe,capture:!1});l.push(ce)}))},t.prototype.getLineDisObject=function(e,r){return{line:e,point:r,dis:ph(e,r)}},t.prototype.getContainer=function(){return this.get("container")},t.prototype.clearAlignLine=function(){var e=this._cfgs.alignLines;(0,m.each)(e,function(r){r.remove()}),e.length=0},t.prototype.destory=function(){var e=this._cfgs,r=e.horizontalLines,n=e.verticalLines,a=this.get("graph"),i=a.getNodes();i.forEach(function(o){var s=o.get("id");delete r["".concat(s,"tltr")],delete r["".concat(s,"lcrc")],delete r["".concat(s,"blbr")],delete n["".concat(s,"tlbl")],delete n["".concat(s,"tcbc")],delete n["".concat(s,"trbr")]}),this.clearAlignLine()},t}(Qi),Eh=mh,bh=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),wi=function(){return wi=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},wi.apply(this,arguments)},xh=["click","mouseenter"],wh=function(c){bh(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{data:{},position:"top",padding:8,margin:8,offsetX:0,offsetY:0,layout:"horizontal",flipPage:!1,containerStyle:{},align:void 0,horiSep:8,vertiSep:8,filter:{enable:!1,trigger:"click"}}},t.prototype.init=function(){this.formatArray("padding"),this.formatArray("margin");var e=this.get("filter")||{},r=e.multiple;r&&e.trigger==="mouseenter"&&this.set("multiple",!1);var n=this.get("align");if(!n){var a=this.get("position").split("-");a.includes("left")&&(n="left"),a.includes("right")?n="right":n="center",this.set("align",n)}var i=this.get("graph"),o=i.get("container"),s=(0,Aa.Z)(`<div class='g6-legend-container' style="position: absolute;"></div>`);o.appendChild(s),this.set("container",s);var l=this.render();(0,Kn.Z)(s,this.getContainerPos(l)),this.bindEvents()},t.prototype.getContainerPos=function(e){e===void 0&&(e=[0,0]);var r=this,n=r.get("graph"),a=this.get("offsetX"),i=this.get("offsetY"),o=this.get("margin"),s=this.get("position").split("-"),l={top:0,right:1,bottom:2,left:3},h=0,p=0,D={left:(n.getWidth()-e[0])/2+h,top:(n.getHeight()-e[1])/2+p};return s.forEach(function(I){var F=o[l[I]],Z=I;switch(I){case"top":F+=p;break;case"left":F+=h;break;case"bottom":F=n.getHeight()-e[1]-F+p,Z="top";break;default:F=n.getWidth()-e[0]-F+h,Z="left";break}D[Z]=F}),D.top+=i+n.getContainer().offsetTop,D.left+=a+n.getContainer().offsetLeft,Object.keys(D).forEach(function(I){D[I]="".concat(D[I],"px")}),D},t.prototype.bindEvents=function(){var e=this,r=e.get("filter");if(!(!r||!r.enable)){var n=r.trigger||"click";xh.includes(n)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),n="click");var a=e.get("legendCanvas");n==="mouseenter"?(a.on("node-container:mouseenter",function(i){return e.filterData(i)}),a.on("node-container:mouseleave",function(i){e.clearFilter(),e.clearActiveLegend()})):(a.on("node-container:click",function(i){return e.filterData(i)}),a.on("click",function(i){i.target&&i.target.isCanvas&&i.target.isCanvas()&&(e.clearFilter(),e.clearActiveLegend())}))}},t.prototype.changeData=function(e){this.set("data",e);var r=this.render();(0,Kn.Z)(this.get("container"),this.getContainerPos(r))},t.prototype.activateLegend=function(e){var r=this.get("filter"),n=r==null?void 0:r.multiple;n||this.clearActiveLegend();var a=e.get("parent");a.get("active")?(a.set("active",!1),this.findLegendItemsByState("active").length&&a.set("inactive",!0)):(a.set("inactive",!1),a.set("active",!0)),this.findLegendItemsByState("active").length?this.findLegendItemsByState("active","all",!1).forEach(function(p){p.set("inactive",!0)}):this.clearActiveLegend();var i=(r==null?void 0:r.legendStateStyles)||{},o=(i==null?void 0:i.inactive)||{opacity:.5,"text-shape":{opacity:.5}},s=o["text-shape"]||{};this.findLegendItemsByState("inactive").forEach(function(p){var D=p.get("children"),I=D[0],F=D[1];I.attr(wi(wi({},I.get("oriAttrs")),o)),F.attr(wi(wi({},F.get("oriAttrs")),s))});var l=(i==null?void 0:i.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},h=l["text-shape"]||{};this.findLegendItemsByState("active").forEach(function(p){var D=p.get("children"),I=D[0],F=D[1];I.attr(wi(wi({},I.get("oriAttrs")),l)),F.attr(wi(wi({},F.get("oriAttrs")),h))})},t.prototype.findLegendItemsByState=function(e,r,n){r===void 0&&(r="all"),n===void 0&&(n=!0);var a=this.get("legendCanvas").find(function(s){return s.get("name")==="root"}),i=a.find(function(s){return s.get("name")==="node-group"}),o=a.find(function(s){return s.get("name")==="edge-group"});return r==="node"?i.get("children").filter(function(s){return!!s.get(e)===n}):r==="edge"?o.get("children").filter(function(s){return!!s.get(e)===n}):i.get("children").filter(function(s){return!!s.get(e)===n}).concat(o.get("children").filter(function(s){return!!s.get(e)===n}))},t.prototype.clearActiveLegend=function(){var e=this.get("legendCanvas"),r=e.find(function(a){return a.get("name")==="root"}),n=[r.find(function(a){return a.get("name")==="node-group"}),r.find(function(a){return a.get("name")==="edge-group"})];n.forEach(function(a){a.get("children").forEach(function(i){i.set("active",!1),i.set("inactive",!1);var o=i.get("children"),s=o[0],l=o[1];s.attr(s.get("oriAttrs")),l.attr(l.get("oriAttrs"))})})},t.prototype.filterData=function(e){var r=this.get("filter"),n=r==null?void 0:r.filterFunctions;if(!(!r||!n)){var a=this.get("legendCanvas"),i=this.get("graph"),o=r.graphActiveState||"active",s=r.graphInactiveState||"inactive",l=r.multiple;this.clearFilter(),l||this.clearActiveLegend(),this.activateLegend(e.target);var h=a.find(function(se){return se.get("name")==="root"}),p=h.find(function(se){return se.get("name")==="node-group"}),D=h.find(function(se){return se.get("name")==="edge-group"}),I=p.get("children").filter(function(se){return se.get("active")}),F=D.get("children").filter(function(se){return se.get("active")}),Z=0,ee=["getNodes","getEdges"];ee.forEach(function(se){i[se]().forEach(function(oe){var ce=!1,we=se==="getNodes"?I:F;we.forEach(function(Re){var Oe=n[Re.get("id")];ce=ce||Oe(oe.getModel())}),ce?(i.setItemState(oe,s,!1),i.setItemState(oe,o,!0),Z++):(i.setItemState(oe,o,!1),i.setItemState(oe,s,!0))})}),Z||ee.forEach(function(se){i[se]().forEach(function(oe){i.clearItemStates(oe,[s])})})}},t.prototype.clearFilter=function(){var e=this.get("graph"),r=this.get("filter");if(!!r){var n=r.graphActiveState||"active",a=r.graphInactiveState||"inactive";e.getNodes().forEach(function(i){e.clearItemStates(i,[n,a])}),e.getEdges().forEach(function(i){e.clearItemStates(i,[n,a])})}},t.prototype.render=function(){var e=this;this.processData();var r=this.get("legendCanvas");r?r.clear():r=new so.Canvas({container:this.get("container"),width:200,height:200});var n=r.addGroup({name:"root"}),a=n.addGroup({name:"node-group"}),i=n.addGroup({name:"edge-group"});this.set("legendCanvas",r);var o=this.get("itemsData"),s=["nodes","edges"],l=[a,i];s.forEach(function(Kt,jr){o[Kt].forEach(function(Xr){var er,mr=l[jr].addGroup({id:Xr.id,name:"node-container"}),kr,Fr=Xr.type,Jr=e.getShapeSize(Xr),fn=Jr.width,Vn=Jr.height,Tn=Jr.r,wa=e.getStyle(Kt.substr(0,4),Xr);switch(Xr.type){case"circle":kr={r:Tn,x:0,y:0};break;case"rect":kr={width:fn,height:Vn,x:-fn/2,y:-Vn/2};break;case"ellipse":kr={rx:fn,ry:Vn,x:0,y:0},Fr="ellipse";break;case"line":kr={x1:-fn/2,y1:0,x2:fn/2,y2:0},Fr="line";break;case"quadratic":kr={path:[["M",-fn/2,0],["Q",0,fn/2,fn/2,0]]},Fr="path";break;case"cubic":kr={path:[["M",-fn/2,0],["C",-fn/6,fn/2,fn/6,-fn/2,fn/2,0]]},Fr="path";break;case"diamond":kr={path:[["M",0,-Vn],["L",fn,0],["L",0,Vn],["L",-fn,0],["Z"]]},Fr="path";break;case"triangle":kr={path:[["M",-fn,Vn],["L",0,-Vn],["L",fn,Vn],["Z"]]},Fr="path";break;case"star":kr={path:ki.getStarPath(Tn*3,Tn*1.2)},Fr="path";break;default:kr={r:Tn,x:0,y:0};break}var ua=mr.addShape(Fr,{attrs:wi(wi({},kr),wa),name:"".concat(Xr.type,"-node-keyShape"),oriAttrs:wi({opacity:1},wa)});if(Xr.label){var fa=ua.getBBox(),Ma=((er=Xr.labelCfg)===null||er===void 0?void 0:er.style)||{},ja=wi({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},Ma);mr.addShape("text",{attrs:wi({x:fa.maxX+4,y:0,text:Xr.label},ja),className:"legend-label",name:"".concat(Xr.type,"-node-text"),oriAttrs:ja})}})});var h=this.get("padding"),p,D=n.find(function(Kt){return Kt.get("name")==="title-container"}),I={height:0,maxY:0,width:0};if(this.get("title")){D||(D=n.addGroup({name:"title-container"}));var F={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:h[0]},Z=this.get("titleConfig")||{},ee=Object.assign(F,Z.style||{});p=D.addShape("text",{attrs:wi({text:this.get("title")},ee)}),I=D.getCanvasBBox(),D.setMatrix([1,0,0,0,1,0,Z.offsetX,Z.offsetY,1])}this.layoutItems();var se=n.getCanvasBBox(),oe=a.getCanvasBBox(),ce=oe.minX<0?Math.abs(oe.minX)+h[3]:h[3],we=I.maxY<oe.minY?Math.abs(I.maxY-oe.minY)+h[0]:I.maxY+h[0],Re=[1,0,0,0,1,0,ce,we,1];a.setMatrix(Re),se=n.getCanvasBBox();var Oe=[se.minX+se.width+h[1],se.minY+se.height+h[2]];if(p){var Z=wi({position:"center",offsetX:0,offsetY:0},this.get("titleConfig"));I=D.getCanvasBBox();var Pe=D.getMatrix()||[1,0,0,0,1,0,0,0,1];Z.position==="center"?Pe[6]=Oe[0]/2+Z.offsetX:Z.position==="right"?(Pe[6]=Oe[0]-h[3]+Z.offsetX,p.attr({textAlign:"right"})):(Pe[6]=h[3]+Z.offsetX,p.attr({textAlign:"left"})),D.setMatrix(Pe),I=D.getCanvasBBox(),ce=oe.minX<0?Math.abs(oe.minX)+h[3]:h[3],we=oe.minY<I.maxY?Math.abs(I.maxY-oe.minY)+h[0]:I.maxY+h[0],Re=[1,0,0,0,1,0,ce,we,1],a.setMatrix(Re);var He=[1,0,0,0,1,0,ce,we,1];this.get("layout")==="vertical"?He[6]+=oe.maxX+this.get("horiSep"):He[7]+=oe.maxY+this.get("vertiSep"),i.setMatrix(He)}else{oe=a.getCanvasBBox();var at=[1,0,0,0,1,0,0,0,1];this.get("layout")==="vertical"?at[6]+=Re[6]+oe.maxX+this.get("horiSep"):at[7]+=Re[7]+oe.maxY+this.get("vertiSep"),i.setMatrix(at)}se=n.getCanvasBBox(),oe=a.getCanvasBBox(),Re=a.getMatrix()||[1,0,0,0,1,0,0,0,1];var qe=i.getMatrix()||[1,0,0,0,1,0,0,0,1],yt=i.getCanvasBBox();Oe=[Math.max(oe.width+Re[6],yt.width+qe[6])+h[1],Math.max(oe.height+Re[7],yt.height+qe[7])+h[2]],r.changeSize(Oe[0],Oe[1]);var Ft=this.get("containerStyle"),yr=n.getMatrix()||[1,0,0,0,1,0,0,0,1],fr=ki.invertMatrix({x:0,y:0},yr),lr=n.addShape("rect",{attrs:wi({x:fr.x+(Ft.lineWidth||1),y:fr.y+(Ft.lineWidth||1),width:Oe[0]-2*(Ft.lineWidth||1),height:Oe[1]-2*(Ft.lineWidth||1),fill:"#f00",stroke:"#000",lineWidth:1,opacity:.5},Ft),name:"legend-back-rect",capture:!1});return lr.toBack(),Oe},t.prototype.layoutItems=function(){var e=this.get("legendCanvas"),r=this.get("horiSep"),n=this.get("vertiSep"),a=this.get("layout"),i=this.get("align"),o=[0,0],s=e.find(function(we){return we.get("name")==="root"}),l=s.find(function(we){return we.get("name")==="node-group"}),h=s.find(function(we){return we.get("name")==="edge-group"}),p={min:0,max:-Infinity},D=-Infinity;l.get("children").forEach(function(we,Re){Re===0&&(p.min=o[0]);var Oe=we.get("children")[0],Pe=we.getCanvasBBox(),He=Oe.getBBox(),at=He.width,qe=He.height,yt=0,Ft=0,yr=0;a==="vertical"?(Ft=o[1],yr=o[0]+at/2,o[0]=yr+Pe.height+n,yt=Pe.maxX+Ft+at/2):(Ft=o[0]+at/2,yr=o[1],o[0]=Ft+Pe.width+r,yt=Pe.maxY+yr+qe/2),o[0]>p.max&&(p.max=o[0]),yt>D&&(D=yt),we.setMatrix([1,0,0,0,1,0,Ft,yr,1])});var I=p.max-p.min,F={min:0,max:-Infinity},Z=l.getCanvasBBox();o[0]=0,o[1]=a==="vertical"?Z.maxX+r:Z.maxY+n,h.get("children").forEach(function(we,Re){Re===0&&(F.min=o[0]);var Oe=we.get("children")[0],Pe=we.getCanvasBBox(),He=Oe.getBBox(),at=He.width,qe=He.height,yt=0,Ft=0;a==="vertical"?(yt=o[1],Ft=o[0],o[0]=Ft+Pe.height+n,we.setMatrix([1,0,0,0,1,0,0,Ft+qe/2,1])):(yt=o[0],Ft=o[1],o[0]=yt+Pe.width+r,we.setMatrix([1,0,0,0,1,0,yt+at/2,0,1])),o[0]>F.max&&(F.max=o[0])});var ee=F.max-F.min;if(i&&i!==""&&i!=="left"){var se=I-ee,oe=i==="center"?Math.abs(se)/2:Math.abs(se),ce=se<0?l:h;ce.get("children").forEach(function(we){var Re=we.getMatrix()||[1,0,0,0,1,0,0,0,1];a==="vertical"?Re[7]+=oe:Re[6]+=oe,we.setMatrix(Re)})}},t.prototype.processData=function(){var e=this.get("data"),r={nodes:[],edges:[]};e.nodes&&(e.nodes.sort(function(n,a){return n.order-a.order}),e.nodes.forEach(function(n){var a,i,o,s,l,h=n.size||[((a=n.style)===null||a===void 0?void 0:a.width)||((i=n.style)===null||i===void 0?void 0:i.r)||8,((o=n.style)===null||o===void 0?void 0:o.height)||((s=n.style)===null||s===void 0?void 0:s.r)||8],p=((l=n.labelCfg)===null||l===void 0?void 0:l.style)||{};r.nodes.push({id:n.id||(0,m.uniqueId)(),type:n.type||"circle",style:wi({},n.style),order:n.order,label:n.label,itemType:"node",size:h,labelCfg:{position:"right",style:wi({fontFamily:"Arial"},p)}})})),e.edges&&(e.edges.sort(function(n,a){return n.order-a.order}),e.edges.forEach(function(n){var a,i,o=n.type||"line";n.type==="cubic-horizontal"&&(o="cubic");var s=((a=n.labelCfg)===null||a===void 0?void 0:a.style)||{},l=n.size||[((i=n.style)===null||i===void 0?void 0:i.width)||8,1];r.edges.push({id:n.id||(0,m.uniqueId)(),type:o,size:l,style:wi({lineWidth:(0,m.isArray)(l)?l[1]:1},n.style),order:n.order,label:n.label,itemType:"edge",labelCfg:{position:"right",style:wi({fontFamily:"Arial"},s)}})})),this.set("itemsData",r)},t.prototype.getContainer=function(){return this.get("container")},t.prototype.formatArray=function(e){var r=this.get(e);if((0,m.isNumber)(r))this.set(e,[r,r,r,r]);else if((0,m.isArray)(r))switch(r.length){case 0:this.set(e,[0,0,0,0]);break;case 1:this.set(e,[r[0],r[0],r[0],r[0]]);break;case 2:this.set(e,[r[0],r[1],r[0],r[1]]);break;case 3:this.set(e,[r[0],r[1],r[2],r[1]]);break;default:break}return this.get(e)},t.prototype.getShapeSize=function(e){var r,n,a;return e.size&&((0,m.isArray)(e.size)?(r=e.size[0],n=e.size[1]||e.size[0],a=e.size[0]/2):(0,m.isNumber)(e.size)&&(r=e.size,n=e.size,a=e.size/2)),e.style&&(e.style.width&&(r=e.style.width),e.style.height&&(n=e.style.height),e.style.r&&(a=e.style.r)),a||(a=5),r||(r=a),n||(n=a),{width:r,height:n,r:a}},t.prototype.getStyle=function(e,r){var n=e==="node"?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1};return wi(wi({},n),r.style||{})},t.prototype.destroy=function(){var e=this.get("legendCanvas");e==null||e.destroy();var r=this.get("graph"),n=r.get("container"),a=this.get("container");n.removeChild(a)},t}(Qi),Sh=wh,_h=function(){var c=function(e,r){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},c(e,r)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}(),xs=function(){return xs=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},xs.apply(this,arguments)},vd=function(c,t){var e={};for(var r in c)Object.prototype.hasOwnProperty.call(c,r)&&t.indexOf(r)<0&&(e[r]=c[r]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(c);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(c,r[n])&&(e[r[n]]=c[r[n]]);return e};typeof document!="undefined"&&pi()(`
  144. .g6-annotation-container {
  145. background-color: rgba(255, 255, 255, 0.3);
  146. padding: 8px;
  147. }
  148. .g6-annotation-wrapper {
  149. background-color: #fff;
  150. box-shadow: 0 0 8px rgba(0, 0, 0, 0.85);
  151. }
  152. .g6-annotation-header-wapper {
  153. height: fit-content;
  154. width: 100%;
  155. background-color: #5B8FF9;
  156. display: inline-flex;
  157. cursor: move;
  158. }
  159. .g6-annotation-title {
  160. margin: 4px 40px 4px 8px;
  161. cursor: text;
  162. min-width: 32px;
  163. }
  164. .g6-annotation-collapse {
  165. margin: 4px;
  166. cursor: pointer;
  167. }
  168. .g6-annotation-expand {
  169. margin: 4px;
  170. cursor: pointer;
  171. }
  172. .g6-annotation-close {
  173. margin: 4px 8px 4px 0;
  174. cursor: pointer;
  175. }
  176. .g6-annotation-content {
  177. padding: 8px;
  178. width: fit-content;
  179. cursor: text;
  180. word-break: break-all;
  181. min-width: 32px;
  182. }
  183. .g6-annotation-title-input-wrapper {
  184. margin: 4px 40px 4px 8px;
  185. }
  186. .g6-annotation-content-input {
  187. height: 100%;
  188. word-break: break-all;
  189. }
  190. .g6-annotation-content-input-wrapper {
  191. margin: 8px;
  192. height: 100%;
  193. }
  194. `);var gd="canvas-annotation",Mh=function(c){_h(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{trigger:"click",editable:!0,itemHighlightState:"highlight",linkHighlightStyle:{shadowColor:"#5B8FF9",shadowBlur:10},cardCfg:{minHeight:60,width:"fit-content",height:"fit-content",collapseType:"minimize",closeType:"hide",borderRadius:5,maxTitleLength:20}}},t.prototype.getEvents=function(){var e={viewportchange:"updateLinks",afterlayout:"updateLinks",aftergraphrefreshposition:"updateLinks",afterupdateitem:"updateLink",afterchangedata:"onGraphDataChange",afteritemvisibilitychange:"onGraphItemVisibilityChange"};switch(this.get("trigger")){case"click":e=xs(xs({},e),{"node:click":"showAnnotation","edge:click":"showAnnotation"})}return e},t.prototype.getDOMContent=function(e){if(!this.destroyed){var r=e.collapsed,n=e.maxWidth,a=e.title,i=a===void 0?"":a,o=e.content,s=o===void 0?"":o,l=e.borderRadius,h=l===void 0?5:l,p=r?"<p class='g6-annotation-expand'>+</p>":"<p class='g6-annotation-collapse'>-</p>",D=r?"":" <p class='g6-annotation-content'>".concat(s,"</p>"),I="<p class='g6-annotation-close'>x</p>",F=r?"".concat(h,"px"):"".concat(h,"px ").concat(h,"px 0 0");return'<div class="g6-annotation-wrapper" style="border-radius: '.concat(h,"px; max-width: ").concat(n,`px">
  195. <div
  196. class="g6-annotation-header-wapper"
  197. style="border-radius: `).concat(F,`;"
  198. >
  199. <h4 class='g6-annotation-title'>`).concat(i,`</h4>
  200. `).concat(p,`
  201. `).concat(I,`
  202. </div>
  203. `).concat(D,`
  204. </div>`)}},t.prototype.init=function(){var e=this;if(!e.destroyed){var r=e.get("graph"),n=r.getContainer(),a=e.get("container"),i=this.get("containerCfg");i?(a=this.createContainer(),n.appendChild(a)):a=n,this.set("container",a);var o=n.getBoundingClientRect(),s=new so.Canvas({container:n,width:o.right-o.left,height:o.bottom-o.top});(0,Kn.Z)(s.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",(0,m.debounce)(function(){return e.resizeCanvas(e)},100));var l=s.addGroup({id:"annotation-link-group"});e.set("linkGroup",l),e.set("canvas",s),e.get("getTitle")||e.set("getTitle",function(p){var D,I=((D=p==null?void 0:p.getModel)===null||D===void 0?void 0:D.call(p))||{},F=I.label,Z=I.id;return F||Z||"-"}),e.get("getContent")||e.set("getContent",function(p){var D,I;if(!p)return"-";var F=((D=p.getModel)===null||D===void 0?void 0:D.call(p))||{},Z=F.label,ee=F.id,se=(I=p.getType)===null||I===void 0?void 0:I.call(p),oe=se?"".concat(se,": "):"";return"".concat(oe).concat(Z||ee||"")});var h=e.get("defaultData");h&&this.readData(h)}},t.prototype.createContainer=function(){var e=this;if(!this.destroyed){var r=this.get("containerCfg"),n=this.get("graph"),a=n.getContainer(),i=a.getBoundingClientRect(),o=i.left,s=i.right,l=i.top,h=i.bottom,p=h-l,D=s-o,I=r.position,F=I===void 0?"top":I,Z=r.offsetX,ee=Z===void 0?0:Z,se=r.offsetY,oe=se===void 0?0:se,ce=vd(r,["position","offsetX","offsetY"]),we=r.height,Re=we===void 0?"fit-content":we,Oe=r.width,Pe=Oe===void 0?n.getWidth():Oe;Re==="100%"&&(Re=p),Pe==="100%"&&(Pe=D);var He="unset",at="unset",qe={};switch(F){case"right":He="".concat(p,"px"),qe={top:0,right:0},qe.right+=o+ee,qe.top+=l+oe;break;case"bottom":at="".concat(D,"px"),qe={bottom:0,left:0},qe.left+=o+ee,qe.bottom+=l+oe;break;case"top":at="".concat(D,"px");case"left":He="".concat(p,"px");default:qe={top:0,left:0},qe.left+=o+ee,qe.top+=l+oe;break}Object.keys(qe).forEach(function(Ft){qe[Ft]="".concat(qe[Ft],"px")});var yt=(0,Aa.Z)("<div class='".concat(r.className," g6-annotation-container'></div>"));return(0,Kn.Z)(yt,xs(xs({position:"absolute",display:F==="top"||F==="bottom"?"inline-flex":"unset",width:(0,m.isNumber)(Pe)?"".concat(Pe,"px"):Pe,height:(0,m.isNumber)(Re)?"".concat(Re,"px"):Re,maxHeight:He,maxWidth:at,overflow:"scroll"},qe),ce)),a.appendChild(yt),yt.addEventListener("scroll",function(Ft){e.updateLinks()}),yt}},t.prototype.resizeCanvas=function(e){clearTimeout(e.resizeTimer),e.resizeTimer=setTimeout(function(){if(!(!e||e.destroyed)){var r=e.get("container").getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top;e.get("canvas").changeSize(n,a),e.updateOutsideCards(e)}},250)},t.prototype.updateOutsideCards=function(e){var r=e||this,n=r.get("cardInfoMap")||{},a=r.get("graph"),i=a.getPointByCanvas(0,0),o=a.getPointByCanvas(a.getWidth(),a.getHeight()),s=a.getClientByPoint(i.x,i.y),l=s.x,h=s.y,p=a.getClientByPoint(o.x,o.y),D=p.x,I=p.y;Object.values(n).forEach(function(F){var Z=F.card;if(!!Z){var ee=Z.style,se=oc(ee.left),oe=oc(ee.top),ce=Z.getBoundingClientRect(),we=ce.width,Re=ce.height,Oe=se,Pe=oe;se+we>D-l&&(Oe=D-l-we),se<0&&(Oe=0),oe+Re>I-h&&(Pe=I-h-Re),oe<0&&(Pe=0),(0,Kn.Z)(Z,{left:"".concat(Oe,"px"),top:"".concat(Pe,"px")})}}),r.updateLinks()},t.prototype.showAnnotation=function(e){if(!this.destroyed){var r=e.item;this.toggleAnnotation(r)}},t.prototype.hideCards=function(){var e=this;if(!e.destroyed){var r=e.get("cardInfoMap")||{};Object.keys(r).forEach(function(n){e.hideCard(n)})}},t.prototype.toggleAnnotation=function(e,r){var n,a;r===void 0&&(r={});var i=this;if(!i.destroyed){var o=i.get("cardInfoMap")||{},s=i.get("graph"),l=i.get("container"),h=i.get("containerCfg"),p=Object.assign({},i.get("cardCfg")||{},r),D=p.minHeight,I=p.minWidth,F=p.width,Z=p.height,ee=p.collapsed,se=ee===void 0?!1:ee,oe=p.x,ce=p.y,we=p.title,Re=p.content,Oe=p.maxTitleLength,Pe=p.defaultBegin,He=vd(p,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),at=i.get("linkGroup"),qe=this.get("rows")||[[]],yt=(n=e.isCanvas)===null||n===void 0?void 0:n.call(e),Ft=yt?gd:e.getID(),yr=o[Ft]||{},fr=yr.card,lr=yr.link,Kt=yr.x,jr=yr.y,Xr=yr.title,er=yr.content,mr=this.get("getTitle"),kr=this.get("getContent"),Fr=this.get("getContentPlaceholder")||function(){return""},Jr=this.get("getTitlePlaceHolder")||function(){return""},fn=Fr(e),Vn=Jr(e),Tn=(0,Aa.Z)(this.getDOMContent(xs({itemId:Ft,collapsed:se,title:((a=Xr||we||(mr==null?void 0:mr(e)))===null||a===void 0?void 0:a.substr(0,Oe))||Vn,content:er||Re||(kr==null?void 0:kr(e))||fn},He))),wa=(0,m.isNumber)(D)?"".concat(D,"px"):D;(0,Kn.Z)(Tn,{minHeight:se?"unset":wa,minWidth:(0,m.isNumber)(I)?"".concat(I,"px"):I,height:Z,width:F});var ua=!!fr;ua?(lr==null||lr.remove(!0),l.replaceChild(Tn,fr)):l.appendChild(Tn);var fa;if(!h){if(fa=l.getBoundingClientRect()||{},oe!==void 0&&ce!==void 0)Kt=oe,jr=ce;else if(!ua&&!yt){var Ma=fa.top,ja=Pe||{},Ra=ja.left,uo=ja.right,Da=uo===void 0?16:uo,fo=ja.top,Qa=fo===void 0?8:fo,Ja=ja.bottom,oi=Da,Si=Qa;isNaN(Ra)||(oi=l.scrollWidth-Ra),isNaN(Ja)||(Si=l.scrollHeight-Ja);var Ai=(0,m.isNumber)(I)?I:100;Kt=l.scrollWidth-Tn.scrollWidth-(qe.length-1)*Ai-oi;var la=qe[qe.length-1],Ca=(la[la.length-1]||{}).bbox;jr=(Ca==null?void 0:Ca.bottom)-Ma||Si}(0,Kn.Z)(Tn,{position:"absolute",left:"".concat(Kt,"px"),top:"".concat(jr,"px"),cusor:h?"unset":"move"})}this.bindListener(Tn,Ft);var Xn=Tn.getBoundingClientRect();if(!yt){var Ta=ql(e,Xn,s,this.get("canvas")),Na=this.get("linkStyle");lr=at.addShape("path",{attrs:xs({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:Ta},Na)})}if(o[Ft]=xs(xs({},o[Ft]||{}),{id:Ft,collapsed:se,card:Tn,link:lr,x:Kt,y:jr,cardBBox:Xn,content:er||Re,title:Xr||we,contentPlaceholder:fn,titlePlaceholder:Vn,isCanvas:yt}),i.set("cardInfoMap",o),h)this.updateCardPositionsInConatainer(),this.updateLinks();else{var cn=!isNaN(oe)&&!isNaN(ce);if(!ua&&!yt&&!cn){var pa=fa.bottom,ma=pa===void 0?0:pa,Ma=fa.top;qe[qe.length-1].push({id:Ft,bbox:Xn}),Xn.top>ma-Ma-Xn.height-16&&qe.push([]),this.set("rows",qe)}}this.updateCardSize(Ft);var Ua=this.get("onAnnotationChange");Ua==null||Ua(o[Ft],ua?"update":"create")}},t.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var e=this.get("cardInfoMap");if(!!e){var r=this.get("container"),n=this.get("containerCfg").position,a=r.getBoundingClientRect().width,i=getComputedStyle(r),o=oc(i.paddingLeft)+oc(i.paddingRight);a-=o,Object.values(e).forEach(function(s){var l=s.card,h=l.getBoundingClientRect().width;switch(n){case"right":(0,Kn.Z)(l,{marginLeft:a?"".concat(a-h,"px"):"0px"});break;case"top":case"bottom":(0,Kn.Z)(l,{marginLeft:"8px"});default:break}})}}},t.prototype.handleExpandCollapseCard=function(e){if(!this.destroyed){var r=this.get("graph"),n=this.get("cardInfoMap");if(!!n){var a=n[e].collapsed,i=r.findById(e);if(!!i){var o=this.get("cardCfg").collapseType;o==="hide"&&!a?this.hideCard(e):this.toggleAnnotation(i,{collapsed:!a}),n[e]=xs(xs({},n[e]),{collapsed:!a})}}}},t.prototype.hideCard=function(e){if(!this.destroyed){var r=this.get("cardInfoMap");if(!(!r||!r[e])){var n=r[e],a=n.card,i=n.link;(0,Kn.Z)(a,{display:"none"}),i==null||i.hide();var o=this.get("onAnnotationChange");o(r[e],"hide")}}},t.prototype.removeCard=function(e){if(!this.destroyed){var r=this.get("cardInfoMap");if(!!r){var n=r[e],a=n.card,i=n.link,o=this.get("container");o.removeChild(a),i==null||i.remove(!0),delete r[e];var s=this.get("onAnnotationChange");s(n,"remove")}}},t.prototype.bindListener=function(e,r){var n=this;if(!this.destroyed){e.addEventListener("mousemove",function(s){var l;if(s.target.className==="g6-annotation-collapse"?l="collapse":s.target.className==="g6-annotation-expand"?l="expand":s.target.className==="g6-annotation-close"&&(l="close"),l){var h=n.get("cardCfg").onMouseEnterIcon,p=h===void 0?function(){}:h;p(s,r,l)}}),e.addEventListener("mouseout",function(s){var l;if(s.target.className==="g6-annotation-collapse"?l="collapse":s.target.className==="g6-annotation-expand"?l="expand":s.target.className==="g6-annotation-close"&&(l="close"),l){var h=n.get("cardCfg").onMouseLeaveIcon,p=h===void 0?function(){}:h;p(s,r,l)}}),e.addEventListener("mouseenter",function(s){var l=n.get("cardInfoMap");if(!!l){var h=n.get("graph"),p=h.findById(r);if(p){var D=n.get("itemHighlightState");h.setItemState(p,D,!0)}var I=l[r].link;if(I){var F=n.get("linkHighlightStyle")||{};I.attr(F)}}}),e.addEventListener("mouseleave",function(s){var l=n.get("cardInfoMap");if(!!l){var h=n.get("graph"),p=h.findById(r);if(p){var D=n.get("itemHighlightState");h.setItemState(p,D,!1)}var I=l[r].link;if(I){var F=n.get("linkHighlightStyle")||{};Object.keys(F).forEach(function(ee){I.attr(ee,void 0),I.attr(ee,void 0)});var Z=n.get("linkStyle");I.attr(Z)}}}),e.addEventListener("click",function(s){var l=(n.get("cardCfg")||{}).onClickIcon;if(s.target.className==="g6-annotation-collapse"||s.target.className==="g6-annotation-expand"){var h=n.get("cardCfg").collapseType;h==="hide"?n.hideCard(r):n.handleExpandCollapseCard(r),l==null||l(s,r,s.target.className==="g6-annotation-collapse"?"collapse":"expand")}else if(s.target.className==="g6-annotation-close"){var p=n.get("cardCfg").closeType;p==="remove"?n.removeCard(r):n.hideCard(r),l==null||l(s,r,"close")}});var a=this.get("editable");a&&e.addEventListener("dblclick",function(s){var l=n.get("cardInfoMap"),h=(n.get("cardCfg")||{}).maxTitleLength,p=h===void 0?20:h;if(!!l){var D=s.target,I=D.className;if(!(I!=="g6-annotation-title"&&I!=="g6-annotation-content")){var F=I==="g6-annotation-title"?D.getBoundingClientRect():D.parentNode.getBoundingClientRect(),Z=F.width,ee=F.height,se=getComputedStyle(D),oe=I==="g6-annotation-title"?"input":"textarea",ce=(0,Aa.Z)("<".concat(oe,' class="').concat(I,'-input" type="textarea" style="width:').concat(Z,"px; height: ").concat(ee,'px; min-width: 16px;"/>')),we=(0,Aa.Z)('<div class="'.concat(I,'-input-wrapper" style="width: ').concat(Z,"px; height: ").concat(ee,"px; min-width: 16px; margin-right: ").concat(se.marginRight,'" />'));we.appendChild(ce),D.parentNode.replaceChild(we,D);var Re=l[r],Oe=Re.contentPlaceholder,Pe=Re.titlePlaceholder,He=Re.content,at=Re.title,qe=He;I==="g6-annotation-title"?(ce.name="title",ce.maxLength=p,qe=at):ce.name="content",qe?(ce.innerHTML=D.innerHTML,ce.value=D.innerHTML):ce.placeholder=I==="g6-annotation-title"?Pe:Oe,ce.focus(),ce.addEventListener("blur",function(yt){ce.value&&(D.innerHTML=ce.value,Re[ce.name||"title"]=ce.value),we.parentNode.replaceChild(D,we),n.updateCardSize(r);var Ft=n.get("onAnnotationChange");Ft==null||Ft(Re,"update")})}}});var i=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];e.draggable=!0,e.addEventListener("dragstart",function(s){var l=s.target.className;if(!i.includes(l)){var h=e.style;n.set("dragging",{card:e,x:s.clientX,y:s.clientY,left:oc(h.left),top:oc(h.top)})}}),e.addEventListener("drag",function(s){s.preventDefault();var l=n.get("cardInfoMap");if(!!l){var h=s.clientX,p=s.clientY,D=n.get("dragging");if(!(isNaN(h)||isNaN(p)||!D)){var I=D.x,F=D.y,Z=D.left,ee=D.top,se=D.card,oe=h-I,ce=p-F;Z+=oe,ee+=ce;var we=n.get("graph"),Re=we.getPointByCanvas(0,0),Oe=we.getPointByCanvas(we.getWidth(),we.getHeight()),Pe=we.getClientByPoint(Re.x,Re.y),He=Pe.x,at=Pe.y,qe=we.getClientByPoint(Oe.x,Oe.y),yt=qe.x,Ft=qe.y,yr=se.getBoundingClientRect(),fr=yr.right-yr.left,lr=yr.bottom-yr.top;(Z>yt-He-fr&&oe>0||Z<0&&oe<0)&&(Z-=oe),(ee>Ft-at-lr&&ce>0||ee<0&&ce<0)&&(ee-=ce),(0,Kn.Z)(se,{left:"".concat(Z,"px"),top:"".concat(ee,"px"),visibility:"hidden"}),I=h,F=p;var Kt=(l[r]||{}).link;if(Kt){var jr=we.findById(r);Kt.attr("path",ql(jr,yr,we,n.get("canvas")))}n.set("dragging",{x:I,y:F,left:Z,top:ee,card:se})}}});var o=function(l){var h=n.get("cardInfoMap");if(!!h){var p=n.get("dragging");if(p){var D=p.left,I=p.top,F=p.card;h[r].x=D,h[r].y=I,(0,Kn.Z)(F,{visibility:"visible"}),n.set("dragging",!1);var Z=n.get("rows");Z==null||Z.forEach(function(se){for(var oe=se.length-1;oe>=0;oe--)se[oe].id===r&&se.splice(oe,1)});var ee=n.get("onAnnotationChange");ee==null||ee(h[r],"update")}}};e.addEventListener("dragend",o)}},t.prototype.updateCardSize=function(e){var r=this.get("cardInfoMap");if(!!r){var n=r[e].card,a=n.getBoundingClientRect().width,i=n.getElementsByClassName("g6-annotation-title")[0];if(i){var o=getComputedStyle(i),s=oc(o.marginLeft),l=i.getBoundingClientRect().width;(0,Kn.Z)(i,{marginRight:"".concat(a-s-24-16-l,"px")})}}},t.prototype.updateLink=function(e){var r=e.item;if(!!r){var n=this.get("cardInfoMap");if(!!n){var a=this.get("canvas"),i=this.get("graph"),o=r.getID(),s=n[o]||{},l=s.link,h=s.card;if(l){var p=ql(r,h.getBoundingClientRect(),i,a);l.attr("path",p)}}}},t.prototype.updateLinks=function(){var e=this;if(!this.destroyed){var r=this.get("cardInfoMap");if(!!r){var n=this.get("graph");Object.values(r).forEach(function(a){var i=a.id,o=n.findById(i);e.updateLink({item:o})})}}},t.prototype.onGraphDataChange=function(){var e=this,r=this.get("cardInfoMap");if(!!r){var n=this.get("graph");Object.values(r).forEach(function(a){var i=a.id,o=a.card,s=a.isCanvas;if(!(!o||s||o.style.display==="none")){var l=n.findById(i);l&&l.isVisible()?e.toggleAnnotation(l):e.hideCard(i)}})}},t.prototype.onGraphItemVisibilityChange=function(e){var r=e.item,n=e.visible;if(!(!r||r.destroyed)){var a=this.get("cardInfoMap");if(!!a){var i=r.getID();!a[i]||n||this.hideCard(i)}}},t.prototype.saveData=function(e){e===void 0&&(e=!1);var r=this.get("cardInfoMap");if(!!r){var n=this.get("graph"),a=this.get("getTitle"),i=this.get("getContent"),o=[];return Object.values(r).forEach(function(s){var l=s.title,h=s.content,p=s.x,D=s.y,I=s.id,F=s.collapsed,Z=s.card;if(!(Z&&Z.style.display==="none"&&!e)){var ee=n.findById(I)||n.get("canvas");o.push({id:I,x:p,y:D,collapsed:F,title:l||(a==null?void 0:a(ee)),content:h||(i==null?void 0:i(ee)),visible:Z&&Z.style.display!=="none"})}}),o}},t.prototype.readData=function(e){var r=this,n=this.get("graph");e.forEach(function(a){var i=a.id,o=a.x,s=a.y,l=a.title,h=a.content,p=a.collapsed,D=a.visible,I=n.findById(i);if(!I&&i===gd&&(I=n.get("canvas")),!I){var F=r.get("cardInfoMap")||{};F[i]=a,r.set("cardInfoMap",F);return}r.toggleAnnotation(I,{x:o,y:s,title:l,content:h,collapsed:p}),D||r.hideCard(i)})},t.prototype.clear=function(){var e=this.get("cardInfoMap");if(!!e){var r=this.get("container");Object.values(e).forEach(function(n){var a=n.card,i=n.link;r.removeChild(a),i==null||i.remove(!0)}),this.set("cardInfoMap",{})}},t.prototype.destroy=function(){var e;this.clear(),(e=this.get("canvas"))===null||e===void 0||e.destroy();var r=this.get("graph");!r||r.destroyed||(this.get("containerCfg")&&r.getContainer().removeChild(this.get("container")),this.destroyed=!0)},t}(Qi),Ch=Mh,Th=function(t,e){var r,n,a,i=Infinity;Object.keys(t).forEach(function(l){var h=t[l];Object.keys(e).forEach(function(p){var D=e[p],I=h.x-D.x,F=h.y-D.y,Z=I*I+F*F;i>Z&&(i=Z,r=h,n=D,a=[l,p])})});var o=20,s=ki.getControlPoint(r,n,.5,o);return[["M",r.x,r.y],["Q",s.x,s.y,n.x,n.y]]},ql=function(t,e,r,n){var a,i,o=t.getType();if(o==="edge")i=[t.getKeyShape().getPoint(.5)];else{var s=(a=t.getKeyShape)===null||a===void 0?void 0:a.call(t).getBBox(),l=s.minX,h=s.minY,p=s.maxX,D=s.maxY,I=t.getModel(),F=I.x,Z=I.y;l+=F,h+=Z,p+=F,D+=Z,i={left:{x:l,y:(h+D)/2},right:{x:p,y:(h+D)/2},top:{x:(l+p)/2,y:h},bottom:{x:(l+p)/2,y:D}}}Object.keys(i).forEach(function(at){var qe=i[at],yt=qe.x,Ft=qe.y,yr=r.getClientByPoint(yt,Ft);i[at]=n.getPointByClient(yr.x,yr.y)});var ee=e.top,se=ee===void 0?0:ee,oe=e.left,ce=oe===void 0?0:oe,we=e.right,Re=we===void 0?0:we,Oe=e.bottom,Pe=Oe===void 0?0:Oe,He={left:n.getPointByClient(ce,(se+Pe)/2),right:n.getPointByClient(Re,(se+Pe)/2),top:n.getPointByClient((ce+Re)/2,se),bottom:n.getPointByClient((ce+Re)/2,Pe)};return Th(i,He)},oc=function(t){return Number(t.replace(/\s+|px/gi,""))||0},Ih={PluginBase:Qi,Menu:Es,Grid:jc,Minimap:bl,Bundling:Sl,ToolBar:ve,Tooltip:Zt,Fisheye:Zc,TimeBar:yn,ImageMinimap:Sa,EdgeFilterLens:kl,SnapLine:Eh,Legend:Sh,Annotation:Ch},Oh=Ih,Vi=Oh;To("circle",{options:{size:Kr.defaultNode.size,style:{x:0,y:0,stroke:Kr.defaultNode.style.stroke,fill:Kr.defaultNode.style.fill,lineWidth:Kr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Kr.nodeLabel.style.fill,fontSize:Kr.nodeLabel.style.fontSize,fontFamily:Kr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Kr.defaultNode.linkPoints.size,lineWidth:Kr.defaultNode.linkPoints.lineWidth,fill:Kr.defaultNode.linkPoints.fill,stroke:Kr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,b.__assign)({},Kr.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=(0,m.deepMix)({},n,t.icon),o="".concat(this.type,"-keyShape"),s=e.addShape("circle",{attrs:a,className:o,name:o,draggable:!0});e.shapeMap[o]=s;var l=i.width,h=i.height,p=i.show,D=i.text;if(p){var I="".concat(this.type,"-icon");D?e.shapeMap[I]=e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:I,name:I,draggable:!0}):e.shapeMap[I]=e.addShape("image",{attrs:(0,b.__assign)({x:-l/2,y:-h/2},i),className:I,name:I,draggable:!0})}return this.drawLinkPoints(t,e),s},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints;if(!!r){var n=r||{},a=n.top,i=n.left,o=n.right,s=n.bottom,l=n.size,h=n.r,p=(0,b.__rest)(n,["top","left","right","bottom","size","r"]),D=this.getSize(t),I=D[0]/2;if(i){var F="link-point-left";e.shapeMap[F]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:-I,y:0,r:l/2||h||5}),className:F,name:F,isAnchorPoint:!0})}if(o){var Z="link-point-right";e.shapeMap[Z]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:I,y:0,r:l/2||h||5}),className:Z,name:Z,isAnchorPoint:!0})}if(a){var ee="link-point-top";e.shapeMap[ee]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:0,y:-I,r:l/2||h||5}),className:ee,name:ee,isAnchorPoint:!0})}if(s){var se="link-point-bottom";e.shapeMap[se]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:0,y:I,r:l/2||h||5}),className:se,name:se,isAnchorPoint:!0})}}},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,m.deepMix)({},e,r),a=this.getSize(t),i=a[0]/2,o=(0,b.__assign)({x:0,y:0,r:i},n);return o},update:function(t,e,r){var n=e.getContainer(),a=this.getSize(t),i=(0,b.__assign)({},t.style);t.style.stroke===void 0&&t.color&&(i.stroke=t.color),t.style.r===void 0&&!isNaN(a[0])&&(i.r=a[0]/2),this.updateShape(t,e,i,!0,r),this.updateLinkPoints(t,n)}},"single-node"),To("rect",{options:{size:[100,30],style:{radius:0,stroke:Kr.defaultNode.style.stroke,fill:Kr.defaultNode.style.fill,lineWidth:Kr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Kr.nodeLabel.style.fill,fontSize:Kr.nodeLabel.style.fontSize,fontFamily:Kr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Kr.defaultNode.linkPoints.size,lineWidth:Kr.defaultNode.linkPoints.lineWidth,fill:Kr.defaultNode.linkPoints.fill,stroke:Kr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},anchorPoints:[[0,.5],[1,.5]],stateStyles:(0,b.__assign)({},Kr.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t),n=e.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return e.shapeMap["".concat(this.type,"-keyShape")]=n,this.drawLinkPoints(t,e),n},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=r===void 0?{}:r,a=n.top,i=n.left,o=n.right,s=n.bottom,l=n.size,h=n.r,p=(0,b.__rest)(n,["top","left","right","bottom","size","r"]),D=this.getSize(t),I=D[0],F=D[1];i&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:-I/2,y:0,r:l/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),o&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:I/2,y:0,r:l/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:0,y:-F/2,r:l/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:0,y:F/2,r:l/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,m.mix)({},e,r),a=this.getSize(t),i=n.width||a[0],o=n.height||a[1],s=(0,b.__assign)({x:-i/2,y:-o/2,width:i,height:o},n);return s},update:function(t,e,r){var n=e.getContainer(),a=this.getOptions({}).style,i=this.getSize(t),o=e.get("keyShape");t.size||(i[0]=o.attr("width")||a.width,i[1]=o.attr("height")||a.height);var s={stroke:t.color,x:-i[0]/2,y:-i[1]/2,width:i[0],height:i[1]},l=(0,m.mix)({},a,o.attr(),s);l=(0,m.mix)(l,t.style),this.updateShape(t,e,l,!1,r),this.updateLinkPoints(t,n)}},"single-node"),To("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:Kr.defaultNode.style.stroke,fill:Kr.defaultNode.style.fill,lineWidth:Kr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Kr.nodeLabel.style.fill,fontSize:Kr.nodeLabel.style.fontSize,fontFamily:Kr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Kr.defaultNode.linkPoints.size,lineWidth:Kr.defaultNode.linkPoints.lineWidth,fill:Kr.defaultNode.linkPoints.fill,stroke:Kr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,b.__assign)({},Kr.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=e.addShape("ellipse",{attrs:a,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});e.shapeMap["ellipse-keyShape"]=i;var o=n.width,s=n.height,l=n.show,h=n.text;return l&&(h?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,b.__assign)({x:-o/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),i},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=r===void 0?{}:r,a=n.top,i=n.left,o=n.right,s=n.bottom,l=n.size,h=n.r,p=(0,b.__rest)(n,["top","left","right","bottom","size","r"]),D=this.getSize(t),I=D[0]/2,F=D[1]/2;i&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:-I,y:0,r:l/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),o&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:I,y:0,r:l/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:0,y:-F,r:l/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:0,y:F,r:l/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,m.mix)({},e,r),a=this.getSize(t),i=a[0]/2,o=a[1]/2,s=(0,b.__assign)({x:0,y:0,rx:i,ry:o},n);return s},update:function(t,e,r){var n=e.getContainer(),a=this.getOptions({}).style,i=this.getSize(t),o={stroke:t.color,rx:i[0]/2,ry:i[1]/2},s=e.get("keyShape"),l=(0,m.mix)({},a,s.attr(),o);l=(0,m.mix)(l,t.style),this.updateShape(t,e,l,!0,r),this.updateLinkPoints(t,n)}},"single-node"),To("diamond",{options:{size:[80,80],style:{stroke:Kr.defaultNode.style.stroke,fill:Kr.defaultNode.style.fill,lineWidth:Kr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Kr.nodeLabel.style.fill,fontSize:Kr.nodeLabel.style.fontSize,fontFamily:Kr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Kr.defaultNode.linkPoints.size,lineWidth:Kr.defaultNode.linkPoints.lineWidth,fill:Kr.defaultNode.linkPoints.fill,stroke:Kr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,b.__assign)({},Kr.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=i;var o=n.width,s=n.height,l=n.show,h=n.text;return l&&(h?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,b.__assign)({x:-o/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),i},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=r===void 0?{}:r,a=n.top,i=n.left,o=n.right,s=n.bottom,l=n.size,h=n.r,p=(0,b.__rest)(n,["top","left","right","bottom","size","r"]),D=this.getSize(t),I=D[0],F=D[1];i&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:-I/2,y:0,r:l/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),o&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:I/2,y:0,r:l/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:0,y:-F/2,r:l/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:0,y:F/2,r:l/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(t){var e=this.getSize(t),r=e[0],n=e[1],a=[["M",0,-n/2],["L",r/2,0],["L",0,n/2],["L",-r/2,0],["Z"]];return a},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,m.mix)({},e,r),a=this.getPath(t),i=(0,b.__assign)({path:a},n);return i},update:function(t,e,r){var n=e.getContainer(),a=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},s=e.get("keyShape"),l=(0,m.mix)({},a,s.attr(),o);l=(0,m.mix)(l,t.style),this.updateShape(t,e,l,!0,r),this.updateLinkPoints(t,n)}},"single-node"),To("triangle",{options:{size:40,direction:"up",style:{stroke:Kr.defaultNode.style.stroke,fill:Kr.defaultNode.style.fill,lineWidth:Kr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Kr.nodeLabel.style.fill,fontSize:Kr.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Kr.defaultNode.linkPoints.size,lineWidth:Kr.defaultNode.linkPoints.lineWidth,fill:Kr.defaultNode.linkPoints.fill,stroke:Kr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20,offset:6},stateStyles:(0,b.__assign)({},Kr.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.icon,a=n===void 0?{}:n,i=r.direction,o=this.getShapeStyle(t),s=t.direction||i,l=e.addShape("path",{attrs:o,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=l;var h=a.width,p=a.height,D=a.show,I=a.offset,F=a.text;if(D)if(F)e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0});else{var Z=-h/2,ee=-p/2;(s==="up"||s==="down")&&(ee+=I),(s==="left"||s==="right")&&(Z+=I),e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,b.__assign)({x:Z,y:ee},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(t,e),l},drawLinkPoints:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.linkPoints,a=n===void 0?{}:n,i=r.direction,o=t.direction||i,s=a.top,l=a.left,h=a.right,p=a.bottom,D=a.size,I=a.r,F=(0,b.__rest)(a,["top","left","right","bottom","size","r"]),Z=this.getSize(t),ee=Z[0];if(l){var se=null,oe=ee*Math.sin(1/3*Math.PI),ce=ee*Math.sin(1/3*Math.PI);o==="up"?se=[-ce,oe]:o==="down"?se=[-ce,-oe]:o==="left"&&(se=[-ce,ce-oe]),se&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},F),{x:se[0],y:se[1],r:D/2||I||5}),className:"link-point-left",name:"link-point-left"}))}if(h){var we=null,oe=ee*Math.sin(1/3*Math.PI),ce=ee*Math.sin(1/3*Math.PI);o==="up"?we=[ce,oe]:o==="down"?we=[ce,-oe]:o==="right"&&(we=[ce,ce-oe]),we&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},F),{x:we[0],y:we[1],r:D/2||I||5}),className:"link-point-right",name:"link-point-right"}))}if(s){var Re=null,oe=ee*Math.sin(1/3*Math.PI),ce=ee*Math.sin(1/3*Math.PI);o==="up"?Re=[ce-oe,-oe]:o==="left"?Re=[ce,-oe]:o==="right"&&(Re=[-ce,-oe]),Re&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},F),{x:Re[0],y:Re[1],r:D/2||I||5}),className:"link-point-top",name:"link-point-top"}))}if(p){var Oe=null,oe=ee*Math.sin(1/3*Math.PI),ce=ee*Math.sin(1/3*Math.PI);o==="down"?Oe=[-ce+oe,oe]:o==="left"?Oe=[ce,oe]:o==="right"&&(Oe=[-ce,oe]),Oe&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},F),{x:Oe[0],y:Oe[1],r:D/2||I||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(t){var e=(this.mergeStyle||this.getOptions(t)).direction,r=t.direction||e,n=this.getSize(t),a=n[0],i=a*Math.sin(1/3*Math.PI),o=a*Math.sin(1/3*Math.PI),s=[["M",-o,i],["L",0,-i],["L",o,i],["Z"]];return r==="down"?s=[["M",-o,-i],["L",o,-i],["L",0,i],["Z"]]:r==="left"?s=[["M",-o,o-i],["L",o,-o],["L",o,o],["Z"]]:r==="right"&&(s=[["M",o,o-i],["L",-o,o],["L",-o,-o],["Z"]]),s},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,m.mix)({},e,r),a=this.getPath(t),i=(0,b.__assign)({path:a},n);return i},update:function(t,e,r){var n=e.getContainer(),a=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},s=e.get("keyShape"),l=(0,m.mix)({},a,s.attr(),o);l=(0,m.mix)(l,t.style),this.updateShape(t,e,l,!0,r),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var r=this.getOptions({}),n=r.linkPoints,a=r.direction,i=t.direction||a,o=e.shapeMap["link-point-left"]||e.find(function(Kt){return Kt.get("className")==="link-point-left"}),s=e.shapeMap["link-point-right"]||e.find(function(Kt){return Kt.get("className")==="link-point-right"}),l=e.shapeMap["link-point-top"]||e.find(function(Kt){return Kt.get("className")==="link-point-top"}),h=e.shapeMap["link-point-bottom"]||e.find(function(Kt){return Kt.get("className")==="link-point-bottom"}),p=n,D=o||s||l||h;D&&(p=D.attr());var I=(0,m.mix)({},p,t.linkPoints),F=I.fill,Z=I.stroke,ee=I.lineWidth,se=I.size/2;se||(se=I.r);var oe=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},ce=oe.left,we=oe.right,Re=oe.top,Oe=oe.bottom,Pe=this.getSize(t),He=Pe[0],at={r:se,fill:F,stroke:Z,lineWidth:ee},qe=null,yt=He*Math.sin(1/3*Math.PI),Ft=He*Math.sin(1/3*Math.PI);i==="up"?qe=[-Ft,yt]:i==="down"?qe=[-Ft,-yt]:i==="left"&&(qe=[-Ft,Ft-yt]),qe&&(o?!ce&&ce!==void 0?(o.remove(),delete e.shapeMap["link-point-left"]):o.attr((0,b.__assign)((0,b.__assign)({},at),{x:qe[0],y:qe[1]})):ce&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},at),{x:qe[0],y:qe[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var yr=null;i==="up"?yr=[Ft,yt]:i==="down"?yr=[Ft,-yt]:i==="right"&&(yr=[Ft,Ft-yt]),yr&&(s?!we&&we!==void 0?(s.remove(),delete e.shapeMap["link-point-right"]):s.attr((0,b.__assign)((0,b.__assign)({},at),{x:yr[0],y:yr[1]})):we&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},at),{x:yr[0],y:yr[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var fr=null;i==="up"?fr=[Ft-yt,-yt]:i==="left"?fr=[Ft,-yt]:i==="right"&&(fr=[-Ft,-yt]),fr&&(l?!Re&&Re!==void 0?(l.remove(),delete e.shapeMap["link-point-top"]):l.attr((0,b.__assign)((0,b.__assign)({},at),{x:fr[0],y:fr[1]})):Re&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},at),{x:fr[0],y:fr[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var lr=null;i==="down"?lr=[-Ft+yt,yt]:i==="left"?lr=[Ft,yt]:i==="right"&&(lr=[-Ft,yt]),lr&&(h?!Oe&&Oe!==void 0?(h.remove(),delete e.shapeMap["link-point-bottom"]):h.attr((0,b.__assign)((0,b.__assign)({},at),{x:lr[0],y:lr[1]})):Oe&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},at),{x:lr[0],y:lr[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node"),To("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:Kr.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:Kr.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:Kr.windowFontFamily},paddingTop:0},preRect:{show:!0,width:4,fill:"#40a9ff",radius:2},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:10,lineWidth:1,fill:"#72CC4A",stroke:"#72CC4A"},logoIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg",width:16,height:16,offset:0},stateIcon:{show:!0,x:0,y:0,img:"https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg",width:16,height:16,offset:-5},anchorPoints:[[0,.5],[1,.5]]},shapeType:"modelRect",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).preRect,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=this.getSize(t),o=i[0],s=i[1],l=e.addShape("rect",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=l;var h=n.show,p=(0,b.__rest)(n,["show"]);return h&&(e.shapeMap["pre-rect"]=e.addShape("rect",{attrs:(0,b.__assign)({x:-o/2,y:-s/2,height:s},p),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(t,e),this.drawStateIcon(t,e),this.drawLinkPoints(t,e),l},drawLogoIcon:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).logoIcon,n=r===void 0?{}:r,a=this.getSize(t),i=a[0];if(n.show){var o=n.width,s=n.height,l=n.x,h=n.y,p=n.offset,D=n.text,I=(0,b.__rest)(n,["width","height","x","y","offset","text"]);D?e.shapeMap["rect-logo-icon"]=e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},I),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0}):e.shapeMap["rect-logo-icon"]=e.addShape("image",{attrs:(0,b.__assign)((0,b.__assign)({},I),{x:l||-i/2+o+p,y:h||-s/2,width:o,height:s}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).stateIcon,n=r===void 0?{}:r,a=this.getSize(t),i=a[0];if(n.show){var o=n.width,s=n.height,l=n.x,h=n.y,p=n.offset,D=n.text,I=(0,b.__rest)(n,["width","height","x","y","offset","text"]);D?e.shapeMap["rect-state-icon"]=e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},I),className:"rect-state-icon",name:"rect-state-icon",draggable:!0}):e.shapeMap["rect-state-icon"]=e.addShape("image",{attrs:(0,b.__assign)((0,b.__assign)({},I),{x:l||i/2-o+p,y:h||-s/2,width:o,height:s}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=r===void 0?{}:r,a=n.top,i=n.left,o=n.right,s=n.bottom,l=n.size,h=n.r,p=(0,b.__rest)(n,["top","left","right","bottom","size","r"]),D=this.getSize(t),I=D[0],F=D[1];i&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:-I/2,y:0,r:l/2||h||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),o&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:I/2,y:0,r:l/2||h||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:0,y:-F/2,r:l/2||h||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),s&&(e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},p),{x:0,y:F/2,r:l/2||h||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(t,e){var r=this.getOptions(t),n=r.labelCfg,a=n===void 0?{}:n,i=r.logoIcon,o=i===void 0?{}:i,s=r.descriptionCfg,l=s===void 0?{}:s,h=this.getSize(t),p=h[0],D=null,I=o.show,F=o.width,Z=-p/2+a.offset;I&&(Z=-p/2+F+a.offset);var ee=a.style,se=l.style,oe=l.paddingTop;return(0,m.isString)(t.description)?(D=e.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},ee),{x:Z,y:-5,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=D,e.shapeMap["rect-description"]=e.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},se),{x:Z,y:17+(oe||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(D=e.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},ee),{x:Z,y:7,text:t.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),e.shapeMap["text-shape"]=D),D},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,m.mix)({},e,r),a=this.getSize(t),i=n.width||a[0],o=n.height||a[1],s=(0,b.__assign)({x:-i/2,y:-o/2,width:i,height:o},n);return s},update:function(t,e){var r=this.mergeStyle||this.getOptions(t),n=r.style,a=n===void 0?{}:n,i=r.labelCfg,o=i===void 0?{}:i,s=r.descriptionCfg,l=s===void 0?{}:s,h=this.getSize(t),p=h[0],D=h[1],I=e.get("keyShape");I.attr((0,b.__assign)((0,b.__assign)({},a),{x:-p/2,y:-D/2,width:p,height:D}));var F=e.getContainer(),Z=F.shapeMap["rect-logo-icon"]||F.find(function(Tn){return Tn.get("className")==="rect-logo-icon"}),ee=Z?Z.attr():{},se=(0,m.mix)({},ee,t.logoIcon),oe=se.width;oe===void 0&&(oe=this.options.logoIcon.width);var ce=t.logoIcon?t.logoIcon.show:void 0,we=o.offset,Re=-p/2+oe+we;!ce&&ce!==void 0&&(Re=-p/2+we);var Oe=F.shapeMap["node-label"]||F.find(function(Tn){return Tn.get("className")==="node-label"}),Pe=F.shapeMap["rect-description"]||F.find(function(Tn){return Tn.get("className")==="rect-description"});if(t.label)if(!Oe)F.shapeMap["node-label"]=F.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},o.style),{x:Re,y:t.description?-5:7,text:t.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var He=t.labelCfg?t.labelCfg.style:{},at=(0,m.mix)({},Oe.attr(),He);t.label&&(at.text=t.label),at.x=Re,(0,m.isString)(t.description)&&(at.y=-5),Pe&&(Pe.resetMatrix(),Pe.attr({x:Re})),Oe.resetMatrix(),Oe.attr(at)}if((0,m.isString)(t.description)){var qe=l.paddingTop;if(!Pe)F.shapeMap["rect-description"]=F.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},l.style),{x:Re,y:17+(qe||0),text:t.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var He=t.descriptionCfg?t.descriptionCfg.style:{},yt=(0,m.mix)({},Pe.attr(),He);(0,m.isString)(t.description)&&(yt.text=t.description),yt.x=Re,Pe.resetMatrix(),Pe.attr((0,b.__assign)((0,b.__assign)({},yt),{y:17+(qe||0)}))}}var Ft=F.shapeMap["pre-rect"]||F.find(function(Tn){return Tn.get("className")==="pre-rect"});if(Ft&&!Ft.destroyed){var yr=(0,m.mix)({},Ft.attr(),t.preRect);Ft.attr((0,b.__assign)((0,b.__assign)({},yr),{x:-p/2,y:-D/2,height:D}))}if(Z&&!Z.destroyed)if(!ce&&ce!==void 0)Z.remove(),delete F.shapeMap["pre-rect"];else{var fr=se.width,lr=se.height,Kt=se.x,jr=se.y,Xr=se.offset,er=(0,b.__rest)(se,["width","height","x","y","offset"]);Z.attr((0,b.__assign)((0,b.__assign)({},er),{x:Kt||-p/2+fr+Xr,y:jr||-lr/2,width:fr,height:lr}))}else ce&&this.drawLogoIcon(t,F);var mr=F.shapeMap["rect-state-icon"]||F.find(function(Tn){return Tn.get("className")==="rect-state-icon"}),kr=mr?mr.attr():{},Fr=(0,m.mix)({},kr,t.stateIcon);if(mr){!Fr.show&&Fr.show!==void 0&&(mr.remove(),delete F.shapeMap["rect-state-icon"]);var Jr=Fr.width,lr=Fr.height,Kt=Fr.x,jr=Fr.y,fn=Fr.offset,Vn=(0,b.__rest)(Fr,["width","height","x","y","offset"]);mr.attr((0,b.__assign)((0,b.__assign)({},Vn),{x:Kt||p/2-Jr+fn,y:jr||-lr/2,width:Jr,height:lr}))}else Fr.show&&this.drawStateIcon(t,F);this.updateLinkPoints(t,F)},getOptions:function(t,e){return e==="move"?t:(0,m.deepMix)({},this.options,this.getCustomConfig(t)||{},t)}},"single-node"),To("star",{options:{size:60,style:{stroke:Kr.defaultNode.style.stroke,fill:Kr.defaultNode.style.fill,lineWidth:Kr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Kr.nodeLabel.style.fill,fontSize:Kr.nodeLabel.style.fontSize,fontFamily:Kr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Kr.defaultNode.linkPoints.size,lineWidth:Kr.defaultNode.linkPoints.lineWidth,fill:Kr.defaultNode.linkPoints.fill,stroke:Kr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,b.__assign)({},Kr.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=e.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});e.shapeMap["".concat(this.type,"-keyShape")]=i;var o=n.width,s=n.height,l=n.show,h=n.text;return l&&(h?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,b.__assign)({x:-o/2,y:-s/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(t,e),i},drawLinkPoints:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).linkPoints,n=r===void 0?{}:r,a=n.top,i=n.left,o=n.right,s=n.leftBottom,l=n.rightBottom,h=n.size,p=n.r,D=(0,b.__rest)(n,["top","left","right","leftBottom","rightBottom","size","r"]),I=this.getSize(t),F=I[0];if(o){var Z=Math.cos((18+72*0)/180*Math.PI)*F,ee=Math.sin((18+72*0)/180*Math.PI)*F;e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},D),{x:Z,y:-ee,r:h/2||p||5}),className:"link-point-right",name:"link-point-right"})}if(a){var Z=Math.cos((18+72*1)/180*Math.PI)*F,ee=Math.sin((18+72*1)/180*Math.PI)*F;e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},D),{x:Z,y:-ee,r:h/2||p||5}),className:"link-point-top",name:"link-point-top"})}if(i){var Z=Math.cos((18+72*2)/180*Math.PI)*F,ee=Math.sin((18+72*2)/180*Math.PI)*F;e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},D),{x:Z,y:-ee,r:h/2||p||5}),className:"link-point-left",name:"link-point-left"})}if(s){var Z=Math.cos((18+72*3)/180*Math.PI)*F,ee=Math.sin((18+72*3)/180*Math.PI)*F;e.shapeMap["link-point-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},D),{x:Z,y:-ee,r:h/2||p||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(l){var Z=Math.cos((18+72*4)/180*Math.PI)*F,ee=Math.sin((18+72*4)/180*Math.PI)*F;e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},D),{x:Z,y:-ee,r:h/2||p||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(t){var e=this.getSize(t),r=e[0],n=r*3/8,a=t.innerR||n;return ki.getStarPath(r,a)},getShapeStyle:function(t){var e=(this.mergeStyle||this.getOptions(t)).style,r={stroke:t.color},n=(0,m.mix)({},e,r),a=this.getPath(t),i=(0,b.__assign)({path:a},n);return i},update:function(t,e,r){var n=e.getContainer(),a=this.getOptions({}).style,i=this.getPath(t),o={stroke:t.color,path:i},s=e.get("keyShape"),l=(0,m.mix)({},a,s.attr(),o);l=(0,m.mix)(l,t.style),this.updateShape(t,e,l,!0,r),this.updateLinkPoints(t,n)},updateLinkPoints:function(t,e){var r=this.getOptions({}).linkPoints,n=e.shapeMap["link-point-left"]||e.find(function(yt){return yt.get("className")==="link-point-left"}),a=e.shapeMap["link-point-right"]||e.find(function(yt){return yt.get("className")==="link-point-right"}),i=e.shapeMap["link-point-top"]||e.find(function(yt){return yt.get("className")==="link-point-top"}),o=e.shapeMap["link-point-left-bottom"]||e.find(function(yt){return yt.get("className")==="link-point-left-bottom"}),s=e.shapeMap["link-point-left-bottom"]||e.find(function(yt){return yt.get("className")==="link-point-right-bottom"}),l=r,h=n||a||i||o||s;h&&(l=h.attr());var p=(0,m.mix)({},l,t.linkPoints),D=p.fill,I=p.stroke,F=p.lineWidth,Z=p.size/2;Z||(Z=p.r);var ee=t.linkPoints?t.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},se=ee.left,oe=ee.right,ce=ee.top,we=ee.leftBottom,Re=ee.rightBottom,Oe=this.getSize(t),Pe=Oe[0],He={r:Z,fill:D,stroke:I,lineWidth:F},at=Math.cos((18+72*0)/180*Math.PI)*Pe,qe=Math.sin((18+72*0)/180*Math.PI)*Pe;a?!oe&&oe!==void 0?(a.remove(),delete e.shapeMap["link-point-right"]):a.attr((0,b.__assign)((0,b.__assign)({},He),{x:at,y:-qe})):oe&&(e.shapeMap["link-point-right"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},He),{x:at,y:-qe}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),at=Math.cos((18+72*1)/180*Math.PI)*Pe,qe=Math.sin((18+72*1)/180*Math.PI)*Pe,i?!ce&&ce!==void 0?(i.remove(),delete e.shapeMap["link-point-top"]):i.attr((0,b.__assign)((0,b.__assign)({},He),{x:at,y:-qe})):ce&&(e.shapeMap["link-point-top"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},He),{x:at,y:-qe}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),at=Math.cos((18+72*2)/180*Math.PI)*Pe,qe=Math.sin((18+72*2)/180*Math.PI)*Pe,n?!se&&se!==void 0?(n.remove(),delete e.shapeMap["link-point-left"]):n.attr((0,b.__assign)((0,b.__assign)({},He),{x:at,y:-qe})):se&&(e.shapeMap["link-point-left"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},He),{x:at,y:-qe}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),at=Math.cos((18+72*3)/180*Math.PI)*Pe,qe=Math.sin((18+72*3)/180*Math.PI)*Pe,o?!we&&we!==void 0?(o.remove(),delete e.shapeMap["link-point-left-bottom"]):o.attr((0,b.__assign)((0,b.__assign)({},He),{x:at,y:-qe})):we&&(e.shapeMap["link-point-left-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},He),{x:at,y:-qe}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),at=Math.cos((18+72*4)/180*Math.PI)*Pe,qe=Math.sin((18+72*4)/180*Math.PI)*Pe,s?!Re&&Re!==void 0?(s.remove(),delete e.shapeMap["link-point-right-bottom"]):s.attr((0,b.__assign)((0,b.__assign)({},He),{x:at,y:-qe})):Re&&(e.shapeMap["link-point-right-bottom"]=e.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},He),{x:at,y:-qe}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var pd=ki.defaultSubjectColors,Il="fan-shape-";To("donut",{options:{size:Kr.defaultNode.size,style:{x:0,y:0,stroke:Kr.defaultNode.style.stroke,fill:Kr.defaultNode.style.fill,lineWidth:Kr.defaultNode.style.lineWidth},labelCfg:{style:{fill:Kr.nodeLabel.style.fill,fontSize:Kr.nodeLabel.style.fontSize,fontFamily:Kr.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Kr.defaultNode.linkPoints.size,lineWidth:Kr.defaultNode.linkPoints.lineWidth,fill:Kr.defaultNode.linkPoints.fill,stroke:Kr.defaultNode.linkPoints.stroke},icon:{show:!1,img:"https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg",width:20,height:20},stateStyles:(0,b.__assign)({},Kr.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(t,e){var r=(this.mergeStyle||this.getOptions(t)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(t),i=(0,m.deepMix)({},n,t.icon),o=e.addShape("circle",{attrs:a,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});e.shapeMap["".concat(this.type,"-keyShape")]=o;var s=i.width,l=i.height,h=i.show,p=i.text;return h&&(p?e.shapeMap["".concat(this.type,"-icon")]=e.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):e.shapeMap["".concat(this.type,"-icon")]=e.addShape("image",{attrs:(0,b.__assign)({x:-s/2,y:-l/2},i),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),Ah(t,e,o),this.drawLinkPoints(t,e),o},updateShape:function(t,e,r,n,a){var i=e.get("keyShape");i.attr((0,b.__assign)({},r)),Lh(t,e,i),this.updateLabel(t,e,a),n&&this.updateIcon(t,e)}},"circle");var Ah=function(t,e,r){var n=t.donutAttrs,a=n===void 0?{}:n,i=t.donutColorMap,o=i===void 0?{}:i,s=Object.keys(a).length;if(a&&s>1){var l=yd(a,o),h=l.configs,p=l.totalValue;if(p){var D=md(r),I=D.lineWidth,F=D.arcR,Z=[F,0],ee=0;if(s===1){ed(e,{arcR:F,arcBegin:Z,beginAngle:ee,config:h[0],fanIndex:0,lineWidth:I,totalValue:p,drawWhole:!0});return}for(var se=0;se<h.length;se++){var oe=ed(e,{arcR:F,arcBegin:Z,beginAngle:ee,config:h[se],fanIndex:se,lineWidth:I,totalValue:p});if(oe.shouldEnd)return;Z=oe.arcBegin,ee=oe.beginAngle}}}},ed=function(t,e){var r=e.arcR,n=e.arcBegin,a=e.beginAngle,i=e.config,o=e.fanIndex,s=e.lineWidth,l=e.totalValue,h=e.drawWhole,p=h===void 0?!1:h,D=e.updateShape,I=D===void 0?void 0:D,F=i.value/l;if(F<.001)return{beginAngle:a,arcBegin:n,shape:void 0,shouldEnd:!1};var Z,ee,se;if(p||F>.999)Z=[r,1e-4],se=1;else{var oe=F*Math.PI*2;ee=a+oe,Z=[r*Math.cos(ee),-r*Math.sin(ee)],se=oe>Math.PI?1:0}var ce={path:[["M",n[0],n[1]],["A",r,r,0,se,0,Z[0],Z[1]],["L",Z[0],Z[1]]],stroke:i.color||(I==null?void 0:I.attr("stroke"))||pd[o%pd.length],lineWidth:s};return I?I.attr(ce):t.shapeMap["".concat(Il).concat(o)]=t.addShape("path",{attrs:ce,name:"".concat(Il).concat(o),draggable:!0}),{beginAngle:ee,arcBegin:Z,shape:t.shapeMap["".concat(Il).concat(o)],shouldEnd:p||F>.999}},Lh=function(t,e,r){var n=t.donutAttrs,a=t.donutColorMap,i=a===void 0?{}:a,o={},s=e.getContainer();if(n){var l=yd(n,i),h=l.configs,p=l.totalValue;if(p)for(var D=md(r),I=D.lineWidth,F=D.arcR,Z=[F,0],ee=0,se=0;se<h.length;se++){var oe="".concat(Il).concat(se),ce=ed(s,{arcR:F,arcBegin:Z,beginAngle:ee,config:h[se],fanIndex:se,lineWidth:I,totalValue:p,drawWhole:h.length===1,updateShape:s.shapeMap[oe]});if(ce.shape&&(o[oe]=!0),ce.shouldEnd)break;Z=ce.arcBegin,ee=ce.beginAngle}}var we=Object.keys(s.shapeMap).filter(function(Re){return Re.includes(Il)});we.forEach(function(Re){o[Re]||(s.shapeMap[Re].remove(!0),delete s.shapeMap[Re])})},yd=function(t,e){var r=0,n=[];return Object.keys(t).forEach(function(a){var i=+t[a];isNaN(i)||(n.push({key:a,value:i,color:e[a]}),r+=i)}),{totalValue:r,configs:n}},md=function(t){var e=t.attr("r"),r=.6*e,n=(e+r)/2,a=e-r;return{lineWidth:a,arcR:n}},Rl=function(t){var e=t.x,r=t.y;return{x:e,y:r,centerX:e,centerY:r,minX:e,minY:r,maxX:e,maxY:r,height:0,width:0}},Dh=function(t){t===void 0&&(t=[]);var e=[],r=[];t.forEach(function(s){e.push(s.x),r.push(s.y)});var n=Math.min.apply(Math,e),a=Math.max.apply(Math,e),i=Math.min.apply(Math,r),o=Math.max.apply(Math,r);return{centerX:(n+a)/2,centerY:(i+o)/2,maxX:a,maxY:o,minX:n,minY:i,height:o-i,width:a-n}},Qg=function(t,e){return Math.abs(t.centerX-e.centerX)*2<t.width+e.width&&Math.abs(t.centerY-e.centerY)*2<t.height+e.height},td=function(t){for(var e=[],r={},n=t.length,a=n-1;a>=0;a--){var i=t[a];i.id="".concat(i.x,"|||").concat(i.y),r[i.id]||(r[i.id]=i,e.push(i))}return e},Ed=function(t){return td(t)},Jg=function(t,e){return[t,{x:t.x,y:e.y},e]},Bl=function(t,e){return t.width||t.height?{centerX:t.centerX,centerY:t.centerY,minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e,height:t.height+2*e,width:t.width+2*e}:t},Nh=function(t,e){var r=Math.abs(t.x-e.centerX),n=Math.abs(t.y-e.centerY);return r===0&&n===0?0:r/e.width>n/e.height},rd=function(t,e,r){var n=Nh(e,t);if(n===0){var a=t.centerX,i=t.centerY;return r.y<e.y?i=t.minY:r.x>e.x?a=t.maxX:r.x<e.x?a=t.minX:r.x===e.x&&(i=t.maxY),{x:a,y:i}}return n?{x:e.x>t.centerX?t.maxX:t.minX,y:e.y}:{x:e.x,y:e.y>t.centerY?t.maxY:t.minY}},bd=function(t,e){var r=Math.min(t.minX,e.minX),n=Math.min(t.minY,e.minY),a=Math.max(t.maxX,e.maxX),i=Math.max(t.maxY,e.maxY);return{centerX:(r+a)/2,centerY:(n+i)/2,minX:r,minY:n,maxX:a,maxY:i,height:i-n,width:a-r}},nd=function(t){return[{x:t.minX,y:t.minY},{x:t.maxX,y:t.minY},{x:t.maxX,y:t.maxY},{x:t.minX,y:t.maxY}]},Fl=function(t,e){var r=t.x,n=t.y;return r<e.minX||r>e.maxX||n<e.minY||n>e.maxY},Ph=function(t,e){return e<t.minX||e>t.maxX?[]:[{x:e,y:t.minY},{x:e,y:t.maxY}]},kh=function(t,e){return e<t.minY||e>t.maxY?[]:[{x:t.minX,y:e},{x:t.maxX,y:e}]},Rh=function(t,e){return Ph(t,e.x).concat(kh(t,e.y))},Ol=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Bh=function(t,e){var r=-2,n=0;return e.forEach(function(a){a&&(t.x===a.x&&(n+=r),t.y===a.y&&(n+=r))}),n},xd=function(t,e,r,n,a){return Ol(t,e)+Ol(t,r)+Bh(t,[e,r,n,a])},Fh=function c(t,e,r,n,a){a===void 0&&(a=0),t.unshift(e[n]),r[n]&&r[n]!==n&&a<=100&&c(t,e,r,r[n],a+1)},qg=function(t,e){var r=t.indexOf(e);r>-1&&t.splice(r,1)},Gl=function(t,e,r,n){var a=r.x-t.x,i=r.y-t.y,o=n.x-t.x,s=n.y-t.y,l=r.x-e.x,h=r.y-e.y,p=n.x-e.x,D=n.y-e.y,I=a*s-i*o,F=l*D-h*p,Z=a*h-i*l,ee=o*D-s*p;return I*F<=0&&Z*ee<=0},ad=function(t,e,r){if(r.width||r.height){var n=nd(r),a=n[0],i=n[1],o=n[2],s=n[3];return Gl(t,e,a,i)||Gl(t,e,a,s)||Gl(t,e,i,o)||Gl(t,e,o,s)}return!1},Gh=function(t,e,r,n){var a=[];return t.forEach(function(i){if(i!==e&&(i.x===e.x||i.y===e.y)){if(ad(i,e,r)||ad(i,e,n))return;a.push(i)}}),td(a)},zh=function(t,e,r,n,a,i,o){var s,l=[],h=(s={},s[e.id]=e,s),p={},D={},I={};D[e.id]=0,I[e.id]=xd(e,r,e);var F=new _d;F.add({id:e.id,value:I[e.id]});var Z={};t.forEach(function(Re){Z[Re.id]=Re});for(var ee;Object.keys(h).length;){var se=F.minId(!1);if(se)ee=h[se];else break;if(ee===r){var oe=[];return Fh(oe,Z,p,r.id),oe}delete h[ee.id],F.remove(ee.id),l.push(ee);var ce=Gh(t,ee,n,a),we=function(Oe){Oe.forEach(function(Pe){if(l.indexOf(Pe)===-1){var He=Pe.id;h[He]||(h[He]=Pe);var at=I[ee.id]+Ol(ee,Pe);if(D[He]&&at>=D[He]){F.add({id:He,value:I[He]});return}p[He]=ee.id,D[He]=at,I[He]=D[He]+xd(Pe,r,e,i,o),F.add({id:He,value:I[He]})}})};we(ce)}return[e,r]},Uh=function(t,e,r){return!(t.x===e.x&&e.x===r.x||t.y===e.y&&e.y===r.y)},Wh=function(t,e,r,n){var a=Ol(t,e),i=Ol(r,e);a<n&&(n=a),i<n&&(n=i);var o={x:e.x-n/a*(e.x-t.x),y:e.y-n/a*(e.y-t.y)},s={x:e.x-n/i*(e.x-r.x),y:e.y-n/i*(e.y-r.y)};return[o,s]},wd=function(t,e){var r=[],n=t[0];return r.push("M".concat(n.x," ").concat(n.y)),t.forEach(function(a,i){var o=t[i+1],s=t[i+2];if(o&&s)if(Uh(a,o,s)){var l=Wh(a,o,s,e),h=l[0],p=l[1];r.push("L".concat(h.x," ").concat(h.y)),r.push("Q".concat(o.x," ").concat(o.y," ").concat(p.x," ").concat(p.y)),r.push("L".concat(p.x," ").concat(p.y))}else r.push("L".concat(o.x," ").concat(o.y));else o&&r.push("L".concat(o.x," ").concat(o.y))}),r.join("")},Sd=function(t,e,r,n,a){var i,o;if(!r||!r.getType())i=Rl(t);else if(r.getType()==="combo"){var s=r.getKeyShape().getBBox();if(s){var l=r.getModel(),h=l.x,p=l.y;i={x:h,y:p,width:s.width,height:s.height,minX:s.minX+h,maxX:s.maxX+h,minY:s.minY+p,maxY:s.maxY+p},i.centerX=(i.minX+i.maxX)/2,i.centerY=(i.minY+i.maxY)/2}else i=Rl(t)}else i=r&&r.getBBox();if(!n||!n.getType())o=Rl(e);else if(n.getType()==="combo"){var D=n.getKeyShape().getBBox();if(D){var I=n.getModel(),F=I.x,Z=I.y;o={x:F,y:Z,width:D.width,height:D.height,minX:D.minX+F,maxX:D.maxX+F,minY:D.minY+Z,maxY:D.maxY+Z},o.centerX=(o.minX+o.maxX)/2,o.centerY=(o.minY+o.maxY)/2}else o=Rl(e)}else o=n&&n.getBBox();var ee=Bl(i,a),se=Bl(o,a),oe=rd(ee,t,e),ce=rd(se,e,t),we=Dh([oe,ce]),Re=bd(ee,we),Oe=bd(se,we),Pe=[];Pe=Pe.concat(nd(Re)).concat(nd(Oe));var He={x:(t.x+e.x)/2,y:(t.y+e.y)/2};[we,Re,Oe].forEach(function(qe){Pe=Pe.concat(Rh(qe,He).filter(function(yt){return Fl(yt,ee)&&Fl(yt,se)}))}),[{x:oe.x,y:ce.y},{x:ce.x,y:oe.y}].forEach(function(qe){Fl(qe,ee)&&Fl(qe,se)&&Pe.push(qe)}),Pe.unshift(oe),Pe.push(ce),Pe=td(Pe);var at=zh(Pe,oe,ce,i,o,t,e);return at.unshift(t),at.push(e),Ed(at)},jh=function(t){if(!(t==null?void 0:t.length))return t;for(var e=t[t.length-1],r={x:e.x,y:e.y},n=[e],a=[e],i=t.length-2;i>=0;i--){var o=t[i];if(o.x===r.x?n.push(o):(n=[o],r.x=o.x),o.y===r.y?a.push(o):(a=[o],r.y=o.y),n.length>2){var s=t.indexOf(n[1]);s>-1&&t.splice(s,1);continue}if(a.length>2){var s=t.indexOf(a[1]);s>-1&&t.splice(s,1)}}return t},_d=function(){function c(){this.arr=[],this.map={},this.arr=[],this.map={}}return c.prototype._innerAdd=function(t,e){for(var r=[0,e-1];r[1]-r[0]>1;){var n=Math.floor((r[0]+r[1])/2);if(this.arr[n].value>t.value)r[1]=n;else if(this.arr[n].value<t.value)r[0]=n;else{this.arr.splice(n,0,t),this.map[t.id]=!0;return}}this.arr.splice(r[1],0,t),this.map[t.id]=!0},c.prototype.add=function(t){delete this.map[t.id];var e=this.arr.length;if(!e){this.arr.push(t),this.map[t.id]=!0;return}if(this.arr[e-1].value<t.value){this.arr.push(t),this.map[t.id]=!0;return}this._innerAdd(t,e)},c.prototype.remove=function(t){!this.map[t]||delete this.map[t]},c.prototype._clearAndGetMinId=function(){for(var t,e=this.arr.length-1;e>=0;e--)this.map[this.arr[e].id]?t=this.arr[e].id:this.arr.splice(e,1);return t},c.prototype._findFirstId=function(){for(;this.arr.length;){var t=this.arr.shift();if(this.map[t.id])return t.id}},c.prototype.minId=function(t){return t?this._clearAndGetMinId():this._findFirstId()},c}(),Xh=function(t,e){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)},Vh=function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))},Yh=function(t,e){return[t,e]},Hh=function(t,e,r,n,a){return Ed(Sd(t,e,r,n,a.offset))},Zh={offset:20,maxAllowedDirectionChange:Math.PI/2,maximumLoops:2e3,gridSize:10,directions:[{stepX:1,stepY:0},{stepX:-1,stepY:0},{stepX:0,stepY:1},{stepX:0,stepY:-1}],get penalties(){return{0:0,45:this.gridSize/2,90:this.gridSize/2}},distFunc:Xh,fallbackRoute:Hh},ep={maxAllowedDirectionChange:Math.PI/4,directions:[{stepX:1,stepY:0},{stepX:1,stepY:1},{stepX:0,stepY:1},{stepX:-1,stepY:1},{stepX:-1,stepY:0},{stepX:-1,stepY:-1},{stepX:0,stepY:-1},{stepX:1,stepY:-1}],distFunc:Vh,fallbackRoute:Yh},Wu=function(t,e){var r=Math.round(Math.abs(t/e)),n=t<0?-1:1;return r<0?0:n*r},Kh=function(t,e,r){var n={};return t.forEach(function(a){if(!!a)for(var i=Bl(a.getBBox(),r),o=Wu(i.minX,e);o<=Wu(i.maxX,e);o+=1)for(var s=Wu(i.minY,e);s<=Wu(i.maxY,e);s+=1)n["".concat(o,"|||").concat(s)]=!0}),n},id=function(t,e){var r=e.x-t.x,n=e.y-t.y;return r||n?Math.atan2(n,r):0},Md=function(t,e){var r=Math.abs(t-e);return r>Math.PI?2*Math.PI-r:r},Cd=function(t,e,r){for(var n=Infinity,a=0,i=e.length;a<i;a++){var o=r(t,e[a]);o<n&&(n=o)}return n},Td=function(t,e,r,n,a){var i=[];if(!r)return[t];var o=a.directions,s=a.offset,l=r.getBBox(),h=e.x>l.minX&&e.x<l.maxX&&e.y>l.minY&&e.y<l.maxY,p=Bl(l,s);for(var D in p)p[D]=Wu(p[D],a.gridSize);if(h){for(var I=0,F=o;I<F.length;I++)for(var Z=F[I],ee=[[{x:p.minX,y:p.minY},{x:p.maxX,y:p.minY}],[{x:p.minX,y:p.minY},{x:p.minX,y:p.maxY}],[{x:p.maxX,y:p.minY},{x:p.maxX,y:p.maxY}],[{x:p.minX,y:p.maxY},{x:p.maxX,y:p.maxY}]],D=0;D<4;D++){var se=ee[D],oe=ki.getLineIntersect(t,{x:t.x+Z.stepX*p.width,y:t.y+Z.stepY*p.height},se[0],se[1]);oe&&!ad(t,oe,l)&&(oe.id="".concat(oe.x,"|||").concat(oe.y),i.push(oe))}return i}var ce=rd(p,t,n);return ce.id="".concat(ce.x,"|||").concat(ce.y),[ce]},od=function(t,e,r,n){var a=id(t,e),i=r[t.id];if(!i){var o=id(n,t);return Md(o,a)}var s=id({x:i.x,y:i.y},t);return Md(s,a)},$h=function(t,e,r,n,a,i,o){var s=[n],l=n,h=t.id,p=t.x,D=t.y,I={x:p,y:D,id:h};od(I,i,e,r)&&(l={x:i.x===n.x?n.x:I.x*o,y:i.y===n.y?n.y:I.y*o},s.unshift(l));for(var F=e[h];F&&F.id!==h;){var Z={x:p,y:D,id:h},ee={x:F.x,y:F.y,id:F.id},se=od(ee,Z,e,r);se&&(l={x:ee.x===Z.x?l.x:ee.x*o,y:ee.y===Z.y?l.y:ee.y*o},s.unshift(l)),h=ee.id,p=ee.x,D=ee.y,F=e[h]}return s[0].x=p===r.x?a.x:l.x,s[0].y=D===r.y?a.y:l.y,s.unshift(a),s},Qh=function(t,e,r,n,a){if(isNaN(t.x)||isNaN(e.x))return[];var i=(0,m.deepMix)(Zh,a);i.obstacles=i.obstacles||[];var o=i.penalties,s=i.gridSize,l=Kh(i.obstacles.concat([r,n]),s,i.offset),h={x:Wu(t.x,s),y:Wu(t.y,s)},p={x:Wu(e.x,s),y:Wu(e.y,s)};t.id="".concat(h.x,"|||").concat(h.y),e.id="".concat(p.x,"|||").concat(p.y);var D=Td(h,t,r,p,i),I=Td(p,e,n,h,i);D.forEach(function(er){delete l[er.id]}),I.forEach(function(er){delete l[er.id]});for(var F={},Z={},ee={},se={},oe={},ce=new _d,we=0;we<D.length;we++){var Re=D[we];F[Re.id]=Re,se[Re.id]=0,oe[Re.id]=Cd(Re,I,i.distFunc),ce.add({id:Re.id,value:oe[Re.id]})}var Oe=i.maximumLoops,Pe,He,at,qe,yt,Ft,yr=Infinity,fr={};for(I.forEach(function(er){fr["".concat(er.x,"|||").concat(er.y)]=!0}),Object.keys(F).forEach(function(er){var mr=F[er].id;oe[mr]<=yr&&(yr=oe[mr],Pe=F[mr])});Object.keys(F).length>0&&Oe>0;){var lr=ce.minId((Oe+1)%30==0);if(lr)Pe=F[lr];else break;if(fr["".concat(Pe.x,"|||").concat(Pe.y)])return $h(Pe,ee,h,e,t,p,s);delete F[Pe.id],ce.remove(Pe.id),Z[Pe.id]=!0;for(var we=0;we<i.directions.length;we++){He=i.directions[we];var Kt="".concat(Math.round(Pe.x)+He.stepX,"|||").concat(Math.round(Pe.y)+He.stepY);if(at={x:Pe.x+He.stepX,y:Pe.y+He.stepY,id:Kt},!Z[Kt]&&(Ft=od(Pe,at,ee,h),!(Ft>i.maxAllowedDirectionChange)&&!l[Kt])){F[Kt]||(F[Kt]=at);var jr=o[Ft];qe=i.distFunc(Pe,at)+(isNaN(jr)?s:jr),yt=se[Pe.id]+qe;var Xr=se[Kt];Xr&&yt>=Xr||(ee[Kt]=Pe,se[Kt]=yt,oe[Kt]=yt+Cd(at,I,i.distFunc),ce.add({id:Kt,value:oe[Kt]}))}}Oe-=1}return i.fallbackRoute(t,e,r,n,i)};Sc("polyline",{options:{color:Kr.defaultEdge.color,size:Kr.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:Kr.defaultEdge.style.stroke,lineAppendWidth:Kr.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:Kr.edgeLabel.style.fill,fontSize:Kr.edgeLabel.style.fontSize,fontFamily:Kr.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:(0,b.__assign)({},Kr.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(t,e){var r=this.getShapeStyle(t);r.radius===0&&delete r.radius;var n=e.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return e.shapeMap["edge-shape"]=n,n},getShapeStyle:function(t){var e=this.options.style,r={stroke:t.color},n=(0,m.mix)({},e,r,t.style);t=this.getPathPoints(t),this.radius=n.radius,this.offset=n.offset;var a=t.startPoint,i=t.endPoint,o=this.getControlPoints(t),s=[a];o&&(s=s.concat(o)),s.push(i);var l=t.sourceNode,h=t.targetNode,p=n.radius,D=this.options.routeCfg,I=(0,m.mix)({},D,t.routeCfg);I.offset=n.offset;var F=this.getPath(s,l,h,p,I,!Boolean(o));((0,m.isArray)(F)&&F.length<=1||(0,m.isString)(F)&&F.indexOf("L")===-1)&&(F="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(i.x)||isNaN(i.y))&&(F="M0 0, L0 0");var Z=(0,m.mix)({},Kr.defaultEdge.style,n,{lineWidth:t.size,path:F});return Z},updateShapeStyle:function(t,e){var r=e.getContainer();if(!!e.isVisible()){var n={stroke:t.color},a=r.shapeMap["edge-shape"]||r.find(function(we){return we.get("className")==="edge-shape"})||e.getKeyShape(),i=t.size;t=this.getPathPoints(t);var o=t.startPoint,s=t.endPoint,l=this.getControlPoints(t),h=[o];l&&(h=h.concat(l)),h.push(s);var p=a.attr(),D=(0,m.mix)({},n,p,t.style),I=t.sourceNode,F=t.targetNode,Z=D.radius,ee=this.options.routeCfg,se=(0,m.mix)({},ee,t.routeCfg);se.offset=D.offset;var oe=this.getPath(h,I,F,Z,se,!Boolean(l));((0,m.isArray)(oe)&&oe.length<=1||(0,m.isString)(oe)&&oe.indexOf("L")===-1)&&(oe="M0 0, L0 0"),(isNaN(o.x)||isNaN(o.y)||isNaN(s.x)||isNaN(s.y))&&(oe="M0 0, L0 0"),p.endArrow&&D.endArrow===!1&&(t.style.endArrow={path:""}),p.startArrow&&D.startArrow===!1&&(t.style.startArrow={path:""});var ce=(0,m.mix)(n,a.attr(),{lineWidth:i,path:oe},t.style);a&&a.attr(ce)}},getPath:function(t,e,r,n,a,i){var o=a.offset,s=a.obstacles,l=a.simple;if(!o||t.length>2||i===!1){if(n)return wd(t,n);var h=[];return(0,m.each)(t,function(F,Z){Z===0?h.push(["M",F.x,F.y]):h.push(["L",F.x,F.y])}),h}l!==!1&&!(s==null?void 0:s.length)&&(l=!0);var p=l?Sd(t[t.length-1],t[0],r,e,o):Qh(t[0],t[t.length-1],e,r,a);if(!p||!p.length)return"M0 0, L0 0";if(n){var D=wd(p,n);return D}p=jh(p);var I=ki.pointsToPolygon(p);return I}},"single-edge");var Id=Vo.cloneEvent,Od=Vo.isNaN,Ad=Math.abs,Jh=10,qh=["shift","ctrl","alt","control"],ev={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,scalableRange:0,allowDragOnItem:!1}},getEvents:function(){return{mousedown:"onMouseDown",drag:"onDragMove",dragend:"onMouseUp","canvas:click":"onMouseUp",keyup:"onKeyUp",focus:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onMouseUp"}},updateViewport:function(t){var e=this.origin,r=+t.clientX,n=+t.clientY;if(!(Od(r)||Od(n))){var a=r-e.x,i=n-e.y;this.get("direction")==="x"?i=0:this.get("direction")==="y"&&(a=0),this.origin={x:r,y:n};var o=this.graph.get("width"),s=this.graph.get("height"),l=this.graph.get("canvas").getCanvasBBox(),h=this.scalableRange,p=this.scalableRange;h<1&&h>-1&&(h=o*h,p=s*p),(l.minX<=o+h&&l.minX+a>o+h||l.maxX+h>=0&&l.maxX+h+a<0)&&(a=0),(l.minY<=s+p&&l.minY+i>s+p||l.maxY+p>=0&&l.maxY+p+i<0)&&(i=0),this.graph.translate(a,i)}},onTouchStart:function(t){var e=this,r=t.originalEvent.touches,n=r[0],a=r[1];n&&a||(t.preventDefault(),this.mousedown=!0,e.onDragStart(t))},onMouseDown:function(t){this.mousedown=!0},onDragMove:function(t){!this.mousedown||(this.dragstart?this.onDrag(t):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=this,r=t.originalEvent;if(!(r&&t.name!=="touchstart"&&r.button!==0)&&!(t.name!=="touchstart"&&typeof window!="undefined"&&window.event&&!window.event.buttons&&!window.event.button)&&!!this.shouldBegin(t,this)&&!e.keydown&&!!this.allowDrag(t)){if(e.origin={x:t.clientX,y:t.clientY},e.dragging=!1,this.enableOptimize){for(var n=this.graph,a=n.getEdges(),i=0,o=a.length;i<o;i++){var s=a[i].get("group").get("children");!s||s.forEach(function(ce){ce.set("ori-visibility",ce.get("ori-visibility")||ce.get("visible")),ce.hide()})}for(var l=n.getNodes(),h=0,p=l.length;h<p;h++)for(var D=l[h].getContainer(),I=D.get("children"),F=0,Z=I;F<Z.length;F++){var ee=Z[F],se=ee.get("isKeyShape");se||(ee.set("ori-visibility",ee.get("ori-visibility")||ee.get("visible")),ee.hide())}}if(typeof window!="undefined"){var oe=this;this.handleDOMContextMenu=function(ce){return oe.onMouseUp(ce)},document.body.addEventListener("contextmenu",this.handleDOMContextMenu)}}},onTouchMove:function(t){var e=this,r=t.originalEvent.touches,n=r[0],a=r[1];if(n&&a){this.onMouseUp(t);return}t.preventDefault(),e.onDrag(t)},onDrag:function(t){if(!!this.mousedown){var e=this.graph;if(!this.keydown&&!!this.allowDrag(t)&&(t=Id(t),!!this.origin)){if(this.dragging)t.type="drag",e.emit("canvas:drag",t);else{if(Ad(this.origin.x-t.clientX)+Ad(this.origin.y-t.clientY)<Jh)return;this.shouldBegin(t,this)&&(t.type="dragstart",e.emit("canvas:dragstart",t),this.originPosition={x:t.clientX,y:t.clientY},this.dragging=!0)}this.shouldUpdate(t,this)&&this.updateViewport(t)}}},onMouseUp:function(t){var e,r;this.mousedown=!1,this.dragstart=!1;var n=this.graph;if(!this.keydown){var a=n.getZoom(),i=n.get("modeController"),o=(r=(e=i==null?void 0:i.modes[i.mode])===null||e===void 0?void 0:e.filter(function(Pe){return Pe.type==="zoom-canvas"}))===null||r===void 0?void 0:r[0],s=o?o.optimizeZoom||.1:0;if(this.enableOptimize){for(var l=n.getEdges(),h=0,p=l.length;h<p;h++){var D=l[h].get("group").get("children");!D||D.forEach(function(Pe){var He=Pe.get("ori-visibility");Pe.set("ori-visibility",void 0),He&&Pe.show()})}if(a>s)for(var I=n.getNodes(),F=0,Z=I.length;F<Z;F++)for(var ee=I[F].getContainer(),se=ee.get("children"),oe=0,ce=se;oe<ce.length;oe++){var we=ce[oe],Re=we.get("isKeyShape");if(!Re){var Oe=we.get("ori-visibility");we.set("ori-visibility",void 0),Oe&&we.show()}}}if(!this.dragging){this.origin=null;return}t=Id(t),this.shouldEnd(t,this)&&this.updateViewport(t),t.type="dragend",t.dx=t.clientX-this.originPosition.x,t.dy=t.clientY-this.originPosition.y,n.emit("canvas:dragend",t),this.endDrag(),typeof window!="undefined"&&document.body.removeEventListener("contextmenu",this.handleDOMContextMenu)}},endDrag:function(){this.origin=null,this.dragging=!1,this.dragbegin=!1,this.mousedown=!1,this.dragstart=!1},onKeyDown:function(t){var e=this,r=t.key;!r||(qh.indexOf(r.toLowerCase())>-1?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(t){var e,r,n=t.target,a=n&&n.isCanvas&&n.isCanvas();if((0,m.isBoolean)(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if((0,m.isObject)(this.allowDragOnItem)){var i=this.allowDragOnItem,o=i.node,s=i.edge,l=i.combo,h=(r=(e=t.item)===null||e===void 0?void 0:e.getType)===null||r===void 0?void 0:r.call(e);if(!o&&h==="node"||!s&&h==="edge"||!l&&h==="combo")return!1}return!0}},tv={getDefaultCfg:function(){return{updateEdge:!0,delegateStyle:{},enableDelegate:!1,onlyChangeComboSize:!1,comboActiveState:"",selectedState:"selected",enableOptimize:!1,enableDebounce:!1,enableStack:!0}},getEvents:function(){return{"node:mousedown":"onMouseDown",drag:"onDragMove",dragend:"onDragEnd","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave","combo:drop":"onDropCombo","node:drop":"onDropNode","canvas:drop":"onDropCanvas",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onDragEnd",afterchangedata:"onDragEnd"}},validationCombo:function(t){if(!this.origin||!t||t.destroyed)return!1;var e=t.getType();return e==="combo"},onTouchStart:function(t){if(!!t.item){var e=this;try{var r=t.originalEvent.touches,n=r[0],a=r[1];if(n&&a)return;t.preventDefault()}catch(i){console.warn("Touch original event not exist!")}this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},this.dragstart=!0,e.onDragStart(t)}},onTouchMove:function(t){var e=this;try{var r=t.originalEvent.touches,n=r[0],a=r[1];if(n&&a){e.onDragEnd(t);return}t.preventDefault()}catch(i){console.warn("Touch original event not exist!")}e.onDrag(t)},onMouseDown:function(t){this.mousedown={item:t.item,target:t.target,origin:{x:t.x,y:t.y}},typeof window!="undefined"&&!this.windowEventBinded&&(this.windowEventBinded=!0,document.body.addEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.addEventListener("mouseup",this.onDragEnd.bind(this)))},onDragMove:function(t){var e,r;if(((r=(e=t.item)===null||e===void 0?void 0:e.getType)===null||r===void 0?void 0:r.call(e))!=="node"){this.onDragEnd();return}!this.mousedown||(this.dragstart?this.onDrag((0,b.__assign)((0,b.__assign)({},t),this.mousedown)):(this.dragstart=!0,this.onDragStart(t)))},onDragStart:function(t){var e=this;if(this.currentShouldEnd=!0,!!this.shouldBegin((0,b.__assign)((0,b.__assign)({},t),this.mousedown),this)){var r=this.mousedown,n=r.item,a=r.target;if(!(!n||n.destroyed||n.hasLocked())){var i=n.getContainer();if(i.set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(n),a){var o=a.get("isAnchorPoint");if(o)return}var s=this.graph;this.targets=[],this.targetCombo=null;var l=s.findAllByState("node",this.selectedState),h=n.get("id"),p=l.filter(function(I){var F=I.get("id");return h===F});if(p.length===0?this.targets.push(n):l.length>1?l.forEach(function(I){var F=I.hasLocked();F||e.targets.push(I)}):this.targets.push(n),this.graph.get("enabledStack")&&this.enableStack){var D=[];this.targets.forEach(function(I){var F=I.getModel(),Z=F.x,ee=F.y,se=F.id;D.push({x:Z,y:ee,id:se})}),this.set("beforeDragNodes",D)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(I){var F=I.getEdges();F.forEach(function(Z){!Z.isVisible()||(e.hidenEdge[Z.getID()]=!0,Z.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(t){var e=this;if(!(!this.mousedown||!this.origin)&&!!this.shouldUpdate(t,this))if(this.get("enableDelegate"))this.updateDelegate(t);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var r={};this.targets.map(function(n){e.update(n,t);var a=n.getModel().comboId;a&&(r[a]=e.graph.findById(a))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(t){var e=this,r;if(this.mousedown=!1,this.dragstart=!1,typeof window!="undefined"&&this.windowEventBinded&&(this.windowEventBinded=!1,document.body.removeEventListener("contextmenu",this.onDragEnd.bind(this)),document.body.removeEventListener("mouseup",this.onDragEnd.bind(this))),!!this.origin){(r=this.cachedCaptureItems)===null||r===void 0||r.forEach(function(i){var o=i.getContainer();o.set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(i){var o=i.getEdges();o.forEach(function(s){e.hidenEdge[s.getID()]&&s.show(),s.refresh()})}),this.hidenEdge={};var n=this.graph;if(n.get("enabledStack")&&this.enableStack){var a={before:{nodes:[],edges:[],combos:[]},after:{nodes:[],edges:[],combos:[]}};this.get("beforeDragNodes").forEach(function(i){a.before.nodes.push(i)}),this.targets.forEach(function(i){var o=i.getModel(),s=o.x,l=o.y,h=o.id;a.after.nodes.push({x:s,y:l,id:h})}),n.pushStack("update",(0,m.clone)(a))}n.emit("dragnodeend",{items:this.targets,targetItem:null}),this.point={},this.origin=null,this.originPoint={},this.targets.length=0,this.targetCombo=null}},onDropCombo:function(t){var e=t.item;if(this.currentShouldEnd=this.shouldEnd(t,e,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.currentShouldEnd||!this.validationCombo(e))){var r=this.graph;if(this.comboActiveState&&r.setItemState(e,this.comboActiveState,!1),this.targetCombo=e,this.onlyChangeComboSize)r.updateCombos();else{var n=e.getModel();this.targets.map(function(a){var i=a.getModel();i.comboId!==n.id&&r.updateComboTree(a,n.id)}),r.updateCombo(e)}r.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(t){var e=this.graph;this.currentShouldEnd=this.shouldEnd(t,void 0,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.targets||this.targets.length===0||!this.currentShouldEnd)&&(this.onlyChangeComboSize?this.updateParentCombos():this.targets.map(function(r){var n=r.getModel();n.comboId&&e.updateComboTree(r)}))},onDropNode:function(t){if(!(!this.targets||this.targets.length===0)){var e=this,r=t.item,n=e.graph,a=r.getModel().comboId,i=a?n.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),!!this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(a){var o=n.findById(a);e.comboActiveState&&n.setItemState(o,e.comboActiveState,!1),this.targets.map(function(s){var l=s.getModel();a!==l.comboId&&n.updateComboTree(s,a)}),n.updateCombo(o)}else this.targets.map(function(s){var l=s.getModel();l.comboId&&n.updateComboTree(s)});n.emit("dragnodeend",{items:this.targets,targetItem:r})}}},onDragEnter:function(t){var e=t.item;if(!!this.validationCombo(e)){var r=this.graph;this.comboActiveState&&r.setItemState(e,this.comboActiveState,!0)}},onDragLeave:function(t){var e=t.item;if(!!this.validationCombo(e)){var r=this.graph;this.comboActiveState&&r.setItemState(e,this.comboActiveState,!1)}},updatePositions:function(t,e){var r=this;!this.targets||this.targets.length===0||(this.get("enableDelegate")?this.enableDebounce?this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:t,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):e||this.targets.map(function(n){return r.update(n,t)}):this.targets.map(function(n){return r.update(n,t,e)}))},update:function(t,e,r){var n=this.origin,a=t.get("model"),i=t.get("id");this.point[i]||(this.point[i]={x:a.x||0,y:a.y||0});var o=e.x-n.x+this.point[i].x,s=e.y-n.y+this.point[i].y;r&&(o+=n.x-e.x,s+=n.y-e.y);var l={x:o,y:s};this.get("updateEdge")?this.graph.updateItem(t,l,!1):t.updatePosition(l)},debounceUpdate:(0,m.debounce)(function(c){var t=c.targets,e=c.graph,r=c.point,n=c.origin,a=c.evt,i=c.updateEdge,o=c.onlyChangeComboSize,s=c.updateParentCombos;t.map(function(l){var h=l.get("model"),p=l.get("id");r[p]||(r[p]={x:h.x||0,y:h.y||0});var D=a.x-n.x+r[p].x,I=a.y-n.y+r[p].y,F={x:D,y:I};i?e.updateItem(l,F,!1):l.updatePosition(F)}),o&&s(e,t)},50,!0),updateDelegate:function(t){var e=this.graph;if(this.delegateRect){var D=t.x-this.origin.x+this.originPoint.minX,I=t.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:D,y:I})}else{var r=e.get("group"),n=(0,m.deepMix)({},wo.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(t),i=a.x,o=a.y,s=a.width,l=a.height,h=a.minX,p=a.minY;this.originPoint={x:i,y:o,width:s,height:l,minX:h,minY:p},this.delegateRect=r.addShape("rect",{attrs:(0,b.__assign)({width:s,height:l,x:i,y:o},n),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(t){var e=this.targets;e.length===0&&e.push(t.item);for(var r=Infinity,n=-Infinity,a=Infinity,i=-Infinity,o=0;o<e.length;o++){var s=e[o],l=s.getBBox(),h=l.minX,p=l.minY,D=l.maxX,I=l.maxY;h<r&&(r=h),p<a&&(a=p),D>n&&(n=D),I>i&&(i=I)}var F=Math.floor(r),Z=Math.floor(a),ee=Math.ceil(n)-Math.floor(r),se=Math.ceil(i)-Math.floor(a);return{x:F,y:Z,width:ee,height:se,minX:r,minY:a}},updateParentCombos:function(t,e){var r=t||this.graph,n=e||this.targets,a={};n==null||n.forEach(function(i){var o=i.getModel().comboId;o&&(a[o]=r.findById(o))}),Object.values(a).forEach(function(i){i&&r.updateCombo(i)})}},rv={getDefaultCfg:function(){return{trigger:"mouseenter",activeState:"active",inactiveState:"inactive",resetSelected:!1,shouldUpdate:function(){return!0}}},getEvents:function(){return this.get("trigger")==="mouseenter"?{"node:mouseenter":"setAllItemStates","combo:mouseenter":"setAllItemStates","node:mouseleave":"clearActiveState","combo:mouseleave":"clearActiveState"}:{"node:click":"setAllItemStates","combo:click":"setAllItemStates","canvas:click":"clearActiveState","node:touchstart":"setOnTouchStart","combo:touchstart":"setOnTouchStart","canvas:touchstart":"clearOnTouchStart"}},setOnTouchStart:function(t){var e=this;try{var r=t.originalEvent.touches,n=r[0],a=r[1];if(n&&a)return;t.preventDefault()}catch(i){console.warn("Touch original event not exist!")}e.setAllItemStates(t)},clearOnTouchStart:function(t){var e=this;try{var r=t.originalEvent.touches,n=r[0],a=r[1];if(n&&a)return;t.preventDefault()}catch(i){console.warn("Touch original event not exist!")}e.clearActiveState(t)},setAllItemStates:function(t){clearTimeout(this.timer),this.throttleSetAllItemStates(t,this)},clearActiveState:function(t){var e=this;this.timer=setTimeout(function(){e.throttleClearActiveState(t,e)},50)},throttleSetAllItemStates:(0,m.throttle)(function(c,t){var e=c.item,r=t.graph;if(!(!r||r.destroyed)&&(t.item=e,!!t.shouldUpdate(c.item,{event:c,action:"activate"},t))){for(var n=t.activeState,a=t.inactiveState,i=r.getNodes(),o=r.getCombos(),s=r.getEdges(),l=r.get("vedges"),h=i.length,p=o.length,D=s.length,I=l.length,F=t.inactiveItems||{},Z=t.activeItems||{},ee=0;ee<h;ee++){var se=i[ee],oe=se.getID(),ce=se.hasState("selected");t.resetSelected&&ce&&r.setItemState(se,"selected",!1),Z[oe]&&(r.setItemState(se,n,!1),delete Z[oe]),a&&!F[oe]&&(r.setItemState(se,a,!0),F[oe]=se)}for(var ee=0;ee<p;ee++){var we=o[ee],Re=we.getID(),ce=we.hasState("selected");t.resetSelected&&ce&&r.setItemState(we,"selected",!1),Z[Re]&&(r.setItemState(we,n,!1),delete Z[Re]),a&&!F[Re]&&(r.setItemState(we,a,!0),F[Re]=we)}for(var ee=0;ee<D;ee++){var Oe=s[ee],Pe=Oe.getID();Z[Pe]&&(r.setItemState(Oe,n,!1),delete Z[Pe]),a&&!F[Pe]&&(r.setItemState(Oe,a,!0),F[Pe]=Oe)}for(var ee=0;ee<I;ee++){var He=l[ee],at=He.getID();Z[at]&&(r.setItemState(He,n,!1),delete Z[at]),a&&!F[at]&&(r.setItemState(He,a,!0),F[at]=He)}if(e&&!e.destroyed){a&&(r.setItemState(e,a,!1),delete F[e.getID()]),Z[e.getID()]||(r.setItemState(e,n,!0),Z[e.getID()]=e);for(var qe=e.getEdges(),yt=qe.length,ee=0;ee<yt;ee++){var Oe=qe[ee],Pe=Oe.getID(),Ft=void 0;Oe.getSource()===e?Ft=Oe.getTarget():Ft=Oe.getSource();var yr=Ft.getID();a&&F[yr]&&(r.setItemState(Ft,a,!1),delete F[yr]),Z[yr]||(r.setItemState(Ft,n,!0),Z[yr]=Ft),F[Pe]&&(r.setItemState(Oe,a,!1),delete F[Pe]),Z[Pe]||(r.setItemState(Oe,n,!0),Z[Pe]=Oe),Oe.toFront()}}t.activeItems=Z,t.inactiveItems=F,r.emit("afteractivaterelations",{item:c.item,action:"activate"})}},50,{trailing:!0,leading:!0}),throttleClearActiveState:(0,m.throttle)(function(c,t){var e=t.get("graph");if(!(!e||e.destroyed)&&!!t.shouldUpdate(c.item,{event:c,action:"deactivate"},t)){var r=t.activeState,n=t.inactiveState,a=t.activeItems||{},i=t.inactiveItems||{};Object.values(a).filter(function(o){return!o.destroyed}).forEach(function(o){e.clearItemStates(o,r)}),Object.values(i).filter(function(o){return!o.destroyed}).forEach(function(o){e.clearItemStates(o,n)}),t.activeItems={},t.inactiveItems={},e.emit("afteractivaterelations",{item:c.item||t.get("item"),action:"deactivate"})}},50,{trailing:!0,leading:!0})},zl=Math.min,Ld=Math.max,Dd=Math.abs,Nd="shift",nv=["drag","shift","ctrl","alt","control"],av={getDefaultCfg:function(){return{brushStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},selectedState:"selected",trigger:Nd,includeEdges:!0,includeCombos:!1,selectedEdges:[],selectedNodes:[],selectedCombos:[]}},getEvents:function(){return nv.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=Nd,console.warn("Behavior brush-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates"}:{dragstart:"onMouseDown",drag:"onMouseMove",dragend:"onMouseUp","canvas:click":"clearStates",keyup:"onKeyUp",keydown:"onKeyDown"}},onMouseDown:function(t){var e=t.item,r=this.brush;e||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),r||(r=this.createBrush()),this.originPoint={x:t.canvasX,y:t.canvasY},r.attr({width:0,height:0}),r.show(),this.dragging=!0)},onMouseMove:function(t){!this.dragging||this.trigger!=="drag"&&!this.keydown||this.updateBrush(t)},onMouseUp:function(t){var e=this.graph;!this.brush&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(t),this.dragging=!1)},clearStates:function(){var t=this,e=t.graph,r=t.selectedState,n=e.findAllByState("node",r),a=e.findAllByState("edge",r),i=e.findAllByState("combo",r);n.forEach(function(o){return e.setItemState(o,r,!1)}),a.forEach(function(o){return e.setItemState(o,r,!1)}),i.forEach(function(o){return e.setItemState(o,r,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),e.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(t,e,r,n,a){var i=t.getBBox();return i.centerX>=e&&i.centerX<=r&&i.centerY>=n&&i.centerY<=a},getSelectedNodes:function(t){var e=this,r=this,n=r.graph,a=r.originPoint,i=r.shouldUpdate,o=r.isBBoxCenterInRect,s=this.selectedState,l={x:t.x,y:t.y},h=n.getPointByCanvas(a.x,a.y),p=zl(l.x,h.x),D=Ld(l.x,h.x),I=zl(l.y,h.y),F=Ld(l.y,h.y),Z=[],ee=[];n.getNodes().forEach(function(ce){if(ce.isVisible()&&o(ce,p,D,I,F)&&i(ce,"select",e)){Z.push(ce);var we=ce.getModel();ee.push(we.id),n.setItemState(ce,s,!0)}});var se=[];this.includeEdges&&Z.forEach(function(ce){var we=ce.getOutEdges();we.forEach(function(Re){if(!!Re.isVisible()){var Oe=Re.getModel(),Pe=Oe.source,He=Oe.target;ee.includes(Pe)&&ee.includes(He)&&i(Re,"select",e)&&(se.push(Re),n.setItemState(Re,e.selectedState,!0))}})});var oe=[];this.includeCombos&&n.getCombos().forEach(function(ce){if(ce.isVisible()&&o(ce,p,D,I,F)&&i(ce,"select",e)){oe.push(ce);var we=ce.getModel();ee.push(we.id),n.setItemState(ce,s,!0)}}),this.selectedEdges=se,this.selectedNodes=Z,this.selectedCombos=oe,this.onSelect&&this.onSelect(Z,se,oe),n.emit("nodeselectchange",{selectedItems:{nodes:Z,edges:se,combos:oe},select:!0})},createBrush:function(){var t=this,e=t.graph.get("canvas").addShape("rect",{attrs:t.brushStyle,capture:!1,name:"brush-shape"});return this.brush=e,this.delegate=e,e},updateBrush:function(t){var e=this.originPoint;this.brush.attr({width:Dd(t.canvasX-e.x),height:Dd(t.canvasY-e.y),x:zl(t.canvasX,e.x),y:zl(t.canvasY,e.y)})},onKeyDown:function(t){var e=t.key;if(!!e){var r=this.trigger.toLowerCase(),n=e.toLowerCase();n===r||n==="control"&&r==="ctrl"||n==="ctrl"&&r==="control"?this.keydown=!0:this.keydown=!1}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.keydown=!1}},Pd="shift",iv=["shift","ctrl","alt","control"],ov={getDefaultCfg:function(){return{multiple:!0,trigger:Pd,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var t=this;return iv.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=Pd,console.warn("Behavior click-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),t.multiple?{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick",keyup:"onKeyUp",keydown:"onKeyDown"}:{"node:click":"onClick","combo:click":"onClick","edge:click":"onClick","canvas:click":"onCanvasClick"}},onClick:function(t){var e=this,r=t.item;if(!(!r||r.destroyed)){var n=r.getType(),a=e.graph,i=e.keydown,o=e.multiple,s=e.shouldUpdate,l=e.shouldBegin;if(!!l(t,e)){if(!i||!o){var h=a.findAllByState("node",e.selectedState).concat(a.findAllByState("edge",e.selectedState)).concat(a.findAllByState("combo",e.selectedState));(0,m.each)(h,function(Z){Z!==r&&a.setItemState(Z,e.selectedState,!1)})}var p=function(){switch(n){case"node":return e.selectNode;case"edge":return e.selectEdge;case"combo":return e.selectCombo;default:return!1}}();if(!p){var D=a.findAllByState("node",e.selectedState),I=a.findAllByState("edge",e.selectedState),F=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{selectedItems:{nodes:D,edges:I,combos:F},select:!1});return}if(r.hasState(e.selectedState)){s(t,e)&&a.setItemState(r,e.selectedState,!1);var D=a.findAllByState("node",e.selectedState),I=a.findAllByState("edge",e.selectedState),F=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{target:r,selectedItems:{nodes:D,edges:I,combos:F},select:!1})}else{s(t,e)&&a.setItemState(r,e.selectedState,!0);var D=a.findAllByState("node",e.selectedState),I=a.findAllByState("edge",e.selectedState),F=a.findAllByState("combo",e.selectedState);a.emit("nodeselectchange",{target:r,selectedItems:{nodes:D,edges:I,combos:F},select:!0})}}}},onCanvasClick:function(t){var e=this,r=this,n=r.graph,a=r.shouldBegin;if(!!a(t,this)){var i=n.findAllByState("node",this.selectedState);(0,m.each)(i,function(l){n.setItemState(l,e.selectedState,!1)});var o=n.findAllByState("edge",this.selectedState);(0,m.each)(o,function(l){n.setItemState(l,e.selectedState,!1)});var s=n.findAllByState("combo",this.selectedState);(0,m.each)(s,function(l){n.setItemState(l,e.selectedState,!1)}),n.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(t){var e=this,r=t.key;!r||(r.toLowerCase()===this.trigger.toLowerCase()||r.toLowerCase()==="control"?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){var t=this;t.keydown=!1}},sv=q.vs,kd=.05,uv={getDefaultCfg:function(){return{sensitivity:2,minZoom:void 0,maxZoom:void 0,enableOptimize:!1,optimizeZoom:.1,fixSelectedItems:{fixAll:!1,fixLineWidth:!1,fixLabel:!1,fixState:"selected"},animate:!1,animateCfg:{duration:500}}},getEvents:function(){var t=this.fixSelectedItems;return t.fixState||(t.fixState="selected"),t.fixAll&&(t.fixLineWidth=!0,t.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(t){var e=t.originalEvent.touches,r=e[0],n=e[1];t.preventDefault(),!!n&&(this.shouldBegin&&!this.shouldBegin(t,this)||(this.startPoint={pageX:r.pageX,pageY:r.pageY},this.moveable=!0,n&&(this.endPoint={pageX:n.pageX,pageY:n.pageY}),this.originScale=this.graph.getZoom()||this.currentScale||1))},onTouchMove:function(t){if(!!this.moveable){t.preventDefault();var e=t.originalEvent.touches,r=e[0],n=e[1];if(!!n){this.endPoint||(this.endPoint={pageX:n.pageX,pageY:n.pageY});var a=function(Z,ee){return Math.hypot(ee.x-Z.x,ee.y-Z.y)},i=a({x:r.pageX,y:r.pageY},{x:n.pageX,y:n.pageY})/a({x:this.startPoint.pageX,y:this.startPoint.pageY},{x:this.endPoint.pageX,y:this.endPoint.pageY}),o=this.originScale*i;this.currentScale=o;var s=this.get("minZoom")||this.graph.get("minZoom"),l=this.get("maxZoom")||this.graph.get("maxZoom");if(!(o>l||o<s)){var h=this.get("animate"),p=this.get("animateCfg"),D=this.graph.get("canvas"),I=D.getPointByClient(t.clientX,t.clientY);this.graph.zoomTo(o,{x:I.x,y:I.y},h,p),this.graph.emit("wheelzoom",t)}}}},onTouchEnd:function(){this.moveable=!1,this.endPoint=null},onWheel:function(t){var e=this,r=this,n=r.graph,a=r.fixSelectedItems;if(!(this.shouldBegin&&!this.shouldBegin(t,this))&&!!this.shouldUpdate(t,this)){t.preventDefault();var i=n.get("canvas"),o=i.getPointByClient(t.clientX,t.clientY),s=this.get("sensitivity"),l=n.getZoom(),h=l,p=l;t.wheelDelta<0?h=1-kd*s:h=1/(1-kd*s),p=l*h;var D=this.get("minZoom")||n.get("minZoom"),I=this.get("maxZoom")||n.get("maxZoom");p>I?p=I:p<D&&(p=D);var F=this.get("enableOptimize");if(F){var Z=this.get("optimizeZoom"),ee=this.get("optimized"),se=n.getNodes(),oe=n.getEdges(),ce=se.length,we=oe.length;if(!ee){for(var Re=0;Re<ce;Re++){var Oe=se[Re];if(!Oe.destroyed)for(var Pe=Oe.get("group").get("children"),He=Pe.length,at=0;at<He;at++){var qe=Pe[at];!qe.destoryed&&!qe.get("isKeyShape")&&(qe.set("ori-visibility",qe.get("ori-visibility")||qe.get("visible")),qe.hide())}}for(var yt=0;yt<we;yt++)for(var Ft=oe[yt],Pe=Ft.get("group").get("children"),He=Pe.length,at=0;at<He;at++){var qe=Pe[at];qe.set("ori-visibility",qe.get("ori-visibility")||qe.get("visible")),qe.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var yr=setTimeout(function(){var la=n.getZoom(),Ca=e.get("optimized");if(Ca){e.set("optimized",!1);for(var Xn=0;Xn<ce;Xn++){var Ta=se[Xn],Na=Ta.get("group").get("children"),cn=Na.length;if(la<Z){var pa=Ta.getKeyShape(),ma=pa.get("ori-visibility");pa.set("ori-visibility",void 0),ma&&pa.show()}else for(var Ua=0;Ua<cn;Ua++){var xa=Na[Ua],ma=xa.get("ori-visibility");xa.set("ori-visibility",void 0),!xa.get("visible")&&ma&&ma&&xa.show()}}for(var Nn=0;Nn<we;Nn++){var Xa=oe[Nn],Na=Xa.get("group").get("children"),cn=Na.length;if(la<Z){var pa=Xa.getKeyShape(),ma=pa.get("ori-visibility");pa.set("ori-visibility",void 0),ma&&pa.show()}else for(var Ua=0;Ua<cn;Ua++){var xa=Na[Ua];if(!xa.get("visible")){var ma=xa.get("ori-visibility");xa.set("ori-visibility",void 0),ma&&xa.show()}}}}},100);this.set("timeout",yr)}if(l<=1){var fr=void 0,lr=void 0;if(a.fixAll||a.fixLineWidth||a.fixLabel){fr=n.findAllByState("node",a.fixState),lr=n.findAllByState("edge",a.fixState);for(var Kt=l/p,jr=fr.length,Xr=0;Xr<jr;Xr++){var Oe=fr[Xr],er=Oe.getContainer(),mr=Oe.getModel(),kr=Oe.getOriginStyle(),Fr=Oe.getStateStyle(a.fixState),Jr=Oe.get("shapeFactory").getShape(mr.type).getStateStyle(a.fixState,Oe)[a.fixState];if(a.fixAll){if(p<=1){var fn=(0,m.clone)(er.getMatrix());fn||(fn=[1,0,0,0,1,0,0,0,1]);var Vn=Oe.getModel(),Tn=Vn.x,wa=Vn.y;fn=sv(fn,[["t",-Tn,-wa],["s",Kt,Kt],["t",Tn,wa]]),er.setMatrix(fn)}}else for(var Pe=er.get("children"),He=Pe.length,at=0;at<He;at++){var qe=Pe[at],ua=void 0,fa=void 0;if(a.fixLabel){var Ma=qe.get("type");if(Ma==="text"){ua=qe.attr("fontSize")||12;var ja=Fr[qe.get("name")],Ra=Jr[qe.get("name")],uo=ja?ja.fontSize:12,Da=Ra?Ra.fontSize:12,fo=uo||Da||12;if(p<=1&&qe.attr("fontSize",fo/p),fa)break}}if(a.fixLineWidth&&qe.get("isKeyShape")){fa=qe.attr("lineWidth")||0;var Qa=Fr.lineWidth||Jr.lineWidth||kr.lineWidth||0;if(p<=1&&qe.attr("lineWidth",Qa/p),ua)break}}}for(var Ja=lr.length,oi=0;oi<Ja;oi++)for(var Ft=lr[oi],er=Ft.getContainer(),Pe=er.get("children"),mr=Ft.getModel(),Fr=Ft.getStateStyle(a.fixState),Jr=Ft.get("shapeFactory").getShape(mr.type).getStateStyle(a.fixState,Ft)[a.fixState],He=Pe.length,at=0;at<He;at++){var qe=Pe[at],ua=void 0,fa=void 0;if(a.fixLabel||a.fixAll){var Ma=qe.get("type");if(Ma==="text"){ua=qe.attr("fontSize")||12;var ja=Fr[qe.get("name")],Ra=Jr[qe.get("name")],uo=ja?ja.fontSize:12,Da=Ra?Ra.fontSize:12,fo=uo||Da||12;if(p<=1&&qe.attr("fontSize",fo/p),fa)break}}if((a.fixLineWidth||a.fixAll)&&qe.get("isKeyShape")){fa=qe.attr("lineWidth")||0;var Qa=Fr.lineWidth||Jr.lineWidth||1;if(p<=1&&qe.attr("lineWidth",Qa/p),ua)break}}}}var Si=this.get("animate"),Ai=this.get("animateCfg");n.zoomTo(p,{x:o.x,y:o.y},Si,Ai),n.emit("wheelzoom",t)}}},Rd={onMouseEnter:function(t){var e=t.item;this.currentTarget=e,this.showTooltip(t),this.graph.emit("tooltipchange",{item:t.item,action:"show"})},onMouseMove:function(t){if(!this.shouldUpdate(t,this)){this.hideTooltip();return}!this.currentTarget||t.item!==this.currentTarget||this.updatePosition(t)},onMouseLeave:function(t){!this.shouldEnd(t,this)||(this.hideTooltip(),this.graph.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null)},showTooltip:function(t){var e=this.container;if(!(!t.item||t.item.destroyed)){e||(e=this.createTooltip(this.graph.get("canvas")),this.container=e);var r=this.formatText(t.item.get("model"),t);e.innerHTML=r,(0,Kn.Z)(this.container,{visibility:"visible"}),this.updatePosition(t)}},hideTooltip:function(){(0,Kn.Z)(this.container,{visibility:"hidden"})},updatePosition:function(t){var e=this.get("shouldBegin"),r=this,n=r.width,a=r.height,i=r.container,o=r.graph;if(!e(t,this)){(0,Kn.Z)(i,{visibility:"hidden"});return}var s=o.getPointByClient(t.clientX,t.clientY),l=o.getCanvasByPoint(s.x,s.y),h=l.x,p=l.y,D=i.getBoundingClientRect();h>n/2?h-=D.width:h+=this.offset,p>a/2?p-=D.height:p+=this.offset;var I="".concat(h,"px"),F="".concat(p,"px");(0,Kn.Z)(this.container,{left:I,top:F,visibility:"visible"})},createTooltip:function(t){var e=t.get("el");e.style.position="relative";var r=(0,Aa.Z)('<div class="g6-tooltip g6-'.concat(this.item,'-tooltip"></div>'));return e.parentNode.appendChild(r),(0,Kn.Z)(r,{position:"absolute",visibility:"visible"}),this.width=t.get("width"),this.height=t.get("height"),this.container=r,this.graph.get("tooltips").push(r),r}},fv=(0,b.__assign)({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(e){return e.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Rd),cv=(0,b.__assign)({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(e){return"source: ".concat(e.source," target: ").concat(e.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},Rd),Bd="click",lv=["click","dblclick"],dv={getDefaultCfg:function(){return{trigger:Bd,onChange:function(){}}},getEvents:function(){var t,e;return lv.includes(this.trigger)?e=this.trigger:(e=Bd,console.warn("Behavior collapse-expand \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),t={},t["node:".concat(e)]="onNodeClick",t.touchstart="onNodeClick",t},onNodeClick:function(t){var e=this;if(this.trigger==="click"){if(this.timer){clearTimeout(this.timer),this.timer=0;return}this.timer=setTimeout(function(){e.toggle(t),clearTimeout(e.timer),e.timer=0},200)}else this.toggle(t)},toggle:function(t){var e=t.item;if(!!e){var r=this.graph.findDataById(e.get("id"));if(!!r){var n=r.children;if(!(!n||n.length===0)){var a=!r.collapsed;!this.shouldBegin(t,a,this)||(r.collapsed=a,e.getModel().collapsed=a,this.graph.emit("itemcollapsed",{item:t.item,collapsed:a}),!!this.shouldUpdate(t,a,this)&&(this.onChange(e,a,this),this.graph.layout()))}}}}},hv=Vo.calculationItemsBBox,vv=function c(t,e){if(e(t)!==!1&&t){var r=t.get("combos");if(r.length===0)return!1;(0,m.each)(r,function(n){c(n,e)})}},gv={getDefaultCfg:function(){return{enableDelegate:!1,delegateStyle:{},onlyChangeComboSize:!1,activeState:"",selectedState:"selected",enableStack:!0}},getEvents:function(){return{"combo:mousedown":"onMouseDown","combo:dragstart":"onDragStart","combo:drag":"onDrag","combo:dragend":"onDragEnd","combo:drop":"onDrop","node:drop":"onNodeDrop","combo:dragenter":"onDragEnter","combo:dragleave":"onDragLeave"}},validationCombo:function(t){var e=t.item;if(!e||e.destroyed||!this.shouldUpdate(t,this))return!1;var r=e.getType();return r==="combo"},onMouseDown:function(t){this.origin={x:t.x,y:t.y}},onDragStart:function(t){var e=this,r=this.graph,n=t.item;if(this.currentShouldEnd=!0,!!this.validationCombo(t)){this.targets=[];var a=r.findAllByState("combo",this.selectedState),i=n.get("id"),o=a.filter(function(l){var h=l.get("id");return i===h});o.length===0?this.targets.push(n):this.targets=a;var s=[];this.targets.forEach(function(l){var h=l.getModel(),p=h.x,D=h.y,I=h.id;s.push({x:p,y:D,id:I})}),this.set("beforeDragItems",s),this.activeState&&this.targets.map(function(l){var h=l.getModel();if(h.parentId){var p=r.findById(h.parentId);p&&r.setItemState(p,e.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],vv(n,function(l){if(l.destroyed)return!1;var h=l.getModel();return e.currentItemChildCombos.push(h.id),!0})}},onDrag:function(t){var e=this;if(!!this.origin&&!!this.validationCombo(t))if(this.enableDelegate)this.updateDelegate(t);else{if(this.activeState){var r=this.graph,n=t.item,a=n.getModel(),i=r.getCombos(),o=n.getBBox(),s=o.centerX,l=o.centerY,h=o.width,p=i.filter(function(D){var I=D.getModel();return a.parentId,I.id!==a.id&&!e.currentItemChildCombos.includes(I.id)});p.map(function(D){var I=D.getBBox(),F=I.centerX,Z=I.centerY,ee=I.width,se=s-F,oe=l-Z,ce=2*Math.sqrt(se*se+oe*oe);h+ee-ce>.8*h?r.setItemState(D,e.activeState,!0):r.setItemState(D,e.activeState,!1)})}(0,m.each)(this.targets,function(D){e.updateCombo(D,t)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(t,e){var r=this;(this.enableDelegate||e)&&(0,m.each)(this.targets,function(n){r.updateCombo(n,t,e)})},onDrop:function(t){var e=this,r=t.item;if(this.currentShouldEnd=this.shouldEnd(t,r,this),this.updatePositions(t,!this.currentShouldEnd),!(!this.currentShouldEnd||!r||!this.targets||r.destroyed)){var n=this.graph,a=r.getModel();this.targets.map(function(i){var o=i.getModel();o.parentId!==a.id?(e.activeState&&n.setItemState(r,e.activeState,!1),e.onlyChangeComboSize?n.updateCombo(i):n.updateComboTree(i,a.id,!1)):n.updateCombo(r)}),this.end(r,t),this.endComparison=!0}},onNodeDrop:function(t){var e=this;if(!(!this.targets||this.targets.length===0)){var r=this.graph,n=t.item,a=n.getModel().comboId,i=a?r.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(t,i,this),this.updatePositions(t,!this.currentShouldEnd),!!this.currentShouldEnd){var o;if(a){if(this.activeState){var s=r.findById(a);r.setItemState(s,this.activeState,!1)}this.targets.map(function(l){e.onlyChangeComboSize?r.updateCombo(l):a!==l.getID()&&(o=r.findById(a),a!==l.getModel().parentId&&r.updateComboTree(l,a,!1))})}else this.targets.map(function(l){if(e.onlyChangeComboSize)r.updateCombo(l);else{var h=l.getModel();h.comboId&&r.updateComboTree(l,void 0,!1)}});this.endComparison=!0,this.end(o,t)}}},onDragEnter:function(t){if(!!this.origin&&!!this.validationCombo(t)){var e=t.item,r=this.graph;this.activeState&&r.setItemState(e,this.activeState,!0)}},onDragLeave:function(t){if(!!this.origin&&!!this.validationCombo(t)){var e=t.item,r=this.graph;this.activeState&&r.setItemState(e,this.activeState,!1)}},onDragEnd:function(t){if(!(!this.targets||this.targets.length===0)){var e=t.item;this.currentShouldEnd&&this.updatePositions(t);var r=this.getParentCombo(e.getModel().parentId),n=this.graph;r&&this.activeState&&n.setItemState(r,this.activeState,!1),this.end(void 0,t)}},end:function(t,e){var r=this;if(!!this.origin){var n=this.graph;if(this.delegateShape){var a=n.get("delegateGroup");a.clear(),this.delegateShape=null}if(t&&this.activeState&&n.setItemState(t,this.activeState,!1),!t){var i=n.get("enabledStack")&&this.enableStack,o={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(s){if(!r.onlyChangeComboSize)n.updateComboTree(s,void 0,i);else{n.updateCombo(s);var l=s.getModel(),h=l.x,p=l.y,D=l.id;o.after.combos.push({x:h,y:p,id:D}),n.pushStack("update",o)}})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(t,e,r){var n=this;if(r===void 0&&(r={}),e(t,r)!==!1&&t){var a=t.get("combos");(0,m.each)(a,function(o){n.traverse(o,e,r)});var i=t.get("nodes");(0,m.each)(i,function(o){n.traverse(o,e,r)})}},updateCombo:function(t,e,r){this.updateSingleItem(t,e,r);var n={};this.traverse(t,function(a,i){return a.destroyed?!1:(a.getEdges().forEach(function(o){return i[o.getID()]=o}),!0)},n),Object.values(n).forEach(function(a){return a.refresh()})},updateSingleItem:function(t,e,r){var n=this.origin,a=this.graph,i=t.getModel(),o=t.get("id");this.point[o]||(this.point[o]={x:i.x,y:i.y});var s=e.x-n.x+this.point[o].x,l=e.y-n.y+this.point[o].y;r&&(s+=n.x-e.x,l+=n.y-e.y),a.updateItem(t,{x:s,y:l},!1)},getParentCombo:function(t){var e=this.graph;if(!!t){var r=e.findById(t);if(!!r)return r}},updateDelegate:function(t){var e=this.graph;if(this.delegateShape){var D=t.x-this.origin.x+this.originPoint.minX,I=t.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:D,y:I})}else{var r=e.get("delegateGroup"),n=null;this.targets.length>1?n=hv(this.targets):n=this.targets[0].getBBox();var a=n.x,i=n.y,o=n.width,s=n.height,l=n.minX,h=n.minY;this.originPoint={x:a,y:i,width:o,height:s,minX:l,minY:h};var p=(0,b.__assign)((0,b.__assign)({},wo.delegateStyle),this.delegateStyle);this.delegateShape=r.addShape("rect",{attrs:(0,b.__assign)({width:n.width,height:n.height,x:n.x,y:n.y},p),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var t=this,e=t.graph,r=t.targets,n={};r==null||r.forEach(function(a){var i=a.getModel().parentId;i&&(n[i]=e.findById(i))}),Object.values(n).forEach(function(a){a&&e.updateCombo(a)})}},Fd="dblclick",pv=["click","dblclick"],yv={getDefaultCfg:function(){return{trigger:Fd,relayout:!0}},getEvents:function(){var t,e;return pv.includes(this.trigger)?e=this.trigger:(e=Fd,console.warn("Behavior collapse-expand-group \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),t={},t["combo:".concat(e)]="onComboClick",t},onComboClick:function(t){var e=t.item,r=this,n=r.graph,a=r.relayout;if(!(!e||e.destroyed||e.getType()!=="combo")){var i=e.getModel(),o=i.id;!o||(n.collapseExpandCombo(o),a&&n.get("layout")?n.layout():n.refreshPositions())}}},mv=Vo.isPolygonsIntersect,Ev=Vo.pathToPoints,Gd="shift",bv=["drag","shift","ctrl","alt","control"],xv=function(t,e){var r,n=t.getKeyShape();if(t.get("type")==="path")r=Ev(n.attr("path"));else{var a=n.getCanvasBBox();r=[[a.minX,a.minY],[a.maxX,a.minY],[a.maxX,a.maxY],[a.minX,a.maxY]]}return mv(e,r)},wv={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:Gd,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return bv.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=Gd,console.warn("Behavior lasso-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),this.trigger==="drag"?{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd","canvas:click":"clearStates"}:{dragstart:"onDragStart",drag:"onDragMove",dragend:"onDragEnd",keyup:"onKeyUp",keydown:"onKeyDown","canvas:click":"clearStates"}},onDragStart:function(t){var e=this.lasso,r=t.item;r||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates("dragstart"),e||(e=this.createLasso()),this.dragging=!0,this.originPoint={x:t.x,y:t.y},this.points.push(this.originPoint),e.show())},onDragMove:function(t){!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push({x:t.x,y:t.y}),this.updateLasso(t))},onDragEnd:function(t){!this.lasso&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.points.push(this.originPoint),this.getSelectedItems(),this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1)},getLassoPath:function(){var t=this.points,e=[];return t.length&&(t.forEach(function(r,n){n===0?e.push(["M",r.x,r.y]):e.push(["L",r.x,r.y])}),e.push(["L",t[0].x,t[0].y])),e},clearStates:function(t){t===void 0&&(t="canvas:click");var e=this,r=e.graph,n=e.selectedState,a=e.shouldDeselect,i=r.findAllByState("node",n),o=r.findAllByState("edge",n);(!a||a({action:t,nodes:i,edges:o}))&&(i.forEach(function(s){return r.setItemState(s,n,!1)}),o.forEach(function(s){return r.setItemState(s,n,!1)})),this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges),this.selectedNodes=[],this.selectedEdges=[],r.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[]},select:!1})},getSelectedItems:function(){var t=this,e=this,r=e.graph,n=e.shouldUpdate,a=this.points.map(function(h){return[r.getCanvasByPoint(h.x,h.y).x,r.getCanvasByPoint(h.x,h.y).y]}),i=this.selectedState,o=[],s=[];r.getNodes().forEach(function(h){if(!!h.isVisible()&&xv(h,a)&&n(h,"select",t)){o.push(h);var p=h.getModel();s.push(p.id),r.setItemState(h,i,!0)}});var l=[];this.includeEdges&&o.forEach(function(h){var p=h.getOutEdges();p.forEach(function(D){if(!!D.isVisible()){var I=D.getModel(),F=I.source,Z=I.target;s.includes(F)&&s.includes(Z)&&n(D,"select",t)&&(l.push(D),r.setItemState(D,t.selectedState,!0))}})}),this.selectedEdges=l,this.selectedNodes=o,this.onSelect&&this.onSelect(o,l),r.emit("nodeselectchange",{selectedItems:{nodes:o,edges:l},select:!0})},createLasso:function(){var t=this,e=t.graph.get("delegateGroup").addShape("path",{attrs:(0,b.__assign)({path:[]},t.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=e,this.delegate=e,this.points=[],e},updateLasso:function(t){var e=this;this.lasso.attr({path:e.getLassoPath()})},onKeyDown:function(t){var e=t.key;!e||(e.toLowerCase()===this.trigger.toLowerCase()?this.keydown=!0:this.keydown=!1)},onKeyUp:function(){this.lasso&&(this.lasso.remove(!0),this.lasso=null,this.points=[],this.dragging=!1),this.keydown=!1}},zd="click",Sv=["click","drag"],Ud=void 0,_v=["shift","ctrl","control","alt","meta",void 0],Mv={getDefaultCfg:function(){return{trigger:zd,key:Ud,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var t=this;Sv.indexOf(t.trigger.toLowerCase())>-1||(t.trigger=zd,console.warn("Behavior create-edge \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click'\uFF0C'drag'")),t.key&&_v.indexOf(t.key.toLowerCase())===-1&&(t.trigger=Ud,console.warn("Behavior create-edge \u7684 key \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'shift'\uFF0C'ctrl'\uFF0C'alt'\uFF0C'control'\uFF0C\u6216 undefined"));var e;return t.trigger==="drag"?e={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:t.trigger==="click"&&(e={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),t.key&&(e.keydown="onKeyDown",e.keyup="onKeyUp"),e},onDragEnd:function(t){var e=this;if(!(e.key&&!e.keydown)){var r=t.item;(!r||r.getID()===e.source||r.getType()!=="node")&&e.cancelCreating({item:e.edge,x:t.x,y:t.y})}},onClick:function(t){var e=this;if(!(e.key&&!e.keydown)){var r=t.item,n=e.graph,a=r.getModel(),i=e.getEdgeConfig;if(e.addingEdge&&e.edge){if(!e.shouldEnd(t,e))return;var o=void 0;i&&(0,m.isFunction)(i)?o=i({source:e.source,target:a.id},e):o=e.edgeConfig;var s=(0,b.__assign)({target:a.id},o);if(e.source===a.id&&(s.type="loop"),n.emit("beforecreateedge",{}),n.updateItem(e.edge,s,!1),n.get("enabledStack")){var l=(0,b.__assign)((0,b.__assign)({},e.edge.getModel()),{itemType:"edge"}),h={};h.edges=[l],n.pushStack("add",{before:{},after:h})}n.emit("aftercreateedge",{edge:e.edge}),e.edge.getKeyShape().set("capture",!0),e.edge=null,e.addingEdge=!1}else{if(!e.shouldBegin(t,e))return;var o=void 0;i&&(0,m.isFunction)(i)?o=i({source:a.id,target:a.id},e):o=e.edgeConfig,e.edge=n.addItem("edge",(0,b.__assign)({source:a.id,target:a.id},o),!1),e.source=a.id,e.addingEdge=!0,e.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(t){var e=this;if(!(e.key&&!e.keydown)){e.edge&&e.edge.destroyed&&e.cancelCreating({item:e.edge});var r={x:t.x,y:t.y};if(!e.graph.findById(e.source)){e.addingEdge=!1;return}e.addingEdge&&e.edge&&e.graph.updateItem(e.edge,{target:r},!1)}},cancelCreating:function(t){var e,r,n=this;if(!(n.key&&!n.keydown)){var a=n.graph,i=t.item;if(n.addingEdge&&(n.edge===i||((r=(e=t.target)===null||e===void 0?void 0:e.isCanvas)===null||r===void 0?void 0:r.call(e)))){n.edge&&!n.edge.destroyed&&a.removeItem(n.edge,!1),n.edge=null,n.addingEdge=!1;return}}},onKeyDown:function(t){var e=this,r=t.key;!r||(r.toLowerCase()===e.key.toLowerCase()?e.keydown=!0:e.keydown=!1)},onKeyUp:function(){var t=this;t.addingEdge&&t.edge&&(t.graph.removeItem(t.edge,!1),t.addingEdge=!1,t.edge=null),this.keydown=!1}},Wd="ctrl",Cv=["shift","ctrl","alt","control"],Tv="1",Iv={getDefaultCfg:function(){return{trigger:Wd,combinedKey:Tv,functionName:"fitView",functionParams:[]}},getEvents:function(){return Cv.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=Wd,console.warn("Behavior shortcuts-fit-view \u7684 trigger \u53C2\u6570 '".concat(this.trigger,"' \u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'"))),this.combinedKey===this.trigger&&(this.combinedKey=void 0),{keyup:"onKeyUp",keydown:"onKeyDown"}},onKeyDown:function(t){var e=t.key;if(!!e){var r=this.trigger.toLowerCase(),n=e.toLowerCase();this.triggerKeydown||(n===r||n==="control"&&r==="ctrl"||n==="ctrl"&&r==="control"?this.triggerKeydown=!0:this.triggerKeydown=!1);var a=this.graph;if(!a[this.functionName])return console.warn("Behavior shortcuts-fit-view \u7684 functionName \u53C2\u6570 '".concat(this.functionName,"' \u4E0D\u5408\u6CD5\uFF0C\u5B83\u4E0D\u662F Graph \u7684\u4E00\u4E2A\u51FD\u6570\u540D")),{};if(this.triggerKeydown&&!this.combinedKey){this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]();return}var i=this.combinedKey.toLowerCase();this.triggerKeydown&&(n===i||n==="control"&&i==="ctrl"||n==="ctrl"&&i==="control")&&(this.functionParams&&this.functionParams.length?a[this.functionName].apply(a,this.functionParams):a[this.functionName]())}},onKeyUp:function(){this.brush&&(this.brush.remove(!0),this.brush=null,this.dragging=!1),this.triggerKeydown=!1}},Ov=["shift","ctrl","alt","control","meta"],Av={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||Ov.indexOf(this.zoomKey)===-1)&&(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(t){var e=this;if(!!this.allowDrag(t)){var r=this.graph,n=Array.isArray(this.zoomKey)?[].concat(this.zoomKey):[this.zoomKey];n.includes("control")&&n.push("ctrl");var a=n.some(function(mr){return t["".concat(mr,"Key")]});if(a){var i=r.get("canvas"),o=i.getPointByClient(t.clientX,t.clientY),s=r.getZoom();t.wheelDelta>0?s=s+s*.05:s=s-s*.05,r.zoomTo(s,{x:o.x,y:o.y})}else{var l=t.deltaX||t.movementX,h=t.deltaY||t.movementY;!h&&navigator.userAgent.indexOf("Firefox")>-1&&(h=-t.wheelDelta*125/3);var p=this.graph.get("width"),D=this.graph.get("height"),I=this.graph.get("canvas").getCanvasBBox(),F=this.scalableRange,Z=this.scalableRange;F<1&&F>-1&&(F=p*F,Z=D*Z);var ee=I.minX,se=I.maxX,oe=I.minY,ce=I.maxY;l>0?se<-F?l=0:se-l<-F&&(l=se+F):l<0&&(ee>p+F?l=0:ee-l>p+F&&(l=ee-(p+F))),h>0?ce<-Z?h=0:ce-h<-Z&&(h=ce+Z):h<0&&(oe>D+Z?h=0:oe-h>D+Z&&(h=oe-(D+Z))),this.get("direction")==="x"?h=0:this.get("direction")==="y"&&(l=0),r.translate(-l,-h)}t.preventDefault();var we=this.get("enableOptimize");if(we){var Re=this.get("optimizeZoom"),Oe=this.get("optimized"),Pe=r.getNodes(),He=r.getEdges(),at=Pe.length,qe=He.length;if(!Oe){for(var yt=0;yt<at;yt++){var Ft=Pe[yt];if(!Ft.destroyed)for(var yr=Ft.get("group").get("children"),fr=yr.length,lr=0;lr<fr;lr++){var Kt=yr[lr];!Kt.destoryed&&!Kt.get("isKeyShape")&&(Kt.set("ori-visibility",Kt.get("ori-visibility")||Kt.get("visible")),Kt.hide())}}for(var jr=0;jr<qe;jr++)for(var Xr=He[jr],yr=Xr.get("group").get("children"),fr=yr.length,lr=0;lr<fr;lr++){var Kt=yr[lr];Kt.set("ori-visibility",Kt.get("ori-visibility")||Kt.get("visible")),Kt.hide()}this.set("optimized",!0)}clearTimeout(this.get("timeout"));var er=setTimeout(function(){var mr=r.getZoom(),kr=e.get("optimized");if(kr){e.set("optimized",!1);for(var Fr=0;Fr<at;Fr++){var Jr=Pe[Fr],fn=Jr.get("group").get("children"),Vn=fn.length;if(mr<Re){var Tn=Jr.getKeyShape(),wa=Tn.get("ori-visibility");wa&&Tn.show()}else for(var ua=0;ua<Vn;ua++){var fa=fn[ua],wa=fa.get("ori-visibility");!fa.get("visible")&&wa&&wa&&fa.show()}}for(var Ma=0;Ma<qe;Ma++){var ja=He[Ma],fn=ja.get("group").get("children"),Vn=fn.length;if(mr<Re){var Tn=ja.getKeyShape(),wa=Tn.get("ori-visibility");wa&&Tn.show()}else for(var ua=0;ua<Vn;ua++){var fa=fn[ua];if(!fa.get("visible")){var wa=fa.get("ori-visibility");wa&&fa.show()}}}}},100);this.set("timeout",er)}}},allowDrag:function(t){var e,r,n=t.target,a=n&&n.isCanvas&&n.isCanvas();if((0,m.isBoolean)(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if((0,m.isObject)(this.allowDragOnItem)){var i=this.allowDragOnItem,o=i.node,s=i.edge,l=i.combo,h=(r=(e=t.item)===null||e===void 0?void 0:e.getType)===null||r===void 0?void 0:r.call(e);if(!o&&h==="node"||!s&&h==="edge"||!l&&h==="combo")return!1}return!0}},Lv={"drag-canvas":ev,"zoom-canvas":uv,"drag-node":tv,"activate-relations":rv,"brush-select":av,"click-select":ov,"lasso-select":wv,tooltip:fv,"edge-tooltip":cv,"collapse-expand":dv,"drag-combo":gv,"collapse-expand-combo":yv,"create-edge":Mv,"shortcuts-call":Iv,"scroll-canvas":Av};(0,m.each)(Lv,function(c,t){Ns(t,c)});var Dv=(0,b.__assign)((0,b.__assign)({},B),_c),tp=Vi.Grid,rp=Vi.Minimap,np=Vi.Bundling,ap=Vi.Menu,Nv=Vi.Fisheye,ip=Vi.ToolBar,op=Vi.Tooltip,Pv=Vi.TimeBar,kv=Vi.ImageMinimap,Rv=Vi.EdgeFilterLens,Bv=Vi.SnapLine,sp=Vi.Legend,Fv=Vi.Annotation,jd={version:wo.version,Graph:ys,TreeGraph:yl,Util:Vo,Layout:ea.Layouts,TreeLayout:Rc,registerLayout:gl,Global:wo,registerBehavior:Ns,registerCombo:qs,registerEdge:Sc,registerNode:To,Minimap:Vi.Minimap,Grid:Vi.Grid,Bundling:Vi.Bundling,Menu:Vi.Menu,ToolBar:Vi.ToolBar,Tooltip:Vi.Tooltip,Legend:Vi.Legend,TimeBar:Pv,SnapLine:Bv,Fisheye:Nv,ImageMinimap:kv,EdgeFilterLens:Rv,Annotation:Fv,Algorithm:Dv,Arrow:xc,Marker:Su,Shape:jo};jd.version="4.8.9";var sc=jd,up="4.8.9",Gv=function(){function c(t){t&&this.setData(t)}return c.prototype.getData=function(){return this.data},c.prototype.setData=function(t){this.data=t},c}(),zv=Gv,$c=function(c){if(!c||typeof c!="object")return c;var t;return Array.isArray(c)?t=c.map(function(e){return $c(e)}):c instanceof HTMLElement?t=c:(t={},Object.keys(c).forEach(function(e){return t[e]=$c(c[e])})),t},Uv="#1890ff",Xd={hover:{stroke:Uv,lineWidth:2}},fp=null,cp={stroke:"#40a9ff"},Wv=[[0,.5],[1,.5]],jv={fill:"#000",fontSize:12},lp={fill:"#000",fontSize:12,textAlign:"start",textBaseline:"middle"},Xv={show:!1,size:[150,100],type:"keyShape"},Vd={fill:"#fff",stroke:"#40a9ff",radius:2},Vv=6,ts="g",dp=4,Yv={position:"absolute",right:"12px",top:"12px",display:"flex",flexDirection:"column",padding:"6px",borderRadius:"2px",fontSize:"24px",textAlign:"center",lineHeight:"24px",color:"rgba(0,0,0,.65)",backgroundColor:"#fff",boxShadow:"0 0 3px #ccc"},Al=window.console,Qc=function(){return Qc=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Qc.apply(this,arguments)},Hv=function(c,t){t===void 0&&(t=100);var e=[],r=c.nodes,n=r===void 0?[]:r,a=c.edges,i=a===void 0?[]:a,o=[],s=function(I){return i.filter(function(F){var Z,ee=e.findIndex(function(oe){return oe.id===F.target});if(ee!==-1&&F.source===I){var se=l(F.source);Al.warn("The data [".concat(F.source,",").concat(F.target,",").concat((Z=se[0])===null||Z===void 0?void 0:Z.source,"] is in a loop, please check the rationality."))}return ee===-1&&F.source===I})},l=function(I){return i.filter(function(F){return F.target===I})};i.forEach(function(I){var F=I.source;i.find(function(Z){return Z.target===F})||o.push(F)});var h=0,p=function(I){var F;return F={},F["".concat(ts,"_level")]=h,F["".concat(ts,"_parent")]=l(I.id).map(function(Z){return Z.source}),F["".concat(ts,"_children")]=h<t-1?s(I.id).map(function(Z){return Z.target}):[],F};if(!o.length)return{edges:i,nodes:n.map(function(I){return Qc(Qc({},I),p(I))})};for(var D=function(){var I=n.filter(function(Z){return o.includes(Z.id)});e=e.concat(I.map(function(Z){return Qc(Qc({},Z),p(Z))}));var F=[];o.forEach(function(Z){F.push.apply(F,s(Z).map(function(ee){return ee.target}))}),o=F,h+=1};o.length;)D();return{nodes:e,edges:i}},Zv=function(c,t){var e=c.nodes,r=c.edges;if(t<=0)return c;var n=e.filter(function(a){return!a.hasOwnProperty("".concat(ts,"_level"))||a["".concat(ts,"_level")]<t});return{nodes:n,edges:r.filter(function(a){var i=a.source,o=a.target;return n.filter(function(s){return[i,o].includes(s.id)}).length>=2})}},Ul=function(){return Ul=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Ul.apply(this,arguments)},Yd=function(c,t,e,r){var n;t===void 0&&(t=0),e===void 0&&(e=""),r===void 0&&(r="");var a=c.id,i=c.children,o=i===void 0?[]:i;return Ul(Ul((n={},n["".concat(ts,"_level")]=t,n["".concat(ts,"_parentId")]=e,n["".concat(ts,"_currentPath")]=r,n),c),{children:o==null?void 0:o.map(function(s,l){return Yd(s,t+1,e?"".concat(e,"-").concat(a):a,"".concat(r,"-").concat(l))})})},Wl=function(){return Wl=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Wl.apply(this,arguments)},Hd=function(c,t){var e=c.children,r=e===void 0?[]:e,n=c.g_level,a=n===void 0?0:n;return t<=0?c:Wl(Wl({},c),{children:a+1<t?r==null?void 0:r.map(function(i){return Hd(i,t)}):[]})},jl=new Map,hp=function(c,t){var e=jl.get(c);e?e.push(t):e=[t],jl.set(c,e)},sd=function(c){var t=jl.get(c)||[];t.forEach(function(e){typeof e=="function"&&e.apply(null,arguments)}),jl.set(c,[])},Kv=function(c){return(c==null?void 0:c.nodes)instanceof Array&&(c==null?void 0:c.edges)instanceof Array},Zd=function(c,t){var e=$c(c),r=e;return t&&(Kv(c)?(r=Hv(c,t),e=Zv(r,t)):(r=Yd(c),e=Hd(r,t))),[e,r]},$v=function(c,t,e){var r=Zd(t,e),n=r[0],a=r[1];c.data(n),c.set("eventData",new zv(a)),c.render(),c.get("canvas").set("localRefresh",!1),sd(c.get("id"))},Kd=function(c,t){return typeof c=="function"&&t?c(t)||{}:Array.isArray(c)?c:Wv},ud=function(){return ud=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},ud.apply(this,arguments)},Jc=function(c,t){if(!!c&&!(typeof c=="object"&&(c==null?void 0:c.show)===!1)){var e=typeof c=="function"?c(t):c,r=e.type,n=r===void 0?"vee":r,a=e.d,i=a===void 0?0:a,o=e.size,s=o===void 0?10:o;return ud({path:sc.Arrow[n](s,s,i),fill:"#ccc",d:i},e)}},Ll=function(c,t,e){return typeof c=="function"?c(t,e):c},$d=function(c,t){c===void 0&&(c="right");var e=t[0],r=t[1],n=0,a=0;switch(c){case"top":n=e/2,a=0;break;case"right":n=e,a=r/2;break;case"bottom":n=e/2,a=r;break;case"left":n=0,a=r/2;break}return{x:n,y:a}},Qv=function(c,t){return(0,m.reduce)(c,function(e,r,n){return n=t?t(r):r,e.hasOwnProperty(n)?++e[n]:e[n]=1,e},{})},Qd=function(c){var t=c.nodes,e=c.edges;if(t.length===1)return t[0].id;var r=[];e.forEach(function(s){r.push(s.source)});var n=Qv(r),a=0,i="";for(var o in n)n.hasOwnProperty(o)&&n[o]>a&&(a=n[o],i=o);return i},Jd=function(c,t,e){var r,n;return e&&e.current&&(r=e.current.offsetWidth,n=e.current.offsetHeight||500),!c&&!r||!t&&!n?(Al.warn("\u8BF7\u4E3A Graph \u6307\u5B9A width \u4E0E height\uFF01\u5426\u5219\u5C06\u4F7F\u7528\u9ED8\u8BA4\u503C 500 * 500"),[500,500]):[c||r||500,t||n||500]},Jv=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(c){var t=Math.random()*16|0,e=c=="x"?t:t&3|8;return e.toString(16)})},qv=function(c,t){return c.current||(c.current="".concat(t,"-graph-").concat(Jv())),c.current},eg=function(c,t){var e=t!=null?t:{},r=e.nodeCfg,n=r===void 0?{}:r,a=e.edgeCfg,i=a===void 0?{}:a,o=n.nodeStateStyles,s=i.edgeStateStyles,l={},h=function(I,F,Z){c.updateItem(I,{style:{endArrow:!!F&&{fill:F},startArrow:!!Z&&{fill:Z}}})},p=function(I,F,Z){var ee,se,oe;Z?I.toFront():I.toBack();var ce=(ee=I.getModel().style)!==null&&ee!==void 0?ee:{},we=ce.endArrow,Re=ce.startArrow;if(we||Re){if(!l[I.getID()]){var Oe=(we!=null?we:{}).fill,Pe=(Re!=null?Re:{}).fill,He=(oe=(se=I.getModel().style)===null||se===void 0?void 0:se[F])===null||oe===void 0?void 0:oe.stroke;l[I.getID()]=[[He!=null?He:Oe,Oe],[He!=null?He:Pe,Pe]]}var at=l[I.getID()];h(I,we&&at[0][Z?0:1],Re&&at[1][Z?0:1])}c.setItemState(I,F,Z)},D=function(I,F,Z,ee){var se=ee==="node"?c.findAll("edge",function(ce){return ce.getSource()===I||ce.getTarget()===I}):c.findAll("node",function(ce){return I.getSource().get("id")===ce.get("id")||I.getTarget().get("id")===ce.get("id")}),oe=[I].concat(se);oe.forEach(function(ce){p(ce,F,Z)})};o&&(c.on("node:mouseenter",function(I){var F=I.item;D(F,"hover",!0,"node")}),c.on("node:mouseleave",function(I){var F=I.item;D(F,"hover",!1,"node")})),s&&(c.on("edge:mouseenter",function(I){var F=I.item;D(F,"hover",!0,"edge")}),c.on("edge:mouseleave",function(I){var F=I.item;D(F,"hover",!1,"edge")}))},Xl=function(){return Xl=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Xl.apply(this,arguments)},qd=function(c,t){if(c===void 0&&(c={}),!(!t||t.destroyed)){var e=t.get("plugins").filter(function(a){return a.get("name")==="minimap"})[0];if(e&&t.removePlugin(e),c.show){var r=Object.assign(Xv,c),n=new sc.Minimap(Xl(Xl({},r),{name:"minimap"}));t.addPlugin(n)}}},tg=z(73935),rg=z.t(tg,2),fd=function(){return fd=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},fd.apply(this,arguments)},eh=function(c,t,e,r){function n(a){return a instanceof e?a:new e(function(i){i(a)})}return new(e||(e=Promise))(function(a,i){function o(h){try{l(r.next(h))}catch(p){i(p)}}function s(h){try{l(r.throw(h))}catch(p){i(p)}}function l(h){h.done?a(h.value):n(h.value).then(o,s)}l((r=r.apply(c,t||[])).next())})},th=function(c,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,i;return i={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function o(l){return function(h){return s([l,h])}}function s(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(e=0)),e;)try{if(r=1,n&&(a=l[0]&2?n.return:l[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;switch(n=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,n=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){e.label=l[1];break}if(l[0]===6&&e.label<a[1]){e.label=a[1],a=l;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(l);break}a[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(c,e)}catch(h){l=[6,h],n=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Dl=fd({},rg),ng=Dl.version,ag=Dl.render,ig=Dl.unmountComponentAtNode,Vl;try{var og=Number((ng||"").split(".")[0]);og>=18&&(Vl=Dl.createRoot)}catch(c){}function rh(c){var t=Dl.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&typeof t=="object"&&(t.usingClientEntryPoint=c)}var Yl="__rc_react_root__";function sg(c,t){rh(!0);var e=t[Yl]||Vl(t);rh(!1),e.render(c),t[Yl]=e}function ug(c,t){ag(c,t)}function vp(c,t){}function nh(c,t){if(Vl){sg(c,t);return}ug(c,t)}function fg(c){return eh(this,void 0,void 0,function(){return th(this,function(t){return[2,Promise.resolve().then(function(){var e;(e=c[Yl])===null||e===void 0||e.unmount(),delete c[Yl]})]})})}function cg(c){ig(c)}function gp(c){}function pp(c){return eh(this,void 0,void 0,function(){return th(this,function(t){return Vl!==void 0?[2,fg(c)]:(cg(c),[2])})})}var ah=function(c,t){t===void 0&&(t={});var e=Object.keys(t);e.forEach(function(r){c.style[r]=t[r]})},cd=function(c,t,e){t===void 0&&(t={});var r=document.createElement("div");return Object.keys(t).forEach(function(n){r[n]=t[n]}),e&&ah(r,e),nh(c,r),r},Hl=function(){return Hl=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Hl.apply(this,arguments)},lg=function(c,t){var e={};for(var r in c)Object.prototype.hasOwnProperty.call(c,r)&&t.indexOf(r)<0&&(e[r]=c[r]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(c);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(c,r[n])&&(e[r[n]]=c[r[n]]);return e},dg=function(c,t){if(c===void 0&&(c={}),!(!t||t.destroyed)){var e=t.get("plugins").filter(function(i){return i.get("name")==="tooltip"})[0];if(e&&t.removePlugin(e),c.show||c.show===void 0&&Object.keys(c).length>0){var r=c.customContent,n=lg(c,["customContent"]),a=new sc.Tooltip(Hl(Hl({offsetX:10,offsetY:20,itemTypes:["node"]},n),{getContent:function(i){return(0,m.isFunction)(r)?cd(r(i.item.getModel()),{className:"g6-tooltip"}):""},name:"tooltip"}));t.addPlugin(a)}}},hg=function(){function c(t){this._cfgs=(0,m.deepMix)(this.getDefaultCfgs(),t),this._events={},this.destroyed=!1}return c.prototype.getDefaultCfgs=function(){return{}},c.prototype.initPlugin=function(t){var e=this;e.set("graph",t);var r=e.getEvents(),n={};(0,m.each)(r,function(a,i){var o=(0,m.wrapBehavior)(e,a);n[i]=o,t.on(i,o)}),this._events=n,this.init()},c.prototype.getEvents=function(){return{}},c.prototype.get=function(t){var e;return(e=this._cfgs)===null||e===void 0?void 0:e[t]},c.prototype.set=function(t,e){this._cfgs[t]=e},c.prototype.destroy=function(){},c.prototype.destroyPlugin=function(){this.destroy();var t=this.get("graph"),e=this._events;(0,m.each)(e,function(r,n){t.off(n,r)}),this._events=null,this._cfgs=null,this.destroyed=!0},c}(),vg=hg,gg=function(){var c=function(t,e){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},c(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");c(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();typeof document!="undefined"&&pi()(`
  205. .g6-component-contextmenu {
  206. border: 1px solid #e2e2e2;
  207. border-radius: 4px;
  208. font-size: 12px;
  209. color: #545454;
  210. background-color: rgba(255, 255, 255, 0.9);
  211. padding: 10px 8px;
  212. box-shadow: rgb(174, 174, 174) 0px 0px 10px;
  213. }
  214. .g6-contextmenu-ul {
  215. padding: 0;
  216. margin: 0;
  217. list-style: none;
  218. }
  219. `);var pg=function(c){gg(t,c);function t(e){return c.call(this,e)||this}return t.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,customContent:function(e){return`
  220. <ul class='g6-contextmenu-ul'>
  221. <li>\u83DC\u5355\u98791</li>
  222. <li>\u83DC\u5355\u98792</li>
  223. </ul>
  224. `},shouldBegin:function(e){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},t.prototype.getEvents=function(){return this.get("trigger")==="click"?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},t.prototype.init=function(){var e=this.get("className"),r=(0,Aa.Z)("<div class=".concat(e||"g6-component-contextmenu","></div>"));(0,Kn.Z)(r,{top:"0px",position:"absolute",visibility:"hidden"});var n=this.get("container");n||(n=this.get("graph").get("container")),(0,m.isString)(n)&&(n=document.getElementById(n)),n.appendChild(r),this.set("menu",r)},t.prototype.onMenuShow=function(e){var r=this;e.preventDefault();var n=this.get("itemTypes");if(e.item){if(e.item&&e.item.getType&&n.indexOf(e.item.getType())===-1){r.onMenuHide();return}}else if(n.indexOf("canvas")===-1){r.onMenuHide();return}var a=this.get("shouldBegin");if(!!a(e)){var i=this.get("menu"),o=this.get("customContent"),s=this.get("graph"),l=o(e,s);nh(l,i),this.removeMenuEventListener();var h=this.get("handleMenuClick");if(h){var p=function(Pe){h(Pe.target,e.item,s)};this.set("handleMenuClickWrapper",p),i.addEventListener("click",p)}var D=s.get("width"),I=s.get("height"),F=i.getBoundingClientRect(),Z=this.get("offsetX")||0,ee=this.get("offsetY")||0,se=s.getContainer().offsetTop,oe=s.getContainer().offsetLeft,ce=e.canvasX+oe+Z,we=e.canvasY+se+ee;ce+F.width>D&&(ce=e.canvasX-F.width-Z+oe),we+F.height>I&&(we=e.canvasY-F.height-ee+se),(0,Kn.Z)(i,{top:"".concat(we,"px"),left:"".concat(ce,"px"),visibility:"visible"});var Re=this.get("trigger")==="click",Oe=function(Pe){if(Re){Re=!1;return}r.onMenuHide()};document.body.addEventListener("click",Oe),this.set("handler",Oe)}},t.prototype.removeMenuEventListener=function(){var e=this.get("handleMenuClickWrapper"),r=this.get("handler");if(e){var n=this.get("menu");n.removeEventListener("click",e),this.set("handleMenuClickWrapper",null)}r&&document.body.removeEventListener("click",r)},t.prototype.onMenuHide=function(){var e=this.get("menu");e&&(0,Kn.Z)(e,{visibility:"hidden"}),this.removeMenuEventListener()},t.prototype.destroy=function(){var e=this.get("menu");if(this.removeMenuEventListener(),e){var r=this.get("container");r||(r=this.get("graph").get("container")),(0,m.isString)(r)&&(r=document.getElementById(r)),r.removeChild(e)}},t}(vg),yg=pg,Zl=function(){return Zl=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Zl.apply(this,arguments)},mg=function(c,t){if(c===void 0&&(c={}),!(!t||t.destroyed)){var e=t.get("plugins").filter(function(n){return n.get("name")==="menu"})[0];if(e&&t.removePlugin(e),c.show||c.show===void 0){var r=new yg(Zl(Zl({offsetX:16+10,offsetY:0,itemTypes:["node"]},c),{name:"menu"}));t.addPlugin(r)}}},Eg=function(c){var t=(0,d.useState)(!1),e=t[0],r=t[1],n=function(){document.fullscreenElement||r(!1)},a=function(){c&&c.requestFullscreen&&c.requestFullscreen().then(function(){r(!0)}).catch(function(s){Al.error("requestFullscreen error: ",s)})},i=function(){document.exitFullscreen&&document.exitFullscreen().then(function(){r(!1)}).catch(function(s){Al.error("exitFullscreen error: ",s)})},o=function(){if(!c){Al.error("need dom");return}e?i():a()};return(0,d.useEffect)(function(){return document.addEventListener("fullscreenchange",n,!1),function(){document.removeEventListener("fullscreenchange",n)}},[]),[e,o]},bg=Eg,xg=function(c){var t=c.toolbarCfg,e=c.container,r=c.graph,n=(0,d.useRef)(),a=(0,d.useRef)(),i=(0,d.useRef)(),o=(0,d.useRef)(1),s=t.zoomFactor,l=s===void 0?.25:s,h=t.renderIcon,p=t.customContent,D=bg(e),I=D[0],F=D[1],Z=function(){return[window.outerWidth,window.outerHeight]},ee=function(Oe){var Pe,He=Oe?Z():[a.current,i.current];(Pe=n.current)===null||Pe===void 0||Pe.changeSize(He[0],He[1])},se=function(){return e?{x:e.clientWidth/2,y:e.clientHeight/2}:{x:0,y:0}},oe=function(){var Oe;(Oe=n.current)===null||Oe===void 0||Oe.zoom(Math.min(o.current+l,5),se())},ce=function(){var Oe;(Oe=n.current)===null||Oe===void 0||Oe.zoom(Math.max(o.current-l,.25),se())};(0,d.useEffect)(function(){r&&(n.current=r,a.current=e==null?void 0:e.clientWidth,i.current=e==null?void 0:e.clientHeight)},[r]);var we=function(){F(),ee(!document.fullscreenElement)},Re=p||h;return Re?Re({zoomIn:oe,zoomOut:ce,toggleFullscreen:we,fullscreen:I,graph:r}):d.createElement(d.Fragment,null,I?d.createElement("span",{style:{cursor:"pointer"},onClick:we},"\u2684"):d.createElement("span",{style:{cursor:"pointer"},onClick:we},"\u2610"),d.createElement("span",{style:{cursor:"pointer"},onClick:oe},"+"),d.createElement("span",{style:{cursor:"pointer"},onClick:ce},"-"))},Kl=function(){return Kl=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Kl.apply(this,arguments)},wg=function(c,t){var e={};for(var r in c)Object.prototype.hasOwnProperty.call(c,r)&&t.indexOf(r)<0&&(e[r]=c[r]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(c);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(c,r[n])&&(e[r[n]]=c[r[n]]);return e},Sg=function(c,t,e){var r;c===void 0&&(c={});var n=c.show,a=c.className,i=c.style,o=wg(c,["show","className","style"]),s=t==null?void 0:t.get("id");if(!(!t||t.destroyed)){var l="".concat(s,"-toolbar"),h=document.querySelector("#".concat(l));if(h&&((r=h.parentNode)===null||r===void 0||r.removeChild(h)),n){var p=cd(d.createElement(xg,{graph:t,container:e,toolbarCfg:o}),{className:a!=null?a:"charts-toolbar",id:l},Kl(Kl({},Yv),i));e.appendChild(p)}}},ih={},_g=function(c,t){ih[c]=t},yp=function(c){return ih[c]},Zo=function(){return Zo=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Zo.apply(this,arguments)};function Mg(c,t,e){e===void 0&&(e={});var r=(0,d.useRef)(null),n=(0,d.useRef)(),a=(0,d.useRef)(),i=(0,d.useRef)(),o=t.data,s=t.width,l=t.height,h=t.layout,p=t.minimapCfg,D=t.behaviors,I=t.fitCenter,F=t.nodeCfg,Z=t.edgeCfg,ee=t.markerCfg,se=t.level,oe=t.toolbarCfg,ce=t.tooltipCfg,we=t.menuCfg,Re=t.customLayout,Oe=n.current,Pe=function(fr){fr.forEach(function(lr){var Kt,jr,Xr=lr.getModel(),er=Xr.source,mr=Xr.target,kr=(Kt=Oe==null?void 0:Oe.findById(er))===null||Kt===void 0?void 0:Kt.get("visible"),Fr=(jr=Oe==null?void 0:Oe.findById(mr))===null||jr===void 0?void 0:jr.get("visible");(kr===!1||Fr===!1)&&lr.changeVisibility(!1)})},He=function(){var fr,lr;if(!!Oe){var Kt=o,jr=Kt;se&&(fr=Zd(o,se),Kt=fr[0],jr=fr[1]),Oe.changeData(Kt),(lr=Oe.get("eventData"))===null||lr===void 0||lr.setData(jr),Pe(Oe.getEdges()),I&&Oe.fitCenter(),sd(Oe.get("id"))}},at=function(){Oe==null||Oe.updateLayout(h),I&&(Oe==null||Oe.fitCenter())},qe=function(){if(!!Oe){var fr=F!=null?F:{},lr=fr.type,Kt=fr.anchorPoints,jr=fr.style,Xr=fr.title;Oe.getNodes().forEach(function(er){var mr=Kd(Kt,er.getModel());Oe.updateItem(er,{nodeCfg:F,markerCfg:ee,type:lr,style:jr,anchorPoints:mr,labelCfg:Xr})}),sd(Oe.get("id"))}},yt=function(){if(!!Oe){var fr=Z!=null?Z:{},lr=fr.type,Kt=fr.style,jr=fr.startArrow,Xr=fr.endArrow,er=fr.label;Oe.getEdges().forEach(function(mr){if(["fund-line","labels-line"].includes(lr))Oe.updateItem(mr,{edgeCfg:Z});else{var kr=mr.getModel(),Fr=Jc(jr,kr),Jr=Jc(Xr,kr),fn=er!=null?er:{},Vn=fn.style,Tn=fn.content;Oe.updateItem(mr,{type:lr,label:Ll(Tn,kr,Oe),labelCfg:{style:Ll(Vn,kr,Oe)},style:Zo({stroke:"#ccc",startArrow:Fr,endArrow:Jr},typeof Kt=="function"?Kt(kr,Oe):Kt)})}})}},Ft=function(){!Oe||Oe.getNodes().forEach(function(fr){var lr=(typeof ee=="function"?ee(fr.getModel(),fr.get("group")):ee).position,Kt=lr===void 0?"right":lr,jr=fr.getBBox(),Xr=jr.width,er=jr.height,mr=fr.get("group").get("children").find(function(kr){return kr.get("name")==="collapse-icon"});mr&&(mr==null||mr.attr(Zo({},$d(Kt,[Xr,er]))))})},yr=function(fr){var lr=e.name,Kt=lr===void 0?"":lr;if(Kt!=="FundFlowGraph")return fr;if(!!fr){var jr=fr.hover,Xr=jr===void 0?{}:jr,er=Xr.endArrow,mr=Xr.startArrow;return!er&&!mr?fr:{hover:Zo(Zo({},Xr),{endArrow:er?Jc(er):!1,startArrow:mr?Jc(mr):!1})}}};return(0,d.useEffect)(function(){var fr;if(Oe&&!Oe.destroyed){if((0,m.isEqual)(o,i.current))return;if(e.name==="RadialGraph"&&!((fr=i.current.nodes)===null||fr===void 0?void 0:fr.length)){var lr=Qd(o);Oe.set("centerNode",lr),Oe.updateLayout(Zo(Zo({},h),{focusNode:lr}))}else He();i.current=$c(o)}},[o]),(0,d.useEffect)(function(){var fr,lr,Kt,jr,Xr;if(Oe&&!Oe.destroyed){if((0,m.isEqual)(t,a.current))return;!Re&&!(0,m.isEqual)(h,(fr=a.current)===null||fr===void 0?void 0:fr.layout)&&at(),(0,m.isEqual)(p,(lr=a.current)===null||lr===void 0?void 0:lr.minimapCfg)||qd(p,Oe),(0,m.isEqual)(F,(Kt=a.current)===null||Kt===void 0?void 0:Kt.nodeCfg)||qe(),(0,m.isEqual)(Z,(jr=a.current)===null||jr===void 0?void 0:jr.edgeCfg)||yt(),(0,m.isEqual)(ee,(Xr=a.current)===null||Xr===void 0?void 0:Xr.markerCfg)||Ft(),a.current=t}},[t]),(0,d.useEffect)(function(){if(Oe&&!Oe.destroyed){var fr=Jd(s,l,r);Oe.changeSize(fr[0],fr[1])}},[r,s,l]),(0,d.useEffect)(function(){if(Oe&&!Oe.destroyed){var fr=Oe.get("modes").default,lr=[];fr.forEach(function(Kt){(0,m.isObject)(Kt)?lr.push(Kt.type):(0,m.isString)(Kt)&&lr.push(Kt)}),Oe.removeBehaviors(lr,"default"),Oe.addBehaviors(D,"default")}},[D]),(0,d.useEffect)(function(){if(r.current&&c&&!n.current){var fr=e.name,lr=fr===void 0?"":fr,Kt=e.bindEvents,jr=Jd(s,l,r),Xr=t.nodeCfg,er=t.edgeCfg,mr=t.behaviors,kr=mr===void 0?[]:mr,Fr=t.layout,Jr=t.animate,fn=t.autoFit,Vn=t.fitCenter,Tn=t.onReady,wa=t.customLayout,ua=t.fetchLoading,fa=Xr!=null?Xr:{},Ma=fa.type,ja=fa.anchorPoints,Ra=fa.nodeStateStyles,uo=fa.style,Da=fa.title,fo=fa.linkCenter,Qa=fa.getChildren,Ja=fa.asyncData,oi=er!=null?er:{},Si=oi.type,Ai=oi.style,la=oi.startArrow,Ca=oi.endArrow,Xn=oi.label,Ta=oi.edgeStateStyles;n.current=new sc[c]({container:r.current,width:jr[0],height:jr[1],animate:Jr,linkCenter:fo,modes:{default:kr},defaultNode:Zo(Zo({},Xr),{nodeCfg:Xr}),defaultEdge:Zo(Zo({},(0,m.omit)(er,["label"])),{edgeCfg:er,labelCfg:Xn==null?void 0:Xn.style}),nodeStateStyles:Ra,edgeStateStyles:yr(Ta),layout:wa?void 0:Fr,fitView:fn,fitCenter:Vn,extraPlugin:{getChildren:Qa,fetchLoading:ua}});var Na=qv(n.current,lr),cn=n.current;cn.set("id",Na),_g(Na,cn);var pa=["fund-card","indicator-card","file-tree-node","organization-card"],ma=function(Nn){return(0,m.isString)(Nn)?Nn:lr==="FundFlowGraph"?Nn==null?void 0:Nn.text:Nn==null?void 0:Nn.title};cn.node(function(Nn){if(pa.includes(Ma)){var Xa=Kd(ja,Nn);return Nn.markerCfg=ee,Nn.edgeCfg=er,{anchorPoints:Xa,_draggable:kr.includes("drag-node"),_graphId:Na}}var Ci=(Da!=null?Da:{}).style;return{_graphId:Na,label:ma(Nn.value),labelCfg:{style:Ll(Ci,Nn,cn)},style:Zo({stroke:"#ccc"},typeof uo=="function"?uo(Nn,cn):uo)}});var Ua=function(Nn){var Xa=(Xn!=null?Xn:{}).content;if(["DecompositionTreeGraph","OrganizationGraph","RadialTreeGraph"].includes(lr))return Ll(Xa,Nn,cn);if(["FundFlowGraph","FlowAnalysisGraph"].includes(lr)){var Ci=Nn.value;return typeof Ci=="object"?Ci==null?void 0:Ci.text:Ci}return Nn.value};if(["fund-line","labels-line"].includes(Si)||cn.edge(function(Nn){var Xa=Jc(la,Nn),Ci=Jc(Ca,Nn),Ti=(Xn!=null?Xn:{}).style;return{label:Ua(Nn),labelCfg:{style:Ll(Ti,Nn,cn)},style:Zo({stroke:"#ccc",startArrow:Xa,endArrow:Ci},typeof Ai=="function"?Ai(Nn,cn):Ai)}}),eg(cn,t),lr==="RadialGraph"){var xa=Qd(o);cn.set("centerNode",xa)}typeof Kt=="function"&&Kt({graph:cn,level:se,asyncData:Ja,getChildren:Qa,fetchLoading:ua,layout:Fr}),$v(cn,o,se),Vn&&cn.fitCenter(),Tn&&Tn(cn),i.current=$c(o)}},[]),(0,d.useEffect)(function(){if(n.current){var fr=n.current;qd(p,fr),dg(ce,fr),mg(we,fr),Sg(oe,fr,r.current)}},[n,oe,ce,we]),(0,d.useEffect)(function(){return function(){(Oe==null?void 0:Oe.current)&&!Oe.current.destroyed&&Oe.current.destroy()}},[]),{container:r}}var Cg=function(c){return Object.prototype.toString.call(c).slice(8,-1)},Nl=function(){return Nl=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Nl.apply(this,arguments)};function Tg(c,t){var e=$c(c),r=(0,d.useCallback)(function(a,i){var o=Nl({},i),s=Object.keys(a);return s.forEach(function(l){Cg(a[l])==="Object"?o[l]=Nl(Nl({},i[l]),a[l]):o[l]=a[l]}),o},[c,t]),n=r(e,t);return{uProps:n}}var oh="marker:click",$l=function(){return $l=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},$l.apply(this,arguments)},Ig=function(c,t){t===void 0&&(t="");var e=t.split("-");e.shift();var r=c;return e.forEach(function(n){!r||(r=r.children[Number(n)])}),(r==null?void 0:r.children)?r.children.map(function(n){return $l($l({},n),{children:[]})}):[]},Og=function(c,t){var e="".concat(ts,"-antd-loading");if(t){var r=(0,m.isFunction)(t)?t(c):t;document.body.appendChild(cd(r,{className:e}))}else{var n=document.createElement("div");n.className=e;var a={position:"fixed",left:"0",top:"0",width:"100vw",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0, 0.25)",color:"#fff",fontSize:"16px",zIndex:999};ah(n,a);var i=document.createElement("span");i.innerText="loading...",n.appendChild(i),document.body.appendChild(n)}},Ag=function(c,t,e){var r=c.get("eventData").getData(),n=e.split("-");n.shift();var a=r;n.forEach(function(i){a=a.children[Number(i)]}),a.children=t},Lg=function(){var c=document.getElementsByClassName("".concat(ts,"-antd-loading"));Array.from(c).forEach(function(t){document.body.removeChild(t)})},ld=function(){return ld=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},ld.apply(this,arguments)},Dg=function(c,t,e,r){function n(a){return a instanceof e?a:new e(function(i){i(a)})}return new(e||(e=Promise))(function(a,i){function o(h){try{l(r.next(h))}catch(p){i(p)}}function s(h){try{l(r.throw(h))}catch(p){i(p)}}function l(h){h.done?a(h.value):n(h.value).then(o,s)}l((r=r.apply(c,t||[])).next())})},Ng=function(c,t){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,n,a,i;return i={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function o(l){return function(h){return s([l,h])}}function s(l){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(e=0)),e;)try{if(r=1,n&&(a=l[0]&2?n.return:l[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;switch(n=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return e.label++,{value:l[1],done:!1};case 5:e.label++,n=l[1],l=[0];continue;case 7:l=e.ops.pop(),e.trys.pop();continue;default:if(a=e.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){e=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){e.label=l[1];break}if(l[0]===6&&e.label<a[1]){e.label=a[1],a=l;break}if(a&&e.label<a[2]){e.label=a[2],e.ops.push(l);break}a[2]&&e.ops.pop(),e.trys.pop();continue}l=t.call(c,e)}catch(h){l=[6,h],n=0}finally{r=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Pg=function(c){var t=c.graph,e=c.level,r=c.getChildren,n=c.fetchLoading,a=function(i){return Dg(void 0,void 0,void 0,function(){var o,s,l,h,p,D,I,F,Z,ee,se,oe,ce;return Ng(this,function(we){switch(we.label){case 0:return o=i.item,s=o.getModel(),((ce=i.target.get("name"))===null||ce===void 0?void 0:ce.startsWith("collapse-icon"))?(l=o.getModel(),h=l.collapsed,p=l.g_currentPath,D=l.children,I=D===void 0?[]:D,F=l.g_parentId,Z=l.g_level,ee=l.id,se=e&&!I.length&&Ig(t.get("eventData").getData(),p),r&&!(I==null?void 0:I.length)&&!(se==null?void 0:se.length)?(Og(s,n),[4,r(o.getModel())]):[3,2]):[3,3];case 1:oe=we.sent(),oe&&(oe=oe.map(function(Re,Oe){var Pe;return ld((Pe={},Pe["".concat(ts,"_level")]=Z+1,Pe["".concat(ts,"_parentId")]="".concat(F,"-").concat(ee),Pe["".concat(ts,"_currentPath")]="".concat(p,"-").concat(Oe),Pe),Re)}),Ag(t,oe,p)),se=oe,Lg(),we.label=2;case 2:(se==null?void 0:se.length)>0?(s.children=se,t.updateChild(s,s.id),t.updateItem(o,{collapsed:!1}),t.refreshItem(o),t.emit(oh,i,{type:"fetch",collapsed:!0})):(t.updateItem(o,{collapsed:!h}),t.layout(),t.emit(oh,i,{type:"collapse",collapsed:!!h})),we.label=3;case 3:return[2]}})})};t.on("node:click",function(i){a(i)}),t.on("node:touchstart",function(i){a(i)})},kg=function(c){if(typeof c=="number")return[c,c,c,c];var t=[];switch(c.length){case 1:t=[c[0],c[0],c[0],c[0]];break;case 2:t=[c[0],c[1],c[0],c[1]];break;case 3:t=[c[0],c[1],c[2],c[1]];break;case 4:t=c;break;default:break}return t},sh=function(c,t,e,r){return typeof c=="function"?c(t,e,r)||{}:c||{}},Pl=function(){return Pl=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},Pl.apply(this,arguments)},Rg=function(c,t,e,r){var n=c.show,a=c.position,i=c.collapsed,o=c.style;n&&t.addShape("marker",{attrs:Pl(Pl(Pl({},$d(a,e)),{r:6,cursor:"pointer",symbol:i?sc.Marker.expand:sc.Marker.collapse,stroke:Vd.stroke,lineWidth:1,fill:"#fff"}),o),defaultCollapsed:!1,name:r?"collapse-icon-".concat(a):"collapse-icon",position:a})},ju=function(){return ju=Object.assign||function(c){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(c[n]=t[n])}return c},ju.apply(this,arguments)},Bg=function(c,t,e){if(e||arguments.length===2)for(var r=0,n=t.length,a;r<n;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return c.concat(a||Array.prototype.slice.call(t))},Fg=function(){var c={width:12,height:12};sc.registerNode("organization-card",{draw:function(t,e){var r,n,a;t===void 0&&(t={});var i=t.value,o=i===void 0?{}:i,s=t.nodeCfg,l=t.markerCfg,h=t._draggable,p=ju({},o),D=!1;p.text&&(D=!0,p.name=p.text),p.value&&(D=!0,p.title=p.value);var I=s,F=I.style,Z=I.padding,ee=Z===void 0?0:Z,se=I.label,oe=se===void 0?{}:se,ce=I.autoWidth,we=I.customContent,Re=oe.style,Oe=kg(ee),Pe=(t==null?void 0:t.size)||[100,30];typeof Pe=="number"&&(Pe=[Pe,Pe]);var He=0,at=Pe[0]-Oe[1]-Oe[3],qe=sh(F,t,e),yt=e.addShape("rect",{attrs:ju(ju({x:0,y:0,width:Pe[0],height:Pe[1]},Vd),qe),name:"main-box",draggable:h});if(p){var Ft=function(Tn){if(D){var wa={name:"text",title:"value"};return wa[Tn]}return Tn};He+=Oe[0];var yr=function(Tn,wa,ua,fa){fa===void 0&&(fa=0);var Ma=0,ja=[],Ra=["icon","name","title"],uo=function(Da,fo){var Qa=fo.fontSize,Ja=Qa===void 0?12:Qa,oi=0,Si=0,Ai=ce?Ma&&Ma+Oe[3]:(wa+Ma)/2;switch(Da){case"icon":oi=ua,Si=He;break;case"name":oi=ua+Ai,Si=Tn.title?Oe[0]:(Pe[1]-Ja)/2;break;case"title":oi=ua+Ai,Si=Tn.name?Oe[0]+ja[1]+Vv:(Pe[1]-Ja)/2;break;default:break}return{x:oi,y:Si}};return Ra.forEach(function(Da,fo){var Qa=Da.startsWith("icon"),Ja=sh(Re,t,e,Ft(Da));Da==="icon"&&Tn[Da]&&(Ma=Ja.width||32);var oi=e.addShape(Qa?"image":"text",{attrs:ju(ju(ju(ju({textBaseline:"top",textAlign:ce?"start":"center"},uo(Da,Ja)),{text:Tn[Da],img:Tn[Da]}),Qa?c:jv),Ja),name:"".concat(Da,"-").concat(fa,"-").concat(fo),draggable:h});ja.push(oi.getBBox().height)}),ja},fr=function(Tn,wa){var ua;wa===void 0&&(wa=0);var fa=[];we?fa.push((ua=we(Tn,e,{startX:Oe[3],startY:He,width:at}))!==null&&ua!==void 0?ua:0):fa.push.apply(fa,yr(Tn,at,Oe[3],wa)),He+=Math.max.apply(Math,fa)};fr(p)}if(yt==null||yt.attr("height",Math.max(He+Oe[2],Pe[1])),ce){var lr=Math.max.apply(Math,Bg([Pe[0]],(r=e==null?void 0:e.getChildren())===null||r===void 0?void 0:r.map(function(Tn){return(Tn.getBBox().maxX||0)+Oe[1]}),!1));yt==null||yt.attr("width",lr)}if(l){var Kt=((a=(n=e==null?void 0:e.get("item"))===null||n===void 0?void 0:n.getModel())!==null&&a!==void 0?a:{}).collapsed,jr=yt.getBBox(),Xr=jr.width,er=jr.height,mr=typeof l=="function"?l(t,e):l,kr=mr.show,Fr=mr.position,Jr=Fr===void 0?"right":Fr,fn=mr.collapsed,Vn=mr.style;Rg({show:kr,position:Jr,collapsed:Kt!=null?Kt:fn,style:Vn},e,[Xr,er]),yt.attr("defaultCollapsed",fn)}return yt},update:void 0},"single-node")},Gg=function(c,t){var e={};for(var r in c)Object.prototype.hasOwnProperty.call(c,r)&&t.indexOf(r)<0&&(e[r]=c[r]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(c);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(c,r[n])&&(e[r[n]]=c[r[n]]);return e};Fg();var zg={fill:"#91d5ff",stroke:"#40a9ff",radius:2},Ug={type:"compactBox",direction:"TB",getId:function(t){return t.id},getHeight:function(){return 16},getWidth:function(){return 16},getVGap:function(){return 40},getHGap:function(){return 70}},Wg={nodeCfg:{type:"organization-card",size:[100,44],style:zg,padding:6,anchorPoints:[[.5,0],[.5,1]],nodeStateStyles:Xd,label:{style:function(c,t,e){var r={icon:{width:32,height:32},title:{fill:"#fff"},name:{fill:"#000"}};return e?r[e]:{}}}},edgeCfg:{type:"polyline",endArrow:{type:"triangle",fill:"#91d5ff"},edgeStateStyles:Xd,style:{stroke:"#91d5ff"}},behaviors:["zoom-canvas","drag-canvas"],layout:Ug,animate:!0,markerPosition:"right",autoFit:!0,fitCenter:!0,style:{position:"relative",height:"inherit",backgroundColor:"#fff"}},jg=function(c){var t=Tg(c,Wg).uProps,e=t.className,r=t.style,n=t.loading,a=t.loadingTemplate,i=t.errorTemplate,o=Gg(t,["className","style","loading","loadingTemplate","errorTemplate"]),s=Mg("TreeGraph",o,{name:"OrganizationGraph",bindEvents:Pg}).container;return d.createElement(k,{errorTemplate:i},n&&d.createElement(E,{loadingTemplate:a}),d.createElement("div",{className:e,style:r,ref:s}))},Xg=jg},31199:function(or,U,z){"use strict";var B=z(28991),j=z(81253),R=z(85893),A=z(67294),N=z(31649),L=["fieldProps","min","proFieldProps","max"],y=function(v,g){var d=v.fieldProps,_=v.min,E=v.proFieldProps,w=v.max,T=(0,j.Z)(v,L);return(0,R.jsx)(N.Z,(0,B.Z)({valueType:"digit",fieldProps:(0,B.Z)({min:_,max:w},d),ref:g,filedConfig:{defaultProps:{width:"100%"}},proFieldProps:E},T))};U.Z=A.forwardRef(y)},64317:function(or,U,z){"use strict";var B=z(28991),j=z(81253),R=z(85893),A=z(22270),N=z(67294),L=z(66758),y=z(31649),x=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],v=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],g=N.forwardRef(function(T,k){var b=T.fieldProps,m=T.children,$=T.params,W=T.proFieldProps,X=T.mode,H=T.valueEnum,Q=T.request,q=T.showSearch,J=T.options,te=(0,j.Z)(T,x),fe=(0,N.useContext)(L.Z);return(0,R.jsx)(y.Z,(0,B.Z)((0,B.Z)({valueEnum:(0,A.h)(H),request:Q,params:$,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,B.Z)({options:J,mode:X,showSearch:q,getPopupContainer:fe.getPopupContainer},b),ref:k,proFieldProps:W},te),{},{children:m}))}),d=N.forwardRef(function(T,k){var b=T.fieldProps,m=T.children,$=T.params,W=T.proFieldProps,X=T.mode,H=T.valueEnum,Q=T.request,q=T.options,J=(0,j.Z)(T,v),te=(0,B.Z)({options:q,mode:X||"multiple",labelInValue:!0,showSearch:!0,showArrow:!1,autoClearSearchValue:!0,optionLabelProp:"label"},b),fe=(0,N.useContext)(L.Z);return(0,R.jsx)(y.Z,(0,B.Z)((0,B.Z)({valueEnum:(0,A.h)(H),request:Q,params:$,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,B.Z)({getPopupContainer:fe.getPopupContainer},te),ref:k,proFieldProps:W},J),{},{children:m}))}),_=g,E=d,w=_;w.SearchSelect=E,w.displayName="ProFormComponent",U.Z=w},5966:function(or,U,z){"use strict";var B=z(28991),j=z(81253),R=z(85893),A=z(31649),N=["fieldProps","proFieldProps"],L=["fieldProps","proFieldProps"],y="text",x=function(_){var E=_.fieldProps,w=_.proFieldProps,T=(0,j.Z)(_,N);return(0,R.jsx)(A.Z,(0,B.Z)({valueType:y,fieldProps:E,filedConfig:{valueType:y},proFieldProps:w},T))},v=function(_){var E=_.fieldProps,w=_.proFieldProps,T=(0,j.Z)(_,L);return(0,R.jsx)(A.Z,(0,B.Z)({valueType:"password",fieldProps:E,proFieldProps:w,filedConfig:{valueType:y}},T))},g=x;g.Password=v,g.displayName="ProFormComponent",U.Z=g},62238:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var z=function(R,A){var N=R.nodes,L=R.edges,y=[],x={};if(!N)throw new Error("invalid nodes data!");return N&&N.forEach(function(v,g){x[v.id]=g;var d=[];y.push(d)}),L&&L.forEach(function(v){var g=v.source,d=v.target,_=x[g],E=x[d];!_&&_!==0||!E&&E!==0||(y[_][E]=1,A||(y[E][_]=1))}),y},B=z;U.default=B},10369:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),Object.defineProperty(U,"GADDIAsync",{enumerable:!0,get:function(){return B.GADDIAsync}}),Object.defineProperty(U,"connectedComponentAsync",{enumerable:!0,get:function(){return B.connectedComponentAsync}}),U.default=void 0,Object.defineProperty(U,"detectAllCyclesAsync",{enumerable:!0,get:function(){return B.detectAllCyclesAsync}}),Object.defineProperty(U,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return B.detectAllDirectedCycleAsync}}),Object.defineProperty(U,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return B.detectAllUndirectedCycleAsync}}),Object.defineProperty(U,"detectCycleAsync",{enumerable:!0,get:function(){return B.detectCycleAsync}}),U.detectDirectedCycleAsync=void 0,Object.defineProperty(U,"dijkstraAsync",{enumerable:!0,get:function(){return B.dijkstraAsync}}),Object.defineProperty(U,"findAllPathAsync",{enumerable:!0,get:function(){return B.findAllPathAsync}}),Object.defineProperty(U,"findShortestPathAsync",{enumerable:!0,get:function(){return B.findShortestPathAsync}}),Object.defineProperty(U,"floydWarshallAsync",{enumerable:!0,get:function(){return B.floydWarshallAsync}}),Object.defineProperty(U,"getAdjMatrixAsync",{enumerable:!0,get:function(){return B.getAdjMatrixAsync}}),Object.defineProperty(U,"getDegreeAsync",{enumerable:!0,get:function(){return B.getDegreeAsync}}),Object.defineProperty(U,"getInDegreeAsync",{enumerable:!0,get:function(){return B.getInDegreeAsync}}),Object.defineProperty(U,"getNeighborsAsync",{enumerable:!0,get:function(){return B.getNeighborsAsync}}),Object.defineProperty(U,"getOutDegreeAsync",{enumerable:!0,get:function(){return B.getOutDegreeAsync}}),Object.defineProperty(U,"labelPropagationAsync",{enumerable:!0,get:function(){return B.labelPropagationAsync}}),Object.defineProperty(U,"louvainAsync",{enumerable:!0,get:function(){return B.louvainAsync}}),Object.defineProperty(U,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return B.minimumSpanningTreeAsync}}),Object.defineProperty(U,"pageRankAsync",{enumerable:!0,get:function(){return B.pageRankAsync}});var B=z(30485),j=B.detectCycleAsync;U.detectDirectedCycleAsync=j;var R={getAdjMatrixAsync:B.getAdjMatrixAsync,connectedComponentAsync:B.connectedComponentAsync,getDegreeAsync:B.getDegreeAsync,getInDegreeAsync:B.getInDegreeAsync,getOutDegreeAsync:B.getOutDegreeAsync,detectCycleAsync:B.detectCycleAsync,detectDirectedCycleAsync:j,detectAllCyclesAsync:B.detectAllCyclesAsync,detectAllDirectedCycleAsync:B.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:B.detectAllUndirectedCycleAsync,dijkstraAsync:B.dijkstraAsync,findAllPathAsync:B.findAllPathAsync,findShortestPathAsync:B.findShortestPathAsync,floydWarshallAsync:B.floydWarshallAsync,labelPropagationAsync:B.labelPropagationAsync,louvainAsync:B.louvainAsync,minimumSpanningTreeAsync:B.minimumSpanningTreeAsync,pageRankAsync:B.pageRankAsync,getNeighborsAsync:B.getNeighborsAsync,GADDIAsync:B.GADDIAsync};U.default=R},83764:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=R(z(93026)),j=z(70643);function R(y){return y&&y.__esModule?y:{default:y}}function A(y){y===void 0&&(y={});var x=y,v=function(){},g=function(){var d={};return function(_){var E=_.next,w=E;return d[w]?!1:(d[w]=!0,!0)}}();return x.allowTraversal=y.allowTraversal||g,x.enter=y.enter||v,x.leave=y.leave||v,x}var N=function(x,v,g,d){d===void 0&&(d=!0);var _=A(g),E=new B.default,w=x.edges,T=w===void 0?[]:w;E.enqueue(v);for(var k="",b=function(){var $=E.dequeue();_.enter({current:$,previous:k}),(0,j.getNeighbors)($,T,d?"target":void 0).forEach(function(W){_.allowTraversal({previous:k,current:$,next:W})&&E.enqueue(W)}),_.leave({current:$,previous:k}),k=$};!E.isEmpty();)b()},L=N;U.default=L},59527:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=A,U.detectStrongConnectComponents=U.detectConnectedComponents=void 0;var B=z(70643),j=function(L){for(var y=L.nodes,x=y===void 0?[]:y,v=L.edges,g=v===void 0?[]:v,d=[],_={},E=[],w=function m($){E.push($),_[$.id]=!0;for(var W=(0,B.getNeighbors)($.id,g),X=function(q){var J=W[q];if(!_[J]){var te=x.filter(function(fe){return fe.id===J});te.length>0&&m(te[0])}},H=0;H<W.length;++H)X(H)},T=0;T<x.length;T++){var k=x[T];if(!_[k.id]){w(k);for(var b=[];E.length>0;)b.push(E.pop());d.push(b)}}return d};U.detectConnectedComponents=j;var R=function(L){for(var y=L.nodes,x=y===void 0?[]:y,v=L.edges,g=v===void 0?[]:v,d=[],_={},E={},w={},T=[],k=0,b=function X(H){E[H.id]=k,w[H.id]=k,k+=1,d.push(H),_[H.id]=!0;for(var Q=(0,B.getNeighbors)(H.id,g,"target").filter(function(de){return x.map(function(Te){return Te.id}).indexOf(de)>-1}),q=function(Te){var Se=Q[Te];if(!E[Se]&&E[Se]!==0){var Ie=x.filter(function(be){return be.id===Se});Ie.length>0&&X(Ie[0]),w[H.id]=Math.min(w[H.id],w[Se])}else _[Se]&&(w[H.id]=Math.min(w[H.id],E[Se]))},J=0;J<Q.length;J++)q(J);if(w[H.id]===E[H.id]){for(var te=[];d.length>0;){var fe=d.pop();if(_[fe.id]=!1,te.push(fe),fe===H)break}te.length>0&&T.push(te)}},m=0,$=x;m<$.length;m++){var W=$[m];!E[W.id]&&E[W.id]!==0&&b(W)}return T};U.detectStrongConnectComponents=R;function A(N,L){return L?R(N):j(N)}},92935:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.secondReg=U.dateReg=void 0;var z=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;U.secondReg=z;var B=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;U.dateReg=B},82556:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.getOutDegree=U.getInDegree=U.default=void 0;var z=function(N){var L={},y=N.nodes,x=y===void 0?[]:y,v=N.edges,g=v===void 0?[]:v;return x.forEach(function(d){L[d.id]={degree:0,inDegree:0,outDegree:0}}),g.forEach(function(d){L[d.source].degree++,L[d.source].outDegree++,L[d.target].degree++,L[d.target].inDegree++}),L},B=z;U.default=B;var j=function(N,L){var y=z(N);return y[L]?z(N)[L].inDegree:0};U.getInDegree=j;var R=function(N,L){var y=z(N);return y[L]?z(N)[L].outDegree:0};U.getOutDegree=R},94282:function(or,U,z){"use strict";function B(E){return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},B(E)}Object.defineProperty(U,"__esModule",{value:!0}),U.detectAllUndirectedCycle=U.detectAllDirectedCycle=U.detectAllCycles=U.default=void 0;var j=y(z(45891)),R=L(z(59527)),A=z(70643);function N(E){if(typeof WeakMap!="function")return null;var w=new WeakMap,T=new WeakMap;return(N=function(b){return b?T:w})(E)}function L(E,w){if(!w&&E&&E.__esModule)return E;if(E===null||B(E)!=="object"&&typeof E!="function")return{default:E};var T=N(w);if(T&&T.has(E))return T.get(E);var k={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in E)if(m!=="default"&&Object.prototype.hasOwnProperty.call(E,m)){var $=b?Object.getOwnPropertyDescriptor(E,m):null;$&&($.get||$.set)?Object.defineProperty(k,m,$):k[m]=E[m]}return k.default=E,T&&T.set(E,k),k}function y(E){return E&&E.__esModule?E:{default:E}}var x=function(w){var T=null,k=w.nodes,b=k===void 0?[]:k,m={},$={},W={},X={};b.forEach(function(q){$[q.id]=q});for(var H={enter:function(J){var te=J.current,fe=J.previous;if(W[te]){T={};for(var de=te,Te=fe;Te!==te;)T[de]=Te,de=Te,Te=m[Te];T[de]=Te}else W[te]=te,delete $[te],m[te]=fe},leave:function(J){var te=J.current;X[te]=te,delete W[te]},allowTraversal:function(J){var te=J.next;return T?!1:!X[te]}};Object.keys($).length;){var Q=Object.keys($)[0];(0,j.default)(w,Q,H)}return T},v=function(w,T,k){var b,m;k===void 0&&(k=!0);for(var $=[],W=(0,R.default)(w,!1),X=0,H=W;X<H.length;X++){var Q=H[X];if(!!Q.length)for(var q=Q[0],J=q.id,te=[q],fe=(b={},b[J]=q,b),de=(m={},m[J]=new Set,m);te.length>0;)for(var Te=te.pop(),Se=Te.id,Ie=(0,A.getNeighbors)(Se,w.edges),be=function(De){var Ue,nt=Ie[De],Ze=w.nodes.find(function(St){return St.id===nt});if(nt===Se)$.push((Ue={},Ue[nt]=Te,Ue));else if(!(nt in de))fe[nt]=Te,te.push(Ze),de[nt]=new Set([Te]);else if(!de[Se].has(Ze)){for(var ht=!0,Rt=[Ze,Te],tr=fe[Se];de[nt].size&&!de[nt].has(tr)&&(Rt.push(tr),tr!==fe[tr.id]);)tr=fe[tr.id];if(Rt.push(tr),T&&k?(ht=!1,Rt.findIndex(function(St){return T.indexOf(St.id)>-1})>-1&&(ht=!0)):T&&!k&&Rt.findIndex(function(St){return T.indexOf(St.id)>-1})>-1&&(ht=!1),ht){for(var Qe={},lt=1;lt<Rt.length;lt+=1)Qe[Rt[lt-1].id]=Rt[lt];Rt.length&&(Qe[Rt[Rt.length-1].id]=Rt[0]),$.push(Qe)}de[nt].add(Te)}},pe=0;pe<Ie.length;pe+=1)be(pe)}return $};U.detectAllUndirectedCycle=v;var g=function(w,T,k){k===void 0&&(k=!0);for(var b=[],m=new Set,$=[],W=[],X={},H={},Q=function(tr){for(var Qe=[tr];Qe.length>0;){var lt=Qe.pop();m.has(lt)&&(m.delete(lt),$[lt.id].forEach(function(St){Qe.push(St)}),$[lt.id].clear())}},q=function Rt(tr,Qe,lt){var St=!1;if(T&&k===!1&&T.indexOf(tr.id)>-1)return St;b.push(tr),m.add(tr);for(var Ct=lt[tr.id],_t=0;_t<Ct.length;_t+=1){var pt=X[Ct[_t]];if(pt===Qe){for(var rr={},xr=1;xr<b.length;xr+=1)rr[b[xr-1].id]=b[xr];b.length&&(rr[b[b.length-1].id]=b[0]),W.push(rr),St=!0}else m.has(pt)||Rt(pt,Qe,lt)&&(St=!0)}if(St)Q(tr);else for(var _t=0;_t<Ct.length;_t+=1){var pt=X[Ct[_t]];$[pt.id].has(tr)||$[pt.id].add(tr)}return b.pop(),St},J=w.nodes,te=J===void 0?[]:J,fe=0;fe<te.length;fe+=1){var de=te[fe],Te=de.id;H[Te]=fe,X[fe]=de}if(T&&k)for(var Se=function(tr){var Qe=T[tr];H[te[tr].id]=H[Qe],H[Qe]=0,X[0]=te.find(function(lt){return lt.id===Qe}),X[H[te[tr].id]]=te[tr]},fe=0;fe<T.length;fe++)Se(fe);for(var Ie=function(tr){for(var Qe,lt,St=Infinity,Ct=0;Ct<tr.length;Ct+=1)for(var _t=tr[Ct],pt=0;pt<_t.length;pt++){var rr=H[_t[pt].id];rr<St&&(St=rr,lt=Ct)}for(var xr=tr[lt],Vt=[],Ct=0;Ct<xr.length;Ct+=1){var ft=xr[Ct];Vt[ft.id]=[];for(var Bt=0,qt=(0,A.getNeighbors)(ft.id,w.edges,"target").filter(function(Ae){return xr.map(function(Hr){return Hr.id}).indexOf(Ae)>-1});Bt<qt.length;Bt++){var br=qt[Bt];br===ft.id&&!(k===!1&&T.indexOf(ft.id)>-1)?W.push((Qe={},Qe[ft.id]=ft,Qe)):Vt[ft.id].push(H[br])}}return{component:xr,adjList:Vt,minIdx:St}},be=0;be<te.length;){var pe=te.filter(function(Rt){return H[Rt.id]>=be}),Me=(0,R.detectStrongConnectComponents)({nodes:pe,edges:w.edges}).filter(function(Rt){return Rt.length>1});if(Me.length===0)break;var De=Ie(Me),Ue=De.minIdx,nt=De.adjList,Ze=De.component;if(Ze.length>1){Ze.forEach(function(Rt){$[Rt.id]=new Set});var ht=X[Ue];if(T&&k&&T.indexOf(ht.id)===-1)return W;q(ht,ht,nt),be=Ue+1}else break}return W};U.detectAllDirectedCycle=g;var d=function(w,T,k,b){return b===void 0&&(b=!0),T?g(w,k,b):v(w,k,b)};U.detectAllCycles=d;var _=x;U.default=_},45891:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=A;var B=z(70643);function j(N){N===void 0&&(N={});var L=N,y=function(){},x=function(){var v={};return function(g){var d=g.next;return v[d]?!1:(v[d]=!0,!0)}}();return L.allowTraversal=N.allowTraversal||x,L.enter=N.enter||y,L.leave=N.leave||y,L}function R(N,L,y,x){x.enter({current:L,previous:y});var v=N.edges,g=v===void 0?[]:v;(0,B.getNeighbors)(L,g,"target").forEach(function(d){x.allowTraversal({previous:y,current:L,next:d})&&R(N,d,L,x)}),x.leave({current:L,previous:y})}function A(N,L,y){R(N,L,"",j(y))}},78089:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=z(70655),j=z(49242),R=z(70643),A=function(v,g,d){for(var _=Infinity,E,w=0;w<g.length;w++){var T=g[w].id;!d[T]&&v[T]<=_&&(_=v[T],E=g[w])}return E},N=function(v,g,d,_){var E=v.nodes,w=E===void 0?[]:E,T=v.edges,k=T===void 0?[]:T,b=[],m={},$={},W={};w.forEach(function(fe,de){var Te=fe.id;b.push(Te),$[Te]=Infinity,Te===g&&($[Te]=0)});for(var X=w.length,H=function(de){var Te=A($,w,m),Se=Te.id;if(m[Se]=!0,$[Se]===Infinity)return"continue";var Ie=[];d?Ie=(0,R.getOutEdgesNodeId)(Se,k):Ie=(0,R.getEdgesByNodeId)(Se,k),Ie.forEach(function(be){var pe=be.target,Me=be.source,De=pe===Se?Me:pe,Ue=_&&be[_]?be[_]:1;$[De]>$[Te.id]+Ue?($[De]=$[Te.id]+Ue,W[De]=[Te.id]):$[De]===$[Te.id]+Ue&&W[De].push(Te.id)})},Q=0;Q<X;Q++)H(Q);W[g]=[g];var q={};for(var J in $)$[J]!==Infinity&&y(g,J,W,q);var te={};for(var J in q)te[J]=q[J][0];return{length:$,path:te,allPath:q}},L=N;U.default=L;function y(x,v,g,d){if(x===v)return[x];if(d[v])return d[v];for(var _=[],E=0,w=g[v];E<w.length;E++){var T=w[E],k=y(x,T,g,d);if(!k)return;for(var b=0,m=k;b<m.length;b++){var $=m[b];(0,j.isArray)($)?_.push((0,B.__spreadArray)((0,B.__spreadArray)([],$,!0),[v],!1)):_.push([$,v])}}return d[v]=_,d[v]}},41727:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.findShortestPath=U.findAllPath=void 0;var B=R(z(78089)),j=z(70643);function R(L){return L&&L.__esModule?L:{default:L}}var A=function(y,x,v,g,d){var _=(0,B.default)(y,x,g,d),E=_.length,w=_.path,T=_.allPath;return{length:E[v],path:w[v],allPath:T[v]}};U.findShortestPath=A;var N=function(y,x,v,g){var d;if(x===v)return[[x]];var _=y.edges,E=_===void 0?[]:_,w=[x],T=(d={},d[x]=!0,d),k=[],b=[],m=g?(0,j.getNeighbors)(x,E,"target"):(0,j.getNeighbors)(x,E);for(k.push(m);w.length>0&&k.length>0;){var $=k[k.length-1];if($.length){var W=$.shift();W&&(w.push(W),T[W]=!0,m=g?(0,j.getNeighbors)(W,E,"target"):(0,j.getNeighbors)(W,E),k.push(m.filter(function(Q){return!T[Q]})))}else{var X=w.pop();T[X]=!1,k.pop();continue}if(w[w.length-1]===v){var H=w.map(function(q){return q});b.push(H);var X=w.pop();T[X]=!1,k.pop()}}return b};U.findAllPath=N},75033:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=j(z(62238));function j(N){return N&&N.__esModule?N:{default:N}}var R=function(L,y){for(var x=(0,B.default)(L,y),v=[],g=x.length,d=0;d<g;d+=1){v[d]=[];for(var _=0;_<g;_+=1)d===_?v[d][_]=0:x[d][_]===0||!x[d][_]?v[d][_]=Infinity:v[d][_]=x[d][_]}for(var E=0;E<g;E+=1)for(var d=0;d<g;d+=1)for(var _=0;_<g;_+=1)v[d][_]>v[d][E]+v[E][_]&&(v[d][_]=v[d][E]+v[E][_]);return v},A=R;U.default=A},21146:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=z(49242),j=z(68575),R=function(){function _(E,w,T,k,b){this.fromNode=E,this.toNode=w,this.nodeEdgeNodeLabel={nodeLabel1:T||j.VACANT_NODE_LABEL,edgeLabel:k||j.VACANT_EDGE_LABEL,nodeLabel2:b||j.VACANT_NODE_LABEL}}return _.prototype.equalTo=function(E){return this.fromNode===E.formNode&&this.toNode===E.toNode&&this.nodeEdgeNodeLabel===E.nodeEdgeNodeLabel},_.prototype.notEqualTo=function(E){return!this.equalTo(E)},_}(),A=function(){function _(){this.rmpath=[],this.dfsEdgeList=[]}return _.prototype.equalTo=function(E){var w=this.dfsEdgeList.length,T=E.length;if(w!==T)return!1;for(var k=0;k<w;k++)if(this.dfsEdgeList[k]!==E[k])return!1;return!0},_.prototype.notEqualTo=function(E){return!this.equalTo(E)},_.prototype.pushBack=function(E,w,T,k,b){return this.dfsEdgeList.push(new R(E,w,T,k,b)),this.dfsEdgeList},_.prototype.toGraph=function(E,w){E===void 0&&(E=j.VACANT_GRAPH_ID),w===void 0&&(w=!1);var T=new j.Graph(E,!0,w);return this.dfsEdgeList.forEach(function(k){var b=k.fromNode,m=k.toNode,$=k.nodeEdgeNodeLabel,W=$.nodeLabel1,X=$.edgeLabel,H=$.nodeLabel2;W!==j.VACANT_NODE_LABEL&&T.addNode(b,W),H!==j.VACANT_NODE_LABEL&&T.addNode(m,H),W!==j.VACANT_NODE_LABEL&&H!==W&&T.addEdge(void 0,b,m,X)}),T},_.prototype.buildRmpath=function(){this.rmpath=[];for(var E=void 0,w=this.dfsEdgeList.length,T=w-1;T>=0;T--){var k=this.dfsEdgeList[T],b=k.fromNode,m=k.toNode;b<m&&(E===void 0||m===E)&&(this.rmpath.push(T),E=b)}return this.rmpath},_.prototype.getNodeNum=function(){var E={};return this.dfsEdgeList.forEach(function(w){E[w.fromNode]||(E[w.fromNode]=!0),E[w.toNode]||(E[w.toNode]=!0)}),Object.keys(E).length},_}(),N=function(){function _(E){if(this.his={},this.nodesUsed={},this.edgesUsed={},this.edges=[],!!E){for(;E;){var w=E.edge;this.edges.push(w),this.nodesUsed[w.from]=1,this.nodesUsed[w.to]=1,this.edgesUsed[w.id]=1,E=E.preNode}this.edges=this.edges.reverse()}}return _.prototype.hasNode=function(E){return this.nodesUsed[E.id]===1},_.prototype.hasEdge=function(E){return this.edgesUsed[E.id]===1},_}(),L=function(){function _(E){var w=E.graphs,T=E.minSupport,k=T===void 0?2:T,b=E.minNodeNum,m=b===void 0?1:b,$=E.maxNodeNum,W=$===void 0?4:$,X=E.top,H=X===void 0?10:X,Q=E.directed,q=Q===void 0?!1:Q,J=E.verbose,te=J===void 0?!1:J;this.graphs=w,this.dfsCode=new A,this.support=0,this.frequentSize1Subgraphs=[],this.frequentSubgraphs=[],this.minSupport=k,this.top=H,this.directed=q,this.counter=0,this.maxNodeNum=W,this.minNodeNum=m,this.verbose=te,this.maxNodeNum<this.minNodeNum&&(this.maxNodeNum=this.minNodeNum),this.reportDF=[]}return _.prototype.findForwardRootEdges=function(E,w){var T=this,k=[],b=E.nodeMap;return w.edges.forEach(function(m){(T.directed||w.label<=b[m.to].label)&&k.push(m)}),k},_.prototype.findBackwardEdge=function(E,w,T,k){if(!this.directed&&w===T)return null;for(var b=E.nodeMap,m=b[T.to],$=m.edges,W=$.length,X=0;X<W;X++){var H=$[X];if(!(k.hasEdge(H)||H.to!==w.from)){if(this.directed){if(b[w.from].label<b[T.to].label||b[w.from].label===b[T.to].label&&w.label<=H.label)return H}else if(w.label<H.label||w.label===H.label&&b[w.to].label<=b[T.to].label)return H}}return null},_.prototype.findForwardPureEdges=function(E,w,T,k){for(var b=[],m=w.to,$=E.nodeMap[m].edges,W=$.length,X=0;X<W;X++){var H=$[X],Q=E.nodeMap[H.to];T<=Q.label&&!k.hasNode(Q)&&b.push(H)}return b},_.prototype.findForwardRmpathEdges=function(E,w,T,k){for(var b=[],m=E.nodeMap,$=m[w.to].label,W=m[w.from],X=W.edges,H=X.length,Q=0;Q<H;Q++){var q=X[Q],J=m[q.to].label;w.to===q.to||T>J||k.hasNode(m[q.to])||(w.label<q.label||w.label===q.label&&$<=J)&&b.push(q)}return b},_.prototype.getSupport=function(E){var w={};return E.forEach(function(T){w[T.graphId]||(w[T.graphId]=!0)}),Object.keys(w).length},_.prototype.findMinLabel=function(E){var w=void 0;return Object.keys(E).forEach(function(T){var k=E[T],b=k.nodeLabel1,m=k.edgeLabel,$=k.nodeLabel2;if(!w){w={nodeLabel1:b,edgeLabel:m,nodeLabel2:$};return}(b<w.nodeLabel1||b===w.nodeLabel1&&m<w.edgeLabel||b===w.nodeLabel1&&m===w.edgeLabel&&$<w.nodeLabel2)&&(w={nodeLabel1:b,edgeLabel:m,nodeLabel2:$})}),w},_.prototype.isMin=function(){var E=this,w=this.dfsCode;if(this.verbose&&console.log("isMin checking",w),w.dfsEdgeList.length===1)return!0;var T=this.directed,k=w.toGraph(j.VACANT_GRAPH_ID,T),b=k.nodeMap,m=new A,$={};k.nodes.forEach(function(Q){var q=E.findForwardRootEdges(k,Q);q.forEach(function(J){var te=b[J.to],fe="".concat(Q.label,"-").concat(J.label,"-").concat(te.label);$[fe]||($[fe]={projected:[],nodeLabel1:Q.label,edgeLabel:J.label,nodeLabel2:te.label});var de={graphId:k.id,edge:J,preNode:null};$[fe].projected.push(de)})});var W=this.findMinLabel($);if(!!W){m.dfsEdgeList.push(new R(0,1,W.nodeLabel1,W.edgeLabel,W.nodeLabel2));var X=function Q(q){for(var J=m.buildRmpath(),te=m.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,fe=m.dfsEdgeList[J[0]].toNode,de={},Te=!1,Se=0,Ie=T?-1:0,be=function(Ct){if(Te)return"break";q.forEach(function(_t){var pt=new N(_t),rr=E.findBackwardEdge(k,pt.edges[J[Ct]],pt.edges[J[0]],pt);rr&&(de[rr.label]||(de[rr.label]={projected:[],edgeLabel:rr.label}),de[rr.label].projected.push({graphId:k.id,edge:de,preNode:_t}),Se=m.dfsEdgeList[J[Ct]].fromNode,Te=!0)})},pe=J.length-1;pe>Ie;pe--){var Me=be(pe);if(Me==="break")break}if(Te){var De=E.findMinLabel(de);m.dfsEdgeList.push(new R(fe,Se,j.VACANT_NODE_LABEL,De.edgeLabel,j.VACANT_NODE_LABEL));var Ue=m.dfsEdgeList.length-1;return E.dfsCode.dfsEdgeList[Ue]!==m.dfsEdgeList[Ue]?!1:Q(de[De.edgeLabel].projected)}var nt={};Te=!1;var Ze=0;q.forEach(function(St){var Ct=new N(St),_t=E.findForwardPureEdges(k,Ct.edges[J[0]],te,Ct);_t.length>0&&(Te=!0,Ze=fe,_t.forEach(function(pt){var rr="".concat(pt.label,"-").concat(b[pt.to].label);nt[rr]||(nt[rr]={projected:[],edgeLabel:pt.label,nodeLabel2:b[pt.to].label}),nt[rr].projected.push({graphId:k.id,edge:pt,preNode:St})}))});for(var ht=J.length,Rt=function(Ct){if(Te)return"break";var _t=J[Ct];q.forEach(function(pt){var rr=new N(pt),xr=E.findForwardRmpathEdges(k,rr.edges[_t],te,rr);xr.length>0&&(Te=!0,Ze=m.dfsEdgeList[_t].fromNode,xr.forEach(function(Vt){var ft="".concat(Vt.label,"-").concat(b[Vt.to].label);nt[ft]||(nt[ft]={projected:[],edgeLabel:Vt.label,nodeLabel2:b[Vt.to].label}),nt[ft].projected.push({graphId:k.id,edge:Vt,preNode:pt})}))})},pe=0;pe<ht;pe++){var tr=Rt(pe);if(tr==="break")break}if(!Te)return!0;var Qe=E.findMinLabel(nt);m.dfsEdgeList.push(new R(Ze,fe+1,j.VACANT_NODE_LABEL,Qe.edgeLabel,Qe.nodeLabel2));var lt=m.dfsEdgeList.length-1;return w.dfsEdgeList[lt]!==m.dfsEdgeList[lt]?!1:Q(nt["".concat(Qe.edgeLabel,"-").concat(Qe.nodeLabel2)].projected)},H="".concat(W.nodeLabel1,"-").concat(W.edgeLabel,"-").concat(W.nodeLabel2);return X($[H].projected)}},_.prototype.report=function(){if(!(this.dfsCode.getNodeNum()<this.minNodeNum)){this.counter++;var E=this.dfsCode.toGraph(this.counter,this.directed);this.frequentSubgraphs.push((0,B.clone)(E))}},_.prototype.subGraphMining=function(E){var w=this,T=this.getSupport(E);if(!(T<this.minSupport)&&!!this.isMin()){this.report();var k=this.dfsCode.getNodeNum(),b=this.dfsCode.buildRmpath(),m=this.dfsCode.dfsEdgeList[b[0]].toNode,$=this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1,W={},X={};E.forEach(function(H){for(var Q=w.graphs[H.graphId],q=Q.nodeMap,J=new N(H),te=b.length-1;te>=0;te--){var fe=w.findBackwardEdge(Q,J.edges[b[te]],J.edges[b[0]],J);if(fe){var de="".concat(w.dfsCode.dfsEdgeList[b[te]].fromNode,"-").concat(fe.label);X[de]||(X[de]={projected:[],toNodeId:w.dfsCode.dfsEdgeList[b[te]].fromNode,edgeLabel:fe.label}),X[de].projected.push({graphId:H.graphId,edge:fe,preNode:H})}}if(!(k>=w.maxNodeNum)){var Te=w.findForwardPureEdges(Q,J.edges[b[0]],$,J);Te.forEach(function(Ie){var be="".concat(m,"-").concat(Ie.label,"-").concat(q[Ie.to].label);W[be]||(W[be]={projected:[],fromNodeId:m,edgeLabel:Ie.label,nodeLabel2:q[Ie.to].label}),W[be].projected.push({graphId:H.graphId,edge:Ie,preNode:H})});for(var Se=function(be){var pe=w.findForwardRmpathEdges(Q,J.edges[b[be]],$,J);pe.forEach(function(Me){var De="".concat(w.dfsCode.dfsEdgeList[b[be]].fromNode,"-").concat(Me.label,"-").concat(q[Me.to].label);W[De]||(W[De]={projected:[],fromNodeId:w.dfsCode.dfsEdgeList[b[be]].fromNode,edgeLabel:Me.label,nodeLabel2:q[Me.to].label}),W[De].projected.push({graphId:H.graphId,edge:Me,preNode:H})})},te=0;te<b.length;te++)Se(te)}}),Object.keys(X).forEach(function(H){var Q=X[H],q=Q.toNodeId,J=Q.edgeLabel;w.dfsCode.dfsEdgeList.push(new R(m,q,"-1",J,"-1")),w.subGraphMining(X[H].projected),w.dfsCode.dfsEdgeList.pop()}),Object.keys(W).forEach(function(H){var Q=W[H],q=Q.fromNodeId,J=Q.edgeLabel,te=Q.nodeLabel2;w.dfsCode.dfsEdgeList.push(new R(q,m+1,j.VACANT_NODE_LABEL,J,te)),w.subGraphMining(W[H].projected),w.dfsCode.dfsEdgeList.pop()})}},_.prototype.generate1EdgeFrequentSubGraphs=function(){var E=this.graphs,w=this.directed,T=this.minSupport,k=this.frequentSize1Subgraphs,b={},m={},$={},W={};return Object.keys(E).forEach(function(X){var H=E[X],Q=H.nodeMap;H.nodes.forEach(function(q,J){var te=q.label,fe="".concat(X,"-").concat(te);if(!$[fe]){var de=b[te]||0;de++,b[te]=de}$[fe]={graphKey:X,label:te},q.edges.forEach(function(Te){var Se=te,Ie=Q[Te.to].label;if(!w&&Se>Ie){var be=Ie;Ie=Se,Se=be}var pe=Te.label,Me="".concat(X,"-").concat(Se,"-").concat(pe,"-").concat(Ie),De="".concat(Se,"-").concat(pe,"-").concat(Ie);if(!m[De]){var Ue=m[De]||0;Ue++,m[De]=Ue}W[Me]={graphId:X,nodeLabel1:Se,edgeLabel:pe,nodeLabel2:Ie}})})}),Object.keys(b).forEach(function(X){var H=b[X];if(!(H<T)){var Q={nodes:[],edges:[]};Q.nodes.push({id:"0",label:X}),k.push(Q)}}),k},_.prototype.run=function(){var E=this;if(this.frequentSize1Subgraphs=this.generate1EdgeFrequentSubGraphs(),!(this.maxNodeNum<2)){var w=this.graphs,T=this.directed,k={};Object.keys(w).forEach(function(b){var m=w[b],$=m.nodeMap;m.nodes.forEach(function(W){var X=E.findForwardRootEdges(m,W);X.forEach(function(H){var Q=$[H.to],q="".concat(W.label,"-").concat(H.label,"-").concat(Q.label);k[q]||(k[q]={projected:[],nodeLabel1:W.label,edgeLabel:H.label,nodeLabel2:Q.label});var J={graphId:b,edge:H,preNode:null};k[q].projected.push(J)})})}),Object.keys(k).forEach(function(b){var m=k[b],$=m.projected,W=m.nodeLabel1,X=m.edgeLabel,H=m.nodeLabel2;E.dfsCode.dfsEdgeList.push(new R(0,1,W,X,H)),E.subGraphMining($),E.dfsCode.dfsEdgeList.pop()})}},_}(),y=function(E,w,T,k){var b={};return Object.keys(E).forEach(function(m,$){var W=E[m],X=new j.Graph($,!0,w),H={};W.nodes.forEach(function(Q,q){X.addNode(q,Q[T]),H[Q.id]=q}),W.edges.forEach(function(Q,q){var J=H[Q.source],te=H[Q.target];X.addEdge(-1,J,te,Q[k])}),X&&X.getNodeNum()&&(b[X.id]=X)}),b},x=function(E,w,T){var k=[];return E.forEach(function(b){var m={nodes:[],edges:[]};b.nodes.forEach(function($){var W;m.nodes.push((W={id:"".concat($.id)},W[w]=$.label,W))}),b.edges.forEach(function($){var W;m.edges.push((W={source:"".concat($.from),target:"".concat($.to)},W[T]=$.label,W))}),k.push(m)}),k},v="cluster",g=function(E){var w=E.graphs,T=E.directed,k=T===void 0?!1:T,b=E.nodeLabelProp,m=b===void 0?v:b,$=E.edgeLabelProp,W=$===void 0?v:$,X=y(w,k,m,W),H=E.minSupport,Q=E.maxNodeNum,q=E.minNodeNum,J=E.verbose,te=E.top,fe={graphs:X,minSupport:H,maxNodeNum:Q,minNodeNum:q,top:te,verbose:J,directed:k},de=new L(fe);de.run();var Te=x(de.frequentSubgraphs,m,W);return Te},d=g;U.default=d},68575:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.VACANT_NODE_LABEL=U.VACANT_NODE_ID=U.VACANT_GRAPH_ID=U.VACANT_EDGE_LABEL=U.VACANT_EDGE_ID=U.Node=U.Graph=U.Edge=U.AUTO_EDGE_ID=void 0;var z=-1;U.VACANT_EDGE_ID=z;var B=-1;U.VACANT_NODE_ID=B;var j="-1";U.VACANT_EDGE_LABEL=j;var R="-1";U.VACANT_NODE_LABEL=R;var A=-1;U.VACANT_GRAPH_ID=A;var N="-1";U.AUTO_EDGE_ID=N;var L=function(){function v(g,d,_,E){g===void 0&&(g=z),d===void 0&&(d=B),_===void 0&&(_=B),E===void 0&&(E=j),this.id=g,this.from=d,this.to=_,this.label=E}return v}();U.Edge=L;var y=function(){function v(g,d){g===void 0&&(g=B),d===void 0&&(d=R),this.id=g,this.label=d,this.edges=[],this.edgeMap={}}return v.prototype.addEdge=function(g){this.edges.push(g),this.edgeMap[g.id]=g},v}();U.Node=y;var x=function(){function v(g,d,_){g===void 0&&(g=B),d===void 0&&(d=!0),_===void 0&&(_=!1),this.id=g,this.edgeIdAutoIncrease=d,this.edges=[],this.nodes=[],this.nodeMap={},this.edgeMap={},this.nodeLabelMap={},this.edgeLabelMap={},this.counter=0,this.directed=_}return v.prototype.getNodeNum=function(){return this.nodes.length},v.prototype.addNode=function(g,d){if(!this.nodeMap[g]){var _=new y(g,d);this.nodes.push(_),this.nodeMap[g]=_,this.nodeLabelMap[d]||(this.nodeLabelMap[d]=[]),this.nodeLabelMap[d].push(g)}},v.prototype.addEdge=function(g,d,_,E){if((this.edgeIdAutoIncrease||g===void 0)&&(g=this.counter++),!(this.nodeMap[d]&&this.nodeMap[_]&&this.nodeMap[_].edgeMap[g])){var w=new L(g,d,_,E);if(this.edges.push(w),this.edgeMap[g]=w,this.nodeMap[d].addEdge(w),this.edgeLabelMap[E]||(this.edgeLabelMap[E]=[]),this.edgeLabelMap[E].push(w),!this.directed){var T=new L(g,_,d,E);this.nodeMap[_].addEdge(T),this.edgeLabelMap[E].push(T)}}},v}();U.Graph=x},82812:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=z(70655),j=L(z(75033)),R=L(z(21146)),A=L(z(78089)),N=z(70643);function L(W){return W&&W.__esModule?W:{default:W}}var y=function(X,H,Q,q){Q===void 0&&(Q="cluster"),q===void 0&&(q=2);var J=[],te=X.nodes;return H.forEach(function(fe,de){J.push(x(te,fe,de,Q,q))}),J},x=function(X,H,Q,q,J){var te=[Q],fe=[],de={};return H.forEach(function(Te,Se){if(Te<=J&&Q!==Se){te.push(Se),fe.push(X[Se]);var Ie=X[Se][q];de[Ie]?(de[Ie].count++,de[Ie].dists.push(Te)):de[Ie]={count:1,dists:[Te]}}}),Object.keys(de).forEach(function(Te){de[Te].dists=de[Te].dists.sort(function(Se,Ie){return Se-Ie})}),{nodeIdx:Q,nodeId:X[Q].id,nodeIdxs:te,neighbors:fe,neighborNum:te.length-1,nodeLabelCountMap:de}},v=function(X,H,Q,q,J){var te=Math.ceil(Q/H),fe={},de=0;return q.forEach(function(Te,Se){for(var Ie=0,be=0,pe=Te.nodeIdxs,Me=Te.neighborNum-1;Ie<te;){for(var De=pe[1+Math.floor(Math.random()*Me)],Ue=0;(fe["".concat(Se,"-").concat(De)]||fe["".concat(De,"-").concat(Se)])&&(De=Math.floor(Math.random()*H),Ue++,!(Ue>2*H)););if(Ue<2*H&&(fe["".concat(Se,"-").concat(De)]={start:Se,end:De,distance:J[Se][De]},Ie++,de++,de>=Q))return fe;if(be++,be>2*H)break}if(Ie<te){var nt=te-Ie;te=(te+nt)/(H-Se-1)}}),fe},g=function(X,H,Q,q){var J=Q.nodes;return q||(q={}),Object.keys(X).forEach(function(te){var fe,de;if(!(q&&q[te])){q[te]={nodes:[],edges:[]};var Te=X[te],Se=(fe=H[Te.start])===null||fe===void 0?void 0:fe.nodeIdxs,Ie=(de=H[Te.end])===null||de===void 0?void 0:de.nodeIdxs;if(!(!Se||!Ie)){var be=new Set(Ie),pe=Se.filter(function(Ze){return be.has(Ze)});if(!(!pe||!pe.length)){for(var Me={},De=pe.length,Ue=0;Ue<De;Ue++){var nt=J[pe[Ue]];q[te].nodes.push(nt),Me[nt.id]=!0}Q.edges.forEach(function(Ze){Me[Ze.source]&&Me[Ze.target]&&q[te].edges.push(Ze)})}}}}),q},d=function(X,H,Q,q){var J,te,fe={};X.nodes.forEach(function(Te){fe[Te.id]=Te});var de=0;return!((J=H==null?void 0:H.edges)===null||J===void 0?void 0:J.length)||((te=H==null?void 0:H.nodes)===null||te===void 0?void 0:te.length)<2?0:(X.edges.forEach(function(Te){var Se=fe[Te.source][Q],Ie=fe[Te.target][Q],be=H==null?void 0:H.nodes[0][Q],pe=H==null?void 0:H.nodes[1][Q],Me=H==null?void 0:H.edges[0][q];Te[q]===Me&&(Se===be&&Ie===pe||Se===pe&&Ie===be)&&de++}),de)},_=function(X,H,Q){for(var q=Infinity,J=0,te=function(Te){var Se=X[Te],Ie=Object.keys(Se).sort(function(Ze,ht){return Se[Ze]-Se[ht]}),be=10,pe=[];Ie.forEach(function(Ze,ht){pe[ht%be]||(pe[ht%be]={graphs:[],totalCount:0,aveCount:0}),pe[ht%be].graphs.push(Ze),pe[ht%be].totalCount+=Se[Ze]});var Me=0,De=[];pe.forEach(function(Ze){var ht=Ze.totalCount/Ze.graphs.length;Ze.aveCount=ht,De.push(ht);var Rt=0,tr=Ze.length;Ze.graphs.forEach(function(Qe,lt){var St=Se[Qe];Ze.graphs.forEach(function(Ct,_t){lt!==_t&&(Rt+=Math.abs(St-Se[Ct]))})}),Rt/=tr*(tr-1)/2,Me+=Rt}),Me/=pe.length;var Ue=0;De.forEach(function(Ze,ht){De.forEach(function(Rt,tr){ht!==tr&&(Ue+=Math.abs(Ze-Rt))}),Ue/=De.length*(De.length-1)/2});var nt=Ue-Me;q<nt&&(q=nt,J=Te)},fe=0;fe<H;fe++)te(fe);return{structure:Q[J],structureCountMap:X[J]}},E=function(X,H){var Q={},q={};return X.forEach(function(J,te){Q[J.id]={idx:te,node:J,degree:0,inDegree:0,outDegree:0};var fe=J[H];q[fe]||(q[fe]=[]),q[fe].push(J)}),{nodeMap:Q,nodeLabelMap:q}},w=function(X,H,Q){var q={},J={};return X.forEach(function(te,fe){q["".concat(N.uniqueId)]={idx:fe,edge:te};var de=te[H];J[de]||(J[de]=[]),J[de].push(te);var Te=Q[te.source];Te&&(Te.degree++,Te.outDegree++);var Se=Q[te.target];Se&&(Se.degree++,Se.inDegree++)}),{edgeMap:q,edgeLabelMap:J}},T=function(X,H,Q){var q=H.length,J={};return H.forEach(function(te,fe){for(var de=Q?0:fe+1,Te=X[fe].id,Se=de;Se<q;Se++)if(fe!==Se){var Ie=X[Se].id,be=te[Se];J["".concat(Te,"-").concat(Ie)]=be,Q||(J["".concat(Ie,"-").concat(Te)]=be)}}),J},k=function(X,H,Q,q,J,te,fe,de,Te,Se,Ie){var be,pe="".concat(H.id,"-").concat(Q.id);if(Se&&Se[pe])return Se[pe];var Me=Ie?Ie[pe]:void 0;if(!Me){var De=(be={},be[pe]={start:q[H.id].idx,end:q[Q.id].idx,distance:J},be);Ie=g(De,te,X,Ie),Me=Ie[pe]}return d(Me,fe,de,Te)},b=function(X,H,Q,q){var J,te,fe,de=(J=X[H])===null||J===void 0?void 0:J.degree,Te=(te=X[H])===null||te===void 0?void 0:te.inDegree,Se=(fe=X[H])===null||fe===void 0?void 0:fe.outDegree;return X[H]===void 0&&(de=Infinity,Te=Infinity,Se=Infinity,q[H].forEach(function(Ie){var be=Q[Ie.id].degree;de>be&&(de=be);var pe=Q[Ie.id].inDegree;Te>pe&&(Te=pe);var Me=Q[Ie.id].outDegree;Se>Me&&(Se=Me)}),X[H]={degree:de,inDegree:Te,outDegree:Se}),{minPatternNodeLabelDegree:de,minPatternNodeLabelInDegree:Te,minPatternNodeLabelOutDegree:Se}},m=function(X,H,Q,q,J,te,fe){var de;if(Q===void 0&&(Q=!1),te===void 0&&(te="cluster"),fe===void 0&&(fe="cluster"),!(!X||!X.nodes)){var Te=X.nodes.length;if(!!Te){var Se=(0,j.default)(X,Q),Ie=(0,j.default)(H,Q),be=T(X.nodes,Se,Q),pe=T(H.nodes,Ie,Q),Me=E(X.nodes,te),De=Me.nodeMap,Ue=Me.nodeLabelMap,nt=E(H.nodes,te),Ze=nt.nodeMap,ht=nt.nodeLabelMap;w(X.edges,fe,De);var Rt=w(H.edges,fe,Ze).edgeLabelMap,tr=[];Ie==null||Ie.forEach(function(Zr){tr=tr.concat(Zr)}),J||(J=Math.max.apply(Math,(0,B.__spreadArray)((0,B.__spreadArray)([],tr,!1),[2],!1))),q||(q=J);var Qe=y(X,Se,te,q),lt=y(H,Ie,te,q),St=Math.min(100,Te*(Te-1)/2),Ct=v(q,Te,St,Qe,Se),_t=g(Ct,Qe,X),pt=10,rr=1,xr=1,Vt=4,ft={graphs:_t,nodeLabelProp:te,edgeLabelProp:fe,minSupport:rr,minNodeNum:xr,maxNodeNum:Vt,directed:Q},Bt=(0,R.default)(ft).slice(0,pt),qt=Bt.length,br=[];Bt.forEach(function(Zr,Pn){br[Pn]={},Object.keys(_t).forEach(function(An){var ln=_t[An],va=d(ln,Zr,te,fe);br[Pn][An]=va})});var Ur=_(br,qt,Bt),Ae=Ur.structure,Hr=Ur.structureCountMap,Sr=H.nodes[0],qr=[],Gr=(de=H.nodes[0])===null||de===void 0?void 0:de[te],vn=-Infinity;H.nodes.forEach(function(Zr){var Pn=Zr[te],An=Ue[Pn];(An==null?void 0:An.length)>vn&&(vn=An.length,qr=An,Gr=Pn,Sr=Zr)});var Gn={},mn={},$r={},gn={},Rr={},ct={};Object.keys(ht).forEach(function(Zr,Pn){Rr[Zr]=[],Q&&(ct[Zr]=[]);var An=-Infinity,ln=ht[Zr],va={};ln.forEach(function(ae){var P=pe["".concat(Sr.id,"-").concat(ae.id)];if(P&&Rr[Zr].push(P),An<P&&(An=P),va["".concat(Sr.id,"-").concat(ae.id)]={start:0,end:Ze[ae.id].idx,distance:P},Q){var S=pe["".concat(ae.id,"-").concat(Sr.id)];S&&ct[Zr].push(S)}}),Rr[Zr]=Rr[Zr].sort(function(ae,P){return ae-P}),Q&&(ct[Zr]=ct[Zr].sort(function(ae,P){return ae-P})),mn=g(va,lt,H,mn);var K=[];if(Object.keys(va).forEach(function(ae){if($r[ae]){K.push($r[ae]);return}var P=mn[ae];$r[ae]=d(P,Ae,te,fe),K.push($r[ae])}),K=K.sort(function(ae,P){return P-ae}),gn["".concat(Sr.id,"-").concat(Zr)]=K,Zr!==Gr)for(var Dt=(qr==null?void 0:qr.length)||0,rt=function(P){var S=qr[P],C=Qe[De[S.id].idx],V=C.nodeLabelCountMap[Zr],he=ht[Zr].length;if(!V||V.count<he)return qr.splice(P,1),"continue";for(var xe=!1,Ee=0;Ee<he;Ee++)if(V.dists[Ee]>Rr[Zr][Ee]){xe=!0;break}if(xe)return qr.splice(P,1),"continue";var Ne={};C.neighbors.forEach(function(Pt){var $t=be["".concat(S.id,"-").concat(Pt.id)];Ne["".concat(S.id,"-").concat(Pt.id)]={start:De[S.id].idx,end:De[Pt.id].idx,distance:$t}}),_t=g(Ne,Qe,X,_t);var Et=[];Object.keys(Ne).forEach(function(Pt){if(Hr[Pt]){Et.push(Hr[Pt]);return}var $t=_t[Pt];Hr[Pt]=d($t,Ae,te,fe),Et.push(Hr[Pt])}),Et=Et.sort(function(Pt,$t){return $t-Pt});for(var st=!1,Ee=0;Ee<he;Ee++)if(Et[Ee]<K[Ee]){st=!0;break}if(st)return qr.splice(P,1),"continue"},ne=Dt-1;ne>=0;ne--)rt(ne)});var Wt=[];qr==null||qr.forEach(function(Zr){for(var Pn=De[Zr.id].idx,An=x(X.nodes,Se[Pn],Pn,te,J),ln=An.neighbors,va=ln.length,K=!1,Dt=va-1;Dt>=0;Dt--){if(ln.length+1<H.nodes.length){K=!0;return}var rt=ln[Dt],ne=rt[te];if(!ht[ne]||!ht[ne].length){ln.splice(Dt,1);continue}if(!Rr[ne]||!Rr[ne].length){ln.splice(Dt,1);continue}var ae="".concat(Zr.id,"-").concat(rt.id),P=be[ae],S=Rr[ne].length-1,C=Rr[ne][S];if(P>C){ln.splice(Dt,1);continue}if(Q){var V="".concat(rt.id,"-").concat(Zr.id),he=be[V];S=ct[ne].length-1;var xe=ct[ne][S];if(he>xe){ln.splice(Dt,1);continue}}var Ee=Hr[ae]?Hr[ae]:k(X,Zr,rt,De,P,Qe,Ae,te,fe,Hr,_t),Ne="".concat(Sr.id,"-").concat(ne),Et=gn[Ne][gn[Ne].length-1];if(Ee<Et){ln.splice(Dt,1);continue}var st=b(Gn,ne,Ze,ht),Pt=st.minPatternNodeLabelDegree,$t=st.minPatternNodeLabelInDegree,Ht=st.minPatternNodeLabelOutDegree;if(De[rt.id].degree<Pt){ln.splice(Dt,1);continue}}K||Wt.push({nodes:[Zr].concat(ln)})});var Er=(0,A.default)(H,Sr.id,!1).length,Dr={};Q?(Object.keys(Er).forEach(function(Zr){var Pn=Ze[Zr].node[te];Dr[Pn]?Dr[Pn].push(Er[Zr]):Dr[Pn]=[Er[Zr]]}),Object.keys(Dr).forEach(function(Zr){Dr[Zr].sort(function(Pn,An){return Pn-An})})):Dr=Rr;for(var Vr=Wt.length,pn=function(Pn){var An=Wt[Pn],ln=An.nodes[0],va={},K={};An.nodes.forEach(function(bn,je){K[bn.id]={idx:je,node:bn,degree:0,inDegree:0,outDegree:0};var Ce=bn[te];va[Ce]?va[Ce]++:va[Ce]=1});var Dt=[],rt={};X.edges.forEach(function(bn){K[bn.source]&&K[bn.target]&&(Dt.push(bn),rt[bn[fe]]?rt[bn[fe]]++:rt[bn[fe]]=1,K[bn.source].degree++,K[bn.target].degree++,K[bn.source].outDegree++,K[bn.target].inDegree++)});for(var ne=Object.keys(Rt).length,ae=!1,P=0;P<ne;P++){var S=Object.keys(Rt)[P];if(!rt[S]||rt[S]<Rt[S].length){ae=!0;break}}if(ae)return Wt.splice(Pn,1),"continue";var C=Dt.length;if(C<H.edges.length)return Wt.splice(Pn,1),"break";for(var V=!1,he=function(je){var Ce=Dt[je],Xe=Ce[fe],ut=Rt[Xe];if(!ut||!ut.length)return rt[Xe]--,ut&&rt[Xe]<ut.length?(V=!0,"break"):(Dt.splice(je,1),K[Ce.source].degree--,K[Ce.target].degree--,K[Ce.source].outDegree--,K[Ce.target].inDegree--,"continue");var ot=K[Ce.source].node[te],bt=K[Ce.target].node[te],Xt=!1;if(ut.forEach(function(wr){var Wr=Ze[wr.source].node,on=Ze[wr.target].node;Wr[te]===ot&&on[te]===bt&&(Xt=!0),!Q&&Wr[te]===bt&&on[te]===ot&&(Xt=!0)}),!Xt)return rt[Xe]--,ut&&rt[Xe]<ut.length?(V=!0,"break"):(Dt.splice(je,1),K[Ce.source].degree--,K[Ce.target].degree--,K[Ce.source].outDegree--,K[Ce.target].inDegree--,"continue")},P=C-1;P>=0;P--){var xe=he(P);if(xe==="break")break}if(V)return Wt.splice(Pn,1),"continue";An.edges=Dt;var Ee=(0,A.default)(An,An.nodes[0].id,!1).length;if(Object.keys(Ee).reverse().forEach(function(bn){if(!(bn===An.nodes[0].id||V)){if(Ee[bn]===Infinity){var je=K[bn].node[te];if(va[je]--,va[je]<ht[je].length){V=!0;return}var Ce=An.nodes.indexOf(K[bn].node);An.nodes.splice(Ce,1),K[bn]=void 0;return}var Xe=De[bn].node[te];if(!Dr[Xe]||!Dr[Xe].length||Ee[bn]>Dr[Xe][Dr[Xe].length-1]){var je=K[bn].node[te];if(va[je]--,va[je]<ht[je].length){V=!0;return}var Ce=An.nodes.indexOf(K[bn].node);An.nodes.splice(Ce,1),K[bn]=void 0}}}),V)return Wt.splice(Pn,1),"continue";for(var Ne=!0,Et=0;Ne&&!V;){Ne=!1;var st=Q?K[ln.id].degree<Ze[Sr.id].degree||K[ln.id].inDegree<Ze[Sr.id].inDegree||K[ln.id].outDegree<Ze[Sr.id].outDegree:K[ln.id].degree<Ze[Sr.id].degree;if(st){V=!0;break}if(va[ln[te]]<ht[ln[te]].length){V=!0;break}for(var Pt=An.nodes.length,$t=Pt-1;$t>=0;$t--){var Ht=An.nodes[$t],Br=K[Ht.id].degree,hn=K[Ht.id].inDegree,Ot=K[Ht.id].outDegree,Qt=Ht[te],pr=b(Gn,Qt,Ze,ht),en=pr.minPatternNodeLabelDegree,Nr=pr.minPatternNodeLabelInDegree,ta=pr.minPatternNodeLabelOutDegree,kn=Q?Br<en||hn<Nr||Ot<ta:Br<en;if(kn){if(va[Ht[te]]--,va[Ht[te]]<ht[Ht[te]].length){V=!0;break}An.nodes.splice($t,1),K[Ht.id]=void 0,Ne=!0}}if(V||!Ne&&Et!==0)break;C=Dt.length;for(var En=C-1;En>=0;En--){var Rn=Dt[En];if(!K[Rn.source]||!K[Rn.target]){Dt.splice(En,1);var Yn=Rn[fe];if(rt[Yn]--,K[Rn.source]&&(K[Rn.source].degree--,K[Rn.source].outDegree--),K[Rn.target]&&(K[Rn.target].degree--,K[Rn.target].inDegree--),Rt[Yn]&&rt[Yn]<Rt[Yn].length){V=!0;break}Ne=!0}}Et++}if(V||V||An.nodes.length<H.nodes.length||Dt.length<H.edges.length)return Wt.splice(Pn,1),"continue"},wn=Vr-1;wn>=0;wn--){var Sn=pn(wn);if(Sn==="break")break}for(var In=Wt.length,$n=function(Pn){var An=Wt[Pn],ln={};An.edges.forEach(function(Dt){var rt="".concat(Dt.source,"-").concat(Dt.target,"-").concat(Dt.label);ln[rt]?ln[rt]++:ln[rt]=1});for(var va=function(rt){var ne=Wt[rt],ae={};ne.edges.forEach(function(S){var C="".concat(S.source,"-").concat(S.target,"-").concat(S.label);ae[C]?ae[C]++:ae[C]=1});var P=!0;Object.keys(ae).length!==Object.keys(ln).length?P=!1:Object.keys(ln).forEach(function(S){ae[S]!==ln[S]&&(P=!1)}),P&&Wt.splice(rt,1)},K=In-1;K>Pn;K--)va(K);In=Wt.length},wn=0;wn<=In-1;wn++)$n(wn);return Wt}}},$=m;U.default=$},5170:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=R(z(62238)),j=z(70643);function R(L){return L&&L.__esModule?L:{default:L}}var A=function(y,x,v,g){x===void 0&&(x=!1),v===void 0&&(v="weight"),g===void 0&&(g=1e3);var d=y.nodes,_=d===void 0?[]:d,E=y.edges,w=E===void 0?[]:E,T={},k={};_.forEach(function(te,fe){var de=(0,j.uniqueId)();te.clusterId=de,T[de]={id:de,nodes:[te]},k[te.id]={node:te,idx:fe}});var b=(0,B.default)(y,x),m=[],$={};b.forEach(function(te,fe){var de=0,Te=_[fe].id;$[Te]={},te.forEach(function(Se,Ie){if(!!Se){de+=Se;var be=_[Ie].id;$[Te][be]=Se}}),m.push(de)});for(var W=0,X=function(){var fe=!1;if(_.forEach(function(de){var Te={};Object.keys($[de.id]).forEach(function(nt){var Ze=$[de.id][nt],ht=k[nt].node,Rt=ht.clusterId;Te[Rt]||(Te[Rt]=0),Te[Rt]+=Ze});var Se=-Infinity,Ie=[];if(Object.keys(Te).forEach(function(nt){Se<Te[nt]?(Se=Te[nt],Ie=[nt]):Se===Te[nt]&&Ie.push(nt)}),!(Ie.length===1&&Ie[0]===de.clusterId)){var be=Ie.indexOf(de.clusterId);if(be>=0&&Ie.splice(be,1),Ie&&Ie.length){fe=!0;var pe=T[de.clusterId],Me=pe.nodes.indexOf(de);pe.nodes.splice(Me,1);var De=Math.floor(Math.random()*Ie.length),Ue=T[Ie[De]];Ue.nodes.push(de),de.clusterId=Ue.id}}}),!fe)return"break";W++};W<g;){var H=X();if(H==="break")break}Object.keys(T).forEach(function(te){var fe=T[te];(!fe.nodes||!fe.nodes.length)&&delete T[te]});var Q=[],q={};w.forEach(function(te){var fe=te.source,de=te.target,Te=te[v]||1,Se=k[fe].node.clusterId,Ie=k[de].node.clusterId,be="".concat(Se,"---").concat(Ie);if(q[be])q[be].weight+=Te,q[be].count++;else{var pe={source:Se,target:Ie,weight:Te,count:1};q[be]=pe,Q.push(pe)}});var J=[];return Object.keys(T).forEach(function(te){J.push(T[te])}),{clusters:J,clusterEdges:Q}},N=A;U.default=N},35179:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=z(49242),j=L(z(62238)),R=L(z(29741)),A=z(3665),N=z(26838);function L(d){return d&&d.__esModule?d:{default:d}}var y=function(_,E,w,T){for(var k=E.length,b=2*T,m=0,$=0;$<k;$++)for(var W=_[$].clusterId,X=0;X<k;X++){var H=_[X].clusterId;if(W===H){var Q=E[$][X]||0,q=w[$]||0,J=w[X]||0;m+=Q-q*J/b}}return m*=1/b,m},x=function(_,E){_===void 0&&(_=[]);for(var w=_.length,T=new R.default([]),k=0;k<w;k++)T=T.add(new R.default(E[k]));var b=T.avg(w);b.normalize();for(var m=0,k=0;k<w;k++){var $=new R.default(E[k]),W=$.squareEuclideanDistance(b);m+=W}var X=[];_.forEach(function(){X.push([])});for(var k=0;k<w;k++){var $=new R.default(E[k]);_[k].clusterInertial=0;for(var H=0;H<w;H++){if(k===H){X[k][H]=0;continue}var Q=new R.default(E[H]);X[k][H]=$.squareEuclideanDistance(Q),_[k].clusterInertial+=X[k][H]}}for(var q=0,J=2*w*m,k=0;k<w;k++)for(var te=_[k].clusterId,H=0;H<w;H++){var fe=_[H].clusterId;if(!(k===H||te!==fe)){var de=_[k].clusterInertial*_[H].clusterInertial/Math.pow(J,2)-X[k][H]/J;q+=de}}return Number(q.toFixed(4))},v=function(_,E,w,T,k,b,m,$,W){E===void 0&&(E=!1),w===void 0&&(w="weight"),T===void 0&&(T=1e-4),k===void 0&&(k=!1),b===void 0&&(b=void 0),m===void 0&&(m=[]),$===void 0&&($=["id"]),W===void 0&&(W=1);var X=_.nodes,H=X===void 0?[]:X,Q=_.edges,q=Q===void 0?[]:Q,J=[];if(k){H.forEach(function(_t,pt){_t.properties=_t.properties||{},_t.originIndex=pt});var te=[];H.every(function(_t){return _t.hasOwnProperty("nodeType")})&&(te=Array.from(new Set(H.map(function(_t){return _t.nodeType}))),H.forEach(function(_t){_t.properties.nodeType=te.findIndex(function(pt){return pt===_t.nodeType})}));var fe=(0,A.getAllProperties)(H,b);J=(0,N.oneHot)(fe,m,$)}var de=1,Te={},Se={};H.forEach(function(_t,pt){var rr=String(de++);_t.clusterId=rr,Te[rr]={id:rr,nodes:[_t]},Se[_t.id]={node:_t,idx:pt}});var Ie=(0,j.default)(_,E),be=[],pe={},Me=0;Ie.forEach(function(_t,pt){var rr=0,xr=H[pt].id;pe[xr]={},_t.forEach(function(Vt,ft){if(!!Vt){rr+=Vt;var Bt=H[ft].id;pe[xr][Bt]=Vt,Me+=Vt}}),be.push(rr)}),Me/=2;for(var De=Infinity,Ue=Infinity,nt=0,Ze=[],ht={};;){k&&H.every(function(_t){return _t.hasOwnProperty("properties")})?De=y(H,Ie,be,Me)+x(H,J)*W:De=y(H,Ie,be,Me),nt===0&&(Ue=De,Ze=H,ht=Te);var Rt=De>0&&De>Ue&&De-Ue<T;if(De>Ue&&(Ze=H.map(function(_t){return{node:_t,clusterId:_t.clusterId}}),ht=(0,B.clone)(Te),Ue=De),Rt||nt>100)break;nt++,Object.keys(Te).forEach(function(_t){var pt=0;q.forEach(function(rr){var xr=rr.source,Vt=rr.target,ft=Se[xr].node.clusterId,Bt=Se[Vt].node.clusterId;(ft===_t&&Bt!==_t||Bt===_t&&ft!==_t)&&(pt=pt+(rr[w]||1))}),Te[_t].sumTot=pt}),H.forEach(function(_t,pt){var rr=Te[_t.clusterId],xr=0,Vt,ft=be[pt]/(2*Me),Bt=0,qt=rr.nodes;qt.forEach(function(mn){var $r=Se[mn.id].idx;Bt+=Ie[pt][$r]||0});var br=Bt-rr.sumTot*ft,Ur=qt.filter(function(mn){return mn.id!==_t.id}),Ae=[];Ur.forEach(function(mn,$r){Ae[$r]=J[mn.originIndex]});var Hr=x(Ur,J)*W,Sr=pe[_t.id];if(Object.keys(Sr).forEach(function(mn){var $r=Se[mn].node,gn=$r.clusterId;if(gn!==_t.clusterId){var Rr=Te[gn],ct=Rr.nodes;if(!(!ct||!ct.length)){var Wt=0;ct.forEach(function(Sn){var In=Se[Sn.id].idx;Wt+=Ie[pt][In]||0});var Er=Wt-Rr.sumTot*ft,Dr=ct.concat([_t]),Vr=[];Dr.forEach(function(Sn,In){Vr[In]=J[Sn.originIndex]});var pn=x(Dr,J)*W,wn=Er-br;k&&(wn=Er+pn-(br+Hr)),wn>xr&&(xr=wn,Vt=Rr)}}}),xr>0){Vt.nodes.push(_t);var qr=_t.clusterId;_t.clusterId=Vt.id;var Gr=rr.nodes.indexOf(_t);rr.nodes.splice(Gr,1);var vn=0,Gn=0;q.forEach(function(mn){var $r=mn.source,gn=mn.target,Rr=Se[$r].node.clusterId,ct=Se[gn].node.clusterId;(Rr===Vt.id&&ct!==Vt.id||ct===Vt.id&&Rr!==Vt.id)&&(vn=vn+(mn[w]||1)),(Rr===qr&&ct!==qr||ct===qr&&Rr!==qr)&&(Gn=Gn+(mn[w]||1))}),Vt.sumTot=vn,rr.sumTot=Gn}})}var tr={},Qe=0;Object.keys(ht).forEach(function(_t){var pt=ht[_t];if(!pt.nodes||!pt.nodes.length){delete ht[_t];return}var rr=String(Qe+1);rr!==_t&&(pt.id=rr,pt.nodes=pt.nodes.map(function(xr){return{id:xr.id,clusterId:rr}}),ht[rr]=pt,tr[_t]=rr,delete ht[_t],Qe++)}),Ze.forEach(function(_t){var pt=_t.node,rr=_t.clusterId;!pt||(pt.clusterId=rr,pt.clusterId&&tr[pt.clusterId]&&(pt.clusterId=tr[pt.clusterId]))});var lt=[],St={};q.forEach(function(_t){var pt=_t.source,rr=_t.target,xr=_t[w]||1,Vt=Se[pt].node.clusterId,ft=Se[rr].node.clusterId;if(!(!Vt||!ft)){var Bt="".concat(Vt,"---").concat(ft);if(St[Bt])St[Bt].weight+=xr,St[Bt].count++;else{var qt={source:Vt,target:ft,weight:xr,count:1};St[Bt]=qt,lt.push(qt)}}});var Ct=[];return Object.keys(ht).forEach(function(_t){Ct.push(ht[_t])}),{clusters:Ct,clusterEdges:lt}},g=v;U.default=g},89454:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=A(z(38823)),j=A(z(57085)),R=z(70643);function A(v){return v&&v.__esModule?v:{default:v}}var N=function(g,d){var _=[],E=g.nodes,w=E===void 0?[]:E,T=g.edges,k=T===void 0?[]:T;if(w.length===0)return _;var b=w[0],m=new Set;m.add(b);var $=function(J,te){return d?J.weight-te.weight:0},W=new j.default($);for((0,R.getEdgesByNodeId)(b.id,k).forEach(function(q){W.insert(q)});!W.isEmpty();){var X=W.delMin(),H=X.source,Q=X.target;m.has(H)&&m.has(Q)||(_.push(X),m.has(H)||(m.add(H),(0,R.getEdgesByNodeId)(H,k).forEach(function(q){W.insert(q)})),m.has(Q)||(m.add(Q),(0,R.getEdgesByNodeId)(Q,k).forEach(function(q){W.insert(q)})))}return _},L=function(g,d){var _=[],E=g.nodes,w=E===void 0?[]:E,T=g.edges,k=T===void 0?[]:T;if(w.length===0)return _;var b=k.map(function(H){return H});d&&b.sort(function(H,Q){return H.weight-Q.weight});for(var m=new B.default(w.map(function(H){return H.id}));b.length>0;){var $=b.shift(),W=$.source,X=$.target;m.connected(W,X)||(_.push($),m.union(W,X))}return _},y=function(g,d,_){var E={prim:N,kruskal:L};return _?E[_](g,d):L(g,d)},x=y;U.default=x},74926:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=R(z(82556)),j=z(70643);function R(L){return L&&L.__esModule?L:{default:L}}var A=function(y,x,v){typeof x!="number"&&(x=1e-6),typeof v!="number"&&(v=.85);for(var g=1,d=0,_=1e3,E=y.nodes,w=E===void 0?[]:E,T=y.edges,k=T===void 0?[]:T,b=w.length,m,$={},W={},X=0;X<b;++X){var H=w[X],Q=H.id;$[Q]=1/b,W[Q]=1/b}for(var q=(0,B.default)(y);_>0&&g>x;){d=0;for(var X=0;X<b;++X){var H=w[X],Q=H.id;if(m=0,q[H.id].inDegree===0)$[Q]=0;else{for(var J=(0,j.getNeighbors)(Q,k,"source"),te=0;te<J.length;++te){var fe=J[te],de=q[fe].outDegree;de>0&&(m+=W[fe]/de)}$[Q]=v*m,d+=$[Q]}}d=(1-d)/b,g=0;for(var X=0;X<b;++X){var H=w[X],Q=H.id;m=$[Q]+d,g+=Math.abs(m-W[Q]),W[Q]=m}_-=1}return W},N=A;U.default=N},57085:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var z=function(A,N){return A-N},B=function(){function R(A){A===void 0&&(A=z),this.compareFn=A,this.list=[]}return R.prototype.getLeft=function(A){return 2*A+1},R.prototype.getRight=function(A){return 2*A+2},R.prototype.getParent=function(A){return A===0?null:Math.floor((A-1)/2)},R.prototype.isEmpty=function(){return this.list.length<=0},R.prototype.top=function(){return this.isEmpty()?void 0:this.list[0]},R.prototype.delMin=function(){var A=this.top(),N=this.list.pop();return this.list.length>0&&(this.list[0]=N,this.moveDown(0)),A},R.prototype.insert=function(A){if(A!==null){this.list.push(A);var N=this.list.length-1;return this.moveUp(N),!0}return!1},R.prototype.moveUp=function(A){for(var N=this.getParent(A);A&&A>0&&this.compareFn(this.list[N],this.list[A])>0;){var L=this.list[N];this.list[N]=this.list[A],this.list[A]=L,A=N,N=this.getParent(A)}},R.prototype.moveDown=function(A){var N,L=A,y=this.getLeft(A),x=this.getRight(A),v=this.list.length;y!==null&&y<v&&this.compareFn(this.list[L],this.list[y])>0?L=y:x!==null&&x<v&&this.compareFn(this.list[L],this.list[x])>0&&(L=x),A!==L&&(N=[this.list[L],this.list[A]],this.list[A]=N[0],this.list[L]=N[1],this.moveDown(L))},R}(),j=B;U.default=j},88481:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=U.LinkedListNode=void 0;var z=function(N,L){return N===L},B=function(){function A(N,L){L===void 0&&(L=null),this.value=N,this.next=L}return A.prototype.toString=function(N){return N?N(this.value):"".concat(this.value)},A}();U.LinkedListNode=B;var j=function(){function A(N){N===void 0&&(N=z),this.head=null,this.tail=null,this.compare=N}return A.prototype.prepend=function(N){var L=new B(N,this.head);return this.head=L,this.tail||(this.tail=L),this},A.prototype.append=function(N){var L=new B(N);return this.head?(this.tail.next=L,this.tail=L,this):(this.head=L,this.tail=L,this)},A.prototype.delete=function(N){if(!this.head)return null;for(var L=null;this.head&&this.compare(this.head.value,N);)L=this.head,this.head=this.head.next;var y=this.head;if(y!==null)for(;y.next;)this.compare(y.next.value,N)?(L=y.next,y.next=y.next.next):y=y.next;return this.compare(this.tail.value,N)&&(this.tail=y),L},A.prototype.find=function(N){var L=N.value,y=L===void 0?void 0:L,x=N.callback,v=x===void 0?void 0:x;if(!this.head)return null;for(var g=this.head;g;){if(v&&v(g.value)||y!==void 0&&this.compare(g.value,y))return g;g=g.next}return null},A.prototype.deleteTail=function(){var N=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,N;for(var L=this.head;L.next;)L.next.next?L=L.next:L.next=null;return this.tail=L,N},A.prototype.deleteHead=function(){if(!this.head)return null;var N=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),N},A.prototype.fromArray=function(N){var L=this;return N.forEach(function(y){return L.append(y)}),this},A.prototype.toArray=function(){for(var N=[],L=this.head;L;)N.push(L),L=L.next;return N},A.prototype.reverse=function(){for(var N=this.head,L=null,y=null;N;)y=N.next,N.next=L,L=N,N=y;this.tail=this.head,this.head=L},A.prototype.toString=function(N){return N===void 0&&(N=void 0),this.toArray().map(function(L){return L.toString(N)}).toString()},A}(),R=j;U.default=R},93026:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=j(z(88481));function j(N){return N&&N.__esModule?N:{default:N}}var R=function(){function N(){this.linkedList=new B.default}return N.prototype.isEmpty=function(){return!this.linkedList.head},N.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},N.prototype.enqueue=function(L){this.linkedList.append(L)},N.prototype.dequeue=function(){var L=this.linkedList.deleteHead();return L?L.value:null},N.prototype.toString=function(L){return this.linkedList.toString(L)},N}(),A=R;U.default=A},38823:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var z=function(){function j(R){this.count=R.length,this.parent={};for(var A=0,N=R;A<N.length;A++){var L=N[A];this.parent[L]=L}}return j.prototype.find=function(R){for(;this.parent[R]!==R;)R=this.parent[R];return R},j.prototype.union=function(R,A){var N=this.find(R),L=this.find(A);N!==L&&(N<L?(this.parent[A]!==A&&this.union(this.parent[A],R),this.parent[A]=this.parent[R]):(this.parent[R]!==R&&this.union(this.parent[R],A),this.parent[R]=this.parent[A]))},j.prototype.connected=function(R,A){return this.find(R)===this.find(A)},j}(),B=z;U.default=B},17892:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.DistanceType=void 0;var z;U.DistanceType=z,function(B){B.EuclideanDistance="euclideanDistance"}(z||(U.DistanceType=z={}))},70643:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.uniqueId=U.getOutEdgesNodeId=U.getNeighbors=U.getEdgesByNodeId=void 0;var z=function(N,L,y){L===void 0&&(L=[]);var x=L.filter(function(_){return _.source===N||_.target===N});if(y==="target"){var v=function(E){return E.source===N};return x.filter(v).map(function(_){return _.target})}if(y==="source"){var g=function(E){return E.target===N};return x.filter(g).map(function(_){return _.source})}var d=function(E){return E.source===N?E.target:E.source};return x.map(d)};U.getNeighbors=z;var B=function(N,L){return L.filter(function(y){return y.source===N})};U.getOutEdgesNodeId=B;var j=function(N,L){return L.filter(function(y){return y.source===N||y.target===N})};U.getEdgesByNodeId=j;var R=function(N){N===void 0&&(N=0);var L="".concat(Math.random()).split(".")[1].substr(0,5),y="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(N,"-").concat(L).concat(y)};U.uniqueId=R},26838:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.oneHot=U.getDistance=U.getAllKeyValueMap=U.default=void 0;var B=z(49242),j=z(17892),R=A(z(29741));function A(v){return v&&v.__esModule?v:{default:v}}var N=function(g,d,_){var E=[];(d==null?void 0:d.length)?E=d:(g.forEach(function(T){E=E.concat(Object.keys(T))}),E=(0,B.uniq)(E));var w={};return E.forEach(function(T){var k=[];g.forEach(function(b){b[T]!==void 0&&b[T]!==""&&k.push(b[T])}),k.length&&!(_==null?void 0:_.includes(T))&&(w[T]=(0,B.uniq)(k))}),w};U.getAllKeyValueMap=N;var L=function(g,d,_){var E=N(g,d,_),w=[];if(!Object.keys(E).length)return w;var T=Object.values(E),k=T.every(function(b){return b.every(function(m){return typeof m=="number"})});return g.forEach(function(b,m){var $=[];Object.keys(E).forEach(function(W){var X=b[W],H=E[W],Q=H.findIndex(function(te){return X===te}),q=[];if(k)q.push(X);else for(var J=0;J<H.length;J++)J===Q?q.push(1):q.push(0);$=$.concat(q)}),w[m]=$}),w};U.oneHot=L;var y=function(g,d,_,E){_===void 0&&(_=j.DistanceType.EuclideanDistance);var w=0;switch(_){case j.DistanceType.EuclideanDistance:w=new R.default(g).euclideanDistance(new R.default(d));break;default:break}return w};U.getDistance=y;var x={getAllKeyValueMap:N,oneHot:L,getDistance:y};U.default=x},3665:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.getPropertyWeight=U.getAllSortProperties=U.getAllProperties=U.default=void 0;var B=z(92935),j=function(x,v){x===void 0&&(x=[]),v===void 0&&(v=100);var g={};x.forEach(function(_){!_.properties||Object.keys(_.properties).forEach(function(E){if(E==="id"||!"".concat(_.properties[E]).match(B.secondReg)&&!"".concat(_.properties[E]).match(B.dateReg)&&isNaN(Number(_.properties[E]))){g.hasOwnProperty(E)&&delete g[E];return}g.hasOwnProperty(E)?g[E]+=1:g[E]=1})});var d=Object.keys(g).sort(function(_,E){return g[E]-g[_]});return d.length<v?d:d.slice(0,v)};U.getAllSortProperties=j;var R=function(x,v){return v.map(function(g){return x.hasOwnProperty(g)?x[g]:0})},A=function(x){for(var v=j(x),g=[],d=0;d<x.length;d++)g[d]=R(x[d].properties,v);return g};U.getPropertyWeight=A;var N=function(x,v){v===void 0&&(v=void 0);var g=[];return x.forEach(function(d){v===void 0&&g.push(d),d[v]!==void 0&&g.push(d[v])}),g};U.getAllProperties=N;var L={getAllSortProperties:j,getPropertyWeight:A,getAllProperties:N};U.default=L},29741:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=z(49242),j=function(){function A(N){this.arr=N}return A.prototype.getArr=function(){return this.arr||[]},A.prototype.add=function(N){var L,y=N.arr;if(!((L=this.arr)===null||L===void 0?void 0:L.length))return new A(y);if(!(y==null?void 0:y.length))return new A(this.arr);if(this.arr.length===y.length){var x=[];for(var v in this.arr)x[v]=this.arr[v]+y[v];return new A(x)}},A.prototype.subtract=function(N){var L,y=N.arr;if(!((L=this.arr)===null||L===void 0?void 0:L.length))return new A(y);if(!(y==null?void 0:y.length))return new A(this.arr);if(this.arr.length===y.length){var x=[];for(var v in this.arr)x[v]=this.arr[v]-y[v];return new A(x)}},A.prototype.avg=function(N){var L=[];if(N!==0)for(var y in this.arr)L[y]=this.arr[y]/N;return new A(L)},A.prototype.negate=function(){var N=[];for(var L in this.arr)N[L]=-this.arr[L];return new A(N)},A.prototype.squareEuclideanDistance=function(N){var L,y=N.arr;if(!((L=this.arr)===null||L===void 0?void 0:L.length)||!(y==null?void 0:y.length))return 0;if(this.arr.length===y.length){var x=0;for(var v in this.arr)x+=Math.pow(this.arr[v]-N.arr[v],2);return x}},A.prototype.euclideanDistance=function(N){var L,y=N.arr;if(!((L=this.arr)===null||L===void 0?void 0:L.length)||!(y==null?void 0:y.length))return 0;if(this.arr.length===y.length){var x=0;for(var v in this.arr)x+=Math.pow(this.arr[v]-N.arr[v],2);return Math.sqrt(x)}else console.error("The two vectors are unequal in length.")},A.prototype.normalize=function(){var N=[],L=(0,B.clone)(this.arr);L.sort(function(g,d){return g-d});var y=L[L.length-1],x=L[0];for(var v in this.arr)N[v]=(this.arr[v]-x)/(y-x);return new A(N)},A.prototype.norm2=function(){var N;if(!((N=this.arr)===null||N===void 0?void 0:N.length))return 0;var L=0;for(var y in this.arr)L+=Math.pow(this.arr[y],2);return Math.sqrt(L)},A.prototype.dot=function(N){var L,y=N.arr;if(!((L=this.arr)===null||L===void 0?void 0:L.length)||!(y==null?void 0:y.length))return 0;if(this.arr.length===y.length){var x=0;for(var v in this.arr)x+=this.arr[v]*N.arr[v];return x}else console.error("The two vectors are unequal in length.")},A.prototype.equal=function(N){var L,y=N.arr;if(((L=this.arr)===null||L===void 0?void 0:L.length)!==(y==null?void 0:y.length))return!1;for(var x in this.arr)if(this.arr[x]!==y[x])return!1;return!0},A}(),R=j;U.default=R},31656:function(or,U,z){"use strict";function B(W){return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X},B(W)}Object.defineProperty(U,"__esModule",{value:!0}),Object.defineProperty(U,"GADDI",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(U,"breadthFirstSearch",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(U,"connectedComponent",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(U,"depthFirstSearch",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(U,"detectCycle",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(U,"dijkstra",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(U,"findAllPath",{enumerable:!0,get:function(){return v.findAllPath}}),Object.defineProperty(U,"findShortestPath",{enumerable:!0,get:function(){return v.findShortestPath}}),Object.defineProperty(U,"floydWarshall",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(U,"getAdjMatrix",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(U,"getDegree",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(U,"getInDegree",{enumerable:!0,get:function(){return N.getInDegree}}),Object.defineProperty(U,"getNeighbors",{enumerable:!0,get:function(){return k.getNeighbors}}),Object.defineProperty(U,"getOutDegree",{enumerable:!0,get:function(){return N.getOutDegree}}),Object.defineProperty(U,"labelPropagation",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(U,"louvain",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(U,"minimumSpanningTree",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(U,"pageRank",{enumerable:!0,get:function(){return w.default}});var j=$(z(62238)),R=$(z(83764)),A=$(z(59527)),N=m(z(82556)),L=$(z(94282)),y=$(z(45891)),x=$(z(78089)),v=z(41727),g=$(z(75033)),d=$(z(5170)),_=$(z(35179)),E=$(z(89454)),w=$(z(74926)),T=$(z(82812)),k=z(70643);function b(W){if(typeof WeakMap!="function")return null;var X=new WeakMap,H=new WeakMap;return(b=function(q){return q?H:X})(W)}function m(W,X){if(!X&&W&&W.__esModule)return W;if(W===null||B(W)!=="object"&&typeof W!="function")return{default:W};var H=b(X);if(H&&H.has(W))return H.get(W);var Q={},q=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var J in W)if(J!=="default"&&Object.prototype.hasOwnProperty.call(W,J)){var te=q?Object.getOwnPropertyDescriptor(W,J):null;te&&(te.get||te.set)?Object.defineProperty(Q,J,te):Q[J]=W[J]}return Q.default=W,H&&H.set(W,Q),Q}function $(W){return W&&W.__esModule?W:{default:W}}},66044:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.MESSAGE=U.ALGORITHM=void 0;var z={pageRank:"pageRank",breadthFirstSearch:"breadthFirstSearch",connectedComponent:"connectedComponent",depthFirstSearch:"depthFirstSearch",detectCycle:"detectCycle",detectDirectedCycle:"detectDirectedCycle",detectAllCycles:"detectAllCycles",detectAllDirectedCycle:"detectAllDirectedCycle",detectAllUndirectedCycle:"detectAllUndirectedCycle",dijkstra:"dijkstra",findAllPath:"findAllPath",findShortestPath:"findShortestPath",floydWarshall:"floydWarshall",getAdjMatrix:"getAdjMatrix",getDegree:"getDegree",getInDegree:"getInDegree",getNeighbors:"getNeighbors",getOutDegree:"getOutDegree",labelPropagation:"labelPropagation",louvain:"louvain",GADDI:"GADDI",minimumSpanningTree:"minimumSpanningTree",SUCCESS:"SUCCESS",FAILURE:"FAILURE"};U.ALGORITHM=z;var B={SUCCESS:"SUCCESS",FAILURE:"FAILURE"};U.MESSAGE=B},70585:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var B=z(66044),j=R(z(12067));function R(L){return L&&L.__esModule?L:{default:L}}var A=function(y){return function(){for(var x=[],v=0;v<arguments.length;v++)x[v]=arguments[v];return new Promise(function(g,d){var _=new j.default;_.postMessage({_algorithmType:y,data:x}),_.onmessage=function(E){var w=E.data,T=w.data,k=w._algorithmType;B.MESSAGE.SUCCESS===k?g(T):d(),_.terminate()}})}},N=A;U.default=N},30485:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.pageRankAsync=U.minimumSpanningTreeAsync=U.louvainAsync=U.labelPropagationAsync=U.getOutDegreeAsync=U.getNeighborsAsync=U.getInDegreeAsync=U.getDegreeAsync=U.getAdjMatrixAsync=U.floydWarshallAsync=U.findShortestPathAsync=U.findAllPathAsync=U.dijkstraAsync=U.detectCycleAsync=U.detectAllUndirectedCycleAsync=U.detectAllDirectedCycleAsync=U.detectAllCyclesAsync=U.connectedComponentAsync=U.GADDIAsync=void 0;var B=R(z(70585)),j=z(66044);function R(Q){return Q&&Q.__esModule?Q:{default:Q}}var A=function(q,J){return(0,B.default)(j.ALGORITHM.getAdjMatrix).apply(void 0,[q,J])};U.getAdjMatrixAsync=A;var N=function(q,J){return(0,B.default)(j.ALGORITHM.connectedComponent).apply(void 0,[q,J])};U.connectedComponentAsync=N;var L=function(q){return(0,B.default)(j.ALGORITHM.getDegree)(q)};U.getDegreeAsync=L;var y=function(q,J){return(0,B.default)(j.ALGORITHM.getInDegree)(q,J)};U.getInDegreeAsync=y;var x=function(q,J){return(0,B.default)(j.ALGORITHM.getOutDegree)(q,J)};U.getOutDegreeAsync=x;var v=function(q){return(0,B.default)(j.ALGORITHM.detectCycle)(q)};U.detectCycleAsync=v;var g=function(q){return(0,B.default)(j.ALGORITHM.detectAllCycles)(q)};U.detectAllCyclesAsync=g;var d=function(q){return(0,B.default)(j.ALGORITHM.detectAllDirectedCycle)(q)};U.detectAllDirectedCycleAsync=d;var _=function(q){return(0,B.default)(j.ALGORITHM.detectAllUndirectedCycle)(q)};U.detectAllUndirectedCycleAsync=_;var E=function(q,J,te,fe){return(0,B.default)(j.ALGORITHM.dijkstra).apply(void 0,[q,J,te,fe])};U.dijkstraAsync=E;var w=function(q,J,te,fe){return(0,B.default)(j.ALGORITHM.findAllPath).apply(void 0,[q,J,te,fe])};U.findAllPathAsync=w;var T=function(q,J,te,fe,de){return(0,B.default)(j.ALGORITHM.findShortestPath).apply(void 0,[q,J,te,fe,de])};U.findShortestPathAsync=T;var k=function(q,J){return(0,B.default)(j.ALGORITHM.floydWarshall).apply(void 0,[q,J])};U.floydWarshallAsync=k;var b=function(q,J,te,fe){return fe===void 0&&(fe=1e3),(0,B.default)(j.ALGORITHM.labelPropagation)(q,J,te,fe)};U.labelPropagationAsync=b;var m=function(q,J,te,fe){return(0,B.default)(j.ALGORITHM.louvain)(q,J,te,fe)};U.louvainAsync=m;var $=function(q,J,te){return(0,B.default)(j.ALGORITHM.minimumSpanningTree).apply(void 0,[q,J,te])};U.minimumSpanningTreeAsync=$;var W=function(q,J,te){return(0,B.default)(j.ALGORITHM.pageRank).apply(void 0,[q,J,te])};U.pageRankAsync=W;var X=function(q,J,te){return(0,B.default)(j.ALGORITHM.getNeighbors).apply(void 0,[q,J,te])};U.getNeighborsAsync=X;var H=function(q,J,te,fe,de,Te,Se){return te===void 0&&(te=!1),Te===void 0&&(Te="cluster"),Se===void 0&&(Se="cluster"),(0,B.default)(j.ALGORITHM.GADDI).apply(void 0,[q,J,te,fe,de,Te,Se])};U.GADDIAsync=H},12067:function(or,U,z){"use strict";function B(x){return B=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},B(x)}Object.defineProperty(U,"__esModule",{value:!0}),U.default=void 0;var j=N(z(31656)),R=z(66044);function A(x){if(typeof WeakMap!="function")return null;var v=new WeakMap,g=new WeakMap;return(A=function(_){return _?g:v})(x)}function N(x,v){if(!v&&x&&x.__esModule)return x;if(x===null||B(x)!=="object"&&typeof x!="function")return{default:x};var g=A(v);if(g&&g.has(x))return g.get(x);var d={},_=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var E in x)if(E!=="default"&&Object.prototype.hasOwnProperty.call(x,E)){var w=_?Object.getOwnPropertyDescriptor(x,E):null;w&&(w.get||w.set)?Object.defineProperty(d,E,w):d[E]=x[E]}return d.default=x,g&&g.set(x,d),d}var L=typeof self!="undefined"?self:{};L.onmessage=function(x){var v=x.data,g=v._algorithmType,d=v.data;if(!!g){if(typeof j[g]=="function"){var _=j[g].apply(j,d);L.postMessage({_algorithmType:R.MESSAGE.SUCCESS,data:_});return}L.postMessage({_algorithmType:R.MESSAGE.FAILURE})}};var y=null;U.default=y},70390:function(or,U,z){"use strict";z.r(U),z.d(U,{Kernel:function(){return Te},World:function(){return va}});var B=z(92137),j=z(96156),R=z(6610),A=z(5991),N=z(36719),L=z.n(N),y=z(81763),x=z.n(y),v=z(1469),g=z.n(v),d=z(87757),_=z.n(d),E=null,w=1;function T(){return w++}var k=null,b=null,m;(function(K){K[K.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT",K[K.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT",K[K.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT",K[K.POINTS=0]="POINTS",K[K.LINES=1]="LINES",K[K.LINE_LOOP=2]="LINE_LOOP",K[K.LINE_STRIP=3]="LINE_STRIP",K[K.TRIANGLES=4]="TRIANGLES",K[K.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",K[K.TRIANGLE_FAN=6]="TRIANGLE_FAN",K[K.ZERO=0]="ZERO",K[K.ONE=1]="ONE",K[K.SRC_COLOR=768]="SRC_COLOR",K[K.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",K[K.SRC_ALPHA=770]="SRC_ALPHA",K[K.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",K[K.DST_ALPHA=772]="DST_ALPHA",K[K.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",K[K.DST_COLOR=774]="DST_COLOR",K[K.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",K[K.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE",K[K.FUNC_ADD=32774]="FUNC_ADD",K[K.BLEND_EQUATION=32777]="BLEND_EQUATION",K[K.BLEND_EQUATION_RGB=32777]="BLEND_EQUATION_RGB",K[K.BLEND_EQUATION_ALPHA=34877]="BLEND_EQUATION_ALPHA",K[K.FUNC_SUBTRACT=32778]="FUNC_SUBTRACT",K[K.FUNC_REVERSE_SUBTRACT=32779]="FUNC_REVERSE_SUBTRACT",K[K.MAX_EXT=32776]="MAX_EXT",K[K.MIN_EXT=32775]="MIN_EXT",K[K.BLEND_DST_RGB=32968]="BLEND_DST_RGB",K[K.BLEND_SRC_RGB=32969]="BLEND_SRC_RGB",K[K.BLEND_DST_ALPHA=32970]="BLEND_DST_ALPHA",K[K.BLEND_SRC_ALPHA=32971]="BLEND_SRC_ALPHA",K[K.CONSTANT_COLOR=32769]="CONSTANT_COLOR",K[K.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",K[K.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",K[K.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",K[K.BLEND_COLOR=32773]="BLEND_COLOR",K[K.ARRAY_BUFFER=34962]="ARRAY_BUFFER",K[K.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",K[K.ARRAY_BUFFER_BINDING=34964]="ARRAY_BUFFER_BINDING",K[K.ELEMENT_ARRAY_BUFFER_BINDING=34965]="ELEMENT_ARRAY_BUFFER_BINDING",K[K.STREAM_DRAW=35040]="STREAM_DRAW",K[K.STATIC_DRAW=35044]="STATIC_DRAW",K[K.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW",K[K.BUFFER_SIZE=34660]="BUFFER_SIZE",K[K.BUFFER_USAGE=34661]="BUFFER_USAGE",K[K.CURRENT_VERTEX_ATTRIB=34342]="CURRENT_VERTEX_ATTRIB",K[K.FRONT=1028]="FRONT",K[K.BACK=1029]="BACK",K[K.FRONT_AND_BACK=1032]="FRONT_AND_BACK",K[K.CULL_FACE=2884]="CULL_FACE",K[K.BLEND=3042]="BLEND",K[K.DITHER=3024]="DITHER",K[K.STENCIL_TEST=2960]="STENCIL_TEST",K[K.DEPTH_TEST=2929]="DEPTH_TEST",K[K.SCISSOR_TEST=3089]="SCISSOR_TEST",K[K.POLYGON_OFFSET_FILL=32823]="POLYGON_OFFSET_FILL",K[K.SAMPLE_ALPHA_TO_COVERAGE=32926]="SAMPLE_ALPHA_TO_COVERAGE",K[K.SAMPLE_COVERAGE=32928]="SAMPLE_COVERAGE",K[K.NO_ERROR=0]="NO_ERROR",K[K.INVALID_ENUM=1280]="INVALID_ENUM",K[K.INVALID_VALUE=1281]="INVALID_VALUE",K[K.INVALID_OPERATION=1282]="INVALID_OPERATION",K[K.OUT_OF_MEMORY=1285]="OUT_OF_MEMORY",K[K.CW=2304]="CW",K[K.CCW=2305]="CCW",K[K.LINE_WIDTH=2849]="LINE_WIDTH",K[K.ALIASED_POINT_SIZE_RANGE=33901]="ALIASED_POINT_SIZE_RANGE",K[K.ALIASED_LINE_WIDTH_RANGE=33902]="ALIASED_LINE_WIDTH_RANGE",K[K.CULL_FACE_MODE=2885]="CULL_FACE_MODE",K[K.FRONT_FACE=2886]="FRONT_FACE",K[K.DEPTH_RANGE=2928]="DEPTH_RANGE",K[K.DEPTH_WRITEMASK=2930]="DEPTH_WRITEMASK",K[K.DEPTH_CLEAR_VALUE=2931]="DEPTH_CLEAR_VALUE",K[K.DEPTH_FUNC=2932]="DEPTH_FUNC",K[K.STENCIL_CLEAR_VALUE=2961]="STENCIL_CLEAR_VALUE",K[K.STENCIL_FUNC=2962]="STENCIL_FUNC",K[K.STENCIL_FAIL=2964]="STENCIL_FAIL",K[K.STENCIL_PASS_DEPTH_FAIL=2965]="STENCIL_PASS_DEPTH_FAIL",K[K.STENCIL_PASS_DEPTH_PASS=2966]="STENCIL_PASS_DEPTH_PASS",K[K.STENCIL_REF=2967]="STENCIL_REF",K[K.STENCIL_VALUE_MASK=2963]="STENCIL_VALUE_MASK",K[K.STENCIL_WRITEMASK=2968]="STENCIL_WRITEMASK",K[K.STENCIL_BACK_FUNC=34816]="STENCIL_BACK_FUNC",K[K.STENCIL_BACK_FAIL=34817]="STENCIL_BACK_FAIL",K[K.STENCIL_BACK_PASS_DEPTH_FAIL=34818]="STENCIL_BACK_PASS_DEPTH_FAIL",K[K.STENCIL_BACK_PASS_DEPTH_PASS=34819]="STENCIL_BACK_PASS_DEPTH_PASS",K[K.STENCIL_BACK_REF=36003]="STENCIL_BACK_REF",K[K.STENCIL_BACK_VALUE_MASK=36004]="STENCIL_BACK_VALUE_MASK",K[K.STENCIL_BACK_WRITEMASK=36005]="STENCIL_BACK_WRITEMASK",K[K.VIEWPORT=2978]="VIEWPORT",K[K.SCISSOR_BOX=3088]="SCISSOR_BOX",K[K.COLOR_CLEAR_VALUE=3106]="COLOR_CLEAR_VALUE",K[K.COLOR_WRITEMASK=3107]="COLOR_WRITEMASK",K[K.UNPACK_ALIGNMENT=3317]="UNPACK_ALIGNMENT",K[K.PACK_ALIGNMENT=3333]="PACK_ALIGNMENT",K[K.MAX_TEXTURE_SIZE=3379]="MAX_TEXTURE_SIZE",K[K.MAX_VIEWPORT_DIMS=3386]="MAX_VIEWPORT_DIMS",K[K.SUBPIXEL_BITS=3408]="SUBPIXEL_BITS",K[K.RED_BITS=3410]="RED_BITS",K[K.GREEN_BITS=3411]="GREEN_BITS",K[K.BLUE_BITS=3412]="BLUE_BITS",K[K.ALPHA_BITS=3413]="ALPHA_BITS",K[K.DEPTH_BITS=3414]="DEPTH_BITS",K[K.STENCIL_BITS=3415]="STENCIL_BITS",K[K.POLYGON_OFFSET_UNITS=10752]="POLYGON_OFFSET_UNITS",K[K.POLYGON_OFFSET_FACTOR=32824]="POLYGON_OFFSET_FACTOR",K[K.TEXTURE_BINDING_2D=32873]="TEXTURE_BINDING_2D",K[K.SAMPLE_BUFFERS=32936]="SAMPLE_BUFFERS",K[K.SAMPLES=32937]="SAMPLES",K[K.SAMPLE_COVERAGE_VALUE=32938]="SAMPLE_COVERAGE_VALUE",K[K.SAMPLE_COVERAGE_INVERT=32939]="SAMPLE_COVERAGE_INVERT",K[K.COMPRESSED_TEXTURE_FORMATS=34467]="COMPRESSED_TEXTURE_FORMATS",K[K.DONT_CARE=4352]="DONT_CARE",K[K.FASTEST=4353]="FASTEST",K[K.NICEST=4354]="NICEST",K[K.GENERATE_MIPMAP_HINT=33170]="GENERATE_MIPMAP_HINT",K[K.BYTE=5120]="BYTE",K[K.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",K[K.SHORT=5122]="SHORT",K[K.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",K[K.INT=5124]="INT",K[K.UNSIGNED_INT=5125]="UNSIGNED_INT",K[K.FLOAT=5126]="FLOAT",K[K.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",K[K.ALPHA=6406]="ALPHA",K[K.RGB=6407]="RGB",K[K.RGBA=6408]="RGBA",K[K.LUMINANCE=6409]="LUMINANCE",K[K.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",K[K.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",K[K.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",K[K.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",K[K.FRAGMENT_SHADER=35632]="FRAGMENT_SHADER",K[K.VERTEX_SHADER=35633]="VERTEX_SHADER",K[K.MAX_VERTEX_ATTRIBS=34921]="MAX_VERTEX_ATTRIBS",K[K.MAX_VERTEX_UNIFORM_VECTORS=36347]="MAX_VERTEX_UNIFORM_VECTORS",K[K.MAX_VARYING_VECTORS=36348]="MAX_VARYING_VECTORS",K[K.MAX_COMBINED_TEXTURE_IMAGE_UNITS=35661]="MAX_COMBINED_TEXTURE_IMAGE_UNITS",K[K.MAX_VERTEX_TEXTURE_IMAGE_UNITS=35660]="MAX_VERTEX_TEXTURE_IMAGE_UNITS",K[K.MAX_TEXTURE_IMAGE_UNITS=34930]="MAX_TEXTURE_IMAGE_UNITS",K[K.MAX_FRAGMENT_UNIFORM_VECTORS=36349]="MAX_FRAGMENT_UNIFORM_VECTORS",K[K.SHADER_TYPE=35663]="SHADER_TYPE",K[K.DELETE_STATUS=35712]="DELETE_STATUS",K[K.LINK_STATUS=35714]="LINK_STATUS",K[K.VALIDATE_STATUS=35715]="VALIDATE_STATUS",K[K.ATTACHED_SHADERS=35717]="ATTACHED_SHADERS",K[K.ACTIVE_UNIFORMS=35718]="ACTIVE_UNIFORMS",K[K.ACTIVE_ATTRIBUTES=35721]="ACTIVE_ATTRIBUTES",K[K.SHADING_LANGUAGE_VERSION=35724]="SHADING_LANGUAGE_VERSION",K[K.CURRENT_PROGRAM=35725]="CURRENT_PROGRAM",K[K.NEVER=512]="NEVER",K[K.LESS=513]="LESS",K[K.EQUAL=514]="EQUAL",K[K.LEQUAL=515]="LEQUAL",K[K.GREATER=516]="GREATER",K[K.NOTEQUAL=517]="NOTEQUAL",K[K.GEQUAL=518]="GEQUAL",K[K.ALWAYS=519]="ALWAYS",K[K.KEEP=7680]="KEEP",K[K.REPLACE=7681]="REPLACE",K[K.INCR=7682]="INCR",K[K.DECR=7683]="DECR",K[K.INVERT=5386]="INVERT",K[K.INCR_WRAP=34055]="INCR_WRAP",K[K.DECR_WRAP=34056]="DECR_WRAP",K[K.VENDOR=7936]="VENDOR",K[K.RENDERER=7937]="RENDERER",K[K.VERSION=7938]="VERSION",K[K.NEAREST=9728]="NEAREST",K[K.LINEAR=9729]="LINEAR",K[K.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",K[K.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",K[K.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",K[K.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR",K[K.TEXTURE_MAG_FILTER=10240]="TEXTURE_MAG_FILTER",K[K.TEXTURE_MIN_FILTER=10241]="TEXTURE_MIN_FILTER",K[K.TEXTURE_WRAP_S=10242]="TEXTURE_WRAP_S",K[K.TEXTURE_WRAP_T=10243]="TEXTURE_WRAP_T",K[K.TEXTURE_2D=3553]="TEXTURE_2D",K[K.TEXTURE=5890]="TEXTURE",K[K.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",K[K.TEXTURE_BINDING_CUBE_MAP=34068]="TEXTURE_BINDING_CUBE_MAP",K[K.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",K[K.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",K[K.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",K[K.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",K[K.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",K[K.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",K[K.MAX_CUBE_MAP_TEXTURE_SIZE=34076]="MAX_CUBE_MAP_TEXTURE_SIZE",K[K.TEXTURE0=33984]="TEXTURE0",K[K.TEXTURE1=33985]="TEXTURE1",K[K.TEXTURE2=33986]="TEXTURE2",K[K.TEXTURE3=33987]="TEXTURE3",K[K.TEXTURE4=33988]="TEXTURE4",K[K.TEXTURE5=33989]="TEXTURE5",K[K.TEXTURE6=33990]="TEXTURE6",K[K.TEXTURE7=33991]="TEXTURE7",K[K.TEXTURE8=33992]="TEXTURE8",K[K.TEXTURE9=33993]="TEXTURE9",K[K.TEXTURE10=33994]="TEXTURE10",K[K.TEXTURE11=33995]="TEXTURE11",K[K.TEXTURE12=33996]="TEXTURE12",K[K.TEXTURE13=33997]="TEXTURE13",K[K.TEXTURE14=33998]="TEXTURE14",K[K.TEXTURE15=33999]="TEXTURE15",K[K.TEXTURE16=34e3]="TEXTURE16",K[K.TEXTURE17=34001]="TEXTURE17",K[K.TEXTURE18=34002]="TEXTURE18",K[K.TEXTURE19=34003]="TEXTURE19",K[K.TEXTURE20=34004]="TEXTURE20",K[K.TEXTURE21=34005]="TEXTURE21",K[K.TEXTURE22=34006]="TEXTURE22",K[K.TEXTURE23=34007]="TEXTURE23",K[K.TEXTURE24=34008]="TEXTURE24",K[K.TEXTURE25=34009]="TEXTURE25",K[K.TEXTURE26=34010]="TEXTURE26",K[K.TEXTURE27=34011]="TEXTURE27",K[K.TEXTURE28=34012]="TEXTURE28",K[K.TEXTURE29=34013]="TEXTURE29",K[K.TEXTURE30=34014]="TEXTURE30",K[K.TEXTURE31=34015]="TEXTURE31",K[K.ACTIVE_TEXTURE=34016]="ACTIVE_TEXTURE",K[K.REPEAT=10497]="REPEAT",K[K.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",K[K.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",K[K.FLOAT_VEC2=35664]="FLOAT_VEC2",K[K.FLOAT_VEC3=35665]="FLOAT_VEC3",K[K.FLOAT_VEC4=35666]="FLOAT_VEC4",K[K.INT_VEC2=35667]="INT_VEC2",K[K.INT_VEC3=35668]="INT_VEC3",K[K.INT_VEC4=35669]="INT_VEC4",K[K.BOOL=35670]="BOOL",K[K.BOOL_VEC2=35671]="BOOL_VEC2",K[K.BOOL_VEC3=35672]="BOOL_VEC3",K[K.BOOL_VEC4=35673]="BOOL_VEC4",K[K.FLOAT_MAT2=35674]="FLOAT_MAT2",K[K.FLOAT_MAT3=35675]="FLOAT_MAT3",K[K.FLOAT_MAT4=35676]="FLOAT_MAT4",K[K.SAMPLER_2D=35678]="SAMPLER_2D",K[K.SAMPLER_CUBE=35680]="SAMPLER_CUBE",K[K.VERTEX_ATTRIB_ARRAY_ENABLED=34338]="VERTEX_ATTRIB_ARRAY_ENABLED",K[K.VERTEX_ATTRIB_ARRAY_SIZE=34339]="VERTEX_ATTRIB_ARRAY_SIZE",K[K.VERTEX_ATTRIB_ARRAY_STRIDE=34340]="VERTEX_ATTRIB_ARRAY_STRIDE",K[K.VERTEX_ATTRIB_ARRAY_TYPE=34341]="VERTEX_ATTRIB_ARRAY_TYPE",K[K.VERTEX_ATTRIB_ARRAY_NORMALIZED=34922]="VERTEX_ATTRIB_ARRAY_NORMALIZED",K[K.VERTEX_ATTRIB_ARRAY_POINTER=34373]="VERTEX_ATTRIB_ARRAY_POINTER",K[K.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING=34975]="VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",K[K.COMPILE_STATUS=35713]="COMPILE_STATUS",K[K.LOW_FLOAT=36336]="LOW_FLOAT",K[K.MEDIUM_FLOAT=36337]="MEDIUM_FLOAT",K[K.HIGH_FLOAT=36338]="HIGH_FLOAT",K[K.LOW_INT=36339]="LOW_INT",K[K.MEDIUM_INT=36340]="MEDIUM_INT",K[K.HIGH_INT=36341]="HIGH_INT",K[K.FRAMEBUFFER=36160]="FRAMEBUFFER",K[K.RENDERBUFFER=36161]="RENDERBUFFER",K[K.RGBA4=32854]="RGBA4",K[K.RGB5_A1=32855]="RGB5_A1",K[K.RGB565=36194]="RGB565",K[K.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16",K[K.STENCIL_INDEX=6401]="STENCIL_INDEX",K[K.STENCIL_INDEX8=36168]="STENCIL_INDEX8",K[K.DEPTH_STENCIL=34041]="DEPTH_STENCIL",K[K.RENDERBUFFER_WIDTH=36162]="RENDERBUFFER_WIDTH",K[K.RENDERBUFFER_HEIGHT=36163]="RENDERBUFFER_HEIGHT",K[K.RENDERBUFFER_INTERNAL_FORMAT=36164]="RENDERBUFFER_INTERNAL_FORMAT",K[K.RENDERBUFFER_RED_SIZE=36176]="RENDERBUFFER_RED_SIZE",K[K.RENDERBUFFER_GREEN_SIZE=36177]="RENDERBUFFER_GREEN_SIZE",K[K.RENDERBUFFER_BLUE_SIZE=36178]="RENDERBUFFER_BLUE_SIZE",K[K.RENDERBUFFER_ALPHA_SIZE=36179]="RENDERBUFFER_ALPHA_SIZE",K[K.RENDERBUFFER_DEPTH_SIZE=36180]="RENDERBUFFER_DEPTH_SIZE",K[K.RENDERBUFFER_STENCIL_SIZE=36181]="RENDERBUFFER_STENCIL_SIZE",K[K.FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE=36048]="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",K[K.FRAMEBUFFER_ATTACHMENT_OBJECT_NAME=36049]="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",K[K.FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL=36050]="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",K[K.FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE=36051]="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",K[K.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0",K[K.DEPTH_ATTACHMENT=36096]="DEPTH_ATTACHMENT",K[K.STENCIL_ATTACHMENT=36128]="STENCIL_ATTACHMENT",K[K.DEPTH_STENCIL_ATTACHMENT=33306]="DEPTH_STENCIL_ATTACHMENT",K[K.NONE=0]="NONE",K[K.FRAMEBUFFER_COMPLETE=36053]="FRAMEBUFFER_COMPLETE",K[K.FRAMEBUFFER_INCOMPLETE_ATTACHMENT=36054]="FRAMEBUFFER_INCOMPLETE_ATTACHMENT",K[K.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT=36055]="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",K[K.FRAMEBUFFER_INCOMPLETE_DIMENSIONS=36057]="FRAMEBUFFER_INCOMPLETE_DIMENSIONS",K[K.FRAMEBUFFER_UNSUPPORTED=36061]="FRAMEBUFFER_UNSUPPORTED",K[K.FRAMEBUFFER_BINDING=36006]="FRAMEBUFFER_BINDING",K[K.RENDERBUFFER_BINDING=36007]="RENDERBUFFER_BINDING",K[K.MAX_RENDERBUFFER_SIZE=34024]="MAX_RENDERBUFFER_SIZE",K[K.INVALID_FRAMEBUFFER_OPERATION=1286]="INVALID_FRAMEBUFFER_OPERATION",K[K.UNPACK_FLIP_Y_WEBGL=37440]="UNPACK_FLIP_Y_WEBGL",K[K.UNPACK_PREMULTIPLY_ALPHA_WEBGL=37441]="UNPACK_PREMULTIPLY_ALPHA_WEBGL",K[K.CONTEXT_LOST_WEBGL=37442]="CONTEXT_LOST_WEBGL",K[K.UNPACK_COLORSPACE_CONVERSION_WEBGL=37443]="UNPACK_COLORSPACE_CONVERSION_WEBGL",K[K.BROWSER_DEFAULT_WEBGL=37444]="BROWSER_DEFAULT_WEBGL",K[K.COPY_SRC=1]="COPY_SRC",K[K.COPY_DST=2]="COPY_DST",K[K.SAMPLED=4]="SAMPLED",K[K.STORAGE=8]="STORAGE",K[K.RENDER_ATTACHMENT=16]="RENDER_ATTACHMENT"})(m||(m={}));var $=function(){function K(){(0,R.Z)(this,K),this.config=void 0}return(0,A.Z)(K,[{key:"get",value:function(){return this.config}},{key:"set",value:function(rt){this.config=rt}}]),K}(),W=typeof navigator!="undefined"&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),X;(function(K){K.Void="Void",K.Boolean="Boolean",K.Float="Float",K.Uint32="Uint32",K.Int32="Int32",K.Vector="Vector",K.Vector2Float="vec2<f32>",K.Vector3Float="vec3<f32>",K.Vector4Float="vec4<f32>",K.Vector2Boolean="vec2<bool>",K.Vector3Boolean="vec3<bool>",K.Vector4Boolean="vec4<bool>",K.Vector2Uint="vec2<u32>",K.Vector3Uint="vec3<u32>",K.Vector4Uint="vec4<u32>",K.Vector2Int="vec2<i32>",K.Vector3Int="vec3<i32>",K.Vector4Int="vec4<i32>",K.Matrix="Matrix",K.Matrix3x3Float="mat3x3<f32>",K.Matrix4x4Float="mat4x4<i32>",K.Struct="Struct",K.FloatArray="Float[]",K.Vector4FloatArray="vec4<f32>[]"})(X||(X={}));var H;(function(K){K.Program="Program",K.Identifier="Identifier",K.VariableDeclaration="VariableDeclaration",K.BlockStatement="BlockStatement",K.ReturnStatement="ReturnStatement",K.FunctionDeclaration="FunctionDeclaration",K.VariableDeclarator="VariableDeclarator",K.AssignmentExpression="AssignmentExpression",K.LogicalExpression="LogicalExpression",K.BinaryExpression="BinaryExpression",K.ArrayExpression="ArrayExpression",K.UnaryExpression="UnaryExpression",K.UpdateExpression="UpdateExpression",K.FunctionExpression="FunctionExpression",K.MemberExpression="MemberExpression",K.ConditionalExpression="ConditionalExpression",K.ExpressionStatement="ExpressionStatement",K.CallExpression="CallExpression",K.NumThreadStatement="NumThreadStatement",K.StorageStatement="StorageStatement",K.DoWhileStatement="DoWhileStatement",K.WhileStatement="WhileStatement",K.ForStatement="ForStatement",K.BreakStatement="BreakStatement",K.ContinueStatement="ContinueStatement",K.IfStatement="IfStatement",K.ImportedFunctionStatement="ImportedFunctionStatement"})(H||(H={}));var Q;(function(K){K.Input="Input",K.Output="Output",K.Uniform="Uniform",K.Workgroup="Workgroup",K.UniformConstant="UniformConstant",K.Image="Image",K.StorageBuffer="StorageBuffer",K.Private="Private",K.Function="Function"})(Q||(Q={}));var q;(function(K){K.GLSL100="GLSL100",K.GLSL450="GLSL450",K.WGSL="WGSL"})(q||(q={}));var J="__DefineValuePlaceholder__";function te(){if(typeof document!="undefined")return document.createElement("canvas");throw new Error("Cannot create a canvas in this context")}function fe(K,Dt){var rt=Object.keys(K);if(Object.getOwnPropertySymbols){var ne=Object.getOwnPropertySymbols(K);Dt&&(ne=ne.filter(function(ae){return Object.getOwnPropertyDescriptor(K,ae).enumerable})),rt.push.apply(rt,ne)}return rt}function de(K){for(var Dt=1;Dt<arguments.length;Dt++){var rt=arguments[Dt]!=null?arguments[Dt]:{};Dt%2?fe(Object(rt),!0).forEach(function(ne){(0,j.Z)(K,ne,rt[ne])}):Object.getOwnPropertyDescriptors?Object.defineProperties(K,Object.getOwnPropertyDescriptors(rt)):fe(Object(rt)).forEach(function(ne){Object.defineProperty(K,ne,Object.getOwnPropertyDescriptor(rt,ne))})}return K}var Te=function(){function K(Dt,rt){(0,R.Z)(this,K),this.engine=Dt,this.configService=rt,this.model=void 0,this.dirty=!0,this.compiledBundle=void 0,this.initPromise=void 0}return(0,A.Z)(K,[{key:"init",value:function(){var rt=this.configService.get(),ne=rt.canvas,ae=rt.engineOptions;this.initPromise=this.engine.init(de({canvas:ne||te(),antialiasing:!1},ae))}},{key:"setBundle",value:function(rt){this.compiledBundle=JSON.parse(JSON.stringify(rt))}},{key:"setDispatch",value:function(rt){return this.compiledBundle.context&&(this.compiledBundle.context.dispatch=rt),this}},{key:"setMaxIteration",value:function(rt){return this.compiledBundle.context&&(this.compiledBundle.context.maxIteration=rt),this}},{key:"setBinding",value:function(rt,ne){var ae=this;if(typeof rt=="string"){var P=x()(ne)||L()(ne)||g()(ne);if(this.compiledBundle&&this.compiledBundle.context){var S=this.compiledBundle.context.defines.find(function(V){return V.name===rt});if(S)return S.value=ne,this;var C=this.compiledBundle.context.uniforms.find(function(V){return V.name===rt});C&&(P?(C.data=ne,C.isReferer=!1,C.storageClass===Q.Uniform?this.model&&this.model.updateUniform(rt,ne):this.model&&this.model.updateBuffer(rt,ne)):(C.isReferer=!0,C.data=ne))}}else Object.keys(rt).forEach(function(V){ae.setBinding(V,rt[V])});return this}},{key:"execute",value:function(){var Dt=(0,B.Z)(_().mark(function ne(){var ae=this,P,S,C=arguments;return _().wrap(function(he){for(;;)switch(he.prev=he.next){case 0:if(P=C.length>0&&C[0]!==void 0?C[0]:1,!this.dirty){he.next=6;break}return this.compiledBundle.context&&(P>1?this.compiledBundle.context.maxIteration=P:this.compiledBundle.context.maxIteration++),he.next=5,this.compile();case 5:this.dirty=!1;case 6:for(this.engine.beginFrame(),this.engine.clear({}),this.compiledBundle.context&&this.compiledBundle.context.uniforms.filter(function(xe){var Ee=xe.isReferer;return Ee}).forEach(function(xe){var Ee=xe.data,Ne=xe.name;ae.model.confirmInput(Ee.model,Ne)}),S=0;S<P;S++)this.model.run();return this.engine.endFrame(),he.abrupt("return",this);case 12:case"end":return he.stop()}},ne,this)}));function rt(){return Dt.apply(this,arguments)}return rt}()},{key:"getOutput",value:function(){var Dt=(0,B.Z)(_().mark(function ne(){return _().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.abrupt("return",this.model.readData());case 1:case"end":return P.stop()}},ne,this)}));function rt(){return Dt.apply(this,arguments)}return rt}()},{key:"compile",value:function(){var Dt=(0,B.Z)(_().mark(function ne(){var ae,P,S;return _().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,this.initPromise;case 2:return ae=de({},this.compiledBundle.context),P=this.engine.supportWebGPU?this.engine.useWGSL?q.WGSL:q.GLSL450:q.GLSL100,S=this.compiledBundle.shaders[P],ae.defines.filter(function(he){return he.runtime}).forEach(function(he){var xe="".concat(J).concat(he.name);S=S.replace(xe,"".concat(he.value))}),ae.shader=S,ae.uniforms.forEach(function(he){if(!he.data&&he.storageClass===Q.StorageBuffer){var xe=1;he.type===X.FloatArray?xe=1:he.type===X.Vector4FloatArray&&(xe=4),he.data=new Float32Array(ae.output.length*xe).fill(0)}}),this.compiledBundle.context=ae,V.next=11,this.engine.createComputeModel(this.compiledBundle.context);case 11:this.model=V.sent;case 12:case"end":return V.stop()}},ne,this)}));function rt(){return Dt.apply(this,arguments)}return rt}()}]),K}(),Se=z(81550),Ie=z.n(Se),be=function(){function K(Dt,rt){(0,R.Z)(this,K),this.attribute=void 0,this.buffer=void 0;var ne=rt.buffer,ae=rt.offset,P=rt.stride,S=rt.normalized,C=rt.size,V=rt.divisor;this.buffer=ne,this.attribute={buffer:ne.get(),offset:ae||0,stride:P||0,normalized:S||!1,divisor:V||0},C&&(this.attribute.size=C)}return(0,A.Z)(K,[{key:"get",value:function(){return this.attribute}},{key:"updateBuffer",value:function(rt){this.buffer.subData(rt)}},{key:"destroy",value:function(){this.buffer.destroy()}}]),K}(),pe,Me,De,Ue,nt,Ze,ht,Rt,tr,Qe,lt,St,Ct,_t,pt=(pe={},(0,j.Z)(pe,m.POINTS,"points"),(0,j.Z)(pe,m.LINES,"lines"),(0,j.Z)(pe,m.LINE_LOOP,"line loop"),(0,j.Z)(pe,m.LINE_STRIP,"line strip"),(0,j.Z)(pe,m.TRIANGLES,"triangles"),(0,j.Z)(pe,m.TRIANGLE_FAN,"triangle fan"),(0,j.Z)(pe,m.TRIANGLE_STRIP,"triangle strip"),pe),rr=(Me={},(0,j.Z)(Me,m.STATIC_DRAW,"static"),(0,j.Z)(Me,m.DYNAMIC_DRAW,"dynamic"),(0,j.Z)(Me,m.STREAM_DRAW,"stream"),Me),xr=(De={},(0,j.Z)(De,m.BYTE,"int8"),(0,j.Z)(De,m.UNSIGNED_INT,"int16"),(0,j.Z)(De,m.INT,"int32"),(0,j.Z)(De,m.UNSIGNED_BYTE,"uint8"),(0,j.Z)(De,m.UNSIGNED_SHORT,"uint16"),(0,j.Z)(De,m.UNSIGNED_INT,"uint32"),(0,j.Z)(De,m.FLOAT,"float"),De),Vt=(Ue={},(0,j.Z)(Ue,m.ALPHA,"alpha"),(0,j.Z)(Ue,m.LUMINANCE,"luminance"),(0,j.Z)(Ue,m.LUMINANCE_ALPHA,"luminance alpha"),(0,j.Z)(Ue,m.RGB,"rgb"),(0,j.Z)(Ue,m.RGBA,"rgba"),(0,j.Z)(Ue,m.RGBA4,"rgba4"),(0,j.Z)(Ue,m.RGB5_A1,"rgb5 a1"),(0,j.Z)(Ue,m.RGB565,"rgb565"),(0,j.Z)(Ue,m.DEPTH_COMPONENT,"depth"),(0,j.Z)(Ue,m.DEPTH_STENCIL,"depth stencil"),Ue),ft=(nt={},(0,j.Z)(nt,m.DONT_CARE,"dont care"),(0,j.Z)(nt,m.NICEST,"nice"),(0,j.Z)(nt,m.FASTEST,"fast"),nt),Bt=(Ze={},(0,j.Z)(Ze,m.NEAREST,"nearest"),(0,j.Z)(Ze,m.LINEAR,"linear"),(0,j.Z)(Ze,m.LINEAR_MIPMAP_LINEAR,"mipmap"),(0,j.Z)(Ze,m.NEAREST_MIPMAP_LINEAR,"nearest mipmap linear"),(0,j.Z)(Ze,m.LINEAR_MIPMAP_NEAREST,"linear mipmap nearest"),(0,j.Z)(Ze,m.NEAREST_MIPMAP_NEAREST,"nearest mipmap nearest"),Ze),qt=(ht={},(0,j.Z)(ht,m.REPEAT,"repeat"),(0,j.Z)(ht,m.CLAMP_TO_EDGE,"clamp"),(0,j.Z)(ht,m.MIRRORED_REPEAT,"mirror"),ht),br=(Rt={},(0,j.Z)(Rt,m.NONE,"none"),(0,j.Z)(Rt,m.BROWSER_DEFAULT_WEBGL,"browser"),Rt),Ur=(tr={},(0,j.Z)(tr,m.NEVER,"never"),(0,j.Z)(tr,m.ALWAYS,"always"),(0,j.Z)(tr,m.LESS,"less"),(0,j.Z)(tr,m.LEQUAL,"lequal"),(0,j.Z)(tr,m.GREATER,"greater"),(0,j.Z)(tr,m.GEQUAL,"gequal"),(0,j.Z)(tr,m.EQUAL,"equal"),(0,j.Z)(tr,m.NOTEQUAL,"notequal"),tr),Ae=(Qe={},(0,j.Z)(Qe,m.FUNC_ADD,"add"),(0,j.Z)(Qe,m.MIN_EXT,"min"),(0,j.Z)(Qe,m.MAX_EXT,"max"),(0,j.Z)(Qe,m.FUNC_SUBTRACT,"subtract"),(0,j.Z)(Qe,m.FUNC_REVERSE_SUBTRACT,"reverse subtract"),Qe),Hr=(lt={},(0,j.Z)(lt,m.ZERO,"zero"),(0,j.Z)(lt,m.ONE,"one"),(0,j.Z)(lt,m.SRC_COLOR,"src color"),(0,j.Z)(lt,m.ONE_MINUS_SRC_COLOR,"one minus src color"),(0,j.Z)(lt,m.SRC_ALPHA,"src alpha"),(0,j.Z)(lt,m.ONE_MINUS_SRC_ALPHA,"one minus src alpha"),(0,j.Z)(lt,m.DST_COLOR,"dst color"),(0,j.Z)(lt,m.ONE_MINUS_DST_COLOR,"one minus dst color"),(0,j.Z)(lt,m.DST_ALPHA,"dst alpha"),(0,j.Z)(lt,m.ONE_MINUS_DST_ALPHA,"one minus dst alpha"),(0,j.Z)(lt,m.CONSTANT_COLOR,"constant color"),(0,j.Z)(lt,m.ONE_MINUS_CONSTANT_COLOR,"one minus constant color"),(0,j.Z)(lt,m.CONSTANT_ALPHA,"constant alpha"),(0,j.Z)(lt,m.ONE_MINUS_CONSTANT_ALPHA,"one minus constant alpha"),(0,j.Z)(lt,m.SRC_ALPHA_SATURATE,"src alpha saturate"),lt),Sr=(St={},(0,j.Z)(St,m.NEVER,"never"),(0,j.Z)(St,m.ALWAYS,"always"),(0,j.Z)(St,m.LESS,"less"),(0,j.Z)(St,m.LEQUAL,"lequal"),(0,j.Z)(St,m.GREATER,"greater"),(0,j.Z)(St,m.GEQUAL,"gequal"),(0,j.Z)(St,m.EQUAL,"equal"),(0,j.Z)(St,m.NOTEQUAL,"notequal"),St),qr=(Ct={},(0,j.Z)(Ct,m.ZERO,"zero"),(0,j.Z)(Ct,m.KEEP,"keep"),(0,j.Z)(Ct,m.REPLACE,"replace"),(0,j.Z)(Ct,m.INVERT,"invert"),(0,j.Z)(Ct,m.INCR,"increment"),(0,j.Z)(Ct,m.DECR,"decrement"),(0,j.Z)(Ct,m.INCR_WRAP,"increment wrap"),(0,j.Z)(Ct,m.DECR_WRAP,"decrement wrap"),Ct),Gr=(_t={},(0,j.Z)(_t,m.FRONT,"front"),(0,j.Z)(_t,m.BACK,"back"),_t),vn=function(){function K(Dt,rt){(0,R.Z)(this,K),this.buffer=void 0;var ne=rt.data,ae=rt.usage,P=rt.type;this.buffer=Dt.buffer({data:ne,usage:rr[ae||m.STATIC_DRAW],type:xr[P||m.UNSIGNED_BYTE]})}return(0,A.Z)(K,[{key:"get",value:function(){return this.buffer}},{key:"destroy",value:function(){}},{key:"subData",value:function(rt){var ne=rt.data,ae=rt.offset;this.buffer.subdata(ne,ae)}}]),K}(),Gn=z(85061);function mn(K,Dt){var rt=Object.keys(K);if(Object.getOwnPropertySymbols){var ne=Object.getOwnPropertySymbols(K);Dt&&(ne=ne.filter(function(ae){return Object.getOwnPropertyDescriptor(K,ae).enumerable})),rt.push.apply(rt,ne)}return rt}function $r(K){for(var Dt=1;Dt<arguments.length;Dt++){var rt=arguments[Dt]!=null?arguments[Dt]:{};Dt%2?mn(Object(rt),!0).forEach(function(ne){(0,j.Z)(K,ne,rt[ne])}):Object.getOwnPropertyDescriptors?Object.defineProperties(K,Object.getOwnPropertyDescriptors(rt)):mn(Object(rt)).forEach(function(ne){Object.defineProperty(K,ne,Object.getOwnPropertyDescriptor(rt,ne))})}return K}var gn=`attribute vec3 a_Position;
  225. attribute vec2 a_TexCoord;
  226. varying vec2 v_TexCoord;
  227. void main() {
  228. gl_Position = vec4(a_Position, 1.0);
  229. v_TexCoord = a_TexCoord;
  230. }`,Rr=0,ct=!1,Wt=function(){function K(Dt,rt){var ne=this;(0,R.Z)(this,K),this.reGl=Dt,this.context=rt,this.entity=T(),this.texFBO=void 0,this.computeCommand=void 0,this.textureCache={},this.outputTextureName=void 0,this.swapOutputTextureName=void 0,this.compiledPingpong=void 0,this.dynamicPingpong=void 0;var ae={};this.context.uniforms.forEach(function(he){var xe=he.name,Ee=he.type,Ne=he.data,Et=he.isReferer,st=he.storageClass;if(st===Q.StorageBuffer){if(Et)ne.textureCache[xe]={data:void 0},ae["".concat(xe,"Size")]=function(){return Ne.compiledBundle.context.output.textureSize};else{ne.textureCache[xe]=ne.calcDataTexture(xe,Ee,Ne);var Pt=ne.textureCache[xe],$t=Pt.textureWidth,Ht=Pt.isOutput;ae["".concat(xe,"Size")]=[$t,$t],Ht&&(ne.outputTextureName=xe,ne.context.needPingpong&&(ne.outputTextureName="".concat(xe,"Output"),ne.textureCache[ne.outputTextureName]=ne.calcDataTexture(xe,Ee,Ne)))}ae[xe]=function(){return ct&&console.log("[".concat(ne.entity,"]: ").concat(xe," ").concat(ne.textureCache[xe].id)),ne.textureCache[xe].texture}}else if(st===Q.Uniform){if(Ne&&(Array.isArray(Ne)||L()(Ne))&&Ne.length>16)throw new Error("invalid data type ".concat(Ee));ae[xe]=function(){return he.data}}});var P=this.getOuputDataTexture(),S=P.textureWidth,C=P.texelCount;ae.u_OutputTextureSize=[S,S],ae.u_OutputTexelCount=C,this.context.output.textureSize=[S,S];var V={attributes:{a_Position:[[-1,1,0],[-1,-1,0],[1,1,0],[1,-1,0]],a_TexCoord:[[0,1],[0,0],[1,1],[1,0]]},frag:`#ifdef GL_FRAGMENT_PRECISION_HIGH
  231. precision highp float;
  232. #else
  233. precision mediump float;
  234. #endif
  235. `.concat(this.context.shader),uniforms:ae,vert:gn,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(V)}return(0,A.Z)(K,[{key:"run",value:function(){var rt=this;this.context.maxIteration>1&&this.context.needPingpong&&(this.compiledPingpong=!0),(this.compiledPingpong||this.dynamicPingpong)&&this.swap(),this.texFBO=this.reGl.framebuffer({color:this.getOuputDataTexture().texture}),this.texFBO.use(function(){rt.computeCommand()}),ct&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:function(){var Dt=(0,B.Z)(_().mark(function ne(){var ae=this,P,S,C,V,he,xe,Ee,Ne;return _().wrap(function(st){for(;;)switch(st.prev=st.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){P=ae.reGl.read()}),!P){st.next=6;break}if(S=this.getOuputDataTexture(),C=S.originalDataLength,V=S.elementsPerTexel,he=S.typedArrayConstructor,xe=he===void 0?Float32Array:he,Ee=[],V!==4)for(Ne=0;Ne<P.length;Ne+=4)V===1?Ee.push(P[Ne]):V===2?Ee.push(P[Ne],P[Ne+1]):Ee.push(P[Ne],P[Ne+1],P[Ne+2]);else Ee=P;return st.abrupt("return",new xe(Ee.slice(0,C)));case 6:return st.abrupt("return",new Float32Array);case 7:case"end":return st.stop()}},ne,this)}));function rt(){return Dt.apply(this,arguments)}return rt}()},{key:"confirmInput",value:function(rt,ne){var ae;this.entity===rt.entity?(this.dynamicPingpong=!0,ae=this):ae=rt,this.textureCache[ne].id=ae.getOuputDataTexture().id,this.textureCache[ne].texture=ae.getOuputDataTexture().texture,ct&&console.log("[".concat(this.entity,"]: confirm input ").concat(ne," from model ").concat(ae.entity,", ").concat(ae.getOuputDataTexture().id))}},{key:"updateUniform",value:function(){}},{key:"updateBuffer",value:function(rt,ne){var ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,P=this.context.uniforms.find(function(he){var xe=he.name;return xe===rt});if(P){var S=this.calcDataTexture(rt,P.type,ne),C=S.texture,V=S.data;this.textureCache[rt].data=V,this.textureCache[rt].texture=C}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var rt=this.context.output.name;this.textureCache[rt].id=this.getOuputDataTexture().id,this.textureCache[rt].texture=this.getOuputDataTexture().texture}var ne=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=ne,ct&&console.log("[".concat(this.entity,"]: after swap, output ").concat(this.getOuputDataTexture().id))}},{key:"getOuputDataTexture",value:function(){return this.textureCache[this.outputTextureName]}},{key:"createSwapOutputDataTexture",value:function(){var rt=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=rt}},{key:"cloneDataTexture",value:function(rt){var ne=rt.data,ae=rt.textureWidth;return $r($r({},rt),{},{id:Rr++,texture:this.reGl.texture({width:ae,height:ae,data:ne,type:"float"})})}},{key:"calcDataTexture",value:function(rt,ne,ae){var P=1;ne===X.Vector4FloatArray&&(P=4);for(var S=[],C=0;C<ae.length;C+=P)P===1?S.push(ae[C],0,0,0):P===2?S.push(ae[C],ae[C+1],0,0):P===3?S.push(ae[C],ae[C+1],ae[C+2],0):P===4&&S.push(ae[C],ae[C+1],ae[C+2],ae[C+3]);var V=ae.length,he=Math.ceil(V/P),xe=Math.ceil(Math.sqrt(he)),Ee=xe*xe;he<Ee&&S.push.apply(S,(0,Gn.Z)(new Array((Ee-he)*4).fill(0)));var Ne=this.reGl.texture({width:xe,height:xe,data:S,type:"float"});return{id:Rr++,data:S,originalDataLength:V,typedArrayConstructor:L()(ae)?ae.constructor:void 0,textureWidth:xe,texture:Ne,texelCount:he,elementsPerTexel:P,isOutput:rt===this.context.output.name}}}]),K}(),Er=function(){function K(Dt,rt){(0,R.Z)(this,K),this.elements=void 0;var ne=rt.data,ae=rt.usage,P=rt.type,S=rt.count;this.elements=Dt.elements({data:ne,usage:rr[ae||m.STATIC_DRAW],type:xr[P||m.UNSIGNED_BYTE],count:S})}return(0,A.Z)(K,[{key:"get",value:function(){return this.elements}},{key:"subData",value:function(rt){var ne=rt.data;this.elements.subdata(ne)}},{key:"destroy",value:function(){this.elements.destroy()}}]),K}(),Dr=function(){function K(Dt,rt){(0,R.Z)(this,K),this.framebuffer=void 0;var ne=rt.width,ae=rt.height,P=rt.color,S=rt.colors,C=rt.depth,V=rt.stencil,he={width:ne,height:ae};Array.isArray(S)&&(he.colors=S.map(function(xe){return xe.get()})),P&&typeof P!="boolean"&&(he.color=P.get()),this.framebuffer=Dt.framebuffer(he)}return(0,A.Z)(K,[{key:"get",value:function(){return this.framebuffer}},{key:"destroy",value:function(){this.framebuffer.destroy()}},{key:"resize",value:function(rt){var ne=rt.width,ae=rt.height;this.framebuffer.resize(ne,ae)}}]),K}(),Vr=z(90484),pn=z(68630),wn=z.n(pn);function Sn(K){var Dt={};return Object.keys(K).forEach(function(rt){In(rt,K[rt],Dt,"")}),Dt}function In(K,Dt,rt,ne){if(Dt===null||typeof Dt=="number"||typeof Dt=="boolean"||Array.isArray(Dt)&&typeof Dt[0]=="number"||L()(Dt)||Dt===""||Dt.resize!==void 0){rt["".concat(ne&&ne+".").concat(K)]=Dt;return}wn()(Dt)&&Object.keys(Dt).forEach(function(ae){In(ae,Dt[ae],rt,"".concat(ne&&ne+".").concat(K))}),Array.isArray(Dt)&&Dt.forEach(function(ae,P){Object.keys(ae).forEach(function(S){In(S,ae[S],rt,"".concat(ne&&ne+".").concat(K,"[").concat(P,"]"))})})}function $n(K,Dt){var rt=Object.keys(K);if(Object.getOwnPropertySymbols){var ne=Object.getOwnPropertySymbols(K);Dt&&(ne=ne.filter(function(ae){return Object.getOwnPropertyDescriptor(K,ae).enumerable})),rt.push.apply(rt,ne)}return rt}function Zr(K){for(var Dt=1;Dt<arguments.length;Dt++){var rt=arguments[Dt]!=null?arguments[Dt]:{};Dt%2?$n(Object(rt),!0).forEach(function(ne){(0,j.Z)(K,ne,rt[ne])}):Object.getOwnPropertyDescriptors?Object.defineProperties(K,Object.getOwnPropertyDescriptors(rt)):$n(Object(rt)).forEach(function(ne){Object.defineProperty(K,ne,Object.getOwnPropertyDescriptor(rt,ne))})}return K}var Pn=function(){function K(Dt,rt){(0,R.Z)(this,K),this.reGl=void 0,this.drawCommand=void 0,this.uniforms={},this.reGl=Dt;var ne=rt.vs,ae=rt.fs,P=rt.defines,S=rt.attributes,C=rt.uniforms,V=rt.primitive,he=rt.count,xe=rt.elements,Ee=rt.depth,Ne=rt.blend,Et=rt.stencil,st=rt.cull,Pt=rt.instances,$t=rt.scissor,Ht=rt.viewport,Br={};C&&(this.uniforms=Sn(C),Object.keys(C).forEach(function(pr){Br[pr]=Dt.prop(pr)}));var hn={};Object.keys(S).forEach(function(pr){hn[pr]=S[pr].get()});var Ot=P&&this.generateDefines(P)||"",Qt={attributes:hn,frag:`#ifdef GL_FRAGMENT_PRECISION_HIGH
  236. precision highp float;
  237. #else
  238. precision mediump float;
  239. #endif
  240. `.concat(Ot,`
  241. `).concat(ae),uniforms:Br,vert:`
  242. `.concat(Ot,`
  243. `).concat(ne),primitive:pt[V===void 0?m.TRIANGLES:V]};Pt&&(Qt.instances=Pt),he&&(Qt.count=he),xe&&(Qt.elements=xe.get()),$t&&(Qt.scissor=$t),Ht&&(Qt.viewport=Ht),this.initDepthDrawParams({depth:Ee},Qt),this.initBlendDrawParams({blend:Ne},Qt),this.initStencilDrawParams({stencil:Et},Qt),this.initCullDrawParams({cull:st},Qt),this.drawCommand=Dt(Qt)}return(0,A.Z)(K,[{key:"addUniforms",value:function(rt){this.uniforms=Zr(Zr({},this.uniforms),Sn(rt))}},{key:"draw",value:function(rt){var ne=Zr(Zr({},this.uniforms),Sn(rt.uniforms||{})),ae={};Object.keys(ne).forEach(function(P){var S=(0,Vr.Z)(ne[P]);S==="boolean"||S==="number"||Array.isArray(ne[P])||ne[P].BYTES_PER_ELEMENT?ae[P]=ne[P]:S==="string"||(ae[P]=ne[P].get())}),this.drawCommand(ae)}},{key:"destroy",value:function(){}},{key:"initDepthDrawParams",value:function(rt,ne){var ae=rt.depth;ae&&(ne.depth={enable:ae.enable===void 0?!0:!!ae.enable,mask:ae.mask===void 0?!0:!!ae.mask,func:Ur[ae.func||m.LESS],range:ae.range||[0,1]})}},{key:"initBlendDrawParams",value:function(rt,ne){var ae=rt.blend;if(ae){var P=ae.enable,S=ae.func,C=ae.equation,V=ae.color,he=V===void 0?[0,0,0,0]:V;ne.blend={enable:!!P,func:{srcRGB:Hr[S&&S.srcRGB||m.SRC_ALPHA],srcAlpha:Hr[S&&S.srcAlpha||m.SRC_ALPHA],dstRGB:Hr[S&&S.dstRGB||m.ONE_MINUS_SRC_ALPHA],dstAlpha:Hr[S&&S.dstAlpha||m.ONE_MINUS_SRC_ALPHA]},equation:{rgb:Ae[C&&C.rgb||m.FUNC_ADD],alpha:Ae[C&&C.alpha||m.FUNC_ADD]},color:he}}}},{key:"initStencilDrawParams",value:function(rt,ne){var ae=rt.stencil;if(ae){var P=ae.enable,S=ae.mask,C=S===void 0?-1:S,V=ae.func,he=V===void 0?{cmp:m.ALWAYS,ref:0,mask:-1}:V,xe=ae.opFront,Ee=xe===void 0?{fail:m.KEEP,zfail:m.KEEP,zpass:m.KEEP}:xe,Ne=ae.opBack,Et=Ne===void 0?{fail:m.KEEP,zfail:m.KEEP,zpass:m.KEEP}:Ne;ne.stencil={enable:!!P,mask:C,func:Zr(Zr({},he),{},{cmp:Sr[he.cmp]}),opFront:{fail:qr[Ee.fail],zfail:qr[Ee.zfail],zpass:qr[Ee.zpass]},opBack:{fail:qr[Et.fail],zfail:qr[Et.zfail],zpass:qr[Et.zpass]}}}}},{key:"initCullDrawParams",value:function(rt,ne){var ae=rt.cull;if(ae){var P=ae.enable,S=ae.face,C=S===void 0?m.BACK:S;ne.cull={enable:!!P,face:Gr[C]}}}},{key:"generateDefines",value:function(rt){return Object.keys(rt).map(function(ne){return"#define ".concat(ne," ").concat(Number(rt[ne]))}).join(`
  244. `)}}]),K}(),An=function(){function K(Dt,rt){(0,R.Z)(this,K),this.texture=void 0,this.width=void 0,this.height=void 0;var ne=rt.data,ae=rt.type,P=ae===void 0?m.UNSIGNED_BYTE:ae,S=rt.width,C=rt.height,V=rt.flipY,he=V===void 0?!1:V,xe=rt.format,Ee=xe===void 0?m.RGBA:xe,Ne=rt.mipmap,Et=Ne===void 0?!1:Ne,st=rt.wrapS,Pt=st===void 0?m.CLAMP_TO_EDGE:st,$t=rt.wrapT,Ht=$t===void 0?m.CLAMP_TO_EDGE:$t,Br=rt.aniso,hn=Br===void 0?0:Br,Ot=rt.alignment,Qt=Ot===void 0?1:Ot,pr=rt.premultiplyAlpha,en=pr===void 0?!1:pr,Nr=rt.mag,ta=Nr===void 0?m.NEAREST:Nr,kn=rt.min,En=kn===void 0?m.NEAREST:kn,Rn=rt.colorSpace,Yn=Rn===void 0?m.BROWSER_DEFAULT_WEBGL:Rn;this.width=S,this.height=C;var bn={width:S,height:C,type:xr[P],format:Vt[Ee],wrapS:qt[Pt],wrapT:qt[Ht],mag:Bt[ta],min:Bt[En],alignment:Qt,flipY:he,colorSpace:br[Yn],premultiplyAlpha:en,aniso:hn};ne&&(bn.data=ne),typeof Et=="number"?bn.mipmap=ft[Et]:typeof Et=="boolean"&&(bn.mipmap=Et),this.texture=Dt.texture(bn)}return(0,A.Z)(K,[{key:"get",value:function(){return this.texture}},{key:"update",value:function(){this.texture._texture.bind()}},{key:"resize",value:function(rt){var ne=rt.width,ae=rt.height;this.texture.resize(ne,ae),this.width=ne,this.height=ae}},{key:"destroy",value:function(){this.texture.destroy()}}]),K}(),ln=function(){function K(){var Dt=this;(0,R.Z)(this,K),this.supportWebGPU=!1,this.useWGSL=!1,this.$canvas=void 0,this.gl=void 0,this.inited=void 0,this.createModel=function(){var rt=(0,B.Z)(_().mark(function ne(ae){return _().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(!ae.uniforms){S.next=3;break}return S.next=3,Promise.all(Object.keys(ae.uniforms).map(function(){var C=(0,B.Z)(_().mark(function V(he){var xe;return _().wrap(function(Ne){for(;;)switch(Ne.prev=Ne.next){case 0:if(!(ae.uniforms[he]&&ae.uniforms[he].load!==void 0)){Ne.next=5;break}return Ne.next=3,ae.uniforms[he].load();case 3:xe=Ne.sent,ae.uniforms[he]=xe;case 5:case"end":return Ne.stop()}},V)}));return function(V){return C.apply(this,arguments)}}()));case 3:return S.abrupt("return",new Pn(Dt.gl,ae));case 4:case"end":return S.stop()}},ne)}));return function(ne){return rt.apply(this,arguments)}}(),this.createAttribute=function(rt){return new be(Dt.gl,rt)},this.createBuffer=function(rt){return new vn(Dt.gl,rt)},this.createElements=function(rt){return new Er(Dt.gl,rt)},this.createTexture2D=function(rt){return new An(Dt.gl,rt)},this.createFramebuffer=function(rt){return new Dr(Dt.gl,rt)},this.useFramebuffer=function(rt,ne){Dt.gl({framebuffer:rt?rt.get():null})(ne)},this.createComputeModel=function(){var rt=(0,B.Z)(_().mark(function ne(ae){return _().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.abrupt("return",new Wt(Dt.gl,ae));case 1:case"end":return S.stop()}},ne)}));return function(ne){return rt.apply(this,arguments)}}(),this.clear=function(rt){var ne=rt.color,ae=rt.depth,P=rt.stencil,S=rt.framebuffer,C=S===void 0?null:S,V={color:ne,depth:ae,stencil:P};V.framebuffer=C===null?C:C.get(),Dt.gl.clear(V)},this.setScissor=function(rt){Dt.gl&&Dt.gl._gl&&(rt.enable&&rt.box?(Dt.gl._gl.enable(m.SCISSOR_TEST),Dt.gl._gl.scissor(rt.box.x,rt.box.y,rt.box.width,rt.box.height)):Dt.gl._gl.disable(m.SCISSOR_TEST),Dt.gl._refresh())},this.viewport=function(rt){var ne=rt.x,ae=rt.y,P=rt.width,S=rt.height;Dt.gl&&Dt.gl._gl&&(Dt.gl._gl.viewport(ne,ae,P,S),Dt.gl._refresh())},this.readPixels=function(rt){var ne=rt.framebuffer,ae=rt.x,P=rt.y,S=rt.width,C=rt.height,V={x:ae,y:P,width:S,height:C};return ne&&(V.framebuffer=ne.get()),Dt.gl.read(V)},this.getCanvas=function(){return Dt.$canvas},this.getGLContext=function(){return Dt.gl._gl},this.destroy=function(){Dt.gl&&(Dt.gl.destroy(),Dt.inited=!1)}}return(0,A.Z)(K,[{key:"init",value:function(){var Dt=(0,B.Z)(_().mark(function ne(ae){return _().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(!this.inited){S.next=2;break}return S.abrupt("return");case 2:return this.$canvas=ae.canvas,S.next=5,new Promise(function(C,V){Ie()({canvas:ae.canvas,attributes:{alpha:!0,antialias:ae.antialias,premultipliedAlpha:!0},pixelRatio:1,extensions:["OES_element_index_uint","OES_texture_float","OES_standard_derivatives","angle_instanced_arrays"],optionalExtensions:["EXT_texture_filter_anisotropic","EXT_blend_minmax","WEBGL_depth_texture"],profile:!0,onDone:function(xe,Ee){(xe||!Ee)&&V(xe),C(Ee)}})});case 5:this.gl=S.sent,this.inited=!0;case 7:case"end":return S.stop()}},ne,this)}));function rt(ne){return Dt.apply(this,arguments)}return rt}()},{key:"isFloatSupported",value:function(){return this.gl.limits.readFloat}},{key:"beginFrame",value:function(){}},{key:"endFrame",value:function(){}}]),K}(),va=function(){function K(){(0,R.Z)(this,K),this.engine=void 0,this.configService=new $}return(0,A.Z)(K,[{key:"setConfig",value:function(rt){this.configService.set(rt)}},{key:"setEngine",value:function(rt){this.engine=rt}},{key:"createEntity",value:function(){return T()}},{key:"createKernel",value:function(rt){var ne=new Te(this.engine,this.configService);return typeof rt=="string"?ne.setBundle(JSON.parse(rt)):ne.setBundle(rt),ne.init(),ne}},{key:"destroy",value:function(){this.engine.destroy()}}],[{key:"create",value:function(){var rt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ne=new K;return ne.setConfig(rt),ne.setEngine(new ln),ne}}]),K}()},67320:function(or,U,z){"use strict";var B=this&&this.__createBinding||(Object.create?function(A,N,L,y){y===void 0&&(y=L);var x=Object.getOwnPropertyDescriptor(N,L);(!x||("get"in x?!N.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return N[L]}}),Object.defineProperty(A,y,x)}:function(A,N,L,y){y===void 0&&(y=L),A[y]=N[L]}),j=this&&this.__exportStar||function(A,N){for(var L in A)L!=="default"&&!Object.prototype.hasOwnProperty.call(N,L)&&B(N,A,L)};Object.defineProperty(U,"__esModule",{value:!0}),U.getLayoutByName=U.unRegisterLayout=U.registerLayout=void 0;var R=z(39464);Object.defineProperty(U,"registerLayout",{enumerable:!0,get:function(){return R.registerLayout}}),Object.defineProperty(U,"unRegisterLayout",{enumerable:!0,get:function(){return R.unRegisterLayout}}),Object.defineProperty(U,"getLayoutByName",{enumerable:!0,get:function(){return R.getLayoutByName}}),j(z(64649),U)},46253:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.Base=void 0;var z=function(){function B(){this.nodes=[],this.edges=[],this.combos=[],this.comboEdges=[],this.hiddenNodes=[],this.hiddenEdges=[],this.hiddenCombos=[],this.vedges=[],this.positions=[],this.destroyed=!1,this.onLayoutEnd=function(){}}return B.prototype.layout=function(j){return this.init(j),this.execute(!0)},B.prototype.init=function(j){this.nodes=j.nodes||[],this.edges=j.edges||[],this.combos=j.combos||[],this.comboEdges=j.comboEdges||[],this.hiddenNodes=j.hiddenNodes||[],this.hiddenEdges=j.hiddenEdges||[],this.hiddenCombos=j.hiddenCombos||[],this.vedges=j.vedges||[]},B.prototype.execute=function(j){},B.prototype.executeWithWorker=function(){},B.prototype.getDefaultCfg=function(){return{}},B.prototype.updateCfg=function(j){j&&Object.assign(this,j)},B.prototype.getType=function(){return"base"},B.prototype.destroy=function(){this.nodes=null,this.edges=null,this.combos=null,this.positions=null,this.destroyed=!0},B}();U.Base=z},93959:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var x=function(v,g){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,_){d.__proto__=_}||function(d,_){for(var E in _)Object.prototype.hasOwnProperty.call(_,E)&&(d[E]=_[E])},x(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");x(v,g);function d(){this.constructor=v}v.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.CircularLayout=void 0;var j=z(46253),R=z(8273);function A(x,v,g,d){x.forEach(function(_,E){x[E].children=[],x[E].parent=[]}),d?v.forEach(function(_){var E=(0,R.getEdgeTerminal)(_,"source"),w=(0,R.getEdgeTerminal)(_,"target"),T=0;E&&(T=g[E]);var k=0;w&&(k=g[w]);var b=x[T].children,m=x[k].parent;b.push(x[k].id),m.push(x[T].id)}):v.forEach(function(_){var E=(0,R.getEdgeTerminal)(_,"source"),w=(0,R.getEdgeTerminal)(_,"target"),T=0;E&&(T=g[E]);var k=0;w&&(k=g[w]);var b=x[T].children,m=x[k].children;b.push(x[k].id),m.push(x[T].id)})}function N(x,v,g){for(var d=g.length,_=0;_<d;_++){var E=(0,R.getEdgeTerminal)(g[_],"source"),w=(0,R.getEdgeTerminal)(g[_],"target");if(x.id===E&&v.id===w||v.id===E&&x.id===w)return!0}return!1}function L(x,v){var g=x.degree,d=v.degree;return g<d?-1:g>d?1:0}var y=function(x){B(v,x);function v(g){var d=x.call(this)||this;return d.radius=null,d.nodeSize=void 0,d.startRadius=null,d.endRadius=null,d.startAngle=0,d.endAngle=2*Math.PI,d.clockwise=!0,d.divisions=1,d.ordering=null,d.angleRatio=1,d.nodes=[],d.edges=[],d.nodeMap={},d.degrees=[],d.width=300,d.height=300,d.updateCfg(g),d}return v.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},v.prototype.execute=function(){var g,d=this,_=d.nodes,E=d.edges,w=_.length;if(w===0){d.onLayoutEnd&&d.onLayoutEnd();return}!d.width&&typeof window!="undefined"&&(d.width=window.innerWidth),!d.height&&typeof window!="undefined"&&(d.height=window.innerHeight),d.center||(d.center=[d.width/2,d.height/2]);var T=d.center;if(w===1){_[0].x=T[0],_[0].y=T[1],d.onLayoutEnd&&d.onLayoutEnd();return}var k=d.radius,b=d.startRadius,m=d.endRadius,$=d.divisions,W=d.startAngle,X=d.endAngle,H=d.angleRatio,Q=d.ordering,q=d.clockwise,J=d.nodeSpacing,te=d.nodeSize,fe=(X-W)/w,de={};_.forEach(function(Rt,tr){de[Rt.id]=tr}),d.nodeMap=de;var Te=(0,R.getDegree)(_.length,de,E);if(d.degrees=Te,J){var Se=(0,R.getFuncByUnknownType)(10,J),Ie=(0,R.getFuncByUnknownType)(10,te),be=-Infinity;_.forEach(function(Rt){var tr=Ie(Rt);be<tr&&(be=tr)});var pe=0;_.forEach(function(Rt,tr){tr===0?pe+=be||10:pe+=(Se(Rt)||0)+(be||10)}),k=pe/(2*Math.PI)}else!k&&!b&&!m?k=d.height>d.width?d.width/2:d.height/2:!b&&m?b=m:b&&!m&&(m=b);var Me=fe*H,De=[];Q==="topology"?De=d.topologyOrdering():Q==="topology-directed"?De=d.topologyOrdering(!0):Q==="degree"?De=d.degreeOrdering():De=_;for(var Ue=Math.ceil(w/$),nt=0;nt<w;++nt){var Ze=k;!Ze&&b!==null&&m!==null&&(Ze=b+nt*(m-b)/(w-1)),Ze||(Ze=10+nt*100/(w-1));var ht=W+nt%Ue*Me+2*Math.PI/$*Math.floor(nt/Ue);q||(ht=X-nt%Ue*Me-2*Math.PI/$*Math.floor(nt/Ue)),De[nt].x=T[0]+Math.cos(ht)*Ze,De[nt].y=T[1]+Math.sin(ht)*Ze,De[nt].weight=Te[nt].all}return(g=d.onLayoutEnd)===null||g===void 0||g.call(d),{nodes:De,edges:this.edges}},v.prototype.topologyOrdering=function(g){g===void 0&&(g=!1);var d=this,_=d.degrees,E=d.edges,w=d.nodes,T=(0,R.clone)(w),k=d.nodeMap,b=[T[0]],m=[w[0]],$=[],W=w.length;$[0]=!0,A(T,E,k,g);var X=0;return T.forEach(function(H,Q){if(Q!==0)if((Q===W-1||_[Q].all!==_[Q+1].all||N(b[X],H,E))&&!$[Q])b.push(H),m.push(w[k[H.id]]),$[Q]=!0,X++;else{for(var q=b[X].children,J=!1,te=0;te<q.length;te++){var fe=k[q[te]];if(_[fe].all===_[Q].all&&!$[fe]){b.push(T[fe]),m.push(w[k[T[fe].id]]),$[fe]=!0,J=!0;break}}for(var de=0;!J&&($[de]||(b.push(T[de]),m.push(w[k[T[de].id]]),$[de]=!0,J=!0),de++,de!==W););}}),m},v.prototype.degreeOrdering=function(){var g=this,d=g.nodes,_=[],E=g.degrees;return d.forEach(function(w,T){w.degree=E[T].all,_.push(w)}),_.sort(L),_},v.prototype.getType=function(){return"circular"},v}(j.Base);U.CircularLayout=y},6412:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var x=function(v,g){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,_){d.__proto__=_}||function(d,_){for(var E in _)Object.prototype.hasOwnProperty.call(_,E)&&(d[E]=_[E])},x(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");x(v,g);function d(){this.constructor=v}v.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}(),j=this&&this.__assign||function(){return j=Object.assign||function(x){for(var v,g=1,d=arguments.length;g<d;g++){v=arguments[g];for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(x[_]=v[_])}return x},j.apply(this,arguments)};Object.defineProperty(U,"__esModule",{value:!0}),U.ComboCombinedLayout=void 0;var R=z(24979),A=z(46253),N=z(8273),L=z(64649),y=function(x){B(v,x);function v(g){var d=x.call(this)||this;return d.center=[0,0],d.nodes=[],d.edges=[],d.combos=[],d.comboEdges=[],d.comboPadding=10,d.comboTrees=[],d.updateCfg(g),d}return v.prototype.getDefaultCfg=function(){return{}},v.prototype.execute=function(){var g=this,d=g.nodes,_=g.center;if(!d||d.length===0){g.onLayoutEnd&&g.onLayoutEnd();return}if(d.length===1){d[0].x=_[0],d[0].y=_[1],g.onLayoutEnd&&g.onLayoutEnd();return}g.initVals(),g.run(),g.onLayoutEnd&&g.onLayoutEnd()},v.prototype.run=function(){var g,d=this,_=d.nodes,E=d.edges,w=d.combos,T=d.comboEdges,k=d.center,b={};_.forEach(function(be){b[be.id]=be});var m={};w.forEach(function(be){m[be.id]=be});var $=d.getInnerGraphs(b),W=[],X=[],H={},Q=!0;this.comboTrees.forEach(function(be){var pe=$[be.id],Me=j(j({},be),{x:pe.x||m[be.id].x,y:pe.y||m[be.id].y,fx:pe.fx||m[be.id].fx,fy:pe.fy||m[be.id].fy,mass:pe.mass||m[be.id].mass,size:pe.size});X.push(Me),!isNaN(Me.x)&&Me.x!==0&&!isNaN(Me.y)&&Me.y!==0?Q=!1:(Me.x=Math.random()*100,Me.y=Math.random()*100),W.push(be.id),(0,N.traverseTreeUp)(be,function(De){return De.id!==be.id&&(H[De.id]=be.id),!0})}),_.forEach(function(be){if(!(be.comboId&&m[be.comboId])){var pe=j({},be);X.push(pe),!isNaN(pe.x)&&pe.x!==0&&!isNaN(pe.y)&&pe.y!==0?Q=!1:(pe.x=Math.random()*100,pe.y=Math.random()*100),W.push(be.id)}});var q=[];if(E.concat(T).forEach(function(be){var pe=H[be.source]||be.source,Me=H[be.target]||be.target;pe!==Me&&W.includes(pe)&&W.includes(Me)&&q.push({source:pe,target:Me})}),X==null?void 0:X.length){if(X.length===1)X[0].x=k[0],X[0].y=k[1];else{var J={nodes:X,edges:q},te=this.outerLayout||new L.GForceLayout({gravity:1,factor:4,linkDistance:function(be,pe,Me){var De,Ue,nt=((((De=pe.size)===null||De===void 0?void 0:De[0])||30)+(((Ue=Me.size)===null||Ue===void 0?void 0:Ue[0])||30))/2;return Math.min(nt*1.5,700)}}),fe=(g=te.getType)===null||g===void 0?void 0:g.call(te);if(te.updateCfg({center:k,kg:5,preventOverlap:!0,animate:!1}),Q&&R.FORCE_LAYOUT_TYPE_MAP[fe]){var de=X.length<100?new L.MDSLayout:new L.GridLayout;de.layout(J)}te.layout(J)}X.forEach(function(be){var pe=$[be.id];if(!pe){var Me=b[be.id];Me&&(Me.x=be.x,Me.y=be.y);return}pe.visited=!0,pe.x=be.x,pe.y=be.y,pe.nodes.forEach(function(De){De.x+=be.x,De.y+=be.y})})}for(var Te=Object.keys($),Se=function(be){var pe=Te[be],Me=$[pe];if(!Me)return"continue";Me.nodes.forEach(function(De){Me.visited||(De.x+=Me.x||0,De.y+=Me.y||0),b[De.id]&&(b[De.id].x=De.x,b[De.id].y=De.y)}),m[pe]&&(m[pe].x=Me.x,m[pe].y=Me.y)},Ie=Te.length-1;Ie>=0;Ie--)Se(Ie);return{nodes:_,edges:E,combos:w,comboEdges:T}},v.prototype.getInnerGraphs=function(g){var d=this,_=d.comboTrees,E=d.nodeSize,w=d.edges,T=d.comboPadding,k=d.spacing,b={},m=this.innerLayout||new L.ConcentricLayout({sortBy:"id"});return m.center=[0,0],m.preventOverlap=!0,m.nodeSpacing=k,(_||[]).forEach(function($){(0,N.traverseTreeUp)($,function(W){var X,H=(T==null?void 0:T(W))||10;if((0,N.isArray)(H)&&(H=Math.max.apply(Math,H)),(X=W.children)===null||X===void 0?void 0:X.length){var q=W.children.map(function(De){if(De.itemType==="combo")return b[De.id];var Ue=g[De.id]||{};return j(j({},Ue),De)}),J=q.map(function(De){return De.id}),te={nodes:q,edges:w.filter(function(De){return J.includes(De.source)&&J.includes(De.target)})},fe=Infinity;q.forEach(function(De){var Ue;De.size||(De.size=((Ue=b[De.id])===null||Ue===void 0?void 0:Ue.size)||(E==null?void 0:E(De))||[30,30]),(0,N.isNumber)(De.size)&&(De.size=[De.size,De.size]),fe>De.size[0]&&(fe=De.size[0]),fe>De.size[1]&&(fe=De.size[1])}),m.layout(te);var de=(0,N.getLayoutBBox)(q),Te=de.minX,Se=de.minY,Ie=de.maxX,be=de.maxY,pe={x:(Ie+Te)/2,y:(be+Se)/2};te.nodes.forEach(function(De){De.x-=pe.x,De.y-=pe.y});var Me=Math.max(Ie-Te,be-Se,fe)+H*2;b[W.id]={id:W.id,nodes:q,size:[Me,Me]}}else if(W.itemType==="combo"){var Q=H?[H*2,H*2]:[30,30];b[W.id]={id:W.id,nodes:[],size:Q}}return!0})}),b},v.prototype.initVals=function(){var g=this,d=g.nodeSize,_=g.spacing,E,w;if((0,N.isNumber)(_)?w=function(){return _}:(0,N.isFunction)(_)?w=_:w=function(){return 0},this.spacing=w,!d)E=function(W){var X=w(W);if(W.size){if((0,N.isArray)(W.size)){var H=W.size[0]>W.size[1]?W.size[0]:W.size[1];return(H+X)/2}if((0,N.isObject)(W.size)){var H=W.size.width>W.size.height?W.size.width:W.size.height;return(H+X)/2}return(W.size+X)/2}return 10+X/2};else if((0,N.isFunction)(d))E=function(W){var X=d(W),H=w(W);if((0,N.isArray)(W.size)){var Q=W.size[0]>W.size[1]?W.size[0]:W.size[1];return(Q+H)/2}return((X||10)+H)/2};else if((0,N.isArray)(d)){var T=d[0]>d[1]?d[0]:d[1],k=T/2;E=function(W){return k+w(W)/2}}else{var b=d/2;E=function(W){return b+w(W)/2}}this.nodeSize=E;var m=g.comboPadding,$;(0,N.isNumber)(m)?$=function(){return m}:(0,N.isArray)(m)?$=function(){return Math.max.apply(null,m)}:(0,N.isFunction)(m)?$=m:$=function(){return 0},this.comboPadding=$},v.prototype.getType=function(){return"comboCombined"},v}(A.Base);U.ComboCombinedLayout=y},48133:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var N=function(L,y){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,v){x.__proto__=v}||function(x,v){for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(x[g]=v[g])},N(L,y)};return function(L,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");N(L,y);function x(){this.constructor=L}L.prototype=y===null?Object.create(y):(x.prototype=y.prototype,new x)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.ComboForceLayout=void 0;var j=z(46253),R=z(8273),A=function(N){B(L,N);function L(y){var x=N.call(this)||this;return x.center=[0,0],x.maxIteration=100,x.gravity=10,x.comboGravity=10,x.linkDistance=10,x.alpha=1,x.alphaMin=.001,x.alphaDecay=1-Math.pow(x.alphaMin,1/300),x.alphaTarget=0,x.velocityDecay=.6,x.edgeStrength=.6,x.nodeStrength=30,x.preventOverlap=!1,x.preventNodeOverlap=!1,x.preventComboOverlap=!1,x.collideStrength=void 0,x.nodeCollideStrength=.5,x.comboCollideStrength=.5,x.comboSpacing=20,x.comboPadding=10,x.optimizeRangeFactor=1,x.onTick=function(){},x.onLayoutEnd=function(){},x.depthAttractiveForceScale=1,x.depthRepulsiveForceScale=2,x.nodes=[],x.edges=[],x.combos=[],x.comboTrees=[],x.width=300,x.height=300,x.bias=[],x.nodeMap={},x.oriComboMap={},x.indexMap={},x.comboMap={},x.previousLayouted=!1,x.updateCfg(y),x}return L.prototype.getDefaultCfg=function(){return{maxIteration:100,center:[0,0],gravity:10,speed:1,comboGravity:30,preventOverlap:!1,preventComboOverlap:!0,preventNodeOverlap:!0,nodeSpacing:void 0,collideStrength:void 0,nodeCollideStrength:.5,comboCollideStrength:.5,comboSpacing:20,comboPadding:10,edgeStrength:.6,nodeStrength:30,linkDistance:10}},L.prototype.execute=function(){var y=this,x=y.nodes,v=y.center;if(y.comboTree={id:"comboTreeRoot",depth:-1,children:y.comboTrees},!x||x.length===0){y.onLayoutEnd&&y.onLayoutEnd();return}if(x.length===1){x[0].x=v[0],x[0].y=v[1],y.onLayoutEnd&&y.onLayoutEnd();return}y.initVals(),y.run(),y.onLayoutEnd&&y.onLayoutEnd()},L.prototype.run=function(){var y=this,x=y.nodes,v=y.previousLayouted?y.maxIteration/5:y.maxIteration;!y.width&&typeof window!="undefined"&&(y.width=window.innerWidth),!y.height&&typeof window!="undefined"&&(y.height=window.innerHeight);var g=y.center,d=y.velocityDecay,_=y.comboMap;y.previousLayouted||y.initPos(_);for(var E=function(b){var m=[];x.forEach(function($,W){m[W]={x:0,y:0}}),y.applyCalculate(m),y.applyComboCenterForce(m),x.forEach(function($,W){!(0,R.isNumber)($.x)||!(0,R.isNumber)($.y)||($.x+=m[W].x*d,$.y+=m[W].y*d)}),y.alpha+=(y.alphaTarget-y.alpha)*y.alphaDecay,y.onTick()},w=0;w<v;w++)E(w);var T=[0,0];x.forEach(function(b){!(0,R.isNumber)(b.x)||!(0,R.isNumber)(b.y)||(T[0]+=b.x,T[1]+=b.y)}),T[0]/=x.length,T[1]/=x.length;var k=[g[0]-T[0],g[1]-T[1]];x.forEach(function(b,m){!(0,R.isNumber)(b.x)||!(0,R.isNumber)(b.y)||(b.x+=k[0],b.y+=k[1])}),y.combos.forEach(function(b){var m=_[b.id];m&&m.empty&&(b.x=m.cx||b.x,b.y=m.cy||b.y)}),y.previousLayouted=!0},L.prototype.initVals=function(){var y=this,x=y.edges,v=y.nodes,g=y.combos,d={},_={},E={};v.forEach(function(Ze,ht){_[Ze.id]=Ze,E[Ze.id]=ht}),y.nodeMap=_,y.indexMap=E;var w={};g.forEach(function(Ze){w[Ze.id]=Ze}),y.oriComboMap=w,y.comboMap=y.getComboMap();var T=y.preventOverlap;y.preventComboOverlap=y.preventComboOverlap||T,y.preventNodeOverlap=y.preventNodeOverlap||T;var k=y.collideStrength;k&&(y.comboCollideStrength=k,y.nodeCollideStrength=k),y.comboCollideStrength=y.comboCollideStrength?y.comboCollideStrength:0,y.nodeCollideStrength=y.nodeCollideStrength?y.nodeCollideStrength:0;for(var b=0;b<x.length;++b){var m=(0,R.getEdgeTerminal)(x[b],"source"),$=(0,R.getEdgeTerminal)(x[b],"target");d[m]?d[m]++:d[m]=1,d[$]?d[$]++:d[$]=1}for(var W=[],b=0;b<x.length;++b){var m=(0,R.getEdgeTerminal)(x[b],"source"),$=(0,R.getEdgeTerminal)(x[b],"target");W[b]=d[m]/(d[m]+d[$])}this.bias=W;var X=y.nodeSize,H=y.nodeSpacing,Q,q;if((0,R.isNumber)(H)?q=function(){return H}:(0,R.isFunction)(H)?q=H:q=function(){return 0},this.nodeSpacing=q,!X)Q=function(Ze){if(Ze.size){if((0,R.isArray)(Ze.size)){var ht=Ze.size[0]>Ze.size[1]?Ze.size[0]:Ze.size[1];return ht/2}if((0,R.isObject)(Ze.size)){var ht=Ze.size.width>Ze.size.height?Ze.size.width:Ze.size.height;return ht/2}return Ze.size/2}return 10};else if((0,R.isFunction)(X))Q=function(Ze){return X(Ze)};else if((0,R.isArray)(X)){var J=X[0]>X[1]?X[0]:X[1],te=J/2;Q=function(Ze){return te}}else{var fe=X/2;Q=function(Ze){return fe}}this.nodeSize=Q;var de=y.comboSpacing,Te;(0,R.isNumber)(de)?Te=function(){return de}:(0,R.isFunction)(de)?Te=de:Te=function(){return 0},this.comboSpacing=Te;var Se=y.comboPadding,Ie;(0,R.isNumber)(Se)?Ie=function(){return Se}:(0,R.isArray)(Se)?Ie=function(){return Math.max.apply(null,Se)}:(0,R.isFunction)(Se)?Ie=Se:Ie=function(){return 0},this.comboPadding=Ie;var be=this.linkDistance,pe;be||(be=10),(0,R.isNumber)(be)?pe=function(Ze){return be}:pe=be,this.linkDistance=pe;var Me=this.edgeStrength,De;Me||(Me=1),(0,R.isNumber)(Me)?De=function(Ze){return Me}:De=Me,this.edgeStrength=De;var Ue=this.nodeStrength,nt;Ue||(Ue=30),(0,R.isNumber)(Ue)?nt=function(Ze){return Ue}:nt=Ue,this.nodeStrength=nt},L.prototype.initPos=function(y){var x=this,v=x.nodes;v.forEach(function(g,d){var _=g.comboId,E=y[_];_&&E?(g.x=E.cx+100/(d+1),g.y=E.cy+100/(d+1)):(g.x=100/(d+1),g.y=100/(d+1))})},L.prototype.getComboMap=function(){var y=this,x=y.nodeMap,v=y.comboTrees,g=y.oriComboMap,d={};return(v||[]).forEach(function(_){var E=[];(0,R.traverseTreeUp)(_,function(w){if(w.itemType==="node"||!g[w.id])return!0;if(d[w.id]===void 0){var T={id:w.id,name:w.id,cx:0,cy:0,count:0,depth:y.oriComboMap[w.id].depth||0,children:[]};d[w.id]=T}var k=w.children;k&&k.forEach(function($){if(!d[$.id]&&!x[$.id])return!0;E.push($)});var b=d[w.id];if(b.cx=0,b.cy=0,E.length===0){b.empty=!0;var m=g[w.id];b.cx=m.x,b.cy=m.y}return E.forEach(function($){if(b.count++,$.itemType!=="node"){var W=d[$.id];(0,R.isNumber)(W.cx)&&(b.cx+=W.cx),(0,R.isNumber)(W.cy)&&(b.cy+=W.cy);return}var X=x[$.id];!X||((0,R.isNumber)(X.x)&&(b.cx+=X.x),(0,R.isNumber)(X.y)&&(b.cy+=X.y))}),b.cx/=b.count||1,b.cy/=b.count||1,b.children=E,!0})}),d},L.prototype.applyComboCenterForce=function(y){var x=this,v=x.gravity,g=x.comboGravity||v,d=this.alpha,_=x.comboTrees,E=x.indexMap,w=x.nodeMap,T=x.comboMap;(_||[]).forEach(function(k){(0,R.traverseTreeUp)(k,function(b){if(b.itemType==="node")return!0;var m=T[b.id];if(!m)return!0;var $=T[b.id],W=($.depth+1)/10*.5,X=$.cx,H=$.cy;return $.cx=0,$.cy=0,$.children.forEach(function(Q){if(Q.itemType!=="node"){var q=T[Q.id];q&&(0,R.isNumber)(q.cx)&&($.cx+=q.cx),q&&(0,R.isNumber)(q.cy)&&($.cy+=q.cy);return}var J=w[Q.id],te=J.x-X||.005,fe=J.y-H||.005,de=Math.sqrt(te*te+fe*fe),Te=E[J.id],Se=g*d/de*W;y[Te].x-=te*Se,y[Te].y-=fe*Se,(0,R.isNumber)(J.x)&&($.cx+=J.x),(0,R.isNumber)(J.y)&&($.cy+=J.y)}),$.cx/=$.count||1,$.cy/=$.count||1,!0})})},L.prototype.applyCalculate=function(y){var x=this,v=x.comboMap,g=x.nodes,d={};g.forEach(function(E,w){g.forEach(function(T,k){if(!(w<k)){var b=E.x-T.x||.005,m=E.y-T.y||.005,$=b*b+m*m,W=Math.sqrt($);$<1&&($=W),d["".concat(E.id,"-").concat(T.id)]={vx:b,vy:m,vl2:$,vl:W},d["".concat(T.id,"-").concat(E.id)]={vl2:$,vl:W,vx:-b,vy:-m}}})}),x.updateComboSizes(v),x.calRepulsive(y,d),x.calAttractive(y,d);var _=x.preventComboOverlap;_&&x.comboNonOverlapping(y,v)},L.prototype.updateComboSizes=function(y){var x=this,v=x.comboTrees,g=x.nodeMap,d=x.nodeSize,_=x.comboSpacing,E=x.comboPadding;(v||[]).forEach(function(w){var T=[];(0,R.traverseTreeUp)(w,function(k){if(k.itemType==="node")return!0;var b=y[k.id];if(!b)return!1;var m=k.children;m&&m.forEach(function(X){!y[X.id]&&!g[X.id]||T.push(X)}),b.minX=Infinity,b.minY=Infinity,b.maxX=-Infinity,b.maxY=-Infinity,T.forEach(function(X){if(X.itemType!=="node")return!0;var H=g[X.id];if(!H)return!0;var Q=d(H),q=H.x-Q,J=H.y-Q,te=H.x+Q,fe=H.y+Q;b.minX>q&&(b.minX=q),b.minY>J&&(b.minY=J),b.maxX<te&&(b.maxX=te),b.maxY<fe&&(b.maxY=fe)});var $=x.oriComboMap[k.id].size||10;(0,R.isArray)($)&&($=$[0]);var W=Math.max(b.maxX-b.minX,b.maxY-b.minY,$);return b.r=W/2+_(b)/2+E(b),!0})})},L.prototype.comboNonOverlapping=function(y,x){var v=this,g=v.comboTree,d=v.comboCollideStrength,_=v.indexMap,E=v.nodeMap;(0,R.traverseTreeUp)(g,function(w){if(!x[w.id]&&!E[w.id]&&w.id!=="comboTreeRoot")return!1;var T=w.children;return T&&T.length>1&&T.forEach(function(k,b){if(k.itemType==="node")return!1;var m=x[k.id];!m||T.forEach(function($,W){if(b<=W||$.itemType==="node")return!1;var X=x[$.id];if(!X)return!1;var H=m.cx-X.cx||.005,Q=m.cy-X.cy||.005,q=H*H+Q*Q,J=m.r||1,te=X.r||1,fe=J+te,de=te*te,Te=J*J;if(q<fe*fe){var Se=k.children;if(!Se||Se.length===0)return!1;var Ie=$.children;if(!Ie||Ie.length===0)return!1;var be=Math.sqrt(q),pe=(fe-be)/be*d,Me=H*pe,De=Q*pe,Ue=de/(Te+de),nt=1-Ue;Se.forEach(function(Ze){if(Ze.itemType!=="node")return!1;if(!!E[Ze.id]){var ht=_[Ze.id];Ie.forEach(function(Rt){if(Rt.itemType!=="node"||!E[Rt.id])return!1;var tr=_[Rt.id];y[ht].x+=Me*Ue,y[ht].y+=De*Ue,y[tr].x-=Me*nt,y[tr].y-=De*nt})}})}})}),!0})},L.prototype.calRepulsive=function(y,x){var v=this,g=v.nodes,d=v.width*v.optimizeRangeFactor,_=v.nodeStrength,E=v.alpha,w=v.nodeCollideStrength,T=v.preventNodeOverlap,k=v.nodeSize,b=v.nodeSpacing,m=v.depthRepulsiveForceScale,$=v.center;g.forEach(function(W,X){if(!(!W.x||!W.y)){if($){var H=v.gravity,Q=W.x-$[0]||.005,q=W.y-$[1]||.005,J=Math.sqrt(Q*Q+q*q);y[X].x-=Q*H*E/J,y[X].y-=q*H*E/J}g.forEach(function(te,fe){if(X!==fe&&!(!te.x||!te.y)){var de=x["".concat(W.id,"-").concat(te.id)],Te=de.vl2,Se=de.vl;if(!(Se>d)){var Ie=x["".concat(W.id,"-").concat(te.id)],be=Ie.vx,pe=Ie.vy,Me=Math.log(Math.abs(te.depth-W.depth)/10)+1||1;Me=Me<1?1:Me,te.comboId!==W.comboId&&(Me+=1);var De=Me?Math.pow(m,Me):1,Ue=_(te)*E/Te*De;if(y[X].x+=be*Ue,y[X].y+=pe*Ue,X<fe&&T){var nt=k(W)+b(W)||1,Ze=k(te)+b(te)||1,ht=nt+Ze;if(Te<ht*ht){var Rt=(ht-Se)/Se*w,tr=Ze*Ze,Qe=tr/(nt*nt+tr),lt=be*Rt,St=pe*Rt;y[X].x+=lt*Qe,y[X].y+=St*Qe,Qe=1-Qe,y[fe].x-=lt*Qe,y[fe].y-=St*Qe}}}}})}})},L.prototype.calAttractive=function(y,x){var v=this,g=v.edges,d=v.linkDistance,_=v.alpha,E=v.edgeStrength,w=v.bias,T=v.depthAttractiveForceScale;g.forEach(function(k,b){var m=(0,R.getEdgeTerminal)(k,"source"),$=(0,R.getEdgeTerminal)(k,"target");if(!(!m||!$||m===$)){var W=v.indexMap[m],X=v.indexMap[$],H=v.nodeMap[m],Q=v.nodeMap[$];if(!(!H||!Q)){var q=H.depth===Q.depth?0:Math.log(Math.abs(H.depth-Q.depth)/10);H.comboId===Q.comboId&&(q=q/2);var J=q?Math.pow(T,q):1;if(H.comboId!==Q.comboId&&J===1?J=T/2:H.comboId===Q.comboId&&(J=2),!(!(0,R.isNumber)(Q.x)||!(0,R.isNumber)(H.x)||!(0,R.isNumber)(Q.y)||!(0,R.isNumber)(H.y))){var te=x["".concat($,"-").concat(m)],fe=te.vl,de=te.vx,Te=te.vy,Se=(fe-d(k))/fe*_*E(k)*J,Ie=de*Se,be=Te*Se,pe=w[b];y[X].x-=Ie*pe,y[X].y-=be*pe,y[W].x+=Ie*(1-pe),y[W].y+=be*(1-pe)}}}})},L.prototype.getType=function(){return"comboForce"},L}(j.Base);U.ComboForceLayout=A},98162:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var N=function(L,y){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,v){x.__proto__=v}||function(x,v){for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(x[g]=v[g])},N(L,y)};return function(L,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");N(L,y);function x(){this.constructor=L}L.prototype=y===null?Object.create(y):(x.prototype=y.prototype,new x)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.ConcentricLayout=void 0;var j=z(8273),R=z(46253),A=function(N){B(L,N);function L(y){var x=N.call(this)||this;return x.nodeSize=30,x.minNodeSpacing=10,x.nodeSpacing=10,x.preventOverlap=!1,x.equidistant=!1,x.startAngle=3/2*Math.PI,x.clockwise=!0,x.sortBy="degree",x.nodes=[],x.edges=[],x.width=300,x.height=300,x.onLayoutEnd=function(){},x.updateCfg(y),x}return L.prototype.getDefaultCfg=function(){return{nodeSize:30,minNodeSpacing:10,nodeSpacing:10,preventOverlap:!1,sweep:void 0,equidistant:!1,startAngle:3/2*Math.PI,clockwise:!0,maxLevelDiff:void 0,sortBy:"degree"}},L.prototype.execute=function(){var y,x,v=this,g=v.nodes,d=v.edges,_=g.length;if(_===0){(y=v.onLayoutEnd)===null||y===void 0||y.call(v);return}!v.width&&typeof window!="undefined"&&(v.width=window.innerWidth),!v.height&&typeof window!="undefined"&&(v.height=window.innerHeight),v.center||(v.center=[v.width/2,v.height/2]);var E=v.center;if(_===1){g[0].x=E[0],g[0].y=E[1],(x=v.onLayoutEnd)===null||x===void 0||x.call(v);return}var w=v.nodeSize,T=v.nodeSpacing,k=[],b,m=0;(0,j.isArray)(w)?b=Math.max(w[0],w[1]):b=w,(0,j.isArray)(T)?m=Math.max(T[0],T[1]):(0,j.isNumber)(T)&&(m=T),g.forEach(function(Me){k.push(Me);var De=b;(0,j.isArray)(Me.size)?De=Math.max(Me.size[0],Me.size[1]):(0,j.isNumber)(Me.size)?De=Me.size:(0,j.isObject)(Me.size)&&(De=Math.max(Me.size.width,Me.size.height)),b=Math.max(b,De),(0,j.isFunction)(T)&&(m=Math.max(T(Me),m))}),v.clockwise=v.counterclockwise!==void 0?!v.counterclockwise:v.clockwise;var $={},W={};if(k.forEach(function(Me,De){$[Me.id]=Me,W[Me.id]=De}),(v.sortBy==="degree"||!(0,j.isString)(v.sortBy)||k[0][v.sortBy]===void 0)&&(v.sortBy="degree",!(0,j.isNumber)(g[0].degree))){var X=(0,j.getDegree)(g.length,W,d);k.forEach(function(Me,De){Me.degree=X[De].all})}k.sort(function(Me,De){return De[v.sortBy]-Me[v.sortBy]}),v.maxValueNode=k[0],v.maxLevelDiff=v.maxLevelDiff||v.maxValueNode[v.sortBy]/4;var H=[[]],Q=H[0];k.forEach(function(Me){if(Q.length>0){var De=Math.abs(Q[0][v.sortBy]-Me[v.sortBy]);v.maxLevelDiff&&De>=v.maxLevelDiff&&(Q=[],H.push(Q))}Q.push(Me)});var q=b+(m||v.minNodeSpacing);if(!v.preventOverlap){var J=H.length>0&&H[0].length>1,te=Math.min(v.width,v.height)/2-q,fe=te/(H.length+(J?1:0));q=Math.min(q,fe)}var de=0;if(H.forEach(function(Me){var De=v.sweep;De===void 0&&(De=2*Math.PI-2*Math.PI/Me.length);var Ue=Me.dTheta=De/Math.max(1,Me.length-1);if(Me.length>1&&v.preventOverlap){var nt=Math.cos(Ue)-Math.cos(0),Ze=Math.sin(Ue)-Math.sin(0),ht=Math.sqrt(q*q/(nt*nt+Ze*Ze));de=Math.max(ht,de)}Me.r=de,de+=q}),v.equidistant){for(var Te=0,Se=0,Ie=0;Ie<H.length;Ie++){var be=H[Ie],pe=be.r-Se;Te=Math.max(Te,pe)}Se=0,H.forEach(function(Me,De){De===0&&(Se=Me.r),Me.r=Se,Se+=Te})}return H.forEach(function(Me){var De=Me.dTheta,Ue=Me.r;Me.forEach(function(nt,Ze){var ht=v.startAngle+(v.clockwise?1:-1)*De*Ze;nt.x=E[0]+Ue*Math.cos(ht),nt.y=E[1]+Ue*Math.sin(ht)})}),v.onLayoutEnd&&v.onLayoutEnd(),{nodes:g,edges:d}},L.prototype.getType=function(){return"concentric"},L}(R.Base);U.ConcentricLayout=A},24979:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.FORCE_LAYOUT_TYPE_MAP=U.LAYOUT_MESSAGE=void 0,U.LAYOUT_MESSAGE={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"},U.FORCE_LAYOUT_TYPE_MAP={gForce:!0,force2:!0,fruchterman:!0,forceAtlas2:!0,force:!0,"graphin-force":!0}},2:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var v=function(g,d){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,E){_.__proto__=E}||function(_,E){for(var w in E)Object.prototype.hasOwnProperty.call(E,w)&&(_[w]=E[w])},v(g,d)};return function(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");v(g,d);function _(){this.constructor=g}g.prototype=d===null?Object.create(d):(_.prototype=d.prototype,new _)}}(),j=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(U,"__esModule",{value:!0}),U.DagreLayout=void 0;var R=j(z(53186)),A=z(8273),N=z(46253),L=z(67858),y=function(v){B(g,v);function g(d){var _=v.call(this)||this;return _.rankdir="TB",_.nodesep=50,_.ranksep=50,_.controlPoints=!1,_.sortByCombo=!1,_.edgeLabelSpace=!0,_.radial=!1,_.nodes=[],_.edges=[],_.onLayoutEnd=function(){},_.layoutNode=function(E){var w=_,T=w.nodes,k=T.find(function(m){return m.id===E});if(k){var b=k.layout!==!1;return b}return!0},_.updateCfg(d),_}return g.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,nodeSize:void 0,nodesepFunc:void 0,ranksepFunc:void 0,nodesep:50,ranksep:50,controlPoints:!1,radial:!1,focusNode:null}},g.prototype.execute=function(){var d=this,_,E,w,T,k=this,b=k.nodes,m=k.nodeSize,$=k.rankdir,W=k.combos,X=k.begin,H=k.radial,Q=k.comboEdges,q=Q===void 0?[]:Q,J=k.vedges,te=J===void 0?[]:J;if(!!b){var fe=k.edges||[],de=new L.Graph({multigraph:!0,compound:!0});k.nodeMap={};var Te={};b.forEach(function(ct){k.nodeMap[ct.id]=ct,!!ct.comboId&&(Te[ct.comboId]=Te[ct.comboId]||[],Te[ct.comboId].push(ct.id))});var Se=[],Ie={};((_=k.nodeOrder)===null||_===void 0?void 0:_.length)?(k.nodeOrder.forEach(function(ct){Ie[ct]=!0,Se.push(k.nodeMap[ct])}),b.forEach(function(ct){Ie[ct.id]||Se.push(ct)})):Se=b;var be;m?(0,A.isArray)(m)?be=function(){return m}:be=function(){return[m,m]}:be=function(ct){return ct.size?(0,A.isArray)(ct.size)?ct.size:(0,A.isObject)(ct.size)?[ct.size.width||40,ct.size.height||40]:[ct.size,ct.size]:[40,40]};var pe=(0,A.getFunc)(k.ranksep,50,k.ranksepFunc),Me=(0,A.getFunc)(k.nodesep,50,k.nodesepFunc),De=Me,Ue=pe;($==="LR"||$==="RL")&&(De=pe,Ue=Me),de.setDefaultEdgeLabel(function(){return{}}),de.setGraph(k);var nt={};this.sortByCombo&&W&&W.forEach(function(ct){if(nt[ct.id]=ct,ct.collapsed){var Wt=be(ct),Er=Ue(ct),Dr=De(ct),Vr=Wt[0]+2*Dr,pn=Wt[1]+2*Er;de.setNode(ct.id,{width:Vr,height:pn})}!ct.parentId||(nt[ct.parentId]||de.setNode(ct.parentId,{}),de.setParent(ct.id,ct.parentId))}),Se.filter(function(ct){return ct.layout!==!1}).forEach(function(ct){var Wt=be(ct),Er=Ue(ct),Dr=De(ct),Vr=Wt[0]+2*Dr,pn=Wt[1]+2*Er,wn=ct.layer;(0,A.isNumber)(wn)?de.setNode(ct.id,{width:Vr,height:pn,layer:wn}):de.setNode(ct.id,{width:Vr,height:pn}),d.sortByCombo&&ct.comboId&&(nt[ct.comboId]||(nt[ct.comboId]={id:ct.comboId},de.setNode(ct.comboId,{})),de.setParent(ct.id,ct.comboId))}),fe.forEach(function(ct){var Wt=(0,A.getEdgeTerminal)(ct,"source"),Er=(0,A.getEdgeTerminal)(ct,"target");d.layoutNode(Wt)&&d.layoutNode(Er)&&de.setEdge(Wt,Er,{weight:ct.weight||1})}),(E=q==null?void 0:q.concat(te||[]))===null||E===void 0||E.forEach(function(ct){var Wt,Er,Dr=ct.source,Vr=ct.target,pn=((Wt=nt[Dr])===null||Wt===void 0?void 0:Wt.collapsed)?[Dr]:Te[Dr]||[Dr],wn=((Er=nt[Vr])===null||Er===void 0?void 0:Er.collapsed)?[Vr]:Te[Vr]||[Vr];pn.forEach(function(Sn){wn.forEach(function(In){de.setEdge(Sn,In,{weight:ct.weight||1})})})});var Ze=void 0;((w=k.preset)===null||w===void 0?void 0:w.nodes)&&(Ze=new L.Graph({multigraph:!0,compound:!0}),k.preset.nodes.forEach(function(ct){Ze==null||Ze.setNode(ct.id,ct)})),R.default.layout(de,{prevGraph:Ze,edgeLabelSpace:k.edgeLabelSpace,keepNodeOrder:Boolean(!!k.nodeOrder),nodeOrder:k.nodeOrder});var ht=[0,0];if(X){var Rt=Infinity,tr=Infinity;de.nodes().forEach(function(ct){var Wt=de.node(ct);Rt>Wt.x&&(Rt=Wt.x),tr>Wt.y&&(tr=Wt.y)}),de.edges().forEach(function(ct){var Wt,Er=de.edge(ct);(Wt=Er.points)===null||Wt===void 0||Wt.forEach(function(Dr){Rt>Dr.x&&(Rt=Dr.x),tr>Dr.y&&(tr=Dr.y)})}),ht[0]=X[0]-Rt,ht[1]=X[1]-tr}var Qe=$==="LR"||$==="RL";if(H){var lt=this,St=lt.focusNode,Ct=lt.ranksep,_t=lt.getRadialPos,pt=(0,A.isString)(St)?St:St==null?void 0:St.id,rr=pt?(T=de.node(pt))===null||T===void 0?void 0:T._rank:0,xr=[],Vt=Qe?"y":"x",ft=Qe?"height":"width",Bt=Infinity,qt=-Infinity;de.nodes().forEach(function(ct){var Wt=de.node(ct);if(!!k.nodeMap[ct]){var Er=Me(k.nodeMap[ct]);if(rr===0)xr[Wt._rank]||(xr[Wt._rank]={nodes:[],totalWidth:0,maxSize:-Infinity}),xr[Wt._rank].nodes.push(ct),xr[Wt._rank].totalWidth+=Er*2+Wt[ft],xr[Wt._rank].maxSize<Math.max(Wt.width,Wt.height)&&(xr[Wt._rank].maxSize=Math.max(Wt.width,Wt.height));else{var Dr=Wt._rank-rr;if(Dr===0)xr[Dr]||(xr[Dr]={nodes:[],totalWidth:0,maxSize:-Infinity}),xr[Dr].nodes.push(ct),xr[Dr].totalWidth+=Er*2+Wt[ft],xr[Dr].maxSize<Math.max(Wt.width,Wt.height)&&(xr[Dr].maxSize=Math.max(Wt.width,Wt.height));else{var Vr=Math.abs(Dr);xr[Vr]||(xr[Vr]={left:[],right:[],totalWidth:0,maxSize:-Infinity}),xr[Vr].totalWidth+=Er*2+Wt[ft],xr[Vr].maxSize<Math.max(Wt.width,Wt.height)&&(xr[Vr].maxSize=Math.max(Wt.width,Wt.height)),Dr<0?xr[Vr].left.push(ct):xr[Vr].right.push(ct)}}var pn=Wt[Vt]-Wt[ft]/2-Er,wn=Wt[Vt]+Wt[ft]/2+Er;pn<Bt&&(Bt=pn),wn>qt&&(qt=wn)}});var br=Ct||50,Ur={},Ae=(qt-Bt)/.9,Hr=[(Bt+qt-Ae)*.5,(Bt+qt+Ae)*.5],Sr=function(ct,Wt,Er,Dr){Er===void 0&&(Er=-Infinity),Dr===void 0&&(Dr=[0,1]);var Vr=Er;return ct.forEach(function(pn){var wn=de.node(pn);Ur[pn]=Wt;var Sn=_t(wn[Vt],Hr,Ae,Wt,Dr),In=Sn.x,$n=Sn.y;if(!!k.nodeMap[pn]){k.nodeMap[pn].x=In+ht[0],k.nodeMap[pn].y=$n+ht[1],k.nodeMap[pn]._order=wn._order;var Zr=pe(k.nodeMap[pn]);Vr<Zr&&(Vr=Zr)}}),Vr},qr=!0,Gr=0;xr.forEach(function(ct){var Wt,Er,Dr,Vr,pn,wn,Sn;if(!(!((Wt=ct==null?void 0:ct.nodes)===null||Wt===void 0?void 0:Wt.length)&&!((Er=ct==null?void 0:ct.left)===null||Er===void 0?void 0:Er.length)&&!((Dr=ct==null?void 0:ct.right)===null||Dr===void 0?void 0:Dr.length))){if(qr&&ct.nodes.length===1){var In=ct.nodes[0];if(!k.nodeMap[In])return;k.nodeMap[In].x=ht[0],k.nodeMap[In].y=ht[1],Ur[ct.nodes[0]]=0,br=pe(k.nodeMap[In]),qr=!1;return}br=Math.max(br,ct.totalWidth/(2*Math.PI));var $n=-Infinity;if(rr===0||((Vr=ct.nodes)===null||Vr===void 0?void 0:Vr.length))$n=Sr(ct.nodes,br,$n,[0,1]);else{var Zr=((pn=ct.left)===null||pn===void 0?void 0:pn.length)/(((wn=ct.left)===null||wn===void 0?void 0:wn.length)+((Sn=ct.right)===null||Sn===void 0?void 0:Sn.length));$n=Sr(ct.left,br,$n,[0,Zr]),$n=Sr(ct.right,br,$n,[Zr+.05,1])}br+=$n,qr=!1,Gr-ct.maxSize}}),de.edges().forEach(function(ct){var Wt,Er,Dr,Vr=de.edge(ct),pn=fe.findIndex(function(ln){var va=(0,A.getEdgeTerminal)(ln,"source"),K=(0,A.getEdgeTerminal)(ln,"target");return va===ct.v&&K===ct.w});if(!(pn<=-1)&&k.edgeLabelSpace&&k.controlPoints&&fe[pn].type!=="loop"){var wn=Vt==="x"?"y":"x",Sn=(Wt=Vr==null?void 0:Vr.points)===null||Wt===void 0?void 0:Wt.slice(1,Vr.points.length-1),In=[],$n=(Er=de.node(ct.v))===null||Er===void 0?void 0:Er[wn],Zr=$n-((Dr=de.node(ct.w))===null||Dr===void 0?void 0:Dr[wn]),Pn=Ur[ct.v],An=Pn-Ur[ct.w];Sn==null||Sn.forEach(function(ln){var va=(ln[wn]-$n)/Zr*An+Pn,K=_t(ln[Vt],Hr,Ae,va);In.push({x:K.x+ht[0],y:K.y+ht[1]})}),fe[pn].controlPoints=In}})}else{var vn=new Set,Gn=$==="BT"||$==="RL",mn=Gn?function(ct,Wt){return Wt-ct}:function(ct,Wt){return ct-Wt};de.nodes().forEach(function(ct){var Wt=de.node(ct);if(!!Wt){var Er=d.nodeMap[ct];Er||(Er=W==null?void 0:W.find(function(Dr){return Dr.id===ct})),!!Er&&(Er.x=Wt.x+ht[0],Er.y=Wt.y+ht[1],Er._order=Wt._order,vn.add(Qe?Er.x:Er.y))}});var $r=Array.from(vn).sort(mn),gn=Qe?function(ct,Wt){return ct.x!==Wt.x}:function(ct,Wt){return ct.y!==Wt.y},Rr=Qe?function(ct,Wt,Er){var Dr=Math.max(Wt.y,Er.y),Vr=Math.min(Wt.y,Er.y);return ct.filter(function(pn){return pn.y<=Dr&&pn.y>=Vr})}:function(ct,Wt,Er){var Dr=Math.max(Wt.x,Er.x),Vr=Math.min(Wt.x,Er.x);return ct.filter(function(pn){return pn.x<=Dr&&pn.x>=Vr})};de.edges().forEach(function(ct){var Wt,Er=de.edge(ct),Dr=fe.findIndex(function(wn){var Sn=(0,A.getEdgeTerminal)(wn,"source"),In=(0,A.getEdgeTerminal)(wn,"target");return Sn===ct.v&&In===ct.w});if(!(Dr<=-1)&&k.edgeLabelSpace&&k.controlPoints&&fe[Dr].type!=="loop"){(Wt=Er==null?void 0:Er.points)===null||Wt===void 0||Wt.forEach(function(wn){wn.x+=ht[0],wn.y+=ht[1]});var Vr=k.nodeMap[ct.v],pn=k.nodeMap[ct.w];fe[Dr].controlPoints=x(Er==null?void 0:Er.points,Vr,pn,$r,Qe,gn,Rr)}})}return k.onLayoutEnd&&k.onLayoutEnd(),{nodes:b,edges:fe}}},g.prototype.getRadialPos=function(d,_,E,w,T){T===void 0&&(T=[0,1]);var k=(d-_[0])/E;k=k*(T[1]-T[0])+T[0];var b=k*2*Math.PI;return{x:Math.cos(b)*w,y:Math.sin(b)*w}},g.prototype.getType=function(){return"dagre"},g}(N.Base);U.DagreLayout=y;var x=function(v,g,d,_,E,w,T){var k=(v==null?void 0:v.slice(1,v.length-1))||[];if(g&&d){var b=g.x,m=g.y,$=d.x,W=d.y;if(E&&(b=g.y,m=g.x,$=d.y,W=d.x),W!==m&&b!==$){var X=_.indexOf(m),H=_[X+1];if(H){var Q=k[0],q=E?{x:(m+H)/2,y:(Q==null?void 0:Q.y)||$}:{x:(Q==null?void 0:Q.x)||$,y:(m+H)/2};(!Q||w(Q,q))&&k.unshift(q)}var J=_.indexOf(W),te=Math.abs(J-X);if(te===1)k=T(k,g,d),k.length||k.push(E?{x:(m+W)/2,y:b}:{x:b,y:(m+W)/2});else if(te>1){var fe=_[J-1];if(fe){var de=k[k.length-1],Te=E?{x:(W+fe)/2,y:(de==null?void 0:de.y)||$}:{x:(de==null?void 0:de.x)||b,y:(W+fe)/2};(!de||w(de,Te))&&k.push(Te)}}}}return k}},77620:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var x=function(v,g){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,_){d.__proto__=_}||function(d,_){for(var E in _)Object.prototype.hasOwnProperty.call(_,E)&&(d[E]=_[E])},x(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");x(v,g);function d(){this.constructor=v}v.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}(),j=this&&this.__assign||function(){return j=Object.assign||function(x){for(var v,g=1,d=arguments.length;g<d;g++){v=arguments[g];for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(x[_]=v[_])}return x},j.apply(this,arguments)},R=this&&this.__spreadArray||function(x,v,g){if(g||arguments.length===2)for(var d=0,_=v.length,E;d<_;d++)(E||!(d in v))&&(E||(E=Array.prototype.slice.call(v,0,d)),E[d]=v[d]);return x.concat(E||Array.prototype.slice.call(v))};Object.defineProperty(U,"__esModule",{value:!0}),U.DagreCompoundLayout=void 0;var A=z(46253),N=z(31969),L=z(8273),y=function(x){B(v,x);function v(g){var d=x.call(this)||this;return d.rankdir="TB",d.nodesep=50,d.edgesep=5,d.ranksep=50,d.controlPoints=!0,d.anchorPoint=!0,d.nodes=[],d.edges=[],d.combos=[],d.onLayoutEnd=function(){},d.updateCfg(g),d}return v.prototype.getDefaultCfg=function(){return{rankdir:"TB",align:void 0,begin:void 0,nodeSize:void 0,nodesep:50,ranksep:50,controlPoints:!0,anchorPoint:!0}},v.prototype.init=function(g){var d=g.hiddenNodes||[],_=g.hiddenEdges||[],E=g.hiddenCombos||[];this.nodes=this.getDataByOrder((g.nodes||[]).concat(d)),this.edges=this.getDataByOrder((g.edges||[]).concat(_)),this.combos=(g.combos||[]).concat(E.map(function(w){return j(j({},w),{collapsed:!0})}))},v.prototype.execute=function(){var g=this,d=g.nodes,_=g.edges;if(!!d){var E=g.getLayoutConfig(),w=E.graphDef,T=E.graphOption,k=E.graphSettings,b=(0,N.buildGraph)(w,T,k),m=(0,N.flatGraph)(b,!0);return this.updatePosition(m),g.onLayoutEnd&&g.onLayoutEnd(),{nodes:d,edges:_}}},v.prototype.getNodePath=function(g){var d=this,_=d.nodes,E=d.combos,w=_.find(function(k){return k.id===g}),T=function(k,b){b===void 0&&(b=[]);var m=E.find(function($){return $.id===k});return m?(b.unshift(k),m.parentId?T(m.parentId,b):b):b};return w&&w.comboId?T(w.comboId,[g]):[g]},v.prototype.getLayoutConfig=function(){var g,d,_,E=this,w=E.nodes,T=E.edges,k=E.combos,b=E.nodeSize,m=E.rankdir,$=E.align,W=E.edgesep,X=E.nodesep,H=E.ranksep,Q=E.settings,q=(k||[]).reduce(function(Rt,tr){var Qe=w.filter(function(St){return St.comboId===tr.id}).map(function(St){return St.id}),lt=(k||[]).filter(function(St){return St.parentId===tr.id}).map(function(St){return St.id});return(Qe.length||lt.length)&&(Rt[tr.id]=R(R([],Qe,!0),lt,!0)),Rt},{}),J;b?(0,L.isArray)(b)?J=function(){return b}:J=function(){return[b,b]}:J=function(Rt){return Rt&&Rt.size?(0,L.isArray)(Rt.size)?Rt.size:(0,L.isObject)(Rt.size)?[Rt.size.width||40,Rt.size.height||40]:[Rt.size,Rt.size]:[40,40]};var te=function(Rt){return Rt&&Rt.size?(0,L.isArray)(Rt.size)?Rt.size:[Rt.size,Rt.size]:[80,40]},fe=te(k==null?void 0:k[0]),de=fe[0],Te=fe[1],Se=(d=(g=E.graphSettings)===null||g===void 0?void 0:g.subScene)===null||d===void 0?void 0:d.meta,Ie=((_=k.find(function(Rt){return!Rt.collapsed}))===null||_===void 0?void 0:_.padding)||[20,20,20,20],be=Ie[0],pe=Ie[1],Me=Ie[2],De=Ie[3],Ue={compound:q,nodes:R([],(w||[]).map(function(Rt){var tr=J(Rt),Qe=tr[0],lt=tr[1];return j(j({},Rt),{width:Qe,height:lt})}),!0),edges:R([],(T||[]).map(function(Rt){return j(j({},Rt),{v:Rt.source,w:Rt.target})}),!0)},nt={expanded:(k||[]).filter(function(Rt){return!Rt.collapsed}).map(function(Rt){return Rt.id})},Ze={graph:{meta:{align:$,rankDir:m,nodeSep:X,edgeSep:W,rankSep:H}},subScene:{meta:{paddingTop:be||(Se==null?void 0:Se.paddingTop)||20,paddingRight:pe||(Se==null?void 0:Se.paddingRight)||20,paddingBottom:Me||(Se==null?void 0:Se.paddingBottom)||20,paddingLeft:De||(Se==null?void 0:Se.paddingLeft)||20,labelHeight:0}},nodeSize:{meta:{width:de,height:Te}}},ht=(0,N.mergeConfig)(Q,j({},(0,N.mergeConfig)(Ze,N.LAYOUT_CONFIG)));return E.graphSettings=ht,{graphDef:Ue,graphOption:nt,graphSettings:ht}},v.prototype.updatePosition=function(g){var d=g.nodes,_=g.edges;this.updateNodePosition(d,_),this.updateEdgePosition(d,_)},v.prototype.getBegin=function(g,d){var _=this,E=_.begin,w=[0,0];if(E){var T=Infinity,k=Infinity;g.forEach(function(b){T>b.x&&(T=b.x),k>b.y&&(k=b.y)}),d.forEach(function(b){b.points.forEach(function(m){T>m.x&&(T=m.x),k>m.y&&(k=m.y)})}),w[0]=E[0]-T,w[1]=E[1]-k}return w},v.prototype.updateNodePosition=function(g,d){var _=this,E=_.combos,w=_.nodes,T=_.edges,k=_.anchorPoint,b=_.graphSettings,m=this.getBegin(g,d);g.forEach(function($){var W,X=$.x,H=$.y,Q=$.id,q=$.type,J=$.coreBox;if(q===N.HierarchyNodeType.META&&Q!==N.ROOT_NAME){var te=E.findIndex(function(Ie){return Ie.id===Q}),fe=(W=b==null?void 0:b.subScene)===null||W===void 0?void 0:W.meta;E[te].offsetX=X+m[0],E[te].offsetY=H+m[1],E[te].fixSize=[J.width,J.height],E[te].fixCollapseSize=[J.width,J.height],$.expanded?E[te].padding=[fe==null?void 0:fe.paddingTop,fe==null?void 0:fe.paddingRight,fe==null?void 0:fe.paddingBottom,fe==null?void 0:fe.paddingLeft]:E[te].padding=[0,0,0,0]}else if(q===N.HierarchyNodeType.OP){var te=w.findIndex(function(be){return be.id===Q});if(w[te].x=X+m[0],w[te].y=H+m[1],k){var de=[],Te=d.filter(function(be){return be.v===Q}),Se=d.filter(function(be){return be.w===Q});Te.length>0&&Te.forEach(function(be){var pe=be.points[0],Me=(pe.x-X)/$.width+.5,De=(pe.y-H)/$.height+.5;de.push([Me,De]),be.baseEdgeList.forEach(function(Ue){var nt=T.find(function(Ze){return Ze.source===Ue.v&&Ze.target===Ue.w});nt&&(nt.sourceAnchor=de.length-1)})}),Se.length>0&&Se.forEach(function(be){var pe=be.points[be.points.length-1],Me=(pe.x-X)/$.width+.5,De=(pe.y-H)/$.height+.5;de.push([Me,De]),be.baseEdgeList.forEach(function(Ue){var nt=T.find(function(Ze){return Ze.source===Ue.v&&Ze.target===Ue.w});nt&&(nt.targetAnchor=de.length-1)})}),w[te].anchorPoints=de.length>0?de:w[te].anchorPoints||[]}}})},v.prototype.updateEdgePosition=function(g,d){var _=this,E=_.combos,w=_.edges,T=_.controlPoints,k=this.getBegin(g,d);T&&(E.forEach(function(b){b.inEdges=[],b.outEdges=[]}),w.forEach(function(b){var m,$,W,X,H=g.find(function(Ie){return Ie.id===b.source}),Q=g.find(function(Ie){return Ie.id===b.target}),q=[],J=[];if(H&&Q)J=(0,N.getEdges)(H==null?void 0:H.id,Q==null?void 0:Q.id,g);else if(!H||!Q){var te=_.getNodePath(b.source),fe=_.getNodePath(b.target),de=te.reverse().slice(H?0:1).find(function(Ie){return g.find(function(be){return be.id===Ie})}),Te=fe.reverse().slice(Q?0:1).find(function(Ie){return g.find(function(be){return be.id===Ie})});H=g.find(function(Ie){return Ie.id===de}),Q=g.find(function(Ie){return Ie.id===Te}),J=(0,N.getEdges)(H==null?void 0:H.id,Q==null?void 0:Q.id,g,{v:b.source,w:b.target})}if(q=J.reduce(function(Ie,be){return R(R([],Ie,!0),be.points.map(function(pe){return j(j({},pe),{x:pe.x+k[0],y:pe.y+k[1]})}),!0)},[]),q=q.slice(1,-1),b.controlPoints=q,(Q==null?void 0:Q.type)===N.NodeType.META){var Se=E.findIndex(function(Ie){return Ie.id===(Q==null?void 0:Q.id)});if(!E[Se]||((m=E[Se].inEdges)===null||m===void 0?void 0:m.some(function(Ie){return Ie.source===H.id&&Ie.target===Q.id})))return;($=E[Se].inEdges)===null||$===void 0||$.push({source:H.id,target:Q.id,controlPoints:q})}if((H==null?void 0:H.type)===N.NodeType.META){var Se=E.findIndex(function(be){return be.id===(H==null?void 0:H.id)});if(!E[Se]||((W=E[Se].outEdges)===null||W===void 0?void 0:W.some(function(be){return be.source===H.id&&be.target===Q.id})))return;(X=E[Se].outEdges)===null||X===void 0||X.push({source:H.id,target:Q.id,controlPoints:q})}}))},v.prototype.getType=function(){return"dagreCompound"},v.prototype.getDataByOrder=function(g){return g.every(function(d){return d.layoutOrder!==void 0})||g.forEach(function(d,_){d.layoutOrder=_}),g.sort(function(d,_){return d.layoutOrder-_.layoutOrder})},v}(A.Base);U.DagreCompoundLayout=y},67858:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var A=function(N,L){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,x){y.__proto__=x}||function(y,x){for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(y[v]=x[v])},A(N,L)};return function(N,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");A(N,L);function y(){this.constructor=N}N.prototype=L===null?Object.create(L):(y.prototype=L.prototype,new y)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.Graph=void 0;var j=z(69787),R=function(A){B(N,A);function N(){return A!==null&&A.apply(this,arguments)||this}return N}(j.Graph);U.Graph=R},53186:function(or,U,z){"use strict";var B=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(U,"__esModule",{value:!0});var j=B(z(86282)),R=z(95869);U.default={layout:j.default,util:{time:R.time,notime:R.notime}}},65721:function(or,U,z){"use strict";var B=this&&this.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(U,"__esModule",{value:!0});var j=B(z(81628)),R=function(L){var y=function(v){return function(g){var d;return((d=v.edge(g))===null||d===void 0?void 0:d.weight)||1}},x=L.graph().acyclicer==="greedy"?(0,j.default)(L,y(L)):A(L);x==null||x.forEach(function(v){var g=L.edge(v);L.removeEdgeObj(v),g.forwardName=v.name,g.reversed=!0,L.setEdge(v.w,v.v,g,"rev-".concat(Math.random()))})},A=function(L){var y=[],x={},v={},g=function(d){var _;v[d]||(v[d]=!0,x[d]=!0,(_=L.outEdges(d))===null||_===void 0||_.forEach(function(E){x[E.w]?y.push(E):g(E.w)}),delete x[d])};return L.nodes().forEach(g),y},N=function(L){L.edges().forEach(function(y){var x=L.edge(y);if(x.reversed){L.removeEdgeObj(y);var v=x.forwardName;delete x.reversed,delete x.forwardName,L.setEdge(y.w,y.v,x,v)}})};U.default={run:R,undo:N}},88597:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var B=z(95869),j=function(A){var N,L=function(y){var x=A.children(y),v=A.node(y);if((x==null?void 0:x.length)&&x.forEach(function(_){return L(_)}),v.hasOwnProperty("minRank")){v.borderLeft=[],v.borderRight=[];for(var g=v.minRank,d=v.maxRank+1;g<d;g+=1)R(A,"borderLeft","_bl",y,v,g),R(A,"borderRight","_br",y,v,g)}};(N=A.children())===null||N===void 0||N.forEach(function(y){return L(y)})},R=function(A,N,L,y,x,v){var g={rank:v,borderType:N,width:0,height:0},d=x[N][v-1],_=(0,B.addDummyNode)(A,"border",g,L);x[N][v]=_,A.setParent(_,y),d&&A.setEdge(d,_,{weight:1})};U.default=j},85374:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(x){var v,g=(v=x.graph().rankdir)===null||v===void 0?void 0:v.toLowerCase();(g==="lr"||g==="rl")&&j(x)},B=function(x){var v,g=(v=x.graph().rankdir)===null||v===void 0?void 0:v.toLowerCase();(g==="bt"||g==="rl")&&A(x),(g==="lr"||g==="rl")&&(L(x),j(x))},j=function(x){x.nodes().forEach(function(v){R(x.node(v))}),x.edges().forEach(function(v){R(x.edge(v))})},R=function(x){var v=x.width;x.width=x.height,x.height=v},A=function(x){x.nodes().forEach(function(v){N(x.node(v))}),x.edges().forEach(function(v){var g,d=x.edge(v);(g=d.points)===null||g===void 0||g.forEach(function(_){return N(_)}),d.hasOwnProperty("y")&&N(d)})},N=function(x){(x==null?void 0:x.y)&&(x.y=-x.y)},L=function(x){x.nodes().forEach(function(v){y(x.node(v))}),x.edges().forEach(function(v){var g,d=x.edge(v);(g=d.points)===null||g===void 0||g.forEach(function(_){return y(_)}),d.hasOwnProperty("x")&&y(d)})},y=function(x){var v=x.x;x.x=x.y,x.y=v};U.default={adjust:z,undo:B}},49174:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(R,A){if(R!=="next"&&R!=="prev")return A},B=function(R){R.prev.next=R.next,R.next.prev=R.prev,delete R.next,delete R.prev},j=function(){function R(){var A={};A.prev=A,A.next=A.prev,this.shortcut=A}return R.prototype.dequeue=function(){var A=this.shortcut,N=A.prev;if(N&&N!==A)return B(N),N},R.prototype.enqueue=function(A){var N=this.shortcut;A.prev&&A.next&&B(A),A.next=N.next,N.next.prev=A,N.next=A,A.prev=N},R.prototype.toString=function(){for(var A=[],N=this.shortcut,L=N.prev;L!==N;)A.push(JSON.stringify(L,z)),L=L==null?void 0:L.prev;return"[".concat(A.join(", "),"]")},R}();U.default=j},81628:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var E=function(w,T){return E=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,b){k.__proto__=b}||function(k,b){for(var m in b)Object.prototype.hasOwnProperty.call(b,m)&&(k[m]=b[m])},E(w,T)};return function(w,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");E(w,T);function k(){this.constructor=w}w.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}}(),j=this&&this.__importDefault||function(E){return E&&E.__esModule?E:{default:E}};Object.defineProperty(U,"__esModule",{value:!0});var R=j(z(49174)),A=z(69787),N=function(E){B(w,E);function w(){return E!==null&&E.apply(this,arguments)||this}return w}(R.default),L=function(E){B(w,E);function w(){return E!==null&&E.apply(this,arguments)||this}return w}(A.Graph),y=function(){return 1},x=function(E,w){var T;if(E.nodeCount()<=1)return[];var k=d(E,w||y),b=v(k.graph,k.buckets,k.zeroIdx);return(T=b.map(function(m){return E.outEdges(m.v,m.w)}))===null||T===void 0?void 0:T.flat()},v=function(E,w,T){for(var k=[],b=w[w.length-1],m=w[0],$;E.nodeCount();){for(;$=m.dequeue();)g(E,w,T,$);for(;$=b.dequeue();)g(E,w,T,$);if(E.nodeCount()){for(var W=w.length-2;W>0;--W)if($=w[W].dequeue(),$){k=k.concat(g(E,w,T,$,!0));break}}}return k},g=function(E,w,T,k,b){var m,$,W=[];return(m=E.inEdges(k.v))===null||m===void 0||m.forEach(function(X){var H=E.edge(X),Q=E.node(X.v);b&&W.push({v:X.v,w:X.w,in:0,out:0}),Q.out===void 0&&(Q.out=0),Q.out-=H,_(w,T,Q)}),($=E.outEdges(k.v))===null||$===void 0||$.forEach(function(X){var H=E.edge(X),Q=X.w,q=E.node(Q);q.in===void 0&&(q.in=0),q.in-=H,_(w,T,q)}),E.removeNode(k.v),b?W:void 0},d=function(E,w){var T=new L,k=0,b=0;E.nodes().forEach(function(H){T.setNode(H,{v:H,in:0,out:0})}),E.edges().forEach(function(H){var Q=T.edge(H)||0,q=(w==null?void 0:w(H))||1,J=Q+q;T.setEdge(H.v,H.w,J),b=Math.max(b,T.node(H.v).out+=q),k=Math.max(k,T.node(H.w).in+=q)});for(var m=[],$=b+k+3,W=0;W<$;W++)m.push(new N);var X=k+1;return T.nodes().forEach(function(H){_(m,X,T.node(H))}),{buckets:m,zeroIdx:X,graph:T}},_=function(E,w,T){T.out?T.in?E[T.out-T.in+w].enqueue(T):E[E.length-1].enqueue(T):E[0].enqueue(T)};U.default=x},86282:function(or,U,z){"use strict";var B=this&&this.__assign||function(){return B=Object.assign||function(Qe){for(var lt,St=1,Ct=arguments.length;St<Ct;St++){lt=arguments[St];for(var _t in lt)Object.prototype.hasOwnProperty.call(lt,_t)&&(Qe[_t]=lt[_t])}return Qe},B.apply(this,arguments)},j=this&&this.__importDefault||function(Qe){return Qe&&Qe.__esModule?Qe:{default:Qe}};Object.defineProperty(U,"__esModule",{value:!0});var R=j(z(65721)),A=j(z(32778)),N=j(z(68976)),L=z(95869),y=j(z(99946)),x=j(z(54794)),v=j(z(88597)),g=j(z(85374)),d=j(z(15113)),_=j(z(90829)),E=j(z(27910)),w=z(67858),T=function(Qe,lt){var St=lt&&lt.debugTiming?L.time:L.notime;St("layout",function(){lt&&!lt.keepNodeOrder&&lt.prevGraph&&St(" inheritOrder",function(){b(Qe,lt.prevGraph)});var Ct=St(" buildLayoutGraph",function(){return fe(Qe)});lt&&lt.edgeLabelSpace===!1||St(" makeSpaceForEdgeLabels",function(){de(Ct)});try{St(" runLayout",function(){k(Ct,St,lt)})}catch(_t){if(_t.message==="Not possible to find intersection inside of the rectangle"){console.error(`The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:
  245. `,_t);return}throw _t}St(" updateInputGraph",function(){m(Qe,Ct)})})},k=function(Qe,lt,St){lt(" removeSelfEdges",function(){nt(Qe)}),lt(" acyclic",function(){R.default.run(Qe)}),lt(" nestingGraph.run",function(){x.default.run(Qe)}),lt(" rank",function(){(0,N.default)((0,L.asNonCompoundGraph)(Qe))}),lt(" injectEdgeLabelProxies",function(){Te(Qe)}),lt(" removeEmptyRanks",function(){(0,L.removeEmptyRanks)(Qe)}),lt(" nestingGraph.cleanup",function(){x.default.cleanup(Qe)}),lt(" normalizeRanks",function(){(0,L.normalizeRanks)(Qe)}),lt(" assignRankMinMax",function(){Se(Qe)}),lt(" removeEdgeLabelProxies",function(){Ie(Qe)}),lt(" normalize.run",function(){A.default.run(Qe)}),lt(" parentDummyChains",function(){(0,y.default)(Qe)}),lt(" addBorderSegments",function(){(0,v.default)(Qe)}),St&&St.keepNodeOrder&&lt(" initDataOrder",function(){(0,E.default)(Qe,St.nodeOrder)}),lt(" order",function(){(0,d.default)(Qe,St==null?void 0:St.keepNodeOrder)}),lt(" insertSelfEdges",function(){Ze(Qe)}),lt(" adjustCoordinateSystem",function(){g.default.adjust(Qe)}),lt(" position",function(){(0,_.default)(Qe)}),lt(" positionSelfEdges",function(){ht(Qe)}),lt(" removeBorderNodes",function(){Ue(Qe)}),lt(" normalize.undo",function(){A.default.undo(Qe)}),lt(" fixupEdgeLabelCoords",function(){Me(Qe)}),lt(" undoCoordinateSystem",function(){g.default.undo(Qe)}),lt(" translateGraph",function(){be(Qe)}),lt(" assignNodeIntersects",function(){pe(Qe)}),lt(" reversePoints",function(){De(Qe)}),lt(" acyclic.undo",function(){R.default.undo(Qe)})},b=function(Qe,lt){Qe.nodes().forEach(function(St){var Ct=Qe.node(St),_t=lt.node(St);_t!==void 0?(Ct.fixorder=_t._order,delete _t._order):delete Ct.fixorder})},m=function(Qe,lt){Qe.nodes().forEach(function(St){var Ct,_t=Qe.node(St);if(_t){var pt=lt.node(St);_t.x=pt.x,_t.y=pt.y,_t._order=pt.order,_t._rank=pt.rank,((Ct=lt.children(St))===null||Ct===void 0?void 0:Ct.length)&&(_t.width=pt.width,_t.height=pt.height)}}),Qe.edges().forEach(function(St){var Ct=Qe.edge(St),_t=lt.edge(St);Ct.points=_t?_t.points:[],_t&&_t.hasOwnProperty("x")&&(Ct.x=_t.x,Ct.y=_t.y)}),Qe.graph().width=lt.graph().width,Qe.graph().height=lt.graph().height},$=["nodesep","edgesep","ranksep","marginx","marginy"],W={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},X=["acyclicer","ranker","rankdir","align"],H=["width","height","layer","fixorder"],Q={width:0,height:0},q=["minlen","weight","width","height","labeloffset"],J={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},te=["labelpos"],fe=function(Qe){var lt=new w.Graph({multigraph:!0,compound:!0}),St=tr(Qe.graph()),Ct={};return X==null||X.forEach(function(_t){St[_t]!==void 0&&(Ct[_t]=St[_t])}),lt.setGraph(Object.assign({},W,Rt(St,$),Ct)),Qe.nodes().forEach(function(_t){var pt=tr(Qe.node(_t)),rr=B(B({},Q),pt),xr=Rt(rr,H);lt.setNode(_t,xr),lt.setParent(_t,Qe.parent(_t))}),Qe.edges().forEach(function(_t){var pt=tr(Qe.edge(_t)),rr={};te==null||te.forEach(function(xr){pt[xr]!==void 0&&(rr[xr]=pt[xr])}),lt.setEdgeObj(_t,Object.assign({},J,Rt(pt,q),rr))}),lt},de=function(Qe){var lt=Qe.graph();lt.ranksep||(lt.ranksep=0),lt.ranksep/=2,Qe.nodes().forEach(function(St){var Ct=Qe.node(St);isNaN(Ct.layer)||Ct.layer||(Ct.layer=0)}),Qe.edges().forEach(function(St){var Ct,_t=Qe.edge(St);_t.minlen*=2,((Ct=_t.labelpos)===null||Ct===void 0?void 0:Ct.toLowerCase())!=="c"&&(lt.rankdir==="TB"||lt.rankdir==="BT"?_t.width+=_t.labeloffset:_t.height+=_t.labeloffset)})},Te=function(Qe){Qe.edges().forEach(function(lt){var St=Qe.edge(lt);if(St.width&&St.height){var Ct=Qe.node(lt.v),_t=Qe.node(lt.w),pt={e:lt,rank:(_t.rank-Ct.rank)/2+Ct.rank};(0,L.addDummyNode)(Qe,"edge-proxy",pt,"_ep")}})},Se=function(Qe){var lt=0;Qe.nodes().forEach(function(St){var Ct,_t,pt=Qe.node(St);pt.borderTop&&(pt.minRank=(Ct=Qe.node(pt.borderTop))===null||Ct===void 0?void 0:Ct.rank,pt.maxRank=(_t=Qe.node(pt.borderBottom))===null||_t===void 0?void 0:_t.rank,lt=Math.max(lt,pt.maxRank||-Infinity))}),Qe.graph().maxRank=lt},Ie=function(Qe){Qe.nodes().forEach(function(lt){var St=Qe.node(lt);St.dummy==="edge-proxy"&&(Qe.edge(St.e).labelRank=St.rank,Qe.removeNode(lt))})},be=function(Qe){var lt,St=0,Ct,_t=0,pt=Qe.graph(),rr=pt.marginx||0,xr=pt.marginy||0,Vt=function(ft){if(!!ft){var Bt=ft.x,qt=ft.y,br=ft.width,Ur=ft.height;!isNaN(Bt)&&!isNaN(br)&&(lt===void 0&&(lt=Bt-br/2),lt=Math.min(lt,Bt-br/2),St=Math.max(St,Bt+br/2)),!isNaN(qt)&&!isNaN(Ur)&&(Ct===void 0&&(Ct=qt-Ur/2),Ct=Math.min(Ct,qt-Ur/2),_t=Math.max(_t,qt+Ur/2))}};Qe.nodes().forEach(function(ft){Vt(Qe.node(ft))}),Qe.edges().forEach(function(ft){var Bt=Qe.edge(ft);(Bt==null?void 0:Bt.hasOwnProperty("x"))&&Vt(Bt)}),lt-=rr,Ct-=xr,Qe.nodes().forEach(function(ft){var Bt=Qe.node(ft);Bt&&(Bt.x-=lt,Bt.y-=Ct)}),Qe.edges().forEach(function(ft){var Bt,qt=Qe.edge(ft);(Bt=qt.points)===null||Bt===void 0||Bt.forEach(function(br){br.x-=lt,br.y-=Ct}),qt.hasOwnProperty("x")&&(qt.x-=lt),qt.hasOwnProperty("y")&&(qt.y-=Ct)}),pt.width=St-lt+rr,pt.height=_t-Ct+xr},pe=function(Qe){Qe.edges().forEach(function(lt){var St=Qe.edge(lt),Ct=Qe.node(lt.v),_t=Qe.node(lt.w),pt,rr;St.points?(pt=St.points[0],rr=St.points[St.points.length-1]):(St.points=[],pt=_t,rr=Ct),St.points.unshift((0,L.intersectRect)(Ct,pt)),St.points.push((0,L.intersectRect)(_t,rr))})},Me=function(Qe){Qe.edges().forEach(function(lt){var St=Qe.edge(lt);if(St==null?void 0:St.hasOwnProperty("x"))switch((St.labelpos==="l"||St.labelpos==="r")&&(St.width-=St.labeloffset),St.labelpos){case"l":St.x-=St.width/2+St.labeloffset;break;case"r":St.x+=St.width/2+St.labeloffset;break}})},De=function(Qe){Qe.edges().forEach(function(lt){var St,Ct=Qe.edge(lt);Ct.reversed&&((St=Ct.points)===null||St===void 0||St.reverse())})},Ue=function(Qe){Qe.nodes().forEach(function(lt){var St,Ct,_t;if((St=Qe.children(lt))===null||St===void 0?void 0:St.length){var pt=Qe.node(lt),rr=Qe.node(pt.borderTop),xr=Qe.node(pt.borderBottom),Vt=Qe.node(pt.borderLeft[((Ct=pt.borderLeft)===null||Ct===void 0?void 0:Ct.length)-1]),ft=Qe.node(pt.borderRight[((_t=pt.borderRight)===null||_t===void 0?void 0:_t.length)-1]);pt.width=Math.abs((ft==null?void 0:ft.x)-(Vt==null?void 0:Vt.x))||10,pt.height=Math.abs((xr==null?void 0:xr.y)-(rr==null?void 0:rr.y))||10,pt.x=((Vt==null?void 0:Vt.x)||0)+pt.width/2,pt.y=((rr==null?void 0:rr.y)||0)+pt.height/2}}),Qe.nodes().forEach(function(lt){var St;((St=Qe.node(lt))===null||St===void 0?void 0:St.dummy)==="border"&&Qe.removeNode(lt)})},nt=function(Qe){Qe.edges().forEach(function(lt){if(lt.v===lt.w){var St=Qe.node(lt.v);St.selfEdges||(St.selfEdges=[]),St.selfEdges.push({e:lt,label:Qe.edge(lt)}),Qe.removeEdgeObj(lt)}})},Ze=function(Qe){var lt=(0,L.buildLayerMatrix)(Qe);lt==null||lt.forEach(function(St){var Ct=0;St==null||St.forEach(function(_t,pt){var rr,xr=Qe.node(_t);xr.order=pt+Ct,(rr=xr.selfEdges)===null||rr===void 0||rr.forEach(function(Vt){(0,L.addDummyNode)(Qe,"selfedge",{width:Vt.label.width,height:Vt.label.height,rank:xr.rank,order:pt+ ++Ct,e:Vt.e,label:Vt.label},"_se")}),delete xr.selfEdges})})},ht=function(Qe){Qe.nodes().forEach(function(lt){var St=Qe.node(lt);if(St.dummy==="selfedge"){var Ct=Qe.node(St.e.v),_t=Ct.x+Ct.width/2,pt=Ct.y,rr=St.x-_t,xr=Ct.height/2;Qe.setEdgeObj(St.e,St.label),Qe.removeNode(lt),St.label.points=[{x:_t+2*rr/3,y:pt-xr},{x:_t+5*rr/6,y:pt-xr},{y:pt,x:_t+rr},{x:_t+5*rr/6,y:pt+xr},{x:_t+2*rr/3,y:pt+xr}],St.label.x=St.x,St.label.y=St.y}})},Rt=function(Qe,lt){var St={};return lt==null||lt.forEach(function(Ct){Qe[Ct]!==void 0&&(St[Ct]=+Qe[Ct])}),St},tr=function(Qe){Qe===void 0&&(Qe={});var lt={};return Object.keys(Qe).forEach(function(St){lt[St.toLowerCase()]=Qe[St]}),lt};U.default=T},54794:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var B=z(95869),j=function(y){var x,v=(0,B.addDummyNode)(y,"root",{},"_root"),g=A(y),d=Math.max.apply(Math,Object.values(g));Math.abs(d)===Infinity&&(d=1);var _=d-1,E=2*_+1;y.graph().nestingRoot=v,y.edges().forEach(function(T){y.edge(T).minlen*=E});var w=N(y)+1;(x=y.children())===null||x===void 0||x.forEach(function(T){R(y,v,E,w,_,g,T)}),y.graph().nodeRankFactor=E},R=function(y,x,v,g,d,_,E){var w=y.children(E);if(!(w==null?void 0:w.length)){E!==x&&y.setEdge(x,E,{weight:0,minlen:v});return}var T=(0,B.addBorderNode)(y,"_bt"),k=(0,B.addBorderNode)(y,"_bb"),b=y.node(E);y.setParent(T,E),b.borderTop=T,y.setParent(k,E),b.borderBottom=k,w==null||w.forEach(function(m){R(y,x,v,g,d,_,m);var $=y.node(m),W=$.borderTop?$.borderTop:m,X=$.borderBottom?$.borderBottom:m,H=$.borderTop?g:2*g,Q=W!==X?1:d-_[E]+1;y.setEdge(T,W,{minlen:Q,weight:H,nestingEdge:!0}),y.setEdge(X,k,{minlen:Q,weight:H,nestingEdge:!0})}),y.parent(E)||y.setEdge(x,T,{weight:0,minlen:d+_[E]})},A=function(y){var x,v={},g=function(d,_){var E=y.children(d);E==null||E.forEach(function(w){return g(w,_+1)}),v[d]=_};return(x=y.children())===null||x===void 0||x.forEach(function(d){return g(d,1)}),v},N=function(y){var x=0;return y.edges().forEach(function(v){x+=y.edge(v).weight}),x},L=function(y){var x=y.graph();x.nestingRoot&&y.removeNode(x.nestingRoot),delete x.nestingRoot,y.edges().forEach(function(v){var g=y.edge(v);g.nestingEdge&&y.removeEdgeObj(v)})};U.default={run:j,cleanup:L}},32778:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var B=z(95869),j=function(N){N.graph().dummyChains=[],N.edges().forEach(function(L){return R(N,L)})},R=function(N,L){var y=L.v,x=N.node(y).rank,v=L.w,g=N.node(v).rank,d=L.name,_=N.edge(L),E=_.labelRank;if(g!==x+1){N.removeEdgeObj(L);var w=N.graph(),T,k,b;for(b=0,++x;x<g;++b,++x)_.points=[],k={edgeLabel:_,width:0,height:0,edgeObj:L,rank:x},T=(0,B.addDummyNode)(N,"edge",k,"_d"),x===E&&(k.width=_.width,k.height=_.height,k.dummy="edge-label",k.labelpos=_.labelpos),N.setEdge(y,T,{weight:_.weight},d),b===0&&(w.dummyChains||(w.dummyChains=[]),w.dummyChains.push(T)),y=T;N.setEdge(y,v,{weight:_.weight},d)}},A=function(N){var L;(L=N.graph().dummyChains)===null||L===void 0||L.forEach(function(y){var x=N.node(y),v=x.edgeLabel,g;x.edgeObj&&N.setEdgeObj(x.edgeObj,v);for(var d=y;x.dummy;)g=N.successors(d)[0],N.removeNode(d),v.points.push({x:x.x,y:x.y}),x.dummy==="edge-label"&&(v.x=x.x,v.y=x.y,v.width=x.width,v.height=x.height),d=g,x=N.node(d)})};U.default={run:j,undo:A}},99388:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(B,j,R){var A={},N;R==null||R.forEach(function(L){for(var y=B.parent(L),x,v;y;){if(x=B.parent(y),x?(v=A[x],A[x]=y):(v=N,N=y),v&&v!==y){j.setEdge(v,y);return}y=x}})};U.default=z},38937:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(B,j){return j.map(function(R){var A=B.inEdges(R);if(!(A==null?void 0:A.length))return{v:R};{var N={sum:0,weight:0};return A==null||A.forEach(function(L){var y=B.edge(L),x=B.node(L.v);N.sum+=y.weight*x.order,N.weight+=y.weight}),{v:R,barycenter:N.sum/N.weight,weight:N.weight}}})};U.default=z},74798:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var B=z(67858),j=function(A,N,L){var y=R(A),x=new B.Graph({compound:!0}).setGraph({root:y}).setDefaultNodeLabel(function(v){return A.node(v)});return A.nodes().forEach(function(v){var g,d=A.node(v),_=A.parent(v);(d.rank===N||d.minRank<=N&&N<=d.maxRank)&&(x.setNode(v),x.setParent(v,_||y),(g=A[L](v))===null||g===void 0||g.forEach(function(E){var w=E.v===v?E.w:E.v,T=x.edgeFromArgs(w,v),k=T!==void 0?T.weight:0;x.setEdge(w,v,{weight:A.edge(E).weight+k})}),d.hasOwnProperty("minRank")&&x.setNode(v,{borderLeft:d.borderLeft[N],borderRight:d.borderRight[N]}))}),x},R=function(A){for(var N;A.hasNode(N="_root".concat(Math.random())););return N};U.default=j},14842:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var B=z(95869),j=function(A,N,L){for(var y=(0,B.zipObject)(L,L.map(function(w,T){return T})),x=N.map(function(w){var T,k=(T=A.outEdges(w))===null||T===void 0?void 0:T.map(function(b){return{pos:y[b.w]||0,weight:A.edge(b).weight}});return k==null?void 0:k.sort(function(b,m){return b.pos-m.pos})}),v=x.flat().filter(function(w){return w!==void 0}),g=1;g<L.length;)g<<=1;var d=2*g-1;g-=1;var _=Array(d).fill(0,0,d),E=0;return v==null||v.forEach(function(w){if(w){var T=w.pos+g;_[T]+=w.weight;for(var k=0;T>0;)T%2&&(k+=_[T+1]),T=T-1>>1,_[T]+=w.weight;E+=w.weight*k}}),E},R=function(A,N){for(var L=0,y=1;y<(N==null?void 0:N.length);y+=1)L+=j(A,N[y-1],N[y]);return L};U.default=R},15113:function(or,U,z){"use strict";var B=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(U,"__esModule",{value:!0});var j=B(z(19722)),R=B(z(14842)),A=B(z(74798)),N=B(z(99388)),L=B(z(69563)),y=z(8273),x=z(67858),v=z(95869),g=function(w,T){for(var k=(0,v.maxRank)(w),b=[],m=[],$=1;$<k+1;$++)b.push($);for(var $=k-1;$>-1;$--)m.push($);var W=d(w,b,"inEdges"),X=d(w,m,"outEdges"),H=(0,j.default)(w);E(w,H);for(var Q=Number.POSITIVE_INFINITY,q,$=0,J=0;J<4;++$,++J){_($%2?W:X,$%4>=2,!1,T),H=(0,v.buildLayerMatrix)(w);var te=(0,R.default)(w,H);te<Q&&(J=0,q=(0,y.clone)(H),Q=te)}H=(0,j.default)(w),E(w,H);for(var $=0,J=0;J<4;++$,++J){_($%2?W:X,$%4>=2,!0,T),H=(0,v.buildLayerMatrix)(w);var te=(0,R.default)(w,H);te<Q&&(J=0,q=(0,y.clone)(H),Q=te)}E(w,q)},d=function(w,T,k){return T.map(function(b){return(0,A.default)(w,b,k)})},_=function(w,T,k,b){var m=new x.Graph;w==null||w.forEach(function($){for(var W,X=$.graph().root,H=(0,L.default)($,X,m,T,k,b),Q=0;Q<((W=H.vs)===null||W===void 0?void 0:W.length);Q++){var q=$.node(H.vs[Q]);q&&(q.order=Q)}(0,N.default)($,m,H.vs)})},E=function(w,T){T==null||T.forEach(function(k){k==null||k.forEach(function(b,m){w.node(b).order=m})})};U.default=g},27910:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(B,j){for(var R=B.nodes().filter(function(x){var v;return!((v=B.children(x))===null||v===void 0?void 0:v.length)}),A=R.map(function(x){return B.node(x).rank}),N=Math.max.apply(Math,A),L=[],y=0;y<N+1;y++)L[y]=[];j==null||j.forEach(function(x){var v=B.node(x);!v||(v==null?void 0:v.dummy)||isNaN(v.rank)||(v.fixorder=L[v.rank].length,L[v.rank].push(x))})};U.default=z},19722:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(B){for(var j={},R=B.nodes().filter(function(_){var E;return!((E=B.children(_))===null||E===void 0?void 0:E.length)}),A=R.map(function(_){return B.node(_).rank}),N=Math.max.apply(Math,A),L=[],y=0;y<N+1;y++)L.push([]);var x=function(_){var E;if(!j.hasOwnProperty(_)){j[_]=!0;var w=B.node(_);isNaN(w.rank)||L[w.rank].push(_),(E=B.successors(_))===null||E===void 0||E.forEach(function(T){return x(T)})}},v=R.sort(function(_,E){return B.node(_).rank-B.node(E).rank}),g=v.filter(function(_){return B.node(_).fixorder!==void 0}),d=g.sort(function(_,E){return B.node(_).fixorder-B.node(E).fixorder});return d==null||d.forEach(function(_){isNaN(B.node(_).rank)||L[B.node(_).rank].push(_),j[_]=!0}),v==null||v.forEach(x),L};U.default=z},73792:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(R,A){var N,L,y,x={};R==null||R.forEach(function(g,d){x[g.v]={i:d,indegree:0,in:[],out:[],vs:[g.v]};var _=x[g.v];g.barycenter!==void 0&&(_.barycenter=g.barycenter,_.weight=g.weight)}),(N=A.edges())===null||N===void 0||N.forEach(function(g){var d=x[g.v],_=x[g.w];d!==void 0&&_!==void 0&&(_.indegree++,d.out.push(x[g.w]))});var v=(y=(L=Object.values(x)).filter)===null||y===void 0?void 0:y.call(L,function(g){return!g.indegree});return B(v)},B=function(R){for(var A,N,L=[],y=function(_){return function(E){E.merged||(E.barycenter===void 0||_.barycenter===void 0||E.barycenter>=_.barycenter)&&j(_,E)}},x=function(_){return function(E){E.in.push(_),--E.indegree==0&&R.push(E)}},v=function(){var _=R.pop();L.push(_),(A=_.in.reverse())===null||A===void 0||A.forEach(function(E){return y(_)(E)}),(N=_.out)===null||N===void 0||N.forEach(function(E){return x(_)(E)})};R==null?void 0:R.length;)v();var g=L.filter(function(_){return!_.merged}),d=["vs","i","barycenter","weight"];return g.map(function(_){var E={};return d==null||d.forEach(function(w){_[w]!==void 0&&(E[w]=_[w])}),E})},j=function(R,A){var N,L=0,y=0;R.weight&&(L+=R.barycenter*R.weight,y+=R.weight),A.weight&&(L+=A.barycenter*A.weight,y+=A.weight),R.vs=(N=A.vs)===null||N===void 0?void 0:N.concat(R.vs),R.barycenter=L/y,R.weight=y,R.i=Math.min(A.i,R.i),A.merged=!0};U.default=z},69563:function(or,U,z){"use strict";var B=this&&this.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(U,"__esModule",{value:!0});var j=B(z(38937)),R=B(z(73792)),A=B(z(17457)),N=function(x,v,g,d,_,E){var w,T,k,b,m=x.children(v),$=x.node(v),W=$?$.borderLeft:void 0,X=$?$.borderRight:void 0,H={};W&&(m=m==null?void 0:m.filter(function(de){return de!==W&&de!==X}));var Q=(0,j.default)(x,m||[]);Q==null||Q.forEach(function(de){var Te;if((Te=x.children(de.v))===null||Te===void 0?void 0:Te.length){var Se=N(x,de.v,g,d,E);H[de.v]=Se,Se.hasOwnProperty("barycenter")&&y(de,Se)}});var q=(0,R.default)(Q,g);L(q,H),(w=q.filter(function(de){return de.vs.length>0}))===null||w===void 0||w.forEach(function(de){var Te=x.node(de.vs[0]);Te&&(de.fixorder=Te.fixorder,de.order=Te.order)});var J=(0,A.default)(q,d,_,E);if(W&&(J.vs=[W,J.vs,X].flat(),(T=x.predecessors(W))===null||T===void 0?void 0:T.length)){var te=x.node(((k=x.predecessors(W))===null||k===void 0?void 0:k[0])||""),fe=x.node(((b=x.predecessors(X))===null||b===void 0?void 0:b[0])||"");J.hasOwnProperty("barycenter")||(J.barycenter=0,J.weight=0),J.barycenter=(J.barycenter*J.weight+te.order+fe.order)/(J.weight+2),J.weight+=2}return J},L=function(x,v){x==null||x.forEach(function(g){var d,_=(d=g.vs)===null||d===void 0?void 0:d.map(function(E){return v[E]?v[E].vs:E});g.vs=_.flat()})},y=function(x,v){x.barycenter!==void 0?(x.barycenter=(x.barycenter*x.weight+v.barycenter*v.weight)/(x.weight+v.weight),x.weight+=v.weight):(x.barycenter=v.barycenter,x.weight=v.weight)};U.default=N},17457:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var B=z(95869),j=function(N,L,y,x){var v=(0,B.partition)(N,function(b){var m=b.hasOwnProperty("fixorder")&&!isNaN(b.fixorder);return x?!m&&b.hasOwnProperty("barycenter"):m||b.hasOwnProperty("barycenter")}),g=v.lhs,d=v.rhs.sort(function(b,m){return-b.i- -m.i}),_=[],E=0,w=0,T=0;g==null||g.sort(A(!!L,!!y)),T=R(_,d,T),g==null||g.forEach(function(b){var m;T+=(m=b.vs)===null||m===void 0?void 0:m.length,_.push(b.vs),E+=b.barycenter*b.weight,w+=b.weight,T=R(_,d,T)});var k={vs:_.flat()};return w&&(k.barycenter=E/w,k.weight=w),k},R=function(N,L,y){for(var x=y,v;L.length&&(v=L[L.length-1]).i<=x;)L.pop(),N==null||N.push(v.vs),x++;return x},A=function(N,L){return function(y,x){if(y.fixorder!==void 0&&x.fixorder!==void 0)return y.fixorder-x.fixorder;if(y.barycenter<x.barycenter)return-1;if(y.barycenter>x.barycenter)return 1;if(L&&y.order!==void 0&&x.order!==void 0){if(y.order<x.order)return-1;if(y.order>x.order)return 1}return N?x.i-y.i:y.i-x.i}};U.default=j},99946:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(R){var A,N={},L=0,y=function(x){var v,g=L;(v=R.children(x))===null||v===void 0||v.forEach(y),N[x]={low:g,lim:L++}};return(A=R.children())===null||A===void 0||A.forEach(y),N},B=function(R,A,N,L){var y=[],x=[],v=Math.min(A[N].low,A[L].low),g=Math.max(A[N].lim,A[L].lim),d,_;d=N;do d=R.parent(d),y.push(d);while(d&&(A[d].low>v||g>A[d].lim));for(_=d,d=L;d&&d!==_;)x.push(d),d=R.parent(d);return{lca:_,path:y.concat(x.reverse())}},j=function(R){var A,N=z(R);(A=R.graph().dummyChains)===null||A===void 0||A.forEach(function(L){var y,x,v=L,g=R.node(v),d=g.edgeObj;if(!!d)for(var _=B(R,N,d.v,d.w),E=_.path,w=_.lca,T=0,k=E[T],b=!0;v!==d.w;){if(g=R.node(v),b){for(;k!==w&&((y=R.node(k))===null||y===void 0?void 0:y.maxRank)<g.rank;)T++,k=E[T];k===w&&(b=!1)}if(!b){for(;T<E.length-1&&((x=R.node(E[T+1]))===null||x===void 0?void 0:x.minRank)<=g.rank;)T++;k=E[T]}R.setParent(v,k),v=R.successors(v)[0]}})};U.default=j},50075:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var $=function(W,X){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(H,Q){H.__proto__=Q}||function(H,Q){for(var q in Q)Object.prototype.hasOwnProperty.call(Q,q)&&(H[q]=Q[q])},$(W,X)};return function(W,X){if(typeof X!="function"&&X!==null)throw new TypeError("Class extends value "+String(X)+" is not a constructor or null");$(W,X);function H(){this.constructor=W}W.prototype=X===null?Object.create(X):(H.prototype=X.prototype,new H)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.width=U.sep=U.positionX=U.balance=U.alignCoordinates=U.findSmallestWidthAlignment=U.buildBlockGraph=U.horizontalCompaction=U.verticalAlignment=U.hasConflict=U.addConflict=U.findOtherInnerSegmentNode=U.findType2Conflicts=U.findType1Conflicts=void 0;var j=z(69787),R=z(95869),A=function($){B(W,$);function W(){return $!==null&&$.apply(this,arguments)||this}return W}(j.Graph),N=function($,W){var X={},H=function(Q,q){var J=0,te=0,fe=Q.length,de=q==null?void 0:q[(q==null?void 0:q.length)-1];return q==null||q.forEach(function(Te,Se){var Ie,be=(0,U.findOtherInnerSegmentNode)($,Te),pe=be?$.node(be).order:fe;(be||Te===de)&&((Ie=q.slice(te,Se+1))===null||Ie===void 0||Ie.forEach(function(Me){var De;(De=$.predecessors(Me))===null||De===void 0||De.forEach(function(Ue){var nt,Ze=$.node(Ue),ht=Ze.order;(ht<J||pe<ht)&&!(Ze.dummy&&((nt=$.node(Me))===null||nt===void 0?void 0:nt.dummy))&&(0,U.addConflict)(X,Ue,Me)})}),te=Se+1,J=pe)}),q};return(W==null?void 0:W.length)&&W.reduce(H),X};U.findType1Conflicts=N;var L=function($,W){var X={};function H(te,fe,de,Te,Se){for(var Ie,be,pe,Me=fe;Me<de;Me++)pe=te[Me],((Ie=$.node(pe))===null||Ie===void 0?void 0:Ie.dummy)&&((be=$.predecessors(pe))===null||be===void 0||be.forEach(function(De){var Ue=$.node(De);Ue.dummy&&(Ue.order<Te||Ue.order>Se)&&(0,U.addConflict)(X,De,pe)}))}function Q(te){return JSON.stringify(te.slice(1))}function q(te,fe){var de=Q(te);fe.get(de)||(H.apply(void 0,te),fe.set(de,!0))}var J=function(te,fe){var de=-1,Te,Se=0,Ie=new Map;return fe==null||fe.forEach(function(be,pe){var Me;if(((Me=$.node(be))===null||Me===void 0?void 0:Me.dummy)==="border"){var De=$.predecessors(be)||[];De.length&&(Te=$.node(De[0]).order,q([fe,Se,pe,de,Te],Ie),Se=pe,de=Te)}q([fe,Se,fe.length,Te,te.length],Ie)}),fe};return(W==null?void 0:W.length)&&W.reduce(J),X};U.findType2Conflicts=L;var y=function($,W){var X,H;if((X=$.node(W))===null||X===void 0?void 0:X.dummy)return(H=$.predecessors(W))===null||H===void 0?void 0:H.find(function(Q){return $.node(Q).dummy})};U.findOtherInnerSegmentNode=y;var x=function($,W,X){var H=W,Q=X;if(H>Q){var q=H;H=Q,Q=q}var J=$[H];J||($[H]=J={}),J[Q]=!0};U.addConflict=x;var v=function($,W,X){var H=W,Q=X;if(H>Q){var q=W;H=Q,Q=q}return!!$[H]};U.hasConflict=v;var g=function($,W,X,H){var Q={},q={},J={};return W==null||W.forEach(function(te){te==null||te.forEach(function(fe,de){Q[fe]=fe,q[fe]=fe,J[fe]=de})}),W==null||W.forEach(function(te){var fe=-1;te==null||te.forEach(function(de){var Te=H(de);if(Te.length){Te=Te.sort(function(Me,De){return J[Me]-J[De]});for(var Se=(Te.length-1)/2,Ie=Math.floor(Se),be=Math.ceil(Se);Ie<=be;++Ie){var pe=Te[Ie];q[de]===de&&fe<J[pe]&&!(0,U.hasConflict)(X,de,pe)&&(q[pe]=de,q[de]=Q[de]=Q[pe],fe=J[pe])}}})}),{root:Q,align:q}};U.verticalAlignment=g;var d=function($,W,X,H,Q){var q,J={},te=(0,U.buildBlockGraph)($,W,X,Q),fe=Q?"borderLeft":"borderRight",de=function(Ie,be){for(var pe=te.nodes(),Me=pe.pop(),De={};Me;)De[Me]?Ie(Me):(De[Me]=!0,pe.push(Me),pe=pe.concat(be(Me))),Me=pe.pop()},Te=function(Ie){J[Ie]=(te.inEdges(Ie)||[]).reduce(function(be,pe){return Math.max(be,(J[pe.v]||0)+te.edge(pe))},0)},Se=function(Ie){var be=(te.outEdges(Ie)||[]).reduce(function(Me,De){return Math.min(Me,(J[De.w]||0)-te.edge(De))},Number.POSITIVE_INFINITY),pe=$.node(Ie);be!==Number.POSITIVE_INFINITY&&pe.borderType!==fe&&(J[Ie]=Math.max(J[Ie],be))};return de(Te,te.predecessors.bind(te)),de(Se,te.successors.bind(te)),(q=Object.values(H))===null||q===void 0||q.forEach(function(Ie){J[Ie]=J[X[Ie]]}),J};U.horizontalCompaction=d;var _=function($,W,X,H){var Q=new A,q=$.graph(),J=(0,U.sep)(q.nodesep,q.edgesep,H);return W==null||W.forEach(function(te){var fe;te==null||te.forEach(function(de){var Te=X[de];if(Q.setNode(Te),fe){var Se=X[fe],Ie=Q.edgeFromArgs(Se,Te);Q.setEdge(Se,Te,Math.max(J($,de,fe),Ie||0))}fe=de})}),Q};U.buildBlockGraph=_;var E=function($,W){return(0,R.minBy)(Object.values(W),function(X){var H,Q=Number.NEGATIVE_INFINITY,q=Number.POSITIVE_INFINITY;return(H=Object.keys(X))===null||H===void 0||H.forEach(function(J){var te=X[J],fe=(0,U.width)($,J)/2;Q=Math.max(te+fe,Q),q=Math.min(te-fe,q)}),Q-q})};U.findSmallestWidthAlignment=E;function w($,W){var X=Object.values(W),H=Math.min.apply(Math,X),Q=Math.max.apply(Math,X);["u","d"].forEach(function(q){["l","r"].forEach(function(J){var te=q+J,fe=$[te],de;if(fe!==W){var Te=Object.values(fe);de=J==="l"?H-Math.min.apply(Math,Te):Q-Math.max.apply(Math,Te),de&&($[te]={},Object.keys(fe).forEach(function(Se){$[te][Se]=fe[Se]+de}))}})})}U.alignCoordinates=w;var T=function($,W){var X={};return Object.keys($.ul).forEach(function(H){if(W)X[H]=$[W.toLowerCase()][H];else{var Q=Object.values($).map(function(q){return q[H]});X[H]=(Q[0]+Q[1])/2}}),X};U.balance=T;var k=function($){var W=(0,R.buildLayerMatrix)($),X=Object.assign((0,U.findType1Conflicts)($,W),(0,U.findType2Conflicts)($,W)),H={},Q;["u","d"].forEach(function(J){Q=J==="u"?W:Object.values(W).reverse(),["l","r"].forEach(function(te){te==="r"&&(Q=Q.map(function(Se){return Object.values(Se).reverse()}));var fe=(J==="u"?$.predecessors:$.successors).bind($),de=(0,U.verticalAlignment)($,Q,X,fe),Te=(0,U.horizontalCompaction)($,Q,de.root,de.align,te==="r");te==="r"&&Object.keys(Te).forEach(function(Se){Te[Se]=-Te[Se]}),H[J+te]=Te})});var q=(0,U.findSmallestWidthAlignment)($,H);return w(H,q),(0,U.balance)(H,$.graph().align)};U.positionX=k;var b=function($,W,X){return function(H,Q,q){var J=H.node(Q),te=H.node(q),fe=0,de;if(fe+=J.width/2,J.hasOwnProperty("labelpos"))switch((J.labelpos||"").toLowerCase()){case"l":de=-J.width/2;break;case"r":de=J.width/2;break}if(de&&(fe+=X?de:-de),de=0,fe+=(J.dummy?W:$)/2,fe+=(te.dummy?W:$)/2,fe+=te.width/2,te.labelpos)switch((te.labelpos||"").toLowerCase()){case"l":de=te.width/2;break;case"r":de=-te.width/2;break}return de&&(fe+=X?de:-de),de=0,fe}};U.sep=b;var m=function($,W){return $.node(W).width||0};U.width=m},90829:function(or,U,z){"use strict";var B=this&&this.__spreadArray||function(y,x,v){if(v||arguments.length===2)for(var g=0,d=x.length,_;g<d;g++)(_||!(g in x))&&(_||(_=Array.prototype.slice.call(x,0,g)),_[g]=x[g]);return y.concat(_||Array.prototype.slice.call(x))};Object.defineProperty(U,"__esModule",{value:!0});var j=z(95869),R=z(50075),A=function(y){var x=(0,j.buildLayerMatrix)(y),v=y.graph().ranksep,g=0;x==null||x.forEach(function(d){var _=d.map(function(w){return y.node(w).height}),E=Math.max.apply(Math,B(B([],_,!1),[0],!1));d==null||d.forEach(function(w){y.node(w).y=g+E/2}),g+=E+v})},N=function(y){var x=(0,j.buildLayerMatrix)(y),v=Object.assign((0,R.findType1Conflicts)(y,x),(0,R.findType2Conflicts)(y,x)),g={},d=[];["u","d"].forEach(function(E){d=E==="u"?x:Object.values(x).reverse(),["l","r"].forEach(function(w){w==="r"&&(d=d.map(function(m){return Object.values(m).reverse()}));var T=(E==="u"?y.predecessors:y.successors).bind(y),k=(0,R.verticalAlignment)(y,d,v,T),b=(0,R.horizontalCompaction)(y,d,k.root,k.align,w==="r");w==="r"&&Object.keys(b).forEach(function(m){return b[m]=-b[m]}),g[E+w]=b})});var _=(0,R.findSmallestWidthAlignment)(y,g);return _&&(0,R.alignCoordinates)(g,_),(0,R.balance)(g,y.graph().align)},L=function(y){var x,v=(0,j.asNonCompoundGraph)(y);A(v);var g=N(v);(x=Object.keys(g))===null||x===void 0||x.forEach(function(d){v.node(d).x=g[d]})};U.default=L},85003:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.feasibleTreeWithLayer=U.feasibleTree=void 0;var B=z(76783),j=z(95869),R=z(67858),A=function(g){var d=new R.Graph({directed:!1}),_=g.nodes()[0],E=g.nodeCount();d.setNode(_,{});for(var w,T;N(d,g)<E;)w=x(d,g),T=d.hasNode(w.v)?(0,B.slack)(g,w):-(0,B.slack)(g,w),v(d,g,T);return d};U.feasibleTree=A;var N=function(g,d){var _=function(E){d.nodeEdges(E).forEach(function(w){var T=w.v,k=E===T?w.w:T;!g.hasNode(k)&&!(0,B.slack)(d,w)&&(g.setNode(k,{}),g.setEdge(E,k,{}),_(k))})};return g.nodes().forEach(_),g.nodeCount()},L=function(g){var d=new R.Graph({directed:!1}),_=g.nodes()[0],E=g.nodes().filter(function(k){return!!g.node(k)}).length;d.setNode(_,{});for(var w,T;y(d,g)<E;)w=x(d,g),T=d.hasNode(w.v)?(0,B.slack)(g,w):-(0,B.slack)(g,w),v(d,g,T);return d};U.feasibleTreeWithLayer=L;var y=function(g,d){var _=function(E){var w;(w=d.nodeEdges(E))===null||w===void 0||w.forEach(function(T){var k=T.v,b=E===k?T.w:k;!g.hasNode(b)&&(d.node(b).layer!==void 0||!(0,B.slack)(d,T))&&(g.setNode(b,{}),g.setEdge(E,b,{}),_(b))})};return g.nodes().forEach(_),g.nodeCount()},x=function(g,d){return(0,j.minBy)(d.edges(),function(_){return g.hasNode(_.v)!==g.hasNode(_.w)?(0,B.slack)(d,_):Infinity})},v=function(g,d,_){g.nodes().forEach(function(E){d.node(E).rank||(d.node(E).rank=0),d.node(E).rank+=_})};U.default={feasibleTree:A,feasibleTreeWithLayer:L}},68976:function(or,U,z){"use strict";var B=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(U,"__esModule",{value:!0});var j=z(76783),R=z(85003),A=B(z(5574)),N=function(v){switch(v.graph().ranker){case"network-simplex":x(v);break;case"tight-tree":y(v);break;case"longest-path":L(v);break;default:y(v)}},L=j.longestPath,y=function(v){(0,j.longestPathWithLayer)(v),(0,R.feasibleTreeWithLayer)(v)},x=function(v){(0,A.default)(v)};U.default=N},5574:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.exchangeEdges=U.enterEdge=U.leaveEdge=U.initLowLimValues=U.calcCutValue=U.initCutValues=void 0;var B=z(85003),j=z(76783),R=z(95869),A=z(69787),N=A.algorithm.preorder,L=A.algorithm.postorder,y=function($){var W=(0,R.simplify)($);(0,j.longestPath)(W);var X=(0,B.feasibleTree)(W);(0,U.initLowLimValues)(X),(0,U.initCutValues)(X,W);for(var H,Q;H=(0,U.leaveEdge)(X);)Q=(0,U.enterEdge)(X,W,H),(0,U.exchangeEdges)(X,W,H,Q)},x=function($,W){var X=L($,$.nodes());X=X==null?void 0:X.slice(0,(X==null?void 0:X.length)-1),X==null||X.forEach(function(H){v($,W,H)})};U.initCutValues=x;var v=function($,W,X){var H=$.node(X),Q=H.parent;$.edgeFromArgs(X,Q).cutvalue=(0,U.calcCutValue)($,W,X)},g=function($,W,X){var H,Q=$.node(X),q=Q.parent,J=!0,te=W.edgeFromArgs(X,q),fe=0;return te||(J=!1,te=W.edgeFromArgs(q,X)),fe=te.weight,(H=W.nodeEdges(X))===null||H===void 0||H.forEach(function(de){var Te=de.v===X,Se=Te?de.w:de.v;if(Se!==q){var Ie=Te===J,be=W.edge(de).weight;if(fe+=Ie?be:-be,b($,X,Se)){var pe=$.edgeFromArgs(X,Se).cutvalue;fe+=Ie?-pe:pe}}}),fe};U.calcCutValue=g;var d=function($,W){W===void 0&&(W=$.nodes()[0]),_($,{},1,W)};U.initLowLimValues=d;var _=function($,W,X,H,Q){var q,J=X,te=X,fe=$.node(H);return W[H]=!0,(q=$.neighbors(H))===null||q===void 0||q.forEach(function(de){W[de]||(te=_($,W,te,de,H))}),fe.low=J,fe.lim=te++,Q?fe.parent=Q:delete fe.parent,te},E=function($){return $.edges().find(function(W){return $.edge(W).cutvalue<0})};U.leaveEdge=E;var w=function($,W,X){var H=X.v,Q=X.w;W.hasEdge(H,Q)||(H=X.w,Q=X.v);var q=$.node(H),J=$.node(Q),te=q,fe=!1;q.lim>J.lim&&(te=J,fe=!0);var de=W.edges().filter(function(Te){return fe===m($,$.node(Te.v),te)&&fe!==m($,$.node(Te.w),te)});return(0,R.minBy)(de,function(Te){return(0,j.slack)(W,Te)})};U.enterEdge=w;var T=function($,W,X,H){var Q=X.v,q=X.w;$.removeEdge(Q,q),$.setEdge(H.v,H.w,{}),(0,U.initLowLimValues)($),(0,U.initCutValues)($,W),k($,W)};U.exchangeEdges=T;var k=function($,W){var X=$.nodes().find(function(Q){var q;return!((q=W.node(Q))===null||q===void 0?void 0:q.parent)}),H=N($,X);H=H==null?void 0:H.slice(1),H==null||H.forEach(function(Q){var q=$.node(Q).parent,J=W.edgeFromArgs(Q,q),te=!1;J||(J=W.edgeFromArgs(q,Q),te=!0),W.node(Q).rank=W.node(q).rank+(te?J.minlen:-J.minlen)})},b=function($,W,X){return $.hasEdge(W,X)},m=function($,W,X){return X.low<=W.lim&&W.lim<=X.lim};U.default=y},76783:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.slack=U.longestPathWithLayer=U.longestPath=void 0;var z=function(R){var A,N={},L=function(y){var x,v=R.node(y);if(!v)return 0;if(N[y])return v.rank;N[y]=!0;var g;return(x=R.outEdges(y))===null||x===void 0||x.forEach(function(d){var _=L(d.w),E=R.edge(d).minlen,w=_-E;w&&(g===void 0||w<g)&&(g=w)}),g||(g=0),v.rank=g,g};(A=R.sources())===null||A===void 0||A.forEach(function(y){return L(y)})};U.longestPath=z;var B=function(R){var A,N={},L,y=function(g){var d,_=R.node(g);if(!_)return 0;if(N[g])return _.rank;N[g]=!0;var E;return(d=R.outEdges(g))===null||d===void 0||d.forEach(function(w){var T=y(w.w),k=R.edge(w).minlen,b=T-k;b&&(E===void 0||b<E)&&(E=b)}),E||(E=0),(L===void 0||E<L)&&(L=E),_.rank=E,E};(A=R.sources())===null||A===void 0||A.forEach(function(g){R.node(g)&&y(g)}),L===void 0&&(L=0);var x={},v=function(g,d){var _,E=R.node(g),w=isNaN(E.layer)?d:E.layer;(E.rank===void 0||E.rank<w)&&(E.rank=w),!x[g]&&(x[g]=!0,(_=R.outEdges(g))===null||_===void 0||_.map(function(T){v(T.w,w+R.edge(T).minlen)}))};R.nodes().forEach(function(g){var d=R.node(g);!d||(isNaN(d.layer)?d.rank-=L:v(g,d.layer))})};U.longestPathWithLayer=B;var j=function(R,A){return R.node(A.w).rank-R.node(A.v).rank-R.edge(A).minlen};U.slack=j,U.default={longestPath:z,longestPathWithLayer:B,slack:j}},95869:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.minBy=U.notime=U.time=U.partition=U.maxRank=U.addBorderNode=U.removeEmptyRanks=U.normalizeRanks=U.buildLayerMatrix=U.intersectRect=U.predecessorWeights=U.successorWeights=U.zipObject=U.asNonCompoundGraph=U.simplify=U.addDummyNode=void 0;var B=z(8273),j=z(67858),R=function(W,X){return Number(W)-Number(X)},A=function(W,X,H,Q){var q;do q="".concat(Q).concat(Math.random());while(W.hasNode(q));return H.dummy=X,W.setNode(q,H),q};U.addDummyNode=A;var N=function(W){var X=new j.Graph().setGraph(W.graph());return W.nodes().forEach(function(H){X.setNode(H,W.node(H))}),W.edges().forEach(function(H){var Q=X.edgeFromArgs(H.v,H.w)||{weight:0,minlen:1},q=W.edge(H);X.setEdge(H.v,H.w,{weight:Q.weight+q.weight,minlen:Math.max(Q.minlen,q.minlen)})}),X};U.simplify=N;var L=function(W){var X=new j.Graph({multigraph:W.isMultigraph()}).setGraph(W.graph());return W.nodes().forEach(function(H){var Q;((Q=W.children(H))===null||Q===void 0?void 0:Q.length)||X.setNode(H,W.node(H))}),W.edges().forEach(function(H){X.setEdgeObj(H,W.edge(H))}),X};U.asNonCompoundGraph=L;var y=function(W,X){return W==null?void 0:W.reduce(function(H,Q,q){return H[Q]=X[q],H},{})};U.zipObject=y;var x=function(W){var X={};return W.nodes().forEach(function(H){var Q,q={};(Q=W.outEdges(H))===null||Q===void 0||Q.forEach(function(J){var te;q[J.w]=(q[J.w]||0)+(((te=W.edge(J))===null||te===void 0?void 0:te.weight)||0)}),X[H]=q}),X};U.successorWeights=x;var v=function(W){var X=W.nodes(),H=X.map(function(Q){var q,J={};return(q=W.inEdges(Q))===null||q===void 0||q.forEach(function(te){J[te.v]=(J[te.v]||0)+W.edge(te).weight}),J});return(0,U.zipObject)(X,H)};U.predecessorWeights=v;var g=function(W,X){var H=Number(W.x),Q=Number(W.y),q=Number(X.x)-H,J=Number(X.y)-Q,te=Number(W.width)/2,fe=Number(W.height)/2;if(!q&&!J)return{x:0,y:0};var de,Te;return Math.abs(J)*te>Math.abs(q)*fe?(J<0&&(fe=-fe),de=fe*q/J,Te=fe):(q<0&&(te=-te),de=te,Te=te*J/q),{x:H+de,y:Q+Te}};U.intersectRect=g;var d=function(W){for(var X=[],H=(0,U.maxRank)(W)+1,Q=0;Q<H;Q++)X.push([]);W.nodes().forEach(function(q){var J=W.node(q);if(!!J){var te=J.rank;te!==void 0&&X[te]&&X[te].push(q)}});for(var Q=0;Q<H;Q++)X[Q]=X[Q].sort(function(J,te){var fe,de;return R((fe=W.node(J))===null||fe===void 0?void 0:fe.order,(de=W.node(te))===null||de===void 0?void 0:de.order)});return X};U.buildLayerMatrix=d;var _=function(W){var X=W.nodes().filter(function(Q){var q;return((q=W.node(Q))===null||q===void 0?void 0:q.rank)!==void 0}).map(function(Q){return W.node(Q).rank}),H=Math.min.apply(Math,X);W.nodes().forEach(function(Q){var q=W.node(Q);q.hasOwnProperty("rank")&&H!==Infinity&&(q.rank-=H)})};U.normalizeRanks=_;var E=function(W){var X=W.nodes(),H=X.filter(function(Te){var Se;return((Se=W.node(Te))===null||Se===void 0?void 0:Se.rank)!==void 0}).map(function(Te){return W.node(Te).rank}),Q=Math.min.apply(Math,H),q=[];X.forEach(function(Te){var Se,Ie=(((Se=W.node(Te))===null||Se===void 0?void 0:Se.rank)||0)-Q;q[Ie]||(q[Ie]=[]),q[Ie].push(Te)});for(var J=0,te=W.graph().nodeRankFactor||0,fe=0;fe<q.length;fe++){var de=q[fe];de===void 0?fe%te!=0&&(J-=1):J&&(de==null||de.forEach(function(Te){var Se=W.node(Te);Se&&(Se.rank=Se.rank||0,Se.rank+=J)}))}};U.removeEmptyRanks=E;var w=function(W,X,H,Q){var q={width:0,height:0};return(0,B.isNumber)(H)&&(0,B.isNumber)(Q)&&(q.rank=H,q.order=Q),(0,U.addDummyNode)(W,"border",q,X)};U.addBorderNode=w;var T=function(W){var X;return W.nodes().forEach(function(H){var Q,q=(Q=W.node(H))===null||Q===void 0?void 0:Q.rank;q!==void 0&&(X===void 0||q>X)&&(X=q)}),X||(X=0),X};U.maxRank=T;var k=function(W,X){var H={lhs:[],rhs:[]};return W==null||W.forEach(function(Q){X(Q)?H.lhs.push(Q):H.rhs.push(Q)}),H};U.partition=k;var b=function(W,X){var H=Date.now();try{return X()}finally{console.log("".concat(W," time: ").concat(Date.now()-H,"ms"))}};U.time=b;var m=function(W,X){return X()};U.notime=m;var $=function(W,X){return W.reduce(function(H,Q){var q=X(H),J=X(Q);return q>J?Q:H})};U.minBy=$},29279:function(or,U,z){"use strict";var B=this&&this.__assign||function(){return B=Object.assign||function(d){for(var _,E=1,w=arguments.length;E<w;E++){_=arguments[E];for(var T in _)Object.prototype.hasOwnProperty.call(_,T)&&(d[T]=_[T])}return d},B.apply(this,arguments)},j=this&&this.__createBinding||(Object.create?function(d,_,E,w){w===void 0&&(w=E);var T=Object.getOwnPropertyDescriptor(_,E);(!T||("get"in T?!_.__esModule:T.writable||T.configurable))&&(T={enumerable:!0,get:function(){return _[E]}}),Object.defineProperty(d,w,T)}:function(d,_,E,w){w===void 0&&(w=E),d[w]=_[E]}),R=this&&this.__setModuleDefault||(Object.create?function(d,_){Object.defineProperty(d,"default",{enumerable:!0,value:_})}:function(d,_){d.default=_}),A=this&&this.__importStar||function(d){if(d&&d.__esModule)return d;var _={};if(d!=null)for(var E in d)E!=="default"&&Object.prototype.hasOwnProperty.call(d,E)&&j(_,d,E);return R(_,d),_},N=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(U,"__esModule",{value:!0});var L=A(z(41685)),y=N(z(28563)),x=N(z(77280)),v=z(2);function g(d,_){var E=d.nodes,w=d.edges,T=_.width,k=_.height;if(!(E==null?void 0:E.length))return Promise.resolve();var b=[];E.forEach(function(J){var te=w.filter(function(de){return de.source===J.id||de.target===J.id});if(te.length>1){var fe=B({},J);delete fe.size,b.push(fe)}});var m=[];w.forEach(function(J){var te=b.find(function(de){return de.id===J.source}),fe=b.find(function(de){return de.id===J.target});te&&fe&&m.push(J)});var $=new v.DagreLayout({type:"dagre",ranksep:_.nodeMinGap,nodesep:_.nodeMinGap}),W=$.layout({nodes:b,edges:m}).nodes;E.forEach(function(J){var te=(W||[]).find(function(fe){return fe.id===J.id});J.x=(te==null?void 0:te.x)||T/2,J.y=(te==null?void 0:te.y)||k/2});var X=JSON.parse(JSON.stringify(E)),H=JSON.parse(JSON.stringify(w)),Q=L.forceSimulation().nodes(X).force("link",L.forceLink(H).id(function(J){return J.id}).distance(function(J){var te=m.find(function(fe){return fe.source===J.source&&fe.target===J.target});return te?30:20})).force("charge",L.forceManyBody()).force("center",L.forceCenter(T/2,k/2)).force("x",L.forceX(T/2)).force("y",L.forceY(k/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),q=new Promise(function(J){Q.on("end",function(){E.forEach(function(be){var pe=X.find(function(Me){return Me.id===be.id});pe&&(be.x=pe.x,be.y=pe.y)});var te=Math.min.apply(Math,E.map(function(be){return be.x})),fe=Math.max.apply(Math,E.map(function(be){return be.x})),de=Math.min.apply(Math,E.map(function(be){return be.y})),Te=Math.max.apply(Math,E.map(function(be){return be.y})),Se=T/(fe-te),Ie=k/(Te-de);E.forEach(function(be){be.x!==void 0&&Se<1&&(be.x=(be.x-te)*Se),be.y!==void 0&&Ie<1&&(be.y=(be.y-de)*Ie)}),E.forEach(function(be){be.sizeTemp=be.size,be.size=[10,10]}),(0,x.default)(E,w),E.forEach(function(be){be.size=be.sizeTemp||[],delete be.sizeTemp}),(0,y.default)({nodes:E,edges:w},_),J()})});return q}U.default=g},28563:function(or,U,z){"use strict";var B=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(U,"__esModule",{value:!0});var j=B(z(62120));function R(A,N){if(!A.nodes||A.nodes.length===0)return A;var L=N.width,y=N.height,x=N.nodeMinGap,v=1e4,g=1e4;A.nodes.forEach(function(H){var Q=H.size[0]||50,q=H.size[1]||50;v=Math.min(Q,v),g=Math.min(q,g)});var d=new j.default;d.init(L,y,{CELL_H:g,CELL_W:v}),A.nodes.forEach(function(H){var Q=d.occupyNearest(H);Q&&(Q.node={id:H.id,size:H.size},H.x=Q.x,H.y=Q.y,H.dx=Q.dx,H.dy=Q.dy)});for(var _=0;_<A.nodes.length;_++){var E=A.nodes[_],w=d.findGridByNodeId(E.id);if(!w)throw new Error("can not find node cell");var T=w.column,k=w.row;if(E.size[0]+x>v){for(var b=Math.ceil((E.size[0]+x)/v)-1,m=b,$=0;$<b;$++){var W=d.additionColumn.indexOf(T+$+1)>-1;if(W&&!d.cells[T+$+1][k].node)m--;else break}d.insertColumn(T,m)}if(E.size[1]+x>g){for(var b=Math.ceil((E.size[1]+x)/g)-1,m=b,$=0;$<b;$++){var W=d.additionRow.indexOf(k+$+1)>-1;if(W&&!d.cells[T][k+$+1].node)m--;else break}d.insertRow(k,m)}}for(var _=0;_<d.columnNum;_++)for(var X=function(Q){var q=d.cells[_][Q];if(q.node){var J=A.nodes.find(function(te){var fe;return te.id===((fe=q==null?void 0:q.node)===null||fe===void 0?void 0:fe.id)});J&&(J.x=q.x+J.size[0]/2,J.y=q.y+J.size[1]/2)}},$=0;$<d.rowNum;$++)X($)}U.default=R},62120:function(or,U){"use strict";var z=this&&this.__assign||function(){return z=Object.assign||function(j){for(var R,A=1,N=arguments.length;A<N;A++){R=arguments[A];for(var L in R)Object.prototype.hasOwnProperty.call(R,L)&&(j[L]=R[L])}return j},z.apply(this,arguments)};Object.defineProperty(U,"__esModule",{value:!0});var B=function(){function j(){this.cells=[],this.columnNum=0,this.rowNum=0,this.additionColumn=[],this.additionRow=[]}return j.prototype.init=function(R,A,N){this.cells=[],this.CELL_W=N.CELL_W||j.DEFAULT_CELL_W,this.CELL_H=N.CELL_H||j.DEFAULT_CELL_H,this.columnNum=Math.ceil(R/this.CELL_W),this.rowNum=Math.ceil(A/this.CELL_H),j.MIN_DIST=Math.pow(R,2)+Math.pow(A,2);for(var L=0;L<this.columnNum;L++){for(var y=[],x=0;x<this.rowNum;x++){var v={dx:L,dy:x,x:L*this.CELL_W,y:x*this.CELL_H,occupied:!1};y.push(v)}this.cells.push(y)}},j.prototype.findGridByNodeId=function(R){for(var A,N,L=0;L<this.columnNum;L++)for(var y=0;y<this.rowNum;y++)if(this.cells[L][y].node&&((N=(A=this.cells[L][y])===null||A===void 0?void 0:A.node)===null||N===void 0?void 0:N.id)===R)return{column:L,row:y};return null},j.prototype.sqdist=function(R,A){return Math.pow(R.x-A.x,2)+Math.pow(R.y-A.y,2)},j.prototype.occupyNearest=function(R){for(var A=j.MIN_DIST,N,L=null,y=0;y<this.columnNum;y++)for(var x=0;x<this.rowNum;x++)!this.cells[y][x].occupied&&(N=this.sqdist(R,this.cells[y][x]))<A&&(A=N,L=this.cells[y][x]);return L&&(L.occupied=!0),L},j.prototype.insertColumn=function(R,A){if(!(A<=0)){for(var N=0;N<A;N++){this.cells[N+this.columnNum]=[];for(var L=0;L<this.rowNum;L++)this.cells[N+this.columnNum][L]={dx:N,dy:L,x:N*this.CELL_W,y:L*this.CELL_H,occupied:!1,node:null}}for(var N=this.columnNum-1;N>R;N--)for(var L=0;L<this.rowNum;L++)this.cells[N+A][L]=z(z({},this.cells[N][L]),{x:(N+A)*this.CELL_W,y:L*this.CELL_H}),this.cells[N][L]={x:N*this.CELL_W,y:L*this.CELL_H,occupied:!0,node:null};for(var L=0;L<this.additionColumn.length;L++)this.additionColumn[L]>=R&&(this.additionColumn[L]+=A);for(var N=0;N<A;N++)this.additionColumn.push(R+N+1);this.columnNum+=A}},j.prototype.insertRow=function(R,A){if(!(A<=0)){for(var N=0;N<A;N++)for(var L=0;L<this.columnNum;L++)this.cells[L][N+this.rowNum]={dx:L,dy:N,x:L*this.CELL_W,y:N*this.CELL_H,occupied:!1,node:null};for(var L=0;L<this.columnNum;L++)for(var N=this.rowNum-1;N>R;N--)this.cells[L][N+A]=z(z({},this.cells[L][N]),{dx:L,dy:N+A,x:L*this.CELL_W,y:(N+A)*this.CELL_H}),this.cells[L][N]={dx:L,dy:N,x:L*this.CELL_W,y:N*this.CELL_H,occupied:!1,node:null};for(var N=0;N<this.additionRow.length;N++)this.additionRow[N]>=R&&(this.additionRow[N]+=A);for(var L=0;L<A;L++)this.additionRow.push(R+L+1);this.rowNum+=A}},j.prototype.getNodes=function(){for(var R=[],A=0;A<this.columnNum;A++)for(var N=0;N<this.rowNum;N++)this.cells[A][N].node&&R.push(this.cells[A][N]);return R},j.MIN_DIST=50,j.DEFAULT_CELL_W=80,j.DEFAULT_CELL_H=80,j}();U.default=B},40311:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var L=function(y,x){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(v[d]=g[d])},L(y,x)};return function(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");L(y,x);function v(){this.constructor=y}y.prototype=x===null?Object.create(x):(v.prototype=x.prototype,new v)}}(),j=this&&this.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(U,"__esModule",{value:!0}),U.ERLayout=void 0;var R=z(46253),A=j(z(29279)),N=function(L){B(y,L);function y(x){var v=L.call(this)||this;return v.width=300,v.height=300,v.nodeMinGap=50,v.onLayoutEnd=function(){},x&&v.updateCfg(x),v}return y.prototype.getDefaultCfg=function(){return{width:300,height:300,nodeMinGap:50}},y.prototype.execute=function(){var x=this,v=x.nodes,g=x.edges;return v==null||v.forEach(function(d){d.size||(d.size=[50,50])}),(0,A.default)({nodes:v,edges:g},{width:this.width,height:this.height,nodeMinGap:this.nodeMinGap}).then(function(){x.onLayoutEnd&&x.onLayoutEnd()})},y.prototype.getType=function(){return"er"},y}(R.Base);U.ERLayout=N},77280:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=1200,B=800,j=1e7,R=10,A=3.141592653589793,N=1.5707963267948966,L=A*.375,y=A*.625,x=new Map,v=10,g=10,d=.8,_=.1,E=.5;function w(X,H,Q){var q=X.x-X.size[0]/2,J=X.y-X.size[1]/2,te=X.x+X.size[0]/2,fe=X.y+X.size[1]/2,de=H.x-H.size[0]/2,Te=H.y-H.size[1]/2,Se=H.x+H.size[0]/2,Ie=H.y+H.size[1]/2,be=X.x,pe=X.y,Me=H.x,De=H.y,Ue=Me-be,nt=Math.atan2(Ue,De-pe),Ze=0,ht=0,Rt=0,tr=0;nt>N?(ht=J-Ie,Ze=de-te,Rt=parseFloat(ht?(ht/Math.cos(nt)).toFixed(2):Ze.toFixed(2)),tr=parseFloat(Ze?(Ze/Math.sin(nt)).toFixed(2):ht.toFixed(2))):0<nt&&nt<=N?(ht=Te-fe,Ze=de-te,ht>Ze?Rt=tr=parseFloat(ht?(ht/Math.cos(nt)).toFixed(2):Ze.toFixed(2)):Rt=tr=parseFloat(Ze?(Ze/Math.sin(nt)).toFixed(2):ht.toFixed(2))):nt<-N?(ht=J-Ie,Ze=-(Se-q),ht>Ze?Rt=tr=parseFloat(ht?(ht/Math.cos(nt)).toFixed(2):Ze.toFixed(2)):Rt=tr=parseFloat(Ze?(Ze/Math.sin(nt)).toFixed(2):ht.toFixed(2))):(ht=Te-fe,Math.abs(Ue)>(te-q)/2?Ze=q-Se:Ze=Ue,ht>Ze?Rt=tr=parseFloat(ht?(ht/Math.cos(nt)).toFixed(2):Ze.toFixed(2)):Rt=tr=parseFloat(Ze&&nt!==0?(Ze/Math.sin(nt)).toFixed(2):ht.toFixed(2)));var Qe=parseFloat(nt.toFixed(2)),lt=Q;return Q&&(lt=L<Qe&&Qe<y),{distance:Math.abs(Rt<tr?Rt:tr),isHoriz:lt}}function T(X,H){var Q=x.get(X.id)||[],q=Q.find(function(qt){return qt.source===H.id||qt.target===H.id}),J=X.size[0]*X.size[1],te=H.size[0]*H.size[1],fe=J>te?H:X,de=J>te?X:H,Te=fe.x-fe.size[0]/2,Se=fe.y-fe.size[1]/2,Ie=fe.x+fe.size[0]/2,be=fe.y+fe.size[1]/2,pe=de.x-de.size[0]/2,Me=de.y-de.size[1]/2,De=de.x+de.size[0]/2,Ue=de.y+de.size[1]/2,nt=fe.x,Ze=fe.y,ht=de.x,Rt=de.y,tr=Ie>=pe&&De>=Te&&be>=Me&&Ue>=Se,Qe=0,lt=0;if(tr){lt=Math.sqrt(Math.pow(ht-nt,2)+Math.pow(Rt-Ze,2));var St=Te>pe?Te:pe,Ct=Se>Me?Se:Me,_t=Ie<De?Ie:De,pt=be<Ue?be:Ue,rr=_t-St,xr=pt-Ct,Vt=rr*xr;lt===0&&(lt=1e-7),Qe=R*1/lt*100+Vt,Qe*=j}else{var ft=!1,Bt=w(fe,de,ft);lt=Bt.distance,ft=Bt.isHoriz,lt<=R?lt!==0?q?Qe+=R+j*1/lt:Qe+=R+j*R/lt:Qe+=j:(Qe+=lt,q&&(Qe+=lt*lt))}return Qe}function k(X){for(var H=0,Q=0;Q<X.length;Q++){var q=X[Q];(q.x<0||q.y<0||q.x>z||q.y>B)&&(H+=1e12);for(var J=Q+1;J<X.length;J++)H+=T(q,X[J])}return H}function b(X,H,Q,q){var J=new Map;Q.forEach(function(nt,Ze){J.set(nt.id,nt)});var te=q.filter(function(nt){return nt.source===X.id||nt.target===X.id})||[],fe=[];te.forEach(function(nt){var Ze=nt.source===X.id?nt.target:nt.source,ht=J.get(Ze);ht&&fe.push(ht)});for(var de=!0,Te=0;Te<fe.length;Te++){var Se=fe[Te],Ie=Math.atan((X.y-Se.y)/(Se.x-X.y))*180,be=Math.atan((H.y-Se.y)/(Se.x-H.y))*180,pe=Ie<30||Ie>150,Me=be<30||be>150,De=Ie>70&&Ie<110,Ue=be>70&&be<110;if(pe&&!Me||Ie*be<0){de=!1;break}else if(De&&!Ue||Ie*be<0){de=!1;break}else if((Se.x-X.x)*(Se.x-H.x)<0){de=!1;break}else if((Se.y-X.y)*(Se.y-H.y)<0){de=!1;break}}return de}function m(X,H){for(var Q=!1,q=1,J=v*q,te=g*q,fe=[J,-J,0,0],de=[0,0,te,-te],Te=0;Te<X.length;++Te)for(var Se=X[Te],Ie=$(Se,X),be=0;be<fe.length;be++){var pe=b(Se,{x:Se.x+fe[be],y:Se.y+de[be]},X,H);if(pe){Se.x+=fe[be],Se.y+=de[be];var Me=$(Se,X),De=Math.random();Me<Ie||De<d&&De>_?(Ie=Me,Q=!0):(Se.x-=fe[be],Se.y-=de[be])}}return d>_&&(d*=E),Q?k(X):0}function $(X,H){var Q=0;(X.x<0||X.y<0||X.x+X.size[0]+20>z||X.y+X.size[1]+20>B)&&(Q+=1e12);for(var q=0;q<H.length;++q)X.id!==H[q].id&&(Q+=T(X,H[q]));return Q}function W(X,H){if(X.length===0)return{nodes:X,edges:H};X.forEach(function(Se){var Ie=H.filter(function(be){return be.source===Se.id||be.target===Se.id});x.set(Se,Ie)}),X.sort(function(Se,Ie){var be,pe;return((be=x.get(Se.id))===null||be===void 0?void 0:be.length)-((pe=x.get(Ie.id))===null||pe===void 0?void 0:pe.length)});for(var Q=k(X),q=20,J=1,te=0,fe=50,de=0;q>0&&(de++,!(de>=fe));){var Te=m(X,H);Te!==0&&(te=Te),J=te-Q,Q=te,J===0?--q:q=20}return X.forEach(function(Se){Se.x=Se.x-Se.size[0]/2,Se.y=Se.y-Se.size[1]/2}),{nodes:X,edges:H}}U.default=W},26961:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.forceNBody=void 0;var B=z(71829),j=.81,R=.1;function A(x,v,g,d,_){var E=g/d,w=x.map(function(k,b){var m=v[k.id],$=m.data,W=m.x,X=m.y,H=m.size,Q=$.layout.force.nodeStrength;return{x:W,y:X,size:H,index:b,vx:0,vy:0,weight:E*Q}}),T=(0,B.quadtree)(w,function(k){return k.x},function(k){return k.y}).visitAfter(N);return w.forEach(function(k){y(k,T)}),w.map(function(k,b){var m=v[x[b].id],$=m.data.layout.force.mass,W=$===void 0?1:$;_[2*b]=k.vx/W,_[2*b+1]=k.vy/W}),_}U.forceNBody=A;function N(x){var v=0,g=0,d=0;if(x.length){for(var _=0;_<4;_++){var E=x[_];E&&E.weight&&(v+=E.weight,g+=E.x*E.weight,d+=E.y*E.weight)}x.x=g/v,x.y=d/v,x.weight=v}else{var E=x;x.x=E.data.x,x.y=E.data.y,x.weight=E.data.weight}}var L=function(x,v,g,d,_,E){var w=E.x-x.x||R,T=E.y-x.y||R,k=d-v,b=w*w+T*T,m=Math.sqrt(b)*b;if(k*k*j<b){var $=x.weight/m;return E.vx+=w*$,E.vy+=T*$,!0}if(x.length)return!1;if(x.data!==E){var $=x.data.weight/m;E.vx+=w*$,E.vy+=T*$}};function y(x,v){v.visit(function(g,d,_,E,w){return L(g,d,_,E,w,x)})}},38129:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var x=function(v,g){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,_){d.__proto__=_}||function(d,_){for(var E in _)Object.prototype.hasOwnProperty.call(_,E)&&(d[E]=_[E])},x(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");x(v,g);function d(){this.constructor=v}v.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}(),j=this&&this.__assign||function(){return j=Object.assign||function(x){for(var v,g=1,d=arguments.length;g<d;g++){v=arguments[g];for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(x[_]=v[_])}return x},j.apply(this,arguments)};Object.defineProperty(U,"__esModule",{value:!0}),U.Force2Layout=void 0;var R=z(46253),A=z(8273),N=z(26961),L=function(x,v){var g;return x?(0,A.isNumber)(x)?g=function(d){return x}:g=x:g=function(d){return v||1},g},y=function(x){B(v,x);function v(g){var d=x.call(this)||this;d.maxIteration=1e3,d.workerEnabled=!1,d.edgeStrength=200,d.nodeStrength=1e3,d.coulombDisScale=.005,d.damping=.9,d.maxSpeed=500,d.minMovement=.4,d.interval=.02,d.factor=1,d.linkDistance=200,d.gravity=0,d.clusterNodeStrength=20,d.preventOverlap=!0,d.distanceThresholdMode="mean",d.tick=function(){},d.nodes=[],d.edges=[],d.width=300,d.height=300,d.nodeMap={},d.nodeIdxMap={},d.judgingDistance=0,d.centripetalOptions={leaf:2,single:2,others:1,center:function(E){return{x:d.width/2,y:d.height/2}}};var _=g.getMass;return d.propsGetMass=_,d.updateCfg(g),d}return v.prototype.getCentripetalOptions=function(){var g=this,d=g.leafCluster,_=g.clustering,E=g.nodeClusterBy,w=g.nodes,T=g.nodeMap,k=g.clusterNodeStrength,b=function(fe){return typeof k=="function"?k(fe):k},m={},$;if(d){$=this.getSameTypeLeafMap()||{};var W=Array.from(new Set(w==null?void 0:w.map(function(fe){return fe[E]})))||[];m={single:100,leaf:function(fe,de,Te){var Se=$[fe.id]||{},Ie=Se.relativeLeafNodes,be=Se.sameTypeLeafNodes;return(be==null?void 0:be.length)===(Ie==null?void 0:Ie.length)||(W==null?void 0:W.length)===1?1:b(fe)},others:1,center:function(fe,de,Te){var Se,Ie=(((Se=fe.data)===null||Se===void 0?void 0:Se.layout)||{}).degree;if(!Ie)return{x:100,y:100};var be;if(Ie===1){var pe=($[fe.id]||{}).sameTypeLeafNodes,Me=pe===void 0?[]:pe;Me.length===1?be=void 0:Me.length>1&&(be=(0,A.getAvgNodePosition)(Me))}else be=void 0;return{x:be==null?void 0:be.x,y:be==null?void 0:be.y}}}}if(_){$||($=this.getSameTypeLeafMap());var X=Array.from(new Set(w.map(function(fe,de){return fe[E]}))).filter(function(fe){return fe!==void 0}),H={};X.forEach(function(fe){var de=w.filter(function(Te){return Te[E]===fe}).map(function(Te){return T[Te.id]});H[fe]=(0,A.getAvgNodePosition)(de)}),m={single:function(fe){return b(fe)},leaf:function(fe){return b(fe)},others:function(fe){return b(fe)},center:function(fe,de,Te){var Se=H[fe[E]];return{x:Se==null?void 0:Se.x,y:Se==null?void 0:Se.y}}}}this.centripetalOptions=j(j({},this.centripetalOptions),m);var Q=this.centripetalOptions,q=Q.leaf,J=Q.single,te=Q.others;q&&typeof q!="function"&&(this.centripetalOptions.leaf=function(){return q}),J&&typeof J!="function"&&(this.centripetalOptions.single=function(){return J}),te&&typeof te!="function"&&(this.centripetalOptions.others=function(){return te})},v.prototype.updateCfg=function(g){g&&Object.assign(this,g)},v.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},v.prototype.execute=function(){var g=this;g.stop();var d=g.nodes,_=g.edges,E=g.defSpringLen;if(g.judgingDistance=0,!d||d.length===0){g.onLayoutEnd([]);return}!g.width&&typeof window!="undefined"&&(g.width=window.innerWidth),!g.height&&typeof window!="undefined"&&(g.height=window.innerHeight),g.center||(g.center=[g.width/2,g.height/2]);var w=g.center;if(d.length===1){d[0].x=w[0],d[0].y=w[1],g.onLayoutEnd([j({},d[0])]);return}g.degreesMap=(0,A.getDegreeMap)(d,_),g.propsGetMass?g.getMass=g.propsGetMass:g.getMass=function(X){var H=1;(0,A.isNumber)(X.mass)&&(H=X.mass);var Q=g.degreesMap[X.id].all;return!Q||Q<5?H:Q*5*H};var T=g.nodeSize,k;if(g.preventOverlap){var b=g.nodeSpacing,m;(0,A.isNumber)(b)?m=function(){return b}:(0,A.isFunction)(b)?m=b:m=function(){return 0},T?(0,A.isArray)(T)?k=function(X){return Math.max(T[0],T[1])+m(X)}:k=function(X){return T+m(X)}:k=function(X){return X.size?(0,A.isArray)(X.size)?Math.max(X.size[0],X.size[1])+m(X):(0,A.isObject)(X.size)?Math.max(X.size.width,X.size.height)+m(X):X.size+m(X):10+m(X)}}g.nodeSize=k,g.linkDistance=L(g.linkDistance,1),g.nodeStrength=L(g.nodeStrength,1),g.edgeStrength=L(g.edgeStrength,1);var $={},W={};d.forEach(function(X,H){(0,A.isNumber)(X.x)||(X.x=Math.random()*g.width),(0,A.isNumber)(X.y)||(X.y=Math.random()*g.height);var Q=g.degreesMap[X.id];$[X.id]=j(j({},X),{data:j(j({},X.data),{size:g.nodeSize(X)||30,layout:{inDegree:Q.in,outDegree:Q.out,degree:Q.all,tDegree:Q.in,sDegree:Q.out,force:{mass:g.getMass(X),nodeStrength:g.nodeStrength(X)}}})}),W[X.id]=H}),g.nodeMap=$,g.nodeIdxMap=W,g.edgeInfos=[],_==null||_.forEach(function(X){var H=$[X.source],Q=$[X.target];!H||!Q?elf.edgeInfos.push({}):g.edgeInfos.push({edgeStrength:g.edgeStrength(X),linkDistance:E?E(j(j({},X),{source:H,target:Q}),H,Q):g.linkDistance(X,H,Q)||1+(T(H)+T(H)||0)/2})}),this.getCentripetalOptions(),g.onLayoutEnd=g.onLayoutEnd||function(){},g.run()},v.prototype.run=function(){var g=this,d=g.maxIteration,_=g.nodes,E=g.workerEnabled,w=g.minMovement,T=g.animate,k=g.nodeMap;if(!!_){var b=[];_.forEach(function(Q,q){b[2*q]=0,b[2*q+1]=0});var m=d,$=!T;if(E||$){for(var W=0,X=0;(g.judgingDistance>w||X<1)&&X<m;X++)W=X,g.runOneStep(X,b);g.onLayoutEnd(Object.values(k))}else{if(typeof window=="undefined")return;var H=0;this.timeInterval=window.setInterval(function(){!_||(g.runOneStep(H,b),H++,(H>=m||g.judgingDistance<w)&&(g.onLayoutEnd(Object.values(k)),window.clearInterval(g.timeInterval)))},0)}}},v.prototype.runOneStep=function(g,d){var _,E=this,w=E.nodes,T=E.edges,k=E.nodeMap,b=E.monitor,m=[];if(!!(w==null?void 0:w.length)){E.calRepulsive(m),T&&E.calAttractive(m),E.calGravity(m);var $=E.interval;if(E.updateVelocity(m,d,$),E.updatePosition(d,$),(_=E.tick)===null||_===void 0||_.call(E),b){var W=this.calTotalEnergy(m);b({energy:W,nodes:w,edges:T,iterations:g})}}},v.prototype.calTotalEnergy=function(g){var d=this,_=d.nodes,E=d.nodeMap;if(!(_==null?void 0:_.length))return 0;var w=0;return _.forEach(function(T,k){var b=g[2*k],m=g[2*k+1],$=b*b+m*m,W=E[T.id].data.layout.force.mass,X=W===void 0?1:W;w+=X*$*.5}),w},v.prototype.calRepulsive=function(g){var d=this,_=d.nodes,E=d.nodeMap,w=d.factor,T=d.coulombDisScale,k=d.nodeSize;(0,N.forceNBody)(_,E,w,T*T,g)},v.prototype.calAttractive=function(g){var d=this,_=d.edges,E=d.nodeMap,w=d.nodeIdxMap,T=d.edgeInfos,k=d.nodeSize;_.forEach(function(b,m){var $=(0,A.getEdgeTerminal)(b,"source"),W=(0,A.getEdgeTerminal)(b,"target"),X=E[$],H=E[W];if(!(!X||!H)){var Q=H.x-X.x,q=H.y-X.y;!Q&&!q&&(Q=Math.random()*.01,q=Math.random()*.01);var J=Math.sqrt(Q*Q+q*q),te=Q/J,fe=q/J,de=T[m]||{},Te=de.linkDistance,Se=Te===void 0?200:Te,Ie=de.edgeStrength,be=Ie===void 0?200:Ie,pe=Se-J,Me=pe*be,De=X.data.layout.force.mass||1,Ue=H.data.layout.force.mass||1,nt=1/De,Ze=1/Ue,ht=te*Me,Rt=fe*Me,tr=2*w[$],Qe=2*w[W];g[tr]-=ht*nt,g[tr+1]-=Rt*nt,g[Qe]+=ht*Ze,g[Qe+1]+=Rt*Ze}})},v.prototype.calGravity=function(g){var d,_=this,E=_.nodes,w=_.edges,T=w===void 0?[]:w,k=_.nodeMap,b=_.width,m=_.height,$=_.center,W=_.gravity,X=_.degreesMap,H=_.centripetalOptions;if(!!E)for(var Q=E.length,q=0;q<Q;q++){var J=2*q,te=k[E[q].id],fe=te.data.layout.force.mass,de=fe===void 0?1:fe,Te=0,Se=0,Ie=W,be=X[te.id],pe=be.in,Me=be.out,De=be.all,Ue=(d=_.getCenter)===null||d===void 0?void 0:d.call(_,te,De);if(Ue){var nt=Ue[0],Ze=Ue[1],ht=Ue[2];Te=te.x-nt,Se=te.y-Ze,Ie=ht}else Te=te.x-$[0],Se=te.y-$[1];if(Ie&&(g[J]-=Ie*Te/de,g[J+1]-=Ie*Se/de),H){var Rt=H.leaf,tr=H.single,Qe=H.others,lt=H.center,St=(lt==null?void 0:lt(te,E,T,b,m))||{x:0,y:0,centerStrength:0},Ct=St.x,_t=St.y,pt=St.centerStrength;if(!(0,A.isNumber)(Ct)||!(0,A.isNumber)(_t))continue;var rr=(te.x-Ct)/de,xr=(te.y-_t)/de;if(pt&&(g[J]-=pt*rr,g[J+1]-=pt*xr),De===0){var Vt=tr(te);if(!Vt)continue;g[J]-=Vt*rr,g[J+1]-=Vt*xr;continue}if(pe===0||Me===0){var ft=Rt(te,E,T);if(!ft)continue;g[J]-=ft*rr,g[J+1]-=ft*xr;continue}var Bt=Qe(te);if(!Bt)continue;g[J]-=Bt*rr,g[J+1]-=Bt*xr}}},v.prototype.updateVelocity=function(g,d,_){var E=this,w=E.nodes,T=E.damping,k=E.maxSpeed;!(w==null?void 0:w.length)||w.forEach(function(b,m){var $=(d[2*m]+g[2*m]*_)*T||.01,W=(d[2*m+1]+g[2*m+1]*_)*T||.01,X=Math.sqrt($*$+W*W);if(X>k){var H=k/X;$=H*$,W=H*W}d[2*m]=$,d[2*m+1]=W})},v.prototype.updatePosition=function(g,d){var _=this,E=_.nodes,w=_.distanceThresholdMode,T=_.nodeMap;if(!(E==null?void 0:E.length)){this.judgingDistance=0;return}var k=0;w==="max"?_.judgingDistance=-Infinity:w==="min"&&(_.judgingDistance=Infinity),E.forEach(function(b,m){var $=T[b.id];if((0,A.isNumber)(b.fx)&&(0,A.isNumber)(b.fy)){b.x=b.fx,b.y=b.fy,$.x=b.x,$.y=b.y;return}var W=g[2*m]*d,X=g[2*m+1]*d;b.x+=W,b.y+=X,$.x=b.x,$.y=b.y;var H=Math.sqrt(W*W+X*X);switch(w){case"max":_.judgingDistance<H&&(_.judgingDistance=H);break;case"min":_.judgingDistance>H&&(_.judgingDistance=H);break;default:k=k+H;break}}),(!w||w==="mean")&&(_.judgingDistance=k/E.length)},v.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},v.prototype.destroy=function(){var g=this;g.stop(),g.tick=null,g.nodes=null,g.edges=null,g.destroyed=!0},v.prototype.getType=function(){return"force2"},v.prototype.getSameTypeLeafMap=function(){var g=this,d=g.nodeClusterBy,_=g.nodes,E=g.edges,w=g.nodeMap,T=g.degreesMap;if(!!(_==null?void 0:_.length)){var k={};return _.forEach(function(b,m){var $=T[b.id].all;$===1&&(k[b.id]=(0,A.getCoreNodeAndRelativeLeafNodes)("leaf",b,E,d,T,w))}),k}},v}(R.Base);U.Force2Layout=y},20039:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(){function B(j){this.id=j.id||0,this.rx=j.rx,this.ry=j.ry,this.fx=0,this.fy=0,this.mass=j.mass,this.degree=j.degree,this.g=j.g||0}return B.prototype.distanceTo=function(j){var R=this.rx-j.rx,A=this.ry-j.ry;return Math.hypot(R,A)},B.prototype.setPos=function(j,R){this.rx=j,this.ry=R},B.prototype.resetForce=function(){this.fx=0,this.fy=0},B.prototype.addForce=function(j){var R=j.rx-this.rx,A=j.ry-this.ry,N=Math.hypot(R,A);N=N<1e-4?1e-4:N;var L=this.g*(this.degree+1)*(j.degree+1)/N;this.fx+=L*R/N,this.fy+=L*A/N},B.prototype.in=function(j){return j.contains(this.rx,this.ry)},B.prototype.add=function(j){var R=this.mass+j.mass,A=(this.rx*this.mass+j.rx*j.mass)/R,N=(this.ry*this.mass+j.ry*j.mass)/R,L=this.degree+j.degree,y={rx:A,ry:N,mass:R,degree:L};return new B(y)},B}();U.default=z},16919:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var v=function(g,d){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,E){_.__proto__=E}||function(_,E){for(var w in E)Object.prototype.hasOwnProperty.call(E,w)&&(_[w]=E[w])},v(g,d)};return function(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");v(g,d);function _(){this.constructor=g}g.prototype=d===null?Object.create(d):(_.prototype=d.prototype,new _)}}(),j=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(U,"__esModule",{value:!0}),U.ForceAtlas2Layout=void 0;var R=z(46253),A=z(8273),N=j(z(20039)),L=j(z(78150)),y=j(z(58979)),x=function(v){B(g,v);function g(d){var _=v.call(this)||this;return _.center=[0,0],_.width=300,_.height=300,_.nodes=[],_.edges=[],_.kr=5,_.kg=1,_.mode="normal",_.preventOverlap=!1,_.dissuadeHubs=!1,_.barnesHut=void 0,_.maxIteration=0,_.ks=.1,_.ksmax=10,_.tao=.1,_.onLayoutEnd=function(){},_.prune=void 0,_.updateCfg(d),_}return g.prototype.getDefaultCfg=function(){return{}},g.prototype.execute=function(){var d=this,_=d.nodes,E=d.onLayoutEnd,w=d.prune,T=d.maxIteration;!d.width&&typeof window!="undefined"&&(d.width=window.innerWidth),!d.height&&typeof window!="undefined"&&(d.height=window.innerHeight);for(var k=[],b=_.length,m=0;m<b;m+=1){var $=_[m],W=10,X=10;(0,A.isNumber)($.size)&&(W=$.size,X=$.size),(0,A.isArray)($.size)?(isNaN($.size[0])||(W=$.size[0]),isNaN($.size[1])||(X=$.size[1])):(0,A.isObject)($.size)&&(W=$.size.width,X=$.size.height),d.getWidth&&!isNaN(d.getWidth($))&&(X=d.getWidth($)),d.getHeight&&!isNaN(d.getHeight($))&&(W=d.getHeight($));var H=Math.max(W,X);k.push(H)}d.barnesHut===void 0&&b>250&&(d.barnesHut=!0),d.prune===void 0&&b>100&&(d.prune=!0),this.maxIteration===0&&!d.prune?(T=250,b<=200&&b>100?T=1e3:b>200&&(T=1200),this.maxIteration=T):this.maxIteration===0&&w&&(T=100,b<=200&&b>100?T=500:b>200&&(T=950),this.maxIteration=T),d.kr||(d.kr=50,b>100&&b<=500?d.kr=20:b>500&&(d.kr=1)),d.kg||(d.kg=20,b>100&&b<=500?d.kg=10:b>500&&(d.kg=1)),this.nodes=d.updateNodesByForces(k),E()},g.prototype.updateNodesByForces=function(d){for(var _=this,E=_.edges,w=_.maxIteration,T=_.nodes,k=E.filter(function(be){var pe=(0,A.getEdgeTerminal)(be,"source"),Me=(0,A.getEdgeTerminal)(be,"target");return pe!==Me}),b=T.length,m=k.length,$=[],W={},X={},H=[],Q=0;Q<b;Q+=1)W[T[Q].id]=Q,$[Q]=0,(T[Q].x===void 0||isNaN(T[Q].x))&&(T[Q].x=Math.random()*1e3),(T[Q].y===void 0||isNaN(T[Q].y))&&(T[Q].y=Math.random()*1e3),H.push({x:T[Q].x,y:T[Q].y});for(var Q=0;Q<m;Q+=1){for(var q=void 0,J=void 0,te=0,fe=0,de=0;de<b;de+=1){var Te=(0,A.getEdgeTerminal)(k[Q],"source"),Se=(0,A.getEdgeTerminal)(k[Q],"target");T[de].id===Te?(q=T[de],te=de):T[de].id===Se&&(J=T[de],fe=de),X[Q]={sourceIdx:te,targetIdx:fe}}q&&($[W[q.id]]+=1),J&&($[W[J.id]]+=1)}var Ie=w;if(T=this.iterate(Ie,W,X,m,$,d),_.prune){for(var de=0;de<m;de+=1)$[X[de].sourceIdx]<=1?(T[X[de].sourceIdx].x=T[X[de].targetIdx].x,T[X[de].sourceIdx].y=T[X[de].targetIdx].y):$[X[de].targetIdx]<=1&&(T[X[de].targetIdx].x=T[X[de].sourceIdx].x,T[X[de].targetIdx].y=T[X[de].sourceIdx].y);_.prune=!1,_.barnesHut=!1,Ie=100,T=this.iterate(Ie,W,X,m,$,d)}return T},g.prototype.iterate=function(d,_,E,w,T,k){for(var b=this,m=b.nodes,$=b.kr,W=b.preventOverlap,X=b.barnesHut,H=m.length,Q=0,q=100,J=d,te=50,fe=[],de=[],Te=[],Se=0;Se<H;Se+=1)if(fe[2*Se]=0,fe[2*Se+1]=0,X){var Ie={id:Se,rx:m[Se].x,ry:m[Se].y,mass:1,g:$,degree:T[Se]};Te[Se]=new N.default(Ie)}for(;J>0;){for(var Se=0;Se<H;Se+=1)de[2*Se]=fe[2*Se],de[2*Se+1]=fe[2*Se+1],fe[2*Se]=0,fe[2*Se+1]=0;fe=this.getAttrForces(J,te,w,_,E,T,k,fe),X&&(W&&J>te||!W)?fe=this.getOptRepGraForces(fe,Te,T):fe=this.getRepGraForces(J,te,fe,q,k,T);var be=this.updatePos(fe,de,Q,T);m=be.nodes,Q=be.sg,J--,b.tick&&b.tick()}return m},g.prototype.getAttrForces=function(d,_,E,w,T,k,b,m){for(var $=this,W=$.nodes,X=$.preventOverlap,H=$.dissuadeHubs,Q=$.mode,q=$.prune,J=0;J<E;J+=1){var te=W[T[J].sourceIdx],fe=T[J].sourceIdx,de=W[T[J].targetIdx],Te=T[J].targetIdx;if(!(q&&(k[fe]<=1||k[Te]<=1))){var Se=[de.x-te.x,de.y-te.y],Ie=Math.hypot(Se[0],Se[1]);Ie=Ie<1e-4?1e-4:Ie,Se[0]=Se[0]/Ie,Se[1]=Se[1]/Ie,X&&d<_&&(Ie=Ie-b[fe]-b[Te]);var be=Ie,pe=be;Q==="linlog"&&(be=Math.log(1+Ie),pe=be),H&&(be=Ie/k[fe],pe=Ie/k[Te]),X&&d<_&&Ie<=0?(be=0,pe=0):X&&d<_&&Ie>0&&(be=Ie,pe=Ie),m[2*w[te.id]]+=be*Se[0],m[2*w[de.id]]-=pe*Se[0],m[2*w[te.id]+1]+=be*Se[1],m[2*w[de.id]+1]-=pe*Se[1]}}return m},g.prototype.getRepGraForces=function(d,_,E,w,T,k){for(var b=this,m=b.nodes,$=b.preventOverlap,W=b.kr,X=b.kg,H=b.center,Q=b.prune,q=m.length,J=0;J<q;J+=1){for(var te=J+1;te<q;te+=1)if(!(Q&&(k[J]<=1||k[te]<=1))){var fe=[m[te].x-m[J].x,m[te].y-m[J].y],de=Math.hypot(fe[0],fe[1]);de=de<1e-4?1e-4:de,fe[0]=fe[0]/de,fe[1]=fe[1]/de,$&&d<_&&(de=de-T[J]-T[te]);var Te=W*(k[J]+1)*(k[te]+1)/de;$&&d<_&&de<0?Te=w*(k[J]+1)*(k[te]+1):$&&d<_&&de===0?Te=0:$&&d<_&&de>0&&(Te=W*(k[J]+1)*(k[te]+1)/de),E[2*J]-=Te*fe[0],E[2*te]+=Te*fe[0],E[2*J+1]-=Te*fe[1],E[2*te+1]+=Te*fe[1]}var Se=[m[J].x-H[0],m[J].y-H[1]],Ie=Math.hypot(Se[0],Se[1]);Se[0]=Se[0]/Ie,Se[1]=Se[1]/Ie;var be=X*(k[J]+1);E[2*J]-=be*Se[0],E[2*J+1]-=be*Se[1]}return E},g.prototype.getOptRepGraForces=function(d,_,E){for(var w=this,T=w.nodes,k=w.kg,b=w.center,m=w.prune,$=T.length,W=9e10,X=-9e10,H=9e10,Q=-9e10,q=0;q<$;q+=1)m&&E[q]<=1||(_[q].setPos(T[q].x,T[q].y),T[q].x>=X&&(X=T[q].x),T[q].x<=W&&(W=T[q].x),T[q].y>=Q&&(Q=T[q].y),T[q].y<=H&&(H=T[q].y));for(var J=Math.max(X-W,Q-H),te={xmid:(X+W)/2,ymid:(Q+H)/2,length:J,massCenter:b,mass:$},fe=new L.default(te),de=new y.default(fe),q=0;q<$;q+=1)m&&E[q]<=1||_[q].in(fe)&&de.insert(_[q]);for(var q=0;q<$;q+=1)if(!(m&&E[q]<=1)){_[q].resetForce(),de.updateForce(_[q]),d[2*q]-=_[q].fx,d[2*q+1]-=_[q].fy;var Te=[T[q].x-b[0],T[q].y-b[1]],Se=Math.hypot(Te[0],Te[1]);Se=Se<1e-4?1e-4:Se,Te[0]=Te[0]/Se,Te[1]=Te[1]/Se;var Ie=k*(E[q]+1);d[2*q]-=Ie*Te[0],d[2*q+1]-=Ie*Te[1]}return d},g.prototype.updatePos=function(d,_,E,w){for(var T=this,k=T.nodes,b=T.ks,m=T.tao,$=T.prune,W=T.ksmax,X=k.length,H=[],Q=[],q=0,J=0,te=0;te<X;te+=1)if(!($&&w[te]<=1)){var fe=[d[2*te]-_[2*te],d[2*te+1]-_[2*te+1]],de=Math.hypot(fe[0],fe[1]),Te=[d[2*te]+_[2*te],d[2*te+1]+_[2*te+1]],Se=Math.hypot(Te[0],Te[1]);H[te]=de,Q[te]=Se/2,q+=(w[te]+1)*H[te],J+=(w[te]+1)*Q[te]}var Ie=E;E=m*J/q,Ie!==0&&(E=E>1.5*Ie?1.5*Ie:E);for(var te=0;te<X;te+=1)if(!($&&w[te]<=1)&&!((0,A.isNumber)(k[te].fx)&&(0,A.isNumber)(k[te].fy))){var be=b*E/(1+E*Math.sqrt(H[te])),pe=Math.hypot(d[2*te],d[2*te+1]);pe=pe<1e-4?1e-4:pe;var Me=W/pe;be=be>Me?Me:be;var De=be*d[2*te],Ue=be*d[2*te+1];k[te].x+=De,k[te].y+=Ue}return{nodes:k,sg:E}},g}(R.Base);U.ForceAtlas2Layout=x},78150:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(){function B(j){this.xmid=j.xmid,this.ymid=j.ymid,this.length=j.length,this.massCenter=j.massCenter||[0,0],this.mass=j.mass||1}return B.prototype.getLength=function(){return this.length},B.prototype.contains=function(j,R){var A=this.length/2;return j<=this.xmid+A&&j>=this.xmid-A&&R<=this.ymid+A&&R>=this.ymid-A},B.prototype.NW=function(){var j=this.xmid-this.length/4,R=this.ymid+this.length/4,A=this.length/2,N={xmid:j,ymid:R,length:A},L=new B(N);return L},B.prototype.NE=function(){var j=this.xmid+this.length/4,R=this.ymid+this.length/4,A=this.length/2,N={xmid:j,ymid:R,length:A},L=new B(N);return L},B.prototype.SW=function(){var j=this.xmid-this.length/4,R=this.ymid-this.length/4,A=this.length/2,N={xmid:j,ymid:R,length:A},L=new B(N);return L},B.prototype.SE=function(){var j=this.xmid+this.length/4,R=this.ymid-this.length/4,A=this.length/2,N={xmid:j,ymid:R,length:A},L=new B(N);return L},B}();U.default=z},58979:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=function(){function B(j){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,j!=null&&(this.quad=j)}return B.prototype.insert=function(j){if(this.body==null){this.body=j;return}this._isExternal()?(this.quad&&(this.NW=new B(this.quad.NW()),this.NE=new B(this.quad.NE()),this.SW=new B(this.quad.SW()),this.SE=new B(this.quad.SE())),this._putBody(this.body),this._putBody(j),this.body=this.body.add(j)):(this.body=this.body.add(j),this._putBody(j))},B.prototype._putBody=function(j){!this.quad||(j.in(this.quad.NW())&&this.NW?this.NW.insert(j):j.in(this.quad.NE())&&this.NE?this.NE.insert(j):j.in(this.quad.SW())&&this.SW?this.SW.insert(j):j.in(this.quad.SE())&&this.SE&&this.SE.insert(j))},B.prototype._isExternal=function(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null},B.prototype.updateForce=function(j){if(!(this.body==null||j===this.body))if(this._isExternal())j.addForce(this.body);else{var R=this.quad?this.quad.getLength():0,A=this.body.distanceTo(j);R/A<this.theta?j.addForce(this.body):(this.NW&&this.NW.updateForce(j),this.NE&&this.NE.updateForce(j),this.SW&&this.SW.updateForce(j),this.SE&&this.SE.updateForce(j))}},B}();U.default=z},92681:function(or,U,z){"use strict";var B=this&&this.__createBinding||(Object.create?function(y,x,v,g){g===void 0&&(g=v);var d=Object.getOwnPropertyDescriptor(x,v);(!d||("get"in d?!x.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return x[v]}}),Object.defineProperty(y,g,d)}:function(y,x,v,g){g===void 0&&(g=v),y[g]=x[v]}),j=this&&this.__setModuleDefault||(Object.create?function(y,x){Object.defineProperty(y,"default",{enumerable:!0,value:x})}:function(y,x){y.default=x}),R=this&&this.__importStar||function(y){if(y&&y.__esModule)return y;var x={};if(y!=null)for(var v in y)v!=="default"&&Object.prototype.hasOwnProperty.call(y,v)&&B(x,y,v);return j(x,y),x};Object.defineProperty(U,"__esModule",{value:!0});var A=R(z(41685)),N=z(8273);function L(){function y(pt){return function(){return pt}}var x=function(pt){return pt.cluster},v=y(1),g=y(-1),d=y(100),_=y(.1),E=[0,0],w=[],T={},k=[],b=100,m=100,$={none:{x:0,y:0}},W=[],X,H="force",Q=!0,q=.1;function J(pt){if(!Q)return J;X.tick(),Ie();for(var rr=0,xr=w.length,Vt=void 0,ft=pt*q;rr<xr;++rr)Vt=w[rr],Vt.vx+=($[x(Vt)].x-Vt.x)*ft,Vt.vy+=($[x(Vt)].y-Vt.y)*ft}function te(){!w||fe()}function fe(){if(!(!w||!w.length)){if(x(w[0])===void 0)throw Error("Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()");var pt=de();X=A.forceSimulation(pt.nodes).force("x",A.forceX(b).strength(.1)).force("y",A.forceY(m).strength(.1)).force("collide",A.forceCollide(function(rr){return rr.r}).iterations(4)).force("charge",A.forceManyBody().strength(g)).force("links",A.forceLink(pt.nodes.length?pt.links:[]).distance(d).strength(_)),W=X.nodes(),Ie()}}function de(){var pt=[],rr=[],xr={},Vt=[],ft={},Bt=[];return ft=Te(w),Bt=Se(k),Vt=Object.keys(ft),Vt.forEach(function(qt,br){var Ur=ft[qt];pt.push({id:qt,size:Ur.count,r:Math.sqrt(Ur.sumforceNodeSize/Math.PI)}),xr[qt]=br}),Bt.forEach(function(qt){var br=(0,N.getEdgeTerminal)(qt,"source"),Ur=(0,N.getEdgeTerminal)(qt,"target"),Ae=xr[br],Hr=xr[Ur];Ae!==void 0&&Hr!==void 0&&rr.push({source:Ae,target:Hr,count:qt.count})}),{nodes:pt,links:rr}}function Te(pt){var rr={};return pt.forEach(function(xr){var Vt=x(xr);rr[Vt]||(rr[Vt]={count:0,sumforceNodeSize:0})}),pt.forEach(function(xr){var Vt=x(xr),ft=v(xr),Bt=rr[Vt];Bt.count=Bt.count+1,Bt.sumforceNodeSize=Bt.sumforceNodeSize+Math.PI*(ft*ft)*1.3,rr[Vt]=Bt}),rr}function Se(pt){var rr={},xr=[];pt.forEach(function(ft){var Bt=be(ft),qt=0;rr[Bt]!==void 0&&(qt=rr[Bt]),qt+=1,rr[Bt]=qt});var Vt=Object.entries(rr);return Vt.forEach(function(ft){var Bt=ft[0],qt=ft[1],br=Bt.split("~")[0],Ur=Bt.split("~")[1];br!==void 0&&Ur!==void 0&&xr.push({source:br,target:Ur,count:qt})}),xr}function Ie(){return $={none:{x:0,y:0}},W.forEach(function(pt){$[pt.id]={x:pt.x-E[0],y:pt.y-E[1]}}),$}function be(pt){var rr=(0,N.getEdgeTerminal)(pt,"source"),xr=(0,N.getEdgeTerminal)(pt,"target"),Vt=x(T[rr]),ft=x(T[xr]);return Vt<=ft?"".concat(Vt,"~").concat(ft):"".concat(ft,"~").concat(Vt)}function pe(pt){T={},pt.forEach(function(rr){T[rr.id]=rr})}function Me(pt){return arguments.length?(H=pt,te(),J):H}function De(pt){return arguments.length?typeof pt=="string"?(x=function(rr){return rr[pt]},J):(x=pt,J):x}function Ue(pt){return arguments.length?(Q=pt,J):Q}function nt(pt){return arguments.length?(q=pt,J):q}function Ze(pt){return arguments.length?(b=pt,J):b}function ht(pt){return arguments.length?(m=pt,J):m}function Rt(pt){return arguments.length?(pe(pt||[]),w=pt||[],J):w}function tr(pt){return arguments.length?(k=pt||[],te(),J):k}function Qe(pt){return arguments.length?(typeof pt=="function"?v=pt:v=y(+pt),te(),J):v}function lt(pt){return arguments.length?(typeof pt=="function"?g=pt:g=y(+pt),te(),J):g}function St(pt){return arguments.length?(typeof pt=="function"?d=pt:d=y(+pt),te(),J):d}function Ct(pt){return arguments.length?(typeof pt=="function"?_=pt:_=y(+pt),te(),J):_}function _t(pt){return arguments.length?(E=pt,J):E}return J.initialize=function(pt){w=pt,te()},J.template=Me,J.groupBy=De,J.enableGrouping=Ue,J.strength=nt,J.centerX=Ze,J.centerY=ht,J.nodes=Rt,J.links=tr,J.forceNodeSize=Qe,J.nodeSize=J.forceNodeSize,J.forceCharge=lt,J.forceLinkDistance=St,J.forceLinkStrength=Ct,J.offset=_t,J.getFocis=Ie,J}U.default=L},68553:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var w=function(T,k){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,m){b.__proto__=m}||function(b,m){for(var $ in m)Object.prototype.hasOwnProperty.call(m,$)&&(b[$]=m[$])},w(T,k)};return function(T,k){if(typeof k!="function"&&k!==null)throw new TypeError("Class extends value "+String(k)+" is not a constructor or null");w(T,k);function b(){this.constructor=T}T.prototype=k===null?Object.create(k):(b.prototype=k.prototype,new b)}}(),j=this&&this.__createBinding||(Object.create?function(w,T,k,b){b===void 0&&(b=k);var m=Object.getOwnPropertyDescriptor(T,k);(!m||("get"in m?!T.__esModule:m.writable||m.configurable))&&(m={enumerable:!0,get:function(){return T[k]}}),Object.defineProperty(w,b,m)}:function(w,T,k,b){b===void 0&&(b=k),w[b]=T[k]}),R=this&&this.__setModuleDefault||(Object.create?function(w,T){Object.defineProperty(w,"default",{enumerable:!0,value:T})}:function(w,T){w.default=T}),A=this&&this.__importStar||function(w){if(w&&w.__esModule)return w;var T={};if(w!=null)for(var k in w)k!=="default"&&Object.prototype.hasOwnProperty.call(w,k)&&j(T,w,k);return R(T,w),T},N=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(U,"__esModule",{value:!0}),U.ForceLayout=void 0;var L=A(z(41685)),y=N(z(92681)),x=z(8273),v=z(46253),g=z(24979),d=function(w){B(T,w);function T(k){var b=w.call(this)||this;return b.center=[0,0],b.nodeStrength=null,b.edgeStrength=null,b.preventOverlap=!1,b.clusterNodeStrength=null,b.clusterEdgeStrength=null,b.clusterEdgeDistance=null,b.clusterNodeSize=null,b.clusterFociStrength=null,b.linkDistance=50,b.alphaDecay=.028,b.alphaMin=.001,b.alpha=.3,b.collideStrength=1,b.workerEnabled=!1,b.tick=function(){},b.onLayoutEnd=function(){},b.ticking=void 0,k&&b.updateCfg(k),b}return T.prototype.getDefaultCfg=function(){return{center:[0,0],nodeStrength:null,edgeStrength:null,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,linkDistance:50,forceSimulation:null,alphaDecay:.028,alphaMin:.001,alpha:.3,collideStrength:1,clustering:!1,clusterNodeStrength:-1,clusterEdgeStrength:.1,clusterEdgeDistance:100,clusterFociStrength:.8,clusterNodeSize:10,tick:function(){},onLayoutEnd:function(){},workerEnabled:!1}},T.prototype.init=function(k){var b=this;b.nodes=k.nodes||[];var m=k.edges||[];b.edges=m.map(function($){var W={},X=["targetNode","sourceNode","startPoint","endPoint"];return Object.keys($).forEach(function(H){X.indexOf(H)>-1||(W[H]=$[H])}),W}),b.ticking=!1},T.prototype.execute=function(k){var b=this,m=b.nodes,$=b.edges;if(!b.ticking){var W=b.forceSimulation,X=b.alphaMin,H=b.alphaDecay,Q=b.alpha;if(W){if(k){if(b.clustering&&b.clusterForce&&(b.clusterForce.nodes(m),b.clusterForce.links($)),W.nodes(m),$&&b.edgeForce)b.edgeForce.links($);else if($&&!b.edgeForce){var te=L.forceLink().id(function(Se){return Se.id}).links($);b.edgeStrength&&te.strength(b.edgeStrength),b.linkDistance&&te.distance(b.linkDistance),b.edgeForce=te,W.force("link",te)}}b.preventOverlap&&b.overlapProcess(W),W.alpha(Q).restart(),this.ticking=!0}else try{var q=L.forceManyBody();if(b.nodeStrength&&q.strength(b.nodeStrength),W=L.forceSimulation().nodes(m),b.clustering){var J=(0,y.default)();J.centerX(b.center[0]).centerY(b.center[1]).template("force").strength(b.clusterFociStrength),$&&J.links($),m&&J.nodes(m),J.forceLinkDistance(b.clusterEdgeDistance).forceLinkStrength(b.clusterEdgeStrength).forceCharge(b.clusterNodeStrength).forceNodeSize(b.clusterNodeSize),b.clusterForce=J,W.force("group",J)}if(W.force("center",L.forceCenter(b.center[0],b.center[1])).force("charge",q).alpha(Q).alphaDecay(H).alphaMin(X),b.preventOverlap&&b.overlapProcess(W),$){var te=L.forceLink().id(function(Te){return Te.id}).links($);b.edgeStrength&&te.strength(b.edgeStrength),b.linkDistance&&te.distance(b.linkDistance),b.edgeForce=te,W.force("link",te)}if(b.workerEnabled&&!E()&&(b.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),!b.workerEnabled)W.on("tick",function(){b.tick()}).on("end",function(){b.ticking=!1,b.onLayoutEnd&&b.onLayoutEnd()}),b.ticking=!0;else{W.stop();for(var fe=_(W),de=1;de<=fe;de++)W.tick(),postMessage({nodes:m,currentTick:de,totalTicks:fe,type:g.LAYOUT_MESSAGE.TICK},void 0);b.ticking=!1}b.forceSimulation=W,b.ticking=!0}catch(Te){b.ticking=!1,console.warn(Te)}}},T.prototype.overlapProcess=function(k){var b=this,m=b.nodeSize,$=b.nodeSpacing,W,X,H=b.collideStrength;if((0,x.isNumber)($)?X=function(){return $}:(0,x.isFunction)($)?X=$:X=function(){return 0},!m)W=function(te){if(te.size){if((0,x.isArray)(te.size)){var fe=te.size[0]>te.size[1]?te.size[0]:te.size[1];return fe/2+X(te)}if((0,x.isObject)(te.size)){var fe=te.size.width>te.size.height?te.size.width:te.size.height;return fe/2+X(te)}return te.size/2+X(te)}return 10+X(te)};else if((0,x.isFunction)(m))W=function(te){var fe=m(te);return fe+X(te)};else if((0,x.isArray)(m)){var Q=m[0]>m[1]?m[0]:m[1],q=Q/2;W=function(te){return q+X(te)}}else if((0,x.isNumber)(m)){var J=m/2;W=function(te){return J+X(te)}}else W=function(){return 10};k.force("collisionForce",L.forceCollide(W).strength(H))},T.prototype.updateCfg=function(k){var b=this;b.ticking&&(b.forceSimulation.stop(),b.ticking=!1),b.forceSimulation=null,Object.assign(b,k)},T.prototype.destroy=function(){var k=this;k.ticking&&(k.forceSimulation.stop(),k.ticking=!1),k.nodes=null,k.edges=null,k.destroyed=!0},T}(v.Base);U.ForceLayout=d;function _(w){var T=w.alphaMin(),k=w.alphaTarget(),b=w.alpha(),m=Math.log((T-k)/(b-k))/Math.log(1-w.alphaDecay()),$=Math.ceil(m);return $}function E(){return typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope}},64180:function(or,U,z){"use strict";var B=this&&this.__createBinding||(Object.create?function(R,A,N,L){L===void 0&&(L=N);var y=Object.getOwnPropertyDescriptor(A,N);(!y||("get"in y?!A.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return A[N]}}),Object.defineProperty(R,L,y)}:function(R,A,N,L){L===void 0&&(L=N),R[L]=A[N]}),j=this&&this.__exportStar||function(R,A){for(var N in R)N!=="default"&&!Object.prototype.hasOwnProperty.call(A,N)&&B(A,R,N)};Object.defineProperty(U,"__esModule",{value:!0}),j(z(68553),U)},23826:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var L=function(y,x){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(v[d]=g[d])},L(y,x)};return function(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");L(y,x);function v(){this.constructor=y}y.prototype=x===null?Object.create(x):(v.prototype=x.prototype,new v)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.FruchtermanLayout=void 0;var j=z(46253),R=z(8273),A=800,N=function(L){B(y,L);function y(x){var v=L.call(this)||this;return v.maxIteration=1e3,v.workerEnabled=!1,v.gravity=10,v.speed=5,v.clustering=!1,v.clusterGravity=10,v.nodes=[],v.edges=[],v.width=300,v.height=300,v.nodeMap={},v.nodeIdxMap={},v.onLayoutEnd=function(){},v.tick=function(){},v.animate=!0,v.updateCfg(x),v}return y.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10,animate:!0}},y.prototype.execute=function(){var x=this,v,g,d=this,_=d.nodes;if(d.timeInterval!==void 0&&typeof window!="undefined"&&window.clearInterval(d.timeInterval),!_||_.length===0){(v=d.onLayoutEnd)===null||v===void 0||v.call(d);return}!d.width&&typeof window!="undefined"&&(d.width=window.innerWidth),!d.height&&typeof window!="undefined"&&(d.height=window.innerHeight),d.center||(d.center=[d.width/2,d.height/2]);var E=d.center;if(_.length===1){_[0].x=E[0],_[0].y=E[1],(g=d.onLayoutEnd)===null||g===void 0||g.call(d);return}var w={},T={};return _.forEach(function(k,b){(0,R.isNumber)(k.x)||(k.x=Math.random()*x.width),(0,R.isNumber)(k.y)||(k.y=Math.random()*x.height),w[k.id]=k,T[k.id]=b}),d.nodeMap=w,d.nodeIdxMap=T,d.run()},y.prototype.run=function(){var x,v=this,g=v.nodes;if(!!g){var d=v.edges,_=v.maxIteration,E=v.workerEnabled,w=v.clustering,T=v.animate,k={};if(w&&g.forEach(function($){k[$.cluster]===void 0&&(k[$.cluster]={name:$.cluster,cx:0,cy:0,count:0})}),E||!T){for(var b=0;b<_;b++)v.runOneStep(k);(x=v.onLayoutEnd)===null||x===void 0||x.call(v)}else{if(typeof window=="undefined")return;var m=0;this.timeInterval=window.setInterval(function(){var $;v.runOneStep(k),m++,m>=_&&(($=v.onLayoutEnd)===null||$===void 0||$.call(v),window.clearInterval(v.timeInterval))},0)}return{nodes:g,edges:d}}},y.prototype.runOneStep=function(x){var v,g=this,d=g.nodes;if(!!d){var _=g.edges,E=g.center,w=g.gravity,T=g.speed,k=g.clustering,b=g.height*g.width,m=Math.sqrt(b)/10,$=b/(d.length+1),W=Math.sqrt($),X=[];if(d.forEach(function(q,J){X[J]={x:0,y:0}}),g.applyCalculate(d,_,X,W,$),k){for(var H in x)x[H].cx=0,x[H].cy=0,x[H].count=0;d.forEach(function(q){var J=x[q.cluster];(0,R.isNumber)(q.x)&&(J.cx+=q.x),(0,R.isNumber)(q.y)&&(J.cy+=q.y),J.count++});for(var H in x)x[H].cx/=x[H].count,x[H].cy/=x[H].count;var Q=g.clusterGravity||w;d.forEach(function(q,J){if(!(!(0,R.isNumber)(q.x)||!(0,R.isNumber)(q.y))){var te=x[q.cluster],fe=Math.sqrt((q.x-te.cx)*(q.x-te.cx)+(q.y-te.cy)*(q.y-te.cy)),de=W*Q;X[J].x-=de*(q.x-te.cx)/fe,X[J].y-=de*(q.y-te.cy)/fe}})}d.forEach(function(q,J){if(!(!(0,R.isNumber)(q.x)||!(0,R.isNumber)(q.y))){var te=.01*W*w;X[J].x-=te*(q.x-E[0]),X[J].y-=te*(q.y-E[1])}}),d.forEach(function(q,J){if((0,R.isNumber)(q.fx)&&(0,R.isNumber)(q.fy)){q.x=q.fx,q.y=q.fy;return}if(!(!(0,R.isNumber)(q.x)||!(0,R.isNumber)(q.y))){var te=Math.sqrt(X[J].x*X[J].x+X[J].y*X[J].y);if(te>0){var fe=Math.min(m*(T/A),te);q.x+=X[J].x/te*fe,q.y+=X[J].y/te*fe}}}),(v=g.tick)===null||v===void 0||v.call(g)}},y.prototype.applyCalculate=function(x,v,g,d,_){var E=this;E.calRepulsive(x,g,_),v&&E.calAttractive(v,g,d)},y.prototype.calRepulsive=function(x,v,g){x.forEach(function(d,_){v[_]={x:0,y:0},x.forEach(function(E,w){if(_!==w&&!(!(0,R.isNumber)(d.x)||!(0,R.isNumber)(E.x)||!(0,R.isNumber)(d.y)||!(0,R.isNumber)(E.y))){var T=d.x-E.x,k=d.y-E.y,b=T*T+k*k;if(b===0){b=1;var m=_>w?1:-1;T=.01*m,k=.01*m}var $=g/b;v[_].x+=T*$,v[_].y+=k*$}})})},y.prototype.calAttractive=function(x,v,g){var d=this;x.forEach(function(_){var E=(0,R.getEdgeTerminal)(_,"source"),w=(0,R.getEdgeTerminal)(_,"target");if(!(!E||!w)){var T=d.nodeIdxMap[E],k=d.nodeIdxMap[w];if(T!==k){var b=d.nodeMap[E],m=d.nodeMap[w];if(!(!(0,R.isNumber)(m.x)||!(0,R.isNumber)(b.x)||!(0,R.isNumber)(m.y)||!(0,R.isNumber)(b.y))){var $=m.x-b.x,W=m.y-b.y,X=Math.sqrt($*$+W*W),H=X*X/g;v[k].x-=$/X*H,v[k].y-=W/X*H,v[T].x+=$/X*H,v[T].y+=W/X*H}}}})},y.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},y.prototype.destroy=function(){var x=this;x.stop(),x.tick=null,x.nodes=null,x.edges=null,x.destroyed=!0},y.prototype.getType=function(){return"fruchterman"},y}(j.Base);U.FruchtermanLayout=N},46260:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var L=function(y,x){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(v[d]=g[d])},L(y,x)};return function(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");L(y,x);function v(){this.constructor=y}y.prototype=x===null?Object.create(x):(v.prototype=x.prototype,new v)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.GForceLayout=void 0;var j=z(46253),R=z(8273),A=function(L,y){var x;return L?(0,R.isNumber)(L)?x=function(v){return L}:x=L:x=function(v){return y||1},x},N=function(L){B(y,L);function y(x){var v=L.call(this)||this;return v.maxIteration=500,v.workerEnabled=!1,v.edgeStrength=200,v.nodeStrength=1e3,v.coulombDisScale=.005,v.damping=.9,v.maxSpeed=1e3,v.minMovement=.5,v.interval=.02,v.factor=1,v.linkDistance=1,v.gravity=10,v.preventOverlap=!0,v.collideStrength=1,v.tick=function(){},v.nodes=[],v.edges=[],v.width=300,v.height=300,v.nodeMap={},v.nodeIdxMap={},v.animate=!0,v.updateCfg(x),v}return y.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},y.prototype.execute=function(){var x,v,g=this,d=g.nodes;if(g.timeInterval!==void 0&&typeof window!="undefined"&&window.clearInterval(g.timeInterval),!d||d.length===0){(x=g.onLayoutEnd)===null||x===void 0||x.call(g);return}!g.width&&typeof window!="undefined"&&(g.width=window.innerWidth),!g.height&&typeof window!="undefined"&&(g.height=window.innerHeight),g.center||(g.center=[g.width/2,g.height/2]);var _=g.center;if(d.length===1){d[0].x=_[0],d[0].y=_[1],(v=g.onLayoutEnd)===null||v===void 0||v.call(g);return}var E={},w={};d.forEach(function(W,X){(0,R.isNumber)(W.x)||(W.x=Math.random()*g.width),(0,R.isNumber)(W.y)||(W.y=Math.random()*g.height),E[W.id]=W,w[W.id]=X}),g.nodeMap=E,g.nodeIdxMap=w,g.linkDistance=A(g.linkDistance,1),g.nodeStrength=A(g.nodeStrength,1),g.edgeStrength=A(g.edgeStrength,1);var T=g.nodeSize,k;if(g.preventOverlap){var b=g.nodeSpacing,m;(0,R.isNumber)(b)?m=function(){return b}:(0,R.isFunction)(b)?m=b:m=function(){return 0},T?(0,R.isArray)(T)?k=function(W){return Math.max(T[0],T[1])+m(W)}:k=function(W){return T+m(W)}:k=function(W){return W.size?(0,R.isArray)(W.size)?Math.max(W.size[0],W.size[1])+m(W):(0,R.isObject)(W.size)?Math.max(W.size.width,W.size.height)+m(W):W.size+m(W):10+m(W)}}g.nodeSize=k;var $=g.edges;g.degrees=(0,R.getDegree)(d.length,g.nodeIdxMap,$),g.getMass||(g.getMass=function(W){var X=W.mass||g.degrees[g.nodeIdxMap[W.id]].all||1;return X}),g.run()},y.prototype.run=function(){var x,v=this,g=v.maxIteration,d=v.nodes,_=v.workerEnabled,E=v.minMovement,w=v.animate;if(!!d)if(_||!w){for(var T=0;T<g;T++){var k=v.runOneStep(T);if(v.reachMoveThreshold(d,k,E))break}(x=v.onLayoutEnd)===null||x===void 0||x.call(v)}else{if(typeof window=="undefined")return;var b=0;this.timeInterval=window.setInterval(function(){var m,$;if(!!d){var W=v.runOneStep(b)||[];v.reachMoveThreshold(d,W,E)&&((m=v.onLayoutEnd)===null||m===void 0||m.call(v),window.clearInterval(v.timeInterval)),b++,b>=g&&(($=v.onLayoutEnd)===null||$===void 0||$.call(v),window.clearInterval(v.timeInterval))}},0)}},y.prototype.reachMoveThreshold=function(x,v,g){var d=0;return x.forEach(function(_,E){var w=_.x-v[E].x,T=_.y-v[E].y;d+=Math.sqrt(w*w+T*T)}),d/=x.length,d<g},y.prototype.runOneStep=function(x){var v,g=this,d=g.nodes,_=g.edges,E=[],w=[];if(!!d){d.forEach(function(b,m){E[2*m]=0,E[2*m+1]=0,w[2*m]=0,w[2*m+1]=0}),g.calRepulsive(E,d),_&&g.calAttractive(E,_),g.calGravity(E,d);var T=Math.max(.02,g.interval-x*.002);g.updateVelocity(E,w,T,d);var k=[];return d.forEach(function(b){k.push({x:b.x,y:b.y})}),g.updatePosition(w,T,d),(v=g.tick)===null||v===void 0||v.call(g),k}},y.prototype.calRepulsive=function(x,v){var g=this,d=g.getMass,_=g.factor,E=g.coulombDisScale,w=g.preventOverlap,T=g.collideStrength,k=T===void 0?1:T,b=g.nodeStrength,m=g.nodeSize;v.forEach(function($,W){var X=d?d($):1;v.forEach(function(H,Q){if(!(W>=Q)){var q=$.x-H.x,J=$.y-H.y;q===0&&J===0&&(q=Math.random()*.01,J=Math.random()*.01);var te=q*q+J*J,fe=Math.sqrt(te),de=(fe+.1)*E,Te=q/fe,Se=J/fe,Ie=(b($)+b(H))*.5*_/(de*de),be=d?d(H):1;if(x[2*W]+=Te*Ie,x[2*W+1]+=Se*Ie,x[2*Q]-=Te*Ie,x[2*Q+1]-=Se*Ie,w&&(m($)+m(H))/2>fe){var pe=k*(b($)+b(H))*.5/te;x[2*W]+=Te*pe/X,x[2*W+1]+=Se*pe/X,x[2*Q]-=Te*pe/be,x[2*Q+1]-=Se*pe/be}}})})},y.prototype.calAttractive=function(x,v){var g=this,d=g.nodeMap,_=g.nodeIdxMap,E=g.linkDistance,w=g.edgeStrength,T=g.nodeSize,k=g.getMass;v.forEach(function(b,m){var $=(0,R.getEdgeTerminal)(b,"source"),W=(0,R.getEdgeTerminal)(b,"target"),X=d[$],H=d[W],Q=H.x-X.x,q=H.y-X.y;Q===0&&q===0&&(Q=Math.random()*.01,q=Math.random()*.01);var J=Math.sqrt(Q*Q+q*q),te=Q/J,fe=q/J,de=E(b,X,H)||1+(T(X)+T(H)||0)/2,Te=de-J,Se=Te*w(b),Ie=_[$],be=_[W],pe=k?k(X):1,Me=k?k(H):1;x[2*Ie]-=te*Se/pe,x[2*Ie+1]-=fe*Se/pe,x[2*be]+=te*Se/Me,x[2*be+1]+=fe*Se/Me})},y.prototype.calGravity=function(x,v){for(var g=this,d=g.center,_=g.gravity,E=g.degrees,w=v.length,T=0;T<w;T++){var k=v[T],b=k.x-d[0],m=k.y-d[1],$=_;if(g.getCenter){var W=g.getCenter(k,E[T].all);W&&(0,R.isNumber)(W[0])&&(0,R.isNumber)(W[1])&&(0,R.isNumber)(W[2])&&(b=k.x-W[0],m=k.y-W[1],$=W[2])}!$||(x[2*T]-=$*b,x[2*T+1]-=$*m)}},y.prototype.updateVelocity=function(x,v,g,d){var _=this,E=g*_.damping;d.forEach(function(w,T){var k=x[2*T]*E||.01,b=x[2*T+1]*E||.01,m=Math.sqrt(k*k+b*b);if(m>_.maxSpeed){var $=_.maxSpeed/m;k=$*k,b=$*b}v[2*T]=k,v[2*T+1]=b})},y.prototype.updatePosition=function(x,v,g){g.forEach(function(d,_){if((0,R.isNumber)(d.fx)&&(0,R.isNumber)(d.fy)){d.x=d.fx,d.y=d.fy;return}var E=x[2*_]*v,w=x[2*_+1]*v;d.x+=E,d.y+=w})},y.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},y.prototype.destroy=function(){var x=this;x.stop(),x.tick=null,x.nodes=null,x.edges=null,x.destroyed=!0},y.prototype.getType=function(){return"gForce"},y}(j.Base);U.GForceLayout=N},81822:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var d=function(_,E){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,T){w.__proto__=T}||function(w,T){for(var k in T)Object.prototype.hasOwnProperty.call(T,k)&&(w[k]=T[k])},d(_,E)};return function(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");d(_,E);function w(){this.constructor=_}_.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}(),j=this&&this.__awaiter||function(d,_,E,w){function T(k){return k instanceof E?k:new E(function(b){b(k)})}return new(E||(E=Promise))(function(k,b){function m(X){try{W(w.next(X))}catch(H){b(H)}}function $(X){try{W(w.throw(X))}catch(H){b(H)}}function W(X){X.done?k(X.value):T(X.value).then(m,$)}W((w=w.apply(d,_||[])).next())})},R=this&&this.__generator||function(d,_){var E={label:0,sent:function(){if(k[0]&1)throw k[1];return k[1]},trys:[],ops:[]},w,T,k,b;return b={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function m(W){return function(X){return $([W,X])}}function $(W){if(w)throw new TypeError("Generator is already executing.");for(;b&&(b=0,W[0]&&(E=0)),E;)try{if(w=1,T&&(k=W[0]&2?T.return:W[0]?T.throw||((k=T.return)&&k.call(T),0):T.next)&&!(k=k.call(T,W[1])).done)return k;switch(T=0,k&&(W=[W[0]&2,k.value]),W[0]){case 0:case 1:k=W;break;case 4:return E.label++,{value:W[1],done:!1};case 5:E.label++,T=W[1],W=[0];continue;case 7:W=E.ops.pop(),E.trys.pop();continue;default:if(k=E.trys,!(k=k.length>0&&k[k.length-1])&&(W[0]===6||W[0]===2)){E=0;continue}if(W[0]===3&&(!k||W[1]>k[0]&&W[1]<k[3])){E.label=W[1];break}if(W[0]===6&&E.label<k[1]){E.label=k[1],k=W;break}if(k&&E.label<k[2]){E.label=k[2],E.ops.push(W);break}k[2]&&E.ops.pop(),E.trys.pop();continue}W=_.call(d,E)}catch(X){W=[6,X],T=0}finally{w=k=0}if(W[0]&5)throw W[1];return{value:W[0]?W[1]:void 0,done:!0}}};Object.defineProperty(U,"__esModule",{value:!0}),U.FruchtermanGPULayout=void 0;var A=z(46253),N=z(8273),L=z(70390),y=z(38342),x=z(41713),v=z(24979),g=function(d){B(_,d);function _(E){var w=d.call(this)||this;return w.maxIteration=1e3,w.gravity=10,w.speed=1,w.clustering=!1,w.clusterField="cluster",w.clusterGravity=10,w.workerEnabled=!1,w.nodes=[],w.edges=[],w.width=300,w.height=300,w.nodeMap={},w.nodeIdxMap={},w.updateCfg(E),w}return _.prototype.getDefaultCfg=function(){return{maxIteration:1e3,gravity:10,speed:1,clustering:!1,clusterGravity:10}},_.prototype.execute=function(){return j(this,void 0,void 0,function(){var E,w,T,k,b,m=this;return R(this,function($){switch($.label){case 0:return E=this,w=E.nodes,!w||w.length===0?(E.onLayoutEnd&&E.onLayoutEnd(),[2]):(!E.width&&typeof window!="undefined"&&(E.width=window.innerWidth),!E.height&&typeof window!="undefined"&&(E.height=window.innerHeight),E.center||(E.center=[E.width/2,E.height/2]),T=E.center,w.length===1?(w[0].x=T[0],w[0].y=T[1],E.onLayoutEnd&&E.onLayoutEnd(),[2]):(k={},b={},w.forEach(function(W,X){(0,N.isNumber)(W.x)||(W.x=Math.random()*m.width),(0,N.isNumber)(W.y)||(W.y=Math.random()*m.height),k[W.id]=W,b[W.id]=X}),E.nodeMap=k,E.nodeIdxMap=b,[4,E.run()]));case 1:return $.sent(),[2]}})})},_.prototype.executeWithWorker=function(E,w){return j(this,void 0,void 0,function(){var T,k,b,m,$,W=this;return R(this,function(X){switch(X.label){case 0:return T=this,k=T.nodes,b=T.center,!k||k.length===0?[2]:k.length===1?(k[0].x=b[0],k[0].y=b[1],[2]):(m={},$={},k.forEach(function(H,Q){(0,N.isNumber)(H.x)||(H.x=Math.random()*W.width),(0,N.isNumber)(H.y)||(H.y=Math.random()*W.height),m[H.id]=H,$[H.id]=Q}),T.nodeMap=m,T.nodeIdxMap=$,[4,T.run(E,w)]);case 1:return X.sent(),[2]}})})},_.prototype.run=function(E,w){return j(this,void 0,void 0,function(){var T,k,b,m,$,W,X,H,Q,q,J,te,fe,de,Te,Se,Ie,be,pe,Me,De,Ue,nt,Ze,ht,Rt,tr=this;return R(this,function(Qe){switch(Qe.label){case 0:for(T=this,k=T.nodes,b=T.edges,m=T.maxIteration,$=T.center,W=T.height*T.width,X=Math.sqrt(W)/10,H=W/(k.length+1),Q=Math.sqrt(H),q=T.speed,J=T.clustering,te=(0,y.attributesToTextureData)([T.clusterField],k),fe=te.array,de=te.count,k.forEach(function(lt,St){var Ct=0,_t=0;(0,N.isNumber)(lt.fx)&&(0,N.isNumber)(lt.fy)&&(Ct=lt.fx||.001,_t=lt.fy||.001),fe[4*St+1]=Ct,fe[4*St+2]=_t}),Te=k.length,Se=(0,y.buildTextureData)(k,b),Ie=Se.maxEdgePerVetex,be=Se.array,pe=T.workerEnabled,pe?Me=L.World.create({canvas:E,engineOptions:{supportCompute:!0}}):Me=L.World.create({engineOptions:{supportCompute:!0}}),De=T.onLayoutEnd,Ue=[],nt=0;nt<de;nt++)Ue.push(0,0,0,0);return Ze=Me.createKernel(x.fruchtermanBundle).setDispatch([Te,1,1]).setBinding({u_Data:be,u_K:Q,u_K2:H,u_Gravity:T.gravity,u_ClusterGravity:T.clusterGravity||T.gravity||1,u_Speed:q,u_MaxDisplace:X,u_Clustering:J?1:0,u_Center:$,u_AttributeArray:fe,u_ClusterCenters:Ue,MAX_EDGE_PER_VERTEX:Ie,VERTEX_COUNT:Te}),J&&(ht=Me.createKernel(x.clusterBundle).setDispatch([de,1,1]).setBinding({u_Data:be,u_NodeAttributes:fe,u_ClusterCenters:Ue,VERTEX_COUNT:Te,CLUSTER_COUNT:de})),Rt=function(){return j(tr,void 0,void 0,function(){var lt,St;return R(this,function(Ct){switch(Ct.label){case 0:lt=0,Ct.label=1;case 1:return lt<m?[4,Ze.execute()]:[3,6];case 2:return Ct.sent(),J?(ht.setBinding({u_Data:Ze}),[4,ht.execute()]):[3,4];case 3:Ct.sent(),Ze.setBinding({u_ClusterCenters:ht}),Ct.label=4;case 4:Ze.setBinding({u_MaxDisplace:X*=.99}),Ct.label=5;case 5:return lt++,[3,1];case 6:return[4,Ze.getOutput()];case 7:return St=Ct.sent(),E?w.postMessage({type:v.LAYOUT_MESSAGE.GPUEND,vertexEdgeData:St}):k.forEach(function(_t,pt){var rr=St[4*pt],xr=St[4*pt+1];_t.x=rr,_t.y=xr}),De&&De(),[2]}})})},[4,Rt()];case 1:return Qe.sent(),[2]}})})},_.prototype.getType=function(){return"fruchterman-gpu"},_}(A.Base);U.FruchtermanGPULayout=g},41713:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.clusterBundle=U.clusterCode=U.fruchtermanBundle=U.fruchtermanCode=void 0,U.fruchtermanCode=`
  246. import { globalInvocationID } from 'g-webgpu';
  247. const MAX_EDGE_PER_VERTEX;
  248. const VERTEX_COUNT;
  249. @numthreads(1, 1, 1)
  250. class Fruchterman {
  251. @in @out
  252. u_Data: vec4[];
  253. @in
  254. u_K: float;
  255. @in
  256. u_K2: float;
  257. @in
  258. u_Center: vec2;
  259. @in
  260. u_Gravity: float;
  261. @in
  262. u_ClusterGravity: float;
  263. @in
  264. u_Speed: float;
  265. @in
  266. u_MaxDisplace: float;
  267. @in
  268. u_Clustering: float;
  269. @in
  270. u_AttributeArray: vec4[];
  271. @in
  272. u_ClusterCenters: vec4[];
  273. calcRepulsive(i: int, currentNode: vec4): vec2 {
  274. let dx = 0, dy = 0;
  275. for (let j = 0; j < VERTEX_COUNT; j++) {
  276. if (i != j) {
  277. const nextNode = this.u_Data[j];
  278. const xDist = currentNode[0] - nextNode[0];
  279. const yDist = currentNode[1] - nextNode[1];
  280. const dist = (xDist * xDist + yDist * yDist) + 0.01;
  281. let param = this.u_K2 / dist;
  282. if (dist > 0.0) {
  283. dx += param * xDist;
  284. dy += param * yDist;
  285. if (xDist == 0 && yDist == 0) {
  286. const sign = i < j ? 1 : -1;
  287. dx += param * sign;
  288. dy += param * sign;
  289. }
  290. }
  291. }
  292. }
  293. return [dx, dy];
  294. }
  295. calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { //
  296. let dx = 0, dy = 0;
  297. const vx = currentNode[0] - this.u_Center[0];
  298. const vy = currentNode[1] - this.u_Center[1];
  299. const gf = 0.01 * this.u_K * this.u_Gravity;
  300. dx = gf * vx;
  301. dy = gf * vy;
  302. if (this.u_Clustering == 1) {
  303. const clusterIdx = int(nodeAttributes[0]);
  304. const center = this.u_ClusterCenters[clusterIdx];
  305. const cvx = currentNode[0] - center[0];
  306. const cvy = currentNode[1] - center[1];
  307. const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01;
  308. const parma = this.u_K * this.u_ClusterGravity / dist;
  309. dx += parma * cvx;
  310. dy += parma * cvy;
  311. }
  312. return [dx, dy];
  313. }
  314. calcAttractive(i: int, currentNode: vec4): vec2 {
  315. let dx = 0, dy = 0;
  316. const arr_offset = int(floor(currentNode[2] + 0.5));
  317. const length = int(floor(currentNode[3] + 0.5));
  318. const node_buffer: vec4;
  319. for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) {
  320. if (p >= length) break;
  321. const arr_idx = arr_offset + p;
  322. // when arr_idx % 4 == 0 update currentNodedx_buffer
  323. const buf_offset = arr_idx - arr_idx / 4 * 4;
  324. if (p == 0 || buf_offset == 0) {
  325. node_buffer = this.u_Data[int(arr_idx / 4)];
  326. }
  327. const float_j = buf_offset == 0 ? node_buffer[0] :
  328. buf_offset == 1 ? node_buffer[1] :
  329. buf_offset == 2 ? node_buffer[2] :
  330. node_buffer[3];
  331. const nextNode = this.u_Data[int(float_j)];
  332. const xDist = currentNode[0] - nextNode[0];
  333. const yDist = currentNode[1] - nextNode[1];
  334. const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01;
  335. let attractiveF = dist / this.u_K;
  336. if (dist > 0.0) {
  337. dx -= xDist * attractiveF;
  338. dy -= yDist * attractiveF;
  339. if (xDist == 0 && yDist == 0) {
  340. const sign = i < int(float_j) ? 1 : -1;
  341. dx -= sign * attractiveF;
  342. dy -= sign * attractiveF;
  343. }
  344. }
  345. }
  346. return [dx, dy];
  347. }
  348. @main
  349. compute() {
  350. const i = globalInvocationID.x;
  351. const currentNode = this.u_Data[i];
  352. let dx = 0, dy = 0;
  353. if (i >= VERTEX_COUNT) {
  354. this.u_Data[i] = currentNode;
  355. return;
  356. }
  357. // [gravity, fx, fy, 0]
  358. const nodeAttributes = this.u_AttributeArray[i];
  359. if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) {
  360. // the node is fixed
  361. this.u_Data[i] = [
  362. nodeAttributes[1],
  363. nodeAttributes[2],
  364. currentNode[2],
  365. currentNode[3]
  366. ];
  367. return;
  368. }
  369. // repulsive
  370. const repulsive = this.calcRepulsive(i, currentNode);
  371. dx += repulsive[0];
  372. dy += repulsive[1];
  373. // attractive
  374. const attractive = this.calcAttractive(i, currentNode);
  375. dx += attractive[0];
  376. dy += attractive[1];
  377. // gravity
  378. const gravity = this.calcGravity(currentNode, nodeAttributes);
  379. dx -= gravity[0];
  380. dy -= gravity[1];
  381. // speed
  382. dx *= this.u_Speed;
  383. dy *= this.u_Speed;
  384. // move
  385. const distLength = sqrt(dx * dx + dy * dy);
  386. if (distLength > 0.0) {
  387. const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength);
  388. this.u_Data[i] = [
  389. currentNode[0] + dx / distLength * limitedDist,
  390. currentNode[1] + dy / distLength * limitedDist,
  391. currentNode[2],
  392. currentNode[3]
  393. ];
  394. }
  395. }
  396. }
  397. `,U.fruchtermanBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_K;\\nuniform float u_K2;\\nuniform vec2 u_Center;\\nuniform float u_Gravity;\\nuniform float u_ClusterGravity;\\nuniform float u_Speed;\\nuniform float u_MaxDisplace;\\nuniform float u_Clustering;\\nuniform sampler2D u_AttributeArray;\\nuniform vec2 u_AttributeArraySize;\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\n}\\nvec4 getDatau_AttributeArray(float address1D) {\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\n}\\nvec4 getDatau_AttributeArray(int address1D) {\\n return getDatau_AttributeArray(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat param = u_K2 / dist;\\nif (dist > 0.0) {dx += param * xDist;\\ndy += param * yDist;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\ndx += param * sign;\\ndy += param * sign;}}}}\\nreturn vec2(dx, dy);}\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nfloat vx = currentNode.x - u_Center.x;\\nfloat vy = currentNode.y - u_Center.y;\\nfloat gf = (0.01 * u_K) * u_Gravity;\\ndx = gf * vx;\\ndy = gf * vy;\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\nfloat cvx = currentNode.x - center.x;\\nfloat cvy = currentNode.y - center.y;\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\ndx += parma * cvx;\\ndy += parma * cvy;}\\nreturn vec2(dx, dy);}\\nvec2 calcAttractive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nint arr_offset = int(floor(currentNode.z + 0.5));\\nint length = int(floor(currentNode.w + 0.5));\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + int(p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat xDist = currentNode.x - nextNode.x;\\nfloat yDist = currentNode.y - nextNode.y;\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\nfloat attractiveF = dist / u_K;\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\ndy -= yDist * attractiveF;\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\ndx -= sign * attractiveF;\\ndy -= sign * attractiveF;}}}\\nreturn vec2(dx, dy);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nfloat dx = 0.0;\\nfloat dy = 0.0;\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\nreturn ;}\\nvec2 repulsive = calcRepulsive(i, currentNode);\\ndx += repulsive.x;\\ndy += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode);\\ndx += attractive.x;\\ndy += attractive.y;\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\ndx -= gravity.x;\\ndy -= gravity.y;\\ndx *= u_Speed;\\ndy *= u_Speed;\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_K","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_K2","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Center","type":"vec2<f32>","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Gravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterGravity","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Speed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_MaxDisplace","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_Clustering","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AttributeArray","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',U.clusterCode=`
  398. import { globalInvocationID } from 'g-webgpu';
  399. const VERTEX_COUNT;
  400. const CLUSTER_COUNT;
  401. @numthreads(1, 1, 1)
  402. class CalcCenter {
  403. @in
  404. u_Data: vec4[];
  405. @in
  406. u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...]
  407. @in @out
  408. u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...]
  409. @main
  410. compute() {
  411. const i = globalInvocationID.x;
  412. const center = this.u_ClusterCenters[i];
  413. let sumx = 0;
  414. let sumy = 0;
  415. let count = 0;
  416. for (let j = 0; j < VERTEX_COUNT; j++) {
  417. const attributes = this.u_NodeAttributes[j];
  418. const clusterIdx = int(attributes[0]);
  419. const vertex = this.u_Data[j];
  420. if (clusterIdx == i) {
  421. sumx += vertex.x;
  422. sumy += vertex.y;
  423. count += 1;
  424. }
  425. }
  426. this.u_ClusterCenters[i] = [
  427. sumx / count,
  428. sumy / count,
  429. count,
  430. i
  431. ];
  432. }
  433. }
  434. `,U.clusterBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributes;\\nuniform vec2 u_NodeAttributesSize;\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributes(float address1D) {\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\n}\\nvec4 getDatau_NodeAttributes(int address1D) {\\n return getDatau_NodeAttributes(float(address1D));\\n}\\nuniform sampler2D u_ClusterCenters;\\nuniform vec2 u_ClusterCentersSize;\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\n}\\nvec4 getDatau_ClusterCenters(float address1D) {\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\n}\\nvec4 getDatau_ClusterCenters(int address1D) {\\n return getDatau_ClusterCenters(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 center = getDatau_ClusterCenters(i);\\nfloat sumx = 0.0;\\nfloat sumy = 0.0;\\nfloat count = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\nint clusterIdx = int(attributes.x);\\nvec4 vertex = getDatau_Data(j);\\nif (clusterIdx == i) {sumx += vertex.x;\\nsumy += vertex.y;\\ncount += 1.0;}}\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"CLUSTER_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}'},86043:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var _=function(E,w){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,k){T.__proto__=k}||function(T,k){for(var b in k)Object.prototype.hasOwnProperty.call(k,b)&&(T[b]=k[b])},_(E,w)};return function(E,w){if(typeof w!="function"&&w!==null)throw new TypeError("Class extends value "+String(w)+" is not a constructor or null");_(E,w);function T(){this.constructor=E}E.prototype=w===null?Object.create(w):(T.prototype=w.prototype,new T)}}(),j=this&&this.__awaiter||function(_,E,w,T){function k(b){return b instanceof w?b:new w(function(m){m(b)})}return new(w||(w=Promise))(function(b,m){function $(H){try{X(T.next(H))}catch(Q){m(Q)}}function W(H){try{X(T.throw(H))}catch(Q){m(Q)}}function X(H){H.done?b(H.value):k(H.value).then($,W)}X((T=T.apply(_,E||[])).next())})},R=this&&this.__generator||function(_,E){var w={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},T,k,b,m;return m={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function $(X){return function(H){return W([X,H])}}function W(X){if(T)throw new TypeError("Generator is already executing.");for(;m&&(m=0,X[0]&&(w=0)),w;)try{if(T=1,k&&(b=X[0]&2?k.return:X[0]?k.throw||((b=k.return)&&b.call(k),0):k.next)&&!(b=b.call(k,X[1])).done)return b;switch(k=0,b&&(X=[X[0]&2,b.value]),X[0]){case 0:case 1:b=X;break;case 4:return w.label++,{value:X[1],done:!1};case 5:w.label++,k=X[1],X=[0];continue;case 7:X=w.ops.pop(),w.trys.pop();continue;default:if(b=w.trys,!(b=b.length>0&&b[b.length-1])&&(X[0]===6||X[0]===2)){w=0;continue}if(X[0]===3&&(!b||X[1]>b[0]&&X[1]<b[3])){w.label=X[1];break}if(X[0]===6&&w.label<b[1]){w.label=b[1],b=X;break}if(b&&w.label<b[2]){w.label=b[2],w.ops.push(X);break}b[2]&&w.ops.pop(),w.trys.pop();continue}X=E.call(_,w)}catch(H){X=[6,H],k=0}finally{T=b=0}if(X[0]&5)throw X[1];return{value:X[0]?X[1]:void 0,done:!0}}};Object.defineProperty(U,"__esModule",{value:!0}),U.GForceGPULayout=void 0;var A=z(46253),N=z(8273),L=z(70390),y=z(38342),x=z(64446),v=z(53733),g=z(24979),d=function(_){B(E,_);function E(w){var T=_.call(this)||this;return T.maxIteration=1e3,T.edgeStrength=200,T.nodeStrength=1e3,T.coulombDisScale=.005,T.damping=.9,T.maxSpeed=1e3,T.minMovement=.5,T.interval=.02,T.factor=1,T.linkDistance=1,T.gravity=10,T.workerEnabled=!1,T.nodes=[],T.edges=[],T.width=300,T.height=300,T.nodeMap={},T.nodeIdxMap={},T.updateCfg(w),T}return E.prototype.getDefaultCfg=function(){return{maxIteration:2e3,gravity:10,clustering:!1,clusterGravity:10}},E.prototype.execute=function(){return j(this,void 0,void 0,function(){var w,T,k,b,m;return R(this,function($){switch($.label){case 0:return w=this,T=w.nodes,!T||T.length===0?(w.onLayoutEnd&&w.onLayoutEnd(),[2]):(!w.width&&typeof window!="undefined"&&(w.width=window.innerWidth),!w.height&&typeof window!="undefined"&&(w.height=window.innerHeight),w.center||(w.center=[w.width/2,w.height/2]),k=w.center,T.length===1?(T[0].x=k[0],T[0].y=k[1],w.onLayoutEnd&&w.onLayoutEnd(),[2]):(b={},m={},T.forEach(function(W,X){(0,N.isNumber)(W.x)||(W.x=Math.random()*w.width),(0,N.isNumber)(W.y)||(W.y=Math.random()*w.height),b[W.id]=W,m[W.id]=X}),w.nodeMap=b,w.nodeIdxMap=m,w.nodeStrength=(0,y.proccessToFunc)(w.nodeStrength,1),w.edgeStrength=(0,y.proccessToFunc)(w.edgeStrength,1),[4,w.run()]));case 1:return $.sent(),[2]}})})},E.prototype.executeWithWorker=function(w,T){var k=this,b=k.nodes,m=k.center;if(!(!b||b.length===0)){if(b.length===1){b[0].x=m[0],b[0].y=m[1];return}var $={},W={};b.forEach(function(X,H){(0,N.isNumber)(X.x)||(X.x=Math.random()*k.width),(0,N.isNumber)(X.y)||(X.y=Math.random()*k.height),$[X.id]=X,W[X.id]=H}),k.nodeMap=$,k.nodeIdxMap=W,k.nodeStrength=(0,y.proccessToFunc)(k.nodeStrength,1),k.edgeStrength=(0,y.proccessToFunc)(k.edgeStrength,1),k.run(w,T)}},E.prototype.run=function(w,T){return j(this,void 0,void 0,function(){var k,b,m,$,W,X,H,Q,q,J,te,fe,de,Te,Se,Ie,be,pe,Me,De,Ue,nt,Ze,ht,Rt,tr,Qe,lt=this;return R(this,function(St){switch(St.label){case 0:for(k=this,b=k.nodes,m=k.edges,$=k.maxIteration,!k.width&&typeof window!="undefined"&&(k.width=window.innerWidth),!k.height&&typeof window!="undefined"&&(k.height=window.innerHeight),W=b.length,k.linkDistance=(0,y.proccessToFunc)(k.linkDistance),k.edgeStrength=(0,y.proccessToFunc)(k.edgeStrength),X=(0,y.buildTextureDataWithTwoEdgeAttr)(b,m,k.linkDistance,k.edgeStrength),H=X.maxEdgePerVetex,Q=X.array,k.degrees=(0,x.getDegree)(b.length,k.nodeIdxMap,m).map(function(Ct){return Ct.all}),q=[],J=[],te=[],fe=[],de=[],Te=[],Se=[],k.getMass||(k.getMass=function(Ct){return k.degrees[k.nodeIdxMap[Ct.id]]||1}),Ie=k.gravity,be=k.center,b.forEach(function(Ct,_t){q.push(k.getMass(Ct)),J.push(k.nodeStrength(Ct)),k.degrees[_t]||(k.degrees[_t]=0);var pt=[be[0],be[1],Ie];if(k.getCenter){var rr=k.getCenter(Ct,k.degrees[_t]);rr&&(0,N.isNumber)(rr[0])&&(0,N.isNumber)(rr[1])&&(0,N.isNumber)(rr[2])&&(pt=rr)}te.push(pt[0]),fe.push(pt[1]),de.push(pt[2]),(0,N.isNumber)(Ct.fx)&&(0,N.isNumber)(Ct.fy)?(Te.push(Ct.fx||.001),Se.push(Ct.fy||.001)):(Te.push(0),Se.push(0))}),pe=(0,y.arrayToTextureData)([q,k.degrees,J,Te]),Me=(0,y.arrayToTextureData)([te,fe,de,Se]),De=k.workerEnabled,De?Ue=L.World.create({canvas:w,engineOptions:{supportCompute:!0}}):Ue=L.World.create({engineOptions:{supportCompute:!0}}),nt=k.onLayoutEnd,Ze=[],Q.forEach(function(Ct){Ze.push(Ct)}),ht=0;ht<4;ht++)Ze.push(0);return Rt=Ue.createKernel(v.gForceBundle).setDispatch([W,1,1]).setBinding({u_Data:Q,u_damping:k.damping,u_maxSpeed:k.maxSpeed,u_minMovement:k.minMovement,u_coulombDisScale:k.coulombDisScale,u_factor:k.factor,u_NodeAttributeArray1:pe,u_NodeAttributeArray2:Me,MAX_EDGE_PER_VERTEX:H,VERTEX_COUNT:W,u_AveMovement:Ze,u_interval:k.interval}),tr=Ue.createKernel(v.aveMovementBundle).setDispatch([1,1,1]).setBinding({u_Data:Q,VERTEX_COUNT:W,u_AveMovement:[0,0,0,0]}),Qe=function(){return j(lt,void 0,void 0,function(){var Ct,_t,pt;return R(this,function(rr){switch(rr.label){case 0:Ct=0,rr.label=1;case 1:return Ct<$?[4,Rt.execute()]:[3,5];case 2:return rr.sent(),tr.setBinding({u_Data:Rt}),[4,tr.execute()];case 3:rr.sent(),_t=Math.max(.02,k.interval-Ct*.002),Rt.setBinding({u_interval:_t,u_AveMovement:tr}),rr.label=4;case 4:return Ct++,[3,1];case 5:return[4,Rt.getOutput()];case 6:return pt=rr.sent(),w?T.postMessage({type:g.LAYOUT_MESSAGE.GPUEND,vertexEdgeData:pt}):b.forEach(function(xr,Vt){var ft=pt[4*Vt],Bt=pt[4*Vt+1];xr.x=ft,xr.y=Bt}),nt&&nt(),[2]}})})},[4,Qe()];case 1:return St.sent(),[2]}})})},E.prototype.getType=function(){return"gForce-gpu"},E}(A.Base);U.GForceGPULayout=d},53733:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.aveMovementBundle=U.aveMovementCode=U.gForceBundle=U.gForceCode=void 0,U.gForceCode=`
  435. import { globalInvocationID } from 'g-webgpu';
  436. const MAX_EDGE_PER_VERTEX;
  437. const VERTEX_COUNT;
  438. const SHIFT_20 = 1048576;
  439. @numthreads(1, 1, 1)
  440. class GGForce {
  441. @in @out
  442. u_Data: vec4[];
  443. @in
  444. u_damping: float;
  445. @in
  446. u_maxSpeed: float;
  447. @in
  448. u_minMovement: float;
  449. @in
  450. u_AveMovement: vec4[];
  451. @in
  452. u_coulombDisScale: float;
  453. @in
  454. u_factor: float;
  455. @in
  456. u_NodeAttributeArray1: vec4[];
  457. @in
  458. u_NodeAttributeArray2: vec4[];
  459. @in
  460. u_interval: float;
  461. unpack_float(packedValue: float): ivec2 {
  462. const packedIntValue = int(packedValue);
  463. const v0 = packedIntValue / SHIFT_20;
  464. return [v0, packedIntValue - v0 * SHIFT_20];
  465. }
  466. calcRepulsive(i: int, currentNode: vec4): vec2 {
  467. let ax = 0, ay = 0;
  468. for (let j: int = 0; j < VERTEX_COUNT; j++) {
  469. if (i != j) {
  470. const nextNode = this.u_Data[j];
  471. const vx = currentNode[0] - nextNode[0];
  472. const vy = currentNode[1] - nextNode[1];
  473. const dist = sqrt(vx * vx + vy * vy) + 0.01;
  474. const n_dist = (dist + 0.1) * this.u_coulombDisScale;
  475. const direx = vx / dist;
  476. const direy = vy / dist;
  477. const attributesi = this.u_NodeAttributeArray1[i];
  478. const attributesj = this.u_NodeAttributeArray1[j];
  479. const massi = attributesi[0];
  480. const nodeStrengthi = attributesi[2];
  481. const nodeStrengthj = attributesj[2];
  482. const nodeStrength = (nodeStrengthi + nodeStrengthj) / 2;
  483. // const param = nodeStrength * this.u_factor / (n_dist * n_dist * massi);
  484. const param = nodeStrength * this.u_factor / (n_dist * n_dist);
  485. ax += direx * param;
  486. ay += direy * param;
  487. }
  488. }
  489. return [ax, ay];
  490. }
  491. calcGravity(i: int, currentNode: vec4, attributes2: vec4): vec2 {
  492. // note: attributes2 = [centerX, centerY, gravity, 0]
  493. const vx = currentNode[0] - attributes2[0];
  494. const vy = currentNode[1] - attributes2[1];
  495. const ax = vx * attributes2[2];
  496. const ay = vy * attributes2[2];
  497. return [ax, ay];
  498. }
  499. calcAttractive(i: int, currentNode: vec4, attributes1: vec4): vec2 {
  500. // note: attributes1 = [mass, degree, nodeSterngth, 0]
  501. const mass = attributes1[0];
  502. let ax = 0, ay = 0;
  503. // const arr_offset = int(floor(currentNode[2] + 0.5));
  504. // const length = int(floor(currentNode[3] + 0.5));
  505. const compressed = this.unpack_float(currentNode[2]);
  506. const length = compressed[0];
  507. const arr_offset = compressed[1];
  508. const node_buffer: vec4;
  509. for (let p: int = 0; p < MAX_EDGE_PER_VERTEX; p++) {
  510. if (p >= length) break;
  511. const arr_idx = arr_offset + 4 * p; // i \u8282\u70B9\u7684\u7B2C p \u6761\u8FB9\u5F00\u59CB\u7684\u5C0F\u683C\u5B50\u4F4D\u7F6E
  512. const buf_offset = arr_idx - arr_idx / 4 * 4;
  513. if (p == 0 || buf_offset == 0) {
  514. node_buffer = this.u_Data[int(arr_idx / 4)]; // \u5927\u683C\u5B50\uFF0C\u5927\u683C\u5B50\u4F4D\u7F6E=\u5C0F\u4E2A\u5B50\u4F4D\u7F6E / 4\uFF0C
  515. }
  516. let float_j: float = node_buffer[0];
  517. const nextNode = this.u_Data[int(float_j)];
  518. const vx = nextNode[0] - currentNode[0];
  519. const vy = nextNode[1] - currentNode[1];
  520. const dist = sqrt(vx * vx + vy * vy) + 0.01;
  521. const direx = vx / dist;
  522. const direy = vy / dist;
  523. const edgeLength = node_buffer[1];
  524. const edgeStrength = node_buffer[2];
  525. const diff: float = edgeLength - dist;//edgeLength
  526. // const param = diff * this.u_stiffness / mass; //
  527. const param = diff * edgeStrength / mass; //
  528. ax -= direx * param;
  529. ay -= direy * param;
  530. }
  531. return [ax, ay];
  532. }
  533. @main
  534. compute() {
  535. const i = globalInvocationID.x;
  536. const currentNode = this.u_Data[i];
  537. const movement = u_AveMovement[0];
  538. let ax = 0, ay = 0;
  539. if (i >= VERTEX_COUNT || movement.x < u_minMovement) {
  540. this.u_Data[i] = currentNode;
  541. return;
  542. }
  543. // \u6BCF\u4E2A\u8282\u70B9\u5C5E\u6027\u5360\u4E24\u4E2A\u6570\u7EC4\u4E2D\u5404\u4E00\u683C
  544. // [mass, degree, nodeStrength, fx]
  545. const nodeAttributes1 = this.u_NodeAttributeArray1[i];
  546. // [centerX, centerY, centerGravity, fy]
  547. const nodeAttributes2 = this.u_NodeAttributeArray2[i];
  548. // repulsive
  549. const repulsive = this.calcRepulsive(i, currentNode);
  550. ax += repulsive[0];
  551. ay += repulsive[1];
  552. // attractive
  553. const attractive = this.calcAttractive(i, currentNode, nodeAttributes1);
  554. ax += attractive[0];
  555. ay += attractive[1];
  556. // gravity
  557. const gravity = this.calcGravity(i, currentNode, nodeAttributes2);
  558. ax -= gravity[0];
  559. ay -= gravity[1];
  560. // speed
  561. const param = this.u_interval * this.u_damping;
  562. let vx = ax * param;
  563. let vy = ay * param;
  564. const vlength = sqrt(vx * vx + vy * vy) + 0.0001;
  565. if (vlength > this.u_maxSpeed) {
  566. const param2 = this.u_maxSpeed / vlength;
  567. vx = param2 * vx;
  568. vy = param2 * vy;
  569. }
  570. // move
  571. if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) {
  572. this.u_Data[i] = [
  573. nodeAttributes1[3],
  574. nodeAttributes2[3],
  575. currentNode[2],
  576. 0
  577. ];
  578. } else {
  579. const distx = vx * this.u_interval;
  580. const disty = vy * this.u_interval;
  581. const distLength = sqrt(distx * distx + disty * disty);
  582. this.u_Data[i] = [
  583. currentNode[0] + distx,
  584. currentNode[1] + disty,
  585. currentNode[2],
  586. distLength
  587. ];
  588. }
  589. // the avarage move distance
  590. // need to share memory
  591. }
  592. }
  593. `,U.gForceBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n#define SHIFT_20 1048576.0\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_damping;\\nuniform float u_maxSpeed;\\nuniform float u_minMovement;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nuniform float u_coulombDisScale;\\nuniform float u_factor;\\nuniform sampler2D u_NodeAttributeArray1;\\nuniform vec2 u_NodeAttributeArray1Size;\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\n}\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\n return getDatau_NodeAttributeArray1(float(address1D));\\n}\\nuniform sampler2D u_NodeAttributeArray2;\\nuniform vec2 u_NodeAttributeArray2Size;\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\n}\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\n}\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\n return getDatau_NodeAttributeArray2(float(address1D));\\n}\\nuniform float u_interval;\\nivec2 unpack_float(float packedValue) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint packedIntValue = int(packedValue);\\nint v0 = packedIntValue / int(SHIFT_20);\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\nfloat vx = currentNode.x - nextNode.x;\\nfloat vy = currentNode.y - nextNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\nfloat massi = attributesi.x;\\nfloat nodeStrengthi = attributesi.z;\\nfloat nodeStrengthj = attributesj.z;\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\nax += direx * param;\\nay += direy * param;}}\\nreturn vec2(ax, ay);}\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat vx = currentNode.x - attributes2.x;\\nfloat vy = currentNode.y - attributes2.y;\\nfloat ax = vx * attributes2.z;\\nfloat ay = vy * attributes2.z;\\nreturn vec2(ax, ay);}\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat mass = attributes1.x;\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nivec2 compressed = unpack_float(currentNode.z);\\nint length = compressed.x;\\nint arr_offset = compressed.y;\\nvec4 node_buffer;\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\nint arr_idx = arr_offset + (4 * p);\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\nfloat float_j = node_buffer.x;\\nvec4 nextNode = getDatau_Data(int(float_j));\\nfloat vx = nextNode.x - currentNode.x;\\nfloat vy = nextNode.y - currentNode.y;\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\nfloat direx = vx / dist;\\nfloat direy = vy / dist;\\nfloat edgeLength = node_buffer.y;\\nfloat edgeStrength = node_buffer.z;\\nfloat diff = edgeLength - dist;\\nfloat param = (diff * edgeStrength) / mass;\\nax -= direx * param;\\nay -= direy * param;}\\nreturn vec2(ax, ay);}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nint i = globalInvocationID.x;\\nvec4 currentNode = getDatau_Data(i);\\nvec4 movement = getDatau_AveMovement(0.0);\\nfloat ax = 0.0;\\nfloat ay = 0.0;\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\nreturn ;}\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\nvec2 repulsive = calcRepulsive(i, currentNode);\\nax += repulsive.x;\\nay += repulsive.y;\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\nax += attractive.x;\\nay += attractive.y;\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\nax -= gravity.x;\\nay -= gravity.y;\\nfloat param = u_interval * u_damping;\\nfloat vx = ax * param;\\nfloat vy = ay * param;\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\nvx = param2 * vx;\\nvy = param2 * vy;}\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {float distx = vx * u_interval;\\nfloat disty = vy * u_interval;\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"MAX_EDGE_PER_VERTEX","type":"Float","runtime":true},{"name":"VERTEX_COUNT","type":"Float","runtime":true},{"name":"SHIFT_20","type":"Float","value":1048576,"runtime":false}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]},{"name":"u_damping","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_maxSpeed","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_minMovement","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_coulombDisScale","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_factor","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray1","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_interval","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',U.aveMovementCode=`
  594. const VERTEX_COUNT;
  595. @numthreads(1, 1, 1)
  596. class CalcAveMovement {
  597. @in
  598. u_Data: vec4[];
  599. @in
  600. u_iter: float;
  601. @in @out
  602. u_AveMovement: vec4[];
  603. @main
  604. compute() {
  605. let movement = 0;
  606. for (let j: int = 0; j < VERTEX_COUNT; j++) {
  607. const vertex = this.u_Data[j];
  608. movement += vertex[3];
  609. }
  610. movement = movement / float(VERTEX_COUNT);
  611. this.u_AveMovement[0] = [movement, 0, 0, 0];
  612. }
  613. }
  614. `,U.aveMovementBundle='{"shaders":{"WGSL":"","GLSL450":"","GLSL100":"\\n\\nfloat epsilon = 0.00001;\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\n vec2 normAddr2D = float(address1D) * conv_const;\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\n}\\n\\nvoid barrier() {}\\n \\n\\nuniform vec2 u_OutputTextureSize;\\nuniform int u_OutputTexelCount;\\nvarying vec2 v_TexCoord;\\n\\nbool gWebGPUDebug = false;\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\n\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\n\\nuniform sampler2D u_Data;\\nuniform vec2 u_DataSize;\\nvec4 getDatau_Data(vec2 address2D) {\\n return vec4(texture2D(u_Data, address2D).rgba);\\n}\\nvec4 getDatau_Data(float address1D) {\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\n}\\nvec4 getDatau_Data(int address1D) {\\n return getDatau_Data(float(address1D));\\n}\\nuniform float u_iter;\\nuniform sampler2D u_AveMovement;\\nuniform vec2 u_AveMovementSize;\\nvec4 getDatau_AveMovement(vec2 address2D) {\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\n}\\nvec4 getDatau_AveMovement(float address1D) {\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\n}\\nvec4 getDatau_AveMovement(int address1D) {\\n return getDatau_AveMovement(float(address1D));\\n}\\nvoid main() {\\nivec3 workGroupSize = ivec3(1, 1, 1);\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\nfloat movement = 0.0;\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\nmovement += vertex.w;}\\nmovement = movement / float(VERTEX_COUNT);\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\n gl_FragColor = gWebGPUDebugOutput;\\n}}\\n"},"context":{"name":"","dispatch":[1,1,1],"threadGroupSize":[1,1,1],"maxIteration":1,"defines":[{"name":"VERTEX_COUNT","type":"Float","runtime":true}],"uniforms":[{"name":"u_Data","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_iter","type":"Float","storageClass":"Uniform","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_AveMovement","type":"vec4<f32>[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}'},74294:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var N=function(L,y){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,v){x.__proto__=v}||function(x,v){for(var g in v)Object.prototype.hasOwnProperty.call(v,g)&&(x[g]=v[g])},N(L,y)};return function(L,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");N(L,y);function x(){this.constructor=L}L.prototype=y===null?Object.create(y):(x.prototype=y.prototype,new x)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.GridLayout=void 0;var j=z(8273),R=z(46253),A=function(N){B(L,N);function L(y){var x=N.call(this)||this;return x.begin=[0,0],x.preventOverlap=!0,x.preventOverlapPadding=10,x.condense=!1,x.sortBy="degree",x.nodes=[],x.edges=[],x.width=300,x.height=300,x.row=0,x.col=0,x.cellWidth=0,x.cellHeight=0,x.cellUsed={},x.id2manPos={},x.onLayoutEnd=function(){},x.updateCfg(y),x}return L.prototype.getDefaultCfg=function(){return{begin:[0,0],preventOverlap:!0,preventOverlapPadding:10,condense:!1,rows:void 0,cols:void 0,position:void 0,sortBy:"degree",nodeSize:30}},L.prototype.execute=function(){var y=this,x=y.nodes,v=y.edges,g=y.begin,d=x.length;if(d===0)return y.onLayoutEnd&&y.onLayoutEnd(),{nodes:x,edges:v};if(d===1)return x[0].x=g[0],x[0].y=g[1],y.onLayoutEnd&&y.onLayoutEnd(),{nodes:x,edges:v};var _=y.sortBy,E=y.width,w=y.height,T=y.condense,k=y.preventOverlapPadding,b=y.preventOverlap,m=y.nodeSpacing,$=y.nodeSize,W=[];x.forEach(function(pe){W.push(pe)});var X={};if(W.forEach(function(pe,Me){X[pe.id]=Me}),(_==="degree"||!(0,j.isString)(_)||W[0][_]===void 0)&&(_="degree",(0,j.isNaN)(x[0].degree))){var H=(0,j.getDegree)(W.length,X,v);W.forEach(function(pe,Me){pe.degree=H[Me].all})}W.sort(function(pe,Me){return Me[_]-pe[_]}),!E&&typeof window!="undefined"&&(E=window.innerWidth),!w&&typeof window!="undefined"&&(w=window.innerHeight);var Q=y.rows,q=y.cols!=null?y.cols:y.columns;if(y.cells=d,Q!=null&&q!=null?(y.rows=Q,y.cols=q):Q!=null&&q==null?(y.rows=Q,y.cols=Math.ceil(y.cells/y.rows)):Q==null&&q!=null?(y.cols=q,y.rows=Math.ceil(y.cells/y.cols)):(y.splits=Math.sqrt(y.cells*y.height/y.width),y.rows=Math.round(y.splits),y.cols=Math.round(y.width/y.height*y.splits)),y.rows=Math.max(y.rows,1),y.cols=Math.max(y.cols,1),y.cols*y.rows>y.cells){var J=y.small(),te=y.large();(J-1)*te>=y.cells?y.small(J-1):(te-1)*J>=y.cells&&y.large(te-1)}else for(;y.cols*y.rows<y.cells;){var J=y.small(),te=y.large();(te+1)*J>=y.cells?y.large(te+1):y.small(J+1)}if(y.cellWidth=E/y.cols,y.cellHeight=w/y.rows,T&&(y.cellWidth=0,y.cellHeight=0),b||m){var fe=(0,j.getFuncByUnknownType)(10,m),de=(0,j.getFuncByUnknownType)(30,$,!1);W.forEach(function(pe){(!pe.x||!pe.y)&&(pe.x=0,pe.y=0);var Me=de(pe)||30,De,Ue;(0,j.isArray)(Me)?(De=Me[0],Ue=Me[1]):(De=Me,Ue=Me);var nt=fe!==void 0?fe(pe):k,Ze=De+nt,ht=Ue+nt;y.cellWidth=Math.max(y.cellWidth,Ze),y.cellHeight=Math.max(y.cellHeight,ht)})}y.cellUsed={},y.row=0,y.col=0,y.id2manPos={};for(var Te=0;Te<W.length;Te++){var Se=W[Te],Ie=void 0;if(y.position&&(Ie=y.position(Se)),Ie&&(Ie.row!==void 0||Ie.col!==void 0)){var be={row:Ie.row,col:Ie.col};if(be.col===void 0)for(be.col=0;y.used(be.row,be.col);)be.col++;else if(be.row===void 0)for(be.row=0;y.used(be.row,be.col);)be.row++;y.id2manPos[Se.id]=be,y.use(be.row,be.col)}y.getPos(Se)}return y.onLayoutEnd&&y.onLayoutEnd(),{edges:v,nodes:W}},L.prototype.small=function(y){var x=this,v,g=x.rows||5,d=x.cols||5;if(y==null)v=Math.min(g,d);else{var _=Math.min(g,d);_===x.rows?x.rows=y:x.cols=y}return v},L.prototype.large=function(y){var x=this,v,g=x.rows||5,d=x.cols||5;if(y==null)v=Math.max(g,d);else{var _=Math.max(g,d);_===x.rows?x.rows=y:x.cols=y}return v},L.prototype.used=function(y,x){var v=this;return v.cellUsed["c-".concat(y,"-").concat(x)]||!1},L.prototype.use=function(y,x){var v=this;v.cellUsed["c-".concat(y,"-").concat(x)]=!0},L.prototype.moveToNextCell=function(){var y=this,x=y.cols||5;y.col++,y.col>=x&&(y.col=0,y.row++)},L.prototype.getPos=function(y){var x=this,v=x.begin,g=x.cellWidth,d=x.cellHeight,_,E,w=x.id2manPos[y.id];if(w)_=w.col*g+g/2+v[0],E=w.row*d+d/2+v[1];else{for(;x.used(x.row,x.col);)x.moveToNextCell();_=x.col*g+g/2+v[0],E=x.row*d+d/2+v[1],x.use(x.row,x.col),x.moveToNextCell()}y.x=_,y.y=E},L.prototype.getType=function(){return"grid"},L}(R.Base);U.GridLayout=A},64649:function(or,U,z){"use strict";var B=this&&this.__createBinding||(Object.create?function(H,Q,q,J){J===void 0&&(J=q);var te=Object.getOwnPropertyDescriptor(Q,q);(!te||("get"in te?!Q.__esModule:te.writable||te.configurable))&&(te={enumerable:!0,get:function(){return Q[q]}}),Object.defineProperty(H,J,te)}:function(H,Q,q,J){J===void 0&&(J=q),H[J]=Q[q]}),j=this&&this.__exportStar||function(H,Q){for(var q in H)q!=="default"&&!Object.prototype.hasOwnProperty.call(Q,q)&&B(Q,H,q)};Object.defineProperty(U,"__esModule",{value:!0}),U.ERLayout=U.ForceAtlas2Layout=U.ComboCombinedLayout=U.ComboForceLayout=U.GForceGPULayout=U.FruchtermanGPULayout=U.FruchtermanLayout=U.MDSLayout=U.ConcentricLayout=U.RadialLayout=U.DagreCompoundLayout=U.DagreLayout=U.CircularLayout=U.ForceLayout=U.Force2Layout=U.GForceLayout=U.RandomLayout=U.GridLayout=U.Layouts=U.Layout=void 0;var R=z(74294);Object.defineProperty(U,"GridLayout",{enumerable:!0,get:function(){return R.GridLayout}});var A=z(26729);Object.defineProperty(U,"RandomLayout",{enumerable:!0,get:function(){return A.RandomLayout}});var N=z(46260);Object.defineProperty(U,"GForceLayout",{enumerable:!0,get:function(){return N.GForceLayout}});var L=z(38129);Object.defineProperty(U,"Force2Layout",{enumerable:!0,get:function(){return L.Force2Layout}});var y=z(64180);Object.defineProperty(U,"ForceLayout",{enumerable:!0,get:function(){return y.ForceLayout}});var x=z(93959);Object.defineProperty(U,"CircularLayout",{enumerable:!0,get:function(){return x.CircularLayout}});var v=z(2);Object.defineProperty(U,"DagreLayout",{enumerable:!0,get:function(){return v.DagreLayout}});var g=z(77620);Object.defineProperty(U,"DagreCompoundLayout",{enumerable:!0,get:function(){return g.DagreCompoundLayout}});var d=z(90106);Object.defineProperty(U,"RadialLayout",{enumerable:!0,get:function(){return d.RadialLayout}});var _=z(98162);Object.defineProperty(U,"ConcentricLayout",{enumerable:!0,get:function(){return _.ConcentricLayout}});var E=z(98204);Object.defineProperty(U,"MDSLayout",{enumerable:!0,get:function(){return E.MDSLayout}});var w=z(23826);Object.defineProperty(U,"FruchtermanLayout",{enumerable:!0,get:function(){return w.FruchtermanLayout}});var T=z(81822);Object.defineProperty(U,"FruchtermanGPULayout",{enumerable:!0,get:function(){return T.FruchtermanGPULayout}});var k=z(86043);Object.defineProperty(U,"GForceGPULayout",{enumerable:!0,get:function(){return k.GForceGPULayout}});var b=z(48133);Object.defineProperty(U,"ComboForceLayout",{enumerable:!0,get:function(){return b.ComboForceLayout}});var m=z(6412);Object.defineProperty(U,"ComboCombinedLayout",{enumerable:!0,get:function(){return m.ComboCombinedLayout}});var $=z(16919);Object.defineProperty(U,"ForceAtlas2Layout",{enumerable:!0,get:function(){return $.ForceAtlas2Layout}});var W=z(40311);Object.defineProperty(U,"ERLayout",{enumerable:!0,get:function(){return W.ERLayout}});var X=z(99745);Object.defineProperty(U,"Layout",{enumerable:!0,get:function(){return X.Layout}}),Object.defineProperty(U,"Layouts",{enumerable:!0,get:function(){return X.Layouts}}),j(z(2230),U)},99745:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.Layouts=U.Layout=void 0;var B=z(39464),j=z(74294),R=z(26729),A=z(38129),N=z(46260),L=z(64180),y=z(93959),x=z(2),v=z(90106),g=z(98162),d=z(98204),_=z(23826),E=z(81822),w=z(86043),T=z(48133),k=z(6412),b=z(16919),m=z(40311),$=z(77620),W=z(8273),X=function(){function H(Q){var q=(0,B.getLayoutByName)(Q.type);this.layoutInstance=new q(Q)}return H.prototype.layout=function(Q){return this.layoutInstance.layout(Q)},H.prototype.updateCfg=function(Q){this.layoutInstance.updateCfg(Q)},H.prototype.init=function(Q){this.correctLayers(Q.nodes),this.layoutInstance.init(Q)},H.prototype.correctLayers=function(Q){if(!!(Q==null?void 0:Q.length)){var q=Infinity,J=[];if(Q.forEach(function(fe){(0,W.isString)(fe.layer)&&(fe.layer=parseInt(fe.layer,10)),!(fe.layer===void 0||isNaN(fe.layer))&&(J.push(fe),fe.layer<q&&(q=fe.layer))}),q<=0){var te=Math.abs(q)+1;J.forEach(function(fe){return fe.layer+=te})}}},H.prototype.execute=function(){this.layoutInstance.execute()},H.prototype.getDefaultCfg=function(){return this.layoutInstance.getDefaultCfg()},H.prototype.destroy=function(){return this.layoutInstance.destroy()},H}();U.Layout=X,U.Layouts={force:L.ForceLayout,fruchterman:_.FruchtermanLayout,forceAtlas2:b.ForceAtlas2Layout,gForce:N.GForceLayout,force2:A.Force2Layout,dagre:x.DagreLayout,dagreCompound:$.DagreCompoundLayout,circular:y.CircularLayout,radial:v.RadialLayout,concentric:g.ConcentricLayout,grid:j.GridLayout,mds:d.MDSLayout,comboForce:T.ComboForceLayout,comboCombined:k.ComboCombinedLayout,random:R.RandomLayout,"gForce-gpu":w.GForceGPULayout,"fruchterman-gpu":E.FruchtermanGPULayout,er:m.ERLayout}},98204:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var L=function(y,x){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,g){v.__proto__=g}||function(v,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(v[d]=g[d])},L(y,x)};return function(y,x){if(typeof x!="function"&&x!==null)throw new TypeError("Class extends value "+String(x)+" is not a constructor or null");L(y,x);function v(){this.constructor=y}y.prototype=x===null?Object.create(x):(v.prototype=x.prototype,new v)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.MDSLayout=void 0;var j=z(52710),R=z(8273),A=z(46253),N=function(L){B(y,L);function y(x){var v=L.call(this)||this;return v.center=[0,0],v.linkDistance=50,v.nodes=[],v.edges=[],v.onLayoutEnd=function(){},v.updateCfg(x),v}return y.prototype.getDefaultCfg=function(){return{center:[0,0],linkDistance:50}},y.prototype.execute=function(){var x=this,v=x.nodes,g=x.edges,d=g===void 0?[]:g,_=x.center;if(!v||v.length===0){x.onLayoutEnd&&x.onLayoutEnd();return}if(v.length===1){v[0].x=_[0],v[0].y=_[1],x.onLayoutEnd&&x.onLayoutEnd();return}var E=x.linkDistance,w=(0,R.getAdjMatrix)({nodes:v,edges:d},!1),T=(0,R.floydWarshall)(w);x.handleInfinity(T);var k=(0,R.scaleMatrix)(T,E);x.scaledDistances=k;var b=x.runMDS();return x.positions=b,b.forEach(function(m,$){v[$].x=m[0]+_[0],v[$].y=m[1]+_[1]}),x.onLayoutEnd&&x.onLayoutEnd(),{nodes:v,edges:d}},y.prototype.runMDS=function(){var x=this,v=2,g=x.scaledDistances,d=j.Matrix.mul(j.Matrix.pow(g,2),-.5),_=d.mean("row"),E=d.mean("column"),w=d.mean();d.add(w).subRowVector(_).subColumnVector(E);var T=new j.SingularValueDecomposition(d),k=j.Matrix.sqrt(T.diagonalMatrix).diagonal();return T.leftSingularVectors.toJSON().map(function(b){return j.Matrix.mul([b],[k]).toJSON()[0].splice(0,v)})},y.prototype.handleInfinity=function(x){var v=-999999;x.forEach(function(g){g.forEach(function(d){d!==Infinity&&v<d&&(v=d)})}),x.forEach(function(g,d){g.forEach(function(_,E){_===Infinity&&(x[d][E]=v)})})},y.prototype.getType=function(){return"mds"},y}(A.Base);U.MDSLayout=N},90106:function(or,U,z){"use strict";var B=this&&this.__createBinding||(Object.create?function(R,A,N,L){L===void 0&&(L=N);var y=Object.getOwnPropertyDescriptor(A,N);(!y||("get"in y?!A.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return A[N]}}),Object.defineProperty(R,L,y)}:function(R,A,N,L){L===void 0&&(L=N),R[L]=A[N]}),j=this&&this.__exportStar||function(R,A){for(var N in R)N!=="default"&&!Object.prototype.hasOwnProperty.call(A,N)&&B(A,R,N)};Object.defineProperty(U,"__esModule",{value:!0}),j(z(54652),U)},87e3:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var B=z(52710),j=function(){function R(A){this.distances=A.distances,this.dimension=A.dimension||2,this.linkDistance=A.linkDistance}return R.prototype.layout=function(){var A=this,N=A.dimension,L=A.distances,y=A.linkDistance;try{var x=B.Matrix.mul(B.Matrix.pow(L,2),-.5),v=x.mean("row"),g=x.mean("column"),d=x.mean();x.add(d).subRowVector(v).subColumnVector(g);var _=new B.SingularValueDecomposition(x),E=B.Matrix.sqrt(_.diagonalMatrix).diagonal();return _.leftSingularVectors.toJSON().map(function(m){return B.Matrix.mul([m],[E]).toJSON()[0].splice(0,N)})}catch(m){for(var w=[],T=0;T<L.length;T++){var k=Math.random()*y,b=Math.random()*y;w.push([k,b])}return w}},R}();U.default=j},54652:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var d=function(_,E){return d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(w,T){w.__proto__=T}||function(w,T){for(var k in T)Object.prototype.hasOwnProperty.call(T,k)&&(w[k]=T[k])},d(_,E)};return function(_,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");d(_,E);function w(){this.constructor=_}_.prototype=E===null?Object.create(E):(w.prototype=E.prototype,new w)}}(),j=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(U,"__esModule",{value:!0}),U.RadialLayout=void 0;var R=z(8273),A=z(46253),N=j(z(87e3)),L=j(z(78614));function y(d){for(var _=d.length,E=d[0].length,w=[],T=0;T<_;T++){for(var k=[],b=0;b<E;b++)d[T][b]!==0?k.push(1/(d[T][b]*d[T][b])):k.push(0);w.push(k)}return w}function x(d,_){var E=-1;return d.forEach(function(w,T){w.id===_&&(E=T)}),E}function v(d,_){return Math.sqrt((d[0]-_[0])*(d[0]-_[0])+(d[1]-_[1])*(d[1]-_[1]))}var g=function(d){B(_,d);function _(E){var w=d.call(this)||this;return w.maxIteration=1e3,w.focusNode=null,w.unitRadius=null,w.linkDistance=50,w.preventOverlap=!1,w.strictRadial=!0,w.maxPreventOverlapIteration=200,w.sortStrength=10,w.nodes=[],w.edges=[],w.updateCfg(E),w}return _.prototype.getDefaultCfg=function(){return{maxIteration:1e3,focusNode:null,unitRadius:null,linkDistance:50,preventOverlap:!1,nodeSize:void 0,nodeSpacing:void 0,strictRadial:!0,maxPreventOverlapIteration:200,sortBy:void 0,sortStrength:10}},_.prototype.execute=function(){var E=this,w=E.nodes,T=E.edges||[];if(!w||w.length===0){E.onLayoutEnd&&E.onLayoutEnd();return}!E.width&&typeof window!="undefined"&&(E.width=window.innerWidth),!E.height&&typeof window!="undefined"&&(E.height=window.innerHeight),E.center||(E.center=[E.width/2,E.height/2]);var k=E.center;if(w.length===1){w[0].x=k[0],w[0].y=k[1],E.onLayoutEnd&&E.onLayoutEnd();return}var b=E.linkDistance,m=null;if((0,R.isString)(E.focusNode)){for(var $=!1,W=0;W<w.length;W++)w[W].id===E.focusNode&&(m=w[W],E.focusNode=m,$=!0,W=w.length);$||(m=null)}else m=E.focusNode;m||(m=w[0],E.focusNode=m);var X=x(w,m.id);X<0&&(X=0),E.focusIndex=X;var H=(0,R.getAdjMatrix)({nodes:w,edges:T},!1),Q=(0,R.floydWarshall)(H),q=E.maxToFocus(Q,X);E.handleInfinity(Q,X,q+1),E.distances=Q;var J=Q[X],te=E.width||500,fe=E.height||500,de=te-k[0]>k[0]?k[0]:te-k[0],Te=fe-k[1]>k[1]?k[1]:fe-k[1];de===0&&(de=te/2),Te===0&&(Te=fe/2);var Se=Te>de?de:Te,Ie=Math.max.apply(Math,J),be=[];J.forEach(function(Ct,_t){E.unitRadius||(E.unitRadius=Se/Ie),be[_t]=Ct*E.unitRadius}),E.radii=be;var pe=E.eIdealDisMatrix();E.eIdealDistances=pe;var Me=y(pe);E.weights=Me;var De=new N.default({linkDistance:b,distances:pe}),Ue=De.layout();Ue.forEach(function(Ct){(0,R.isNaN)(Ct[0])&&(Ct[0]=Math.random()*b),(0,R.isNaN)(Ct[1])&&(Ct[1]=Math.random()*b)}),E.positions=Ue,Ue.forEach(function(Ct,_t){w[_t].x=Ct[0]+k[0],w[_t].y=Ct[1]+k[1]}),Ue.forEach(function(Ct){Ct[0]-=Ue[X][0],Ct[1]-=Ue[X][1]}),E.run();var nt=E.preventOverlap,Ze=E.nodeSize,ht,Rt=E.strictRadial;if(nt){var tr=E.nodeSpacing,Qe;(0,R.isNumber)(tr)?Qe=function(){return tr}:(0,R.isFunction)(tr)?Qe=tr:Qe=function(){return 0},Ze?(0,R.isArray)(Ze)?ht=function(Ct){var _t=Ze[0]>Ze[1]?Ze[0]:Ze[1];return _t+Qe(Ct)}:ht=function(Ct){return Ze+Qe(Ct)}:ht=function(Ct){if(Ct.size){if((0,R.isArray)(Ct.size)){var _t=Ct.size[0]>Ct.size[1]?Ct.size[0]:Ct.size[1];return _t+Qe(Ct)}if((0,R.isObject)(Ct.size)){var _t=Ct.size.width>Ct.size.height?Ct.size.width:Ct.size.height;return _t+Qe(Ct)}return Ct.size+Qe(Ct)}return 10+Qe(Ct)};var lt={nodes:w,nodeSizeFunc:ht,adjMatrix:H,positions:Ue,radii:be,height:fe,width:te,strictRadial:Rt,focusID:X,iterations:E.maxPreventOverlapIteration||200,k:Ue.length/4.5},St=new L.default(lt);Ue=St.layout()}return Ue.forEach(function(Ct,_t){w[_t].x=Ct[0]+k[0],w[_t].y=Ct[1]+k[1]}),E.onLayoutEnd&&E.onLayoutEnd(),{nodes:w,edges:T}},_.prototype.run=function(){for(var E=this,w=E.maxIteration,T=E.positions||[],k=E.weights||[],b=E.eIdealDistances||[],m=E.radii||[],$=0;$<=w;$++){var W=$/w;E.oneIteration(W,T,m,b,k)}},_.prototype.oneIteration=function(E,w,T,k,b){var m=this,$=1-E,W=m.focusIndex;w.forEach(function(X,H){var Q=v(X,[0,0]),q=Q===0?0:1/Q;if(H!==W){var J=0,te=0,fe=0;w.forEach(function(Te,Se){if(H!==Se){var Ie=v(X,Te),be=Ie===0?0:1/Ie,pe=k[Se][H];fe+=b[H][Se],J+=b[H][Se]*(Te[0]+pe*(X[0]-Te[0])*be),te+=b[H][Se]*(Te[1]+pe*(X[1]-Te[1])*be)}});var de=T[H]===0?0:1/T[H];fe*=$,fe+=E*de*de,J*=$,J+=E*de*X[0]*q,X[0]=J/fe,te*=$,te+=E*de*X[1]*q,X[1]=te/fe}})},_.prototype.eIdealDisMatrix=function(){var E=this,w=E.nodes;if(!w)return[];var T=E.distances,k=E.linkDistance,b=E.radii||[],m=E.unitRadius||50,$=[];return T&&T.forEach(function(W,X){var H=[];W.forEach(function(Q,q){if(X===q)H.push(0);else if(b[X]===b[q])if(E.sortBy==="data")H.push(Q*(Math.abs(X-q)*E.sortStrength)/(b[X]/m));else if(E.sortBy){var J=w[X][E.sortBy]||0,te=w[q][E.sortBy]||0;(0,R.isString)(J)&&(J=J.charCodeAt(0)),(0,R.isString)(te)&&(te=te.charCodeAt(0)),H.push(Q*(Math.abs(J-te)*E.sortStrength)/(b[X]/m))}else H.push(Q*k/(b[X]/m));else{var fe=(k+m)/2;H.push(Q*fe)}}),$.push(H)}),$},_.prototype.handleInfinity=function(E,w,T){for(var k=E.length,b=0;b<k;b++)if(E[w][b]===Infinity){E[w][b]=T,E[b][w]=T;for(var m=0;m<k;m++)E[b][m]!==Infinity&&E[w][m]===Infinity&&(E[w][m]=T+E[b][m],E[m][w]=T+E[b][m])}for(var b=0;b<k;b++)if(b!==w){for(var m=0;m<k;m++)if(E[b][m]===Infinity){var $=Math.abs(E[w][b]-E[w][m]);$=$===0?1:$,E[b][m]=$}}},_.prototype.maxToFocus=function(E,w){for(var T=0,k=0;k<E[w].length;k++)E[w][k]!==Infinity&&(T=E[w][k]>T?E[w][k]:T);return T},_.prototype.getType=function(){return"radial"},_}(A.Base);U.RadialLayout=g},78614:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0});var z=800,B=function(){function j(R){this.disp=[],this.positions=R.positions,this.adjMatrix=R.adjMatrix,this.focusID=R.focusID,this.radii=R.radii,this.iterations=R.iterations||10,this.height=R.height||10,this.width=R.width||10,this.speed=R.speed||100,this.gravity=R.gravity||10,this.nodeSizeFunc=R.nodeSizeFunc,this.k=R.k||5,this.strictRadial=R.strictRadial,this.nodes=R.nodes}return j.prototype.layout=function(){var R=this,A=R.positions,N=[],L=R.iterations,y=R.width/10;R.maxDisplace=y,R.disp=N;for(var x=0;x<L;x++)A.forEach(function(v,g){N[g]={x:0,y:0}}),R.getRepulsion(),R.updatePositions();return A},j.prototype.getRepulsion=function(){var R=this,A=R.positions,N=R.nodes,L=R.disp,y=R.k,x=R.radii||[];A.forEach(function(v,g){L[g]={x:0,y:0},A.forEach(function(d,_){if(g!==_&&x[g]===x[_]){var E=v[0]-d[0],w=v[1]-d[1],T=Math.sqrt(E*E+w*w);if(T===0){T=1;var k=g>_?1:-1;E=.01*k,w=.01*k}if(T<R.nodeSizeFunc(N[g])/2+R.nodeSizeFunc(N[_])/2){var b=y*y/T;L[g].x+=E/T*b,L[g].y+=w/T*b}}})})},j.prototype.updatePositions=function(){var R=this,A=R.positions,N=R.disp,L=R.speed,y=R.strictRadial,x=R.focusID,v=R.maxDisplace||R.width/10;y&&N.forEach(function(d,_){var E=A[_][0]-A[x][0],w=A[_][1]-A[x][1],T=Math.sqrt(E*E+w*w),k=w/T,b=-E/T,m=Math.sqrt(d.x*d.x+d.y*d.y),$=Math.acos((k*d.x+b*d.y)/m);$>Math.PI/2&&($-=Math.PI/2,k*=-1,b*=-1);var W=Math.cos($)*m;d.x=k*W,d.y=b*W});var g=R.radii;A.forEach(function(d,_){if(_!==x){var E=Math.sqrt(N[_].x*N[_].x+N[_].y*N[_].y);if(E>0&&_!==x){var w=Math.min(v*(L/z),E);if(d[0]+=N[_].x/E*w,d[1]+=N[_].y/E*w,y){var T=d[0]-A[x][0],k=d[1]-A[x][1],b=Math.sqrt(T*T+k*k);T=T/b*g[_],k=k/b*g[_],d[0]=A[x][0]+T,d[1]=A[x][1]+k}}}})},j}();U.default=B},26729:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var A=function(N,L){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,x){y.__proto__=x}||function(y,x){for(var v in x)Object.prototype.hasOwnProperty.call(x,v)&&(y[v]=x[v])},A(N,L)};return function(N,L){if(typeof L!="function"&&L!==null)throw new TypeError("Class extends value "+String(L)+" is not a constructor or null");A(N,L);function y(){this.constructor=N}N.prototype=L===null?Object.create(L):(y.prototype=L.prototype,new y)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.RandomLayout=void 0;var j=z(46253),R=function(A){B(N,A);function N(L){var y=A.call(this)||this;return y.center=[0,0],y.width=300,y.height=300,y.nodes=[],y.edges=[],y.onLayoutEnd=function(){},y.updateCfg(L),y}return N.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},N.prototype.execute=function(){var L=this,y=L.nodes,x=.9,v=L.center;return!L.width&&typeof window!="undefined"&&(L.width=window.innerWidth),!L.height&&typeof window!="undefined"&&(L.height=window.innerHeight),y&&y.forEach(function(g){g.x=(Math.random()-.5)*x*L.width+v[0],g.y=(Math.random()-.5)*x*L.height+v[1]}),L.onLayoutEnd&&L.onLayoutEnd(),{nodes:y,edges:this.edges}},N.prototype.getType=function(){return"random"},N}(j.Base);U.RandomLayout=R},2230:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0})},39464:function(or,U,z){"use strict";var B=this&&this.__extends||function(){var x=function(v,g){return x=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,_){d.__proto__=_}||function(d,_){for(var E in _)Object.prototype.hasOwnProperty.call(_,E)&&(d[E]=_[E])},x(v,g)};return function(v,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");x(v,g);function d(){this.constructor=v}v.prototype=g===null?Object.create(g):(d.prototype=g.prototype,new d)}}();Object.defineProperty(U,"__esModule",{value:!0}),U.getLayoutByName=U.unRegisterLayout=U.registerLayout=void 0;var j=z(46253),R=z(8273),A=new Map,N=function(x,v){if(A.get(x)&&console.warn("The layout with the name ".concat(x," exists already, it will be overridden")),(0,R.isObject)(v)){var g=function(d){B(_,d);function _(E){var w=this,T;w=d.call(this)||this;var k=w,b={},m=Object.assign({},k.getDefaultCfg(),((T=v.getDefaultCfg)===null||T===void 0?void 0:T.call(v))||{});return Object.assign(b,m,v,E),Object.keys(b).forEach(function($){var W=b[$];k[$]=W}),w}return _}(j.Base);A.set(x,g)}else A.set(x,v);return A.get(x)};U.registerLayout=N;var L=function(x){A.has(x)&&A.delete(x)};U.unRegisterLayout=L;var y=function(x){return A.has(x)?A.get(x):null};U.getLayoutByName=y},92272:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.isArray=void 0,U.isArray=Array.isArray},72612:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.getFuncByUnknownType=U.getFunc=U.isFunction=void 0;var B=z(8273),j=z(5049),R=function(L){return typeof L=="function"};U.isFunction=R;var A=function(L,y,x){var v;return x?v=x:(0,j.isNumber)(L)?v=function(){return L}:v=function(){return y},v};U.getFunc=A;var N=function(L,y,x){return x===void 0&&(x=!0),!y&&y!==0?function(v){return v.size?(0,B.isArray)(v.size)?v.size[0]>v.size[1]?v.size[0]:v.size[1]:(0,B.isObject)(v.size)?v.size.width>v.size.height?v.size.width:v.size.height:v.size:L}:(0,U.isFunction)(y)?y:(0,j.isNumber)(y)?function(){return y}:(0,B.isArray)(y)?function(){if(x){var v=Math.max.apply(Math,y);return isNaN(v)?L:v}return y}:(0,B.isObject)(y)?function(){if(x){var v=Math.max(y.width,y.height);return isNaN(v)?L:v}return[y.width,y.height]}:function(){return L}};U.getFuncByUnknownType=N},38342:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.arrayToTextureData=U.attributesToTextureData=U.buildTextureDataWithTwoEdgeAttr=U.buildTextureData=U.proccessToFunc=void 0;var B=z(8273),j=z(64446),R=function(x,v){var g;return x?(0,B.isNumber)(x)?g=function(){return x}:g=x:g=function(){return v||1},g};U.proccessToFunc=R;var A=function(x,v){var g=[],d=[],_={},E=0;for(E=0;E<x.length;E++){var w=x[E];_[w.id]=E,g.push(w.x),g.push(w.y),g.push(0),g.push(0),d.push([])}for(E=0;E<v.length;E++){var T=v[E],k=(0,j.getEdgeTerminal)(T,"source"),b=(0,j.getEdgeTerminal)(T,"target");!isNaN(_[k])&&!isNaN(_[b])&&(d[_[k]].push(_[b]),d[_[b]].push(_[k]))}var m=0;for(E=0;E<x.length;E++){var $=g.length,W=d[E],X=W.length;g[E*4+2]=$,g[E*4+3]=X,m=Math.max(m,X);for(var H=0;H<X;++H){var Q=W[H];g.push(+Q)}}for(;g.length%4!=0;)g.push(0);return{maxEdgePerVetex:m,array:new Float32Array(g)}};U.buildTextureData=A;var N=function(x,v,g,d){var _=[],E=[],w={},T=0;for(T=0;T<x.length;T++){var k=x[T];w[k.id]=T,_.push(k.x),_.push(k.y),_.push(0),_.push(0),E.push([])}for(T=0;T<v.length;T++){var b=v[T],m=(0,j.getEdgeTerminal)(b,"source"),$=(0,j.getEdgeTerminal)(b,"target");E[w[m]].push(w[$]),E[w[m]].push(g(b)),E[w[m]].push(d(b)),E[w[m]].push(0),E[w[$]].push(w[m]),E[w[$]].push(g(b)),E[w[$]].push(d(b)),E[w[$]].push(0)}var W=0;for(T=0;T<x.length;T++){var X=_.length,H=E[T],Q=H.length;_[T*4+2]=X+1048576*Q/4,_[T*4+3]=0,W=Math.max(W,Q/4);for(var q=0;q<Q;++q){var J=H[q];_.push(+J)}}for(;_.length%4!=0;)_.push(0);return{maxEdgePerVetex:W,array:new Float32Array(_)}};U.buildTextureDataWithTwoEdgeAttr=N;var L=function(x,v){var g=[],d=x.length,_={};return v.forEach(function(E){x.forEach(function(w,T){if(_[E[w]]===void 0&&(_[E[w]]=Object.keys(_).length),g.push(_[E[w]]),T===d-1)for(;g.length%4!=0;)g.push(0)})}),{array:new Float32Array(g),count:Object.keys(_).length}};U.attributesToTextureData=L;var y=function(x){for(var v=[],g=x.length,d=x[0].length,_=function(w){x.forEach(function(T,k){if(v.push(T[w]),k===g-1)for(;v.length%4!=0;)v.push(0)})},E=0;E<d;E++)_(E);return new Float32Array(v)};U.arrayToTextureData=y},8273:function(or,U,z){"use strict";var B=this&&this.__createBinding||(Object.create?function(R,A,N,L){L===void 0&&(L=N);var y=Object.getOwnPropertyDescriptor(A,N);(!y||("get"in y?!A.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return A[N]}}),Object.defineProperty(R,L,y)}:function(R,A,N,L){L===void 0&&(L=N),R[L]=A[N]}),j=this&&this.__exportStar||function(R,A){for(var N in R)N!=="default"&&!Object.prototype.hasOwnProperty.call(A,N)&&B(A,R,N)};Object.defineProperty(U,"__esModule",{value:!0}),j(z(42761),U),j(z(92272),U),j(z(5049),U),j(z(64446),U),j(z(98857),U),j(z(72612),U)},64446:function(or,U,z){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.getCoreNodeAndRelativeLeafNodes=U.getAvgNodePosition=U.getLayoutBBox=U.traverseTreeUp=U.scaleMatrix=U.getAdjMatrix=U.floydWarshall=U.getDegreeMap=U.getDegree=U.getEdgeTerminal=void 0;var B=z(92272),j=z(5049),R=z(98857),A=function(m,$){var W=m[$];return(0,R.isObject)(W)?W.cell:W};U.getEdgeTerminal=A;var N=function(m,$,W){for(var X=[],H=0;H<m;H++)X[H]={in:0,out:0,all:0};return W&&W.forEach(function(Q){var q=(0,U.getEdgeTerminal)(Q,"source"),J=(0,U.getEdgeTerminal)(Q,"target");q&&X[$[q]]&&(X[$[q]].out+=1,X[$[q]].all+=1),J&&X[$[J]]&&(X[$[J]].in+=1,X[$[J]].all+=1)}),X};U.getDegree=N;var L=function(m,$){var W={};return m.forEach(function(X){W[X.id]={in:0,out:0,all:0}}),$&&$.forEach(function(X){var H=(0,U.getEdgeTerminal)(X,"source"),Q=(0,U.getEdgeTerminal)(X,"target");H&&(W[H].out+=1,W[H].all+=1),Q&&(W[Q].in+=1,W[Q].all+=1)}),W};U.getDegreeMap=L;var y=function(m){for(var $=[],W=m.length,X=0;X<W;X+=1){$[X]=[];for(var H=0;H<W;H+=1)X===H?$[X][H]=0:m[X][H]===0||!m[X][H]?$[X][H]=Infinity:$[X][H]=m[X][H]}for(var Q=0;Q<W;Q+=1)for(var X=0;X<W;X+=1)for(var H=0;H<W;H+=1)$[X][H]>$[X][Q]+$[Q][H]&&($[X][H]=$[X][Q]+$[Q][H]);return $};U.floydWarshall=y;var x=function(m,$){var W=m.nodes,X=m.edges,H=[],Q={};if(!W)throw new Error("invalid nodes data!");return W&&W.forEach(function(q,J){Q[q.id]=J;var te=[];H.push(te)}),X==null||X.forEach(function(q){var J=(0,U.getEdgeTerminal)(q,"source"),te=(0,U.getEdgeTerminal)(q,"target"),fe=Q[J],de=Q[te];fe===void 0||de===void 0||(H[fe][de]=1,$||(H[de][fe]=1))}),H};U.getAdjMatrix=x;var v=function(m,$){var W=[];return m.forEach(function(X){var H=[];X.forEach(function(Q){H.push(Q*$)}),W.push(H)}),W};U.scaleMatrix=v;var g=function(m,$){if(m&&m.children){for(var W=m.children.length-1;W>=0;W--)if(!g(m.children[W],$))return}return!!$(m)},d=function(m,$){typeof $=="function"&&g(m,$)};U.traverseTreeUp=d;var _=function(m){var $=Infinity,W=Infinity,X=-Infinity,H=-Infinity;return m.forEach(function(Q){var q=Q.size;(0,B.isArray)(q)?q.length===1&&(q=[q[0],q[0]]):(0,j.isNumber)(q)?q=[q,q]:(q===void 0||isNaN(q))&&(q=[30,30]);var J=[q[0]/2,q[1]/2],te=Q.x-J[0],fe=Q.x+J[0],de=Q.y-J[1],Te=Q.y+J[1];$>te&&($=te),W>de&&(W=de),X<fe&&(X=fe),H<Te&&(H=Te)}),{minX:$,minY:W,maxX:X,maxY:H}};U.getLayoutBBox=_;var E=function(m){var $={x:0,y:0};m.forEach(function(X){$.x+=X.x||0,$.y+=X.y||0});var W=m.length||1;return{x:$.x/W,y:$.y/W}};U.getAvgNodePosition=E;var w=function(m,$,W){var X,H;return m==="source"?((X=W==null?void 0:W.find(function(Q){return Q.target===$.id}))===null||X===void 0?void 0:X.source)||{}:((H=W==null?void 0:W.find(function(Q){return Q.source===$.id}))===null||H===void 0?void 0:H.target)||{}},T=function(m,$,W){var X=[];switch(m){case"source":X=W==null?void 0:W.filter(function(Q){return Q.source===$.id}).map(function(Q){return Q.target});break;case"target":X=W==null?void 0:W.filter(function(Q){return Q.target===$.id}).map(function(Q){return Q.source});break;case"both":X=W==null?void 0:W.filter(function(Q){return Q.source===$.id}).map(function(Q){return Q.target}).concat(W==null?void 0:W.filter(function(Q){return Q.target===$.id}).map(function(Q){return Q.source}));break;default:break}var H=new Set(X);return Array.from(H)},k=function(m,$,W,X,H){var Q=W[$]||"",q=(X==null?void 0:X.filter(function(J){return J[$]===Q}))||[];return m==="leaf"&&(q=q.filter(function(J){var te,fe;return((te=H[J.id])===null||te===void 0?void 0:te.in)===0||((fe=H[J.id])===null||fe===void 0?void 0:fe.out)===0})),q},b=function(m,$,W,X,H,Q){var q=H[$.id],J=q.in,te=q.out,fe=$,de=[];J===0?(fe=w("source",$,W),de=T("both",fe,W).map(function(Se){return Q[Se]})):te===0&&(fe=w("target",$,W),de=T("both",fe,W).map(function(Se){return Q[Se]})),de=de.filter(function(Se){return H[Se.id]&&(H[Se.id].in===0||H[Se.id].out===0)});var Te=k(m,X,$,de,H);return{coreNode:fe,relativeLeafNodes:de,sameTypeLeafNodes:Te}};U.getCoreNodeAndRelativeLeafNodes=b},5049:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.toNumber=U.isNaN=U.isNumber=void 0;var z=function(R){return typeof R=="number"};U.isNumber=z;var B=function(R){return Number.isNaN(Number(R))};U.isNaN=B;var j=function(R){var A=parseFloat(R);return(0,U.isNaN)(A)?R:A};U.toNumber=j},98857:function(or,U){"use strict";var z=this&&this.__assign||function(){return z=Object.assign||function(R){for(var A,N=1,L=arguments.length;N<L;N++){A=arguments[N];for(var y in A)Object.prototype.hasOwnProperty.call(A,y)&&(R[y]=A[y])}return R},z.apply(this,arguments)};Object.defineProperty(U,"__esModule",{value:!0}),U.clone=U.isObject=void 0;var B=function(R){return R!==null&&typeof R=="object"};U.isObject=B;var j=function(R){if(R===null)return R;if(R instanceof Date)return new Date(R.getTime());if(R instanceof Array){var A=[];return R.forEach(function(L){A.push(L)}),A.map(function(L){return(0,U.clone)(L)})}if(typeof R=="object"&&Object.keys(R).length){var N=z({},R);return Object.keys(N).forEach(function(L){N[L]=(0,U.clone)(N[L])}),N}return R};U.clone=j},42761:function(or,U){"use strict";Object.defineProperty(U,"__esModule",{value:!0}),U.camelize=U.isString=void 0;var z=function(R){return typeof R=="string"};U.isString=z;var B=function(R){var A=Object.create(null);return function(N){var L=A[N];return L||(A[N]=R(N))}},j=/-(\w)/g;U.camelize=B(function(R){return R.replace(j,function(A,N){return N?N.toUpperCase():""})})},69787:function(or,U,z){"use strict";z.r(U),z.d(U,{Graph:function(){return Q},GraphWithEvent:function(){return nt},algorithm:function(){return B},comparision:function(){return R},essence:function(){return j},generate:function(){return A}});var B={};z.r(B),z.d(B,{components:function(){return Ct},dfs:function(){return rr},dijkstra:function(){return Sr},dijkstraAll:function(){return Gr},findCycles:function(){return $r},floydWarshall:function(){return he},isAcyclic:function(){return Dt},postorder:function(){return ne},preorder:function(){return P},prim:function(){return lt},tarjan:function(){return Gn},topsort:function(){return va}});var j={};z.r(j),z.d(j,{hasSelfLoop:function(){return Rn},isGraph:function(){return ta},isNullGraph:function(){return En},isSimpleGraph:function(){return kn}});var R={};z.r(R),z.d(R,{containAllSameEdges:function(){return $t},containAllSameNodes:function(){return Pt},containSameEdges:function(){return Ee},containSameNodes:function(){return xe},getSameEdges:function(){return Et},getSameNodes:function(){return Ne},isGraphComplement:function(){return Yn},isGraphContainsAnother:function(){return Br},isGraphOptionSame:function(){return st},isGraphSame:function(){return Ht}});var A={};z.r(A),z.d(A,{getGraphComplement:function(){return bn}});var N;(function(je){je.DEFAULT_EDGE_NAME="\0",je.GRAPH_NODE="\0",je.EDGE_KEY_DELIM=""})(N||(N={}));function L(je,Ce){var Xe=je.get(Ce)||0;je.set(Ce,Xe+1)}function y(je,Ce){var Xe=je.get(Ce);Xe!==void 0&&(Xe=Xe-1,Xe>0?je.set(Ce,Xe):je.delete(Ce))}function x(je,Ce,Xe,ut){var ot=String(Ce),bt=String(Xe);if(!je&&ot>bt){var Xt=ot;ot=bt,bt=Xt}return ot+N.EDGE_KEY_DELIM+bt+N.EDGE_KEY_DELIM+(ut===void 0?N.DEFAULT_EDGE_NAME:ut)}function v(je,Ce,Xe,ut){var ot=String(Ce),bt=String(Xe),Xt={v:Ce,w:Xe};if(!je&&ot>bt){var wr=Xt.v;Xt.v=Xt.w,Xt.w=wr}return ut!==void 0&&(Xt.name=ut),Xt}function g(je,Ce){return x(je,Ce.v,Ce.w,Ce.name)}function d(je){return typeof je=="function"}var _=function(Ce){return Ce.nodes().map(function(Xe){var ut=Ce.node(Xe),ot=Ce.parent(Xe),bt={id:Xe,value:ut,parent:ot};return bt.value===void 0&&delete bt.value,bt.parent===void 0&&delete bt.parent,bt})},E=function(Ce){return Ce.edges().map(function(Xe){var ut=Ce.edge(Xe),ot={v:Xe.v,w:Xe.w,value:ut,name:Xe.name};return ot.name===void 0&&delete ot.name,ot.value===void 0&&delete ot.value,ot})},w=function(Ce){var Xe={options:{directed:Ce.isDirected(),multigraph:Ce.isMultigraph(),compound:Ce.isCompound()},nodes:_(Ce),edges:E(Ce),value:Ce.graph()};return Xe.value===void 0&&delete Xe.value,Xe},T=function(Ce){var Xe=new Q(Ce.options);return Ce.value!==void 0&&Xe.setGraph(Ce.value),Ce.nodes.forEach(function(ut){Xe.setNode(ut.id,ut.value),ut.parent&&Xe.setParent(ut.id,ut.parent)}),Ce.edges.forEach(function(ut){Xe.setEdge(ut.v,ut.w,ut.value,ut.name)}),Xe};function k(je,Ce){var Xe=Object.keys(je);if(Object.getOwnPropertySymbols){var ut=Object.getOwnPropertySymbols(je);Ce&&(ut=ut.filter(function(ot){return Object.getOwnPropertyDescriptor(je,ot).enumerable})),Xe.push.apply(Xe,ut)}return Xe}function b(je){for(var Ce=1;Ce<arguments.length;Ce++){var Xe=arguments[Ce]!=null?arguments[Ce]:{};Ce%2?k(Object(Xe),!0).forEach(function(ut){m(je,ut,Xe[ut])}):Object.getOwnPropertyDescriptors?Object.defineProperties(je,Object.getOwnPropertyDescriptors(Xe)):k(Object(Xe)).forEach(function(ut){Object.defineProperty(je,ut,Object.getOwnPropertyDescriptor(Xe,ut))})}return je}function m(je,Ce,Xe){return Ce in je?Object.defineProperty(je,Ce,{value:Xe,enumerable:!0,configurable:!0,writable:!0}):je[Ce]=Xe,je}function $(je,Ce){if(!(je instanceof Ce))throw new TypeError("Cannot call a class as a function")}function W(je,Ce){for(var Xe=0;Xe<Ce.length;Xe++){var ut=Ce[Xe];ut.enumerable=ut.enumerable||!1,ut.configurable=!0,"value"in ut&&(ut.writable=!0),Object.defineProperty(je,ut.key,ut)}}function X(je,Ce,Xe){return Ce&&W(je.prototype,Ce),Xe&&W(je,Xe),Object.defineProperty(je,"prototype",{writable:!1}),je}var H={compound:!1,multigraph:!1,directed:!0},Q=function(){function je(){var Ce=this,Xe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$(this,je),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=N.GRAPH_NODE,this.label=void 0,this.nodeCountNum=0,this.edgeCountNum=0,this.defaultNodeLabelFn=function(){},this.defaultEdgeLabelFn=function(){},this.parentMap=void 0,this.childrenMap=void 0,this.nodesLabelMap=new Map,this.inEdgesMap=new Map,this.outEdgesMap=new Map,this.predecessorsMap=new Map,this.successorsMap=new Map,this.edgesMap=new Map,this.edgesLabelsMap=new Map,this.isDirected=function(){return Ce.directed},this.isMultigraph=function(){return Ce.multigraph},this.isCompound=function(){return Ce.compound},this.setGraph=function(ot){return Ce.label=ot,Ce},this.graph=function(){return Ce.label},this.setDefaultNodeLabel=function(ot){return d(ot)?Ce.defaultNodeLabelFn=ot:Ce.defaultNodeLabelFn=function(){return ot},Ce},this.nodeCount=function(){return Ce.nodeCountNum},this.node=function(ot){return Ce.nodesLabelMap.get(ot)},this.nodes=function(){return Array.from(Ce.nodesLabelMap.keys())},this.sources=function(){return Ce.nodes().filter(function(ot){var bt;return!((bt=Ce.inEdgesMap.get(ot))===null||bt===void 0?void 0:bt.size)})},this.sinks=function(){return Ce.nodes().filter(function(ot){var bt;return!((bt=Ce.outEdgesMap.get(ot))===null||bt===void 0?void 0:bt.size)})},this.setNodes=function(ot,bt){return ot.map(function(Xt){return Ce.setNode(Xt,bt)}),Ce},this.hasNode=function(ot){return Ce.nodesLabelMap.has(ot)},this.checkCompound=function(){if(!Ce.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(ot){if(Ce.isCompound()){var bt,Xt=(bt=Ce.parentMap)===null||bt===void 0?void 0:bt.get(ot);if(Xt!==Ce.GRAPH_NODE)return Xt}},this.removeFromParentsChildList=function(ot){var bt=Ce.parentMap.get(ot);Ce.childrenMap.get(bt).delete(ot)},this.setParent=function(ot,bt){var Xt,wr;Ce.checkCompound();for(var Wr=bt===void 0?Ce.GRAPH_NODE:bt,on=Ce.parent(Wr);on;){if(ot===on)throw new Error("Setting "+bt+" as parent of "+ot+" would create a cycle");on=Ce.parent(on)}bt&&Ce.setNode(bt),Ce.setNode(ot),Ce.removeFromParentsChildList(ot),(Xt=Ce.parentMap)===null||Xt===void 0||Xt.set(ot,Wr);var xn=Ce.childrenMap.get(Wr);return xn.set(ot,!0),(wr=Ce.childrenMap)===null||wr===void 0||wr.set(Wr,xn),Ce},this.children=function(ot){var bt=ot===void 0?Ce.GRAPH_NODE:ot;if(Ce.isCompound()){var Xt,wr=(Xt=Ce.childrenMap)===null||Xt===void 0?void 0:Xt.get(bt);return wr?Array.from(wr.keys()):void 0}if(bt===Ce.GRAPH_NODE)return Ce.nodes();if(ot&&Ce.hasNode(ot))return[]},this.predecessors=function(ot){var bt=Ce.predecessorsMap.get(ot);return bt?Array.from(bt.keys()):void 0},this.successors=function(ot){var bt=Ce.successorsMap.get(ot);return bt?Array.from(bt.keys()):void 0},this.neighbors=function(ot){var bt;if(!!Ce.hasNode(ot))return Array.from(new Set((bt=Ce.predecessors(ot))===null||bt===void 0?void 0:bt.concat(Ce.successors(ot))))},this.isLeaf=function(ot){var bt;if(Ce.isDirected()){var Xt;return!((Xt=Ce.successors(ot))===null||Xt===void 0?void 0:Xt.length)}return!((bt=Ce.neighbors(ot))===null||bt===void 0?void 0:bt.length)},this.filterNodes=function(ot){var bt=Ce.directed,Xt=Ce.multigraph,wr=Ce.compound,Wr=new je({directed:bt,multigraph:Xt,compound:wr});if(Wr.setGraph(Ce.graph()),Ce.nodes().forEach(function(xn){ot(xn)&&Wr.setNode(xn,Ce.node(xn))}),Ce.edges().forEach(function(xn){Wr.hasNode(xn.v)&&Wr.hasNode(xn.w)&&Wr.setEdgeObj(xn,Ce.edge(xn))}),wr){var on=function(zn){for(var Qn=Ce.parent(zn);Qn!==void 0&&!Wr.hasNode(Qn);)Qn=Ce.parent(Qn);return Qn};Wr.nodes().forEach(function(xn){Wr.setParent(xn,on(xn))})}return Wr},this.setDefaultEdgeLabel=function(ot){return d(ot)?Ce.defaultEdgeLabelFn=ot:Ce.defaultEdgeLabelFn=function(){return ot},Ce},this.edgeCount=function(){return Ce.edgeCountNum},this.setEdgeObj=function(ot,bt){return Ce.setEdge(ot.v,ot.w,bt,ot.name)},this.setPath=function(ot,bt){return ot.reduce(function(Xt,wr){return Ce.setEdge(Xt,wr,bt),wr}),Ce},this.edgeFromArgs=function(ot,bt,Xt){return Ce.edge({v:ot,w:bt,name:Xt})},this.edge=function(ot){return Ce.edgesLabelsMap.get(g(Ce.isDirected(),ot))},this.hasEdge=function(ot,bt,Xt){return Ce.edgesLabelsMap.has(g(Ce.isDirected(),{v:ot,w:bt,name:Xt}))},this.removeEdgeObj=function(ot){var bt=ot.v,Xt=ot.w,wr=ot.name;return Ce.removeEdge(bt,Xt,wr)},this.edges=function(){return Array.from(Ce.edgesMap.values())},this.inEdges=function(ot,bt){var Xt=Ce.inEdgesMap.get(ot);if(Xt)return Array.from(Xt.values()).filter(function(wr){return!bt||wr.v===bt})},this.outEdges=function(ot,bt){var Xt=Ce.outEdgesMap.get(ot);if(Xt)return Array.from(Xt.values()).filter(function(wr){return!bt||wr.w===bt})},this.nodeEdges=function(ot,bt){var Xt;if(!!Ce.hasNode(ot))return(Xt=Ce.inEdges(ot,bt))===null||Xt===void 0?void 0:Xt.concat(Ce.outEdges(ot,bt))},this.toJSON=function(){return w(Ce)},this.nodeInDegree=function(ot){var bt=Ce.inEdgesMap.get(ot);return bt?bt.size:0},this.nodeOutDegree=function(ot){var bt=Ce.outEdgesMap.get(ot);return bt?bt.size:0},this.nodeDegree=function(ot){return Ce.nodeInDegree(ot)+Ce.nodeOutDegree(ot)},this.source=function(ot){return ot.v},this.target=function(ot){return ot.w};var ut=b(b({},H),Xe);this.compound=ut.compound,this.directed=ut.directed,this.multigraph=ut.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return X(je,[{key:"setNode",value:function(Xe,ut){var ot=this.nodesLabelMap,bt=this.defaultNodeLabelFn,Xt=this.isCompound,wr=this.parentMap,Wr=this.childrenMap,on=this.inEdgesMap,xn=this.outEdgesMap,zn=this.predecessorsMap,Qn=this.successorsMap;if(ot.has(Xe))return ut!==void 0&&ot.set(Xe,ut),this;if(ot.set(Xe,ut||bt(Xe)),Xt()){var ia;wr==null||wr.set(Xe,this.GRAPH_NODE),Wr==null||Wr.set(Xe,new Map),(Wr==null?void 0:Wr.has(this.GRAPH_NODE))||Wr==null||Wr.set(this.GRAPH_NODE,new Map),Wr==null||(ia=Wr.get(this.GRAPH_NODE))===null||ia===void 0||ia.set(Xe,!0)}return[on,xn,zn,Qn].forEach(function(Wa){return Wa.set(Xe,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(Xe){var ut=this;if(this.hasNode(Xe)){var ot=function(Ba){ut.removeEdge(Ba.v,Ba.w,Ba.name)},bt=this.inEdgesMap,Xt=this.outEdgesMap,wr=this.predecessorsMap,Wr=this.successorsMap,on=this.nodesLabelMap;if(this.isCompound()){var xn,zn,Qn;this.removeFromParentsChildList(Xe),(xn=this.parentMap)===null||xn===void 0||xn.delete(Xe),(zn=this.children(Xe))===null||zn===void 0||zn.forEach(function(Ia){return ut.setParent(Ia)}),(Qn=this.childrenMap)===null||Qn===void 0||Qn.delete(Xe)}var ia=bt.get(Xe),Wa=Xt.get(Xe);Array.from(ia.values()).forEach(function(Ia){return ot(Ia)}),Array.from(Wa.values()).forEach(function(Ia){return ot(Ia)}),on.delete(Xe),bt.delete(Xe),Xt.delete(Xe),wr.delete(Xe),Wr.delete(Xe),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(Xe,ut,ot,bt){var Xt,wr,Wr=v(this.isDirected(),Xe,ut,bt),on=g(this.isDirected(),Wr),xn=Wr.v,zn=Wr.w;if(this.edgesLabelsMap.has(on))return this.edgesLabelsMap.set(on,ot),this;if(bt!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(xn),this.setNode(zn),this.edgesLabelsMap.set(on,ot||this.defaultEdgeLabelFn(xn,zn,bt)),Object.freeze(Wr),this.edgesMap.set(on,Wr);var Qn=this.predecessorsMap.get(zn),ia=this.successorsMap.get(xn);return L(Qn,xn),L(ia,zn),(Xt=this.inEdgesMap.get(zn))===null||Xt===void 0||Xt.set(on,Wr),(wr=this.outEdgesMap.get(xn))===null||wr===void 0||wr.set(on,Wr),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(Xe,ut,ot){var bt=x(this.isDirected(),Xe,ut,ot),Xt=this.edgesMap.get(bt);if(Xt){var wr=v(this.isDirected(),Xe,ut,ot),Wr=wr.v,on=wr.w;this.edgesLabelsMap.delete(bt),this.edgesMap.delete(bt);var xn=this.predecessorsMap.get(on),zn=this.successorsMap.get(Wr);y(xn,Wr),y(zn,on),this.inEdgesMap.get(on).delete(bt),this.outEdgesMap.get(Wr).delete(bt),this.edgeCountNum-=1}return this}}]),je}();Q.fromJSON=T;function q(je){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ce){return typeof Ce}:function(Ce){return Ce&&typeof Symbol=="function"&&Ce.constructor===Symbol&&Ce!==Symbol.prototype?"symbol":typeof Ce},q(je)}function J(je,Ce){if(!(je instanceof Ce))throw new TypeError("Cannot call a class as a function")}function te(je,Ce){for(var Xe=0;Xe<Ce.length;Xe++){var ut=Ce[Xe];ut.enumerable=ut.enumerable||!1,ut.configurable=!0,"value"in ut&&(ut.writable=!0),Object.defineProperty(je,ut.key,ut)}}function fe(je,Ce,Xe){return Ce&&te(je.prototype,Ce),Xe&&te(je,Xe),Object.defineProperty(je,"prototype",{writable:!1}),je}function de(){return typeof Reflect!="undefined"&&Reflect.get?de=Reflect.get:de=function(Ce,Xe,ut){var ot=Te(Ce,Xe);if(!!ot){var bt=Object.getOwnPropertyDescriptor(ot,Xe);return bt.get?bt.get.call(arguments.length<3?Ce:ut):bt.value}},de.apply(this,arguments)}function Te(je,Ce){for(;!Object.prototype.hasOwnProperty.call(je,Ce)&&(je=Ue(je),je!==null););return je}function Se(je,Ce){if(typeof Ce!="function"&&Ce!==null)throw new TypeError("Super expression must either be null or a function");je.prototype=Object.create(Ce&&Ce.prototype,{constructor:{value:je,writable:!0,configurable:!0}}),Object.defineProperty(je,"prototype",{writable:!1}),Ce&&Ie(je,Ce)}function Ie(je,Ce){return Ie=Object.setPrototypeOf||function(ut,ot){return ut.__proto__=ot,ut},Ie(je,Ce)}function be(je){var Ce=De();return function(){var ut=Ue(je),ot;if(Ce){var bt=Ue(this).constructor;ot=Reflect.construct(ut,arguments,bt)}else ot=ut.apply(this,arguments);return pe(this,ot)}}function pe(je,Ce){if(Ce&&(q(Ce)==="object"||typeof Ce=="function"))return Ce;if(Ce!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Me(je)}function Me(je){if(je===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return je}function De(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(je){return!1}}function Ue(je){return Ue=Object.setPrototypeOf?Object.getPrototypeOf:function(Xe){return Xe.__proto__||Object.getPrototypeOf(Xe)},Ue(je)}var nt=function(je){Se(Xe,je);var Ce=be(Xe);function Xe(){var ut;J(this,Xe);for(var ot=arguments.length,bt=new Array(ot),Xt=0;Xt<ot;Xt++)bt[Xt]=arguments[Xt];return ut=Ce.call.apply(Ce,[this].concat(bt)),ut.eventPool={},ut}return fe(Xe,[{key:"appendEvent",value:function(ot,bt){this.eventPool[ot]||(this.eventPool[ot]=[]),this.eventPool[ot].push(bt)}},{key:"removeEvent",value:function(ot,bt){if(!!this.eventPool[ot]){var Xt=this.eventPool[ot].indexOf(bt);Xt>-1&&this.eventPool[ot].splice(Xt,1)}}},{key:"emitEvent",value:function(ot){for(var bt=arguments.length,Xt=new Array(bt>1?bt-1:0),wr=1;wr<bt;wr++)Xt[wr-1]=arguments[wr];!this.eventPool[ot]||this.eventPool[ot].forEach(function(Wr){Wr.apply(void 0,Xt)})}},{key:"setNode",value:function(ot,bt){return de(Ue(Xe.prototype),"setNode",this).call(this,ot,bt),this.emitEvent("nodeAdd",ot,bt),this}},{key:"removeNode",value:function(ot){return de(Ue(Xe.prototype),"removeNode",this).call(this,ot),this.emitEvent("nodeRemove",ot),this}},{key:"setEdge",value:function(ot,bt,Xt,wr){return de(Ue(Xe.prototype),"setEdge",this).call(this,ot,bt,Xt,wr),this.emitEvent("edgeAdd",ot,bt,Xt,wr),this}},{key:"removeEdge",value:function(ot,bt,Xt){return de(Ue(Xe.prototype),"removeEdge",this).call(this,ot,bt,Xt),this.emitEvent("edgeRemove",ot,bt,Xt),this}}]),Xe}(Q);function Ze(je,Ce){for(var Xe=0;Xe<Ce.length;Xe++){var ut=Ce[Xe];ut.enumerable=ut.enumerable||!1,ut.configurable=!0,"value"in ut&&(ut.writable=!0),Object.defineProperty(je,ut.key,ut)}}function ht(je,Ce,Xe){return Ce&&Ze(je.prototype,Ce),Xe&&Ze(je,Xe),Object.defineProperty(je,"prototype",{writable:!1}),je}function Rt(je,Ce){if(!(je instanceof Ce))throw new TypeError("Cannot call a class as a function")}var tr=ht(function je(){var Ce=this;Rt(this,je),this.arr=[],this.keyIndice=new Map,this.size=function(){return Ce.arr.length},this.keys=function(){return Ce.arr.map(function(Xe){return Xe.key})},this.has=function(Xe){return Ce.keyIndice.has(Xe)},this.priority=function(Xe){var ut=Ce.keyIndice.get(Xe);if(ut!==void 0)return Ce.arr[ut].priority},this.swap=function(Xe,ut){var ot=Ce.arr,bt=Ce.keyIndice,Xt=[ot[Xe],ot[ut]],wr=Xt[0],Wr=Xt[1];ot[Xe]=Wr,ot[ut]=wr,bt.set(wr.key,ut),bt.set(Wr.key,Xe)},this.innerDecrease=function(Xe){for(var ut=Ce.arr,ot=ut[Xe].priority,bt,Xt=Xe;Xt!==0;){var wr;if(bt=Xt>>1,((wr=ut[bt])===null||wr===void 0?void 0:wr.priority)<ot)break;Ce.swap(Xt,bt),Xt=bt}},this.heapify=function(Xe){var ut=Ce.arr,ot=Xe<<1,bt=ot+1,Xt=Xe;ot<ut.length&&(Xt=ut[ot].priority<ut[Xt].priority?ot:Xt,bt<ut.length&&(Xt=ut[bt].priority<ut[Xt].priority?bt:Xt),Xt!==Xe&&(Ce.swap(Xe,Xt),Ce.heapify(Xt)))},this.min=function(){if(Ce.size()===0)throw new Error("Queue underflow");return Ce.arr[0].key},this.add=function(Xe,ut){var ot=Ce.keyIndice,bt=Ce.arr;if(!ot.has(Xe)){var Xt=bt.length;return ot.set(Xe,Xt),bt.push({key:Xe,priority:ut}),Ce.innerDecrease(Xt),!0}return!1},this.removeMin=function(){Ce.swap(0,Ce.arr.length-1);var Xe=Ce.arr.pop();return Ce.keyIndice.delete(Xe.key),Ce.heapify(0),Xe.key},this.decrease=function(Xe,ut){if(!Ce.has(Xe))throw new Error("There's no key named ".concat(Xe));var ot=Ce.keyIndice.get(Xe);if(ut>Ce.arr[ot].priority)throw new Error("New priority is greater than current priority.Key: ".concat(Xe," Old: + ").concat(Ce.arr[ot].priority," New: ").concat(ut));Ce.arr[ot].priority=ut,Ce.innerDecrease(ot)}}),Qe=function(Ce,Xe){var ut=new Q,ot=new Map,bt=new tr,Xt;function wr(xn){var zn=xn.v===Xt?xn.w:xn.v,Qn=bt.priority(zn);if(Qn!==void 0){var ia=Xe(xn);ia<Qn&&(ot.set(zn,Xt),bt.decrease(zn,ia))}}if(Ce.nodeCount()===0)return ut;Ce.nodes().forEach(function(xn){bt.add(xn,Number.POSITIVE_INFINITY),ut.setNode(xn)}),bt.decrease(Ce.nodes()[0],0);for(var Wr=!1;bt.size()>0;){var on;if(Xt=bt.removeMin(),ot.has(Xt))ut.setEdge(Xt,ot.get(Xt));else{if(Wr)throw new Error("Input graph is not connected: "+Ce.graph());Wr=!0}(on=Ce.nodeEdges(Xt))===null||on===void 0||on.forEach(wr)}return ut},lt=Qe,St=function(Ce){var Xe=new Set,ut=[],ot=Ce.nodes();return ot.forEach(function(bt){for(var Xt=[],wr=[bt];wr.length>0;){var Wr=wr.pop();if(!Xe.has(Wr)){var on,xn;Xe.add(Wr),Xt.push(Wr),(on=Ce.successors(Wr))===null||on===void 0||on.forEach(function(zn){return wr.push(zn)}),(xn=Ce.predecessors(Wr))===null||xn===void 0||xn.forEach(function(zn){return wr.push(zn)})}}Xt.length&&ut.push(Xt)}),ut},Ct=St,_t=function je(Ce,Xe,ut,ot,bt,Xt){ot.includes(Xe)||(ot.push(Xe),ut||Xt.push(Xe),bt(Xe).forEach(function(wr){return je(Ce,wr,ut,ot,bt,Xt)}),ut&&Xt.push(Xe))},pt=function(Ce,Xe,ut){var ot=Array.isArray(Xe)?Xe:[Xe],bt=function(on){return Ce.isDirected()?Ce.successors(on):Ce.neighbors(on)},Xt=[],wr=[];return ot.forEach(function(Wr){if(Ce.hasNode(Wr))_t(Ce,Wr,ut==="post",wr,bt,Xt);else throw new Error("Graph does not have node: "+Wr)}),Xt},rr=pt;function xr(je,Ce){return br(je)||qt(je,Ce)||ft(je,Ce)||Vt()}function Vt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
  615. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(je,Ce){if(!!je){if(typeof je=="string")return Bt(je,Ce);var Xe=Object.prototype.toString.call(je).slice(8,-1);if(Xe==="Object"&&je.constructor&&(Xe=je.constructor.name),Xe==="Map"||Xe==="Set")return Array.from(je);if(Xe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Xe))return Bt(je,Ce)}}function Bt(je,Ce){(Ce==null||Ce>je.length)&&(Ce=je.length);for(var Xe=0,ut=new Array(Ce);Xe<Ce;Xe++)ut[Xe]=je[Xe];return ut}function qt(je,Ce){var Xe=je==null?null:typeof Symbol!="undefined"&&je[Symbol.iterator]||je["@@iterator"];if(Xe!=null){var ut=[],ot=!0,bt=!1,Xt,wr;try{for(Xe=Xe.call(je);!(ot=(Xt=Xe.next()).done)&&(ut.push(Xt.value),!(Ce&&ut.length===Ce));ot=!0);}catch(Wr){bt=!0,wr=Wr}finally{try{!ot&&Xe.return!=null&&Xe.return()}finally{if(bt)throw wr}}return ut}}function br(je){if(Array.isArray(je))return je}var Ur=function(){return 1},Ae=function(Ce,Xe,ut,ot){return Hr(Ce,Xe,ut||Ur,ot||function(bt){return Ce.outEdges(bt)})},Hr=function(Ce,Xe,ut,ot){var bt=new Map,Xt=new tr,wr,Wr,on=function(Qn){var ia=Qn.v!==wr?Qn.v:Qn.w,Wa=bt.get(ia),Ia=ut(Qn),Ba=Wr.distance+Ia;if(Ia<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+Qn+" Weight: "+Ia);Ba<Wa.distance&&(Wa.distance=Ba,Wa.predecessor=wr,Xt.decrease(ia,Ba))};for(Ce.nodes().forEach(function(zn){var Qn=zn===Xe?0:Number.POSITIVE_INFINITY;bt.set(zn,{distance:Qn}),Xt.add(zn,Qn)});Xt.size()>0&&(wr=Xt.removeMin(),Wr=bt.get(wr),!(Wr&&Wr.distance===Number.POSITIVE_INFINITY));)ot(wr).forEach(on);var xn={};return Array.from(bt.entries()).forEach(function(zn){var Qn=xr(zn,2),ia=Qn[0],Wa=Qn[1];return xn[String(ia)]=Wa,xn}),xn},Sr=Ae,qr=function(Ce,Xe,ut){var ot={};return Ce.nodes().forEach(function(bt){return ot[String(bt)]=Sr(Ce,bt,Xe,ut),ot}),ot},Gr=qr,vn=function(Ce){var Xe=0,ut=[],ot=new Map,bt=[];function Xt(wr){var Wr,on={onStack:!0,lowlink:Xe,index:Xe};if(ot.set(wr,on),Xe+=1,ut.push(wr),(Wr=Ce.successors(wr))===null||Wr===void 0||Wr.forEach(function(ia){var Wa;if(ot.has(ia)){if((Wa=ot.get(ia))===null||Wa===void 0?void 0:Wa.onStack){var Ba=ot.get(ia);on.lowlink=Math.min(on.lowlink,Ba.index)}}else{Xt(ia);var Ia=ot.get(ia);on.lowlink=Math.min(on.lowlink,Ia.lowlink)}}),on.lowlink===on.index){var xn=[],zn;do{zn=ut.pop();var Qn=ot.get(zn);Qn.onStack=!1,xn.push(zn)}while(wr!==zn);bt.push(xn)}}return Ce.nodes().forEach(function(wr){ot.has(wr)||Xt(wr)}),bt},Gn=vn,mn=function(Ce){return Gn(Ce).filter(function(Xe){return Xe.length>1||Xe.length===1&&Ce.hasEdge(Xe[0],Xe[0])})},$r=mn;function gn(je){return gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ce){return typeof Ce}:function(Ce){return Ce&&typeof Symbol=="function"&&Ce.constructor===Symbol&&Ce!==Symbol.prototype?"symbol":typeof Ce},gn(je)}function Rr(je,Ce){for(var Xe=0;Xe<Ce.length;Xe++){var ut=Ce[Xe];ut.enumerable=ut.enumerable||!1,ut.configurable=!0,"value"in ut&&(ut.writable=!0),Object.defineProperty(je,ut.key,ut)}}function ct(je,Ce,Xe){return Ce&&Rr(je.prototype,Ce),Xe&&Rr(je,Xe),Object.defineProperty(je,"prototype",{writable:!1}),je}function Wt(je,Ce){if(!(je instanceof Ce))throw new TypeError("Cannot call a class as a function")}function Er(je,Ce){if(typeof Ce!="function"&&Ce!==null)throw new TypeError("Super expression must either be null or a function");je.prototype=Object.create(Ce&&Ce.prototype,{constructor:{value:je,writable:!0,configurable:!0}}),Object.defineProperty(je,"prototype",{writable:!1}),Ce&&Zr(je,Ce)}function Dr(je){var Ce=In();return function(){var ut=Pn(je),ot;if(Ce){var bt=Pn(this).constructor;ot=Reflect.construct(ut,arguments,bt)}else ot=ut.apply(this,arguments);return Vr(this,ot)}}function Vr(je,Ce){if(Ce&&(gn(Ce)==="object"||typeof Ce=="function"))return Ce;if(Ce!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pn(je)}function pn(je){if(je===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return je}function wn(je){var Ce=typeof Map=="function"?new Map:void 0;return wn=function(ut){if(ut===null||!$n(ut))return ut;if(typeof ut!="function")throw new TypeError("Super expression must either be null or a function");if(typeof Ce!="undefined"){if(Ce.has(ut))return Ce.get(ut);Ce.set(ut,ot)}function ot(){return Sn(ut,arguments,Pn(this).constructor)}return ot.prototype=Object.create(ut.prototype,{constructor:{value:ot,enumerable:!1,writable:!0,configurable:!0}}),Zr(ot,ut)},wn(je)}function Sn(je,Ce,Xe){return In()?Sn=Reflect.construct:Sn=function(ot,bt,Xt){var wr=[null];wr.push.apply(wr,bt);var Wr=Function.bind.apply(ot,wr),on=new Wr;return Xt&&Zr(on,Xt.prototype),on},Sn.apply(null,arguments)}function In(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(je){return!1}}function $n(je){return Function.toString.call(je).indexOf("[native code]")!==-1}function Zr(je,Ce){return Zr=Object.setPrototypeOf||function(ut,ot){return ut.__proto__=ot,ut},Zr(je,Ce)}function Pn(je){return Pn=Object.setPrototypeOf?Object.getPrototypeOf:function(Xe){return Xe.__proto__||Object.getPrototypeOf(Xe)},Pn(je)}var An=function(je){Er(Xe,je);var Ce=Dr(Xe);function Xe(){return Wt(this,Xe),Ce.apply(this,arguments)}return ct(Xe)}(wn(Error));function ln(je){var Ce=new Set,Xe=new Set,ut=[];function ot(bt){if(Xe.has(bt))throw new An;if(!Ce.has(bt)){var Xt;Xe.add(bt),Ce.add(bt),(Xt=je.predecessors(bt))===null||Xt===void 0||Xt.forEach(ot),Xe.delete(bt),ut.push(bt)}}if(je.sinks().forEach(ot),Ce.size!==je.nodeCount())throw new An;return ut}var va=ln,K=function(Ce){try{va(Ce)}catch(Xe){if(Xe instanceof An)return!1;throw Xe}return!0},Dt=K,rt=function(Ce,Xe){return rr(Ce,Xe,"post")},ne=rt,ae=function(Ce,Xe){return rr(Ce,Xe,"pre")},P=ae,S=function(){return 1};function C(je,Ce,Xe){return V(je,Ce||S,Xe||function(ut){return je.outEdges(ut)})}function V(je,Ce,Xe){var ut={},ot=je.nodes();return ot.forEach(function(bt){var Xt=String(bt);ut[Xt]={},ut[Xt][Xt]={distance:0},ot.forEach(function(wr){bt!==wr&&(ut[Xt][String(wr)]={distance:Number.POSITIVE_INFINITY})}),Xe(bt).forEach(function(wr){var Wr=wr.v===bt?wr.w:wr.v,on=Ce(wr);ut[Xt][String(Wr)]={distance:on,predecessor:bt}})}),ot.forEach(function(bt){var Xt=String(bt),wr=ut[Xt];ot.forEach(function(Wr){var on=String(Wr),xn=ut[on];ot.forEach(function(zn){var Qn=String(zn),ia=xn[Xt],Wa=wr[Qn],Ia=xn[Qn],Ba=ia.distance+Wa.distance;Ba<Ia.distance&&(Ia.distance=Ba,Ia.predecessor=Wa.predecessor)})})}),ut}var he=C,xe=function(Ce,Xe){for(var ut=Ce.nodes(),ot=0;ot<ut.length;ot++){var bt=ut[ot];if(Xe.hasNode(bt))return!0}return!1},Ee=function(Ce,Xe){for(var ut=Ce.edges(),ot=0;ot<ut.length;ot++){var bt=ut[ot];if(Xe.hasEdge(bt.v,bt.w,bt.name))return!0}return!1},Ne=function(Ce,Xe){var ut=Ce.nodes(),ot=ut.filter(function(bt){return Xe.hasNode(bt)});return ot},Et=function(Ce,Xe){var ut=Ce.edges(),ot=ut.filter(function(bt){return Xe.hasEdge(bt.v,bt.w,bt.name)});return ot},st=function(Ce,Xe){return Ce.isCompound()===Xe.isCompound()&&Ce.isDirected()===Xe.isDirected()&&Ce.isMultigraph()===Xe.isMultigraph()},Pt=function(Ce,Xe){var ut=Ne(Ce,Xe);return ut.length===Ce.nodes().length},$t=function(Ce,Xe){var ut=Et(Ce,Xe);return ut.length===Ce.edges().length},Ht=function(Ce,Xe){return st(Ce,Xe)&&Ce.nodeCount()===Xe.nodeCount()&&Pt(Ce,Xe)&&Ce.edgeCount()===Xe.edgeCount()&&$t(Ce,Xe)},Br=function(Ce,Xe){return Pt(Ce,Xe)&&$t(Ce,Xe)};function hn(je,Ce){return Nr(je)||en(je,Ce)||Qt(je,Ce)||Ot()}function Ot(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
  616. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qt(je,Ce){if(!!je){if(typeof je=="string")return pr(je,Ce);var Xe=Object.prototype.toString.call(je).slice(8,-1);if(Xe==="Object"&&je.constructor&&(Xe=je.constructor.name),Xe==="Map"||Xe==="Set")return Array.from(je);if(Xe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Xe))return pr(je,Ce)}}function pr(je,Ce){(Ce==null||Ce>je.length)&&(Ce=je.length);for(var Xe=0,ut=new Array(Ce);Xe<Ce;Xe++)ut[Xe]=je[Xe];return ut}function en(je,Ce){var Xe=je==null?null:typeof Symbol!="undefined"&&je[Symbol.iterator]||je["@@iterator"];if(Xe!=null){var ut=[],ot=!0,bt=!1,Xt,wr;try{for(Xe=Xe.call(je);!(ot=(Xt=Xe.next()).done)&&(ut.push(Xt.value),!(Ce&&ut.length===Ce));ot=!0);}catch(Wr){bt=!0,wr=Wr}finally{try{!ot&&Xe.return!=null&&Xe.return()}finally{if(bt)throw wr}}return ut}}function Nr(je){if(Array.isArray(je))return je}function ta(je){return je instanceof Q}function kn(je){if(je.isMultigraph())return!1;for(var Ce=je.edges(),Xe=new Map,ut=0;ut<Ce.length;ut++){var ot=Ce[ut];if(ot.v===ot.w)return!1;var bt=[ot.v,ot.w].sort(),Xt=hn(bt,2),wr=Xt[0],Wr=Xt[1],on="".concat(wr,"-").concat(Wr);if(Xe.has(on))return!1;Xe.set(on,!0)}return!0}function En(je){return je.nodes().length===0}function Rn(je){for(var Ce=je.edges(),Xe=0;Xe<Ce.length;Xe++){var ut=Ce[Xe];if(ut.v===ut.w)return!0}return!1}var Yn=function(Ce,Xe){if(!kn(Ce)||!kn(Xe)||!Pt(Ce,Xe)||Ee(Ce,Xe))return!1;var ut=Ce.nodeCount();return Ce.edgeCount()+Xe.edgeCount()===ut*(ut-1)/2},bn=function(Ce){if(!kn(Ce))return null;for(var Xe=Ce.nodeCount(),ut=new Q({compound:Ce.isCompound(),directed:Ce.isDirected(),multigraph:Ce.isMultigraph()}),ot=Ce.nodes(),bt=0;bt<Xe;bt++){var Xt=ot[bt];ut.setNode(Xt,Ce.node(Xt));for(var wr=bt+1;wr<Xe;wr++){var Wr=ot[wr];Ce.hasEdge(Xt,Wr)||ut.setEdge(Xt,Wr)}}return ut}},81746:function(or){(function(z,B){or.exports=B()})(typeof self!="undefined"?self:this,function(){return function(U){var z={};function B(j){if(z[j])return z[j].exports;var R=z[j]={i:j,l:!1,exports:{}};return U[j].call(R.exports,R,R.exports,B),R.l=!0,R.exports}return B.m=U,B.c=z,B.d=function(j,R,A){B.o(j,R)||Object.defineProperty(j,R,{configurable:!1,enumerable:!0,get:A})},B.n=function(j){var R=j&&j.__esModule?function(){return j.default}:function(){return j};return B.d(R,"a",R),R},B.o=function(j,R){return Object.prototype.hasOwnProperty.call(j,R)},B.p="",B(B.s=36)}([function(U,z,B){"use strict";var j=B(3);z.a=function(R){return Array.isArray?Array.isArray(R):Object(j.a)(R,"Array")}},function(U,z,B){"use strict";var j=function(R){return R!==null&&typeof R!="function"&&isFinite(R.length)};z.a=j},function(U,z,B){"use strict";var j=B(3);z.a=function(R){return Object(j.a)(R,"Function")}},function(U,z,B){"use strict";var j={}.toString,R=function(A,N){return j.call(A)==="[object "+N+"]"};z.a=R},function(U,z,B){"use strict";var j=B(3);z.a=function(R){return Object(j.a)(R,"String")}},function(U,z,B){"use strict";var j=B(3),R=function(A){return Object(j.a)(A,"Number")};z.a=R},function(U,z,B){var j=B(38),R=j.mix;function A(N,L,y,x){return x===void 0&&(x="height"),y==="center"?(N[x]+L[x])/2:N.height}U.exports={assign:R,getHeight:A}},function(U,z,B){"use strict";var j=function(R){return R==null};z.a=j},function(U,z,B){"use strict";var j=B(0),R=B(12);function A(N,L){if(!!N){var y;if(Object(j.a)(N))for(var x=0,v=N.length;x<v&&(y=L(N[x],x),y!==!1);x++);else if(Object(R.a)(N)){for(var g in N)if(N.hasOwnProperty(g)&&(y=L(N[g],g),y===!1))break}}}z.a=A},function(U,z,B){"use strict";var j=B(7);z.a=function(R){return Object(j.a)(R)?"":R.toString()}},function(U,z,B){"use strict";var j=B(14),R=B(3),A=function(N){if(!Object(j.a)(N)||!Object(R.a)(N,"Object"))return!1;if(Object.getPrototypeOf(N)===null)return!0;for(var L=N;Object.getPrototypeOf(L)!==null;)L=Object.getPrototypeOf(L);return Object.getPrototypeOf(N)===L};z.a=A},function(U,z,B){var j=B(18),R=function(){function A(L,y){y===void 0&&(y={});var x=this;x.options=y,x.rootNode=j(L,y)}var N=A.prototype;return N.execute=function(){throw new Error("please override this method")},A}();U.exports=R},function(U,z,B){"use strict";z.a=function(j){var R=typeof j;return j!==null&&R==="object"||R==="function"}},function(U,z,B){"use strict";var j=B(1),R=function(A,N){return Object(j.a)(A)?A.indexOf(N)>-1:!1};z.a=R},function(U,z,B){"use strict";var j=function(R){return typeof R=="object"&&R!==null};z.a=j},function(U,z,B){"use strict";var j=B(8),R=B(2),A=Object.values?function(N){return Object.values(N)}:function(N){var L=[];return Object(j.a)(N,function(y,x){Object(R.a)(N)&&x==="prototype"||L.push(y)}),L};z.a=A},function(U,z,B){"use strict";z.a=R;function j(A,N){for(var L in N)N.hasOwnProperty(L)&&L!=="constructor"&&N[L]!==void 0&&(A[L]=N[L])}function R(A,N,L,y){return N&&j(A,N),L&&j(A,L),y&&j(A,y),A}},function(U,z,B){var j=B(35),R=["LR","RL","TB","BT","H","V"],A=["LR","RL","H"],N=function(x){return A.indexOf(x)>-1},L=R[0];U.exports=function(y,x,v){var g=x.direction||L;if(x.isHorizontal=N(g),g&&R.indexOf(g)===-1)throw new TypeError("Invalid direction: "+g);if(g===R[0])v(y,x);else if(g===R[1])v(y,x),y.right2left();else if(g===R[2])v(y,x);else if(g===R[3])v(y,x),y.bottom2top();else if(g===R[4]||g===R[5]){var d=j(y,x),_=d.left,E=d.right;v(_,x),v(E,x),x.isHorizontal?_.right2left():_.bottom2top(),E.translate(_.x-E.x,_.y-E.y),y.x=_.x,y.y=E.y;var w=y.getBoundingBox();x.isHorizontal?w.top<0&&y.translate(0,-w.top):w.left<0&&y.translate(-w.left,0)}var T=x.fixedRoot;return T===void 0&&(T=!0),T&&y.translate(-(y.x+y.width/2+y.hgap),-(y.y+y.height/2+y.vgap)),y}},function(U,z,B){var j=B(6),R=18,A=R*2,N=R,L={getId:function(g){return g.id||g.name},getPreH:function(g){return g.preH||0},getPreV:function(g){return g.preV||0},getHGap:function(g){return g.hgap||N},getVGap:function(g){return g.vgap||N},getChildren:function(g){return g.children},getHeight:function(g){return g.height||A},getWidth:function(g){var d=g.label||" ";return g.width||d.split("").length*R}};function y(v,g){var d=this;if(d.vgap=d.hgap=0,v instanceof y)return v;d.data=v;var _=g.getHGap(v),E=g.getVGap(v);return d.preH=g.getPreH(v),d.preV=g.getPreV(v),d.width=g.getWidth(v),d.height=g.getHeight(v),d.width+=d.preH,d.height+=d.preV,d.id=g.getId(v),d.x=d.y=0,d.depth=0,d.children||(d.children=[]),d.addGap(_,E),d}j.assign(y.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(g,d){var _=this;_.hgap+=g,_.vgap+=d,_.width+=2*g,_.height+=2*d},eachNode:function(g){for(var d=this,_=[d],E;E=_.shift();)g(E),_=E.children.concat(_)},DFTraverse:function(g){this.eachNode(g)},BFTraverse:function(g){for(var d=this,_=[d],E;E=_.shift();)g(E),_=_.concat(E.children)},getBoundingBox:function(){var g={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(d){g.left=Math.min(g.left,d.x),g.top=Math.min(g.top,d.y),g.width=Math.max(g.width,d.x+d.width),g.height=Math.max(g.height,d.y+d.height)}),g},translate:function(g,d){g===void 0&&(g=0),d===void 0&&(d=0),this.eachNode(function(_){_.x+=g,_.y+=d,_.x+=_.preH,_.y+=_.preV})},right2left:function(){var g=this,d=g.getBoundingBox();g.eachNode(function(_){_.x=_.x-(_.x-d.left)*2-_.width}),g.translate(d.width,0)},bottom2top:function(){var g=this,d=g.getBoundingBox();g.eachNode(function(_){_.y=_.y-(_.y-d.top)*2-_.height}),g.translate(0,d.height)}});function x(v,g,d){g===void 0&&(g={}),g=j.assign({},L,g);var _=new y(v,g),E=[_],w;if(!d&&!v.collapsed){for(;w=E.shift();)if(!w.data.collapsed){var T=g.getChildren(w.data),k=T?T.length:0;if(w.children=new Array(k),T&&k)for(var b=0;b<k;b++){var m=new y(T[b],g);w.children[b]=m,E.push(m),m.parent=w,m.depth=w.depth+1}}}return _}U.exports=x},function(U,z,B){"use strict";var j=B(1),R=function(A,N){if(!Object(j.a)(A))return A;for(var L=[],y=0;y<A.length;y++){var x=A[y];N(x,y)&&L.push(x)}return L};z.a=R},function(U,z,B){"use strict";var j=B(7),R=B(21);function A(N,L){var y=Object(R.a)(L),x=y.length;if(Object(j.a)(N))return!x;for(var v=0;v<x;v+=1){var g=y[v];if(L[g]!==N[g]||!(g in N))return!1}return!0}z.a=A},function(U,z,B){"use strict";var j=B(8),R=B(2),A=Object.keys?function(N){return Object.keys(N)}:function(N){var L=[];return Object(j.a)(N,function(y,x){Object(R.a)(N)&&x==="prototype"||L.push(x)}),L};z.a=A},function(U,z,B){"use strict";var j=B(0);z.a=function(R){if(!!Object(j.a)(R))return R.reduce(function(A,N){return Math.max(A,N)},R[0])}},function(U,z,B){"use strict";var j=B(0);z.a=function(R){if(!!Object(j.a)(R))return R.reduce(function(A,N){return Math.min(A,N)},R[0])}},function(U,z,B){"use strict";var j=B(1),R=Array.prototype.splice,A=function(L,y){if(!Object(j.a)(L))return[];for(var x=L?y.length:0,v=x-1;x--;){var g=void 0,d=y[x];(x===v||d!==g)&&(g=d,R.call(L,d,1))}return L};z.a=A},function(U,z,B){"use strict";var j=B(8),R=B(0),A=B(10),N=function(L,y,x){if(!Object(R.a)(L)&&!Object(A.a)(L))return L;var v=x;return Object(j.a)(L,function(g,d){v=y(v,g,d)}),v};z.a=N},function(U,z,B){"use strict";z.a=j;function j(R,A){A===void 0&&(A=new Map);var N=[];if(Array.isArray(R))for(var L=0,y=R.length;L<y;L++){var x=R[L];A.has(x)||(N.push(x),A.set(x,!0))}return N}},function(U,z,B){"use strict";z.a=N;var j=B(0),R=B(2),A=B(28);function N(L,y){if(!y)return{0:L};if(!Object(R.a)(y)){var x=Object(j.a)(y)?y:y.replace(/\s+/g,"").split("*");y=function(v){for(var g="_",d=0,_=x.length;d<_;d++)g+=v[x[d]]&&v[x[d]].toString();return g}}return Object(A.a)(L,y)}},function(U,z,B){"use strict";var j=B(0),R=B(2),A=Object.prototype.hasOwnProperty;function N(L,y){if(!y||!Object(j.a)(L))return{};for(var x={},v=Object(R.a)(y)?y:function(E){return E[y]},g,d=0;d<L.length;d++){var _=L[d];g=v(_),A.call(x,g)?x[g].push(_):x[g]=[_]}return x}z.a=N},function(U,z,B){"use strict";z.a=function(j,R){return j.hasOwnProperty(R)}},function(U,z,B){"use strict";var j={}.toString,R=function(A){return j.call(A).replace(/^\[object /,"").replace(/]$/,"")};z.a=R},function(U,z,B){"use strict";var j=Object.prototype,R=function(A){var N=A&&A.constructor,L=typeof N=="function"&&N.prototype||j;return A===L};z.a=R},function(U,z,B){"use strict";var j=B(2);z.a=function(R,A){if(!Object(j.a)(R))throw new TypeError("Expected a function");var N=function(){for(var L=[],y=0;y<arguments.length;y++)L[y]=arguments[y];var x=A?A.apply(this,L):L[0],v=N.cache;if(v.has(x))return v.get(x);var g=R.apply(this,L);return v.set(x,g),g};return N.cache=new Map,N}},function(U,z,B){"use strict";var j=B(14),R=B(1),A=B(4),N=function(L,y){if(L===y)return!0;if(!L||!y||Object(A.a)(L)||Object(A.a)(y))return!1;if(Object(R.a)(L)||Object(R.a)(y)){if(L.length!==y.length)return!1;for(var x=!0,v=0;v<L.length&&(x=N(L[v],y[v]),!!x);v++);return x}if(Object(j.a)(L)||Object(j.a)(y)){var g=Object.keys(L),d=Object.keys(y);if(g.length!==d.length)return!1;for(var x=!0,v=0;v<g.length&&(x=N(L[g[v]],y[g[v]]),!!x);v++);return x}return!1};z.a=N},function(U,z,B){"use strict";var j=B(116),R=B(15),A=B(32),N=B(4),L;z.a=Object(A.a)(function(y,x){x===void 0&&(x={});var v=x.fontSize,g=x.fontFamily,d=x.fontWeight,_=x.fontStyle,E=x.fontVariant;return L||(L=document.createElement("canvas").getContext("2d")),L.font=[_,E,d,v+"px",g].join(" "),L.measureText(Object(N.a)(y)?y:"").width},function(y,x){return x===void 0&&(x={}),Object(j.a)([y],Object(R.a)(x)).join("")})},function(U,z,B){var j=B(18);U.exports=function(R,A){for(var N=j(R.data,A,!0),L=j(R.data,A,!0),y=R.children.length,x=Math.round(y/2),v=A.getSide||function(E,w){return w<x?"right":"left"},g=0;g<y;g++){var d=R.children[g],_=v(d,g);_==="right"?L.children.push(d):N.children.push(d)}return N.eachNode(function(E){E.isRoot()||(E.side="left")}),L.eachNode(function(E){E.isRoot()||(E.side="right")}),{left:N,right:L}}},function(U,z,B){var j={compactBox:B(37),dendrogram:B(120),indented:B(122),mindmap:B(124)};U.exports=j},function(U,z,B){function j(d,_){d.prototype=Object.create(_.prototype),d.prototype.constructor=d,R(d,_)}function R(d,_){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(w,T){return w.__proto__=T,w},R(d,_)}var A=B(11),N=B(119),L=B(17),y=B(6),x=function(d){j(_,d);function _(){return d.apply(this,arguments)||this}var E=_.prototype;return E.execute=function(){var T=this;return L(T.rootNode,T.options,N)},_}(A),v={};function g(d,_){return _=y.assign({},v,_),new x(d,_).execute()}U.exports=g},function(U,z,B){"use strict";Object.defineProperty(z,"__esModule",{value:!0});var j=B(13);B.d(z,"contains",function(){return j.a}),B.d(z,"includes",function(){return j.a});var R=B(39);B.d(z,"difference",function(){return R.a});var A=B(40);B.d(z,"find",function(){return A.a});var N=B(41);B.d(z,"findIndex",function(){return N.a});var L=B(42);B.d(z,"firstValue",function(){return L.a});var y=B(43);B.d(z,"flatten",function(){return y.a});var x=B(44);B.d(z,"flattenDeep",function(){return x.a});var v=B(45);B.d(z,"getRange",function(){return v.a});var g=B(46);B.d(z,"pull",function(){return g.a});var d=B(24);B.d(z,"pullAt",function(){return d.a});var _=B(25);B.d(z,"reduce",function(){return _.a});var E=B(47);B.d(z,"remove",function(){return E.a});var w=B(48);B.d(z,"sortBy",function(){return w.a});var T=B(49);B.d(z,"union",function(){return T.a});var k=B(26);B.d(z,"uniq",function(){return k.a});var b=B(50);B.d(z,"valuesOfKey",function(){return b.a});var m=B(51);B.d(z,"head",function(){return m.a});var $=B(52);B.d(z,"last",function(){return $.a});var W=B(53);B.d(z,"startsWith",function(){return W.a});var X=B(54);B.d(z,"endsWith",function(){return X.a});var H=B(19);B.d(z,"filter",function(){return H.a});var Q=B(55);B.d(z,"every",function(){return Q.a});var q=B(56);B.d(z,"some",function(){return q.a});var J=B(57);B.d(z,"group",function(){return J.a});var te=B(28);B.d(z,"groupBy",function(){return te.a});var fe=B(27);B.d(z,"groupToMap",function(){return fe.a});var de=B(58);B.d(z,"getWrapBehavior",function(){return de.a});var Te=B(59);B.d(z,"wrapBehavior",function(){return Te.a});var Se=B(60);B.d(z,"number2color",function(){return Se.a});var Ie=B(61);B.d(z,"parseRadius",function(){return Ie.a});var be=B(62);B.d(z,"clamp",function(){return be.a});var pe=B(63);B.d(z,"fixedBase",function(){return pe.a});var Me=B(64);B.d(z,"isDecimal",function(){return Me.a});var De=B(65);B.d(z,"isEven",function(){return De.a});var Ue=B(66);B.d(z,"isInteger",function(){return Ue.a});var nt=B(67);B.d(z,"isNegative",function(){return nt.a});var Ze=B(68);B.d(z,"isNumberEqual",function(){return Ze.a});var ht=B(69);B.d(z,"isOdd",function(){return ht.a});var Rt=B(70);B.d(z,"isPositive",function(){return Rt.a});var tr=B(22);B.d(z,"max",function(){return tr.a});var Qe=B(71);B.d(z,"maxBy",function(){return Qe.a});var lt=B(23);B.d(z,"min",function(){return lt.a});var St=B(72);B.d(z,"minBy",function(){return St.a});var Ct=B(73);B.d(z,"mod",function(){return Ct.a});var _t=B(74);B.d(z,"toDegree",function(){return _t.a});var pt=B(75);B.d(z,"toInteger",function(){return pt.a});var rr=B(76);B.d(z,"toRadian",function(){return rr.a});var xr=B(77);B.d(z,"forIn",function(){return xr.a});var Vt=B(29);B.d(z,"has",function(){return Vt.a});var ft=B(78);B.d(z,"hasKey",function(){return ft.a});var Bt=B(79);B.d(z,"hasValue",function(){return Bt.a});var qt=B(21);B.d(z,"keys",function(){return qt.a});var br=B(20);B.d(z,"isMatch",function(){return br.a});var Ur=B(15);B.d(z,"values",function(){return Ur.a});var Ae=B(80);B.d(z,"lowerCase",function(){return Ae.a});var Hr=B(81);B.d(z,"lowerFirst",function(){return Hr.a});var Sr=B(82);B.d(z,"substitute",function(){return Sr.a});var qr=B(83);B.d(z,"upperCase",function(){return qr.a});var Gr=B(84);B.d(z,"upperFirst",function(){return Gr.a});var vn=B(30);B.d(z,"getType",function(){return vn.a});var Gn=B(85);B.d(z,"isArguments",function(){return Gn.a});var mn=B(0);B.d(z,"isArray",function(){return mn.a});var $r=B(1);B.d(z,"isArrayLike",function(){return $r.a});var gn=B(86);B.d(z,"isBoolean",function(){return gn.a});var Rr=B(87);B.d(z,"isDate",function(){return Rr.a});var ct=B(88);B.d(z,"isError",function(){return ct.a});var Wt=B(2);B.d(z,"isFunction",function(){return Wt.a});var Er=B(89);B.d(z,"isFinite",function(){return Er.a});var Dr=B(7);B.d(z,"isNil",function(){return Dr.a});var Vr=B(90);B.d(z,"isNull",function(){return Vr.a});var pn=B(5);B.d(z,"isNumber",function(){return pn.a});var wn=B(12);B.d(z,"isObject",function(){return wn.a});var Sn=B(14);B.d(z,"isObjectLike",function(){return Sn.a});var In=B(10);B.d(z,"isPlainObject",function(){return In.a});var $n=B(31);B.d(z,"isPrototype",function(){return $n.a});var Zr=B(91);B.d(z,"isRegExp",function(){return Zr.a});var Pn=B(4);B.d(z,"isString",function(){return Pn.a});var An=B(3);B.d(z,"isType",function(){return An.a});var ln=B(92);B.d(z,"isUndefined",function(){return ln.a});var va=B(93);B.d(z,"isElement",function(){return va.a});var K=B(94);B.d(z,"requestAnimationFrame",function(){return K.a});var Dt=B(95);B.d(z,"clearAnimationFrame",function(){return Dt.a});var rt=B(96);B.d(z,"augment",function(){return rt.a});var ne=B(97);B.d(z,"clone",function(){return ne.a});var ae=B(98);B.d(z,"debounce",function(){return ae.a});var P=B(32);B.d(z,"memoize",function(){return P.a});var S=B(99);B.d(z,"deepMix",function(){return S.a});var C=B(8);B.d(z,"each",function(){return C.a});var V=B(100);B.d(z,"extend",function(){return V.a});var he=B(101);B.d(z,"indexOf",function(){return he.a});var xe=B(102);B.d(z,"isEmpty",function(){return xe.a});var Ee=B(33);B.d(z,"isEqual",function(){return Ee.a});var Ne=B(103);B.d(z,"isEqualWith",function(){return Ne.a});var Et=B(104);B.d(z,"map",function(){return Et.a});var st=B(105);B.d(z,"mapValues",function(){return st.a});var Pt=B(16);B.d(z,"mix",function(){return Pt.a}),B.d(z,"assign",function(){return Pt.a});var $t=B(106);B.d(z,"get",function(){return $t.a});var Ht=B(107);B.d(z,"set",function(){return Ht.a});var Br=B(108);B.d(z,"pick",function(){return Br.a});var hn=B(109);B.d(z,"omit",function(){return hn.a});var Ot=B(110);B.d(z,"throttle",function(){return Ot.a});var Qt=B(111);B.d(z,"toArray",function(){return Qt.a});var pr=B(9);B.d(z,"toString",function(){return pr.a});var en=B(112);B.d(z,"uniqueId",function(){return en.a});var Nr=B(113);B.d(z,"noop",function(){return Nr.a});var ta=B(114);B.d(z,"identity",function(){return ta.a});var kn=B(115);B.d(z,"size",function(){return kn.a});var En=B(34);B.d(z,"measureTextWidth",function(){return En.a});var Rn=B(117);B.d(z,"getEllipsisText",function(){return Rn.a});var Yn=B(118);B.d(z,"Cache",function(){return Yn.a})},function(U,z,B){"use strict";var j=B(19),R=B(13),A=function(N,L){return L===void 0&&(L=[]),Object(j.a)(N,function(y){return!Object(R.a)(L,y)})};z.a=A},function(U,z,B){"use strict";var j=B(2),R=B(20),A=B(0),N=B(10);function L(y,x){if(!Object(A.a)(y))return null;var v;if(Object(j.a)(x)&&(v=x),Object(N.a)(x)&&(v=function(d){return Object(R.a)(d,x)}),v){for(var g=0;g<y.length;g+=1)if(v(y[g]))return y[g]}return null}z.a=L},function(U,z,B){"use strict";function j(R,A,N){N===void 0&&(N=0);for(var L=N;L<R.length;L++)if(A(R[L],L))return L;return-1}z.a=j},function(U,z,B){"use strict";var j=B(7),R=B(0),A=function(N,L){for(var y=null,x=0;x<N.length;x++){var v=N[x],g=v[L];if(!Object(j.a)(g)){Object(R.a)(g)?y=g[0]:y=g;break}}return y};z.a=A},function(U,z,B){"use strict";var j=B(0),R=function(A){if(!Object(j.a)(A))return[];for(var N=[],L=0;L<A.length;L++)N=N.concat(A[L]);return N};z.a=R},function(U,z,B){"use strict";var j=B(0),R=function(A,N){if(N===void 0&&(N=[]),!Object(j.a)(A))N.push(A);else for(var L=0;L<A.length;L+=1)R(A[L],N);return N};z.a=R},function(U,z,B){"use strict";var j=B(0),R=B(22),A=B(23),N=function(L){var y=L.filter(function(_){return!isNaN(_)});if(!y.length)return{min:0,max:0};if(Object(j.a)(L[0])){for(var x=[],v=0;v<L.length;v++)x=x.concat(L[v]);y=x}var g=Object(R.a)(y),d=Object(A.a)(y);return{min:d,max:g}};z.a=N},function(U,z,B){"use strict";var j=Array.prototype,R=j.splice,A=j.indexOf,N=function(L){for(var y=[],x=1;x<arguments.length;x++)y[x-1]=arguments[x];for(var v=0;v<y.length;v++)for(var g=y[v],d=-1;(d=A.call(L,g))>-1;)R.call(L,d,1);return L};z.a=N},function(U,z,B){"use strict";var j=B(1),R=B(24),A=function(N,L){var y=[];if(!Object(j.a)(N))return y;for(var x=-1,v=[],g=N.length;++x<g;){var d=N[x];L(d,x,N)&&(y.push(d),v.push(x))}return Object(R.a)(N,v),y};z.a=A},function(U,z,B){"use strict";var j=B(0),R=B(4),A=B(2);function N(L,y){var x;if(Object(A.a)(y))x=function(g,d){return y(g)-y(d)};else{var v=[];Object(R.a)(y)?v.push(y):Object(j.a)(y)&&(v=y),x=function(g,d){for(var _=0;_<v.length;_+=1){var E=v[_];if(g[E]>d[E])return 1;if(g[E]<d[E])return-1}return 0}}return L.sort(x),L}z.a=N},function(U,z,B){"use strict";var j=B(26),R=function(){for(var A=[],N=0;N<arguments.length;N++)A[N]=arguments[N];return Object(j.a)([].concat.apply([],A))};z.a=R},function(U,z,B){"use strict";var j=B(0),R=B(7);z.a=function(A,N){for(var L=[],y={},x=0;x<A.length;x++){var v=A[x],g=v[N];if(!Object(R.a)(g)){Object(j.a)(g)||(g=[g]);for(var d=0;d<g.length;d++){var _=g[d];y[_]||(L.push(_),y[_]=!0)}}}return L}},function(U,z,B){"use strict";z.a=R;var j=B(1);function R(A){if(Object(j.a)(A))return A[0]}},function(U,z,B){"use strict";z.a=R;var j=B(1);function R(A){if(Object(j.a)(A)){var N=A;return N[N.length-1]}}},function(U,z,B){"use strict";var j=B(0),R=B(4);function A(N,L){return Object(j.a)(N)||Object(R.a)(N)?N[0]===L:!1}z.a=A},function(U,z,B){"use strict";var j=B(0),R=B(4);function A(N,L){return Object(j.a)(N)||Object(R.a)(N)?N[N.length-1]===L:!1}z.a=A},function(U,z,B){"use strict";var j=function(R,A){for(var N=0;N<R.length;N++)if(!A(R[N],N))return!1;return!0};z.a=j},function(U,z,B){"use strict";var j=function(R,A){for(var N=0;N<R.length;N++)if(A(R[N],N))return!0;return!1};z.a=j},function(U,z,B){"use strict";var j=B(27);z.a=function(R,A){if(!A)return[R];var N=Object(j.a)(R,A),L=[];for(var y in N)L.push(N[y]);return L}},function(U,z,B){"use strict";function j(R,A){return R["_wrap_"+A]}z.a=j},function(U,z,B){"use strict";function j(R,A){if(R["_wrap_"+A])return R["_wrap_"+A];var N=function(L){R[A](L)};return R["_wrap_"+A]=N,N}z.a=j},function(U,z,B){"use strict";var j={};function R(A){var N=j[A];if(!N){for(var L=A.toString(16),y=L.length;y<6;y++)L="0"+L;N="#"+L,j[A]=N}return N}z.a=R},function(U,z,B){"use strict";var j=B(0);function R(A){var N=0,L=0,y=0,x=0;return Object(j.a)(A)?A.length===1?N=L=y=x=A[0]:A.length===2?(N=y=A[0],L=x=A[1]):A.length===3?(N=A[0],L=x=A[1],y=A[2]):(N=A[0],L=A[1],y=A[2],x=A[3]):N=L=y=x=A,{r1:N,r2:L,r3:y,r4:x}}z.a=R},function(U,z,B){"use strict";var j=function(R,A,N){return R<A?A:R>N?N:R};z.a=j},function(U,z,B){"use strict";var j=function(R,A){var N=A.toString(),L=N.indexOf(".");if(L===-1)return Math.round(R);var y=N.substr(L+1).length;return y>20&&(y=20),parseFloat(R.toFixed(y))};z.a=j},function(U,z,B){"use strict";var j=B(5),R=function(A){return Object(j.a)(A)&&A%1!=0};z.a=R},function(U,z,B){"use strict";var j=B(5),R=function(A){return Object(j.a)(A)&&A%2==0};z.a=R},function(U,z,B){"use strict";var j=B(5),R=Number.isInteger?Number.isInteger:function(A){return Object(j.a)(A)&&A%1==0};z.a=R},function(U,z,B){"use strict";var j=B(5),R=function(A){return Object(j.a)(A)&&A<0};z.a=R},function(U,z,B){"use strict";z.a=R;var j=1e-5;function R(A,N,L){return L===void 0&&(L=j),Math.abs(A-N)<L}},function(U,z,B){"use strict";var j=B(5),R=function(A){return Object(j.a)(A)&&A%2!=0};z.a=R},function(U,z,B){"use strict";var j=B(5),R=function(A){return Object(j.a)(A)&&A>0};z.a=R},function(U,z,B){"use strict";var j=B(0),R=B(2);z.a=function(A,N){if(!!Object(j.a)(A)){for(var L,y=-Infinity,x=0;x<A.length;x++){var v=A[x],g=Object(R.a)(N)?N(v):v[N];g>y&&(L=v,y=g)}return L}}},function(U,z,B){"use strict";var j=B(0),R=B(2);z.a=function(A,N){if(!!Object(j.a)(A)){for(var L,y=Infinity,x=0;x<A.length;x++){var v=A[x],g=Object(R.a)(N)?N(v):v[N];g<y&&(L=v,y=g)}return L}}},function(U,z,B){"use strict";var j=function(R,A){return(R%A+A)%A};z.a=j},function(U,z,B){"use strict";var j=180/Math.PI,R=function(A){return j*A};z.a=R},function(U,z,B){"use strict";z.a=parseInt},function(U,z,B){"use strict";var j=Math.PI/180,R=function(A){return j*A};z.a=R},function(U,z,B){"use strict";var j=B(8);z.a=j.a},function(U,z,B){"use strict";var j=B(29);z.a=j.a},function(U,z,B){"use strict";var j=B(13),R=B(15);z.a=function(A,N){return Object(j.a)(Object(R.a)(A),N)}},function(U,z,B){"use strict";var j=B(9),R=function(A){return Object(j.a)(A).toLowerCase()};z.a=R},function(U,z,B){"use strict";var j=B(9),R=function(A){var N=Object(j.a)(A);return N.charAt(0).toLowerCase()+N.substring(1)};z.a=R},function(U,z,B){"use strict";function j(R,A){return!R||!A?R:R.replace(/\\?\{([^{}]+)\}/g,function(N,L){return N.charAt(0)==="\\"?N.slice(1):A[L]===void 0?"":A[L]})}z.a=j},function(U,z,B){"use strict";var j=B(9),R=function(A){return Object(j.a)(A).toUpperCase()};z.a=R},function(U,z,B){"use strict";var j=B(9),R=function(A){var N=Object(j.a)(A);return N.charAt(0).toUpperCase()+N.substring(1)};z.a=R},function(U,z,B){"use strict";var j=B(3),R=function(A){return Object(j.a)(A,"Arguments")};z.a=R},function(U,z,B){"use strict";var j=B(3),R=function(A){return Object(j.a)(A,"Boolean")};z.a=R},function(U,z,B){"use strict";var j=B(3),R=function(A){return Object(j.a)(A,"Date")};z.a=R},function(U,z,B){"use strict";var j=B(3),R=function(A){return Object(j.a)(A,"Error")};z.a=R},function(U,z,B){"use strict";var j=B(5);z.a=function(R){return Object(j.a)(R)&&isFinite(R)}},function(U,z,B){"use strict";var j=function(R){return R===null};z.a=j},function(U,z,B){"use strict";var j=B(3),R=function(A){return Object(j.a)(A,"RegExp")};z.a=R},function(U,z,B){"use strict";var j=function(R){return R===void 0};z.a=j},function(U,z,B){"use strict";var j=function(R){return R instanceof Element||R instanceof HTMLDocument};z.a=j},function(U,z,B){"use strict";z.a=j;function j(R){var A=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(N){return setTimeout(N,16)};return A(R)}},function(U,z,B){"use strict";z.a=j;function j(R){var A=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame||clearTimeout;A(R)}},function(U,z,B){"use strict";var j=B(16),R=B(2),A=function(){for(var N=[],L=0;L<arguments.length;L++)N[L]=arguments[L];for(var y=N[0],x=1;x<N.length;x++){var v=N[x];Object(R.a)(v)&&(v=v.prototype),Object(j.a)(y.prototype,v)}};z.a=A},function(U,z,B){"use strict";var j=B(0),R=function(A){if(typeof A!="object"||A===null)return A;var N;if(Object(j.a)(A)){N=[];for(var L=0,y=A.length;L<y;L++)typeof A[L]=="object"&&A[L]!=null?N[L]=R(A[L]):N[L]=A[L]}else{N={};for(var x in A)typeof A[x]=="object"&&A[x]!=null?N[x]=R(A[x]):N[x]=A[x]}return N};z.a=R},function(U,z,B){"use strict";function j(R,A,N){var L;return function(){var y=this,x=arguments,v=function(){L=null,N||R.apply(y,x)},g=N&&!L;clearTimeout(L),L=setTimeout(v,A),g&&R.apply(y,x)}}z.a=j},function(U,z,B){"use strict";var j=B(0),R=B(10),A=5;function N(y,x,v,g){v=v||0,g=g||A;for(var d in x)if(x.hasOwnProperty(d)){var _=x[d];_!==null&&Object(R.a)(_)?(Object(R.a)(y[d])||(y[d]={}),v<g?N(y[d],_,v+1,g):y[d]=x[d]):Object(j.a)(_)?(y[d]=[],y[d]=y[d].concat(_)):_!==void 0&&(y[d]=_)}}var L=function(y){for(var x=[],v=1;v<arguments.length;v++)x[v-1]=arguments[v];for(var g=0;g<x.length;g+=1)N(y,x[g]);return y};z.a=L},function(U,z,B){"use strict";var j=B(16),R=B(2),A=function(N,L,y,x){Object(R.a)(L)||(y=L,L=N,N=function(){});var v=Object.create?function(d,_){return Object.create(d,{constructor:{value:_}})}:function(d,_){function E(){}E.prototype=d;var w=new E;return w.constructor=_,w},g=v(L.prototype,N);return N.prototype=Object(j.a)(g,N.prototype),N.superclass=v(L.prototype,L),Object(j.a)(g,y),Object(j.a)(N,x),N};z.a=A},function(U,z,B){"use strict";var j=B(1),R=function(A,N){if(!Object(j.a)(A))return-1;var L=Array.prototype.indexOf;if(L)return L.call(A,N);for(var y=-1,x=0;x<A.length;x++)if(A[x]===N){y=x;break}return y};z.a=R},function(U,z,B){"use strict";var j=B(7),R=B(1),A=B(30),N=B(31),L=Object.prototype.hasOwnProperty;function y(x){if(Object(j.a)(x))return!0;if(Object(R.a)(x))return!x.length;var v=Object(A.a)(x);if(v==="Map"||v==="Set")return!x.size;if(Object(N.a)(x))return!Object.keys(x).length;for(var g in x)if(L.call(x,g))return!1;return!0}z.a=y},function(U,z,B){"use strict";var j=B(2),R=B(33);z.a=function(A,N,L){return Object(j.a)(L)?!!L(A,N):Object(R.a)(A,N)}},function(U,z,B){"use strict";var j=B(1),R=function(A,N){if(!Object(j.a)(A))return A;for(var L=[],y=0;y<A.length;y++){var x=A[y];L.push(N(x,y))}return L};z.a=R},function(U,z,B){"use strict";var j=B(7),R=B(12),A=function(N){return N};z.a=function(N,L){L===void 0&&(L=A);var y={};return Object(R.a)(N)&&!Object(j.a)(N)&&Object.keys(N).forEach(function(x){y[x]=L(N[x],x)}),y}},function(U,z,B){"use strict";var j=B(4);z.a=function(R,A,N){for(var L=0,y=Object(j.a)(A)?A.split("."):A;R&&L<y.length;)R=R[y[L++]];return R===void 0||L<y.length?N:R}},function(U,z,B){"use strict";var j=B(12),R=B(4),A=B(5);z.a=function(N,L,y){var x=N,v=Object(R.a)(L)?L.split("."):L;return v.forEach(function(g,d){d<v.length-1?(Object(j.a)(x[g])||(x[g]=Object(A.a)(v[d+1])?[]:{}),x=x[g]):x[g]=y}),N}},function(U,z,B){"use strict";var j=B(8),R=B(10),A=Object.prototype.hasOwnProperty;z.a=function(N,L){if(N===null||!Object(R.a)(N))return{};var y={};return Object(j.a)(L,function(x){A.call(N,x)&&(y[x]=N[x])}),y}},function(U,z,B){"use strict";var j=B(25);z.a=function(R,A){return Object(j.a)(R,function(N,L,y){return A.includes(y)||(N[y]=L),N},{})}},function(U,z,B){"use strict";z.a=function(j,R,A){var N,L,y,x,v=0;A||(A={});var g=function(){v=A.leading===!1?0:Date.now(),N=null,x=j.apply(L,y),N||(L=y=null)},d=function(){var _=Date.now();!v&&A.leading===!1&&(v=_);var E=R-(_-v);return L=this,y=arguments,E<=0||E>R?(N&&(clearTimeout(N),N=null),v=_,x=j.apply(L,y),N||(L=y=null)):!N&&A.trailing!==!1&&(N=setTimeout(g,E)),x};return d.cancel=function(){clearTimeout(N),v=0,N=L=y=null},d}},function(U,z,B){"use strict";var j=B(1);z.a=function(R){return Object(j.a)(R)?Array.prototype.slice.call(R):[]}},function(U,z,B){"use strict";var j={};z.a=function(R){return R=R||"g",j[R]?j[R]+=1:j[R]=1,R+j[R]}},function(U,z,B){"use strict";z.a=function(){}},function(U,z,B){"use strict";z.a=function(j){return j}},function(U,z,B){"use strict";z.a=A;var j=B(7),R=B(1);function A(N){return Object(j.a)(N)?0:Object(R.a)(N)?N.length:Object.keys(N).length}},function(U,z,B){"use strict";z.a=W;var j=function(pe,Me){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(De,Ue){De.__proto__=Ue}||function(De,Ue){for(var nt in Ue)Object.prototype.hasOwnProperty.call(Ue,nt)&&(De[nt]=Ue[nt])},j(pe,Me)};function R(pe,Me){if(typeof Me!="function"&&Me!==null)throw new TypeError("Class extends value "+String(Me)+" is not a constructor or null");j(pe,Me);function De(){this.constructor=pe}pe.prototype=Me===null?Object.create(Me):(De.prototype=Me.prototype,new De)}var A=function(){return A=Object.assign||function(Me){for(var De,Ue=1,nt=arguments.length;Ue<nt;Ue++){De=arguments[Ue];for(var Ze in De)Object.prototype.hasOwnProperty.call(De,Ze)&&(Me[Ze]=De[Ze])}return Me},A.apply(this,arguments)};function N(pe,Me){var De={};for(var Ue in pe)Object.prototype.hasOwnProperty.call(pe,Ue)&&Me.indexOf(Ue)<0&&(De[Ue]=pe[Ue]);if(pe!=null&&typeof Object.getOwnPropertySymbols=="function")for(var nt=0,Ue=Object.getOwnPropertySymbols(pe);nt<Ue.length;nt++)Me.indexOf(Ue[nt])<0&&Object.prototype.propertyIsEnumerable.call(pe,Ue[nt])&&(De[Ue[nt]]=pe[Ue[nt]]);return De}function L(pe,Me,De,Ue){var nt=arguments.length,Ze=nt<3?Me:Ue===null?Ue=Object.getOwnPropertyDescriptor(Me,De):Ue,ht;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Ze=Reflect.decorate(pe,Me,De,Ue);else for(var Rt=pe.length-1;Rt>=0;Rt--)(ht=pe[Rt])&&(Ze=(nt<3?ht(Ze):nt>3?ht(Me,De,Ze):ht(Me,De))||Ze);return nt>3&&Ze&&Object.defineProperty(Me,De,Ze),Ze}function y(pe,Me){return function(De,Ue){Me(De,Ue,pe)}}function x(pe,Me,De,Ue,nt,Ze){function ht(Vt){if(Vt!==void 0&&typeof Vt!="function")throw new TypeError("Function expected");return Vt}for(var Rt=Ue.kind,tr=Rt==="getter"?"get":Rt==="setter"?"set":"value",Qe=!Me&&pe?Ue.static?pe:pe.prototype:null,lt=Me||(Qe?Object.getOwnPropertyDescriptor(Qe,Ue.name):{}),St,Ct=!1,_t=De.length-1;_t>=0;_t--){var pt={};for(var rr in Ue)pt[rr]=rr==="access"?{}:Ue[rr];for(var rr in Ue.access)pt.access[rr]=Ue.access[rr];pt.addInitializer=function(Vt){if(Ct)throw new TypeError("Cannot add initializers after decoration has completed");Ze.push(ht(Vt||null))};var xr=(0,De[_t])(Rt==="accessor"?{get:lt.get,set:lt.set}:lt[tr],pt);if(Rt==="accessor"){if(xr===void 0)continue;if(xr===null||typeof xr!="object")throw new TypeError("Object expected");(St=ht(xr.get))&&(lt.get=St),(St=ht(xr.set))&&(lt.set=St),(St=ht(xr.init))&&nt.push(St)}else(St=ht(xr))&&(Rt==="field"?nt.push(St):lt[tr]=St)}Qe&&Object.defineProperty(Qe,Ue.name,lt),Ct=!0}function v(pe,Me,De){for(var Ue=arguments.length>2,nt=0;nt<Me.length;nt++)De=Ue?Me[nt].call(pe,De):Me[nt].call(pe);return Ue?De:void 0}function g(pe){return typeof pe=="symbol"?pe:"".concat(pe)}function d(pe,Me,De){return typeof Me=="symbol"&&(Me=Me.description?"[".concat(Me.description,"]"):""),Object.defineProperty(pe,"name",{configurable:!0,value:De?"".concat(De," ",Me):Me})}function _(pe,Me){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(pe,Me)}function E(pe,Me,De,Ue){function nt(Ze){return Ze instanceof De?Ze:new De(function(ht){ht(Ze)})}return new(De||(De=Promise))(function(Ze,ht){function Rt(lt){try{Qe(Ue.next(lt))}catch(St){ht(St)}}function tr(lt){try{Qe(Ue.throw(lt))}catch(St){ht(St)}}function Qe(lt){lt.done?Ze(lt.value):nt(lt.value).then(Rt,tr)}Qe((Ue=Ue.apply(pe,Me||[])).next())})}function w(pe,Me){var De={label:0,sent:function(){if(Ze[0]&1)throw Ze[1];return Ze[1]},trys:[],ops:[]},Ue,nt,Ze,ht;return ht={next:Rt(0),throw:Rt(1),return:Rt(2)},typeof Symbol=="function"&&(ht[Symbol.iterator]=function(){return this}),ht;function Rt(Qe){return function(lt){return tr([Qe,lt])}}function tr(Qe){if(Ue)throw new TypeError("Generator is already executing.");for(;ht&&(ht=0,Qe[0]&&(De=0)),De;)try{if(Ue=1,nt&&(Ze=Qe[0]&2?nt.return:Qe[0]?nt.throw||((Ze=nt.return)&&Ze.call(nt),0):nt.next)&&!(Ze=Ze.call(nt,Qe[1])).done)return Ze;switch(nt=0,Ze&&(Qe=[Qe[0]&2,Ze.value]),Qe[0]){case 0:case 1:Ze=Qe;break;case 4:return De.label++,{value:Qe[1],done:!1};case 5:De.label++,nt=Qe[1],Qe=[0];continue;case 7:Qe=De.ops.pop(),De.trys.pop();continue;default:if(Ze=De.trys,!(Ze=Ze.length>0&&Ze[Ze.length-1])&&(Qe[0]===6||Qe[0]===2)){De=0;continue}if(Qe[0]===3&&(!Ze||Qe[1]>Ze[0]&&Qe[1]<Ze[3])){De.label=Qe[1];break}if(Qe[0]===6&&De.label<Ze[1]){De.label=Ze[1],Ze=Qe;break}if(Ze&&De.label<Ze[2]){De.label=Ze[2],De.ops.push(Qe);break}Ze[2]&&De.ops.pop(),De.trys.pop();continue}Qe=Me.call(pe,De)}catch(lt){Qe=[6,lt],nt=0}finally{Ue=Ze=0}if(Qe[0]&5)throw Qe[1];return{value:Qe[0]?Qe[1]:void 0,done:!0}}}var T=Object.create?function(pe,Me,De,Ue){Ue===void 0&&(Ue=De);var nt=Object.getOwnPropertyDescriptor(Me,De);(!nt||("get"in nt?!Me.__esModule:nt.writable||nt.configurable))&&(nt={enumerable:!0,get:function(){return Me[De]}}),Object.defineProperty(pe,Ue,nt)}:function(pe,Me,De,Ue){Ue===void 0&&(Ue=De),pe[Ue]=Me[De]};function k(pe,Me){for(var De in pe)De!=="default"&&!Object.prototype.hasOwnProperty.call(Me,De)&&T(Me,pe,De)}function b(pe){var Me=typeof Symbol=="function"&&Symbol.iterator,De=Me&&pe[Me],Ue=0;if(De)return De.call(pe);if(pe&&typeof pe.length=="number")return{next:function(){return pe&&Ue>=pe.length&&(pe=void 0),{value:pe&&pe[Ue++],done:!pe}}};throw new TypeError(Me?"Object is not iterable.":"Symbol.iterator is not defined.")}function m(pe,Me){var De=typeof Symbol=="function"&&pe[Symbol.iterator];if(!De)return pe;var Ue=De.call(pe),nt,Ze=[],ht;try{for(;(Me===void 0||Me-- >0)&&!(nt=Ue.next()).done;)Ze.push(nt.value)}catch(Rt){ht={error:Rt}}finally{try{nt&&!nt.done&&(De=Ue.return)&&De.call(Ue)}finally{if(ht)throw ht.error}}return Ze}function $(){for(var pe=[],Me=0;Me<arguments.length;Me++)pe=pe.concat(m(arguments[Me]));return pe}function W(){for(var pe=0,Me=0,De=arguments.length;Me<De;Me++)pe+=arguments[Me].length;for(var Ue=Array(pe),nt=0,Me=0;Me<De;Me++)for(var Ze=arguments[Me],ht=0,Rt=Ze.length;ht<Rt;ht++,nt++)Ue[nt]=Ze[ht];return Ue}function X(pe,Me,De){if(De||arguments.length===2)for(var Ue=0,nt=Me.length,Ze;Ue<nt;Ue++)(Ze||!(Ue in Me))&&(Ze||(Ze=Array.prototype.slice.call(Me,0,Ue)),Ze[Ue]=Me[Ue]);return pe.concat(Ze||Array.prototype.slice.call(Me))}function H(pe){return this instanceof H?(this.v=pe,this):new H(pe)}function Q(pe,Me,De){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Ue=De.apply(pe,Me||[]),nt,Ze=[];return nt={},ht("next"),ht("throw"),ht("return"),nt[Symbol.asyncIterator]=function(){return this},nt;function ht(Ct){Ue[Ct]&&(nt[Ct]=function(_t){return new Promise(function(pt,rr){Ze.push([Ct,_t,pt,rr])>1||Rt(Ct,_t)})})}function Rt(Ct,_t){try{tr(Ue[Ct](_t))}catch(pt){St(Ze[0][3],pt)}}function tr(Ct){Ct.value instanceof H?Promise.resolve(Ct.value.v).then(Qe,lt):St(Ze[0][2],Ct)}function Qe(Ct){Rt("next",Ct)}function lt(Ct){Rt("throw",Ct)}function St(Ct,_t){Ct(_t),Ze.shift(),Ze.length&&Rt(Ze[0][0],Ze[0][1])}}function q(pe){var Me,De;return Me={},Ue("next"),Ue("throw",function(nt){throw nt}),Ue("return"),Me[Symbol.iterator]=function(){return this},Me;function Ue(nt,Ze){Me[nt]=pe[nt]?function(ht){return(De=!De)?{value:H(pe[nt](ht)),done:!1}:Ze?Ze(ht):ht}:Ze}}function J(pe){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Me=pe[Symbol.asyncIterator],De;return Me?Me.call(pe):(pe=typeof b=="function"?b(pe):pe[Symbol.iterator](),De={},Ue("next"),Ue("throw"),Ue("return"),De[Symbol.asyncIterator]=function(){return this},De);function Ue(Ze){De[Ze]=pe[Ze]&&function(ht){return new Promise(function(Rt,tr){ht=pe[Ze](ht),nt(Rt,tr,ht.done,ht.value)})}}function nt(Ze,ht,Rt,tr){Promise.resolve(tr).then(function(Qe){Ze({value:Qe,done:Rt})},ht)}}function te(pe,Me){return Object.defineProperty?Object.defineProperty(pe,"raw",{value:Me}):pe.raw=Me,pe}var fe=Object.create?function(pe,Me){Object.defineProperty(pe,"default",{enumerable:!0,value:Me})}:function(pe,Me){pe.default=Me};function de(pe){if(pe&&pe.__esModule)return pe;var Me={};if(pe!=null)for(var De in pe)De!=="default"&&Object.prototype.hasOwnProperty.call(pe,De)&&T(Me,pe,De);return fe(Me,pe),Me}function Te(pe){return pe&&pe.__esModule?pe:{default:pe}}function Se(pe,Me,De,Ue){if(De==="a"&&!Ue)throw new TypeError("Private accessor was defined without a getter");if(typeof Me=="function"?pe!==Me||!Ue:!Me.has(pe))throw new TypeError("Cannot read private member from an object whose class did not declare it");return De==="m"?Ue:De==="a"?Ue.call(pe):Ue?Ue.value:Me.get(pe)}function Ie(pe,Me,De,Ue,nt){if(Ue==="m")throw new TypeError("Private method is not writable");if(Ue==="a"&&!nt)throw new TypeError("Private accessor was defined without a setter");if(typeof Me=="function"?pe!==Me||!nt:!Me.has(pe))throw new TypeError("Cannot write private member to an object whose class did not declare it");return Ue==="a"?nt.call(pe,De):nt?nt.value=De:Me.set(pe,De),De}function be(pe,Me){if(Me===null||typeof Me!="object"&&typeof Me!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof pe=="function"?Me===pe:pe.has(Me)}},function(U,z,B){"use strict";var j=B(4),R=B(9),A=B(34);z.a=function(N,L,y,x){x===void 0&&(x="...");var v=16,g=Object(A.a)(x,y),d=Object(j.a)(N)?N:Object(R.a)(N),_=L,E=[],w,T;if(Object(A.a)(N,y)<=L)return N;for(;w=d.substr(0,v),T=Object(A.a)(w,y),!(T+g>_&&T>_);)if(E.push(w),_-=T,d=d.substr(v),!d)return E.join("");for(;w=d.substr(0,1),T=Object(A.a)(w,y),!(T+g>_);)if(E.push(w),_-=T,d=d.substr(1),!d)return E.join("");return""+E.join("")+x}},function(U,z,B){"use strict";var j=function(){function R(){this.map={}}return R.prototype.has=function(A){return this.map[A]!==void 0},R.prototype.get=function(A,N){var L=this.map[A];return L===void 0?N:L},R.prototype.set=function(A,N){this.map[A]=N},R.prototype.clear=function(){this.map={}},R.prototype.delete=function(A){delete this.map[A]},R.prototype.size=function(){return Object.keys(this.map).length},R}();z.a=j},function(U,z){function B(y,x,v,g){g===void 0&&(g=[]);var d=this;d.w=y||0,d.h=x||0,d.y=v||0,d.x=0,d.c=g||[],d.cs=g.length,d.prelim=0,d.mod=0,d.shift=0,d.change=0,d.tl=null,d.tr=null,d.el=null,d.er=null,d.msel=0,d.mser=0}B.fromNode=function(y,x){if(!y)return null;var v=[];return y.children.forEach(function(g){v.push(B.fromNode(g,x))}),x?new B(y.height,y.width,y.x,v):new B(y.width,y.height,y.y,v)};function j(y,x,v){v?y.y+=x:y.x+=x,y.children.forEach(function(g){j(g,x,v)})}function R(y,x){var v=x?y.y:y.x;return y.children.forEach(function(g){v=Math.min(R(g,x),v)}),v}function A(y,x){var v=R(y,x);j(y,-v,x)}function N(y,x,v){v?x.y=y.x:x.x=y.x,y.c.forEach(function(g,d){N(g,x.children[d],v)})}function L(y,x,v){v===void 0&&(v=0),x?(y.x=v,v+=y.width):(y.y=v,v+=y.height),y.children.forEach(function(g){L(g,x,v)})}U.exports=function(y,x){x===void 0&&(x={});var v=x.isHorizontal;function g(J){if(J.cs===0){d(J);return}g(J.c[0]);for(var te=Q(k(J.c[0].el),0,null),fe=1;fe<J.cs;++fe){g(J.c[fe]);var de=k(J.c[fe].er);_(J,fe,te),te=Q(de,fe,te)}$(J),d(J)}function d(J){J.cs===0?(J.el=J,J.er=J,J.msel=J.mser=0):(J.el=J.c[0].el,J.msel=J.c[0].msel,J.er=J.c[J.cs-1].er,J.mser=J.c[J.cs-1].mser)}function _(J,te,fe){for(var de=J.c[te-1],Te=de.mod,Se=J.c[te],Ie=Se.mod;de!==null&&Se!==null;){k(de)>fe.low&&(fe=fe.nxt);var be=Te+de.prelim+de.w-(Ie+Se.prelim);be>0&&(Ie+=be,E(J,te,fe.index,be));var pe=k(de),Me=k(Se);pe<=Me&&(de=T(de),de!==null&&(Te+=de.mod)),pe>=Me&&(Se=w(Se),Se!==null&&(Ie+=Se.mod))}!de&&!!Se?b(J,te,Se,Ie):!!de&&!Se&&m(J,te,de,Te)}function E(J,te,fe,de){J.c[te].mod+=de,J.c[te].msel+=de,J.c[te].mser+=de,X(J,te,fe,de)}function w(J){return J.cs===0?J.tl:J.c[0]}function T(J){return J.cs===0?J.tr:J.c[J.cs-1]}function k(J){return J.y+J.h}function b(J,te,fe,de){var Te=J.c[0].el;Te.tl=fe;var Se=de-fe.mod-J.c[0].msel;Te.mod+=Se,Te.prelim-=Se,J.c[0].el=J.c[te].el,J.c[0].msel=J.c[te].msel}function m(J,te,fe,de){var Te=J.c[te].er;Te.tr=fe;var Se=de-fe.mod-J.c[te].mser;Te.mod+=Se,Te.prelim-=Se,J.c[te].er=J.c[te-1].er,J.c[te].mser=J.c[te-1].mser}function $(J){J.prelim=(J.c[0].prelim+J.c[0].mod+J.c[J.cs-1].mod+J.c[J.cs-1].prelim+J.c[J.cs-1].w)/2-J.w/2}function W(J,te){te+=J.mod,J.x=J.prelim+te,H(J);for(var fe=0;fe<J.cs;fe++)W(J.c[fe],te)}function X(J,te,fe,de){if(fe!==te-1){var Te=te-fe;J.c[fe+1].shift+=de/Te,J.c[te].shift-=de/Te,J.c[te].change-=de-de/Te}}function H(J){for(var te=0,fe=0,de=0;de<J.cs;de++)te+=J.c[de].shift,fe+=te+J.c[de].change,J.c[de].mod+=fe}function Q(J,te,fe){for(;fe!==null&&J>=fe.low;)fe=fe.nxt;return{low:J,index:te,nxt:fe}}L(y,v);var q=B.fromNode(y,v);return g(q),W(q,0),N(q,y,v),A(y,v),y}},function(U,z,B){function j(d,_){d.prototype=Object.create(_.prototype),d.prototype.constructor=d,R(d,_)}function R(d,_){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(w,T){return w.__proto__=T,w},R(d,_)}var A=B(11),N=B(121),L=B(17),y=B(6),x=function(d){j(_,d);function _(){return d.apply(this,arguments)||this}var E=_.prototype;return E.execute=function(){var T=this;return T.rootNode.width=0,L(T.rootNode,T.options,N)},_}(A),v={};function g(d,_){return _=y.assign({},v,_),new x(d,_).execute()}U.exports=g},function(U,z,B){var j=B(6);function R(L,y){L===void 0&&(L=0),y===void 0&&(y=[]);var x=this;x.x=x.y=0,x.leftChild=x.rightChild=null,x.height=0,x.children=y}var A={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function N(L,y,x){x?(y.x=L.x,y.y=L.y):(y.x=L.y,y.y=L.x),L.children.forEach(function(v,g){N(v,y.children[g],x)})}U.exports=function(L,y){y===void 0&&(y={}),y=j.assign({},A,y);var x=0;function v(w){if(!w)return null;w.width=0,w.depth&&w.depth>x&&(x=w.depth);var T=w.children,k=T.length,b=new R(w.height,[]);return T.forEach(function(m,$){var W=v(m);b.children.push(W),$===0&&(b.leftChild=W),$===k-1&&(b.rightChild=W)}),b.originNode=w,b.isLeaf=w.isLeaf(),b}function g(w){if(w.isLeaf||w.children.length===0)w.drawingDepth=x;else{var T=w.children.map(function(b){return g(b)}),k=Math.min.apply(null,T);w.drawingDepth=k-1}return w.drawingDepth}var d;function _(w){w.x=w.drawingDepth*y.rankSep,w.isLeaf?(w.y=0,d&&(w.y=d.y+d.height+y.nodeSep,w.originNode.parent!==d.originNode.parent&&(w.y+=y.subTreeSep)),d=w):(w.children.forEach(function(T){_(T)}),w.y=(w.leftChild.y+w.rightChild.y)/2)}var E=v(L);return g(E),_(E),N(E,L,y.isHorizontal),L}},function(U,z,B){function j(E,w){E.prototype=Object.create(w.prototype),E.prototype.constructor=E,R(E,w)}function R(E,w){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(k,b){return k.__proto__=b,k},R(E,w)}var A=B(11),N=B(123),L=B(35),y=B(6),x=["LR","RL","H"],v=x[0],g=function(E){j(w,E);function w(){return E.apply(this,arguments)||this}var T=w.prototype;return T.execute=function(){var b=this,m=b.options,$=b.rootNode;m.isHorizontal=!0;var W=m.indent,X=W===void 0?20:W,H=m.dropCap,Q=H===void 0?!0:H,q=m.direction,J=q===void 0?v:q,te=m.align;if(J&&x.indexOf(J)===-1)throw new TypeError("Invalid direction: "+J);if(J===x[0])N($,X,Q,te);else if(J===x[1])N($,X,Q,te),$.right2left();else if(J===x[2]){var fe=L($,m),de=fe.left,Te=fe.right;N(de,X,Q,te),de.right2left(),N(Te,X,Q,te);var Se=de.getBoundingBox();Te.translate(Se.width,0),$.x=Te.x-$.width/2}return $},w}(A),d={};function _(E,w){return w=y.assign({},d,w),new g(E,w).execute()}U.exports=_},function(U,z,B){var j=B(6);function R(A,N,L,y,x){var v=typeof L=="function"?L(A):L*A.depth;if(!y)try{if(A.id===A.parent.children[0].id){A.x+=v,A.y=N?N.y:0;return}}catch(_){}if(A.x+=v,N){if(A.y=N.y+j.getHeight(N,A,x),N.parent&&A.parent.id!==N.parent.id){var g=N.parent,d=g.y+j.getHeight(g,A,x);A.y=d>A.y?d:A.y}}else A.y=0}U.exports=function(A,N,L,y){var x=null;A.eachNode(function(v){R(v,x,N,L,y),x=v})}},function(U,z,B){function j(d,_){d.prototype=Object.create(_.prototype),d.prototype.constructor=d,R(d,_)}function R(d,_){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(w,T){return w.__proto__=T,w},R(d,_)}var A=B(11),N=B(125),L=B(17),y=B(6),x=function(d){j(_,d);function _(){return d.apply(this,arguments)||this}var E=_.prototype;return E.execute=function(){var T=this;return L(T.rootNode,T.options,N)},_}(A),v={};function g(d,_){return _=y.assign({},v,_),new x(d,_).execute()}U.exports=g},function(U,z,B){var j=B(6);function R(L,y){var x=0;return L.children.length?L.children.forEach(function(v){x+=R(v,y)}):x=L.height,L._subTreeSep=y.getSubTreeSep(L.data),L.totalHeight=Math.max(L.height,x)+2*L._subTreeSep,L.totalHeight}function A(L){var y=L.children,x=y.length;if(x){y.forEach(function(w){A(w)});var v=y[0],g=y[x-1],d=g.y-v.y+g.height,_=0;if(y.forEach(function(w){_+=w.totalHeight}),d>L.height)L.y=v.y+d/2-L.height/2;else if(y.length!==1||L.height>_){var E=L.y+(L.height-d)/2-v.y;y.forEach(function(w){w.translate(0,E)})}else L.y=(v.y+v.height/2+g.y+g.height/2)/2-L.height/2}}var N={getSubTreeSep:function(){return 0}};U.exports=function(L,y){y===void 0&&(y={}),y=j.assign({},N,y),L.parent={x:0,width:0,height:0,y:0},L.BFTraverse(function(x){x.x=x.parent.x+x.parent.width}),L.parent=null,R(L,y),L.startY=0,L.y=L.totalHeight/2-L.height/2,L.eachNode(function(x){var v=x.children,g=v.length;if(g){var d=v[0];if(d.startY=x.startY+x._subTreeSep,g===1)d.y=x.y+x.height/2-d.height/2;else{d.y=d.startY+d.totalHeight/2-d.height/2;for(var _=1;_<g;_++){var E=v[_];E.startY=v[_-1].startY+v[_-1].totalHeight,E.y=E.startY+E.totalHeight/2-E.height/2}}}}),A(L)}}])})},31278:function(or,U,z){"use strict";var B;B={value:!0};var j=z(64530);function R(d,_,E){var w=[0,0,0,0,0,0,0,0,0];return j.mat3.fromTranslation(w,E),j.mat3.multiply(d,w,_)}B=R;function A(d,_,E){var w=[0,0,0,0,0,0,0,0,0];return j.mat3.fromRotation(w,E),j.mat3.multiply(d,w,_)}B=A;function N(d,_,E){var w=[0,0,0,0,0,0,0,0,0];return j.mat3.fromScaling(w,E),j.mat3.multiply(d,w,_)}B=N;function L(d,_,E){return j.mat3.multiply(d,E,_)}function y(d,_){for(var E=d?[].concat(d):[1,0,0,0,1,0,0,0,1],w=0,T=_.length;w<T;w++){var k=_[w];switch(k[0]){case"t":R(E,E,[k[1],k[2]]);break;case"s":N(E,E,[k[1],k[2]]);break;case"r":A(E,E,k[1]);break;case"m":L(E,E,k[1]);break;default:break}}return E}U.vs=y;function x(d,_){return d[0]*_[1]-_[0]*d[1]}B=x;function v(d,_,E){var w=j.vec2.angle(d,_),T=x(d,_)>=0;return E?T?Math.PI*2-w:w:T?w:Math.PI*2-w}B=v;function g(d,_,E){return E?(d[0]=_[1],d[1]=-1*_[0]):(d[0]=-1*_[1],d[1]=_[0]),d}B=g},59591:function(or,U,z){var B=z(50008).default;function j(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */or.exports=j=function(){return R},or.exports.__esModule=!0,or.exports.default=or.exports;var R={},A=Object.prototype,N=A.hasOwnProperty,L=Object.defineProperty||function(Ie,be,pe){Ie[be]=pe.value},y=typeof Symbol=="function"?Symbol:{},x=y.iterator||"@@iterator",v=y.asyncIterator||"@@asyncIterator",g=y.toStringTag||"@@toStringTag";function d(Ie,be,pe){return Object.defineProperty(Ie,be,{value:pe,enumerable:!0,configurable:!0,writable:!0}),Ie[be]}try{d({},"")}catch(Ie){d=function(pe,Me,De){return pe[Me]=De}}function _(Ie,be,pe,Me){var De=be&&be.prototype instanceof T?be:T,Ue=Object.create(De.prototype),nt=new de(Me||[]);return L(Ue,"_invoke",{value:q(Ie,pe,nt)}),Ue}function E(Ie,be,pe){try{return{type:"normal",arg:Ie.call(be,pe)}}catch(Me){return{type:"throw",arg:Me}}}R.wrap=_;var w={};function T(){}function k(){}function b(){}var m={};d(m,x,function(){return this});var $=Object.getPrototypeOf,W=$&&$($(Te([])));W&&W!==A&&N.call(W,x)&&(m=W);var X=b.prototype=T.prototype=Object.create(m);function H(Ie){["next","throw","return"].forEach(function(be){d(Ie,be,function(pe){return this._invoke(be,pe)})})}function Q(Ie,be){function pe(De,Ue,nt,Ze){var ht=E(Ie[De],Ie,Ue);if(ht.type!=="throw"){var Rt=ht.arg,tr=Rt.value;return tr&&B(tr)=="object"&&N.call(tr,"__await")?be.resolve(tr.__await).then(function(Qe){pe("next",Qe,nt,Ze)},function(Qe){pe("throw",Qe,nt,Ze)}):be.resolve(tr).then(function(Qe){Rt.value=Qe,nt(Rt)},function(Qe){return pe("throw",Qe,nt,Ze)})}Ze(ht.arg)}var Me;L(this,"_invoke",{value:function(Ue,nt){function Ze(){return new be(function(ht,Rt){pe(Ue,nt,ht,Rt)})}return Me=Me?Me.then(Ze,Ze):Ze()}})}function q(Ie,be,pe){var Me="suspendedStart";return function(De,Ue){if(Me==="executing")throw new Error("Generator is already running");if(Me==="completed"){if(De==="throw")throw Ue;return Se()}for(pe.method=De,pe.arg=Ue;;){var nt=pe.delegate;if(nt){var Ze=J(nt,pe);if(Ze){if(Ze===w)continue;return Ze}}if(pe.method==="next")pe.sent=pe._sent=pe.arg;else if(pe.method==="throw"){if(Me==="suspendedStart")throw Me="completed",pe.arg;pe.dispatchException(pe.arg)}else pe.method==="return"&&pe.abrupt("return",pe.arg);Me="executing";var ht=E(Ie,be,pe);if(ht.type==="normal"){if(Me=pe.done?"completed":"suspendedYield",ht.arg===w)continue;return{value:ht.arg,done:pe.done}}ht.type==="throw"&&(Me="completed",pe.method="throw",pe.arg=ht.arg)}}}function J(Ie,be){var pe=be.method,Me=Ie.iterator[pe];if(Me===void 0)return be.delegate=null,pe==="throw"&&Ie.iterator.return&&(be.method="return",be.arg=void 0,J(Ie,be),be.method==="throw")||pe!=="return"&&(be.method="throw",be.arg=new TypeError("The iterator does not provide a '"+pe+"' method")),w;var De=E(Me,Ie.iterator,be.arg);if(De.type==="throw")return be.method="throw",be.arg=De.arg,be.delegate=null,w;var Ue=De.arg;return Ue?Ue.done?(be[Ie.resultName]=Ue.value,be.next=Ie.nextLoc,be.method!=="return"&&(be.method="next",be.arg=void 0),be.delegate=null,w):Ue:(be.method="throw",be.arg=new TypeError("iterator result is not an object"),be.delegate=null,w)}function te(Ie){var be={tryLoc:Ie[0]};1 in Ie&&(be.catchLoc=Ie[1]),2 in Ie&&(be.finallyLoc=Ie[2],be.afterLoc=Ie[3]),this.tryEntries.push(be)}function fe(Ie){var be=Ie.completion||{};be.type="normal",delete be.arg,Ie.completion=be}function de(Ie){this.tryEntries=[{tryLoc:"root"}],Ie.forEach(te,this),this.reset(!0)}function Te(Ie){if(Ie){var be=Ie[x];if(be)return be.call(Ie);if(typeof Ie.next=="function")return Ie;if(!isNaN(Ie.length)){var pe=-1,Me=function De(){for(;++pe<Ie.length;)if(N.call(Ie,pe))return De.value=Ie[pe],De.done=!1,De;return De.value=void 0,De.done=!0,De};return Me.next=Me}}return{next:Se}}function Se(){return{value:void 0,done:!0}}return k.prototype=b,L(X,"constructor",{value:b,configurable:!0}),L(b,"constructor",{value:k,configurable:!0}),k.displayName=d(b,g,"GeneratorFunction"),R.isGeneratorFunction=function(Ie){var be=typeof Ie=="function"&&Ie.constructor;return!!be&&(be===k||(be.displayName||be.name)==="GeneratorFunction")},R.mark=function(Ie){return Object.setPrototypeOf?Object.setPrototypeOf(Ie,b):(Ie.__proto__=b,d(Ie,g,"GeneratorFunction")),Ie.prototype=Object.create(X),Ie},R.awrap=function(Ie){return{__await:Ie}},H(Q.prototype),d(Q.prototype,v,function(){return this}),R.AsyncIterator=Q,R.async=function(Ie,be,pe,Me,De){De===void 0&&(De=Promise);var Ue=new Q(_(Ie,be,pe,Me),De);return R.isGeneratorFunction(be)?Ue:Ue.next().then(function(nt){return nt.done?nt.value:Ue.next()})},H(X),d(X,g,"Generator"),d(X,x,function(){return this}),d(X,"toString",function(){return"[object Generator]"}),R.keys=function(Ie){var be=Object(Ie),pe=[];for(var Me in be)pe.push(Me);return pe.reverse(),function De(){for(;pe.length;){var Ue=pe.pop();if(Ue in be)return De.value=Ue,De.done=!1,De}return De.done=!0,De}},R.values=Te,de.prototype={constructor:de,reset:function(be){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(fe),!be)for(var pe in this)pe.charAt(0)==="t"&&N.call(this,pe)&&!isNaN(+pe.slice(1))&&(this[pe]=void 0)},stop:function(){this.done=!0;var be=this.tryEntries[0].completion;if(be.type==="throw")throw be.arg;return this.rval},dispatchException:function(be){if(this.done)throw be;var pe=this;function Me(Rt,tr){return nt.type="throw",nt.arg=be,pe.next=Rt,tr&&(pe.method="next",pe.arg=void 0),!!tr}for(var De=this.tryEntries.length-1;De>=0;--De){var Ue=this.tryEntries[De],nt=Ue.completion;if(Ue.tryLoc==="root")return Me("end");if(Ue.tryLoc<=this.prev){var Ze=N.call(Ue,"catchLoc"),ht=N.call(Ue,"finallyLoc");if(Ze&&ht){if(this.prev<Ue.catchLoc)return Me(Ue.catchLoc,!0);if(this.prev<Ue.finallyLoc)return Me(Ue.finallyLoc)}else if(Ze){if(this.prev<Ue.catchLoc)return Me(Ue.catchLoc,!0)}else{if(!ht)throw new Error("try statement without catch or finally");if(this.prev<Ue.finallyLoc)return Me(Ue.finallyLoc)}}}},abrupt:function(be,pe){for(var Me=this.tryEntries.length-1;Me>=0;--Me){var De=this.tryEntries[Me];if(De.tryLoc<=this.prev&&N.call(De,"finallyLoc")&&this.prev<De.finallyLoc){var Ue=De;break}}Ue&&(be==="break"||be==="continue")&&Ue.tryLoc<=pe&&pe<=Ue.finallyLoc&&(Ue=null);var nt=Ue?Ue.completion:{};return nt.type=be,nt.arg=pe,Ue?(this.method="next",this.next=Ue.finallyLoc,w):this.complete(nt)},complete:function(be,pe){if(be.type==="throw")throw be.arg;return be.type==="break"||be.type==="continue"?this.next=be.arg:be.type==="return"?(this.rval=this.arg=be.arg,this.method="return",this.next="end"):be.type==="normal"&&pe&&(this.next=pe),w},finish:function(be){for(var pe=this.tryEntries.length-1;pe>=0;--pe){var Me=this.tryEntries[pe];if(Me.finallyLoc===be)return this.complete(Me.completion,Me.afterLoc),fe(Me),w}},catch:function(be){for(var pe=this.tryEntries.length-1;pe>=0;--pe){var Me=this.tryEntries[pe];if(Me.tryLoc===be){var De=Me.completion;if(De.type==="throw"){var Ue=De.arg;fe(Me)}return Ue}}throw new Error("illegal catch attempt")},delegateYield:function(be,pe,Me){return this.delegate={iterator:Te(be),resultName:pe,nextLoc:Me},this.method==="next"&&(this.arg=void 0),w}},R}or.exports=j,or.exports.__esModule=!0,or.exports.default=or.exports},87757:function(or,U,z){var B=z(59591)();or.exports=B;try{regeneratorRuntime=B}catch(j){typeof globalThis=="object"?globalThis.regeneratorRuntime=B:Function("r","regeneratorRuntime = r")(B)}},41685:function(or,U,z){"use strict";z.r(U),z.d(U,{forceCenter:function(){return B},forceCollide:function(){return y},forceLink:function(){return g},forceManyBody:function(){return pt},forceRadial:function(){return rr},forceSimulation:function(){return _t},forceX:function(){return xr},forceY:function(){return Vt}});function B(ft,Bt){var qt,br=1;ft==null&&(ft=0),Bt==null&&(Bt=0);function Ur(){var Ae,Hr=qt.length,Sr,qr=0,Gr=0;for(Ae=0;Ae<Hr;++Ae)Sr=qt[Ae],qr+=Sr.x,Gr+=Sr.y;for(qr=(qr/Hr-ft)*br,Gr=(Gr/Hr-Bt)*br,Ae=0;Ae<Hr;++Ae)Sr=qt[Ae],Sr.x-=qr,Sr.y-=Gr}return Ur.initialize=function(Ae){qt=Ae},Ur.x=function(Ae){return arguments.length?(ft=+Ae,Ur):ft},Ur.y=function(Ae){return arguments.length?(Bt=+Ae,Ur):Bt},Ur.strength=function(Ae){return arguments.length?(br=+Ae,Ur):br},Ur}var j=z(28833);function R(ft){return function(){return ft}}function A(ft){return(ft()-.5)*1e-6}function N(ft){return ft.x+ft.vx}function L(ft){return ft.y+ft.vy}function y(ft){var Bt,qt,br,Ur=1,Ae=1;typeof ft!="function"&&(ft=R(ft==null?1:+ft));function Hr(){for(var Gr,vn=Bt.length,Gn,mn,$r,gn,Rr,ct,Wt=0;Wt<Ae;++Wt)for(Gn=(0,j.Z)(Bt,N,L).visitAfter(Sr),Gr=0;Gr<vn;++Gr)mn=Bt[Gr],Rr=qt[mn.index],ct=Rr*Rr,$r=mn.x+mn.vx,gn=mn.y+mn.vy,Gn.visit(Er);function Er(Dr,Vr,pn,wn,Sn){var In=Dr.data,$n=Dr.r,Zr=Rr+$n;if(In){if(In.index>mn.index){var Pn=$r-In.x-In.vx,An=gn-In.y-In.vy,ln=Pn*Pn+An*An;ln<Zr*Zr&&(Pn===0&&(Pn=A(br),ln+=Pn*Pn),An===0&&(An=A(br),ln+=An*An),ln=(Zr-(ln=Math.sqrt(ln)))/ln*Ur,mn.vx+=(Pn*=ln)*(Zr=($n*=$n)/(ct+$n)),mn.vy+=(An*=ln)*Zr,In.vx-=Pn*(Zr=1-Zr),In.vy-=An*Zr)}return}return Vr>$r+Zr||wn<$r-Zr||pn>gn+Zr||Sn<gn-Zr}}function Sr(Gr){if(Gr.data)return Gr.r=qt[Gr.data.index];for(var vn=Gr.r=0;vn<4;++vn)Gr[vn]&&Gr[vn].r>Gr.r&&(Gr.r=Gr[vn].r)}function qr(){if(!!Bt){var Gr,vn=Bt.length,Gn;for(qt=new Array(vn),Gr=0;Gr<vn;++Gr)Gn=Bt[Gr],qt[Gn.index]=+ft(Gn,Gr,Bt)}}return Hr.initialize=function(Gr,vn){Bt=Gr,br=vn,qr()},Hr.iterations=function(Gr){return arguments.length?(Ae=+Gr,Hr):Ae},Hr.strength=function(Gr){return arguments.length?(Ur=+Gr,Hr):Ur},Hr.radius=function(Gr){return arguments.length?(ft=typeof Gr=="function"?Gr:R(+Gr),qr(),Hr):ft},Hr}function x(ft){return ft.index}function v(ft,Bt){var qt=ft.get(Bt);if(!qt)throw new Error("node not found: "+Bt);return qt}function g(ft){var Bt=x,qt=Gn,br,Ur=R(30),Ae,Hr,Sr,qr,Gr,vn=1;ft==null&&(ft=[]);function Gn(ct){return 1/Math.min(Sr[ct.source.index],Sr[ct.target.index])}function mn(ct){for(var Wt=0,Er=ft.length;Wt<vn;++Wt)for(var Dr=0,Vr,pn,wn,Sn,In,$n,Zr;Dr<Er;++Dr)Vr=ft[Dr],pn=Vr.source,wn=Vr.target,Sn=wn.x+wn.vx-pn.x-pn.vx||A(Gr),In=wn.y+wn.vy-pn.y-pn.vy||A(Gr),$n=Math.sqrt(Sn*Sn+In*In),$n=($n-Ae[Dr])/$n*ct*br[Dr],Sn*=$n,In*=$n,wn.vx-=Sn*(Zr=qr[Dr]),wn.vy-=In*Zr,pn.vx+=Sn*(Zr=1-Zr),pn.vy+=In*Zr}function $r(){if(!!Hr){var ct,Wt=Hr.length,Er=ft.length,Dr=new Map(Hr.map(function(pn,wn){return[Bt(pn,wn,Hr),pn]})),Vr;for(ct=0,Sr=new Array(Wt);ct<Er;++ct)Vr=ft[ct],Vr.index=ct,typeof Vr.source!="object"&&(Vr.source=v(Dr,Vr.source)),typeof Vr.target!="object"&&(Vr.target=v(Dr,Vr.target)),Sr[Vr.source.index]=(Sr[Vr.source.index]||0)+1,Sr[Vr.target.index]=(Sr[Vr.target.index]||0)+1;for(ct=0,qr=new Array(Er);ct<Er;++ct)Vr=ft[ct],qr[ct]=Sr[Vr.source.index]/(Sr[Vr.source.index]+Sr[Vr.target.index]);br=new Array(Er),gn(),Ae=new Array(Er),Rr()}}function gn(){if(!!Hr)for(var ct=0,Wt=ft.length;ct<Wt;++ct)br[ct]=+qt(ft[ct],ct,ft)}function Rr(){if(!!Hr)for(var ct=0,Wt=ft.length;ct<Wt;++ct)Ae[ct]=+Ur(ft[ct],ct,ft)}return mn.initialize=function(ct,Wt){Hr=ct,Gr=Wt,$r()},mn.links=function(ct){return arguments.length?(ft=ct,$r(),mn):ft},mn.id=function(ct){return arguments.length?(Bt=ct,mn):Bt},mn.iterations=function(ct){return arguments.length?(vn=+ct,mn):vn},mn.strength=function(ct){return arguments.length?(qt=typeof ct=="function"?ct:R(+ct),gn(),mn):qt},mn.distance=function(ct){return arguments.length?(Ur=typeof ct=="function"?ct:R(+ct),Rr(),mn):Ur},mn}var d={value:function(){}};function _(){for(var ft=0,Bt=arguments.length,qt={},br;ft<Bt;++ft){if(!(br=arguments[ft]+"")||br in qt||/[\s.]/.test(br))throw new Error("illegal type: "+br);qt[br]=[]}return new E(qt)}function E(ft){this._=ft}function w(ft,Bt){return ft.trim().split(/^|\s+/).map(function(qt){var br="",Ur=qt.indexOf(".");if(Ur>=0&&(br=qt.slice(Ur+1),qt=qt.slice(0,Ur)),qt&&!Bt.hasOwnProperty(qt))throw new Error("unknown type: "+qt);return{type:qt,name:br}})}E.prototype=_.prototype={constructor:E,on:function(Bt,qt){var br=this._,Ur=w(Bt+"",br),Ae,Hr=-1,Sr=Ur.length;if(arguments.length<2){for(;++Hr<Sr;)if((Ae=(Bt=Ur[Hr]).type)&&(Ae=T(br[Ae],Bt.name)))return Ae;return}if(qt!=null&&typeof qt!="function")throw new Error("invalid callback: "+qt);for(;++Hr<Sr;)if(Ae=(Bt=Ur[Hr]).type)br[Ae]=k(br[Ae],Bt.name,qt);else if(qt==null)for(Ae in br)br[Ae]=k(br[Ae],Bt.name,null);return this},copy:function(){var Bt={},qt=this._;for(var br in qt)Bt[br]=qt[br].slice();return new E(Bt)},call:function(Bt,qt){if((Ae=arguments.length-2)>0)for(var br=new Array(Ae),Ur=0,Ae,Hr;Ur<Ae;++Ur)br[Ur]=arguments[Ur+2];if(!this._.hasOwnProperty(Bt))throw new Error("unknown type: "+Bt);for(Hr=this._[Bt],Ur=0,Ae=Hr.length;Ur<Ae;++Ur)Hr[Ur].value.apply(qt,br)},apply:function(Bt,qt,br){if(!this._.hasOwnProperty(Bt))throw new Error("unknown type: "+Bt);for(var Ur=this._[Bt],Ae=0,Hr=Ur.length;Ae<Hr;++Ae)Ur[Ae].value.apply(qt,br)}};function T(ft,Bt){for(var qt=0,br=ft.length,Ur;qt<br;++qt)if((Ur=ft[qt]).name===Bt)return Ur.value}function k(ft,Bt,qt){for(var br=0,Ur=ft.length;br<Ur;++br)if(ft[br].name===Bt){ft[br]=d,ft=ft.slice(0,br).concat(ft.slice(br+1));break}return qt!=null&&ft.push({name:Bt,value:qt}),ft}var b=_,m=0,$=0,W=0,X=1e3,H,Q,q=0,J=0,te=0,fe=typeof performance=="object"&&performance.now?performance:Date,de=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(ft){setTimeout(ft,17)};function Te(){return J||(de(Se),J=fe.now()+te)}function Se(){J=0}function Ie(){this._call=this._time=this._next=null}Ie.prototype=be.prototype={constructor:Ie,restart:function(ft,Bt,qt){if(typeof ft!="function")throw new TypeError("callback is not a function");qt=(qt==null?Te():+qt)+(Bt==null?0:+Bt),!this._next&&Q!==this&&(Q?Q._next=this:H=this,Q=this),this._call=ft,this._time=qt,nt()},stop:function(){this._call&&(this._call=null,this._time=Infinity,nt())}};function be(ft,Bt,qt){var br=new Ie;return br.restart(ft,Bt,qt),br}function pe(){Te(),++m;for(var ft=H,Bt;ft;)(Bt=J-ft._time)>=0&&ft._call.call(null,Bt),ft=ft._next;--m}function Me(){J=(q=fe.now())+te,m=$=0;try{pe()}finally{m=0,Ue(),J=0}}function De(){var ft=fe.now(),Bt=ft-q;Bt>X&&(te-=Bt,q=ft)}function Ue(){for(var ft,Bt=H,qt,br=Infinity;Bt;)Bt._call?(br>Bt._time&&(br=Bt._time),ft=Bt,Bt=Bt._next):(qt=Bt._next,Bt._next=null,Bt=ft?ft._next=qt:H=qt);Q=ft,nt(br)}function nt(ft){if(!m){$&&($=clearTimeout($));var Bt=ft-J;Bt>24?(ft<Infinity&&($=setTimeout(Me,ft-fe.now()-te)),W&&(W=clearInterval(W))):(W||(q=fe.now(),W=setInterval(De,X)),m=1,de(Me))}}var Ze=1664525,ht=1013904223,Rt=4294967296;function tr(){var ft=1;return function(){return(ft=(Ze*ft+ht)%Rt)/Rt}}function Qe(ft){return ft.x}function lt(ft){return ft.y}var St=10,Ct=Math.PI*(3-Math.sqrt(5));function _t(ft){var Bt,qt=1,br=.001,Ur=1-Math.pow(br,1/300),Ae=0,Hr=.6,Sr=new Map,qr=be(Gn),Gr=b("tick","end"),vn=tr();ft==null&&(ft=[]);function Gn(){mn(),Gr.call("tick",Bt),qt<br&&(qr.stop(),Gr.call("end",Bt))}function mn(Rr){var ct,Wt=ft.length,Er;Rr===void 0&&(Rr=1);for(var Dr=0;Dr<Rr;++Dr)for(qt+=(Ae-qt)*Ur,Sr.forEach(function(Vr){Vr(qt)}),ct=0;ct<Wt;++ct)Er=ft[ct],Er.fx==null?Er.x+=Er.vx*=Hr:(Er.x=Er.fx,Er.vx=0),Er.fy==null?Er.y+=Er.vy*=Hr:(Er.y=Er.fy,Er.vy=0);return Bt}function $r(){for(var Rr=0,ct=ft.length,Wt;Rr<ct;++Rr){if(Wt=ft[Rr],Wt.index=Rr,Wt.fx!=null&&(Wt.x=Wt.fx),Wt.fy!=null&&(Wt.y=Wt.fy),isNaN(Wt.x)||isNaN(Wt.y)){var Er=St*Math.sqrt(.5+Rr),Dr=Rr*Ct;Wt.x=Er*Math.cos(Dr),Wt.y=Er*Math.sin(Dr)}(isNaN(Wt.vx)||isNaN(Wt.vy))&&(Wt.vx=Wt.vy=0)}}function gn(Rr){return Rr.initialize&&Rr.initialize(ft,vn),Rr}return $r(),Bt={tick:mn,restart:function(){return qr.restart(Gn),Bt},stop:function(){return qr.stop(),Bt},nodes:function(ct){return arguments.length?(ft=ct,$r(),Sr.forEach(gn),Bt):ft},alpha:function(ct){return arguments.length?(qt=+ct,Bt):qt},alphaMin:function(ct){return arguments.length?(br=+ct,Bt):br},alphaDecay:function(ct){return arguments.length?(Ur=+ct,Bt):+Ur},alphaTarget:function(ct){return arguments.length?(Ae=+ct,Bt):Ae},velocityDecay:function(ct){return arguments.length?(Hr=1-ct,Bt):1-Hr},randomSource:function(ct){return arguments.length?(vn=ct,Sr.forEach(gn),Bt):vn},force:function(ct,Wt){return arguments.length>1?(Wt==null?Sr.delete(ct):Sr.set(ct,gn(Wt)),Bt):Sr.get(ct)},find:function(ct,Wt,Er){var Dr=0,Vr=ft.length,pn,wn,Sn,In,$n;for(Er==null?Er=Infinity:Er*=Er,Dr=0;Dr<Vr;++Dr)In=ft[Dr],pn=ct-In.x,wn=Wt-In.y,Sn=pn*pn+wn*wn,Sn<Er&&($n=In,Er=Sn);return $n},on:function(ct,Wt){return arguments.length>1?(Gr.on(ct,Wt),Bt):Gr.on(ct)}}}function pt(){var ft,Bt,qt,br,Ur=R(-30),Ae,Hr=1,Sr=Infinity,qr=.81;function Gr($r){var gn,Rr=ft.length,ct=(0,j.Z)(ft,Qe,lt).visitAfter(Gn);for(br=$r,gn=0;gn<Rr;++gn)Bt=ft[gn],ct.visit(mn)}function vn(){if(!!ft){var $r,gn=ft.length,Rr;for(Ae=new Array(gn),$r=0;$r<gn;++$r)Rr=ft[$r],Ae[Rr.index]=+Ur(Rr,$r,ft)}}function Gn($r){var gn=0,Rr,ct,Wt=0,Er,Dr,Vr;if($r.length){for(Er=Dr=Vr=0;Vr<4;++Vr)(Rr=$r[Vr])&&(ct=Math.abs(Rr.value))&&(gn+=Rr.value,Wt+=ct,Er+=ct*Rr.x,Dr+=ct*Rr.y);$r.x=Er/Wt,$r.y=Dr/Wt}else{Rr=$r,Rr.x=Rr.data.x,Rr.y=Rr.data.y;do gn+=Ae[Rr.data.index];while(Rr=Rr.next)}$r.value=gn}function mn($r,gn,Rr,ct){if(!$r.value)return!0;var Wt=$r.x-Bt.x,Er=$r.y-Bt.y,Dr=ct-gn,Vr=Wt*Wt+Er*Er;if(Dr*Dr/qr<Vr)return Vr<Sr&&(Wt===0&&(Wt=A(qt),Vr+=Wt*Wt),Er===0&&(Er=A(qt),Vr+=Er*Er),Vr<Hr&&(Vr=Math.sqrt(Hr*Vr)),Bt.vx+=Wt*$r.value*br/Vr,Bt.vy+=Er*$r.value*br/Vr),!0;if($r.length||Vr>=Sr)return;($r.data!==Bt||$r.next)&&(Wt===0&&(Wt=A(qt),Vr+=Wt*Wt),Er===0&&(Er=A(qt),Vr+=Er*Er),Vr<Hr&&(Vr=Math.sqrt(Hr*Vr)));do $r.data!==Bt&&(Dr=Ae[$r.data.index]*br/Vr,Bt.vx+=Wt*Dr,Bt.vy+=Er*Dr);while($r=$r.next)}return Gr.initialize=function($r,gn){ft=$r,qt=gn,vn()},Gr.strength=function($r){return arguments.length?(Ur=typeof $r=="function"?$r:R(+$r),vn(),Gr):Ur},Gr.distanceMin=function($r){return arguments.length?(Hr=$r*$r,Gr):Math.sqrt(Hr)},Gr.distanceMax=function($r){return arguments.length?(Sr=$r*$r,Gr):Math.sqrt(Sr)},Gr.theta=function($r){return arguments.length?(qr=$r*$r,Gr):Math.sqrt(qr)},Gr}function rr(ft,Bt,qt){var br,Ur=R(.1),Ae,Hr;typeof ft!="function"&&(ft=R(+ft)),Bt==null&&(Bt=0),qt==null&&(qt=0);function Sr(Gr){for(var vn=0,Gn=br.length;vn<Gn;++vn){var mn=br[vn],$r=mn.x-Bt||1e-6,gn=mn.y-qt||1e-6,Rr=Math.sqrt($r*$r+gn*gn),ct=(Hr[vn]-Rr)*Ae[vn]*Gr/Rr;mn.vx+=$r*ct,mn.vy+=gn*ct}}function qr(){if(!!br){var Gr,vn=br.length;for(Ae=new Array(vn),Hr=new Array(vn),Gr=0;Gr<vn;++Gr)Hr[Gr]=+ft(br[Gr],Gr,br),Ae[Gr]=isNaN(Hr[Gr])?0:+Ur(br[Gr],Gr,br)}}return Sr.initialize=function(Gr){br=Gr,qr()},Sr.strength=function(Gr){return arguments.length?(Ur=typeof Gr=="function"?Gr:R(+Gr),qr(),Sr):Ur},Sr.radius=function(Gr){return arguments.length?(ft=typeof Gr=="function"?Gr:R(+Gr),qr(),Sr):ft},Sr.x=function(Gr){return arguments.length?(Bt=+Gr,Sr):Bt},Sr.y=function(Gr){return arguments.length?(qt=+Gr,Sr):qt},Sr}function xr(ft){var Bt=R(.1),qt,br,Ur;typeof ft!="function"&&(ft=R(ft==null?0:+ft));function Ae(Sr){for(var qr=0,Gr=qt.length,vn;qr<Gr;++qr)vn=qt[qr],vn.vx+=(Ur[qr]-vn.x)*br[qr]*Sr}function Hr(){if(!!qt){var Sr,qr=qt.length;for(br=new Array(qr),Ur=new Array(qr),Sr=0;Sr<qr;++Sr)br[Sr]=isNaN(Ur[Sr]=+ft(qt[Sr],Sr,qt))?0:+Bt(qt[Sr],Sr,qt)}}return Ae.initialize=function(Sr){qt=Sr,Hr()},Ae.strength=function(Sr){return arguments.length?(Bt=typeof Sr=="function"?Sr:R(+Sr),Hr(),Ae):Bt},Ae.x=function(Sr){return arguments.length?(ft=typeof Sr=="function"?Sr:R(+Sr),Hr(),Ae):ft},Ae}function Vt(ft){var Bt=R(.1),qt,br,Ur;typeof ft!="function"&&(ft=R(ft==null?0:+ft));function Ae(Sr){for(var qr=0,Gr=qt.length,vn;qr<Gr;++qr)vn=qt[qr],vn.vy+=(Ur[qr]-vn.y)*br[qr]*Sr}function Hr(){if(!!qt){var Sr,qr=qt.length;for(br=new Array(qr),Ur=new Array(qr),Sr=0;Sr<qr;++Sr)br[Sr]=isNaN(Ur[Sr]=+ft(qt[Sr],Sr,qt))?0:+Bt(qt[Sr],Sr,qt)}}return Ae.initialize=function(Sr){qt=Sr,Hr()},Ae.strength=function(Sr){return arguments.length?(Bt=typeof Sr=="function"?Sr:R(+Sr),Hr(),Ae):Bt},Ae.y=function(Sr){return arguments.length?(ft=typeof Sr=="function"?Sr:R(+Sr),Hr(),Ae):ft},Ae}},52710:function(or,U,z){"use strict";z.r(U),z.d(U,{AbstractMatrix:function(){return pt},CHO:function(){return Dt},CholeskyDecomposition:function(){return Dt},EVD:function(){return Zr},EigenvalueDecomposition:function(){return Zr},LU:function(){return $r},LuDecomposition:function(){return $r},Matrix:function(){return Vt},MatrixColumnSelectionView:function(){return qt},MatrixColumnView:function(){return Bt},MatrixFlipColumnView:function(){return br},MatrixFlipRowView:function(){return Ur},MatrixRowSelectionView:function(){return Hr},MatrixRowView:function(){return Ae},MatrixSelectionView:function(){return Sr},MatrixSubView:function(){return qr},MatrixTransposeView:function(){return Gr},NIPALS:function(){return rt},Nipals:function(){return rt},QR:function(){return Rr},QrDecomposition:function(){return Rr},SVD:function(){return ct},SingularValueDecomposition:function(){return ct},WrapperMatrix1D:function(){return vn},WrapperMatrix2D:function(){return Gn},correlation:function(){return $n},covariance:function(){return In},default:function(){return Vt},determinant:function(){return Dr},inverse:function(){return Wt},linearDependencies:function(){return wn},pseudoInverse:function(){return Sn},solve:function(){return Er},wrap:function(){return mn}});var B=z(79320),j=z(81306),R=z(59206),A=z(69610),N=z(54941);const L=Object.prototype.toString;function y(ne){return L.call(ne).endsWith("Array]")}function x(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!y(ne))throw new TypeError("input must be an array");if(ne.length===0)throw new TypeError("input must not be empty");var P=ae.fromIndex,S=P===void 0?0:P,C=ae.toIndex,V=C===void 0?ne.length:C;if(S<0||S>=ne.length||!Number.isInteger(S))throw new Error("fromIndex must be a positive integer smaller than length");if(V<=S||V>ne.length||!Number.isInteger(V))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var he=ne[S],xe=S+1;xe<V;xe++)ne[xe]>he&&(he=ne[xe]);return he}function v(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!y(ne))throw new TypeError("input must be an array");if(ne.length===0)throw new TypeError("input must not be empty");var P=ae.fromIndex,S=P===void 0?0:P,C=ae.toIndex,V=C===void 0?ne.length:C;if(S<0||S>=ne.length||!Number.isInteger(S))throw new Error("fromIndex must be a positive integer smaller than length");if(V<=S||V>ne.length||!Number.isInteger(V))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var he=ne[S],xe=S+1;xe<V;xe++)ne[xe]<he&&(he=ne[xe]);return he}function g(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(y(ne)){if(ne.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var P;if(ae.output!==void 0){if(!y(ae.output))throw new TypeError("output option must be an array if specified");P=ae.output}else P=new Array(ne.length);var S=v(ne),C=x(ne);if(S===C)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var V=ae.min,he=V===void 0?ae.autoMinMax?S:0:V,xe=ae.max,Ee=xe===void 0?ae.autoMinMax?C:1:xe;if(he>=Ee)throw new RangeError("min option must be smaller than max option");for(var Ne=(Ee-he)/(C-S),Et=0;Et<ne.length;Et++)P[Et]=(ne[Et]-S)*Ne+he;return P}var d=" ".repeat(2),_=" ".repeat(4);function E(){return w(this)}function w(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=ae.maxRows,S=P===void 0?15:P,C=ae.maxColumns,V=C===void 0?10:C,he=ae.maxNumSize,xe=he===void 0?8:he,Ee=ae.padMinus,Ne=Ee===void 0?"auto":Ee;return"".concat(ne.constructor.name,` {
  617. `).concat(d,`[
  618. `).concat(_).concat(T(ne,S,V,xe,Ne),`
  619. `).concat(d,`]
  620. `).concat(d,"rows: ").concat(ne.rows,`
  621. `).concat(d,"columns: ").concat(ne.columns,`
  622. }`)}function T(ne,ae,P,S,C){var V=ne.rows,he=ne.columns,xe=Math.min(V,ae),Ee=Math.min(he,P),Ne=[];if(C==="auto"){C=!1;e:for(var Et=0;Et<xe;Et++)for(var st=0;st<Ee;st++)if(ne.get(Et,st)<0){C=!0;break e}}for(var Pt=0;Pt<xe;Pt++){for(var $t=[],Ht=0;Ht<Ee;Ht++)$t.push(k(ne.get(Pt,Ht),S,C));Ne.push("".concat($t.join(" ")))}return Ee!==he&&(Ne[Ne.length-1]+=" ... ".concat(he-P," more columns")),xe!==V&&Ne.push("... ".concat(V-ae," more rows")),Ne.join(`
  623. `.concat(_))}function k(ne,ae,P){return(ne>=0&&P?" ".concat(b(ne,ae-1)):b(ne,ae)).padEnd(ae)}function b(ne,ae){var P=ne.toString();if(P.length<=ae)return P;var S=ne.toFixed(ae);if(S.length>ae&&(S=ne.toFixed(Math.max(0,ae-(S.length-ae)))),S.length<=ae&&!S.startsWith("0.000")&&!S.startsWith("-0.000"))return S;var C=ne.toExponential(ae);return C.length>ae&&(C=ne.toExponential(Math.max(0,ae-(C.length-ae)))),C.slice(0)}function m(ne,ae){ne.prototype.add=function(S){return typeof S=="number"?this.addS(S):this.addM(S)},ne.prototype.addS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)+S);return this},ne.prototype.addM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)+S.get(C,V));return this},ne.add=function(S,C){var V=new ae(S);return V.add(C)},ne.prototype.sub=function(S){return typeof S=="number"?this.subS(S):this.subM(S)},ne.prototype.subS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)-S);return this},ne.prototype.subM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)-S.get(C,V));return this},ne.sub=function(S,C){var V=new ae(S);return V.sub(C)},ne.prototype.subtract=ne.prototype.sub,ne.prototype.subtractS=ne.prototype.subS,ne.prototype.subtractM=ne.prototype.subM,ne.subtract=ne.sub,ne.prototype.mul=function(S){return typeof S=="number"?this.mulS(S):this.mulM(S)},ne.prototype.mulS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)*S);return this},ne.prototype.mulM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)*S.get(C,V));return this},ne.mul=function(S,C){var V=new ae(S);return V.mul(C)},ne.prototype.multiply=ne.prototype.mul,ne.prototype.multiplyS=ne.prototype.mulS,ne.prototype.multiplyM=ne.prototype.mulM,ne.multiply=ne.mul,ne.prototype.div=function(S){return typeof S=="number"?this.divS(S):this.divM(S)},ne.prototype.divS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)/S);return this},ne.prototype.divM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)/S.get(C,V));return this},ne.div=function(S,C){var V=new ae(S);return V.div(C)},ne.prototype.divide=ne.prototype.div,ne.prototype.divideS=ne.prototype.divS,ne.prototype.divideM=ne.prototype.divM,ne.divide=ne.div,ne.prototype.mod=function(S){return typeof S=="number"?this.modS(S):this.modM(S)},ne.prototype.modS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)%S);return this},ne.prototype.modM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)%S.get(C,V));return this},ne.mod=function(S,C){var V=new ae(S);return V.mod(C)},ne.prototype.modulus=ne.prototype.mod,ne.prototype.modulusS=ne.prototype.modS,ne.prototype.modulusM=ne.prototype.modM,ne.modulus=ne.mod,ne.prototype.and=function(S){return typeof S=="number"?this.andS(S):this.andM(S)},ne.prototype.andS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)&S);return this},ne.prototype.andM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)&S.get(C,V));return this},ne.and=function(S,C){var V=new ae(S);return V.and(C)},ne.prototype.or=function(S){return typeof S=="number"?this.orS(S):this.orM(S)},ne.prototype.orS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)|S);return this},ne.prototype.orM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)|S.get(C,V));return this},ne.or=function(S,C){var V=new ae(S);return V.or(C)},ne.prototype.xor=function(S){return typeof S=="number"?this.xorS(S):this.xorM(S)},ne.prototype.xorS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)^S);return this},ne.prototype.xorM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)^S.get(C,V));return this},ne.xor=function(S,C){var V=new ae(S);return V.xor(C)},ne.prototype.leftShift=function(S){return typeof S=="number"?this.leftShiftS(S):this.leftShiftM(S)},ne.prototype.leftShiftS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)<<S);return this},ne.prototype.leftShiftM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)<<S.get(C,V));return this},ne.leftShift=function(S,C){var V=new ae(S);return V.leftShift(C)},ne.prototype.signPropagatingRightShift=function(S){return typeof S=="number"?this.signPropagatingRightShiftS(S):this.signPropagatingRightShiftM(S)},ne.prototype.signPropagatingRightShiftS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)>>S);return this},ne.prototype.signPropagatingRightShiftM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)>>S.get(C,V));return this},ne.signPropagatingRightShift=function(S,C){var V=new ae(S);return V.signPropagatingRightShift(C)},ne.prototype.rightShift=function(S){return typeof S=="number"?this.rightShiftS(S):this.rightShiftM(S)},ne.prototype.rightShiftS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)>>>S);return this},ne.prototype.rightShiftM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,this.get(C,V)>>>S.get(C,V));return this},ne.rightShift=function(S,C){var V=new ae(S);return V.rightShift(C)},ne.prototype.zeroFillRightShift=ne.prototype.rightShift,ne.prototype.zeroFillRightShiftS=ne.prototype.rightShiftS,ne.prototype.zeroFillRightShiftM=ne.prototype.rightShiftM,ne.zeroFillRightShift=ne.rightShift,ne.prototype.not=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,~this.get(S,C));return this},ne.not=function(S){var C=new ae(S);return C.not()},ne.prototype.abs=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.abs(this.get(S,C)));return this},ne.abs=function(S){var C=new ae(S);return C.abs()},ne.prototype.acos=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.acos(this.get(S,C)));return this},ne.acos=function(S){var C=new ae(S);return C.acos()},ne.prototype.acosh=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.acosh(this.get(S,C)));return this},ne.acosh=function(S){var C=new ae(S);return C.acosh()},ne.prototype.asin=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.asin(this.get(S,C)));return this},ne.asin=function(S){var C=new ae(S);return C.asin()},ne.prototype.asinh=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.asinh(this.get(S,C)));return this},ne.asinh=function(S){var C=new ae(S);return C.asinh()},ne.prototype.atan=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.atan(this.get(S,C)));return this},ne.atan=function(S){var C=new ae(S);return C.atan()},ne.prototype.atanh=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.atanh(this.get(S,C)));return this},ne.atanh=function(S){var C=new ae(S);return C.atanh()},ne.prototype.cbrt=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.cbrt(this.get(S,C)));return this},ne.cbrt=function(S){var C=new ae(S);return C.cbrt()},ne.prototype.ceil=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.ceil(this.get(S,C)));return this},ne.ceil=function(S){var C=new ae(S);return C.ceil()},ne.prototype.clz32=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.clz32(this.get(S,C)));return this},ne.clz32=function(S){var C=new ae(S);return C.clz32()},ne.prototype.cos=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.cos(this.get(S,C)));return this},ne.cos=function(S){var C=new ae(S);return C.cos()},ne.prototype.cosh=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.cosh(this.get(S,C)));return this},ne.cosh=function(S){var C=new ae(S);return C.cosh()},ne.prototype.exp=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.exp(this.get(S,C)));return this},ne.exp=function(S){var C=new ae(S);return C.exp()},ne.prototype.expm1=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.expm1(this.get(S,C)));return this},ne.expm1=function(S){var C=new ae(S);return C.expm1()},ne.prototype.floor=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.floor(this.get(S,C)));return this},ne.floor=function(S){var C=new ae(S);return C.floor()},ne.prototype.fround=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.fround(this.get(S,C)));return this},ne.fround=function(S){var C=new ae(S);return C.fround()},ne.prototype.log=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.log(this.get(S,C)));return this},ne.log=function(S){var C=new ae(S);return C.log()},ne.prototype.log1p=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.log1p(this.get(S,C)));return this},ne.log1p=function(S){var C=new ae(S);return C.log1p()},ne.prototype.log10=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.log10(this.get(S,C)));return this},ne.log10=function(S){var C=new ae(S);return C.log10()},ne.prototype.log2=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.log2(this.get(S,C)));return this},ne.log2=function(S){var C=new ae(S);return C.log2()},ne.prototype.round=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.round(this.get(S,C)));return this},ne.round=function(S){var C=new ae(S);return C.round()},ne.prototype.sign=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.sign(this.get(S,C)));return this},ne.sign=function(S){var C=new ae(S);return C.sign()},ne.prototype.sin=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.sin(this.get(S,C)));return this},ne.sin=function(S){var C=new ae(S);return C.sin()},ne.prototype.sinh=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.sinh(this.get(S,C)));return this},ne.sinh=function(S){var C=new ae(S);return C.sinh()},ne.prototype.sqrt=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.sqrt(this.get(S,C)));return this},ne.sqrt=function(S){var C=new ae(S);return C.sqrt()},ne.prototype.tan=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.tan(this.get(S,C)));return this},ne.tan=function(S){var C=new ae(S);return C.tan()},ne.prototype.tanh=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.tanh(this.get(S,C)));return this},ne.tanh=function(S){var C=new ae(S);return C.tanh()},ne.prototype.trunc=function(){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,Math.trunc(this.get(S,C)));return this},ne.trunc=function(S){var C=new ae(S);return C.trunc()},ne.pow=function(S,C){var V=new ae(S);return V.pow(C)},ne.prototype.pow=function(S){return typeof S=="number"?this.powS(S):this.powM(S)},ne.prototype.powS=function(S){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,Math.pow(this.get(C,V),S));return this},ne.prototype.powM=function(S){if(S=ae.checkMatrix(S),this.rows!==S.rows||this.columns!==S.columns)throw new RangeError("Matrices dimensions must be equal");for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.set(C,V,Math.pow(this.get(C,V),S.get(C,V)));return this}}function $(ne,ae,P){var S=P?ne.rows:ne.rows-1;if(ae<0||ae>S)throw new RangeError("Row index out of range")}function W(ne,ae,P){var S=P?ne.columns:ne.columns-1;if(ae<0||ae>S)throw new RangeError("Column index out of range")}function X(ne,ae){if(ae.to1DArray&&(ae=ae.to1DArray()),ae.length!==ne.columns)throw new RangeError("vector size must be the same as the number of columns");return ae}function H(ne,ae){if(ae.to1DArray&&(ae=ae.to1DArray()),ae.length!==ne.rows)throw new RangeError("vector size must be the same as the number of rows");return ae}function Q(ne,ae){if(!y(ae))throw new TypeError("row indices must be an array");for(var P=0;P<ae.length;P++)if(ae[P]<0||ae[P]>=ne.rows)throw new RangeError("row indices are out of range")}function q(ne,ae){if(!y(ae))throw new TypeError("column indices must be an array");for(var P=0;P<ae.length;P++)if(ae[P]<0||ae[P]>=ne.columns)throw new RangeError("column indices are out of range")}function J(ne,ae,P,S,C){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(fe("startRow",ae),fe("endRow",P),fe("startColumn",S),fe("endColumn",C),ae>P||S>C||ae<0||ae>=ne.rows||P<0||P>=ne.rows||S<0||S>=ne.columns||C<0||C>=ne.columns)throw new RangeError("Submatrix indices are out of range")}function te(ne){for(var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,P=[],S=0;S<ne;S++)P.push(ae);return P}function fe(ne,ae){if(typeof ae!="number")throw new TypeError("".concat(ne," must be a number"))}function de(ne){if(ne.isEmpty())throw new Error("Empty matrix has no elements to index")}function Te(ne){for(var ae=te(ne.rows),P=0;P<ne.rows;++P)for(var S=0;S<ne.columns;++S)ae[P]+=ne.get(P,S);return ae}function Se(ne){for(var ae=te(ne.columns),P=0;P<ne.rows;++P)for(var S=0;S<ne.columns;++S)ae[S]+=ne.get(P,S);return ae}function Ie(ne){for(var ae=0,P=0;P<ne.rows;P++)for(var S=0;S<ne.columns;S++)ae+=ne.get(P,S);return ae}function be(ne){for(var ae=te(ne.rows,1),P=0;P<ne.rows;++P)for(var S=0;S<ne.columns;++S)ae[P]*=ne.get(P,S);return ae}function pe(ne){for(var ae=te(ne.columns,1),P=0;P<ne.rows;++P)for(var S=0;S<ne.columns;++S)ae[S]*=ne.get(P,S);return ae}function Me(ne){for(var ae=1,P=0;P<ne.rows;P++)for(var S=0;S<ne.columns;S++)ae*=ne.get(P,S);return ae}function De(ne,ae,P){for(var S=ne.rows,C=ne.columns,V=[],he=0;he<S;he++){for(var xe=0,Ee=0,Ne=0,Et=0;Et<C;Et++)Ne=ne.get(he,Et)-P[he],xe+=Ne,Ee+=Ne*Ne;ae?V.push((Ee-xe*xe/C)/(C-1)):V.push((Ee-xe*xe/C)/C)}return V}function Ue(ne,ae,P){for(var S=ne.rows,C=ne.columns,V=[],he=0;he<C;he++){for(var xe=0,Ee=0,Ne=0,Et=0;Et<S;Et++)Ne=ne.get(Et,he)-P[he],xe+=Ne,Ee+=Ne*Ne;ae?V.push((Ee-xe*xe/S)/(S-1)):V.push((Ee-xe*xe/S)/S)}return V}function nt(ne,ae,P){for(var S=ne.rows,C=ne.columns,V=S*C,he=0,xe=0,Ee=0,Ne=0;Ne<S;Ne++)for(var Et=0;Et<C;Et++)Ee=ne.get(Ne,Et)-P,he+=Ee,xe+=Ee*Ee;return ae?(xe-he*he/V)/(V-1):(xe-he*he/V)/V}function Ze(ne,ae){for(var P=0;P<ne.rows;P++)for(var S=0;S<ne.columns;S++)ne.set(P,S,ne.get(P,S)-ae[P])}function ht(ne,ae){for(var P=0;P<ne.rows;P++)for(var S=0;S<ne.columns;S++)ne.set(P,S,ne.get(P,S)-ae[S])}function Rt(ne,ae){for(var P=0;P<ne.rows;P++)for(var S=0;S<ne.columns;S++)ne.set(P,S,ne.get(P,S)-ae)}function tr(ne){for(var ae=[],P=0;P<ne.rows;P++){for(var S=0,C=0;C<ne.columns;C++)S+=Math.pow(ne.get(P,C),2)/(ne.columns-1);ae.push(Math.sqrt(S))}return ae}function Qe(ne,ae){for(var P=0;P<ne.rows;P++)for(var S=0;S<ne.columns;S++)ne.set(P,S,ne.get(P,S)/ae[P])}function lt(ne){for(var ae=[],P=0;P<ne.columns;P++){for(var S=0,C=0;C<ne.rows;C++)S+=Math.pow(ne.get(C,P),2)/(ne.rows-1);ae.push(Math.sqrt(S))}return ae}function St(ne,ae){for(var P=0;P<ne.rows;P++)for(var S=0;S<ne.columns;S++)ne.set(P,S,ne.get(P,S)/ae[S])}function Ct(ne){for(var ae=ne.size-1,P=0,S=0;S<ne.columns;S++)for(var C=0;C<ne.rows;C++)P+=Math.pow(ne.get(C,S),2)/ae;return Math.sqrt(P)}function _t(ne,ae){for(var P=0;P<ne.rows;P++)for(var S=0;S<ne.columns;S++)ne.set(P,S,ne.get(P,S)/ae)}var pt=function(){function ne(){(0,A.Z)(this,ne)}return(0,N.Z)(ne,[{key:"size",get:function(){return this.rows*this.columns}},{key:"apply",value:function(P){if(typeof P!="function")throw new TypeError("callback must be a function");for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)P.call(this,S,C);return this}},{key:"to1DArray",value:function(){for(var P=[],S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)P.push(this.get(S,C));return P}},{key:"to2DArray",value:function(){for(var P=[],S=0;S<this.rows;S++){P.push([]);for(var C=0;C<this.columns;C++)P[S].push(this.get(S,C))}return P}},{key:"toJSON",value:function(){return this.to2DArray()}},{key:"isRowVector",value:function(){return this.rows===1}},{key:"isColumnVector",value:function(){return this.columns===1}},{key:"isVector",value:function(){return this.rows===1||this.columns===1}},{key:"isSquare",value:function(){return this.rows===this.columns}},{key:"isEmpty",value:function(){return this.rows===0||this.columns===0}},{key:"isSymmetric",value:function(){if(this.isSquare()){for(var P=0;P<this.rows;P++)for(var S=0;S<=P;S++)if(this.get(P,S)!==this.get(S,P))return!1;return!0}return!1}},{key:"isEchelonForm",value:function(){for(var P=0,S=0,C=-1,V=!0,he=!1;P<this.rows&&V;){for(S=0,he=!1;S<this.columns&&he===!1;)this.get(P,S)===0?S++:this.get(P,S)===1&&S>C?(he=!0,C=S):(V=!1,he=!0);P++}return V}},{key:"isReducedEchelonForm",value:function(){for(var P=0,S=0,C=-1,V=!0,he=!1;P<this.rows&&V;){for(S=0,he=!1;S<this.columns&&he===!1;)this.get(P,S)===0?S++:this.get(P,S)===1&&S>C?(he=!0,C=S):(V=!1,he=!0);for(var xe=S+1;xe<this.rows;xe++)this.get(P,xe)!==0&&(V=!1);P++}return V}},{key:"echelonForm",value:function(){for(var P=this.clone(),S=0,C=0;S<P.rows&&C<P.columns;){for(var V=S,he=S;he<P.rows;he++)P.get(he,C)>P.get(V,C)&&(V=he);if(P.get(V,C)===0)C++;else{P.swapRows(S,V);for(var xe=P.get(S,C),Ee=C;Ee<P.columns;Ee++)P.set(S,Ee,P.get(S,Ee)/xe);for(var Ne=S+1;Ne<P.rows;Ne++){var Et=P.get(Ne,C)/P.get(S,C);P.set(Ne,C,0);for(var st=C+1;st<P.columns;st++)P.set(Ne,st,P.get(Ne,st)-P.get(S,st)*Et)}S++,C++}}return P}},{key:"reducedEchelonForm",value:function(){for(var P=this.echelonForm(),S=P.columns,C=P.rows,V=C-1;V>=0;)if(P.maxRow(V)===0)V--;else{for(var he=0,xe=!1;he<C&&xe===!1;)P.get(V,he)===1?xe=!0:he++;for(var Ee=0;Ee<V;Ee++)for(var Ne=P.get(Ee,he),Et=he;Et<S;Et++){var st=P.get(Ee,Et)-Ne*P.get(V,Et);P.set(Ee,Et,st)}V--}return P}},{key:"set",value:function(){throw new Error("set method is unimplemented")}},{key:"get",value:function(){throw new Error("get method is unimplemented")}},{key:"repeat",value:function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(typeof P!="object")throw new TypeError("options must be an object");var S=P.rows,C=S===void 0?1:S,V=P.columns,he=V===void 0?1:V;if(!Number.isInteger(C)||C<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(he)||he<=0)throw new TypeError("columns must be a positive integer");for(var xe=new Vt(this.rows*C,this.columns*he),Ee=0;Ee<C;Ee++)for(var Ne=0;Ne<he;Ne++)xe.setSubMatrix(this,this.rows*Ee,this.columns*Ne);return xe}},{key:"fill",value:function(P){for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,P);return this}},{key:"neg",value:function(){return this.mulS(-1)}},{key:"getRow",value:function(P){$(this,P);for(var S=[],C=0;C<this.columns;C++)S.push(this.get(P,C));return S}},{key:"getRowVector",value:function(P){return Vt.rowVector(this.getRow(P))}},{key:"setRow",value:function(P,S){$(this,P),S=X(this,S);for(var C=0;C<this.columns;C++)this.set(P,C,S[C]);return this}},{key:"swapRows",value:function(P,S){$(this,P),$(this,S);for(var C=0;C<this.columns;C++){var V=this.get(P,C);this.set(P,C,this.get(S,C)),this.set(S,C,V)}return this}},{key:"getColumn",value:function(P){W(this,P);for(var S=[],C=0;C<this.rows;C++)S.push(this.get(C,P));return S}},{key:"getColumnVector",value:function(P){return Vt.columnVector(this.getColumn(P))}},{key:"setColumn",value:function(P,S){W(this,P),S=H(this,S);for(var C=0;C<this.rows;C++)this.set(C,P,S[C]);return this}},{key:"swapColumns",value:function(P,S){W(this,P),W(this,S);for(var C=0;C<this.rows;C++){var V=this.get(C,P);this.set(C,P,this.get(C,S)),this.set(C,S,V)}return this}},{key:"addRowVector",value:function(P){P=X(this,P);for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,this.get(S,C)+P[C]);return this}},{key:"subRowVector",value:function(P){P=X(this,P);for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,this.get(S,C)-P[C]);return this}},{key:"mulRowVector",value:function(P){P=X(this,P);for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,this.get(S,C)*P[C]);return this}},{key:"divRowVector",value:function(P){P=X(this,P);for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,this.get(S,C)/P[C]);return this}},{key:"addColumnVector",value:function(P){P=H(this,P);for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,this.get(S,C)+P[S]);return this}},{key:"subColumnVector",value:function(P){P=H(this,P);for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,this.get(S,C)-P[S]);return this}},{key:"mulColumnVector",value:function(P){P=H(this,P);for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,this.get(S,C)*P[S]);return this}},{key:"divColumnVector",value:function(P){P=H(this,P);for(var S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)this.set(S,C,this.get(S,C)/P[S]);return this}},{key:"mulRow",value:function(P,S){$(this,P);for(var C=0;C<this.columns;C++)this.set(P,C,this.get(P,C)*S);return this}},{key:"mulColumn",value:function(P,S){W(this,P);for(var C=0;C<this.rows;C++)this.set(C,P,this.get(C,P)*S);return this}},{key:"max",value:function(P){if(this.isEmpty())return NaN;switch(P){case"row":{for(var S=new Array(this.rows).fill(Number.NEGATIVE_INFINITY),C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.get(C,V)>S[C]&&(S[C]=this.get(C,V));return S}case"column":{for(var he=new Array(this.columns).fill(Number.NEGATIVE_INFINITY),xe=0;xe<this.rows;xe++)for(var Ee=0;Ee<this.columns;Ee++)this.get(xe,Ee)>he[Ee]&&(he[Ee]=this.get(xe,Ee));return he}case void 0:{for(var Ne=this.get(0,0),Et=0;Et<this.rows;Et++)for(var st=0;st<this.columns;st++)this.get(Et,st)>Ne&&(Ne=this.get(Et,st));return Ne}default:throw new Error("invalid option: ".concat(P))}}},{key:"maxIndex",value:function(){de(this);for(var P=this.get(0,0),S=[0,0],C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.get(C,V)>P&&(P=this.get(C,V),S[0]=C,S[1]=V);return S}},{key:"min",value:function(P){if(this.isEmpty())return NaN;switch(P){case"row":{for(var S=new Array(this.rows).fill(Number.POSITIVE_INFINITY),C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.get(C,V)<S[C]&&(S[C]=this.get(C,V));return S}case"column":{for(var he=new Array(this.columns).fill(Number.POSITIVE_INFINITY),xe=0;xe<this.rows;xe++)for(var Ee=0;Ee<this.columns;Ee++)this.get(xe,Ee)<he[Ee]&&(he[Ee]=this.get(xe,Ee));return he}case void 0:{for(var Ne=this.get(0,0),Et=0;Et<this.rows;Et++)for(var st=0;st<this.columns;st++)this.get(Et,st)<Ne&&(Ne=this.get(Et,st));return Ne}default:throw new Error("invalid option: ".concat(P))}}},{key:"minIndex",value:function(){de(this);for(var P=this.get(0,0),S=[0,0],C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)this.get(C,V)<P&&(P=this.get(C,V),S[0]=C,S[1]=V);return S}},{key:"maxRow",value:function(P){if($(this,P),this.isEmpty())return NaN;for(var S=this.get(P,0),C=1;C<this.columns;C++)this.get(P,C)>S&&(S=this.get(P,C));return S}},{key:"maxRowIndex",value:function(P){$(this,P),de(this);for(var S=this.get(P,0),C=[P,0],V=1;V<this.columns;V++)this.get(P,V)>S&&(S=this.get(P,V),C[1]=V);return C}},{key:"minRow",value:function(P){if($(this,P),this.isEmpty())return NaN;for(var S=this.get(P,0),C=1;C<this.columns;C++)this.get(P,C)<S&&(S=this.get(P,C));return S}},{key:"minRowIndex",value:function(P){$(this,P),de(this);for(var S=this.get(P,0),C=[P,0],V=1;V<this.columns;V++)this.get(P,V)<S&&(S=this.get(P,V),C[1]=V);return C}},{key:"maxColumn",value:function(P){if(W(this,P),this.isEmpty())return NaN;for(var S=this.get(0,P),C=1;C<this.rows;C++)this.get(C,P)>S&&(S=this.get(C,P));return S}},{key:"maxColumnIndex",value:function(P){W(this,P),de(this);for(var S=this.get(0,P),C=[0,P],V=1;V<this.rows;V++)this.get(V,P)>S&&(S=this.get(V,P),C[0]=V);return C}},{key:"minColumn",value:function(P){if(W(this,P),this.isEmpty())return NaN;for(var S=this.get(0,P),C=1;C<this.rows;C++)this.get(C,P)<S&&(S=this.get(C,P));return S}},{key:"minColumnIndex",value:function(P){W(this,P),de(this);for(var S=this.get(0,P),C=[0,P],V=1;V<this.rows;V++)this.get(V,P)<S&&(S=this.get(V,P),C[0]=V);return C}},{key:"diag",value:function(){for(var P=Math.min(this.rows,this.columns),S=[],C=0;C<P;C++)S.push(this.get(C,C));return S}},{key:"norm",value:function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"frobenius",S=0;if(P==="max")return this.max();if(P==="frobenius"){for(var C=0;C<this.rows;C++)for(var V=0;V<this.columns;V++)S=S+this.get(C,V)*this.get(C,V);return Math.sqrt(S)}else throw new RangeError("unknown norm type: ".concat(P))}},{key:"cumulativeSum",value:function(){for(var P=0,S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)P+=this.get(S,C),this.set(S,C,P);return this}},{key:"dot",value:function(P){ne.isMatrix(P)&&(P=P.to1DArray());var S=this.to1DArray();if(S.length!==P.length)throw new RangeError("vectors do not have the same size");for(var C=0,V=0;V<S.length;V++)C+=S[V]*P[V];return C}},{key:"mmul",value:function(P){P=Vt.checkMatrix(P);for(var S=this.rows,C=this.columns,V=P.columns,he=new Vt(S,V),xe=new Float64Array(C),Ee=0;Ee<V;Ee++){for(var Ne=0;Ne<C;Ne++)xe[Ne]=P.get(Ne,Ee);for(var Et=0;Et<S;Et++){for(var st=0,Pt=0;Pt<C;Pt++)st+=this.get(Et,Pt)*xe[Pt];he.set(Et,Ee,st)}}return he}},{key:"strassen2x2",value:function(P){P=Vt.checkMatrix(P);var S=new Vt(2,2),C=this.get(0,0),V=P.get(0,0),he=this.get(0,1),xe=P.get(0,1),Ee=this.get(1,0),Ne=P.get(1,0),Et=this.get(1,1),st=P.get(1,1),Pt=(C+Et)*(V+st),$t=(Ee+Et)*V,Ht=C*(xe-st),Br=Et*(Ne-V),hn=(C+he)*st,Ot=(Ee-C)*(V+xe),Qt=(he-Et)*(Ne+st),pr=Pt+Br-hn+Qt,en=Ht+hn,Nr=$t+Br,ta=Pt-$t+Ht+Ot;return S.set(0,0,pr),S.set(0,1,en),S.set(1,0,Nr),S.set(1,1,ta),S}},{key:"strassen3x3",value:function(P){P=Vt.checkMatrix(P);var S=new Vt(3,3),C=this.get(0,0),V=this.get(0,1),he=this.get(0,2),xe=this.get(1,0),Ee=this.get(1,1),Ne=this.get(1,2),Et=this.get(2,0),st=this.get(2,1),Pt=this.get(2,2),$t=P.get(0,0),Ht=P.get(0,1),Br=P.get(0,2),hn=P.get(1,0),Ot=P.get(1,1),Qt=P.get(1,2),pr=P.get(2,0),en=P.get(2,1),Nr=P.get(2,2),ta=(C+V+he-xe-Ee-st-Pt)*Ot,kn=(C-xe)*(-Ht+Ot),En=Ee*(-$t+Ht+hn-Ot-Qt-pr+Nr),Rn=(-C+xe+Ee)*($t-Ht+Ot),Yn=(xe+Ee)*(-$t+Ht),bn=C*$t,je=(-C+Et+st)*($t-Br+Qt),Ce=(-C+Et)*(Br-Qt),Xe=(Et+st)*(-$t+Br),ut=(C+V+he-Ee-Ne-Et-st)*Qt,ot=st*(-$t+Br+hn-Ot-Qt-pr+en),bt=(-he+st+Pt)*(Ot+pr-en),Xt=(he-Pt)*(Ot-en),wr=he*pr,Wr=(st+Pt)*(-pr+en),on=(-he+Ee+Ne)*(Qt+pr-Nr),xn=(he-Ne)*(Qt-Nr),zn=(Ee+Ne)*(-pr+Nr),Qn=V*hn,ia=Ne*en,Wa=xe*Br,Ia=Et*Ht,Ba=Pt*Nr,Ea=bn+wr+Qn,qa=ta+Rn+Yn+bn+bt+wr+Wr,si=bn+je+Xe+ut+wr+on+zn,_a=kn+En+Rn+bn+wr+on+xn,So=kn+Rn+Yn+bn+ia,to=wr+on+xn+zn+Wa,co=bn+je+Ce+ot+bt+Xt+wr,ni=bt+Xt+wr+Wr+Ia,lo=bn+je+Ce+Xe+Ba;return S.set(0,0,Ea),S.set(0,1,qa),S.set(0,2,si),S.set(1,0,_a),S.set(1,1,So),S.set(1,2,to),S.set(2,0,co),S.set(2,1,ni),S.set(2,2,lo),S}},{key:"mmulStrassen",value:function(P){P=Vt.checkMatrix(P);var S=this.clone(),C=S.rows,V=S.columns,he=P.rows,xe=P.columns;V!==he&&console.warn("Multiplying ".concat(C," x ").concat(V," and ").concat(he," x ").concat(xe," matrix: dimensions do not match."));function Ee(Pt,$t,Ht){var Br=Pt.rows,hn=Pt.columns;if(Br===$t&&hn===Ht)return Pt;var Ot=ne.zeros($t,Ht);return Ot=Ot.setSubMatrix(Pt,0,0),Ot}var Ne=Math.max(C,he),Et=Math.max(V,xe);S=Ee(S,Ne,Et),P=Ee(P,Ne,Et);function st(Pt,$t,Ht,Br){if(Ht<=512||Br<=512)return Pt.mmul($t);Ht%2==1&&Br%2==1?(Pt=Ee(Pt,Ht+1,Br+1),$t=Ee($t,Ht+1,Br+1)):Ht%2==1?(Pt=Ee(Pt,Ht+1,Br),$t=Ee($t,Ht+1,Br)):Br%2==1&&(Pt=Ee(Pt,Ht,Br+1),$t=Ee($t,Ht,Br+1));var hn=parseInt(Pt.rows/2,10),Ot=parseInt(Pt.columns/2,10),Qt=Pt.subMatrix(0,hn-1,0,Ot-1),pr=$t.subMatrix(0,hn-1,0,Ot-1),en=Pt.subMatrix(0,hn-1,Ot,Pt.columns-1),Nr=$t.subMatrix(0,hn-1,Ot,$t.columns-1),ta=Pt.subMatrix(hn,Pt.rows-1,0,Ot-1),kn=$t.subMatrix(hn,$t.rows-1,0,Ot-1),En=Pt.subMatrix(hn,Pt.rows-1,Ot,Pt.columns-1),Rn=$t.subMatrix(hn,$t.rows-1,Ot,$t.columns-1),Yn=st(ne.add(Qt,En),ne.add(pr,Rn),hn,Ot),bn=st(ne.add(ta,En),pr,hn,Ot),je=st(Qt,ne.sub(Nr,Rn),hn,Ot),Ce=st(En,ne.sub(kn,pr),hn,Ot),Xe=st(ne.add(Qt,en),Rn,hn,Ot),ut=st(ne.sub(ta,Qt),ne.add(pr,Nr),hn,Ot),ot=st(ne.sub(en,En),ne.add(kn,Rn),hn,Ot),bt=ne.add(Yn,Ce);bt.sub(Xe),bt.add(ot);var Xt=ne.add(je,Xe),wr=ne.add(bn,Ce),Wr=ne.sub(Yn,bn);Wr.add(je),Wr.add(ut);var on=ne.zeros(2*bt.rows,2*bt.columns);return on=on.setSubMatrix(bt,0,0),on=on.setSubMatrix(Xt,bt.rows,0),on=on.setSubMatrix(wr,0,bt.columns),on=on.setSubMatrix(Wr,bt.rows,bt.columns),on.subMatrix(0,Ht-1,0,Br-1)}return st(S,P,Ne,Et)}},{key:"scaleRows",value:function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(typeof P!="object")throw new TypeError("options must be an object");var S=P.min,C=S===void 0?0:S,V=P.max,he=V===void 0?1:V;if(!Number.isFinite(C))throw new TypeError("min must be a number");if(!Number.isFinite(he))throw new TypeError("max must be a number");if(C>=he)throw new RangeError("min must be smaller than max");for(var xe=new Vt(this.rows,this.columns),Ee=0;Ee<this.rows;Ee++){var Ne=this.getRow(Ee);Ne.length>0&&g(Ne,{min:C,max:he,output:Ne}),xe.setRow(Ee,Ne)}return xe}},{key:"scaleColumns",value:function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(typeof P!="object")throw new TypeError("options must be an object");var S=P.min,C=S===void 0?0:S,V=P.max,he=V===void 0?1:V;if(!Number.isFinite(C))throw new TypeError("min must be a number");if(!Number.isFinite(he))throw new TypeError("max must be a number");if(C>=he)throw new RangeError("min must be smaller than max");for(var xe=new Vt(this.rows,this.columns),Ee=0;Ee<this.columns;Ee++){var Ne=this.getColumn(Ee);Ne.length&&g(Ne,{min:C,max:he,output:Ne}),xe.setColumn(Ee,Ne)}return xe}},{key:"flipRows",value:function(){for(var P=Math.ceil(this.columns/2),S=0;S<this.rows;S++)for(var C=0;C<P;C++){var V=this.get(S,C),he=this.get(S,this.columns-1-C);this.set(S,C,he),this.set(S,this.columns-1-C,V)}return this}},{key:"flipColumns",value:function(){for(var P=Math.ceil(this.rows/2),S=0;S<this.columns;S++)for(var C=0;C<P;C++){var V=this.get(C,S),he=this.get(this.rows-1-C,S);this.set(C,S,he),this.set(this.rows-1-C,S,V)}return this}},{key:"kroneckerProduct",value:function(P){P=Vt.checkMatrix(P);for(var S=this.rows,C=this.columns,V=P.rows,he=P.columns,xe=new Vt(S*V,C*he),Ee=0;Ee<S;Ee++)for(var Ne=0;Ne<C;Ne++)for(var Et=0;Et<V;Et++)for(var st=0;st<he;st++)xe.set(V*Ee+Et,he*Ne+st,this.get(Ee,Ne)*P.get(Et,st));return xe}},{key:"kroneckerSum",value:function(P){if(P=Vt.checkMatrix(P),!this.isSquare()||!P.isSquare())throw new Error("Kronecker Sum needs two Square Matrices");var S=this.rows,C=P.rows,V=this.kroneckerProduct(Vt.eye(C,C)),he=Vt.eye(S,S).kroneckerProduct(P);return V.add(he)}},{key:"transpose",value:function(){for(var P=new Vt(this.columns,this.rows),S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)P.set(C,S,this.get(S,C));return P}},{key:"sortRows",value:function(){for(var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rr,S=0;S<this.rows;S++)this.setRow(S,this.getRow(S).sort(P));return this}},{key:"sortColumns",value:function(){for(var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rr,S=0;S<this.columns;S++)this.setColumn(S,this.getColumn(S).sort(P));return this}},{key:"subMatrix",value:function(P,S,C,V){J(this,P,S,C,V);for(var he=new Vt(S-P+1,V-C+1),xe=P;xe<=S;xe++)for(var Ee=C;Ee<=V;Ee++)he.set(xe-P,Ee-C,this.get(xe,Ee));return he}},{key:"subMatrixRow",value:function(P,S,C){if(S===void 0&&(S=0),C===void 0&&(C=this.columns-1),S>C||S<0||S>=this.columns||C<0||C>=this.columns)throw new RangeError("Argument out of range");for(var V=new Vt(P.length,C-S+1),he=0;he<P.length;he++)for(var xe=S;xe<=C;xe++){if(P[he]<0||P[he]>=this.rows)throw new RangeError("Row index out of range: ".concat(P[he]));V.set(he,xe-S,this.get(P[he],xe))}return V}},{key:"subMatrixColumn",value:function(P,S,C){if(S===void 0&&(S=0),C===void 0&&(C=this.rows-1),S>C||S<0||S>=this.rows||C<0||C>=this.rows)throw new RangeError("Argument out of range");for(var V=new Vt(C-S+1,P.length),he=0;he<P.length;he++)for(var xe=S;xe<=C;xe++){if(P[he]<0||P[he]>=this.columns)throw new RangeError("Column index out of range: ".concat(P[he]));V.set(xe-S,he,this.get(xe,P[he]))}return V}},{key:"setSubMatrix",value:function(P,S,C){if(P=Vt.checkMatrix(P),P.isEmpty())return this;var V=S+P.rows-1,he=C+P.columns-1;J(this,S,V,C,he);for(var xe=0;xe<P.rows;xe++)for(var Ee=0;Ee<P.columns;Ee++)this.set(S+xe,C+Ee,P.get(xe,Ee));return this}},{key:"selection",value:function(P,S){Q(this,P),q(this,S);for(var C=new Vt(P.length,S.length),V=0;V<P.length;V++)for(var he=P[V],xe=0;xe<S.length;xe++){var Ee=S[xe];C.set(V,xe,this.get(he,Ee))}return C}},{key:"trace",value:function(){for(var P=Math.min(this.rows,this.columns),S=0,C=0;C<P;C++)S+=this.get(C,C);return S}},{key:"clone",value:function(){for(var P=new Vt(this.rows,this.columns),S=0;S<this.rows;S++)for(var C=0;C<this.columns;C++)P.set(S,C,this.get(S,C));return P}},{key:"sum",value:function(P){switch(P){case"row":return Te(this);case"column":return Se(this);case void 0:return Ie(this);default:throw new Error("invalid option: ".concat(P))}}},{key:"product",value:function(P){switch(P){case"row":return be(this);case"column":return pe(this);case void 0:return Me(this);default:throw new Error("invalid option: ".concat(P))}}},{key:"mean",value:function(P){var S=this.sum(P);switch(P){case"row":{for(var C=0;C<this.rows;C++)S[C]/=this.columns;return S}case"column":{for(var V=0;V<this.columns;V++)S[V]/=this.rows;return S}case void 0:return S/this.size;default:throw new Error("invalid option: ".concat(P))}}},{key:"variance",value:function(P){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof P=="object"&&(S=P,P=void 0),typeof S!="object")throw new TypeError("options must be an object");var C=S,V=C.unbiased,he=V===void 0?!0:V,xe=C.mean,Ee=xe===void 0?this.mean(P):xe;if(typeof he!="boolean")throw new TypeError("unbiased must be a boolean");switch(P){case"row":{if(!y(Ee))throw new TypeError("mean must be an array");return De(this,he,Ee)}case"column":{if(!y(Ee))throw new TypeError("mean must be an array");return Ue(this,he,Ee)}case void 0:{if(typeof Ee!="number")throw new TypeError("mean must be a number");return nt(this,he,Ee)}default:throw new Error("invalid option: ".concat(P))}}},{key:"standardDeviation",value:function(P,S){typeof P=="object"&&(S=P,P=void 0);var C=this.variance(P,S);if(P===void 0)return Math.sqrt(C);for(var V=0;V<C.length;V++)C[V]=Math.sqrt(C[V]);return C}},{key:"center",value:function(P){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof P=="object"&&(S=P,P=void 0),typeof S!="object")throw new TypeError("options must be an object");var C=S,V=C.center,he=V===void 0?this.mean(P):V;switch(P){case"row":{if(!y(he))throw new TypeError("center must be an array");return Ze(this,he),this}case"column":{if(!y(he))throw new TypeError("center must be an array");return ht(this,he),this}case void 0:{if(typeof he!="number")throw new TypeError("center must be a number");return Rt(this,he),this}default:throw new Error("invalid option: ".concat(P))}}},{key:"scale",value:function(P){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof P=="object"&&(S=P,P=void 0),typeof S!="object")throw new TypeError("options must be an object");var C=S.scale;switch(P){case"row":{if(C===void 0)C=tr(this);else if(!y(C))throw new TypeError("scale must be an array");return Qe(this,C),this}case"column":{if(C===void 0)C=lt(this);else if(!y(C))throw new TypeError("scale must be an array");return St(this,C),this}case void 0:{if(C===void 0)C=Ct(this);else if(typeof C!="number")throw new TypeError("scale must be a number");return _t(this,C),this}default:throw new Error("invalid option: ".concat(P))}}},{key:"toString",value:function(P){return w(this,P)}}],[{key:"from1DArray",value:function(P,S,C){var V=P*S;if(V!==C.length)throw new RangeError("data length does not match given dimensions");for(var he=new Vt(P,S),xe=0;xe<P;xe++)for(var Ee=0;Ee<S;Ee++)he.set(xe,Ee,C[xe*S+Ee]);return he}},{key:"rowVector",value:function(P){for(var S=new Vt(1,P.length),C=0;C<P.length;C++)S.set(0,C,P[C]);return S}},{key:"columnVector",value:function(P){for(var S=new Vt(P.length,1),C=0;C<P.length;C++)S.set(C,0,P[C]);return S}},{key:"zeros",value:function(P,S){return new Vt(P,S)}},{key:"ones",value:function(P,S){return new Vt(P,S).fill(1)}},{key:"rand",value:function(P,S){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof C!="object")throw new TypeError("options must be an object");for(var V=C.random,he=V===void 0?Math.random:V,xe=new Vt(P,S),Ee=0;Ee<P;Ee++)for(var Ne=0;Ne<S;Ne++)xe.set(Ee,Ne,he());return xe}},{key:"randInt",value:function(P,S){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof C!="object")throw new TypeError("options must be an object");var V=C.min,he=V===void 0?0:V,xe=C.max,Ee=xe===void 0?1e3:xe,Ne=C.random,Et=Ne===void 0?Math.random:Ne;if(!Number.isInteger(he))throw new TypeError("min must be an integer");if(!Number.isInteger(Ee))throw new TypeError("max must be an integer");if(he>=Ee)throw new RangeError("min must be smaller than max");for(var st=Ee-he,Pt=new Vt(P,S),$t=0;$t<P;$t++)for(var Ht=0;Ht<S;Ht++){var Br=he+Math.round(Et()*st);Pt.set($t,Ht,Br)}return Pt}},{key:"eye",value:function(P,S,C){S===void 0&&(S=P),C===void 0&&(C=1);for(var V=Math.min(P,S),he=this.zeros(P,S),xe=0;xe<V;xe++)he.set(xe,xe,C);return he}},{key:"diag",value:function(P,S,C){var V=P.length;S===void 0&&(S=V),C===void 0&&(C=S);for(var he=Math.min(V,S,C),xe=this.zeros(S,C),Ee=0;Ee<he;Ee++)xe.set(Ee,Ee,P[Ee]);return xe}},{key:"min",value:function(P,S){P=this.checkMatrix(P),S=this.checkMatrix(S);for(var C=P.rows,V=P.columns,he=new Vt(C,V),xe=0;xe<C;xe++)for(var Ee=0;Ee<V;Ee++)he.set(xe,Ee,Math.min(P.get(xe,Ee),S.get(xe,Ee)));return he}},{key:"max",value:function(P,S){P=this.checkMatrix(P),S=this.checkMatrix(S);for(var C=P.rows,V=P.columns,he=new this(C,V),xe=0;xe<C;xe++)for(var Ee=0;Ee<V;Ee++)he.set(xe,Ee,Math.max(P.get(xe,Ee),S.get(xe,Ee)));return he}},{key:"checkMatrix",value:function(P){return ne.isMatrix(P)?P:new Vt(P)}},{key:"isMatrix",value:function(P){return P!=null&&P.klass==="Matrix"}}]),ne}();pt.prototype.klass="Matrix",typeof Symbol!="undefined"&&(pt.prototype[Symbol.for("nodejs.util.inspect.custom")]=E);function rr(ne,ae){return ne-ae}function xr(ne){return ne.every(function(ae){return typeof ae=="number"})}pt.random=pt.rand,pt.randomInt=pt.randInt,pt.diagonal=pt.diag,pt.prototype.diagonal=pt.prototype.diag,pt.identity=pt.eye,pt.prototype.negate=pt.prototype.neg,pt.prototype.tensorProduct=pt.prototype.kroneckerProduct;var Vt=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S,C){var V;if((0,A.Z)(this,P),V=ae.call(this),P.isMatrix(S))return(0,B.Z)(V,S.clone());if(Number.isInteger(S)&&S>=0)if(V.data=[],Number.isInteger(C)&&C>=0)for(var he=0;he<S;he++)V.data.push(new Float64Array(C));else throw new TypeError("nColumns must be a positive integer");else if(y(S)){var xe=S;if(S=xe.length,C=S?xe[0].length:0,typeof C!="number")throw new TypeError("Data must be a 2D array with at least one element");V.data=[];for(var Ee=0;Ee<S;Ee++){if(xe[Ee].length!==C)throw new RangeError("Inconsistent array dimensions");if(!xr(xe[Ee]))throw new TypeError("Input data contains non-numeric values");V.data.push(Float64Array.from(xe[Ee]))}}else throw new TypeError("First argument must be a positive number or an array");return V.rows=S,V.columns=C,V}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.data[C][V]=he,this}},{key:"get",value:function(C,V){return this.data[C][V]}},{key:"removeRow",value:function(C){return $(this,C),this.data.splice(C,1),this.rows-=1,this}},{key:"addRow",value:function(C,V){return V===void 0&&(V=C,C=this.rows),$(this,C,!0),V=Float64Array.from(X(this,V)),this.data.splice(C,0,V),this.rows+=1,this}},{key:"removeColumn",value:function(C){W(this,C);for(var V=0;V<this.rows;V++){for(var he=new Float64Array(this.columns-1),xe=0;xe<C;xe++)he[xe]=this.data[V][xe];for(var Ee=C+1;Ee<this.columns;Ee++)he[Ee-1]=this.data[V][Ee];this.data[V]=he}return this.columns-=1,this}},{key:"addColumn",value:function(C,V){typeof V=="undefined"&&(V=C,C=this.columns),W(this,C,!0),V=H(this,V);for(var he=0;he<this.rows;he++){for(var xe=new Float64Array(this.columns+1),Ee=0;Ee<C;Ee++)xe[Ee]=this.data[he][Ee];for(xe[Ee++]=V[he];Ee<this.columns+1;Ee++)xe[Ee]=this.data[he][Ee-1];this.data[he]=xe}return this.columns+=1,this}}]),P}(pt);m(pt,Vt);var ft=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S,C,V){var he;return(0,A.Z)(this,P),he=ae.call(this),he.matrix=S,he.rows=C,he.columns=V,he}return(0,N.Z)(P)}(pt),Bt=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S,C){var V;return(0,A.Z)(this,P),W(S,C),V=ae.call(this,S,S.rows,1),V.column=C,V}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.matrix.set(C,this.column,he),this}},{key:"get",value:function(C){return this.matrix.get(C,this.column)}}]),P}(ft),qt=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S,C){var V;return(0,A.Z)(this,P),q(S,C),V=ae.call(this,S,S.rows,C.length),V.columnIndices=C,V}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.matrix.set(C,this.columnIndices[V],he),this}},{key:"get",value:function(C,V){return this.matrix.get(C,this.columnIndices[V])}}]),P}(ft),br=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S){return(0,A.Z)(this,P),ae.call(this,S,S.rows,S.columns)}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.matrix.set(C,this.columns-V-1,he),this}},{key:"get",value:function(C,V){return this.matrix.get(C,this.columns-V-1)}}]),P}(ft),Ur=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S){return(0,A.Z)(this,P),ae.call(this,S,S.rows,S.columns)}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.matrix.set(this.rows-C-1,V,he),this}},{key:"get",value:function(C,V){return this.matrix.get(this.rows-C-1,V)}}]),P}(ft),Ae=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S,C){var V;return(0,A.Z)(this,P),$(S,C),V=ae.call(this,S,1,S.columns),V.row=C,V}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.matrix.set(this.row,V,he),this}},{key:"get",value:function(C,V){return this.matrix.get(this.row,V)}}]),P}(ft),Hr=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S,C){var V;return(0,A.Z)(this,P),Q(S,C),V=ae.call(this,S,C.length,S.columns),V.rowIndices=C,V}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.matrix.set(this.rowIndices[C],V,he),this}},{key:"get",value:function(C,V){return this.matrix.get(this.rowIndices[C],V)}}]),P}(ft),Sr=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S,C,V){var he;return(0,A.Z)(this,P),Q(S,C),q(S,V),he=ae.call(this,S,C.length,V.length),he.rowIndices=C,he.columnIndices=V,he}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.matrix.set(this.rowIndices[C],this.columnIndices[V],he),this}},{key:"get",value:function(C,V){return this.matrix.get(this.rowIndices[C],this.columnIndices[V])}}]),P}(ft),qr=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S,C,V,he,xe){var Ee;return(0,A.Z)(this,P),J(S,C,V,he,xe),Ee=ae.call(this,S,V-C+1,xe-he+1),Ee.startRow=C,Ee.startColumn=he,Ee}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.matrix.set(this.startRow+C,this.startColumn+V,he),this}},{key:"get",value:function(C,V){return this.matrix.get(this.startRow+C,this.startColumn+V)}}]),P}(ft),Gr=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S){return(0,A.Z)(this,P),ae.call(this,S,S.columns,S.rows)}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.matrix.set(V,C,he),this}},{key:"get",value:function(C,V){return this.matrix.get(V,C)}}]),P}(ft),vn=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S){var C,V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,A.Z)(this,P);var he=V.rows,xe=he===void 0?1:he;if(S.length%xe!=0)throw new Error("the data length is not divisible by the number of rows");return C=ae.call(this),C.rows=xe,C.columns=S.length/xe,C.data=S,C}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){var xe=this._calculateIndex(C,V);return this.data[xe]=he,this}},{key:"get",value:function(C,V){var he=this._calculateIndex(C,V);return this.data[he]}},{key:"_calculateIndex",value:function(C,V){return C*this.columns+V}}]),P}(pt),Gn=function(ne){(0,j.Z)(P,ne);var ae=(0,R.Z)(P);function P(S){var C;return(0,A.Z)(this,P),C=ae.call(this),C.data=S,C.rows=S.length,C.columns=S[0].length,C}return(0,N.Z)(P,[{key:"set",value:function(C,V,he){return this.data[C][V]=he,this}},{key:"get",value:function(C,V){return this.data[C][V]}}]),P}(pt);function mn(ne,ae){if(y(ne))return ne[0]&&y(ne[0])?new Gn(ne):new vn(ne,ae);throw new Error("the argument is not an array")}var $r=function(){function ne(ae){(0,A.Z)(this,ne),ae=Gn.checkMatrix(ae);var P=ae.clone(),S=P.rows,C=P.columns,V=new Float64Array(S),he=1,xe,Ee,Ne,Et,st,Pt,$t,Ht,Br;for(xe=0;xe<S;xe++)V[xe]=xe;for(Ht=new Float64Array(S),Ee=0;Ee<C;Ee++){for(xe=0;xe<S;xe++)Ht[xe]=P.get(xe,Ee);for(xe=0;xe<S;xe++){for(Br=Math.min(xe,Ee),st=0,Ne=0;Ne<Br;Ne++)st+=P.get(xe,Ne)*Ht[Ne];Ht[xe]-=st,P.set(xe,Ee,Ht[xe])}for(Et=Ee,xe=Ee+1;xe<S;xe++)Math.abs(Ht[xe])>Math.abs(Ht[Et])&&(Et=xe);if(Et!==Ee){for(Ne=0;Ne<C;Ne++)Pt=P.get(Et,Ne),P.set(Et,Ne,P.get(Ee,Ne)),P.set(Ee,Ne,Pt);$t=V[Et],V[Et]=V[Ee],V[Ee]=$t,he=-he}if(Ee<S&&P.get(Ee,Ee)!==0)for(xe=Ee+1;xe<S;xe++)P.set(xe,Ee,P.get(xe,Ee)/P.get(Ee,Ee))}this.LU=P,this.pivotVector=V,this.pivotSign=he}return(0,N.Z)(ne,[{key:"isSingular",value:function(){for(var P=this.LU,S=P.columns,C=0;C<S;C++)if(P.get(C,C)===0)return!0;return!1}},{key:"solve",value:function(P){P=Vt.checkMatrix(P);var S=this.LU,C=S.rows;if(C!==P.rows)throw new Error("Invalid matrix dimensions");if(this.isSingular())throw new Error("LU matrix is singular");var V=P.columns,he=P.subMatrixRow(this.pivotVector,0,V-1),xe=S.columns,Ee,Ne,Et;for(Et=0;Et<xe;Et++)for(Ee=Et+1;Ee<xe;Ee++)for(Ne=0;Ne<V;Ne++)he.set(Ee,Ne,he.get(Ee,Ne)-he.get(Et,Ne)*S.get(Ee,Et));for(Et=xe-1;Et>=0;Et--){for(Ne=0;Ne<V;Ne++)he.set(Et,Ne,he.get(Et,Ne)/S.get(Et,Et));for(Ee=0;Ee<Et;Ee++)for(Ne=0;Ne<V;Ne++)he.set(Ee,Ne,he.get(Ee,Ne)-he.get(Et,Ne)*S.get(Ee,Et))}return he}},{key:"determinant",get:function(){var P=this.LU;if(!P.isSquare())throw new Error("Matrix must be square");for(var S=this.pivotSign,C=P.columns,V=0;V<C;V++)S*=P.get(V,V);return S}},{key:"lowerTriangularMatrix",get:function(){for(var P=this.LU,S=P.rows,C=P.columns,V=new Vt(S,C),he=0;he<S;he++)for(var xe=0;xe<C;xe++)he>xe?V.set(he,xe,P.get(he,xe)):he===xe?V.set(he,xe,1):V.set(he,xe,0);return V}},{key:"upperTriangularMatrix",get:function(){for(var P=this.LU,S=P.rows,C=P.columns,V=new Vt(S,C),he=0;he<S;he++)for(var xe=0;xe<C;xe++)he<=xe?V.set(he,xe,P.get(he,xe)):V.set(he,xe,0);return V}},{key:"pivotPermutationVector",get:function(){return Array.from(this.pivotVector)}}]),ne}();function gn(ne,ae){var P=0;return Math.abs(ne)>Math.abs(ae)?(P=ae/ne,Math.abs(ne)*Math.sqrt(1+P*P)):ae!==0?(P=ne/ae,Math.abs(ae)*Math.sqrt(1+P*P)):0}var Rr=function(){function ne(ae){(0,A.Z)(this,ne),ae=Gn.checkMatrix(ae);var P=ae.clone(),S=ae.rows,C=ae.columns,V=new Float64Array(C),he,xe,Ee,Ne;for(Ee=0;Ee<C;Ee++){var Et=0;for(he=Ee;he<S;he++)Et=gn(Et,P.get(he,Ee));if(Et!==0){for(P.get(Ee,Ee)<0&&(Et=-Et),he=Ee;he<S;he++)P.set(he,Ee,P.get(he,Ee)/Et);for(P.set(Ee,Ee,P.get(Ee,Ee)+1),xe=Ee+1;xe<C;xe++){for(Ne=0,he=Ee;he<S;he++)Ne+=P.get(he,Ee)*P.get(he,xe);for(Ne=-Ne/P.get(Ee,Ee),he=Ee;he<S;he++)P.set(he,xe,P.get(he,xe)+Ne*P.get(he,Ee))}}V[Ee]=-Et}this.QR=P,this.Rdiag=V}return(0,N.Z)(ne,[{key:"solve",value:function(P){P=Vt.checkMatrix(P);var S=this.QR,C=S.rows;if(P.rows!==C)throw new Error("Matrix row dimensions must agree");if(!this.isFullRank())throw new Error("Matrix is rank deficient");var V=P.columns,he=P.clone(),xe=S.columns,Ee,Ne,Et,st;for(Et=0;Et<xe;Et++)for(Ne=0;Ne<V;Ne++){for(st=0,Ee=Et;Ee<C;Ee++)st+=S.get(Ee,Et)*he.get(Ee,Ne);for(st=-st/S.get(Et,Et),Ee=Et;Ee<C;Ee++)he.set(Ee,Ne,he.get(Ee,Ne)+st*S.get(Ee,Et))}for(Et=xe-1;Et>=0;Et--){for(Ne=0;Ne<V;Ne++)he.set(Et,Ne,he.get(Et,Ne)/this.Rdiag[Et]);for(Ee=0;Ee<Et;Ee++)for(Ne=0;Ne<V;Ne++)he.set(Ee,Ne,he.get(Ee,Ne)-he.get(Et,Ne)*S.get(Ee,Et))}return he.subMatrix(0,xe-1,0,V-1)}},{key:"isFullRank",value:function(){for(var P=this.QR.columns,S=0;S<P;S++)if(this.Rdiag[S]===0)return!1;return!0}},{key:"upperTriangularMatrix",get:function(){var P=this.QR,S=P.columns,C=new Vt(S,S),V,he;for(V=0;V<S;V++)for(he=0;he<S;he++)V<he?C.set(V,he,P.get(V,he)):V===he?C.set(V,he,this.Rdiag[V]):C.set(V,he,0);return C}},{key:"orthogonalMatrix",get:function(){var P=this.QR,S=P.rows,C=P.columns,V=new Vt(S,C),he,xe,Ee,Ne;for(Ee=C-1;Ee>=0;Ee--){for(he=0;he<S;he++)V.set(he,Ee,0);for(V.set(Ee,Ee,1),xe=Ee;xe<C;xe++)if(P.get(Ee,Ee)!==0){for(Ne=0,he=Ee;he<S;he++)Ne+=P.get(he,Ee)*V.get(he,xe);for(Ne=-Ne/P.get(Ee,Ee),he=Ee;he<S;he++)V.set(he,xe,V.get(he,xe)+Ne*P.get(he,Ee))}}return V}}]),ne}(),ct=function(){function ne(ae){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if((0,A.Z)(this,ne),ae=Gn.checkMatrix(ae),ae.isEmpty())throw new Error("Matrix must be non-empty");var S=ae.rows,C=ae.columns,V=P.computeLeftSingularVectors,he=V===void 0?!0:V,xe=P.computeRightSingularVectors,Ee=xe===void 0?!0:xe,Ne=P.autoTranspose,Et=Ne===void 0?!1:Ne,st=Boolean(he),Pt=Boolean(Ee),$t=!1,Ht;if(S<C)if(!Et)Ht=ae.clone(),console.warn("Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose");else{Ht=ae.transpose(),S=Ht.rows,C=Ht.columns,$t=!0;var Br=st;st=Pt,Pt=Br}else Ht=ae.clone();for(var hn=Math.min(S,C),Ot=Math.min(S+1,C),Qt=new Float64Array(Ot),pr=new Vt(S,hn),en=new Vt(C,C),Nr=new Float64Array(C),ta=new Float64Array(S),kn=new Float64Array(Ot),En=0;En<Ot;En++)kn[En]=En;for(var Rn=Math.min(S-1,C),Yn=Math.max(0,Math.min(C-2,S)),bn=Math.max(Rn,Yn),je=0;je<bn;je++){if(je<Rn){Qt[je]=0;for(var Ce=je;Ce<S;Ce++)Qt[je]=gn(Qt[je],Ht.get(Ce,je));if(Qt[je]!==0){Ht.get(je,je)<0&&(Qt[je]=-Qt[je]);for(var Xe=je;Xe<S;Xe++)Ht.set(Xe,je,Ht.get(Xe,je)/Qt[je]);Ht.set(je,je,Ht.get(je,je)+1)}Qt[je]=-Qt[je]}for(var ut=je+1;ut<C;ut++){if(je<Rn&&Qt[je]!==0){for(var ot=0,bt=je;bt<S;bt++)ot+=Ht.get(bt,je)*Ht.get(bt,ut);ot=-ot/Ht.get(je,je);for(var Xt=je;Xt<S;Xt++)Ht.set(Xt,ut,Ht.get(Xt,ut)+ot*Ht.get(Xt,je))}Nr[ut]=Ht.get(je,ut)}if(st&&je<Rn)for(var wr=je;wr<S;wr++)pr.set(wr,je,Ht.get(wr,je));if(je<Yn){Nr[je]=0;for(var Wr=je+1;Wr<C;Wr++)Nr[je]=gn(Nr[je],Nr[Wr]);if(Nr[je]!==0){Nr[je+1]<0&&(Nr[je]=0-Nr[je]);for(var on=je+1;on<C;on++)Nr[on]/=Nr[je];Nr[je+1]+=1}if(Nr[je]=-Nr[je],je+1<S&&Nr[je]!==0){for(var xn=je+1;xn<S;xn++)ta[xn]=0;for(var zn=je+1;zn<S;zn++)for(var Qn=je+1;Qn<C;Qn++)ta[zn]+=Nr[Qn]*Ht.get(zn,Qn);for(var ia=je+1;ia<C;ia++)for(var Wa=-Nr[ia]/Nr[je+1],Ia=je+1;Ia<S;Ia++)Ht.set(Ia,ia,Ht.get(Ia,ia)+Wa*ta[Ia])}if(Pt)for(var Ba=je+1;Ba<C;Ba++)en.set(Ba,je,Nr[Ba])}}var Ea=Math.min(C,S+1);if(Rn<C&&(Qt[Rn]=Ht.get(Rn,Rn)),S<Ea&&(Qt[Ea-1]=0),Yn+1<Ea&&(Nr[Yn]=Ht.get(Yn,Ea-1)),Nr[Ea-1]=0,st){for(var qa=Rn;qa<hn;qa++){for(var si=0;si<S;si++)pr.set(si,qa,0);pr.set(qa,qa,1)}for(var _a=Rn-1;_a>=0;_a--)if(Qt[_a]!==0){for(var So=_a+1;So<hn;So++){for(var to=0,co=_a;co<S;co++)to+=pr.get(co,_a)*pr.get(co,So);to=-to/pr.get(_a,_a);for(var ni=_a;ni<S;ni++)pr.set(ni,So,pr.get(ni,So)+to*pr.get(ni,_a))}for(var lo=_a;lo<S;lo++)pr.set(lo,_a,-pr.get(lo,_a));pr.set(_a,_a,1+pr.get(_a,_a));for(var Ss=0;Ss<_a-1;Ss++)pr.set(Ss,_a,0)}else{for(var Ro=0;Ro<S;Ro++)pr.set(Ro,_a,0);pr.set(_a,_a,1)}}if(Pt)for(var mi=C-1;mi>=0;mi--){if(mi<Yn&&Nr[mi]!==0)for(var ya=mi+1;ya<C;ya++){for(var _o=0,Yi=mi+1;Yi<C;Yi++)_o+=en.get(Yi,mi)*en.get(Yi,ya);_o=-_o/en.get(mi+1,mi);for(var Fi=mi+1;Fi<C;Fi++)en.set(Fi,ya,en.get(Fi,ya)+_o*en.get(Fi,mi))}for(var Bo=0;Bo<C;Bo++)en.set(Bo,mi,0);en.set(mi,mi,1)}for(var _s=Ea-1,Oo=0,Hi=Number.EPSILON;Ea>0;){var _n=void 0,Fo=void 0;for(_n=Ea-2;_n>=-1&&_n!==-1;_n--){var Go=Number.MIN_VALUE+Hi*Math.abs(Qt[_n]+Math.abs(Qt[_n+1]));if(Math.abs(Nr[_n])<=Go||Number.isNaN(Nr[_n])){Nr[_n]=0;break}}if(_n===Ea-2)Fo=4;else{var Va=void 0;for(Va=Ea-1;Va>=_n&&Va!==_n;Va--){var Ms=(Va!==Ea?Math.abs(Nr[Va]):0)+(Va!==_n+1?Math.abs(Nr[Va-1]):0);if(Math.abs(Qt[Va])<=Hi*Ms){Qt[Va]=0;break}}Va===_n?Fo=3:Va===Ea-1?Fo=1:(Fo=2,_n=Va)}switch(_n++,Fo){case 1:{var Ko=Nr[Ea-2];Nr[Ea-2]=0;for(var Li=Ea-2;Li>=_n;Li--){var Mo=gn(Qt[Li],Ko),ho=Qt[Li]/Mo,Gi=Ko/Mo;if(Qt[Li]=Mo,Li!==_n&&(Ko=-Gi*Nr[Li-1],Nr[Li-1]=ho*Nr[Li-1]),Pt)for(var Di=0;Di<C;Di++)Mo=ho*en.get(Di,Li)+Gi*en.get(Di,Ea-1),en.set(Di,Ea-1,-Gi*en.get(Di,Li)+ho*en.get(Di,Ea-1)),en.set(Di,Li,Mo)}break}case 2:{var $o=Nr[_n-1];Nr[_n-1]=0;for(var Ni=_n;Ni<Ea;Ni++){var ro=gn(Qt[Ni],$o),Qo=Qt[Ni]/ro,ns=$o/ro;if(Qt[Ni]=ro,$o=-ns*Nr[Ni],Nr[Ni]=Qo*Nr[Ni],st)for(var zi=0;zi<S;zi++)ro=Qo*pr.get(zi,Ni)+ns*pr.get(zi,_n-1),pr.set(zi,_n-1,-ns*pr.get(zi,Ni)+Qo*pr.get(zi,_n-1)),pr.set(zi,Ni,ro)}break}case 3:{var ga=Math.max(Math.abs(Qt[Ea-1]),Math.abs(Qt[Ea-2]),Math.abs(Nr[Ea-2]),Math.abs(Qt[_n]),Math.abs(Nr[_n])),vo=Qt[Ea-1]/ga,Vs=Qt[Ea-2]/ga,Pi=Nr[Ea-2]/ga,Ao=Qt[_n]/ga,as=Nr[_n]/ga,vi=((Vs+vo)*(Vs-vo)+Pi*Pi)/2,Zi=vo*Pi*(vo*Pi),_i=0;(vi!==0||Zi!==0)&&(vi<0?_i=0-Math.sqrt(vi*vi+Zi):_i=Math.sqrt(vi*vi+Zi),_i=Zi/(vi+_i));for(var no=(Ao+vo)*(Ao-vo)+_i,Ui=Ao*as,da=_n;da<Ea-1;da++){var Fa=gn(no,Ui);Fa===0&&(Fa=Number.MIN_VALUE);var Ya=no/Fa,Ii=Ui/Fa;if(da!==_n&&(Nr[da-1]=Fa),no=Ya*Qt[da]+Ii*Nr[da],Nr[da]=Ya*Nr[da]-Ii*Qt[da],Ui=Ii*Qt[da+1],Qt[da+1]=Ya*Qt[da+1],Pt)for(var Wi=0;Wi<C;Wi++)Fa=Ya*en.get(Wi,da)+Ii*en.get(Wi,da+1),en.set(Wi,da+1,-Ii*en.get(Wi,da)+Ya*en.get(Wi,da+1)),en.set(Wi,da,Fa);if(Fa=gn(no,Ui),Fa===0&&(Fa=Number.MIN_VALUE),Ya=no/Fa,Ii=Ui/Fa,Qt[da]=Fa,no=Ya*Nr[da]+Ii*Qt[da+1],Qt[da+1]=-Ii*Nr[da]+Ya*Qt[da+1],Ui=Ii*Nr[da+1],Nr[da+1]=Ya*Nr[da+1],st&&da<S-1)for(var ao=0;ao<S;ao++)Fa=Ya*pr.get(ao,da)+Ii*pr.get(ao,da+1),pr.set(ao,da+1,-Ii*pr.get(ao,da)+Ya*pr.get(ao,da+1)),pr.set(ao,da,Fa)}Nr[Ea-2]=no,Oo=Oo+1;break}case 4:{if(Qt[_n]<=0&&(Qt[_n]=Qt[_n]<0?-Qt[_n]:0,Pt))for(var go=0;go<=_s;go++)en.set(go,_n,-en.get(go,_n));for(;_n<_s&&!(Qt[_n]>=Qt[_n+1]);){var po=Qt[_n];if(Qt[_n]=Qt[_n+1],Qt[_n+1]=po,Pt&&_n<C-1)for(var yo=0;yo<C;yo++)po=en.get(yo,_n+1),en.set(yo,_n+1,en.get(yo,_n)),en.set(yo,_n,po);if(st&&_n<S-1)for(var ji=0;ji<S;ji++)po=pr.get(ji,_n+1),pr.set(ji,_n+1,pr.get(ji,_n)),pr.set(ji,_n,po);_n++}Oo=0,Ea--;break}}}if($t){var ka=en;en=pr,pr=ka}this.m=S,this.n=C,this.s=Qt,this.U=pr,this.V=en}return(0,N.Z)(ne,[{key:"solve",value:function(P){for(var S=P,C=this.threshold,V=this.s.length,he=Vt.zeros(V,V),xe=0;xe<V;xe++)Math.abs(this.s[xe])<=C?he.set(xe,xe,0):he.set(xe,xe,1/this.s[xe]);for(var Ee=this.U,Ne=this.rightSingularVectors,Et=Ne.mmul(he),st=Ne.rows,Pt=Ee.rows,$t=Vt.zeros(st,Pt),Ht=0;Ht<st;Ht++)for(var Br=0;Br<Pt;Br++){for(var hn=0,Ot=0;Ot<V;Ot++)hn+=Et.get(Ht,Ot)*Ee.get(Br,Ot);$t.set(Ht,Br,hn)}return $t.mmul(S)}},{key:"solveForDiagonal",value:function(P){return this.solve(Vt.diag(P))}},{key:"inverse",value:function(){for(var P=this.V,S=this.threshold,C=P.rows,V=P.columns,he=new Vt(C,this.s.length),xe=0;xe<C;xe++)for(var Ee=0;Ee<V;Ee++)Math.abs(this.s[Ee])>S&&he.set(xe,Ee,P.get(xe,Ee)/this.s[Ee]);for(var Ne=this.U,Et=Ne.rows,st=Ne.columns,Pt=new Vt(C,Et),$t=0;$t<C;$t++)for(var Ht=0;Ht<Et;Ht++){for(var Br=0,hn=0;hn<st;hn++)Br+=he.get($t,hn)*Ne.get(Ht,hn);Pt.set($t,Ht,Br)}return Pt}},{key:"condition",get:function(){return this.s[0]/this.s[Math.min(this.m,this.n)-1]}},{key:"norm2",get:function(){return this.s[0]}},{key:"rank",get:function(){for(var P=Math.max(this.m,this.n)*this.s[0]*Number.EPSILON,S=0,C=this.s,V=0,he=C.length;V<he;V++)C[V]>P&&S++;return S}},{key:"diagonal",get:function(){return Array.from(this.s)}},{key:"threshold",get:function(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}},{key:"leftSingularVectors",get:function(){return this.U}},{key:"rightSingularVectors",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){return Vt.diag(this.s)}}]),ne}();function Wt(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ne=Gn.checkMatrix(ne),ae?new ct(ne).inverse():Er(ne,Vt.eye(ne.rows))}function Er(ne,ae){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return ne=Gn.checkMatrix(ne),ae=Gn.checkMatrix(ae),P?new ct(ne).solve(ae):ne.isSquare()?new $r(ne).solve(ae):new Rr(ne).solve(ae)}function Dr(ne){if(ne=Vt.checkMatrix(ne),ne.isSquare()){if(ne.columns===0)return 1;var ae,P,S,C;if(ne.columns===2)return ae=ne.get(0,0),P=ne.get(0,1),S=ne.get(1,0),C=ne.get(1,1),ae*C-P*S;if(ne.columns===3){var V,he,xe;return V=new Sr(ne,[1,2],[1,2]),he=new Sr(ne,[1,2],[0,2]),xe=new Sr(ne,[1,2],[0,1]),ae=ne.get(0,0),P=ne.get(0,1),S=ne.get(0,2),ae*Dr(V)-P*Dr(he)+S*Dr(xe)}else return new $r(ne).determinant}else throw Error("determinant can only be calculated for a square matrix")}function Vr(ne,ae){for(var P=[],S=0;S<ne;S++)S!==ae&&P.push(S);return P}function pn(ne,ae,P){var S=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1e-9,C=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1e-9;if(ne>C)return new Array(ae.rows+1).fill(0);for(var V=ae.addRow(P,[0]),he=0;he<V.rows;he++)Math.abs(V.get(he,0))<S&&V.set(he,0,0);return V.to1DArray()}function wn(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=ae.thresholdValue,S=P===void 0?1e-9:P,C=ae.thresholdError,V=C===void 0?1e-9:C;ne=Vt.checkMatrix(ne);for(var he=ne.rows,xe=new Vt(he,he),Ee=0;Ee<he;Ee++){var Ne=Vt.columnVector(ne.getRow(Ee)),Et=ne.subMatrixRow(Vr(he,Ee)).transpose(),st=new ct(Et),Pt=st.solve(Ne),$t=Vt.sub(Ne,Et.mmul(Pt)).abs().max();xe.setRow(Ee,pn($t,Pt,Ee,S,V))}return xe}function Sn(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.EPSILON;if(ne=Vt.checkMatrix(ne),ne.isEmpty())return ne.transpose();for(var P=new ct(ne,{autoTranspose:!0}),S=P.leftSingularVectors,C=P.rightSingularVectors,V=P.diagonal,he=0;he<V.length;he++)Math.abs(V[he])>ae?V[he]=1/V[he]:V[he]=0;return C.mmul(Vt.diag(V).mmul(S.transpose()))}function In(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ne,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};ne=new Vt(ne);var S=!1;if(typeof ae=="object"&&!Vt.isMatrix(ae)&&!y(ae)?(P=ae,ae=ne,S=!0):ae=new Vt(ae),ne.rows!==ae.rows)throw new TypeError("Both matrices must have the same number of rows");var C=P,V=C.center,he=V===void 0?!0:V;he&&(ne=ne.center("column"),S||(ae=ae.center("column")));for(var xe=ne.transpose().mmul(ae),Ee=0;Ee<xe.rows;Ee++)for(var Ne=0;Ne<xe.columns;Ne++)xe.set(Ee,Ne,xe.get(Ee,Ne)*(1/(ne.rows-1)));return xe}function $n(ne){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ne,P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};ne=new Vt(ne);var S=!1;if(typeof ae=="object"&&!Vt.isMatrix(ae)&&!y(ae)?(P=ae,ae=ne,S=!0):ae=new Vt(ae),ne.rows!==ae.rows)throw new TypeError("Both matrices must have the same number of rows");var C=P,V=C.center,he=V===void 0?!0:V,xe=C.scale,Ee=xe===void 0?!0:xe;he&&(ne.center("column"),S||ae.center("column")),Ee&&(ne.scale("column"),S||ae.scale("column"));for(var Ne=ne.standardDeviation("column",{unbiased:!0}),Et=S?Ne:ae.standardDeviation("column",{unbiased:!0}),st=ne.transpose().mmul(ae),Pt=0;Pt<st.rows;Pt++)for(var $t=0;$t<st.columns;$t++)st.set(Pt,$t,st.get(Pt,$t)*(1/(Ne[Pt]*Et[$t]))*(1/(ne.rows-1)));return st}var Zr=function(){function ne(ae){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,A.Z)(this,ne);var S=P.assumeSymmetric,C=S===void 0?!1:S;if(ae=Gn.checkMatrix(ae),!ae.isSquare())throw new Error("Matrix is not a square matrix");if(ae.isEmpty())throw new Error("Matrix must be non-empty");var V=ae.columns,he=new Vt(V,V),xe=new Float64Array(V),Ee=new Float64Array(V),Ne=ae,Et,st,Pt=!1;if(C?Pt=!0:Pt=ae.isSymmetric(),Pt){for(Et=0;Et<V;Et++)for(st=0;st<V;st++)he.set(Et,st,Ne.get(Et,st));Pn(V,Ee,xe,he),An(V,Ee,xe,he)}else{var $t=new Vt(V,V),Ht=new Float64Array(V);for(st=0;st<V;st++)for(Et=0;Et<V;Et++)$t.set(Et,st,Ne.get(Et,st));ln(V,$t,Ht,he),va(V,Ee,xe,he,$t)}this.n=V,this.e=Ee,this.d=xe,this.V=he}return(0,N.Z)(ne,[{key:"realEigenvalues",get:function(){return Array.from(this.d)}},{key:"imaginaryEigenvalues",get:function(){return Array.from(this.e)}},{key:"eigenvectorMatrix",get:function(){return this.V}},{key:"diagonalMatrix",get:function(){var P=this.n,S=this.e,C=this.d,V=new Vt(P,P),he,xe;for(he=0;he<P;he++){for(xe=0;xe<P;xe++)V.set(he,xe,0);V.set(he,he,C[he]),S[he]>0?V.set(he,he+1,S[he]):S[he]<0&&V.set(he,he-1,S[he])}return V}}]),ne}();function Pn(ne,ae,P,S){var C,V,he,xe,Ee,Ne,Et,st;for(Ee=0;Ee<ne;Ee++)P[Ee]=S.get(ne-1,Ee);for(xe=ne-1;xe>0;xe--){for(st=0,he=0,Ne=0;Ne<xe;Ne++)st=st+Math.abs(P[Ne]);if(st===0)for(ae[xe]=P[xe-1],Ee=0;Ee<xe;Ee++)P[Ee]=S.get(xe-1,Ee),S.set(xe,Ee,0),S.set(Ee,xe,0);else{for(Ne=0;Ne<xe;Ne++)P[Ne]/=st,he+=P[Ne]*P[Ne];for(C=P[xe-1],V=Math.sqrt(he),C>0&&(V=-V),ae[xe]=st*V,he=he-C*V,P[xe-1]=C-V,Ee=0;Ee<xe;Ee++)ae[Ee]=0;for(Ee=0;Ee<xe;Ee++){for(C=P[Ee],S.set(Ee,xe,C),V=ae[Ee]+S.get(Ee,Ee)*C,Ne=Ee+1;Ne<=xe-1;Ne++)V+=S.get(Ne,Ee)*P[Ne],ae[Ne]+=S.get(Ne,Ee)*C;ae[Ee]=V}for(C=0,Ee=0;Ee<xe;Ee++)ae[Ee]/=he,C+=ae[Ee]*P[Ee];for(Et=C/(he+he),Ee=0;Ee<xe;Ee++)ae[Ee]-=Et*P[Ee];for(Ee=0;Ee<xe;Ee++){for(C=P[Ee],V=ae[Ee],Ne=Ee;Ne<=xe-1;Ne++)S.set(Ne,Ee,S.get(Ne,Ee)-(C*ae[Ne]+V*P[Ne]));P[Ee]=S.get(xe-1,Ee),S.set(xe,Ee,0)}}P[xe]=he}for(xe=0;xe<ne-1;xe++){if(S.set(ne-1,xe,S.get(xe,xe)),S.set(xe,xe,1),he=P[xe+1],he!==0){for(Ne=0;Ne<=xe;Ne++)P[Ne]=S.get(Ne,xe+1)/he;for(Ee=0;Ee<=xe;Ee++){for(V=0,Ne=0;Ne<=xe;Ne++)V+=S.get(Ne,xe+1)*S.get(Ne,Ee);for(Ne=0;Ne<=xe;Ne++)S.set(Ne,Ee,S.get(Ne,Ee)-V*P[Ne])}}for(Ne=0;Ne<=xe;Ne++)S.set(Ne,xe+1,0)}for(Ee=0;Ee<ne;Ee++)P[Ee]=S.get(ne-1,Ee),S.set(ne-1,Ee,0);S.set(ne-1,ne-1,1),ae[0]=0}function An(ne,ae,P,S){var C,V,he,xe,Ee,Ne,Et,st,Pt,$t,Ht,Br,hn,Ot,Qt,pr,en;for(he=1;he<ne;he++)ae[he-1]=ae[he];ae[ne-1]=0;var Nr=0,ta=0,kn=Number.EPSILON;for(Ne=0;Ne<ne;Ne++){for(ta=Math.max(ta,Math.abs(P[Ne])+Math.abs(ae[Ne])),Et=Ne;Et<ne&&!(Math.abs(ae[Et])<=kn*ta);)Et++;if(Et>Ne){en=0;do{for(en=en+1,C=P[Ne],st=(P[Ne+1]-C)/(2*ae[Ne]),Pt=gn(st,1),st<0&&(Pt=-Pt),P[Ne]=ae[Ne]/(st+Pt),P[Ne+1]=ae[Ne]*(st+Pt),$t=P[Ne+1],V=C-P[Ne],he=Ne+2;he<ne;he++)P[he]-=V;for(Nr=Nr+V,st=P[Et],Ht=1,Br=Ht,hn=Ht,Ot=ae[Ne+1],Qt=0,pr=0,he=Et-1;he>=Ne;he--)for(hn=Br,Br=Ht,pr=Qt,C=Ht*ae[he],V=Ht*st,Pt=gn(st,ae[he]),ae[he+1]=Qt*Pt,Qt=ae[he]/Pt,Ht=st/Pt,st=Ht*P[he]-Qt*C,P[he+1]=V+Qt*(Ht*C+Qt*P[he]),Ee=0;Ee<ne;Ee++)V=S.get(Ee,he+1),S.set(Ee,he+1,Qt*S.get(Ee,he)+Ht*V),S.set(Ee,he,Ht*S.get(Ee,he)-Qt*V);st=-Qt*pr*hn*Ot*ae[Ne]/$t,ae[Ne]=Qt*st,P[Ne]=Ht*st}while(Math.abs(ae[Ne])>kn*ta)}P[Ne]=P[Ne]+Nr,ae[Ne]=0}for(he=0;he<ne-1;he++){for(Ee=he,st=P[he],xe=he+1;xe<ne;xe++)P[xe]<st&&(Ee=xe,st=P[xe]);if(Ee!==he)for(P[Ee]=P[he],P[he]=st,xe=0;xe<ne;xe++)st=S.get(xe,he),S.set(xe,he,S.get(xe,Ee)),S.set(xe,Ee,st)}}function ln(ne,ae,P,S){var C=0,V=ne-1,he,xe,Ee,Ne,Et,st,Pt;for(st=C+1;st<=V-1;st++){for(Pt=0,Ne=st;Ne<=V;Ne++)Pt=Pt+Math.abs(ae.get(Ne,st-1));if(Pt!==0){for(Ee=0,Ne=V;Ne>=st;Ne--)P[Ne]=ae.get(Ne,st-1)/Pt,Ee+=P[Ne]*P[Ne];for(xe=Math.sqrt(Ee),P[st]>0&&(xe=-xe),Ee=Ee-P[st]*xe,P[st]=P[st]-xe,Et=st;Et<ne;Et++){for(he=0,Ne=V;Ne>=st;Ne--)he+=P[Ne]*ae.get(Ne,Et);for(he=he/Ee,Ne=st;Ne<=V;Ne++)ae.set(Ne,Et,ae.get(Ne,Et)-he*P[Ne])}for(Ne=0;Ne<=V;Ne++){for(he=0,Et=V;Et>=st;Et--)he+=P[Et]*ae.get(Ne,Et);for(he=he/Ee,Et=st;Et<=V;Et++)ae.set(Ne,Et,ae.get(Ne,Et)-he*P[Et])}P[st]=Pt*P[st],ae.set(st,st-1,Pt*xe)}}for(Ne=0;Ne<ne;Ne++)for(Et=0;Et<ne;Et++)S.set(Ne,Et,Ne===Et?1:0);for(st=V-1;st>=C+1;st--)if(ae.get(st,st-1)!==0){for(Ne=st+1;Ne<=V;Ne++)P[Ne]=ae.get(Ne,st-1);for(Et=st;Et<=V;Et++){for(xe=0,Ne=st;Ne<=V;Ne++)xe+=P[Ne]*S.get(Ne,Et);for(xe=xe/P[st]/ae.get(st,st-1),Ne=st;Ne<=V;Ne++)S.set(Ne,Et,S.get(Ne,Et)+xe*P[Ne])}}}function va(ne,ae,P,S,C){var V=ne-1,he=0,xe=ne-1,Ee=Number.EPSILON,Ne=0,Et=0,st=0,Pt=0,$t=0,Ht=0,Br=0,hn=0,Ot,Qt,pr,en,Nr,ta,kn,En,Rn,Yn,bn,je,Ce,Xe,ut;for(Ot=0;Ot<ne;Ot++)for((Ot<he||Ot>xe)&&(P[Ot]=C.get(Ot,Ot),ae[Ot]=0),Qt=Math.max(Ot-1,0);Qt<ne;Qt++)Et=Et+Math.abs(C.get(Ot,Qt));for(;V>=he;){for(en=V;en>he&&(Ht=Math.abs(C.get(en-1,en-1))+Math.abs(C.get(en,en)),Ht===0&&(Ht=Et),!(Math.abs(C.get(en,en-1))<Ee*Ht));)en--;if(en===V)C.set(V,V,C.get(V,V)+Ne),P[V]=C.get(V,V),ae[V]=0,V--,hn=0;else if(en===V-1){if(kn=C.get(V,V-1)*C.get(V-1,V),st=(C.get(V-1,V-1)-C.get(V,V))/2,Pt=st*st+kn,Br=Math.sqrt(Math.abs(Pt)),C.set(V,V,C.get(V,V)+Ne),C.set(V-1,V-1,C.get(V-1,V-1)+Ne),En=C.get(V,V),Pt>=0){for(Br=st>=0?st+Br:st-Br,P[V-1]=En+Br,P[V]=P[V-1],Br!==0&&(P[V]=En-kn/Br),ae[V-1]=0,ae[V]=0,En=C.get(V,V-1),Ht=Math.abs(En)+Math.abs(Br),st=En/Ht,Pt=Br/Ht,$t=Math.sqrt(st*st+Pt*Pt),st=st/$t,Pt=Pt/$t,Qt=V-1;Qt<ne;Qt++)Br=C.get(V-1,Qt),C.set(V-1,Qt,Pt*Br+st*C.get(V,Qt)),C.set(V,Qt,Pt*C.get(V,Qt)-st*Br);for(Ot=0;Ot<=V;Ot++)Br=C.get(Ot,V-1),C.set(Ot,V-1,Pt*Br+st*C.get(Ot,V)),C.set(Ot,V,Pt*C.get(Ot,V)-st*Br);for(Ot=he;Ot<=xe;Ot++)Br=S.get(Ot,V-1),S.set(Ot,V-1,Pt*Br+st*S.get(Ot,V)),S.set(Ot,V,Pt*S.get(Ot,V)-st*Br)}else P[V-1]=En+st,P[V]=En+st,ae[V-1]=Br,ae[V]=-Br;V=V-2,hn=0}else{if(En=C.get(V,V),Rn=0,kn=0,en<V&&(Rn=C.get(V-1,V-1),kn=C.get(V,V-1)*C.get(V-1,V)),hn===10){for(Ne+=En,Ot=he;Ot<=V;Ot++)C.set(Ot,Ot,C.get(Ot,Ot)-En);Ht=Math.abs(C.get(V,V-1))+Math.abs(C.get(V-1,V-2)),En=Rn=.75*Ht,kn=-.4375*Ht*Ht}if(hn===30&&(Ht=(Rn-En)/2,Ht=Ht*Ht+kn,Ht>0)){for(Ht=Math.sqrt(Ht),Rn<En&&(Ht=-Ht),Ht=En-kn/((Rn-En)/2+Ht),Ot=he;Ot<=V;Ot++)C.set(Ot,Ot,C.get(Ot,Ot)-Ht);Ne+=Ht,En=Rn=kn=.964}for(hn=hn+1,Nr=V-2;Nr>=en&&(Br=C.get(Nr,Nr),$t=En-Br,Ht=Rn-Br,st=($t*Ht-kn)/C.get(Nr+1,Nr)+C.get(Nr,Nr+1),Pt=C.get(Nr+1,Nr+1)-Br-$t-Ht,$t=C.get(Nr+2,Nr+1),Ht=Math.abs(st)+Math.abs(Pt)+Math.abs($t),st=st/Ht,Pt=Pt/Ht,$t=$t/Ht,!(Nr===en||Math.abs(C.get(Nr,Nr-1))*(Math.abs(Pt)+Math.abs($t))<Ee*(Math.abs(st)*(Math.abs(C.get(Nr-1,Nr-1))+Math.abs(Br)+Math.abs(C.get(Nr+1,Nr+1))))));)Nr--;for(Ot=Nr+2;Ot<=V;Ot++)C.set(Ot,Ot-2,0),Ot>Nr+2&&C.set(Ot,Ot-3,0);for(pr=Nr;pr<=V-1&&(Xe=pr!==V-1,pr!==Nr&&(st=C.get(pr,pr-1),Pt=C.get(pr+1,pr-1),$t=Xe?C.get(pr+2,pr-1):0,En=Math.abs(st)+Math.abs(Pt)+Math.abs($t),En!==0&&(st=st/En,Pt=Pt/En,$t=$t/En)),En!==0);pr++)if(Ht=Math.sqrt(st*st+Pt*Pt+$t*$t),st<0&&(Ht=-Ht),Ht!==0){for(pr!==Nr?C.set(pr,pr-1,-Ht*En):en!==Nr&&C.set(pr,pr-1,-C.get(pr,pr-1)),st=st+Ht,En=st/Ht,Rn=Pt/Ht,Br=$t/Ht,Pt=Pt/st,$t=$t/st,Qt=pr;Qt<ne;Qt++)st=C.get(pr,Qt)+Pt*C.get(pr+1,Qt),Xe&&(st=st+$t*C.get(pr+2,Qt),C.set(pr+2,Qt,C.get(pr+2,Qt)-st*Br)),C.set(pr,Qt,C.get(pr,Qt)-st*En),C.set(pr+1,Qt,C.get(pr+1,Qt)-st*Rn);for(Ot=0;Ot<=Math.min(V,pr+3);Ot++)st=En*C.get(Ot,pr)+Rn*C.get(Ot,pr+1),Xe&&(st=st+Br*C.get(Ot,pr+2),C.set(Ot,pr+2,C.get(Ot,pr+2)-st*$t)),C.set(Ot,pr,C.get(Ot,pr)-st),C.set(Ot,pr+1,C.get(Ot,pr+1)-st*Pt);for(Ot=he;Ot<=xe;Ot++)st=En*S.get(Ot,pr)+Rn*S.get(Ot,pr+1),Xe&&(st=st+Br*S.get(Ot,pr+2),S.set(Ot,pr+2,S.get(Ot,pr+2)-st*$t)),S.set(Ot,pr,S.get(Ot,pr)-st),S.set(Ot,pr+1,S.get(Ot,pr+1)-st*Pt)}}}if(Et!==0){for(V=ne-1;V>=0;V--)if(st=P[V],Pt=ae[V],Pt===0)for(en=V,C.set(V,V,1),Ot=V-1;Ot>=0;Ot--){for(kn=C.get(Ot,Ot)-st,$t=0,Qt=en;Qt<=V;Qt++)$t=$t+C.get(Ot,Qt)*C.get(Qt,V);if(ae[Ot]<0)Br=kn,Ht=$t;else if(en=Ot,ae[Ot]===0?C.set(Ot,V,kn!==0?-$t/kn:-$t/(Ee*Et)):(En=C.get(Ot,Ot+1),Rn=C.get(Ot+1,Ot),Pt=(P[Ot]-st)*(P[Ot]-st)+ae[Ot]*ae[Ot],ta=(En*Ht-Br*$t)/Pt,C.set(Ot,V,ta),C.set(Ot+1,V,Math.abs(En)>Math.abs(Br)?(-$t-kn*ta)/En:(-Ht-Rn*ta)/Br)),ta=Math.abs(C.get(Ot,V)),Ee*ta*ta>1)for(Qt=Ot;Qt<=V;Qt++)C.set(Qt,V,C.get(Qt,V)/ta)}else if(Pt<0)for(en=V-1,Math.abs(C.get(V,V-1))>Math.abs(C.get(V-1,V))?(C.set(V-1,V-1,Pt/C.get(V,V-1)),C.set(V-1,V,-(C.get(V,V)-st)/C.get(V,V-1))):(ut=K(0,-C.get(V-1,V),C.get(V-1,V-1)-st,Pt),C.set(V-1,V-1,ut[0]),C.set(V-1,V,ut[1])),C.set(V,V-1,0),C.set(V,V,1),Ot=V-2;Ot>=0;Ot--){for(Yn=0,bn=0,Qt=en;Qt<=V;Qt++)Yn=Yn+C.get(Ot,Qt)*C.get(Qt,V-1),bn=bn+C.get(Ot,Qt)*C.get(Qt,V);if(kn=C.get(Ot,Ot)-st,ae[Ot]<0)Br=kn,$t=Yn,Ht=bn;else if(en=Ot,ae[Ot]===0?(ut=K(-Yn,-bn,kn,Pt),C.set(Ot,V-1,ut[0]),C.set(Ot,V,ut[1])):(En=C.get(Ot,Ot+1),Rn=C.get(Ot+1,Ot),je=(P[Ot]-st)*(P[Ot]-st)+ae[Ot]*ae[Ot]-Pt*Pt,Ce=(P[Ot]-st)*2*Pt,je===0&&Ce===0&&(je=Ee*Et*(Math.abs(kn)+Math.abs(Pt)+Math.abs(En)+Math.abs(Rn)+Math.abs(Br))),ut=K(En*$t-Br*Yn+Pt*bn,En*Ht-Br*bn-Pt*Yn,je,Ce),C.set(Ot,V-1,ut[0]),C.set(Ot,V,ut[1]),Math.abs(En)>Math.abs(Br)+Math.abs(Pt)?(C.set(Ot+1,V-1,(-Yn-kn*C.get(Ot,V-1)+Pt*C.get(Ot,V))/En),C.set(Ot+1,V,(-bn-kn*C.get(Ot,V)-Pt*C.get(Ot,V-1))/En)):(ut=K(-$t-Rn*C.get(Ot,V-1),-Ht-Rn*C.get(Ot,V),Br,Pt),C.set(Ot+1,V-1,ut[0]),C.set(Ot+1,V,ut[1]))),ta=Math.max(Math.abs(C.get(Ot,V-1)),Math.abs(C.get(Ot,V))),Ee*ta*ta>1)for(Qt=Ot;Qt<=V;Qt++)C.set(Qt,V-1,C.get(Qt,V-1)/ta),C.set(Qt,V,C.get(Qt,V)/ta)}for(Ot=0;Ot<ne;Ot++)if(Ot<he||Ot>xe)for(Qt=Ot;Qt<ne;Qt++)S.set(Ot,Qt,C.get(Ot,Qt));for(Qt=ne-1;Qt>=he;Qt--)for(Ot=he;Ot<=xe;Ot++){for(Br=0,pr=he;pr<=Math.min(Qt,xe);pr++)Br=Br+S.get(Ot,pr)*C.get(pr,Qt);S.set(Ot,Qt,Br)}}}function K(ne,ae,P,S){var C,V;return Math.abs(P)>Math.abs(S)?(C=S/P,V=P+C*S,[(ne+C*ae)/V,(ae-C*ne)/V]):(C=P/S,V=S+C*P,[(C*ne+ae)/V,(C*ae-ne)/V])}var Dt=function(){function ne(ae){if((0,A.Z)(this,ne),ae=Gn.checkMatrix(ae),!ae.isSymmetric())throw new Error("Matrix is not symmetric");var P=ae,S=P.rows,C=new Vt(S,S),V=!0,he,xe,Ee;for(xe=0;xe<S;xe++){var Ne=0;for(Ee=0;Ee<xe;Ee++){var Et=0;for(he=0;he<Ee;he++)Et+=C.get(Ee,he)*C.get(xe,he);Et=(P.get(xe,Ee)-Et)/C.get(Ee,Ee),C.set(xe,Ee,Et),Ne=Ne+Et*Et}for(Ne=P.get(xe,xe)-Ne,V&=Ne>0,C.set(xe,xe,Math.sqrt(Math.max(Ne,0))),Ee=xe+1;Ee<S;Ee++)C.set(xe,Ee,0)}this.L=C,this.positiveDefinite=Boolean(V)}return(0,N.Z)(ne,[{key:"isPositiveDefinite",value:function(){return this.positiveDefinite}},{key:"solve",value:function(P){P=Gn.checkMatrix(P);var S=this.L,C=S.rows;if(P.rows!==C)throw new Error("Matrix dimensions do not match");if(this.isPositiveDefinite()===!1)throw new Error("Matrix is not positive definite");var V=P.columns,he=P.clone(),xe,Ee,Ne;for(Ne=0;Ne<C;Ne++)for(Ee=0;Ee<V;Ee++){for(xe=0;xe<Ne;xe++)he.set(Ne,Ee,he.get(Ne,Ee)-he.get(xe,Ee)*S.get(Ne,xe));he.set(Ne,Ee,he.get(Ne,Ee)/S.get(Ne,Ne))}for(Ne=C-1;Ne>=0;Ne--)for(Ee=0;Ee<V;Ee++){for(xe=Ne+1;xe<C;xe++)he.set(Ne,Ee,he.get(Ne,Ee)-he.get(xe,Ee)*S.get(xe,Ne));he.set(Ne,Ee,he.get(Ne,Ee)/S.get(Ne,Ne))}return he}},{key:"lowerTriangularMatrix",get:function(){return this.L}}]),ne}(),rt=(0,N.Z)(function ne(ae){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,A.Z)(this,ne),ae=Gn.checkMatrix(ae);var S=P.Y,C=P.scaleScores,V=C===void 0?!1:C,he=P.maxIterations,xe=he===void 0?1e3:he,Ee=P.terminationCriteria,Ne=Ee===void 0?1e-10:Ee,Et;if(S){if(y(S)&&typeof S[0]=="number"?S=Vt.columnVector(S):S=Gn.checkMatrix(S),S.rows!==ae.rows)throw new Error("Y should have the same number of rows as X");Et=S.getColumnVector(0)}else Et=ae.getColumnVector(0);for(var st=1,Pt,$t,Ht,Br,hn=0;hn<xe&&st>Ne;hn++)Ht=ae.transpose().mmul(Et).div(Et.transpose().mmul(Et).get(0,0)),Ht=Ht.div(Ht.norm()),Pt=ae.mmul(Ht).div(Ht.transpose().mmul(Ht).get(0,0)),hn>0&&(st=Pt.clone().sub(Br).pow(2).sum()),Br=Pt.clone(),S?($t=S.transpose().mmul(Pt).div(Pt.transpose().mmul(Pt).get(0,0)),$t=$t.div($t.norm()),Et=S.mmul($t).div($t.transpose().mmul($t).get(0,0))):Et=Pt;if(S){var Ot=ae.transpose().mmul(Pt).div(Pt.transpose().mmul(Pt).get(0,0));Ot=Ot.div(Ot.norm());var Qt=ae.clone().sub(Pt.clone().mmul(Ot.transpose())),pr=Et.transpose().mmul(Pt).div(Pt.transpose().mmul(Pt).get(0,0)),en=S.clone().sub(Pt.clone().mulS(pr.get(0,0)).mmul($t.transpose()));this.t=Pt,this.p=Ot.transpose(),this.w=Ht.transpose(),this.q=$t,this.u=Et,this.s=Pt.transpose().mmul(Pt),this.xResidual=Qt,this.yResidual=en,this.betas=pr}else this.w=Ht.transpose(),this.s=Pt.transpose().mmul(Pt).sqrt(),V?this.t=Pt.clone().div(this.s.get(0,0)):this.t=Pt,this.xResidual=ae.sub(Pt.mmul(Ht.transpose()))})},48168:function(or,U,z){var B=z(39092),j={};for(var R in B)B.hasOwnProperty(R)&&(j[B[R]]=R);var A=or.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var N in A)if(A.hasOwnProperty(N)){if(!("channels"in A[N]))throw new Error("missing channels property: "+N);if(!("labels"in A[N]))throw new Error("missing channel labels property: "+N);if(A[N].labels.length!==A[N].channels)throw new Error("channel and label counts mismatch: "+N);var L=A[N].channels,y=A[N].labels;delete A[N].channels,delete A[N].labels,Object.defineProperty(A[N],"channels",{value:L}),Object.defineProperty(A[N],"labels",{value:y})}A.rgb.hsl=function(v){var g=v[0]/255,d=v[1]/255,_=v[2]/255,E=Math.min(g,d,_),w=Math.max(g,d,_),T=w-E,k,b,m;return w===E?k=0:g===w?k=(d-_)/T:d===w?k=2+(_-g)/T:_===w&&(k=4+(g-d)/T),k=Math.min(k*60,360),k<0&&(k+=360),m=(E+w)/2,w===E?b=0:m<=.5?b=T/(w+E):b=T/(2-w-E),[k,b*100,m*100]},A.rgb.hsv=function(v){var g,d,_,E,w,T=v[0]/255,k=v[1]/255,b=v[2]/255,m=Math.max(T,k,b),$=m-Math.min(T,k,b),W=function(X){return(m-X)/6/$+1/2};return $===0?E=w=0:(w=$/m,g=W(T),d=W(k),_=W(b),T===m?E=_-d:k===m?E=1/3+g-_:b===m&&(E=2/3+d-g),E<0?E+=1:E>1&&(E-=1)),[E*360,w*100,m*100]},A.rgb.hwb=function(v){var g=v[0],d=v[1],_=v[2],E=A.rgb.hsl(v)[0],w=1/255*Math.min(g,Math.min(d,_));return _=1-1/255*Math.max(g,Math.max(d,_)),[E,w*100,_*100]},A.rgb.cmyk=function(v){var g=v[0]/255,d=v[1]/255,_=v[2]/255,E,w,T,k;return k=Math.min(1-g,1-d,1-_),E=(1-g-k)/(1-k)||0,w=(1-d-k)/(1-k)||0,T=(1-_-k)/(1-k)||0,[E*100,w*100,T*100,k*100]};function x(v,g){return Math.pow(v[0]-g[0],2)+Math.pow(v[1]-g[1],2)+Math.pow(v[2]-g[2],2)}A.rgb.keyword=function(v){var g=j[v];if(g)return g;var d=Infinity,_;for(var E in B)if(B.hasOwnProperty(E)){var w=B[E],T=x(v,w);T<d&&(d=T,_=E)}return _},A.keyword.rgb=function(v){return B[v]},A.rgb.xyz=function(v){var g=v[0]/255,d=v[1]/255,_=v[2]/255;g=g>.04045?Math.pow((g+.055)/1.055,2.4):g/12.92,d=d>.04045?Math.pow((d+.055)/1.055,2.4):d/12.92,_=_>.04045?Math.pow((_+.055)/1.055,2.4):_/12.92;var E=g*.4124+d*.3576+_*.1805,w=g*.2126+d*.7152+_*.0722,T=g*.0193+d*.1192+_*.9505;return[E*100,w*100,T*100]},A.rgb.lab=function(v){var g=A.rgb.xyz(v),d=g[0],_=g[1],E=g[2],w,T,k;return d/=95.047,_/=100,E/=108.883,d=d>.008856?Math.pow(d,1/3):7.787*d+16/116,_=_>.008856?Math.pow(_,1/3):7.787*_+16/116,E=E>.008856?Math.pow(E,1/3):7.787*E+16/116,w=116*_-16,T=500*(d-_),k=200*(_-E),[w,T,k]},A.hsl.rgb=function(v){var g=v[0]/360,d=v[1]/100,_=v[2]/100,E,w,T,k,b;if(d===0)return b=_*255,[b,b,b];_<.5?w=_*(1+d):w=_+d-_*d,E=2*_-w,k=[0,0,0];for(var m=0;m<3;m++)T=g+1/3*-(m-1),T<0&&T++,T>1&&T--,6*T<1?b=E+(w-E)*6*T:2*T<1?b=w:3*T<2?b=E+(w-E)*(2/3-T)*6:b=E,k[m]=b*255;return k},A.hsl.hsv=function(v){var g=v[0],d=v[1]/100,_=v[2]/100,E=d,w=Math.max(_,.01),T,k;return _*=2,d*=_<=1?_:2-_,E*=w<=1?w:2-w,k=(_+d)/2,T=_===0?2*E/(w+E):2*d/(_+d),[g,T*100,k*100]},A.hsv.rgb=function(v){var g=v[0]/60,d=v[1]/100,_=v[2]/100,E=Math.floor(g)%6,w=g-Math.floor(g),T=255*_*(1-d),k=255*_*(1-d*w),b=255*_*(1-d*(1-w));switch(_*=255,E){case 0:return[_,b,T];case 1:return[k,_,T];case 2:return[T,_,b];case 3:return[T,k,_];case 4:return[b,T,_];case 5:return[_,T,k]}},A.hsv.hsl=function(v){var g=v[0],d=v[1]/100,_=v[2]/100,E=Math.max(_,.01),w,T,k;return k=(2-d)*_,w=(2-d)*E,T=d*E,T/=w<=1?w:2-w,T=T||0,k/=2,[g,T*100,k*100]},A.hwb.rgb=function(v){var g=v[0]/360,d=v[1]/100,_=v[2]/100,E=d+_,w,T,k,b;E>1&&(d/=E,_/=E),w=Math.floor(6*g),T=1-_,k=6*g-w,(w&1)!=0&&(k=1-k),b=d+k*(T-d);var m,$,W;switch(w){default:case 6:case 0:m=T,$=b,W=d;break;case 1:m=b,$=T,W=d;break;case 2:m=d,$=T,W=b;break;case 3:m=d,$=b,W=T;break;case 4:m=b,$=d,W=T;break;case 5:m=T,$=d,W=b;break}return[m*255,$*255,W*255]},A.cmyk.rgb=function(v){var g=v[0]/100,d=v[1]/100,_=v[2]/100,E=v[3]/100,w,T,k;return w=1-Math.min(1,g*(1-E)+E),T=1-Math.min(1,d*(1-E)+E),k=1-Math.min(1,_*(1-E)+E),[w*255,T*255,k*255]},A.xyz.rgb=function(v){var g=v[0]/100,d=v[1]/100,_=v[2]/100,E,w,T;return E=g*3.2406+d*-1.5372+_*-.4986,w=g*-.9689+d*1.8758+_*.0415,T=g*.0557+d*-.204+_*1.057,E=E>.0031308?1.055*Math.pow(E,1/2.4)-.055:E*12.92,w=w>.0031308?1.055*Math.pow(w,1/2.4)-.055:w*12.92,T=T>.0031308?1.055*Math.pow(T,1/2.4)-.055:T*12.92,E=Math.min(Math.max(0,E),1),w=Math.min(Math.max(0,w),1),T=Math.min(Math.max(0,T),1),[E*255,w*255,T*255]},A.xyz.lab=function(v){var g=v[0],d=v[1],_=v[2],E,w,T;return g/=95.047,d/=100,_/=108.883,g=g>.008856?Math.pow(g,1/3):7.787*g+16/116,d=d>.008856?Math.pow(d,1/3):7.787*d+16/116,_=_>.008856?Math.pow(_,1/3):7.787*_+16/116,E=116*d-16,w=500*(g-d),T=200*(d-_),[E,w,T]},A.lab.xyz=function(v){var g=v[0],d=v[1],_=v[2],E,w,T;w=(g+16)/116,E=d/500+w,T=w-_/200;var k=Math.pow(w,3),b=Math.pow(E,3),m=Math.pow(T,3);return w=k>.008856?k:(w-16/116)/7.787,E=b>.008856?b:(E-16/116)/7.787,T=m>.008856?m:(T-16/116)/7.787,E*=95.047,w*=100,T*=108.883,[E,w,T]},A.lab.lch=function(v){var g=v[0],d=v[1],_=v[2],E,w,T;return E=Math.atan2(_,d),w=E*360/2/Math.PI,w<0&&(w+=360),T=Math.sqrt(d*d+_*_),[g,T,w]},A.lch.lab=function(v){var g=v[0],d=v[1],_=v[2],E,w,T;return T=_/360*2*Math.PI,E=d*Math.cos(T),w=d*Math.sin(T),[g,E,w]},A.rgb.ansi16=function(v){var g=v[0],d=v[1],_=v[2],E=1 in arguments?arguments[1]:A.rgb.hsv(v)[2];if(E=Math.round(E/50),E===0)return 30;var w=30+(Math.round(_/255)<<2|Math.round(d/255)<<1|Math.round(g/255));return E===2&&(w+=60),w},A.hsv.ansi16=function(v){return A.rgb.ansi16(A.hsv.rgb(v),v[2])},A.rgb.ansi256=function(v){var g=v[0],d=v[1],_=v[2];if(g===d&&d===_)return g<8?16:g>248?231:Math.round((g-8)/247*24)+232;var E=16+36*Math.round(g/255*5)+6*Math.round(d/255*5)+Math.round(_/255*5);return E},A.ansi16.rgb=function(v){var g=v%10;if(g===0||g===7)return v>50&&(g+=3.5),g=g/10.5*255,[g,g,g];var d=(~~(v>50)+1)*.5,_=(g&1)*d*255,E=(g>>1&1)*d*255,w=(g>>2&1)*d*255;return[_,E,w]},A.ansi256.rgb=function(v){if(v>=232){var g=(v-232)*10+8;return[g,g,g]}v-=16;var d,_=Math.floor(v/36)/5*255,E=Math.floor((d=v%36)/6)/5*255,w=d%6/5*255;return[_,E,w]},A.rgb.hex=function(v){var g=((Math.round(v[0])&255)<<16)+((Math.round(v[1])&255)<<8)+(Math.round(v[2])&255),d=g.toString(16).toUpperCase();return"000000".substring(d.length)+d},A.hex.rgb=function(v){var g=v.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!g)return[0,0,0];var d=g[0];g[0].length===3&&(d=d.split("").map(function(k){return k+k}).join(""));var _=parseInt(d,16),E=_>>16&255,w=_>>8&255,T=_&255;return[E,w,T]},A.rgb.hcg=function(v){var g=v[0]/255,d=v[1]/255,_=v[2]/255,E=Math.max(Math.max(g,d),_),w=Math.min(Math.min(g,d),_),T=E-w,k,b;return T<1?k=w/(1-T):k=0,T<=0?b=0:E===g?b=(d-_)/T%6:E===d?b=2+(_-g)/T:b=4+(g-d)/T+4,b/=6,b%=1,[b*360,T*100,k*100]},A.hsl.hcg=function(v){var g=v[1]/100,d=v[2]/100,_=1,E=0;return d<.5?_=2*g*d:_=2*g*(1-d),_<1&&(E=(d-.5*_)/(1-_)),[v[0],_*100,E*100]},A.hsv.hcg=function(v){var g=v[1]/100,d=v[2]/100,_=g*d,E=0;return _<1&&(E=(d-_)/(1-_)),[v[0],_*100,E*100]},A.hcg.rgb=function(v){var g=v[0]/360,d=v[1]/100,_=v[2]/100;if(d===0)return[_*255,_*255,_*255];var E=[0,0,0],w=g%1*6,T=w%1,k=1-T,b=0;switch(Math.floor(w)){case 0:E[0]=1,E[1]=T,E[2]=0;break;case 1:E[0]=k,E[1]=1,E[2]=0;break;case 2:E[0]=0,E[1]=1,E[2]=T;break;case 3:E[0]=0,E[1]=k,E[2]=1;break;case 4:E[0]=T,E[1]=0,E[2]=1;break;default:E[0]=1,E[1]=0,E[2]=k}return b=(1-d)*_,[(d*E[0]+b)*255,(d*E[1]+b)*255,(d*E[2]+b)*255]},A.hcg.hsv=function(v){var g=v[1]/100,d=v[2]/100,_=g+d*(1-g),E=0;return _>0&&(E=g/_),[v[0],E*100,_*100]},A.hcg.hsl=function(v){var g=v[1]/100,d=v[2]/100,_=d*(1-g)+.5*g,E=0;return _>0&&_<.5?E=g/(2*_):_>=.5&&_<1&&(E=g/(2*(1-_))),[v[0],E*100,_*100]},A.hcg.hwb=function(v){var g=v[1]/100,d=v[2]/100,_=g+d*(1-g);return[v[0],(_-g)*100,(1-_)*100]},A.hwb.hcg=function(v){var g=v[1]/100,d=v[2]/100,_=1-d,E=_-g,w=0;return E<1&&(w=(_-E)/(1-E)),[v[0],E*100,w*100]},A.apple.rgb=function(v){return[v[0]/65535*255,v[1]/65535*255,v[2]/65535*255]},A.rgb.apple=function(v){return[v[0]/255*65535,v[1]/255*65535,v[2]/255*65535]},A.gray.rgb=function(v){return[v[0]/100*255,v[0]/100*255,v[0]/100*255]},A.gray.hsl=A.gray.hsv=function(v){return[0,0,v[0]]},A.gray.hwb=function(v){return[0,100,v[0]]},A.gray.cmyk=function(v){return[0,0,0,v[0]]},A.gray.lab=function(v){return[v[0],0,0]},A.gray.hex=function(v){var g=Math.round(v[0]/100*255)&255,d=(g<<16)+(g<<8)+g,_=d.toString(16).toUpperCase();return"000000".substring(_.length)+_},A.rgb.gray=function(v){var g=(v[0]+v[1]+v[2])/3;return[g/255*100]}},12085:function(or,U,z){var B=z(48168),j=z(4111),R={},A=Object.keys(B);function N(y){var x=function(v){return v==null?v:(arguments.length>1&&(v=Array.prototype.slice.call(arguments)),y(v))};return"conversion"in y&&(x.conversion=y.conversion),x}function L(y){var x=function(v){if(v==null)return v;arguments.length>1&&(v=Array.prototype.slice.call(arguments));var g=y(v);if(typeof g=="object")for(var d=g.length,_=0;_<d;_++)g[_]=Math.round(g[_]);return g};return"conversion"in y&&(x.conversion=y.conversion),x}A.forEach(function(y){R[y]={},Object.defineProperty(R[y],"channels",{value:B[y].channels}),Object.defineProperty(R[y],"labels",{value:B[y].labels});var x=j(y),v=Object.keys(x);v.forEach(function(g){var d=x[g];R[y][g]=L(d),R[y][g].raw=N(d)})}),or.exports=R},39092:function(or){"use strict";or.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},4111:function(or,U,z){var B=z(48168);function j(){for(var L={},y=Object.keys(B),x=y.length,v=0;v<x;v++)L[y[v]]={distance:-1,parent:null};return L}function R(L){var y=j(),x=[L];for(y[L].distance=0;x.length;)for(var v=x.pop(),g=Object.keys(B[v]),d=g.length,_=0;_<d;_++){var E=g[_],w=y[E];w.distance===-1&&(w.distance=y[v].distance+1,w.parent=v,x.unshift(E))}return y}function A(L,y){return function(x){return y(L(x))}}function N(L,y){for(var x=[y[L].parent,L],v=B[y[L].parent][L],g=y[L].parent;y[g].parent;)x.unshift(y[g].parent),v=A(B[y[g].parent][g],v),g=y[g].parent;return v.conversion=x,v}or.exports=function(L){for(var y=R(L),x={},v=Object.keys(y),g=v.length,d=0;d<g;d++){var _=v[d],E=y[_];E.parent!==null&&(x[_]=N(_,y))}return x}},8874:function(or){"use strict";or.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},19818:function(or,U,z){var B=z(8874),j=z(86851),R=Object.hasOwnProperty,A=Object.create(null);for(var N in B)R.call(B,N)&&(A[B[N]]=N);var L=or.exports={to:{},get:{}};L.get=function(v){var g=v.substring(0,3).toLowerCase(),d,_;switch(g){case"hsl":d=L.get.hsl(v),_="hsl";break;case"hwb":d=L.get.hwb(v),_="hwb";break;default:d=L.get.rgb(v),_="rgb";break}return d?{model:_,value:d}:null},L.get.rgb=function(v){if(!v)return null;var g=/^#([a-f0-9]{3,4})$/i,d=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,_=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,E=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,w=/^(\w+)$/,T=[0,0,0,1],k,b,m;if(k=v.match(d)){for(m=k[2],k=k[1],b=0;b<3;b++){var $=b*2;T[b]=parseInt(k.slice($,$+2),16)}m&&(T[3]=parseInt(m,16)/255)}else if(k=v.match(g)){for(k=k[1],m=k[3],b=0;b<3;b++)T[b]=parseInt(k[b]+k[b],16);m&&(T[3]=parseInt(m+m,16)/255)}else if(k=v.match(_)){for(b=0;b<3;b++)T[b]=parseInt(k[b+1],0);k[4]&&(k[5]?T[3]=parseFloat(k[4])*.01:T[3]=parseFloat(k[4]))}else if(k=v.match(E)){for(b=0;b<3;b++)T[b]=Math.round(parseFloat(k[b+1])*2.55);k[4]&&(k[5]?T[3]=parseFloat(k[4])*.01:T[3]=parseFloat(k[4]))}else return(k=v.match(w))?k[1]==="transparent"?[0,0,0,0]:R.call(B,k[1])?(T=B[k[1]],T[3]=1,T):null:null;for(b=0;b<3;b++)T[b]=y(T[b],0,255);return T[3]=y(T[3],0,1),T},L.get.hsl=function(v){if(!v)return null;var g=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,d=v.match(g);if(d){var _=parseFloat(d[4]),E=(parseFloat(d[1])%360+360)%360,w=y(parseFloat(d[2]),0,100),T=y(parseFloat(d[3]),0,100),k=y(isNaN(_)?1:_,0,1);return[E,w,T,k]}return null},L.get.hwb=function(v){if(!v)return null;var g=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,d=v.match(g);if(d){var _=parseFloat(d[4]),E=(parseFloat(d[1])%360+360)%360,w=y(parseFloat(d[2]),0,100),T=y(parseFloat(d[3]),0,100),k=y(isNaN(_)?1:_,0,1);return[E,w,T,k]}return null},L.to.hex=function(){var v=j(arguments);return"#"+x(v[0])+x(v[1])+x(v[2])+(v[3]<1?x(Math.round(v[3]*255)):"")},L.to.rgb=function(){var v=j(arguments);return v.length<4||v[3]===1?"rgb("+Math.round(v[0])+", "+Math.round(v[1])+", "+Math.round(v[2])+")":"rgba("+Math.round(v[0])+", "+Math.round(v[1])+", "+Math.round(v[2])+", "+v[3]+")"},L.to.rgb.percent=function(){var v=j(arguments),g=Math.round(v[0]/255*100),d=Math.round(v[1]/255*100),_=Math.round(v[2]/255*100);return v.length<4||v[3]===1?"rgb("+g+"%, "+d+"%, "+_+"%)":"rgba("+g+"%, "+d+"%, "+_+"%, "+v[3]+")"},L.to.hsl=function(){var v=j(arguments);return v.length<4||v[3]===1?"hsl("+v[0]+", "+v[1]+"%, "+v[2]+"%)":"hsla("+v[0]+", "+v[1]+"%, "+v[2]+"%, "+v[3]+")"},L.to.hwb=function(){var v=j(arguments),g="";return v.length>=4&&v[3]!==1&&(g=", "+v[3]),"hwb("+v[0]+", "+v[1]+"%, "+v[2]+"%"+g+")"},L.to.keyword=function(v){return A[v.slice(0,3)]};function y(v,g,d){return Math.min(Math.max(g,v),d)}function x(v){var g=Math.round(v).toString(16).toUpperCase();return g.length<2?"0"+g:g}},6767:function(or,U,z){"use strict";var B=z(19818),j=z(12085),R=[].slice,A=["keyword","gray","hex"],N={};Object.keys(j).forEach(function(w){N[R.call(j[w].labels).sort().join("")]=w});var L={};function y(w,T){if(!(this instanceof y))return new y(w,T);if(T&&T in A&&(T=null),T&&!(T in j))throw new Error("Unknown model: "+T);var k,b;if(w==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(w instanceof y)this.model=w.model,this.color=w.color.slice(),this.valpha=w.valpha;else if(typeof w=="string"){var m=B.get(w);if(m===null)throw new Error("Unable to parse color from string: "+w);this.model=m.model,b=j[this.model].channels,this.color=m.value.slice(0,b),this.valpha=typeof m.value[b]=="number"?m.value[b]:1}else if(w.length){this.model=T||"rgb",b=j[this.model].channels;var $=R.call(w,0,b);this.color=E($,b),this.valpha=typeof w[b]=="number"?w[b]:1}else if(typeof w=="number")w&=16777215,this.model="rgb",this.color=[w>>16&255,w>>8&255,w&255],this.valpha=1;else{this.valpha=1;var W=Object.keys(w);"alpha"in w&&(W.splice(W.indexOf("alpha"),1),this.valpha=typeof w.alpha=="number"?w.alpha:0);var X=W.sort().join("");if(!(X in N))throw new Error("Unable to parse color from object: "+JSON.stringify(w));this.model=N[X];var H=j[this.model].labels,Q=[];for(k=0;k<H.length;k++)Q.push(w[H[k]]);this.color=E(Q)}if(L[this.model])for(b=j[this.model].channels,k=0;k<b;k++){var q=L[this.model][k];q&&(this.color[k]=q(this.color[k]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}y.prototype={toString:function(){return this.string()},toJSON:function(){return this[this.model]()},string:function(w){var T=this.model in B.to?this:this.rgb();T=T.round(typeof w=="number"?w:1);var k=T.valpha===1?T.color:T.color.concat(this.valpha);return B.to[T.model](k)},percentString:function(w){var T=this.rgb().round(typeof w=="number"?w:1),k=T.valpha===1?T.color:T.color.concat(this.valpha);return B.to.rgb.percent(k)},array:function(){return this.valpha===1?this.color.slice():this.color.concat(this.valpha)},object:function(){for(var w={},T=j[this.model].channels,k=j[this.model].labels,b=0;b<T;b++)w[k[b]]=this.color[b];return this.valpha!==1&&(w.alpha=this.valpha),w},unitArray:function(){var w=this.rgb().color;return w[0]/=255,w[1]/=255,w[2]/=255,this.valpha!==1&&w.push(this.valpha),w},unitObject:function(){var w=this.rgb().object();return w.r/=255,w.g/=255,w.b/=255,this.valpha!==1&&(w.alpha=this.valpha),w},round:function(w){return w=Math.max(w||0,0),new y(this.color.map(v(w)).concat(this.valpha),this.model)},alpha:function(w){return arguments.length?new y(this.color.concat(Math.max(0,Math.min(1,w))),this.model):this.valpha},red:g("rgb",0,d(255)),green:g("rgb",1,d(255)),blue:g("rgb",2,d(255)),hue:g(["hsl","hsv","hsl","hwb","hcg"],0,function(w){return(w%360+360)%360}),saturationl:g("hsl",1,d(100)),lightness:g("hsl",2,d(100)),saturationv:g("hsv",1,d(100)),value:g("hsv",2,d(100)),chroma:g("hcg",1,d(100)),gray:g("hcg",2,d(100)),white:g("hwb",1,d(100)),wblack:g("hwb",2,d(100)),cyan:g("cmyk",0,d(100)),magenta:g("cmyk",1,d(100)),yellow:g("cmyk",2,d(100)),black:g("cmyk",3,d(100)),x:g("xyz",0,d(100)),y:g("xyz",1,d(100)),z:g("xyz",2,d(100)),l:g("lab",0,d(100)),a:g("lab",1),b:g("lab",2),keyword:function(w){return arguments.length?new y(w):j[this.model].keyword(this.color)},hex:function(w){return arguments.length?new y(w):B.to.hex(this.rgb().round().color)},rgbNumber:function(){var w=this.rgb().color;return(w[0]&255)<<16|(w[1]&255)<<8|w[2]&255},luminosity:function(){for(var w=this.rgb().color,T=[],k=0;k<w.length;k++){var b=w[k]/255;T[k]=b<=.03928?b/12.92:Math.pow((b+.055)/1.055,2.4)}return .2126*T[0]+.7152*T[1]+.0722*T[2]},contrast:function(w){var T=this.luminosity(),k=w.luminosity();return T>k?(T+.05)/(k+.05):(k+.05)/(T+.05)},level:function(w){var T=this.contrast(w);return T>=7.1?"AAA":T>=4.5?"AA":""},isDark:function(){var w=this.rgb().color,T=(w[0]*299+w[1]*587+w[2]*114)/1e3;return T<128},isLight:function(){return!this.isDark()},negate:function(){for(var w=this.rgb(),T=0;T<3;T++)w.color[T]=255-w.color[T];return w},lighten:function(w){var T=this.hsl();return T.color[2]+=T.color[2]*w,T},darken:function(w){var T=this.hsl();return T.color[2]-=T.color[2]*w,T},saturate:function(w){var T=this.hsl();return T.color[1]+=T.color[1]*w,T},desaturate:function(w){var T=this.hsl();return T.color[1]-=T.color[1]*w,T},whiten:function(w){var T=this.hwb();return T.color[1]+=T.color[1]*w,T},blacken:function(w){var T=this.hwb();return T.color[2]+=T.color[2]*w,T},grayscale:function(){var w=this.rgb().color,T=w[0]*.3+w[1]*.59+w[2]*.11;return y.rgb(T,T,T)},fade:function(w){return this.alpha(this.valpha-this.valpha*w)},opaquer:function(w){return this.alpha(this.valpha+this.valpha*w)},rotate:function(w){var T=this.hsl(),k=T.color[0];return k=(k+w)%360,k=k<0?360+k:k,T.color[0]=k,T},mix:function(w,T){if(!w||!w.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof w);var k=w.rgb(),b=this.rgb(),m=T===void 0?.5:T,$=2*m-1,W=k.alpha()-b.alpha(),X=(($*W==-1?$:($+W)/(1+$*W))+1)/2,H=1-X;return y.rgb(X*k.red()+H*b.red(),X*k.green()+H*b.green(),X*k.blue()+H*b.blue(),k.alpha()*m+b.alpha()*(1-m))}},Object.keys(j).forEach(function(w){if(A.indexOf(w)===-1){var T=j[w].channels;y.prototype[w]=function(){if(this.model===w)return new y(this);if(arguments.length)return new y(arguments,w);var k=typeof arguments[T]=="number"?T:this.valpha;return new y(_(j[this.model][w].raw(this.color)).concat(k),w)},y[w]=function(k){return typeof k=="number"&&(k=E(R.call(arguments),T)),new y(k,w)}}});function x(w,T){return Number(w.toFixed(T))}function v(w){return function(T){return x(T,w)}}function g(w,T,k){return w=Array.isArray(w)?w:[w],w.forEach(function(b){(L[b]||(L[b]=[]))[T]=k}),w=w[0],function(b){var m;return arguments.length?(k&&(b=k(b)),m=this[w](),m.color[T]=b,m):(m=this[w]().color[T],k&&(m=k(m)),m)}}function d(w){return function(T){return Math.max(0,Math.min(w,T))}}function _(w){return Array.isArray(w)?w:[w]}function E(w,T){for(var k=0;k<T;k++)typeof w[k]!="number"&&(w[k]=0);return w}or.exports=y},71829:function(or,U,z){"use strict";z.r(U),z.d(U,{quadtree:function(){return B.Z}});var B=z(28833)},28833:function(or,U,z){"use strict";z.d(U,{Z:function(){return $}});function B(Q){const q=+this._x.call(null,Q),J=+this._y.call(null,Q);return j(this.cover(q,J),q,J,Q)}function j(Q,q,J,te){if(isNaN(q)||isNaN(J))return Q;var fe,de=Q._root,Te={data:te},Se=Q._x0,Ie=Q._y0,be=Q._x1,pe=Q._y1,Me,De,Ue,nt,Ze,ht,Rt,tr;if(!de)return Q._root=Te,Q;for(;de.length;)if((Ze=q>=(Me=(Se+be)/2))?Se=Me:be=Me,(ht=J>=(De=(Ie+pe)/2))?Ie=De:pe=De,fe=de,!(de=de[Rt=ht<<1|Ze]))return fe[Rt]=Te,Q;if(Ue=+Q._x.call(null,de.data),nt=+Q._y.call(null,de.data),q===Ue&&J===nt)return Te.next=de,fe?fe[Rt]=Te:Q._root=Te,Q;do fe=fe?fe[Rt]=new Array(4):Q._root=new Array(4),(Ze=q>=(Me=(Se+be)/2))?Se=Me:be=Me,(ht=J>=(De=(Ie+pe)/2))?Ie=De:pe=De;while((Rt=ht<<1|Ze)==(tr=(nt>=De)<<1|Ue>=Me));return fe[tr]=de,fe[Rt]=Te,Q}function R(Q){var q,J,te=Q.length,fe,de,Te=new Array(te),Se=new Array(te),Ie=Infinity,be=Infinity,pe=-Infinity,Me=-Infinity;for(J=0;J<te;++J)isNaN(fe=+this._x.call(null,q=Q[J]))||isNaN(de=+this._y.call(null,q))||(Te[J]=fe,Se[J]=de,fe<Ie&&(Ie=fe),fe>pe&&(pe=fe),de<be&&(be=de),de>Me&&(Me=de));if(Ie>pe||be>Me)return this;for(this.cover(Ie,be).cover(pe,Me),J=0;J<te;++J)j(this,Te[J],Se[J],Q[J]);return this}function A(Q,q){if(isNaN(Q=+Q)||isNaN(q=+q))return this;var J=this._x0,te=this._y0,fe=this._x1,de=this._y1;if(isNaN(J))fe=(J=Math.floor(Q))+1,de=(te=Math.floor(q))+1;else{for(var Te=fe-J||1,Se=this._root,Ie,be;J>Q||Q>=fe||te>q||q>=de;)switch(be=(q<te)<<1|Q<J,Ie=new Array(4),Ie[be]=Se,Se=Ie,Te*=2,be){case 0:fe=J+Te,de=te+Te;break;case 1:J=fe-Te,de=te+Te;break;case 2:fe=J+Te,te=de-Te;break;case 3:J=fe-Te,te=de-Te;break}this._root&&this._root.length&&(this._root=Se)}return this._x0=J,this._y0=te,this._x1=fe,this._y1=de,this}function N(){var Q=[];return this.visit(function(q){if(!q.length)do Q.push(q.data);while(q=q.next)}),Q}function L(Q){return arguments.length?this.cover(+Q[0][0],+Q[0][1]).cover(+Q[1][0],+Q[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function y(Q,q,J,te,fe){this.node=Q,this.x0=q,this.y0=J,this.x1=te,this.y1=fe}function x(Q,q,J){var te,fe=this._x0,de=this._y0,Te,Se,Ie,be,pe=this._x1,Me=this._y1,De=[],Ue=this._root,nt,Ze;for(Ue&&De.push(new y(Ue,fe,de,pe,Me)),J==null?J=Infinity:(fe=Q-J,de=q-J,pe=Q+J,Me=q+J,J*=J);nt=De.pop();)if(!(!(Ue=nt.node)||(Te=nt.x0)>pe||(Se=nt.y0)>Me||(Ie=nt.x1)<fe||(be=nt.y1)<de))if(Ue.length){var ht=(Te+Ie)/2,Rt=(Se+be)/2;De.push(new y(Ue[3],ht,Rt,Ie,be),new y(Ue[2],Te,Rt,ht,be),new y(Ue[1],ht,Se,Ie,Rt),new y(Ue[0],Te,Se,ht,Rt)),(Ze=(q>=Rt)<<1|Q>=ht)&&(nt=De[De.length-1],De[De.length-1]=De[De.length-1-Ze],De[De.length-1-Ze]=nt)}else{var tr=Q-+this._x.call(null,Ue.data),Qe=q-+this._y.call(null,Ue.data),lt=tr*tr+Qe*Qe;if(lt<J){var St=Math.sqrt(J=lt);fe=Q-St,de=q-St,pe=Q+St,Me=q+St,te=Ue.data}}return te}function v(Q){if(isNaN(pe=+this._x.call(null,Q))||isNaN(Me=+this._y.call(null,Q)))return this;var q,J=this._root,te,fe,de,Te=this._x0,Se=this._y0,Ie=this._x1,be=this._y1,pe,Me,De,Ue,nt,Ze,ht,Rt;if(!J)return this;if(J.length)for(;;){if((nt=pe>=(De=(Te+Ie)/2))?Te=De:Ie=De,(Ze=Me>=(Ue=(Se+be)/2))?Se=Ue:be=Ue,q=J,!(J=J[ht=Ze<<1|nt]))return this;if(!J.length)break;(q[ht+1&3]||q[ht+2&3]||q[ht+3&3])&&(te=q,Rt=ht)}for(;J.data!==Q;)if(fe=J,!(J=J.next))return this;return(de=J.next)&&delete J.next,fe?(de?fe.next=de:delete fe.next,this):q?(de?q[ht]=de:delete q[ht],(J=q[0]||q[1]||q[2]||q[3])&&J===(q[3]||q[2]||q[1]||q[0])&&!J.length&&(te?te[Rt]=J:this._root=J),this):(this._root=de,this)}function g(Q){for(var q=0,J=Q.length;q<J;++q)this.remove(Q[q]);return this}function d(){return this._root}function _(){var Q=0;return this.visit(function(q){if(!q.length)do++Q;while(q=q.next)}),Q}function E(Q){var q=[],J,te=this._root,fe,de,Te,Se,Ie;for(te&&q.push(new y(te,this._x0,this._y0,this._x1,this._y1));J=q.pop();)if(!Q(te=J.node,de=J.x0,Te=J.y0,Se=J.x1,Ie=J.y1)&&te.length){var be=(de+Se)/2,pe=(Te+Ie)/2;(fe=te[3])&&q.push(new y(fe,be,pe,Se,Ie)),(fe=te[2])&&q.push(new y(fe,de,pe,be,Ie)),(fe=te[1])&&q.push(new y(fe,be,Te,Se,pe)),(fe=te[0])&&q.push(new y(fe,de,Te,be,pe))}return this}function w(Q){var q=[],J=[],te;for(this._root&&q.push(new y(this._root,this._x0,this._y0,this._x1,this._y1));te=q.pop();){var fe=te.node;if(fe.length){var de,Te=te.x0,Se=te.y0,Ie=te.x1,be=te.y1,pe=(Te+Ie)/2,Me=(Se+be)/2;(de=fe[0])&&q.push(new y(de,Te,Se,pe,Me)),(de=fe[1])&&q.push(new y(de,pe,Se,Ie,Me)),(de=fe[2])&&q.push(new y(de,Te,Me,pe,be)),(de=fe[3])&&q.push(new y(de,pe,Me,Ie,be))}J.push(te)}for(;te=J.pop();)Q(te.node,te.x0,te.y0,te.x1,te.y1);return this}function T(Q){return Q[0]}function k(Q){return arguments.length?(this._x=Q,this):this._x}function b(Q){return Q[1]}function m(Q){return arguments.length?(this._y=Q,this):this._y}function $(Q,q,J){var te=new W(q==null?T:q,J==null?b:J,NaN,NaN,NaN,NaN);return Q==null?te:te.addAll(Q)}function W(Q,q,J,te,fe,de){this._x=Q,this._y=q,this._x0=J,this._y0=te,this._x1=fe,this._y1=de,this._root=void 0}function X(Q){for(var q={data:Q.data},J=q;Q=Q.next;)J=J.next={data:Q.data};return q}var H=$.prototype=W.prototype;H.copy=function(){var Q=new W(this._x,this._y,this._x0,this._y0,this._x1,this._y1),q=this._root,J,te;if(!q)return Q;if(!q.length)return Q._root=X(q),Q;for(J=[{source:q,target:Q._root=new Array(4)}];q=J.pop();)for(var fe=0;fe<4;++fe)(te=q.source[fe])&&(te.length?J.push({source:te,target:q.target[fe]=new Array(4)}):q.target[fe]=X(te));return Q},H.add=B,H.addAll=R,H.cover=A,H.data=N,H.extent=L,H.find=x,H.remove=v,H.removeAll=g,H.root=d,H.size=_,H.visit=E,H.visitAfter=w,H.x=k,H.y=m},31969:function(or,U,z){"use strict";z.r(U),z.d(U,{BRIDGE_GRAPH_NAME:function(){return N},GraphType:function(){return x},HierarchyNodeType:function(){return v},InclusionType:function(){return y},LAYOUT_CONFIG:function(){return B},NodeType:function(){return L},ROOT_NAME:function(){return A},buildGraph:function(){return ar},flatGraph:function(){return Mr},getEdges:function(){return Ir},mergeConfig:function(){return j}});const B={graph:{meta:{rankDir:"TB",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function j(f={},M=B){var G,Y,re,ie;const le=JSON.parse(JSON.stringify(M)),ge=((G=f==null?void 0:f.graph)===null||G===void 0?void 0:G.meta)||{},me=((Y=f==null?void 0:f.subScene)===null||Y===void 0?void 0:Y.meta)||{},Le=((re=f==null?void 0:f.nodeSize)===null||re===void 0?void 0:re.meta)||{},ze=((ie=f==null?void 0:f.nodeSize)===null||ie===void 0?void 0:ie.node)||{},Fe=le.nodeSize.bridge;return{graph:{meta:Object.assign(le.graph.meta,ge)},subScene:{meta:Object.assign(le.subScene.meta,me)},nodeSize:{meta:Object.assign(le.nodeSize.meta,Le),node:Object.assign(le.nodeSize.node,ze),bridge:Fe}}}function R(f){return`\u25EC${f}\u25EC`}const A=R("ROOT"),N=R("BRIDGE_GRAPH");var L,y,x,v;(function(f){f[f.META=0]="META",f[f.NODE=1]="NODE",f[f.BRIDGE=2]="BRIDGE"})(L||(L={})),function(f){f[f.INCLUDE=0]="INCLUDE",f[f.EXCLUDE=1]="EXCLUDE",f[f.UNSPECIFIED=2]="UNSPECIFIED"}(y||(y={})),function(f){f[f.META=0]="META",f[f.CORE=1]="CORE",f[f.BRIDGE=2]="BRIDGE"}(x||(x={})),function(f){f[f.META=0]="META",f[f.OP=1]="OP",f[f.SERIES=2]="SERIES"}(v||(v={}));var g=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof z.g!="undefined"?z.g:typeof self!="undefined"?self:{};function d(f,M){return f(M={exports:{}},M.exports),M.exports}var _=function(){this.__data__=[],this.size=0},E=function(f,M){return f===M||f!=f&&M!=M},w=function(f,M){for(var G=f.length;G--;)if(E(f[G][0],M))return G;return-1},T=Array.prototype.splice,k=function(f){var M=this.__data__,G=w(M,f);return!(G<0)&&(G==M.length-1?M.pop():T.call(M,G,1),--this.size,!0)},b=function(f){var M=this.__data__,G=w(M,f);return G<0?void 0:M[G][1]},m=function(f){return w(this.__data__,f)>-1},$=function(f,M){var G=this.__data__,Y=w(G,f);return Y<0?(++this.size,G.push([f,M])):G[Y][1]=M,this};function W(f){var M=-1,G=f==null?0:f.length;for(this.clear();++M<G;){var Y=f[M];this.set(Y[0],Y[1])}}W.prototype.clear=_,W.prototype.delete=k,W.prototype.get=b,W.prototype.has=m,W.prototype.set=$;var X=W,H=function(){this.__data__=new X,this.size=0},Q=function(f){var M=this.__data__,G=M.delete(f);return this.size=M.size,G},q=function(f){return this.__data__.get(f)},J=function(f){return this.__data__.has(f)},te=typeof g=="object"&&g&&g.Object===Object&&g,fe=typeof self=="object"&&self&&self.Object===Object&&self,de=te||fe||Function("return this")(),Te=de.Symbol,Se=Object.prototype,Ie=Se.hasOwnProperty,be=Se.toString,pe=Te?Te.toStringTag:void 0,Me=function(f){var M=Ie.call(f,pe),G=f[pe];try{f[pe]=void 0;var Y=!0}catch(ie){}var re=be.call(f);return Y&&(M?f[pe]=G:delete f[pe]),re},De=Object.prototype.toString,Ue=function(f){return De.call(f)},nt=Te?Te.toStringTag:void 0,Ze=function(f){return f==null?f===void 0?"[object Undefined]":"[object Null]":nt&&nt in Object(f)?Me(f):Ue(f)},ht=function(f){var M=typeof f;return f!=null&&(M=="object"||M=="function")},Rt,tr=function(f){if(!ht(f))return!1;var M=Ze(f);return M=="[object Function]"||M=="[object GeneratorFunction]"||M=="[object AsyncFunction]"||M=="[object Proxy]"},Qe=de["__core-js_shared__"],lt=(Rt=/[^.]+$/.exec(Qe&&Qe.keys&&Qe.keys.IE_PROTO||""))?"Symbol(src)_1."+Rt:"",St=function(f){return!!lt&&lt in f},Ct=Function.prototype.toString,_t=function(f){if(f!=null){try{return Ct.call(f)}catch(M){}try{return f+""}catch(M){}}return""},pt=/^\[object .+?Constructor\]$/,rr=Function.prototype,xr=Object.prototype,Vt=rr.toString,ft=xr.hasOwnProperty,Bt=RegExp("^"+Vt.call(ft).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=function(f){return!(!ht(f)||St(f))&&(tr(f)?Bt:pt).test(_t(f))},br=function(f,M){return f==null?void 0:f[M]},Ur=function(f,M){var G=br(f,M);return qt(G)?G:void 0},Ae=Ur(de,"Map"),Hr=Ur(Object,"create"),Sr=function(){this.__data__=Hr?Hr(null):{},this.size=0},qr=function(f){var M=this.has(f)&&delete this.__data__[f];return this.size-=M?1:0,M},Gr=Object.prototype.hasOwnProperty,vn=function(f){var M=this.__data__;if(Hr){var G=M[f];return G==="__lodash_hash_undefined__"?void 0:G}return Gr.call(M,f)?M[f]:void 0},Gn=Object.prototype.hasOwnProperty,mn=function(f){var M=this.__data__;return Hr?M[f]!==void 0:Gn.call(M,f)},$r=function(f,M){var G=this.__data__;return this.size+=this.has(f)?0:1,G[f]=Hr&&M===void 0?"__lodash_hash_undefined__":M,this};function gn(f){var M=-1,G=f==null?0:f.length;for(this.clear();++M<G;){var Y=f[M];this.set(Y[0],Y[1])}}gn.prototype.clear=Sr,gn.prototype.delete=qr,gn.prototype.get=vn,gn.prototype.has=mn,gn.prototype.set=$r;var Rr=gn,ct=function(){this.size=0,this.__data__={hash:new Rr,map:new(Ae||X),string:new Rr}},Wt=function(f){var M=typeof f;return M=="string"||M=="number"||M=="symbol"||M=="boolean"?f!=="__proto__":f===null},Er=function(f,M){var G=f.__data__;return Wt(M)?G[typeof M=="string"?"string":"hash"]:G.map},Dr=function(f){var M=Er(this,f).delete(f);return this.size-=M?1:0,M},Vr=function(f){return Er(this,f).get(f)},pn=function(f){return Er(this,f).has(f)},wn=function(f,M){var G=Er(this,f),Y=G.size;return G.set(f,M),this.size+=G.size==Y?0:1,this};function Sn(f){var M=-1,G=f==null?0:f.length;for(this.clear();++M<G;){var Y=f[M];this.set(Y[0],Y[1])}}Sn.prototype.clear=ct,Sn.prototype.delete=Dr,Sn.prototype.get=Vr,Sn.prototype.has=pn,Sn.prototype.set=wn;var In=Sn,$n=function(f,M){var G=this.__data__;if(G instanceof X){var Y=G.__data__;if(!Ae||Y.length<199)return Y.push([f,M]),this.size=++G.size,this;G=this.__data__=new In(Y)}return G.set(f,M),this.size=G.size,this};function Zr(f){var M=this.__data__=new X(f);this.size=M.size}Zr.prototype.clear=H,Zr.prototype.delete=Q,Zr.prototype.get=q,Zr.prototype.has=J,Zr.prototype.set=$n;var Pn=Zr,An=function(f,M){for(var G=-1,Y=f==null?0:f.length;++G<Y&&M(f[G],G,f)!==!1;);return f},ln=function(){try{var f=Ur(Object,"defineProperty");return f({},"",{}),f}catch(M){}}(),va=function(f,M,G){M=="__proto__"&&ln?ln(f,M,{configurable:!0,enumerable:!0,value:G,writable:!0}):f[M]=G},K=Object.prototype.hasOwnProperty,Dt=function(f,M,G){var Y=f[M];K.call(f,M)&&E(Y,G)&&(G!==void 0||M in f)||va(f,M,G)},rt=function(f,M,G,Y){var re=!G;G||(G={});for(var ie=-1,le=M.length;++ie<le;){var ge=M[ie],me=Y?Y(G[ge],f[ge],ge,G,f):void 0;me===void 0&&(me=f[ge]),re?va(G,ge,me):Dt(G,ge,me)}return G},ne=function(f,M){for(var G=-1,Y=Array(f);++G<f;)Y[G]=M(G);return Y},ae=function(f){return f!=null&&typeof f=="object"},P=function(f){return ae(f)&&Ze(f)=="[object Arguments]"},S=Object.prototype,C=S.hasOwnProperty,V=S.propertyIsEnumerable,he=P(function(){return arguments}())?P:function(f){return ae(f)&&C.call(f,"callee")&&!V.call(f,"callee")},xe=Array.isArray,Ee=function(){return!1},Ne=d(function(f,M){var G=M&&!M.nodeType&&M,Y=G&&f&&!f.nodeType&&f,re=Y&&Y.exports===G?de.Buffer:void 0,ie=(re?re.isBuffer:void 0)||Ee;f.exports=ie}),Et=/^(?:0|[1-9]\d*)$/,st=function(f,M){var G=typeof f;return!!(M=M==null?9007199254740991:M)&&(G=="number"||G!="symbol"&&Et.test(f))&&f>-1&&f%1==0&&f<M},Pt=function(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=9007199254740991},$t={};$t["[object Float32Array]"]=$t["[object Float64Array]"]=$t["[object Int8Array]"]=$t["[object Int16Array]"]=$t["[object Int32Array]"]=$t["[object Uint8Array]"]=$t["[object Uint8ClampedArray]"]=$t["[object Uint16Array]"]=$t["[object Uint32Array]"]=!0,$t["[object Arguments]"]=$t["[object Array]"]=$t["[object ArrayBuffer]"]=$t["[object Boolean]"]=$t["[object DataView]"]=$t["[object Date]"]=$t["[object Error]"]=$t["[object Function]"]=$t["[object Map]"]=$t["[object Number]"]=$t["[object Object]"]=$t["[object RegExp]"]=$t["[object Set]"]=$t["[object String]"]=$t["[object WeakMap]"]=!1;var Ht=function(f){return ae(f)&&Pt(f.length)&&!!$t[Ze(f)]},Br=function(f){return function(M){return f(M)}},hn=d(function(f,M){var G=M&&!M.nodeType&&M,Y=G&&f&&!f.nodeType&&f,re=Y&&Y.exports===G&&te.process,ie=function(){try{var le=Y&&Y.require&&Y.require("util").types;return le||re&&re.binding&&re.binding("util")}catch(ge){}}();f.exports=ie}),Ot=hn&&hn.isTypedArray,Qt=Ot?Br(Ot):Ht,pr=Object.prototype.hasOwnProperty,en=function(f,M){var G=xe(f),Y=!G&&he(f),re=!G&&!Y&&Ne(f),ie=!G&&!Y&&!re&&Qt(f),le=G||Y||re||ie,ge=le?ne(f.length,String):[],me=ge.length;for(var Le in f)!M&&!pr.call(f,Le)||le&&(Le=="length"||re&&(Le=="offset"||Le=="parent")||ie&&(Le=="buffer"||Le=="byteLength"||Le=="byteOffset")||st(Le,me))||ge.push(Le);return ge},Nr=Object.prototype,ta=function(f){var M=f&&f.constructor;return f===(typeof M=="function"&&M.prototype||Nr)},kn=function(f,M){return function(G){return f(M(G))}},En=kn(Object.keys,Object),Rn=Object.prototype.hasOwnProperty,Yn=function(f){if(!ta(f))return En(f);var M=[];for(var G in Object(f))Rn.call(f,G)&&G!="constructor"&&M.push(G);return M},bn=function(f){return f!=null&&Pt(f.length)&&!tr(f)},je=function(f){return bn(f)?en(f):Yn(f)},Ce=function(f,M){return f&&rt(M,je(M),f)},Xe=function(f){var M=[];if(f!=null)for(var G in Object(f))M.push(G);return M},ut=Object.prototype.hasOwnProperty,ot=function(f){if(!ht(f))return Xe(f);var M=ta(f),G=[];for(var Y in f)(Y!="constructor"||!M&&ut.call(f,Y))&&G.push(Y);return G},bt=function(f){return bn(f)?en(f,!0):ot(f)},Xt=function(f,M){return f&&rt(M,bt(M),f)},wr=d(function(f,M){var G=M&&!M.nodeType&&M,Y=G&&f&&!f.nodeType&&f,re=Y&&Y.exports===G?de.Buffer:void 0,ie=re?re.allocUnsafe:void 0;f.exports=function(le,ge){if(ge)return le.slice();var me=le.length,Le=ie?ie(me):new le.constructor(me);return le.copy(Le),Le}}),Wr=function(f,M){var G=-1,Y=f.length;for(M||(M=Array(Y));++G<Y;)M[G]=f[G];return M},on=function(f,M){for(var G=-1,Y=f==null?0:f.length,re=0,ie=[];++G<Y;){var le=f[G];M(le,G,f)&&(ie[re++]=le)}return ie},xn=function(){return[]},zn=Object.prototype.propertyIsEnumerable,Qn=Object.getOwnPropertySymbols,ia=Qn?function(f){return f==null?[]:(f=Object(f),on(Qn(f),function(M){return zn.call(f,M)}))}:xn,Wa=function(f,M){return rt(f,ia(f),M)},Ia=function(f,M){for(var G=-1,Y=M.length,re=f.length;++G<Y;)f[re+G]=M[G];return f},Ba=kn(Object.getPrototypeOf,Object),Ea=Object.getOwnPropertySymbols?function(f){for(var M=[];f;)Ia(M,ia(f)),f=Ba(f);return M}:xn,qa=function(f,M){return rt(f,Ea(f),M)},si=function(f,M,G){var Y=M(f);return xe(f)?Y:Ia(Y,G(f))},_a=function(f){return si(f,je,ia)},So=function(f){return si(f,bt,Ea)},to=Ur(de,"DataView"),co=Ur(de,"Promise"),ni=Ur(de,"Set"),lo=Ur(de,"WeakMap"),Ss=_t(to),Ro=_t(Ae),mi=_t(co),ya=_t(ni),_o=_t(lo),Yi=Ze;(to&&Yi(new to(new ArrayBuffer(1)))!="[object DataView]"||Ae&&Yi(new Ae)!="[object Map]"||co&&Yi(co.resolve())!="[object Promise]"||ni&&Yi(new ni)!="[object Set]"||lo&&Yi(new lo)!="[object WeakMap]")&&(Yi=function(f){var M=Ze(f),G=M=="[object Object]"?f.constructor:void 0,Y=G?_t(G):"";if(Y)switch(Y){case Ss:return"[object DataView]";case Ro:return"[object Map]";case mi:return"[object Promise]";case ya:return"[object Set]";case _o:return"[object WeakMap]"}return M});var Fi=Yi,Bo=Object.prototype.hasOwnProperty,_s=function(f){var M=f.length,G=new f.constructor(M);return M&&typeof f[0]=="string"&&Bo.call(f,"index")&&(G.index=f.index,G.input=f.input),G},Oo=de.Uint8Array,Hi=function(f){var M=new f.constructor(f.byteLength);return new Oo(M).set(new Oo(f)),M},_n=function(f,M){var G=M?Hi(f.buffer):f.buffer;return new f.constructor(G,f.byteOffset,f.byteLength)},Fo=/\w*$/,Go=function(f){var M=new f.constructor(f.source,Fo.exec(f));return M.lastIndex=f.lastIndex,M},Va=Te?Te.prototype:void 0,Ms=Va?Va.valueOf:void 0,Ko=function(f){return Ms?Object(Ms.call(f)):{}},Li=function(f,M){var G=M?Hi(f.buffer):f.buffer;return new f.constructor(G,f.byteOffset,f.length)},Mo=function(f,M,G){var Y=f.constructor;switch(M){case"[object ArrayBuffer]":return Hi(f);case"[object Boolean]":case"[object Date]":return new Y(+f);case"[object DataView]":return _n(f,G);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return Li(f,G);case"[object Map]":return new Y;case"[object Number]":case"[object String]":return new Y(f);case"[object RegExp]":return Go(f);case"[object Set]":return new Y;case"[object Symbol]":return Ko(f)}},ho=Object.create,Gi=function(){function f(){}return function(M){if(!ht(M))return{};if(ho)return ho(M);f.prototype=M;var G=new f;return f.prototype=void 0,G}}(),Di=function(f){return typeof f.constructor!="function"||ta(f)?{}:Gi(Ba(f))},$o=function(f){return ae(f)&&Fi(f)=="[object Map]"},Ni=hn&&hn.isMap,ro=Ni?Br(Ni):$o,Qo=function(f){return ae(f)&&Fi(f)=="[object Set]"},ns=hn&&hn.isSet,zi=ns?Br(ns):Qo,ga={};ga["[object Arguments]"]=ga["[object Array]"]=ga["[object ArrayBuffer]"]=ga["[object DataView]"]=ga["[object Boolean]"]=ga["[object Date]"]=ga["[object Float32Array]"]=ga["[object Float64Array]"]=ga["[object Int8Array]"]=ga["[object Int16Array]"]=ga["[object Int32Array]"]=ga["[object Map]"]=ga["[object Number]"]=ga["[object Object]"]=ga["[object RegExp]"]=ga["[object Set]"]=ga["[object String]"]=ga["[object Symbol]"]=ga["[object Uint8Array]"]=ga["[object Uint8ClampedArray]"]=ga["[object Uint16Array]"]=ga["[object Uint32Array]"]=!0,ga["[object Error]"]=ga["[object Function]"]=ga["[object WeakMap]"]=!1;var vo=function f(M,G,Y,re,ie,le){var ge,me=1&G,Le=2&G,ze=4&G;if(Y&&(ge=ie?Y(M,re,ie,le):Y(M)),ge!==void 0)return ge;if(!ht(M))return M;var Fe=xe(M);if(Fe){if(ge=_s(M),!me)return Wr(M,ge)}else{var tt=Fi(M),Mt=tt=="[object Function]"||tt=="[object GeneratorFunction]";if(Ne(M))return wr(M,me);if(tt=="[object Object]"||tt=="[object Arguments]"||Mt&&!ie){if(ge=Le||Mt?{}:Di(M),!me)return Le?qa(M,Xt(ge,M)):Wa(M,Ce(ge,M))}else{if(!ga[tt])return ie?M:{};ge=Mo(M,tt,me)}}le||(le=new Pn);var sr=le.get(M);if(sr)return sr;le.set(M,ge),zi(M)?M.forEach(function(Nt){ge.add(f(Nt,G,Y,Nt,M,le))}):ro(M)&&M.forEach(function(Nt,Lt){ge.set(Lt,f(Nt,G,Y,Lt,M,le))});var Tt=Fe?void 0:(ze?Le?So:_a:Le?bt:je)(M);return An(Tt||M,function(Nt,Lt){Tt&&(Nt=M[Lt=Nt]),Dt(ge,Lt,f(Nt,G,Y,Lt,M,le))}),ge},Vs=function(f){return vo(f,4)},Pi=function(f){return function(){return f}},Ao=function(f){return function(M,G,Y){for(var re=-1,ie=Object(M),le=Y(M),ge=le.length;ge--;){var me=le[f?ge:++re];if(G(ie[me],me,ie)===!1)break}return M}}(),as=function(f,M){return f&&Ao(f,M,je)},vi=function(f,M){return function(G,Y){if(G==null)return G;if(!bn(G))return f(G,Y);for(var re=G.length,ie=M?re:-1,le=Object(G);(M?ie--:++ie<re)&&Y(le[ie],ie,le)!==!1;);return G}}(as),Zi=function(f){return f},_i=function(f){return typeof f=="function"?f:Zi},no=function(f,M){return(xe(f)?An:vi)(f,_i(M))},Ui=no,da=function(f,M){var G=[];return vi(f,function(Y,re,ie){M(Y,re,ie)&&G.push(Y)}),G},Fa=function(f){return this.__data__.set(f,"__lodash_hash_undefined__"),this},Ya=function(f){return this.__data__.has(f)};function Ii(f){var M=-1,G=f==null?0:f.length;for(this.__data__=new In;++M<G;)this.add(f[M])}Ii.prototype.add=Ii.prototype.push=Fa,Ii.prototype.has=Ya;var Wi=Ii,ao=function(f,M){for(var G=-1,Y=f==null?0:f.length;++G<Y;)if(M(f[G],G,f))return!0;return!1},go=function(f,M){return f.has(M)},po=function(f,M,G,Y,re,ie){var le=1&G,ge=f.length,me=M.length;if(ge!=me&&!(le&&me>ge))return!1;var Le=ie.get(f),ze=ie.get(M);if(Le&&ze)return Le==M&&ze==f;var Fe=-1,tt=!0,Mt=2&G?new Wi:void 0;for(ie.set(f,M),ie.set(M,f);++Fe<ge;){var sr=f[Fe],Tt=M[Fe];if(Y)var Nt=le?Y(Tt,sr,Fe,M,f,ie):Y(sr,Tt,Fe,f,M,ie);if(Nt!==void 0){if(Nt)continue;tt=!1;break}if(Mt){if(!ao(M,function(Lt,_r){if(!go(Mt,_r)&&(sr===Lt||re(sr,Lt,G,Y,ie)))return Mt.push(_r)})){tt=!1;break}}else if(sr!==Tt&&!re(sr,Tt,G,Y,ie)){tt=!1;break}}return ie.delete(f),ie.delete(M),tt},yo=function(f){var M=-1,G=Array(f.size);return f.forEach(function(Y,re){G[++M]=[re,Y]}),G},ji=function(f){var M=-1,G=Array(f.size);return f.forEach(function(Y){G[++M]=Y}),G},ka=Te?Te.prototype:void 0,Ys=ka?ka.valueOf:void 0,_f=function(f,M,G,Y,re,ie,le){switch(G){case"[object DataView]":if(f.byteLength!=M.byteLength||f.byteOffset!=M.byteOffset)return!1;f=f.buffer,M=M.buffer;case"[object ArrayBuffer]":return!(f.byteLength!=M.byteLength||!ie(new Oo(f),new Oo(M)));case"[object Boolean]":case"[object Date]":case"[object Number]":return E(+f,+M);case"[object Error]":return f.name==M.name&&f.message==M.message;case"[object RegExp]":case"[object String]":return f==M+"";case"[object Map]":var ge=yo;case"[object Set]":var me=1&Y;if(ge||(ge=ji),f.size!=M.size&&!me)return!1;var Le=le.get(f);if(Le)return Le==M;Y|=2,le.set(f,M);var ze=po(ge(f),ge(M),Y,re,ie,le);return le.delete(f),ze;case"[object Symbol]":if(Ys)return Ys.call(f)==Ys.call(M)}return!1},mo=Object.prototype.hasOwnProperty,lu=function(f,M,G,Y,re,ie){var le=1&G,ge=_a(f),me=ge.length;if(me!=_a(M).length&&!le)return!1;for(var Le=me;Le--;){var ze=ge[Le];if(!(le?ze in M:mo.call(M,ze)))return!1}var Fe=ie.get(f),tt=ie.get(M);if(Fe&&tt)return Fe==M&&tt==f;var Mt=!0;ie.set(f,M),ie.set(M,f);for(var sr=le;++Le<me;){var Tt=f[ze=ge[Le]],Nt=M[ze];if(Y)var Lt=le?Y(Nt,Tt,ze,M,f,ie):Y(Tt,Nt,ze,f,M,ie);if(!(Lt===void 0?Tt===Nt||re(Tt,Nt,G,Y,ie):Lt)){Mt=!1;break}sr||(sr=ze=="constructor")}if(Mt&&!sr){var _r=f.constructor,Yr=M.constructor;_r==Yr||!("constructor"in f)||!("constructor"in M)||typeof _r=="function"&&_r instanceof _r&&typeof Yr=="function"&&Yr instanceof Yr||(Mt=!1)}return ie.delete(f),ie.delete(M),Mt},na=Object.prototype.hasOwnProperty,an=function(f,M,G,Y,re,ie){var le=xe(f),ge=xe(M),me=le?"[object Array]":Fi(f),Le=ge?"[object Array]":Fi(M),ze=(me=me=="[object Arguments]"?"[object Object]":me)=="[object Object]",Fe=(Le=Le=="[object Arguments]"?"[object Object]":Le)=="[object Object]",tt=me==Le;if(tt&&Ne(f)){if(!Ne(M))return!1;le=!0,ze=!1}if(tt&&!ze)return ie||(ie=new Pn),le||Qt(f)?po(f,M,G,Y,re,ie):_f(f,M,me,G,Y,re,ie);if(!(1&G)){var Mt=ze&&na.call(f,"__wrapped__"),sr=Fe&&na.call(M,"__wrapped__");if(Mt||sr){var Tt=Mt?f.value():f,Nt=sr?M.value():M;return ie||(ie=new Pn),re(Tt,Nt,G,Y,ie)}}return!!tt&&(ie||(ie=new Pn),lu(f,M,G,Y,re,ie))},Hs=function f(M,G,Y,re,ie){return M===G||(M==null||G==null||!ae(M)&&!ae(G)?M!=M&&G!=G:an(M,G,Y,re,f,ie))},Xi=function(f,M,G,Y){var re=G.length,ie=re,le=!Y;if(f==null)return!ie;for(f=Object(f);re--;){var ge=G[re];if(le&&ge[2]?ge[1]!==f[ge[0]]:!(ge[0]in f))return!1}for(;++re<ie;){var me=(ge=G[re])[0],Le=f[me],ze=ge[1];if(le&&ge[2]){if(Le===void 0&&!(me in f))return!1}else{var Fe=new Pn;if(Y)var tt=Y(Le,ze,me,f,M,Fe);if(!(tt===void 0?Hs(ze,Le,3,Y,Fe):tt))return!1}}return!0},zo=function(f){return f==f&&!ht(f)},is=function(f){for(var M=je(f),G=M.length;G--;){var Y=M[G],re=f[Y];M[G]=[Y,re,zo(re)]}return M},ui=function(f,M){return function(G){return G!=null&&G[f]===M&&(M!==void 0||f in Object(G))}},ai=function(f){var M=is(f);return M.length==1&&M[0][2]?ui(M[0][0],M[0][1]):function(G){return G===f||Xi(G,f,M)}},Eo=function(f){return typeof f=="symbol"||ae(f)&&Ze(f)=="[object Symbol]"},Yu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hu=/^\w*$/,du=function(f,M){if(xe(f))return!1;var G=typeof f;return!(G!="number"&&G!="symbol"&&G!="boolean"&&f!=null&&!Eo(f))||Hu.test(f)||!Yu.test(f)||M!=null&&f in Object(M)};function hu(f,M){if(typeof f!="function"||M!=null&&typeof M!="function")throw new TypeError("Expected a function");var G=function(){var Y=arguments,re=M?M.apply(this,Y):Y[0],ie=G.cache;if(ie.has(re))return ie.get(re);var le=f.apply(this,Y);return G.cache=ie.set(re,le)||ie,le};return G.cache=new(hu.Cache||In),G}hu.Cache=In;var Ei=hu,Ki=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zs=/\\(\\)?/g,Ks=function(f){var M=Ei(f,function(Y){return G.size===500&&G.clear(),Y}),G=M.cache;return M}(function(f){var M=[];return f.charCodeAt(0)===46&&M.push(""),f.replace(Ki,function(G,Y,re,ie){M.push(re?ie.replace(Zs,"$1"):Y||G)}),M}),io=function(f,M){for(var G=-1,Y=f==null?0:f.length,re=Array(Y);++G<Y;)re[G]=M(f[G],G,f);return re},os=Te?Te.prototype:void 0,ss=os?os.toString:void 0,us=function f(M){if(typeof M=="string")return M;if(xe(M))return io(M,f)+"";if(Eo(M))return ss?ss.call(M):"";var G=M+"";return G=="0"&&1/M==-Infinity?"-0":G},$s=function(f){return f==null?"":us(f)},Uo=function(f,M){return xe(f)?f:du(f,M)?[f]:Ks($s(f))},bo=function(f){if(typeof f=="string"||Eo(f))return f;var M=f+"";return M=="0"&&1/f==-Infinity?"-0":M},fs=function(f,M){for(var G=0,Y=(M=Uo(M,f)).length;f!=null&&G<Y;)f=f[bo(M[G++])];return G&&G==Y?f:void 0},Zu=function(f,M,G){var Y=f==null?void 0:fs(f,M);return Y===void 0?G:Y},vu=function(f,M){return f!=null&&M in Object(f)},gu=function(f,M,G){for(var Y=-1,re=(M=Uo(M,f)).length,ie=!1;++Y<re;){var le=bo(M[Y]);if(!(ie=f!=null&&G(f,le)))break;f=f[le]}return ie||++Y!=re?ie:!!(re=f==null?0:f.length)&&Pt(re)&&st(le,re)&&(xe(f)||he(f))},pu=function(f,M){return f!=null&&gu(f,M,vu)},Ku=function(f,M){return du(f)&&zo(M)?ui(bo(f),M):function(G){var Y=Zu(G,f);return Y===void 0&&Y===M?pu(G,f):Hs(M,Y,3)}},Co=function(f){return function(M){return M==null?void 0:M[f]}},Cs=function(f){return function(M){return fs(M,f)}},cs=function(f){return du(f)?Co(bo(f)):Cs(f)},$i=function(f){return typeof f=="function"?f:f==null?Zi:typeof f=="object"?xe(f)?Ku(f[0],f[1]):ai(f):cs(f)},xo=function(f,M){return(xe(f)?on:da)(f,$i(M))},$u=Object.prototype.hasOwnProperty,Mf=function(f,M){return f!=null&&$u.call(f,M)},Ts=function(f,M){return f!=null&&gu(f,M,Mf)},Cf=Object.prototype.hasOwnProperty,u=function(f){if(f==null)return!0;if(bn(f)&&(xe(f)||typeof f=="string"||typeof f.splice=="function"||Ne(f)||Qt(f)||he(f)))return!f.length;var M=Fi(f);if(M=="[object Map]"||M=="[object Set]")return!f.size;if(ta(f))return!Yn(f).length;for(var G in f)if(Cf.call(f,G))return!1;return!0},O=function(f){return f===void 0},ue=function(f,M){var G=-1,Y=bn(f)?Array(f.length):[];return vi(f,function(re,ie,le){Y[++G]=M(re,ie,le)}),Y},ye=function(f,M){return(xe(f)?io:ue)(f,$i(M))},_e=function(f,M,G,Y){var re=-1,ie=f==null?0:f.length;for(Y&&ie&&(G=f[++re]);++re<ie;)G=M(G,f[re],re,f);return G},ke=function(f,M,G,Y,re){return re(f,function(ie,le,ge){G=Y?(Y=!1,ie):M(G,ie,le,ge)}),G},Be=function(f,M,G){var Y=xe(f)?_e:ke,re=arguments.length<3;return Y(f,$i(M),G,re,vi)},Ye=function(f){return typeof f=="string"||!xe(f)&&ae(f)&&Ze(f)=="[object String]"},Je=Co("length"),dt=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),It=function(f){return dt.test(f)},ir="[\\ud800-\\udfff]",cr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",nr="\\ud83c[\\udffb-\\udfff]",Or="[^\\ud800-\\udfff]",Cr="(?:\\ud83c[\\udde6-\\uddff]){2}",hr="[\\ud800-\\udbff][\\udc00-\\udfff]",rn="(?:"+cr+"|"+nr+")?",Jn="[\\ufe0e\\ufe0f]?"+rn+("(?:\\u200d(?:"+[Or,Cr,hr].join("|")+")[\\ufe0e\\ufe0f]?"+rn+")*"),qn="(?:"+[Or+cr+"?",cr,Cr,hr,ir].join("|")+")",Un=RegExp(nr+"(?="+nr+")|"+qn+Jn,"g"),Mn=function(f){for(var M=Un.lastIndex=0;Un.test(f);)++M;return M},Cn=function(f){return It(f)?Mn(f):Je(f)},Ga=function(f){if(f==null)return 0;if(bn(f))return Ye(f)?Cn(f):f.length;var M=Fi(f);return M=="[object Map]"||M=="[object Set]"?f.size:Yn(f).length},ei=function(f,M,G){var Y=xe(f),re=Y||Ne(f)||Qt(f);if(M=$i(M),G==null){var ie=f&&f.constructor;G=re?Y?new ie:[]:ht(f)&&tr(ie)?Gi(Ba(f)):{}}return(re?An:as)(f,function(le,ge,me){return M(G,le,ge,me)}),G},Ka=Te?Te.isConcatSpreadable:void 0,$a=function(f){return xe(f)||he(f)||!!(Ka&&f&&f[Ka])},Ha=function f(M,G,Y,re,ie){var le=-1,ge=M.length;for(Y||(Y=$a),ie||(ie=[]);++le<ge;){var me=M[le];G>0&&Y(me)?G>1?f(me,G-1,Y,re,ie):Ia(ie,me):re||(ie[ie.length]=me)}return ie},fi=function(f,M,G){switch(G.length){case 0:return f.call(M);case 1:return f.call(M,G[0]);case 2:return f.call(M,G[0],G[1]);case 3:return f.call(M,G[0],G[1],G[2])}return f.apply(M,G)},bi=Math.max,ha=function(f,M,G){return M=bi(M===void 0?f.length-1:M,0),function(){for(var Y=arguments,re=-1,ie=bi(Y.length-M,0),le=Array(ie);++re<ie;)le[re]=Y[M+re];re=-1;for(var ge=Array(M+1);++re<M;)ge[re]=Y[re];return ge[M]=G(le),fi(f,this,ge)}},Oa=ln?function(f,M){return ln(f,"toString",{configurable:!0,enumerable:!1,value:Pi(M),writable:!0})}:Zi,Jo=Date.now,Wo=function(f){var M=0,G=0;return function(){var Y=Jo(),re=16-(Y-G);if(G=Y,re>0){if(++M>=800)return arguments[0]}else M=0;return f.apply(void 0,arguments)}}(Oa),oo=function(f,M){return Wo(ha(f,M,Zi),f+"")},Qs=function(f,M,G,Y){for(var re=f.length,ie=G+(Y?1:-1);Y?ie--:++ie<re;)if(M(f[ie],ie,f))return ie;return-1},Tf=function(f){return f!=f},Qu=function(f,M,G){for(var Y=G-1,re=f.length;++Y<re;)if(f[Y]===M)return Y;return-1},Ju=function(f,M,G){return M==M?Qu(f,M,G):Qs(f,Tf,G)},cc=function(f,M){return!!(f==null?0:f.length)&&Ju(f,M,0)>-1},yu=function(f,M,G){for(var Y=-1,re=f==null?0:f.length;++Y<re;)if(G(M,f[Y]))return!0;return!1},If=function(){},Of=ni&&1/ji(new ni([,-0]))[1]==1/0?function(f){return new ni(f)}:If,qo=function(f,M,G){var Y=-1,re=cc,ie=f.length,le=!0,ge=[],me=ge;if(G)le=!1,re=yu;else if(ie>=200){var Le=M?null:Of(f);if(Le)return ji(Le);le=!1,re=go,me=new Wi}else me=M?[]:ge;e:for(;++Y<ie;){var ze=f[Y],Fe=M?M(ze):ze;if(ze=G||ze!==0?ze:0,le&&Fe==Fe){for(var tt=me.length;tt--;)if(me[tt]===Fe)continue e;M&&me.push(Fe),ge.push(ze)}else re(me,Fe,G)||(me!==ge&&me.push(Fe),ge.push(ze))}return ge},Af=function(f){return ae(f)&&bn(f)},lc=oo(function(f){return qo(Ha(f,1,Af,!0))}),el=function(f,M){return io(M,function(G){return f[G]})},Is,mu=function(f){return f==null?[]:el(f,je(f))};try{Is={clone:Vs,constant:Pi,each:Ui,filter:xo,has:Ts,isArray:xe,isEmpty:u,isFunction:tr,isUndefined:O,keys:je,map:ye,reduce:Be,size:Ga,transform:ei,union:lc,values:mu}}catch(f){}Is||(Is=window._);var Qr=Is,Os=ca;function ca(f){this._isDirected=!Qr.has(f,"directed")||f.directed,this._isMultigraph=!!Qr.has(f,"multigraph")&&f.multigraph,this._isCompound=!!Qr.has(f,"compound")&&f.compound,this._label=void 0,this._defaultNodeLabelFn=Qr.constant(void 0),this._defaultEdgeLabelFn=Qr.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children["\0"]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function Lf(f,M){f[M]?f[M]++:f[M]=1}function Eu(f,M){--f[M]||delete f[M]}function ls(f,M,G,Y){var re=""+M,ie=""+G;if(!f&&re>ie){var le=re;re=ie,ie=le}return re+""+ie+""+(Qr.isUndefined(Y)?"\0":Y)}function Df(f,M,G,Y){var re=""+M,ie=""+G;if(!f&&re>ie){var le=re;re=ie,ie=le}var ge={v:re,w:ie};return Y&&(ge.name=Y),ge}function bu(f,M){return ls(f,M.v,M.w,M.name)}ca.prototype._nodeCount=0,ca.prototype._edgeCount=0,ca.prototype.isDirected=function(){return this._isDirected},ca.prototype.isMultigraph=function(){return this._isMultigraph},ca.prototype.isCompound=function(){return this._isCompound},ca.prototype.setGraph=function(f){return this._label=f,this},ca.prototype.graph=function(){return this._label},ca.prototype.setDefaultNodeLabel=function(f){return Qr.isFunction(f)||(f=Qr.constant(f)),this._defaultNodeLabelFn=f,this},ca.prototype.nodeCount=function(){return this._nodeCount},ca.prototype.nodes=function(){return Qr.keys(this._nodes)},ca.prototype.sources=function(){var f=this;return Qr.filter(this.nodes(),function(M){return Qr.isEmpty(f._in[M])})},ca.prototype.sinks=function(){var f=this;return Qr.filter(this.nodes(),function(M){return Qr.isEmpty(f._out[M])})},ca.prototype.setNodes=function(f,M){var G=arguments,Y=this;return Qr.each(f,function(re){G.length>1?Y.setNode(re,M):Y.setNode(re)}),this},ca.prototype.setNode=function(f,M){return Qr.has(this._nodes,f)?(arguments.length>1&&(this._nodes[f]=M),this):(this._nodes[f]=arguments.length>1?M:this._defaultNodeLabelFn(f),this._isCompound&&(this._parent[f]="\0",this._children[f]={},this._children["\0"][f]=!0),this._in[f]={},this._preds[f]={},this._out[f]={},this._sucs[f]={},++this._nodeCount,this)},ca.prototype.node=function(f){return this._nodes[f]},ca.prototype.hasNode=function(f){return Qr.has(this._nodes,f)},ca.prototype.removeNode=function(f){var M=this;if(Qr.has(this._nodes,f)){var G=function(Y){M.removeEdge(M._edgeObjs[Y])};delete this._nodes[f],this._isCompound&&(this._removeFromParentsChildList(f),delete this._parent[f],Qr.each(this.children(f),function(Y){M.setParent(Y)}),delete this._children[f]),Qr.each(Qr.keys(this._in[f]),G),delete this._in[f],delete this._preds[f],Qr.each(Qr.keys(this._out[f]),G),delete this._out[f],delete this._sucs[f],--this._nodeCount}return this},ca.prototype.setParent=function(f,M){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(Qr.isUndefined(M))M="\0";else{for(var G=M+="";!Qr.isUndefined(G);G=this.parent(G))if(G===f)throw new Error("Setting "+M+" as parent of "+f+" would create a cycle");this.setNode(M)}return this.setNode(f),this._removeFromParentsChildList(f),this._parent[f]=M,this._children[M][f]=!0,this},ca.prototype._removeFromParentsChildList=function(f){delete this._children[this._parent[f]][f]},ca.prototype.parent=function(f){if(this._isCompound){var M=this._parent[f];if(M!=="\0")return M}},ca.prototype.children=function(f){if(Qr.isUndefined(f)&&(f="\0"),this._isCompound){var M=this._children[f];if(M)return Qr.keys(M)}else{if(f==="\0")return this.nodes();if(this.hasNode(f))return[]}},ca.prototype.predecessors=function(f){var M=this._preds[f];if(M)return Qr.keys(M)},ca.prototype.successors=function(f){var M=this._sucs[f];if(M)return Qr.keys(M)},ca.prototype.neighbors=function(f){var M=this.predecessors(f);if(M)return Qr.union(M,this.successors(f))},ca.prototype.isLeaf=function(f){return(this.isDirected()?this.successors(f):this.neighbors(f)).length===0},ca.prototype.filterNodes=function(f){var M=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});M.setGraph(this.graph());var G=this;Qr.each(this._nodes,function(ie,le){f(le)&&M.setNode(le,ie)}),Qr.each(this._edgeObjs,function(ie){M.hasNode(ie.v)&&M.hasNode(ie.w)&&M.setEdge(ie,G.edge(ie))});var Y={};function re(ie){var le=G.parent(ie);return le===void 0||M.hasNode(le)?(Y[ie]=le,le):le in Y?Y[le]:re(le)}return this._isCompound&&Qr.each(M.nodes(),function(ie){M.setParent(ie,re(ie))}),M},ca.prototype.setDefaultEdgeLabel=function(f){return Qr.isFunction(f)||(f=Qr.constant(f)),this._defaultEdgeLabelFn=f,this},ca.prototype.edgeCount=function(){return this._edgeCount},ca.prototype.edges=function(){return Qr.values(this._edgeObjs)},ca.prototype.setPath=function(f,M){var G=this,Y=arguments;return Qr.reduce(f,function(re,ie){return Y.length>1?G.setEdge(re,ie,M):G.setEdge(re,ie),ie}),this},ca.prototype.setEdge=function(){var f,M,G,Y,re=!1,ie=arguments[0];typeof ie=="object"&&ie!==null&&"v"in ie?(f=ie.v,M=ie.w,G=ie.name,arguments.length===2&&(Y=arguments[1],re=!0)):(f=ie,M=arguments[1],G=arguments[3],arguments.length>2&&(Y=arguments[2],re=!0)),f=""+f,M=""+M,Qr.isUndefined(G)||(G=""+G);var le=ls(this._isDirected,f,M,G);if(Qr.has(this._edgeLabels,le))return re&&(this._edgeLabels[le]=Y),this;if(!Qr.isUndefined(G)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(f),this.setNode(M),this._edgeLabels[le]=re?Y:this._defaultEdgeLabelFn(f,M,G);var ge=Df(this._isDirected,f,M,G);return f=ge.v,M=ge.w,Object.freeze(ge),this._edgeObjs[le]=ge,Lf(this._preds[M],f),Lf(this._sucs[f],M),this._in[M][le]=ge,this._out[f][le]=ge,this._edgeCount++,this},ca.prototype.edge=function(f,M,G){var Y=arguments.length===1?bu(this._isDirected,arguments[0]):ls(this._isDirected,f,M,G);return this._edgeLabels[Y]},ca.prototype.hasEdge=function(f,M,G){var Y=arguments.length===1?bu(this._isDirected,arguments[0]):ls(this._isDirected,f,M,G);return Qr.has(this._edgeLabels,Y)},ca.prototype.removeEdge=function(f,M,G){var Y=arguments.length===1?bu(this._isDirected,arguments[0]):ls(this._isDirected,f,M,G),re=this._edgeObjs[Y];return re&&(f=re.v,M=re.w,delete this._edgeLabels[Y],delete this._edgeObjs[Y],Eu(this._preds[M],f),Eu(this._sucs[f],M),delete this._in[M][Y],delete this._out[f][Y],this._edgeCount--),this},ca.prototype.inEdges=function(f,M){var G=this._in[f];if(G){var Y=Qr.values(G);return M?Qr.filter(Y,function(re){return re.v===M}):Y}},ca.prototype.outEdges=function(f,M){var G=this._out[f];if(G){var Y=Qr.values(G);return M?Qr.filter(Y,function(re){return re.w===M}):Y}},ca.prototype.nodeEdges=function(f,M){var G=this.inEdges(f,M);if(G)return G.concat(this.outEdges(f,M))};var qu={Graph:Os,version:"2.1.8"},ef={write:function(f){var M={options:{directed:f.isDirected(),multigraph:f.isMultigraph(),compound:f.isCompound()},nodes:Nf(f),edges:Lo(f)};return Qr.isUndefined(f.graph())||(M.value=Qr.clone(f.graph())),M},read:function(f){var M=new Os(f.options).setGraph(f.value);return Qr.each(f.nodes,function(G){M.setNode(G.v,G.value),G.parent&&M.setParent(G.v,G.parent)}),Qr.each(f.edges,function(G){M.setEdge({v:G.v,w:G.w,name:G.name},G.value)}),M}};function Nf(f){return Qr.map(f.nodes(),function(M){var G=f.node(M),Y=f.parent(M),re={v:M};return Qr.isUndefined(G)||(re.value=G),Qr.isUndefined(Y)||(re.parent=Y),re})}function Lo(f){return Qr.map(f.edges(),function(M){var G=f.edge(M),Y={v:M.v,w:M.w};return Qr.isUndefined(M.name)||(Y.name=M.name),Qr.isUndefined(G)||(Y.value=G),Y})}var Pf=function(f){var M,G={},Y=[];function re(ie){Qr.has(G,ie)||(G[ie]=!0,M.push(ie),Qr.each(f.successors(ie),re),Qr.each(f.predecessors(ie),re))}return Qr.each(f.nodes(),function(ie){M=[],re(ie),M.length&&Y.push(M)}),Y},kf=xi;function xi(){this._arr=[],this._keyIndices={}}xi.prototype.size=function(){return this._arr.length},xi.prototype.keys=function(){return this._arr.map(function(f){return f.key})},xi.prototype.has=function(f){return Qr.has(this._keyIndices,f)},xi.prototype.priority=function(f){var M=this._keyIndices[f];if(M!==void 0)return this._arr[M].priority},xi.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},xi.prototype.add=function(f,M){var G=this._keyIndices;if(f=String(f),!Qr.has(G,f)){var Y=this._arr,re=Y.length;return G[f]=re,Y.push({key:f,priority:M}),this._decrease(re),!0}return!1},xi.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var f=this._arr.pop();return delete this._keyIndices[f.key],this._heapify(0),f.key},xi.prototype.decrease=function(f,M){var G=this._keyIndices[f];if(M>this._arr[G].priority)throw new Error("New priority is greater than current priority. Key: "+f+" Old: "+this._arr[G].priority+" New: "+M);this._arr[G].priority=M,this._decrease(G)},xi.prototype._heapify=function(f){var M=this._arr,G=2*f,Y=G+1,re=f;G<M.length&&(re=M[G].priority<M[re].priority?G:re,Y<M.length&&(re=M[Y].priority<M[re].priority?Y:re),re!==f&&(this._swap(f,re),this._heapify(re)))},xi.prototype._decrease=function(f){for(var M,G=this._arr,Y=G[f].priority;f!==0&&!(G[M=f>>1].priority<Y);)this._swap(f,M),f=M},xi.prototype._swap=function(f,M){var G=this._arr,Y=this._keyIndices,re=G[f],ie=G[M];G[f]=ie,G[M]=re,Y[ie.key]=f,Y[re.key]=M};var tf=function(f,M,G,Y){return function(re,ie,le,ge){var me,Le,ze={},Fe=new kf,tt=function(Mt){var sr=Mt.v!==me?Mt.v:Mt.w,Tt=ze[sr],Nt=le(Mt),Lt=Le.distance+Nt;if(Nt<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+Mt+" Weight: "+Nt);Lt<Tt.distance&&(Tt.distance=Lt,Tt.predecessor=me,Fe.decrease(sr,Lt))};for(re.nodes().forEach(function(Mt){var sr=Mt===ie?0:Number.POSITIVE_INFINITY;ze[Mt]={distance:sr},Fe.add(Mt,sr)});Fe.size()>0&&(me=Fe.removeMin(),(Le=ze[me]).distance!==Number.POSITIVE_INFINITY);)ge(me).forEach(tt);return ze}(f,String(M),G||As,Y||function(re){return f.outEdges(re)})},As=Qr.constant(1),rf=function(f,M,G){return Qr.transform(f.nodes(),function(Y,re){Y[re]=tf(f,re,M,G)},{})},nf=function(f){var M=0,G=[],Y={},re=[];function ie(le){var ge=Y[le]={onStack:!0,lowlink:M,index:M++};if(G.push(le),f.successors(le).forEach(function(ze){Qr.has(Y,ze)?Y[ze].onStack&&(ge.lowlink=Math.min(ge.lowlink,Y[ze].index)):(ie(ze),ge.lowlink=Math.min(ge.lowlink,Y[ze].lowlink))}),ge.lowlink===ge.index){var me,Le=[];do me=G.pop(),Y[me].onStack=!1,Le.push(me);while(le!==me);re.push(Le)}}return f.nodes().forEach(function(le){Qr.has(Y,le)||ie(le)}),re},dc=function(f){return Qr.filter(nf(f),function(M){return M.length>1||M.length===1&&f.hasEdge(M[0],M[0])})},hc=function(f,M,G){return function(Y,re,ie){var le={},ge=Y.nodes();return ge.forEach(function(me){le[me]={},le[me][me]={distance:0},ge.forEach(function(Le){me!==Le&&(le[me][Le]={distance:Number.POSITIVE_INFINITY})}),ie(me).forEach(function(Le){var ze=Le.v===me?Le.w:Le.v,Fe=re(Le);le[me][ze]={distance:Fe,predecessor:me}})}),ge.forEach(function(me){var Le=le[me];ge.forEach(function(ze){var Fe=le[ze];ge.forEach(function(tt){var Mt=Fe[me],sr=Le[tt],Tt=Fe[tt],Nt=Mt.distance+sr.distance;Nt<Tt.distance&&(Tt.distance=Nt,Tt.predecessor=sr.predecessor)})})}),le}(f,M||vc,G||function(Y){return f.outEdges(Y)})},vc=Qr.constant(1),af=gc;function gc(f){var M={},G={},Y=[];if(Qr.each(f.sinks(),function re(ie){if(Qr.has(G,ie))throw new xu;Qr.has(M,ie)||(G[ie]=!0,M[ie]=!0,Qr.each(f.predecessors(ie),re),delete G[ie],Y.push(ie))}),Qr.size(M)!==f.nodeCount())throw new xu;return Y}function xu(){}gc.CycleException=xu,xu.prototype=new Error;var pc=function(f,M,G){Qr.isArray(M)||(M=[M]);var Y=(f.isDirected()?f.successors:f.neighbors).bind(f),re=[],ie={};return Qr.each(M,function(le){if(!f.hasNode(le))throw new Error("Graph does not have node: "+le);Rf(f,le,G==="post",ie,Y,re)}),re};function Rf(f,M,G,Y,re,ie){Qr.has(Y,M)||(Y[M]=!0,G||ie.push(M),Qr.each(re(M),function(le){Rf(f,le,G,Y,re,ie)}),G&&ie.push(M))}var ds,tl={Graph:qu.Graph,json:ef,alg:{components:Pf,dijkstra:tf,dijkstraAll:rf,findCycles:dc,floydWarshall:hc,isAcyclic:function(f){try{af(f)}catch(M){if(M instanceof af.CycleException)return!1;throw M}return!0},postorder:function(f,M){return pc(f,M,"post")},preorder:function(f,M){return pc(f,M,"pre")},prim:function(f,M){var G,Y=new Os,re={},ie=new kf;function le(me){var Le=me.v===G?me.w:me.v,ze=ie.priority(Le);if(ze!==void 0){var Fe=M(me);Fe<ze&&(re[Le]=G,ie.decrease(Le,Fe))}}if(f.nodeCount()===0)return Y;Qr.each(f.nodes(),function(me){ie.add(me,Number.POSITIVE_INFINITY),Y.setNode(me)}),ie.decrease(f.nodes()[0],0);for(var ge=!1;ie.size()>0;){if(G=ie.removeMin(),Qr.has(re,G))Y.setEdge(G,re[G]);else{if(ge)throw new Error("Input graph is not connected: "+f);ge=!0}f.nodeEdges(G).forEach(le)}return Y},tarjan:nf,topsort:af},version:qu.version};try{ds=tl}catch(f){}ds||(ds=window.graphlib);var Do=ds,Bf=function(f){return vo(f,5)},hs=function(f,M,G){if(!ht(G))return!1;var Y=typeof M;return!!(Y=="number"?bn(G)&&st(M,G.length):Y=="string"&&M in G)&&E(G[M],f)},Ls=Object.prototype,yc=Ls.hasOwnProperty,wu=oo(function(f,M){f=Object(f);var G=-1,Y=M.length,re=Y>2?M[2]:void 0;for(re&&hs(M[0],M[1],re)&&(Y=1);++G<Y;)for(var ie=M[G],le=bt(ie),ge=-1,me=le.length;++ge<me;){var Le=le[ge],ze=f[Le];(ze===void 0||E(ze,Ls[Le])&&!yc.call(f,Le))&&(f[Le]=ie[Le])}return f}),Ds=function(f){return function(M,G,Y){var re=Object(M);if(!bn(M)){var ie=$i(G);M=je(M),G=function(ge){return ie(re[ge],ge,re)}}var le=f(M,G,Y);return le>-1?re[ie?M[le]:le]:void 0}},mc=/^\s+|\s+$/g,rl=/^[-+]0x[0-9a-f]+$/i,of=/^0b[01]+$/i,Ff=/^0o[0-7]+$/i,Gf=parseInt,Ec=function(f){if(typeof f=="number")return f;if(Eo(f))return NaN;if(ht(f)){var M=typeof f.valueOf=="function"?f.valueOf():f;f=ht(M)?M+"":M}if(typeof f!="string")return f===0?f:+f;f=f.replace(mc,"");var G=of.test(f);return G||Ff.test(f)?Gf(f.slice(2),G?2:8):rl.test(f)?NaN:+f},sf=function(f){return f?(f=Ec(f))===Infinity||f===-Infinity?17976931348623157e292*(f<0?-1:1):f==f?f:0:f===0?f:0},uf=function(f){var M=sf(f),G=M%1;return M==M?G?M-G:M:0},nl=Math.max,al=Ds(function(f,M,G){var Y=f==null?0:f.length;if(!Y)return-1;var re=G==null?0:uf(G);return re<0&&(re=nl(Y+re,0)),Qs(f,$i(M),re)}),bc=function(f){return(f==null?0:f.length)?Ha(f,1):[]},Js=function(f,M){return f==null?f:Ao(f,_i(M),bt)},il=function(f){var M=f==null?0:f.length;return M?f[M-1]:void 0},xc=function(f,M){var G={};return M=$i(M),as(f,function(Y,re,ie){va(G,re,M(Y,re,ie))}),G},Su=function(f,M,G){for(var Y=-1,re=f.length;++Y<re;){var ie=f[Y],le=M(ie);if(le!=null&&(ge===void 0?le==le&&!Eo(le):G(le,ge)))var ge=le,me=ie}return me},jo=function(f,M){return f>M},ol=function(f){return f&&f.length?Su(f,Zi,jo):void 0},_u=function(f,M,G){(G!==void 0&&!E(f[M],G)||G===void 0&&!(M in f))&&va(f,M,G)},sl=Function.prototype,ul=Object.prototype,ki=sl.toString,fl=ul.hasOwnProperty,wc=ki.call(Object),Mu=function(f){if(!ae(f)||Ze(f)!="[object Object]")return!1;var M=Ba(f);if(M===null)return!0;var G=fl.call(M,"constructor")&&M.constructor;return typeof G=="function"&&G instanceof G&&ki.call(G)==wc},ff=function(f,M){if((M!=="constructor"||typeof f[M]!="function")&&M!="__proto__")return f[M]},To=function(f){return rt(f,bt(f))},Sc=function(f,M,G,Y,re,ie,le){var ge=ff(f,G),me=ff(M,G),Le=le.get(me);if(Le)_u(f,G,Le);else{var ze=ie?ie(ge,me,G+"",f,M,le):void 0,Fe=ze===void 0;if(Fe){var tt=xe(me),Mt=!tt&&Ne(me),sr=!tt&&!Mt&&Qt(me);ze=me,tt||Mt||sr?xe(ge)?ze=ge:Af(ge)?ze=Wr(ge):Mt?(Fe=!1,ze=wr(me,!0)):sr?(Fe=!1,ze=Li(me,!0)):ze=[]:Mu(me)||he(me)?(ze=ge,he(ge)?ze=To(ge):ht(ge)&&!tr(ge)||(ze=Di(me))):Fe=!1}Fe&&(le.set(me,ze),re(ze,me,Y,ie,le),le.delete(me)),_u(f,G,ze)}},qs=function f(M,G,Y,re,ie){M!==G&&Ao(G,function(le,ge){if(ie||(ie=new Pn),ht(le))Sc(M,G,ge,Y,f,re,ie);else{var me=re?re(ff(M,ge),le,ge+"",M,G,ie):void 0;me===void 0&&(me=le),_u(M,ge,me)}},bt)},Ns=function(f){return oo(function(M,G){var Y=-1,re=G.length,ie=re>1?G[re-1]:void 0,le=re>2?G[2]:void 0;for(ie=f.length>3&&typeof ie=="function"?(re--,ie):void 0,le&&hs(G[0],G[1],le)&&(ie=re<3?void 0:ie,re=1),M=Object(M);++Y<re;){var ge=G[Y];ge&&f(M,ge,Y,ie)}return M})}(function(f,M,G){qs(f,M,G)}),Kr=function(f,M){return f<M},Cu=function(f){return f&&f.length?Su(f,Zi,Kr):void 0},_c=function(f,M){return f&&f.length?Su(f,$i(M),Kr):void 0},so=function(){return de.Date.now()},Ps=function(f,M,G,Y){if(!ht(f))return f;for(var re=-1,ie=(M=Uo(M,f)).length,le=ie-1,ge=f;ge!=null&&++re<ie;){var me=bo(M[re]),Le=G;if(me==="__proto__"||me==="constructor"||me==="prototype")return f;if(re!=le){var ze=ge[me];(Le=Y?Y(ze,me,ge):void 0)===void 0&&(Le=ht(ze)?ze:st(M[re+1])?[]:{})}Dt(ge,me,Le),ge=ge[me]}return f},zf=function(f,M,G){for(var Y=-1,re=M.length,ie={};++Y<re;){var le=M[Y],ge=fs(f,le);G(ge,le)&&Ps(ie,Uo(le,f),ge)}return ie},ks=function(f,M){return zf(f,M,function(G,Y){return pu(f,Y)})},eu=function(f){return Wo(ha(f,void 0,bc),f+"")}(function(f,M){return f==null?{}:ks(f,M)}),tu=Math.ceil,Tu=Math.max,Mc=function(f,M,G,Y){for(var re=-1,ie=Tu(tu((M-f)/(G||1)),0),le=Array(ie);ie--;)le[Y?ie:++re]=f,f+=G;return le},Cc=function(f){return function(M,G,Y){return Y&&typeof Y!="number"&&hs(M,G,Y)&&(G=Y=void 0),M=sf(M),G===void 0?(G=M,M=0):G=sf(G),Y=Y===void 0?M<G?1:-1:sf(Y),Mc(M,G,Y,f)}}(),Tc=function(f,M){var G=f.length;for(f.sort(M);G--;)f[G]=f[G].value;return f},Uf=function(f,M){if(f!==M){var G=f!==void 0,Y=f===null,re=f==f,ie=Eo(f),le=M!==void 0,ge=M===null,me=M==M,Le=Eo(M);if(!ge&&!Le&&!ie&&f>M||ie&&le&&me&&!ge&&!Le||Y&&le&&me||!G&&me||!re)return 1;if(!Y&&!ie&&!Le&&f<M||Le&&G&&re&&!Y&&!ie||ge&&G&&re||!le&&re||!me)return-1}return 0},Wf=function(f,M,G){for(var Y=-1,re=f.criteria,ie=M.criteria,le=re.length,ge=G.length;++Y<le;){var me=Uf(re[Y],ie[Y]);if(me)return Y>=ge?me:me*(G[Y]=="desc"?-1:1)}return f.index-M.index},jf=function(f,M,G){M=M.length?io(M,function(ie){return xe(ie)?function(le){return fs(le,ie.length===1?ie[0]:ie)}:ie}):[Zi];var Y=-1;M=io(M,Br($i));var re=ue(f,function(ie,le,ge){return{criteria:io(M,function(me){return me(ie)}),index:++Y,value:ie}});return Tc(re,function(ie,le){return Wf(ie,le,G)})},cf=oo(function(f,M){if(f==null)return[];var G=M.length;return G>1&&hs(f,M[0],M[1])?M=[]:G>2&&hs(M[0],M[1],M[2])&&(M=[M[0]]),jf(f,Ha(M,1),[])}),Xf=0,Vf=function(f){var M=++Xf;return $s(f)+M},Iu=function(f,M,G){for(var Y=-1,re=f.length,ie=M.length,le={};++Y<re;){var ge=Y<ie?M[Y]:void 0;G(le,f[Y],ge)}return le},Rs,Oi=function(f,M){return Iu(f||[],M||[],Dt)};try{Rs={cloneDeep:Bf,constant:Pi,defaults:wu,each:Ui,filter:xo,find:al,flatten:bc,forEach:no,forIn:Js,has:Ts,isUndefined:O,last:il,map:ye,mapValues:xc,max:ol,merge:Ns,min:Cu,minBy:_c,now:so,pick:eu,range:Cc,reduce:Be,sortBy:cf,uniqueId:Vf,values:mu,zipObject:Oi}}catch(f){}Rs||(Rs=window._);var gt=Rs,cl=Ou;function Ou(){var f={};f._next=f._prev=f,this._sentinel=f}function Yf(f){f._prev._next=f._next,f._next._prev=f._prev,delete f._next,delete f._prev}function ll(f,M){if(f!=="_next"&&f!=="_prev")return M}Ou.prototype.dequeue=function(){var f=this._sentinel,M=f._prev;if(M!==f)return Yf(M),M},Ou.prototype.enqueue=function(f){var M=this._sentinel;f._prev&&f._next&&Yf(f),f._next=M._next,M._next._prev=f,M._next=f,f._prev=M},Ou.prototype.toString=function(){for(var f=[],M=this._sentinel,G=M._prev;G!==M;)f.push(JSON.stringify(G,ll)),G=G._prev;return"["+f.join(", ")+"]"};var Ic=Do.Graph,dl=function(f,M){if(f.nodeCount()<=1)return[];var G=function(re,ie){var le=new Ic,ge=0,me=0;gt.forEach(re.nodes(),function(Fe){le.setNode(Fe,{v:Fe,in:0,out:0})}),gt.forEach(re.edges(),function(Fe){var tt=le.edge(Fe.v,Fe.w)||0,Mt=ie(Fe),sr=tt+Mt;le.setEdge(Fe.v,Fe.w,sr),me=Math.max(me,le.node(Fe.v).out+=Mt),ge=Math.max(ge,le.node(Fe.w).in+=Mt)});var Le=gt.range(me+ge+3).map(function(){return new cl}),ze=ge+1;return gt.forEach(le.nodes(),function(Fe){Hf(Le,ze,le.node(Fe))}),{graph:le,buckets:Le,zeroIdx:ze}}(f,M||hl),Y=function(re,ie,le){for(var ge,me=[],Le=ie[ie.length-1],ze=ie[0];re.nodeCount();){for(;ge=ze.dequeue();)lf(re,ie,le,ge);for(;ge=Le.dequeue();)lf(re,ie,le,ge);if(re.nodeCount()){for(var Fe=ie.length-2;Fe>0;--Fe)if(ge=ie[Fe].dequeue()){me=me.concat(lf(re,ie,le,ge,!0));break}}}return me}(G.graph,G.buckets,G.zeroIdx);return gt.flatten(gt.map(Y,function(re){return f.outEdges(re.v,re.w)}),!0)},hl=gt.constant(1);function lf(f,M,G,Y,re){var ie=re?[]:void 0;return gt.forEach(f.inEdges(Y.v),function(le){var ge=f.edge(le),me=f.node(le.v);re&&ie.push({v:le.v,w:le.w}),me.out-=ge,Hf(M,G,me)}),gt.forEach(f.outEdges(Y.v),function(le){var ge=f.edge(le),me=le.w,Le=f.node(me);Le.in-=ge,Hf(M,G,Le)}),f.removeNode(Y.v),ie}function Hf(f,M,G){G.out?G.in?f[G.out-G.in+M].enqueue(G):f[f.length-1].enqueue(G):f[0].enqueue(G)}var Oc={run:function(f){var M=f.graph().acyclicer==="greedy"?dl(f,function(G){return function(Y){return G.edge(Y).weight}}(f)):function(G){var Y=[],re={},ie={};function le(ge){gt.has(ie,ge)||(ie[ge]=!0,re[ge]=!0,gt.forEach(G.outEdges(ge),function(me){gt.has(re,me.w)?Y.push(me):le(me.w)}),delete re[ge])}return gt.forEach(G.nodes(),le),Y}(f);gt.forEach(M,function(G){var Y=f.edge(G);f.removeEdge(G),Y.forwardName=G.name,Y.reversed=!0,f.setEdge(G.w,G.v,Y,gt.uniqueId("rev"))})},undo:function(f){gt.forEach(f.edges(),function(M){var G=f.edge(M);if(G.reversed){f.removeEdge(M);var Y=G.forwardName;delete G.reversed,delete G.forwardName,f.setEdge(M.w,M.v,G,Y)}})}},Zf=Do.Graph,Mi={addDummyNode:Au,simplify:function(f){var M=new Zf().setGraph(f.graph());return gt.forEach(f.nodes(),function(G){M.setNode(G,f.node(G))}),gt.forEach(f.edges(),function(G){var Y=M.edge(G.v,G.w)||{weight:0,minlen:1},re=f.edge(G);M.setEdge(G.v,G.w,{weight:Y.weight+re.weight,minlen:Math.max(Y.minlen,re.minlen)})}),M},asNonCompoundGraph:function(f){var M=new Zf({multigraph:f.isMultigraph()}).setGraph(f.graph());return gt.forEach(f.nodes(),function(G){f.children(G).length||M.setNode(G,f.node(G))}),gt.forEach(f.edges(),function(G){M.setEdge(G,f.edge(G))}),M},successorWeights:function(f){var M=gt.map(f.nodes(),function(G){var Y={};return gt.forEach(f.outEdges(G),function(re){Y[re.w]=(Y[re.w]||0)+f.edge(re).weight}),Y});return gt.zipObject(f.nodes(),M)},predecessorWeights:function(f){var M=gt.map(f.nodes(),function(G){var Y={};return gt.forEach(f.inEdges(G),function(re){Y[re.v]=(Y[re.v]||0)+f.edge(re).weight}),Y});return gt.zipObject(f.nodes(),M)},intersectRect:function(f,M){var G,Y,re=f.x,ie=f.y,le=M.x-re,ge=M.y-ie,me=f.width/2,Le=f.height/2;if(!le&&!ge)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(ge)*me>Math.abs(le)*Le?(ge<0&&(Le=-Le),G=Le*le/ge,Y=Le):(le<0&&(me=-me),G=me,Y=me*ge/le),{x:re+G,y:ie+Y}},buildLayerMatrix:function(f){var M=gt.map(gt.range(gi(f)+1),function(){return[]});return gt.forEach(f.nodes(),function(G){var Y=f.node(G),re=Y.rank;gt.isUndefined(re)||(M[re][Y.order]=G)}),M},normalizeRanks:function(f){var M=gt.min(gt.map(f.nodes(),function(G){return f.node(G).rank}));gt.forEach(f.nodes(),function(G){var Y=f.node(G);gt.has(Y,"rank")&&(Y.rank-=M)})},removeEmptyRanks:function(f){var M=gt.min(gt.map(f.nodes(),function(ie){return f.node(ie).rank})),G=[];gt.forEach(f.nodes(),function(ie){var le=f.node(ie).rank-M;G[le]||(G[le]=[]),G[le].push(ie)});var Y=0,re=f.graph().nodeRankFactor;gt.forEach(G,function(ie,le){gt.isUndefined(ie)&&le%re!=0?--Y:Y&&gt.forEach(ie,function(ge){f.node(ge).rank+=Y})})},addBorderNode:function(f,M,G,Y){var re={width:0,height:0};return arguments.length>=4&&(re.rank=G,re.order=Y),Au(f,"border",re,M)},maxRank:gi,partition:function(f,M){var G={lhs:[],rhs:[]};return gt.forEach(f,function(Y){M(Y)?G.lhs.push(Y):G.rhs.push(Y)}),G},time:function(f,M){var G=gt.now();try{return M()}finally{console.log(f+" time: "+(gt.now()-G)+"ms")}},notime:function(f,M){return M()}};function Au(f,M,G,Y){var re;do re=gt.uniqueId(Y);while(f.hasNode(re));return G.dummy=M,f.setNode(re,G),re}function gi(f){return gt.max(gt.map(f.nodes(),function(M){var G=f.node(M).rank;if(!gt.isUndefined(G))return G}))}var Lu={run:function(f){f.graph().dummyChains=[],gt.forEach(f.edges(),function(M){(function(G,Y){var re,ie,le,ge=Y.v,me=G.node(ge).rank,Le=Y.w,ze=G.node(Le).rank,Fe=Y.name,tt=G.edge(Y),Mt=tt.labelRank;if(ze!==me+1){for(G.removeEdge(Y),le=0,++me;me<ze;++le,++me)tt.points=[],ie={width:0,height:0,edgeLabel:tt,edgeObj:Y,rank:me},re=Mi.addDummyNode(G,"edge",ie,"_d"),me===Mt&&(ie.width=tt.width,ie.height=tt.height,ie.dummy="edge-label",ie.labelpos=tt.labelpos),G.setEdge(ge,re,{weight:tt.weight},Fe),le===0&&G.graph().dummyChains.push(re),ge=re;G.setEdge(ge,Le,{weight:tt.weight},Fe)}})(f,M)})},undo:function(f){gt.forEach(f.graph().dummyChains,function(M){var G,Y=f.node(M),re=Y.edgeLabel;for(f.setEdge(Y.edgeObj,re);Y.dummy;)G=f.successors(M)[0],f.removeNode(M),re.points.push({x:Y.x,y:Y.y}),Y.dummy==="edge-label"&&(re.x=Y.x,re.y=Y.y,re.width=Y.width,re.height=Y.height),M=G,Y=f.node(M)})}},Xo=function(f){var M={};gt.forEach(f.sources(),function G(Y){var re=f.node(Y);if(gt.has(M,Y))return re.rank;M[Y]=!0;var ie=gt.min(gt.map(f.outEdges(Y),function(le){return G(le.w)-f.edge(le).minlen}));return ie!==Number.POSITIVE_INFINITY&&ie!=null||(ie=0),re.rank=ie})},vs=function(f,M){return f.node(M.w).rank-f.node(M.v).rank-f.edge(M).minlen},Bs=Do.Graph,gs=vs,ru=function(f){var M,G,Y=new Bs({directed:!1}),re=f.nodes()[0],ie=f.nodeCount();for(Y.setNode(re,{});ps(Y,f)<ie;)M=ra(Y,f),G=Y.hasNode(M.v)?gs(f,M):-gs(f,M),wo(Y,f,G);return Y};function ps(f,M){return gt.forEach(f.nodes(),function G(Y){gt.forEach(M.nodeEdges(Y),function(re){var ie=re.v,le=Y===ie?re.w:ie;f.hasNode(le)||gs(M,re)||(f.setNode(le,{}),f.setEdge(Y,le,{}),G(le))})}),f.nodeCount()}function ra(f,M){return gt.minBy(M.edges(),function(G){if(f.hasNode(G.v)!==f.hasNode(G.w))return gs(M,G)})}function wo(f,M,G){gt.forEach(f.nodes(),function(Y){M.node(Y).rank+=G})}var Fs=vs,df=Xo,Du=Do.alg.preorder,Kf=Do.alg.postorder,$f=Mi.simplify,ea=Io;function Io(f){f=$f(f),df(f);var M,G=ru(f);for(hf(G),nu(G,f);M=qf(G);)Gs(G,f,M,Ac(G,f,M))}function nu(f,M){var G=Kf(f,f.nodes());G=G.slice(0,G.length-1),gt.forEach(G,function(Y){(function(re,ie,le){var ge=re.node(le).parent;re.edge(le,ge).cutvalue=Qf(re,ie,le)})(f,M,Y)})}function Qf(f,M,G){var Y=f.node(G).parent,re=!0,ie=M.edge(G,Y),le=0;return ie||(re=!1,ie=M.edge(Y,G)),le=ie.weight,gt.forEach(M.nodeEdges(G),function(ge){var me,Le,ze=ge.v===G,Fe=ze?ge.w:ge.v;if(Fe!==Y){var tt=ze===re,Mt=M.edge(ge).weight;if(le+=tt?Mt:-Mt,me=G,Le=Fe,f.hasEdge(me,Le)){var sr=f.edge(G,Fe).cutvalue;le+=tt?-sr:sr}}}),le}function hf(f,M){arguments.length<2&&(M=f.nodes()[0]),Jf(f,{},1,M)}function Jf(f,M,G,Y,re){var ie=G,le=f.node(Y);return M[Y]=!0,gt.forEach(f.neighbors(Y),function(ge){gt.has(M,ge)||(G=Jf(f,M,G,ge,Y))}),le.low=ie,le.lim=G++,re?le.parent=re:delete le.parent,G}function qf(f){return gt.find(f.edges(),function(M){return f.edge(M).cutvalue<0})}function Ac(f,M,G){var Y=G.v,re=G.w;M.hasEdge(Y,re)||(Y=G.w,re=G.v);var ie=f.node(Y),le=f.node(re),ge=ie,me=!1;ie.lim>le.lim&&(ge=le,me=!0);var Le=gt.filter(M.edges(),function(ze){return me===Lc(f,f.node(ze.v),ge)&&me!==Lc(f,f.node(ze.w),ge)});return gt.minBy(Le,function(ze){return Fs(M,ze)})}function Gs(f,M,G,Y){var re=G.v,ie=G.w;f.removeEdge(re,ie),f.setEdge(Y.v,Y.w,{}),hf(f),nu(f,M),function(le,ge){var me=gt.find(le.nodes(),function(ze){return!ge.node(ze).parent}),Le=Du(le,me);Le=Le.slice(1),gt.forEach(Le,function(ze){var Fe=le.node(ze).parent,tt=ge.edge(ze,Fe),Mt=!1;tt||(tt=ge.edge(Fe,ze),Mt=!0),ge.node(ze).rank=ge.node(Fe).rank+(Mt?tt.minlen:-tt.minlen)})}(f,M)}function Lc(f,M,G){return G.low<=M.lim&&M.lim<=G.lim}Io.initLowLimValues=hf,Io.initCutValues=nu,Io.calcCutValue=Qf,Io.leaveEdge=qf,Io.enterEdge=Ac,Io.exchangeEdges=Gs;var Dc=Xo,Nc=function(f){switch(f.graph().ranker){case"network-simplex":Vo(f);break;case"tight-tree":(function(M){Dc(M),ru(M)})(f);break;case"longest-path":Pc(f);break;default:Vo(f)}},Pc=Dc;function Vo(f){ea(f)}var vl=function(f){var M=function(G){var Y={},re=0;function ie(le){var ge=re;gt.forEach(G.children(le),ie),Y[le]={low:ge,lim:re++}}return gt.forEach(G.children(),ie),Y}(f);gt.forEach(f.graph().dummyChains,function(G){for(var Y=f.node(G),re=Y.edgeObj,ie=function(Fe,tt,Mt,sr){var Tt,Nt,Lt=[],_r=[],Yr=Math.min(tt[Mt].low,tt[sr].low),Pr=Math.max(tt[Mt].lim,tt[sr].lim);Tt=Mt;do Tt=Fe.parent(Tt),Lt.push(Tt);while(Tt&&(tt[Tt].low>Yr||Pr>tt[Tt].lim));for(Nt=Tt,Tt=sr;(Tt=Fe.parent(Tt))!==Nt;)_r.push(Tt);return{path:Lt.concat(_r.reverse()),lca:Nt}}(f,M,re.v,re.w),le=ie.path,ge=ie.lca,me=0,Le=le[me],ze=!0;G!==re.w;){if(Y=f.node(G),ze){for(;(Le=le[me])!==ge&&f.node(Le).maxRank<Y.rank;)me++;Le===ge&&(ze=!1)}if(!ze){for(;me<le.length-1&&f.node(Le=le[me+1]).minRank<=Y.rank;)me++;Le=le[me]}f.setParent(G,Le),G=f.successors(G)[0]}})},kc={run:function(f){var M=Mi.addDummyNode(f,"root",{},"_root"),G=function(le){var ge={};function me(Le,ze){var Fe=le.children(Le);Fe&&Fe.length&&gt.forEach(Fe,function(tt){me(tt,ze+1)}),ge[Le]=ze}return gt.forEach(le.children(),function(Le){me(Le,1)}),ge}(f),Y=gt.max(gt.values(G))-1,re=2*Y+1;f.graph().nestingRoot=M,gt.forEach(f.edges(),function(le){f.edge(le).minlen*=re});var ie=function(le){return gt.reduce(le.edges(),function(ge,me){return ge+le.edge(me).weight},0)}(f)+1;gt.forEach(f.children(),function(le){Rc(f,M,re,ie,Y,G,le)}),f.graph().nodeRankFactor=re},cleanup:function(f){var M=f.graph();f.removeNode(M.nestingRoot),delete M.nestingRoot,gt.forEach(f.edges(),function(G){f.edge(G).nestingEdge&&f.removeEdge(G)})}};function Rc(f,M,G,Y,re,ie,le){var ge=f.children(le);if(ge.length){var me=Mi.addBorderNode(f,"_bt"),Le=Mi.addBorderNode(f,"_bb"),ze=f.node(le);f.setParent(me,le),ze.borderTop=me,f.setParent(Le,le),ze.borderBottom=Le,gt.forEach(ge,function(Fe){Rc(f,M,G,Y,re,ie,Fe);var tt=f.node(Fe),Mt=tt.borderTop?tt.borderTop:Fe,sr=tt.borderBottom?tt.borderBottom:Fe,Tt=tt.borderTop?Y:2*Y,Nt=Mt!==sr?1:re-ie[le]+1;f.setEdge(me,Mt,{weight:Tt,minlen:Nt,nestingEdge:!0}),f.setEdge(sr,Le,{weight:Tt,minlen:Nt,nestingEdge:!0})}),f.parent(le)||f.setEdge(M,me,{weight:0,minlen:re+ie[le]})}else le!==M&&f.setEdge(M,le,{weight:0,minlen:G})}var gl=function(f){gt.forEach(f.children(),function M(G){var Y=f.children(G),re=f.node(G);if(Y.length&&gt.forEach(Y,M),gt.has(re,"minRank")){re.borderLeft=[],re.borderRight=[];for(var ie=re.minRank,le=re.maxRank+1;ie<le;++ie)Bc(f,"borderLeft","_bl",G,re,ie),Bc(f,"borderRight","_br",G,re,ie)}})};function Bc(f,M,G,Y,re,ie){var le={width:0,height:0,rank:ie,borderType:M},ge=re[M][ie-1],me=Mi.addDummyNode(f,"border",le,G);re[M][ie]=me,f.setParent(me,Y),ge&&f.setEdge(ge,me,{weight:1})}var Fc={adjust:function(f){var M=f.graph().rankdir.toLowerCase();M!=="lr"&&M!=="rl"||Gc(f)},undo:function(f){var M=f.graph().rankdir.toLowerCase();M!=="bt"&&M!=="rl"||function(G){gt.forEach(G.nodes(),function(Y){Nu(G.node(Y))}),gt.forEach(G.edges(),function(Y){var re=G.edge(Y);gt.forEach(re.points,Nu),gt.has(re,"y")&&Nu(re)})}(f),M!=="lr"&&M!=="rl"||(function(G){gt.forEach(G.nodes(),function(Y){au(G.node(Y))}),gt.forEach(G.edges(),function(Y){var re=G.edge(Y);gt.forEach(re.points,au),gt.has(re,"x")&&au(re)})}(f),Gc(f))}};function Gc(f){gt.forEach(f.nodes(),function(M){zs(f.node(M))}),gt.forEach(f.edges(),function(M){zs(f.edge(M))})}function zs(f){var M=f.width;f.width=f.height,f.height=M}function Nu(f){f.y=-f.y}function au(f){var M=f.x;f.x=f.y,f.y=M}var Pu=function(f){var M={},G=gt.filter(f.nodes(),function(ge){return!f.children(ge).length}),Y=gt.max(gt.map(G,function(ge){return f.node(ge).rank})),re=gt.map(gt.range(Y+1),function(){return[]});function ie(ge){if(!gt.has(M,ge)){M[ge]=!0;var me=f.node(ge);re[me.rank].push(ge),gt.forEach(f.successors(ge),ie)}}var le=gt.sortBy(G,function(ge){return f.node(ge).rank});return gt.forEach(le,ie),re},Us=function(f,M){for(var G=0,Y=1;Y<M.length;++Y)G+=vf(f,M[Y-1],M[Y]);return G};function vf(f,M,G){for(var Y=gt.zipObject(G,gt.map(G,function(Le,ze){return ze})),re=gt.flatten(gt.map(M,function(Le){return gt.sortBy(gt.map(f.outEdges(Le),function(ze){return{pos:Y[ze.w],weight:f.edge(ze).weight}}),"pos")}),!0),ie=1;ie<G.length;)ie<<=1;var le=2*ie-1;ie-=1;var ge=gt.map(new Array(le),function(){return 0}),me=0;return gt.forEach(re.forEach(function(Le){var ze=Le.pos+ie;ge[ze]+=Le.weight;for(var Fe=0;ze>0;)ze%2&&(Fe+=ge[ze+1]),ge[ze=ze-1>>1]+=Le.weight;me+=Le.weight*Fe})),me}var ec=function(f,M){return gt.map(M,function(G){var Y=f.inEdges(G);if(Y.length){var re=gt.reduce(Y,function(ie,le){var ge=f.edge(le),me=f.node(le.v);return{sum:ie.sum+ge.weight*me.order,weight:ie.weight+ge.weight}},{sum:0,weight:0});return{v:G,barycenter:re.sum/re.weight,weight:re.weight}}return{v:G}})},gf=function(f,M){var G={};return gt.forEach(f,function(Y,re){var ie=G[Y.v]={indegree:0,in:[],out:[],vs:[Y.v],i:re};gt.isUndefined(Y.barycenter)||(ie.barycenter=Y.barycenter,ie.weight=Y.weight)}),gt.forEach(M.edges(),function(Y){var re=G[Y.v],ie=G[Y.w];gt.isUndefined(re)||gt.isUndefined(ie)||(ie.indegree++,re.out.push(G[Y.w]))}),function(Y){var re=[];function ie(me){return function(Le){Le.merged||(gt.isUndefined(Le.barycenter)||gt.isUndefined(me.barycenter)||Le.barycenter>=me.barycenter)&&function(ze,Fe){var tt=0,Mt=0;ze.weight&&(tt+=ze.barycenter*ze.weight,Mt+=ze.weight),Fe.weight&&(tt+=Fe.barycenter*Fe.weight,Mt+=Fe.weight),ze.vs=Fe.vs.concat(ze.vs),ze.barycenter=tt/Mt,ze.weight=Mt,ze.i=Math.min(Fe.i,ze.i),Fe.merged=!0}(me,Le)}}function le(me){return function(Le){Le.in.push(me),--Le.indegree==0&&Y.push(Le)}}for(;Y.length;){var ge=Y.pop();re.push(ge),gt.forEach(ge.in.reverse(),ie(ge)),gt.forEach(ge.out,le(ge))}return gt.map(gt.filter(re,function(me){return!me.merged}),function(me){return gt.pick(me,["vs","i","barycenter","weight"])})}(gt.filter(G,function(Y){return!Y.indegree}))},pf=function(f,M){var G=Mi.partition(f,function(Fe){return gt.has(Fe,"barycenter")}),Y=G.lhs,re=gt.sortBy(G.rhs,function(Fe){return-Fe.i}),ie=[],le=0,ge=0,me=0;Y.sort((Le=!!M,function(Fe,tt){return Fe.barycenter<tt.barycenter?-1:Fe.barycenter>tt.barycenter?1:Le?tt.i-Fe.i:Fe.i-tt.i})),me=Ws(ie,re,me),gt.forEach(Y,function(Fe){me+=Fe.vs.length,ie.push(Fe.vs),le+=Fe.barycenter*Fe.weight,ge+=Fe.weight,me=Ws(ie,re,me)});var Le,ze={vs:gt.flatten(ie,!0)};return ge&&(ze.barycenter=le/ge,ze.weight=ge),ze};function Ws(f,M,G){for(var Y;M.length&&(Y=gt.last(M)).i<=G;)M.pop(),f.push(Y.vs),G++;return G}var tc=function f(M,G,Y,re){var ie=M.children(G),le=M.node(G),ge=le?le.borderLeft:void 0,me=le?le.borderRight:void 0,Le={};ge&&(ie=gt.filter(ie,function(Tt){return Tt!==ge&&Tt!==me}));var ze=ec(M,ie);gt.forEach(ze,function(Tt){if(M.children(Tt.v).length){var Nt=f(M,Tt.v,Y,re);Le[Tt.v]=Nt,gt.has(Nt,"barycenter")&&(Lt=Tt,_r=Nt,gt.isUndefined(Lt.barycenter)?(Lt.barycenter=_r.barycenter,Lt.weight=_r.weight):(Lt.barycenter=(Lt.barycenter*Lt.weight+_r.barycenter*_r.weight)/(Lt.weight+_r.weight),Lt.weight+=_r.weight))}var Lt,_r});var Fe=gf(ze,Y);(function(Tt,Nt){gt.forEach(Tt,function(Lt){Lt.vs=gt.flatten(Lt.vs.map(function(_r){return Nt[_r]?Nt[_r].vs:_r}),!0)})})(Fe,Le);var tt=pf(Fe,re);if(ge&&(tt.vs=gt.flatten([ge,tt.vs,me],!0),M.predecessors(ge).length)){var Mt=M.node(M.predecessors(ge)[0]),sr=M.node(M.predecessors(me)[0]);gt.has(tt,"barycenter")||(tt.barycenter=0,tt.weight=0),tt.barycenter=(tt.barycenter*tt.weight+Mt.order+sr.order)/(tt.weight+2),tt.weight+=2}return tt},yf=Do.Graph,mf=function(f,M,G){var Y=function(ie){for(var le;ie.hasNode(le=gt.uniqueId("_root")););return le}(f),re=new yf({compound:!0}).setGraph({root:Y}).setDefaultNodeLabel(function(ie){return f.node(ie)});return gt.forEach(f.nodes(),function(ie){var le=f.node(ie),ge=f.parent(ie);(le.rank===M||le.minRank<=M&&M<=le.maxRank)&&(re.setNode(ie),re.setParent(ie,ge||Y),gt.forEach(f[G](ie),function(me){var Le=me.v===ie?me.w:me.v,ze=re.edge(Le,ie),Fe=gt.isUndefined(ze)?0:ze.weight;re.setEdge(Le,ie,{weight:f.edge(me).weight+Fe})}),gt.has(le,"minRank")&&re.setNode(ie,{borderLeft:le.borderLeft[M],borderRight:le.borderRight[M]}))}),re},ku=function(f,M,G){var Y,re={};gt.forEach(G,function(ie){for(var le,ge,me=f.parent(ie);me;){if((le=f.parent(me))?(ge=re[le],re[le]=me):(ge=Y,Y=me),ge&&ge!==me)return void M.setEdge(ge,me);me=le}})},iu=Do.Graph,Aa=function(f){var M=Mi.maxRank(f),G=ou(f,gt.range(1,M+1),"inEdges"),Y=ou(f,gt.range(M-1,-1,-1),"outEdges"),re=Pu(f);js(f,re);for(var ie,le=Number.POSITIVE_INFINITY,ge=0,me=0;me<4;++ge,++me){Ru(ge%2?G:Y,ge%4>=2),re=Mi.buildLayerMatrix(f);var Le=Us(f,re);Le<le&&(me=0,ie=gt.cloneDeep(re),le=Le)}js(f,ie)};function ou(f,M,G){return gt.map(M,function(Y){return mf(f,Y,G)})}function Ru(f,M){var G=new iu;gt.forEach(f,function(Y){var re=Y.graph().root,ie=tc(Y,re,G,M);gt.forEach(ie.vs,function(le,ge){Y.node(le).order=ge}),ku(Y,G,ie.vs)})}function js(f,M){gt.forEach(M,function(G){gt.forEach(G,function(Y,re){f.node(Y).order=re})})}var zc=Do.Graph,Bu=function(f){var M,G=Mi.buildLayerMatrix(f),Y=gt.merge(ys(f,G),Uc(f,G)),re={};gt.forEach(["u","d"],function(le){M=le==="u"?G:gt.values(G).reverse(),gt.forEach(["l","r"],function(ge){ge==="r"&&(M=gt.map(M,function(Fe){return gt.values(Fe).reverse()}));var me=(le==="u"?f.predecessors:f.successors).bind(f),Le=yl(f,M,Y,me),ze=Kn(f,M,Le.root,Le.align,ge==="r");ge==="r"&&(ze=gt.mapValues(ze,function(Fe){return-Fe})),re[le+ge]=ze})});var ie=ms(f,re);return Qi(re,ie),Wc(re,f.graph().align)};function ys(f,M){var G={};return gt.reduce(M,function(Y,re){var ie=0,le=0,ge=Y.length,me=gt.last(re);return gt.forEach(re,function(Le,ze){var Fe=function(Mt,sr){if(Mt.node(sr).dummy)return gt.find(Mt.predecessors(sr),function(Tt){return Mt.node(Tt).dummy})}(f,Le),tt=Fe?f.node(Fe).order:ge;(Fe||Le===me)&&(gt.forEach(re.slice(le,ze+1),function(Mt){gt.forEach(f.predecessors(Mt),function(sr){var Tt=f.node(sr),Nt=Tt.order;!(Nt<ie||tt<Nt)||Tt.dummy&&f.node(Mt).dummy||su(G,sr,Mt)})}),le=ze+1,ie=tt)}),re}),G}function Uc(f,M){var G={};function Y(re,ie,le,ge,me){var Le;gt.forEach(gt.range(ie,le),function(ze){Le=re[ze],f.node(Le).dummy&&gt.forEach(f.predecessors(Le),function(Fe){var tt=f.node(Fe);tt.dummy&&(tt.order<ge||tt.order>me)&&su(G,Fe,Le)})})}return gt.reduce(M,function(re,ie){var le,ge=-1,me=0;return gt.forEach(ie,function(Le,ze){if(f.node(Le).dummy==="border"){var Fe=f.predecessors(Le);Fe.length&&(le=f.node(Fe[0]).order,Y(ie,me,ze,ge,le),me=ze,ge=le)}Y(ie,me,ie.length,le,re.length)}),ie}),G}function su(f,M,G){if(M>G){var Y=M;M=G,G=Y}var re=f[M];re||(f[M]=re={}),re[G]=!0}function pl(f,M,G){if(M>G){var Y=M;M=G,G=Y}return gt.has(f[M],G)}function yl(f,M,G,Y){var re={},ie={},le={};return gt.forEach(M,function(ge){gt.forEach(ge,function(me,Le){re[me]=me,ie[me]=me,le[me]=Le})}),gt.forEach(M,function(ge){var me=-1;gt.forEach(ge,function(Le){var ze=Y(Le);if(ze.length)for(var Fe=((ze=gt.sortBy(ze,function(Tt){return le[Tt]})).length-1)/2,tt=Math.floor(Fe),Mt=Math.ceil(Fe);tt<=Mt;++tt){var sr=ze[tt];ie[Le]===Le&&me<le[sr]&&!pl(G,Le,sr)&&(ie[sr]=Le,ie[Le]=re[Le]=re[sr],me=le[sr])}})}),{root:re,align:ie}}function Kn(f,M,G,Y,re){var ie={},le=function(Le,ze,Fe,tt){var Mt=new zc,sr=Le.graph(),Tt=function(Nt,Lt,_r){return function(Yr,Pr,dn){var sn,tn=Yr.node(Pr),Bn=Yr.node(dn),Fn=0;if(Fn+=tn.width/2,gt.has(tn,"labelpos"))switch(tn.labelpos.toLowerCase()){case"l":sn=-tn.width/2;break;case"r":sn=tn.width/2}if(sn&&(Fn+=_r?sn:-sn),sn=0,Fn+=(tn.dummy?Lt:Nt)/2,Fn+=(Bn.dummy?Lt:Nt)/2,Fn+=Bn.width/2,gt.has(Bn,"labelpos"))switch(Bn.labelpos.toLowerCase()){case"l":sn=Bn.width/2;break;case"r":sn=-Bn.width/2}return sn&&(Fn+=_r?sn:-sn),sn=0,Fn}}(sr.nodesep,sr.edgesep,tt);return gt.forEach(ze,function(Nt){var Lt;gt.forEach(Nt,function(_r){var Yr=Fe[_r];if(Mt.setNode(Yr),Lt){var Pr=Fe[Lt],dn=Mt.edge(Pr,Yr);Mt.setEdge(Pr,Yr,Math.max(Tt(Le,_r,Lt),dn||0))}Lt=_r})}),Mt}(f,M,G,re),ge=re?"borderLeft":"borderRight";function me(Le,ze){for(var Fe=le.nodes(),tt=Fe.pop(),Mt={};tt;)Mt[tt]?Le(tt):(Mt[tt]=!0,Fe.push(tt),Fe=Fe.concat(ze(tt))),tt=Fe.pop()}return me(function(Le){ie[Le]=le.inEdges(Le).reduce(function(ze,Fe){return Math.max(ze,ie[Fe.v]+le.edge(Fe))},0)},le.predecessors.bind(le)),me(function(Le){var ze=le.outEdges(Le).reduce(function(tt,Mt){return Math.min(tt,ie[Mt.w]-le.edge(Mt))},Number.POSITIVE_INFINITY),Fe=f.node(Le);ze!==Number.POSITIVE_INFINITY&&Fe.borderType!==ge&&(ie[Le]=Math.max(ie[Le],ze))},le.successors.bind(le)),gt.forEach(Y,function(Le){ie[Le]=ie[G[Le]]}),ie}function ms(f,M){return gt.minBy(gt.values(M),function(G){var Y=Number.NEGATIVE_INFINITY,re=Number.POSITIVE_INFINITY;return gt.forIn(G,function(ie,le){var ge=function(me,Le){return me.node(Le).width}(f,le)/2;Y=Math.max(ie+ge,Y),re=Math.min(ie-ge,re)}),Y-re})}function Qi(f,M){var G=gt.values(M),Y=gt.min(G),re=gt.max(G);gt.forEach(["u","d"],function(ie){gt.forEach(["l","r"],function(le){var ge,me=ie+le,Le=f[me];if(Le!==M){var ze=gt.values(Le);(ge=le==="l"?Y-gt.min(ze):re-gt.max(ze))&&(f[me]=gt.mapValues(Le,function(Fe){return Fe+ge}))}})})}function Wc(f,M){return gt.mapValues(f.ul,function(G,Y){if(M)return f[M.toLowerCase()][Y];var re=gt.sortBy(gt.map(f,Y));return(re[1]+re[2])/2})}var rc=Bu,ml=function(f){(function(M){var G=Mi.buildLayerMatrix(M),Y=M.graph().ranksep,re=0;gt.forEach(G,function(ie){var le=gt.max(gt.map(ie,function(ge){return M.node(ge).height}));gt.forEach(ie,function(ge){M.node(ge).y=re+le/2}),re+=le+Y})})(f=Mi.asNonCompoundGraph(f)),gt.forEach(rc(f),function(M,G){f.node(G).x=M})},jc=Mi.normalizeRanks,El=Mi.removeEmptyRanks,pi=Mi,Xc=Do.Graph,uu=function(f,M){var G=M&&M.debugTiming?pi.time:pi.notime;G("layout",function(){var Y=G(" buildLayoutGraph",function(){return function(re){var ie=new Xc({multigraph:!0,compound:!0}),le=Ef(re.graph());return ie.setGraph(gt.merge({},Vc,Ri(le,Es),gt.pick(le,Fu))),gt.forEach(re.nodes(),function(ge){var me=Ef(re.node(ge));ie.setNode(ge,gt.defaults(Ri(me,Gu),Yc)),ie.setParent(ge,re.parent(ge))}),gt.forEach(re.edges(),function(ge){var me=Ef(re.edge(ge));ie.setEdge(ge,gt.merge({},bs,Ri(me,Ji),gt.pick(me,ci)))}),ie}(f)});G(" runLayout",function(){(function(re,ie){ie(" makeSpaceForEdgeLabels",function(){(function(le){var ge=le.graph();ge.ranksep/=2,gt.forEach(le.edges(),function(me){var Le=le.edge(me);Le.minlen*=2,Le.labelpos.toLowerCase()!=="c"&&(ge.rankdir==="TB"||ge.rankdir==="BT"?Le.width+=Le.labeloffset:Le.height+=Le.labeloffset)})})(re)}),ie(" removeSelfEdges",function(){(function(le){gt.forEach(le.edges(),function(ge){if(ge.v===ge.w){var me=le.node(ge.v);me.selfEdges||(me.selfEdges=[]),me.selfEdges.push({e:ge,label:le.edge(ge)}),le.removeEdge(ge)}})})(re)}),ie(" acyclic",function(){Oc.run(re)}),ie(" nestingGraph.run",function(){kc.run(re)}),ie(" rank",function(){Nc(pi.asNonCompoundGraph(re))}),ie(" injectEdgeLabelProxies",function(){(function(le){gt.forEach(le.edges(),function(ge){var me=le.edge(ge);if(me.width&&me.height){var Le=le.node(ge.v),ze={rank:(le.node(ge.w).rank-Le.rank)/2+Le.rank,e:ge};pi.addDummyNode(le,"edge-proxy",ze,"_ep")}})})(re)}),ie(" removeEmptyRanks",function(){El(re)}),ie(" nestingGraph.cleanup",function(){kc.cleanup(re)}),ie(" normalizeRanks",function(){jc(re)}),ie(" assignRankMinMax",function(){(function(le){var ge=0;gt.forEach(le.nodes(),function(me){var Le=le.node(me);Le.borderTop&&(Le.minRank=le.node(Le.borderTop).rank,Le.maxRank=le.node(Le.borderBottom).rank,ge=gt.max(ge,Le.maxRank))}),le.graph().maxRank=ge})(re)}),ie(" removeEdgeLabelProxies",function(){(function(le){gt.forEach(le.nodes(),function(ge){var me=le.node(ge);me.dummy==="edge-proxy"&&(le.edge(me.e).labelRank=me.rank,le.removeNode(ge))})})(re)}),ie(" normalize.run",function(){Lu.run(re)}),ie(" parentDummyChains",function(){vl(re)}),ie(" addBorderSegments",function(){gl(re)}),ie(" order",function(){Aa(re)}),ie(" insertSelfEdges",function(){(function(le){var ge=pi.buildLayerMatrix(le);gt.forEach(ge,function(me){var Le=0;gt.forEach(me,function(ze,Fe){var tt=le.node(ze);tt.order=Fe+Le,gt.forEach(tt.selfEdges,function(Mt){pi.addDummyNode(le,"selfedge",{width:Mt.label.width,height:Mt.label.height,rank:tt.rank,order:Fe+ ++Le,e:Mt.e,label:Mt.label},"_se")}),delete tt.selfEdges})})})(re)}),ie(" adjustCoordinateSystem",function(){Fc.adjust(re)}),ie(" position",function(){ml(re)}),ie(" positionSelfEdges",function(){(function(le){gt.forEach(le.nodes(),function(ge){var me=le.node(ge);if(me.dummy==="selfedge"){var Le=le.node(me.e.v),ze=Le.x+Le.width/2,Fe=Le.y,tt=me.x-ze,Mt=Le.height/2;le.setEdge(me.e,me.label),le.removeNode(ge),me.label.points=[{x:ze+2*tt/3,y:Fe-Mt},{x:ze+5*tt/6,y:Fe-Mt},{x:ze+tt,y:Fe},{x:ze+5*tt/6,y:Fe+Mt},{x:ze+2*tt/3,y:Fe+Mt}],me.label.x=me.x,me.label.y=me.y}})})(re)}),ie(" removeBorderNodes",function(){(function(le){gt.forEach(le.nodes(),function(ge){if(le.children(ge).length){var me=le.node(ge),Le=le.node(me.borderTop),ze=le.node(me.borderBottom),Fe=le.node(gt.last(me.borderLeft)),tt=le.node(gt.last(me.borderRight));me.width=Math.abs(tt.x-Fe.x),me.height=Math.abs(ze.y-Le.y),me.x=Fe.x+me.width/2,me.y=Le.y+me.height/2}}),gt.forEach(le.nodes(),function(ge){le.node(ge).dummy==="border"&&le.removeNode(ge)})})(re)}),ie(" normalize.undo",function(){Lu.undo(re)}),ie(" fixupEdgeLabelCoords",function(){(function(le){gt.forEach(le.edges(),function(ge){var me=le.edge(ge);if(gt.has(me,"x"))switch(me.labelpos!=="l"&&me.labelpos!=="r"||(me.width-=me.labeloffset),me.labelpos){case"l":me.x-=me.width/2+me.labeloffset;break;case"r":me.x+=me.width/2+me.labeloffset}})})(re)}),ie(" undoCoordinateSystem",function(){Fc.undo(re)}),ie(" translateGraph",function(){(function(le){var ge=Number.POSITIVE_INFINITY,me=0,Le=Number.POSITIVE_INFINITY,ze=0,Fe=le.graph(),tt=Fe.marginx||0,Mt=Fe.marginy||0;function sr(Tt){var Nt=Tt.x,Lt=Tt.y,_r=Tt.width,Yr=Tt.height;ge=Math.min(ge,Nt-_r/2),me=Math.max(me,Nt+_r/2),Le=Math.min(Le,Lt-Yr/2),ze=Math.max(ze,Lt+Yr/2)}gt.forEach(le.nodes(),function(Tt){sr(le.node(Tt))}),gt.forEach(le.edges(),function(Tt){var Nt=le.edge(Tt);gt.has(Nt,"x")&&sr(Nt)}),ge-=tt,Le-=Mt,gt.forEach(le.nodes(),function(Tt){var Nt=le.node(Tt);Nt.x-=ge,Nt.y-=Le}),gt.forEach(le.edges(),function(Tt){var Nt=le.edge(Tt);gt.forEach(Nt.points,function(Lt){Lt.x-=ge,Lt.y-=Le}),gt.has(Nt,"x")&&(Nt.x-=ge),gt.has(Nt,"y")&&(Nt.y-=Le)}),Fe.width=me-ge+tt,Fe.height=ze-Le+Mt})(re)}),ie(" assignNodeIntersects",function(){(function(le){gt.forEach(le.edges(),function(ge){var me,Le,ze=le.edge(ge),Fe=le.node(ge.v),tt=le.node(ge.w);ze.points?(me=ze.points[0],Le=ze.points[ze.points.length-1]):(ze.points=[],me=tt,Le=Fe),ze.points.unshift(pi.intersectRect(Fe,me)),ze.points.push(pi.intersectRect(tt,Le))})})(re)}),ie(" reversePoints",function(){(function(le){gt.forEach(le.edges(),function(ge){var me=le.edge(ge);me.reversed&&me.points.reverse()})})(re)}),ie(" acyclic.undo",function(){Oc.undo(re)})})(Y,G)}),G(" updateInputGraph",function(){(function(re,ie){gt.forEach(re.nodes(),function(le){var ge=re.node(le),me=ie.node(le);ge&&(ge.x=me.x,ge.y=me.y,ie.children(le).length&&(ge.width=me.width,ge.height=me.height))}),gt.forEach(re.edges(),function(le){var ge=re.edge(le),me=ie.edge(le);ge.points=me.points,gt.has(me,"x")&&(ge.x=me.x,ge.y=me.y)}),re.graph().width=ie.graph().width,re.graph().height=ie.graph().height})(f,Y)})})},Es=["nodesep","edgesep","ranksep","marginx","marginy"],Vc={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},Fu=["acyclicer","ranker","rankdir","align"],Gu=["width","height"],Yc={width:0,height:0},Ji=["minlen","weight","width","height","labeloffset"],bs={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},ci=["labelpos"];function Ri(f,M){return gt.mapValues(gt.pick(f,M),Number)}function Ef(f){var M={};return gt.forEach(f,function(G,Y){M[Y.toLowerCase()]=G}),M}var bl=Do.Graph,Hc={graphlib:Do,layout:uu,debug:{debugOrdering:function(f){var M=Mi.buildLayerMatrix(f),G=new bl({compound:!0,multigraph:!0}).setGraph({});return gt.forEach(f.nodes(),function(Y){G.setNode(Y,{label:Y}),G.setParent(Y,"layer"+f.node(Y).rank)}),gt.forEach(f.edges(),function(Y){G.setEdge(Y.v,Y.w,{},Y.name)}),gt.forEach(M,function(Y,re){var ie="layer"+re;G.setNode(ie,{rank:"same"}),gt.reduce(Y,function(le,ge){return G.setEdge(le,ge,{style:"invis"}),ge})}),G}},util:{time:Mi.time,notime:Mi.notime},version:"0.8.5"},Yo=Hc.graphlib,xl=Hc.layout;class nc{constructor(M){this.cardinality=1,this.include=y.UNSPECIFIED,this.isGroupNode=!1,this.parentNode=null,this.type=L.NODE,this.name=M.name,this.attr=M.attr||{},this.inputs=M.inputs,this.path=M.path||[],this.width=M.width,this.height=M.height}}class wl{constructor(){this.nodes={},this.edges=[],this.nodes={},this.edges=[]}}function Sl(f){const M=new wl;return f.nodes.map(G=>new nc(G)).forEach(G=>{M.nodes[G.name]=G,G.inputs.forEach(Y=>{(function(re,ie,le){le.name!==ie.name&&re.edges.push(Object.assign(Object.assign({},le.attr),{v:le.name,w:ie.name}))})(M,G,Y)})}),M}class _l{constructor(M,G={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=y.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=L.META,this.path=[],this.name=M,this.metaGraph=xf(M,x.META,G)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map(M=>this.metaGraph.node(M))}leaves(){let M,G=[],Y=[this];for(;Y.length;){let re=Y.shift();re.isGroupNode?(M=re.metaGraph,M.nodes().forEach(ie=>Y.push(M.node(ie)))):G.push(re.name)}return G}}class ac{constructor(M,G){this.v=M,this.w=G,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(M,G){this.baseEdgeList.push(M)}}function zu(f,M={}){return new _l(f,M)}function bf(f,M){return new ac(f,M)}function xf(f,M,G){const Y=G||{},re=new Yo.Graph(Y);return re.setGraph({name:f,rankdir:Y.rankdir,type:M,align:Y.align}),re}class Zc{constructor(M={}){this.graphOptions=M,this.index={},this.graphOptions.compound=!0,this.root=zu(A,this.graphOptions),this.index[A]=this.root}getNodeMap(){return this.index}node(M){return this.index[M]}setNode(M,G){this.index[M]=G}getBridgeGraph(M){const G=this.index[M];if(!G)throw Error("Could not find node in hierarchy: "+M);if(!("metaGraph"in G))return null;const Y=G;if(Y.bridgeGraph)return Y.bridgeGraph;const re=xf(N,x.BRIDGE,this.graphOptions);if(Y.bridgeGraph=re,!G.parentNode||!("metaGraph"in G.parentNode))return re;const ie=G.parentNode;return[ie.metaGraph,this.getBridgeGraph(ie.name)].forEach(le=>{le.edges().filter(ge=>ge.v===M||ge.w===M).forEach(ge=>{const me=ge.w===M;le.edge(ge).baseEdgeList.forEach(Le=>{const[ze,Fe]=me?[Le.w,ge.v]:[Le.v,ge.w],tt=this.getChildName(M,ze),Mt={v:me?Fe:tt,w:me?tt:Fe};let sr=re.edge(Mt);sr||(sr=bf(Mt.v,Mt.w),sr.inbound=me,re.setEdge(Mt.v,Mt.w,sr)),sr.addBaseEdge(Le,this)})})}),re}getChildName(M,G){let Y=this.index[G];for(;Y;){if(Y.parentNode&&Y.parentNode.name===M)return Y.name;Y=Y.parentNode}throw Error("Could not find immediate child for descendant: "+G)}getPredecessors(M){const G=this.index[M];if(!G)throw Error("Could not find node with name: "+M);return this.getOneWayEdges(G,!0)}getSuccessors(M){const G=this.index[M];if(!G)throw Error("Could not find node with name: "+M);return this.getOneWayEdges(G,!1)}getOneWayEdges(M,G){const Y=[];if(!M.parentNode||!M.parentNode.isGroupNode)return Y;const re=M.parentNode,ie=re.metaGraph,le=this.getBridgeGraph(re.name);return ic(ie,M,G,Y),ic(le,M,G,Y),Y}}function Ml(f,M){const{rankDirection:G,align:Y}=M,re=new Zc({rankdir:G,align:Y});return function(ie,le){Object.keys(le.nodes).forEach(ge=>{const me=le.nodes[ge],Le=me.path;let ze=ie.root;ze.depth=Math.max(Le.length,ze.depth);for(let Fe=0;Fe<Le.length&&(ze.depth=Math.max(ze.depth,Le.length-Fe),ze.cardinality+=me.cardinality,Fe!==Le.length-1);Fe++){const tt=Le[Fe];let Mt=ie.node(tt);Mt||(Mt=zu(tt,ie.graphOptions),Mt.path=me.path.slice(0,Fe+1),Mt.parentNode=ze,ie.setNode(tt,Mt),ze.metaGraph.setNode(tt,Mt)),ze=Mt}ie.setNode(me.name,me),me.parentNode=ze,ze.metaGraph.setNode(me.name,me)})}(re,f),function(ie,le){const ge=ie.getNodeMap();let me=[],Le=[];const ze=(Fe,tt)=>{let Mt=0;for(;Fe;)tt[Mt++]=Fe.name,Fe=Fe.parentNode;return Mt-1};le.edges.forEach(Fe=>{me=[],Le=[];let tt=ze(le.nodes[Fe.v],me),Mt=ze(le.nodes[Fe.w],Le);for(;me[tt]===Le[Mt];)if(tt--,Mt--,tt<0||Mt<0)throw Error("No difference found between ancestor paths.");const sr=ge[me[tt+1]],Tt=me[tt],Nt=Le[Mt];let Lt=sr.metaGraph.edge(Tt,Nt);Lt||(Lt=bf(Tt,Nt),sr.metaGraph.setEdge(Tt,Nt,Lt)),Lt.addBaseEdge(Fe,ie)})}(re,f),re}function ic(f,M,G,Y){(G?f.inEdges(M.name):f.outEdges(M.name)).forEach(re=>{const ie=f.edge(re);Y.push(ie)})}class Kc{constructor(M){this.hierarchy=M,this.index={},this.hasSubHierarchy={},this.root=new We(this.hierarchy.root,this.hierarchy.graphOptions),this.index[M.root.name]=this.root,this.buildSubHierarchy(M.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(M){if(M in this.hasSubHierarchy)return;this.hasSubHierarchy[M]=!0;const G=this.index[M];if(G.node.type!==L.META)return;const Y=G,re=Y.node.metaGraph,ie=Y.coreGraph;re.nodes().forEach(ze=>{const Fe=this.getOrCreateRenderNodeByName(ze);ie.setNode(ze,Fe)}),re.edges().forEach(ze=>{const Fe=re.edge(ze),tt=new ve(Fe);ie.setEdge(ze.v,ze.w,tt)});const le=Y.node.parentNode;if(!le)return;const ge=this.getRenderNodeByName(le.name),me=(ze,...Fe)=>Fe.concat([ze?"IN":"OUT"]).join("~~"),Le=this.hierarchy.getBridgeGraph(M);Le.edges().forEach(ze=>{const Fe=Le.edge(ze),tt=!!re.node(ze.w),[Mt,sr]=tt?[ze.w,ze.v]:[ze.v,ze.w],Tt=dn=>{const sn=tt?{v:dn,w:M}:{v:M,w:dn};return ge.coreGraph.edge(sn)};let Nt=Tt(sr);Nt||(Nt=Tt(me(tt,sr,le.name)));const Lt=me(tt,M),_r=me(tt,sr,M);let Yr=ie.node(_r);if(!Yr){let dn=ie.node(Lt);if(!dn){const tn={name:Lt,type:L.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:y.UNSPECIFIED,inbound:tt,attr:{}};dn=new wf(tn),this.index[Lt]=dn,ie.setNode(Lt,dn)}const sn={name:_r,type:L.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:y.UNSPECIFIED,inbound:tt,attr:{}};Yr=new wf(sn),this.index[_r]=Yr,ie.setNode(_r,Yr),ie.setParent(_r,Lt),dn.node.cardinality++}const Pr=new ve(Fe);Pr.adjoiningMetaEdge=Nt,tt?ie.setEdge(_r,Mt,Pr):ie.setEdge(Mt,_r,Pr)})}getOrCreateRenderNodeByName(M){if(!M)return null;if(M in this.index)return this.index[M];const G=this.getNodeByName(M);return G?(this.index[M]=G.isGroupNode?new We(G,this.hierarchy.graphOptions):new wf(G),this.index[M]):null}getRenderNodeByName(M){return this.index[M]}getNodeByName(M){return this.hierarchy.node(M)}}class wf{constructor(M){this.node=M,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=M.width||0,this.height=M.height||0,this.displayName=M.name,this.attr=M.attr}}class ve{constructor(M){this.metaEdge=M,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class We extends wf{constructor(M,G){super(M);const Y=M.metaGraph.graph();G.compound=!0,this.coreGraph=xf(Y.name,x.CORE,G)}}function it(f,M){f.node.isGroupNode&&function(G,Y){const re=j(Y);G.coreGraph.nodes().map(ie=>G.coreGraph.node(ie)).forEach(ie=>{var le,ge,me,Le,ze,Fe;const{height:tt,width:Mt}=ie;switch(ie.node.type){case L.NODE:Object.assign(ie,re.nodeSize.node),ie.height=tt||re.nodeSize.node.height,ie.width=Mt||re.nodeSize.node.width;break;case L.BRIDGE:Object.assign(ie,re.nodeSize.bridge);break;case L.META:ie.expanded?it(ie,Y):(Object.assign(ie,re.nodeSize.meta),ie.height=re.nodeSize.meta.height,ie.width=re.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+ie.node.type)}if(!ie.expanded){const sr=ie.attr;(function(Tt,Nt=!1){if(Tt.coreBox.width=Tt.width,Tt.coreBox.height=Tt.height,!Nt){const Lt=`${Tt.displayName}`.length,_r=3;Tt.width=Math.max(Tt.coreBox.width,Lt*_r)}})(ie,Y&&(ie.node.type===0&&!!((ge=(le=Y==null?void 0:Y.nodeSize)===null||le===void 0?void 0:le.meta)===null||ge===void 0?void 0:ge.width)||ie.node.type===1&&(!!((Le=(me=Y==null?void 0:Y.nodeSize)===null||me===void 0?void 0:me.node)===null||Le===void 0?void 0:Le.width)||!!sr.width)||ie.node.type===2&&!!((Fe=(ze=Y==null?void 0:Y.nodeSize)===null||ze===void 0?void 0:ze.bridge)===null||Fe===void 0?void 0:Fe.width)))}})}(f,M),f.node.type===L.META&&function(G,Y){const re=j(Y),ie=re.subScene.meta;Object.assign(G,ie);const{nodeSep:le,rankSep:ge,edgeSep:me,align:Le}=re.graph.meta,ze={nodesep:le,ranksep:ge,edgesep:me,align:Le};Object.assign(G.coreBox,function(Mt,sr){const{ranksep:Tt,nodesep:Nt,edgesep:Lt,align:_r}=sr;Object.assign(Mt.graph(),{ranksep:Tt,nodesep:Nt,edgesep:Lt,align:_r});const Yr=[];if(Mt.nodes().forEach(Bn=>{Mt.node(Bn).node.type!==L.BRIDGE&&Yr.push(Bn)}),!Yr.length)return{width:0,height:0};xl(Mt);let Pr=1/0,dn=1/0,sn=-1/0,tn=-1/0;return Yr.forEach(Bn=>{const Fn=Mt.node(Bn),za=.5*Fn.width,Wn=Fn.x-za,ti=Fn.x+za;Pr=Wn<Pr?Wn:Pr,sn=ti>sn?ti:sn;const La=.5*Fn.height,oa=Fn.y-La,Za=Fn.y+La;dn=oa<dn?oa:dn,tn=Za>tn?Za:tn}),Mt.edges().forEach(Bn=>{const Fn=Mt.edge(Bn),za=Mt.node(Fn.metaEdge.v),Wn=Mt.node(Fn.metaEdge.w);if(Fn.points.length===3&&function(oa){let Za=Zt(oa[0],oa[1]);for(let ri=1;ri<oa.length-1;ri++){const li=Zt(oa[ri],oa[ri+1]);if(Math.abs(li-Za)>1)return!1;Za=li}return!0}(Fn.points)){if(za!=null){const oa=za.expanded?za.x:dr(za);Fn.points[0].x=oa}if(Wn!=null){const oa=Wn.expanded?Wn.x:dr(Wn);Fn.points[2].x=oa}Fn.points=[Fn.points[0],Fn.points[1]]}const ti=Fn.points[Fn.points.length-2];Wn!=null&&(Fn.points[Fn.points.length-1]=Yt(ti,Wn));const La=Fn.points[1];za!=null&&(Fn.points[0]=Yt(La,za)),Fn.points.forEach(oa=>{Pr=oa.x<Pr?oa.x:Pr,sn=oa.x>sn?oa.x:sn,dn=oa.y<dn?oa.y:dn,tn=oa.y>tn?oa.y:tn})}),Mt.nodes().forEach(Bn=>{const Fn=Mt.node(Bn);Fn.x-=Pr,Fn.y-=dn}),Mt.edges().forEach(Bn=>{Mt.edge(Bn).points.forEach(Fn=>{Fn.x-=Pr,Fn.y-=dn})}),{width:sn-Pr,height:tn-dn}}(G.coreGraph,ze));let Fe=0;G.coreGraph.nodeCount()>0&&Fe++;const tt=Fe<=1?0:Fe;G.coreBox.width+=tt+tt,G.coreBox.height=ie.labelHeight+G.coreBox.height,G.width=G.coreBox.width+ie.paddingLeft+ie.paddingRight,G.height=G.paddingTop+G.coreBox.height+G.paddingBottom}(f,M)}function Zt(f,M){const G=M.x-f.x,Y=M.y-f.y;return 180*Math.atan(Y/G)/Math.PI}function dr(f){return f.expanded?f.x:f.x-f.width/2+0+f.coreBox.width/2}function Yt(f,M){const G=M.expanded?M.x:dr(M),Y=M.y,re=f.x-G,ie=f.y-Y;let le,ge,me=M.expanded?M.width:M.coreBox.width,Le=M.expanded?M.height:M.coreBox.height;return Math.abs(ie)*me/2>Math.abs(re)*Le/2?(ie<0&&(Le=-Le),le=ie===0?0:Le/2*re/ie,ge=Le/2):(re<0&&(me=-me),le=me/2,ge=re===0?0:me/2*ie/re),{x:G+le,y:Y+ge}}function ar(f,M,G){var Y,re,ie,le;const ge=f.nodes.filter((Fe,tt,Mt)=>Mt.findIndex(sr=>sr.id===Fe.id)!==tt).map(Fe=>Fe.id);if(ge.length)throw new Error(`Duplicated ids found: ${ge.join(", ")}`);const me=function(Fe){const tt={nodes:[]},Mt=Fe.compound,sr=Object.keys(Mt||{}),Tt=new Map,Nt=(_r,Yr=[])=>{if(Tt.has(_r))return Tt.get(_r);for(let Pr=0;Pr<sr.length;Pr++){let dn=sr[Pr];if(Mt&&Mt[dn].indexOf(_r)!==-1)return Yr.unshift(dn),Nt(dn,Yr)}return Yr.length===0&&Tt.set(_r,Yr),Yr},Lt=_r=>Fe.edges.filter(Yr=>Yr.w===_r).map(Yr=>({name:Yr.v}));return Fe.nodes.forEach(_r=>{const Yr=_r.id,Pr=[...Nt(Yr),Yr];let dn=Lt(Yr);tt.nodes.push({name:Yr,path:Pr,inputs:dn,width:_r.width,height:_r.height,attr:Object.assign({},_r)})}),tt}(f),Le=function(Fe,tt){const Mt=(Tt,Nt)=>{for(let Lt of Nt.values())if(Lt.includes(Tt))return!0;return!1},sr=(Tt,Nt=[])=>{if(Object.keys(Tt).length===0)return[...new Set(Nt)];const Lt=new Map(Object.keys(Tt).map(Yr=>[Yr,Tt[Yr]])),_r={};for(let[Yr,Pr]of Lt)Mt(Yr,Lt)?_r[Yr]=Pr:Nt=Nt.concat(Yr,Pr);return sr(_r,Nt)};return sr(Fe).filter(Tt=>tt.includes(Tt))}(f.compound||{},(M==null?void 0:M.expanded)||[]),ze=function(Fe,tt){return function(Mt){return new Kc(Mt)}(Ml(Sl(Fe),tt))}(me,{rankDirection:((re=(Y=G==null?void 0:G.graph)===null||Y===void 0?void 0:Y.meta)===null||re===void 0?void 0:re.rankDir)||(M==null?void 0:M.rankDirection)||B.graph.meta.rankDir,align:((le=(ie=G==null?void 0:G.graph)===null||ie===void 0?void 0:ie.meta)===null||le===void 0?void 0:le.align)||B.graph.meta.align});return function(Fe,tt){tt.forEach(Mt=>{const sr=Fe.getRenderInfoNodes().find(Lt=>Lt.displayName===Mt);let Tt=sr&&sr.node&&sr.node.name||"";const Nt=Fe.getRenderNodeByName(Tt);if(!Nt)throw new Error(`No nodes found: ${Tt}`);Nt.expanded=!0,Fe.buildSubHierarchy(Tt)})}(ze,Le),it(ze.root,G),Ar(ze.root)}function Mr(f,M=!1){const G=JSON.parse(JSON.stringify(f)),Y={nodes:[G],edges:[...G.edges]};return G.nodes.forEach(function re(ie){(ie.type===0||ie.type===1)&&Y.nodes.push(ie),ie.type===0&&(Y.edges=Y.edges.concat(ie.edges)),Array.isArray(ie.nodes)&&ie.nodes.forEach(re)}),M&&Y.nodes.forEach(re=>{const ie=Y.nodes.find(le=>le.id===re.parentNodeName);if(ie){const le=ie.x-ie.width/2+ie.paddingLeft,ge=ie.y-ie.height/2+ie.labelHeight+ie.paddingTop;ie.id!==A&&(re.x+=le,re.y+=ge),re.type===0&&re.edges.forEach(me=>{me.points.forEach(Le=>{Le.x+=re.x-re.width/2+re.paddingLeft,Le.y+=re.y-re.height/2+re.labelHeight+re.paddingTop})})}}),Y}function Ir(f,M,G,Y){var re,ie;let le=[];const ge=((re=G.find(Fe=>Fe.id===f))===null||re===void 0?void 0:re.path)||[],me=((ie=G.find(Fe=>Fe.id===M))===null||ie===void 0?void 0:ie.path)||[],Le=[A,...ge].slice(0,ge.length).reverse(),ze=[A,...me].slice(0,me.length);return Le.forEach(Fe=>{const tt=G.find(Mt=>Mt.id===Fe);le=le.concat(tt.edges.filter(Mt=>Mt.baseEdgeList.some(sr=>sr.v===((Y==null?void 0:Y.v)||f)&&sr.w===((Y==null?void 0:Y.w)||M))))}),ze.filter(Fe=>!Le.includes(Fe)).forEach(Fe=>{const tt=G.find(Mt=>Mt.id===Fe);le=le.concat(tt.edges.filter(Mt=>Mt.baseEdgeList.some(sr=>sr.v===((Y==null?void 0:Y.v)||f)&&sr.w===((Y==null?void 0:Y.w)||M))))}),le}function Ar(f){const M=f.coreGraph.nodes().map(Y=>f.coreGraph.node(Y));return Object.assign(Object.assign({},Tr(f)),{expanded:f.expanded,nodes:f.expanded?(G=M,G.map(Y=>Y.node.type===L.META?Ar(Y):Tr(Y))):[],edges:f.expanded?zr(f):[]});var G}function Tr(f){return{id:f.node.name,name:f.node.name,type:f.node.type,cardinality:f.node.cardinality,attr:f.attr,parentNodeName:f.node.parentNode?f.node.parentNode.name:null,coreBox:Object.assign({},f.coreBox),x:f.x,y:f.y,width:f.width,height:f.height,radius:f.radius,labelHeight:f.labelHeight,labelOffset:f.labelOffset,outboxWidth:f.outboxWidth,paddingLeft:f.paddingLeft,paddingTop:f.paddingTop,paddingRight:f.paddingRight,paddingBottom:f.paddingBottom,path:f.node.path}}function zr(f){return f.coreGraph.edges().map(M=>({renderInfoEdge:f.coreGraph.edge(M),edge:M})).filter(({renderInfoEdge:M})=>M.metaEdge).map(({edge:M,renderInfoEdge:G})=>{const Y=function(re,ie){const le=ie.points.map(ge=>Object.assign({},ge));if(ie.adjoiningMetaEdge){const ge=ie.adjoiningMetaEdge.points,me=ie.metaEdge.inbound,Le=me?ge[ge.length-1]:ge[0],ze=le[me?0:le.length-1],Fe=re.x-re.width/2,tt=re.y-re.height/2,Mt=Le.x-Fe,sr=Le.y-tt,Tt=-re.paddingLeft,Nt=-(re.paddingTop+re.labelHeight);ze.x=Mt+Tt,ze.y=sr+Nt}return le}(f,G);return{adjoiningEdge:G.adjoiningMetaEdge?{w:G.adjoiningMetaEdge.metaEdge.w,v:G.adjoiningMetaEdge.metaEdge.v}:null,inbound:G.metaEdge.inbound,w:M.w,v:M.v,points:Y,weight:G.weight,baseEdgeList:G.metaEdge.baseEdgeList,parentNodeName:f.node.name}})}},64530:function(or,U,z){"use strict";z.r(U),z.d(U,{glMatrix:function(){return y},mat2:function(){return B},mat2d:function(){return j},mat3:function(){return qr},mat4:function(){return R},quat:function(){return N},quat2:function(){return L},vec2:function(){return Cf},vec3:function(){return Yn},vec4:function(){return A}});var B={};z.r(B),z.d(B,{LDU:function(){return J},add:function(){return te},adjoint:function(){return k},clone:function(){return v},copy:function(){return g},create:function(){return x},determinant:function(){return b},equals:function(){return Te},exactEquals:function(){return de},frob:function(){return q},fromRotation:function(){return X},fromScaling:function(){return H},fromValues:function(){return _},identity:function(){return d},invert:function(){return T},mul:function(){return be},multiply:function(){return m},multiplyScalar:function(){return Se},multiplyScalarAndAdd:function(){return Ie},rotate:function(){return $},scale:function(){return W},set:function(){return E},str:function(){return Q},sub:function(){return pe},subtract:function(){return fe},transpose:function(){return w}});var j={};z.r(j),z.d(j,{add:function(){return ft},clone:function(){return De},copy:function(){return Ue},create:function(){return Me},determinant:function(){return tr},equals:function(){return Ae},exactEquals:function(){return Ur},frob:function(){return Vt},fromRotation:function(){return _t},fromScaling:function(){return pt},fromTranslation:function(){return rr},fromValues:function(){return Ze},identity:function(){return nt},invert:function(){return Rt},mul:function(){return Hr},multiply:function(){return Qe},multiplyScalar:function(){return qt},multiplyScalarAndAdd:function(){return br},rotate:function(){return lt},scale:function(){return St},set:function(){return ht},str:function(){return xr},sub:function(){return Sr},subtract:function(){return Bt},translate:function(){return Ct}});var R={};z.r(R),z.d(R,{add:function(){return Qt},adjoint:function(){return Wt},clone:function(){return vn},copy:function(){return Gn},create:function(){return Gr},determinant:function(){return Er},equals:function(){return kn},exactEquals:function(){return ta},frob:function(){return Ot},fromQuat:function(){return V},fromQuat2:function(){return rt},fromRotation:function(){return An},fromRotationTranslation:function(){return Dt},fromRotationTranslationScale:function(){return S},fromRotationTranslationScaleOrigin:function(){return C},fromScaling:function(){return Pn},fromTranslation:function(){return Zr},fromValues:function(){return mn},fromXRotation:function(){return ln},fromYRotation:function(){return va},fromZRotation:function(){return K},frustum:function(){return he},getRotation:function(){return P},getScaling:function(){return ae},getTranslation:function(){return ne},identity:function(){return gn},invert:function(){return ct},lookAt:function(){return Ht},mul:function(){return En},multiply:function(){return Dr},multiplyScalar:function(){return en},multiplyScalarAndAdd:function(){return Nr},ortho:function(){return Pt},orthoNO:function(){return st},orthoZO:function(){return $t},perspective:function(){return Ee},perspectiveFromFieldOfView:function(){return Et},perspectiveNO:function(){return xe},perspectiveZO:function(){return Ne},rotate:function(){return wn},rotateX:function(){return Sn},rotateY:function(){return In},rotateZ:function(){return $n},scale:function(){return pn},set:function(){return $r},str:function(){return hn},sub:function(){return Rn},subtract:function(){return pr},targetTo:function(){return Br},translate:function(){return Vr},transpose:function(){return Rr}});var A={};z.r(A),z.d(A,{add:function(){return ot},ceil:function(){return Wr},clone:function(){return je},copy:function(){return Xe},create:function(){return bn},cross:function(){return co},dist:function(){return Oo},distance:function(){return Ia},div:function(){return _s},divide:function(){return wr},dot:function(){return to},equals:function(){return Yi},exactEquals:function(){return _o},floor:function(){return on},forEach:function(){return Go},fromValues:function(){return Ce},inverse:function(){return _a},len:function(){return _n},length:function(){return Ea},lerp:function(){return ni},max:function(){return zn},min:function(){return xn},mul:function(){return Bo},multiply:function(){return Xt},negate:function(){return si},normalize:function(){return So},random:function(){return lo},round:function(){return Qn},scale:function(){return ia},scaleAndAdd:function(){return Wa},set:function(){return ut},sqrDist:function(){return Hi},sqrLen:function(){return Fo},squaredDistance:function(){return Ba},squaredLength:function(){return qa},str:function(){return ya},sub:function(){return Fi},subtract:function(){return bt},transformMat4:function(){return Ss},transformQuat:function(){return Ro},zero:function(){return mi}});var N={};z.r(N),z.d(N,{add:function(){return Ui},calculateW:function(){return Ni},clone:function(){return vi},conjugate:function(){return Vs},copy:function(){return _i},create:function(){return Va},dot:function(){return Ya},equals:function(){return ka},exactEquals:function(){return ji},exp:function(){return ro},fromEuler:function(){return Ao},fromMat3:function(){return Pi},fromValues:function(){return Zi},getAngle:function(){return Mo},getAxisAngle:function(){return Li},identity:function(){return Ms},invert:function(){return vo},len:function(){return ao},length:function(){return Wi},lerp:function(){return Ii},ln:function(){return Qo},mul:function(){return da},multiply:function(){return ho},normalize:function(){return yo},pow:function(){return ns},random:function(){return ga},rotateX:function(){return Gi},rotateY:function(){return Di},rotateZ:function(){return $o},rotationTo:function(){return Ys},scale:function(){return Fa},set:function(){return no},setAxes:function(){return mo},setAxisAngle:function(){return Ko},slerp:function(){return zi},sqlerp:function(){return _f},sqrLen:function(){return po},squaredLength:function(){return go},str:function(){return as}});var L={};z.r(L),z.d(L,{add:function(){return Uo},clone:function(){return na},conjugate:function(){return Ku},copy:function(){return ai},create:function(){return lu},dot:function(){return vu},equals:function(){return Ts},exactEquals:function(){return Mf},fromMat4:function(){return ui},fromRotation:function(){return is},fromRotationTranslation:function(){return Xi},fromRotationTranslationValues:function(){return Hs},fromTranslation:function(){return zo},fromValues:function(){return an},getDual:function(){return du},getReal:function(){return Hu},getTranslation:function(){return Ki},identity:function(){return Eo},invert:function(){return pu},len:function(){return Cs},length:function(){return Co},lerp:function(){return gu},mul:function(){return fs},multiply:function(){return bo},normalize:function(){return xo},rotateAroundAxis:function(){return $s},rotateByQuatAppend:function(){return ss},rotateByQuatPrepend:function(){return us},rotateX:function(){return Ks},rotateY:function(){return io},rotateZ:function(){return os},scale:function(){return Zu},set:function(){return Yu},setDual:function(){return Ei},setReal:function(){return hu},sqrLen:function(){return $i},squaredLength:function(){return cs},str:function(){return $u},translate:function(){return Zs}});var y=z(49685);function x(){var u=new y.ARRAY_TYPE(4);return y.ARRAY_TYPE!=Float32Array&&(u[1]=0,u[2]=0),u[0]=1,u[3]=1,u}function v(u){var O=new y.ARRAY_TYPE(4);return O[0]=u[0],O[1]=u[1],O[2]=u[2],O[3]=u[3],O}function g(u,O){return u[0]=O[0],u[1]=O[1],u[2]=O[2],u[3]=O[3],u}function d(u){return u[0]=1,u[1]=0,u[2]=0,u[3]=1,u}function _(u,O,ue,ye){var _e=new y.ARRAY_TYPE(4);return _e[0]=u,_e[1]=O,_e[2]=ue,_e[3]=ye,_e}function E(u,O,ue,ye,_e){return u[0]=O,u[1]=ue,u[2]=ye,u[3]=_e,u}function w(u,O){if(u===O){var ue=O[1];u[1]=O[2],u[2]=ue}else u[0]=O[0],u[1]=O[2],u[2]=O[1],u[3]=O[3];return u}function T(u,O){var ue=O[0],ye=O[1],_e=O[2],ke=O[3],Be=ue*ke-_e*ye;return Be?(Be=1/Be,u[0]=ke*Be,u[1]=-ye*Be,u[2]=-_e*Be,u[3]=ue*Be,u):null}function k(u,O){var ue=O[0];return u[0]=O[3],u[1]=-O[1],u[2]=-O[2],u[3]=ue,u}function b(u){return u[0]*u[3]-u[2]*u[1]}function m(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=ue[0],Je=ue[1],dt=ue[2],It=ue[3];return u[0]=ye*Ye+ke*Je,u[1]=_e*Ye+Be*Je,u[2]=ye*dt+ke*It,u[3]=_e*dt+Be*It,u}function $(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=Math.sin(ue),Je=Math.cos(ue);return u[0]=ye*Je+ke*Ye,u[1]=_e*Je+Be*Ye,u[2]=ye*-Ye+ke*Je,u[3]=_e*-Ye+Be*Je,u}function W(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=ue[0],Je=ue[1];return u[0]=ye*Ye,u[1]=_e*Ye,u[2]=ke*Je,u[3]=Be*Je,u}function X(u,O){var ue=Math.sin(O),ye=Math.cos(O);return u[0]=ye,u[1]=ue,u[2]=-ue,u[3]=ye,u}function H(u,O){return u[0]=O[0],u[1]=0,u[2]=0,u[3]=O[1],u}function Q(u){return"mat2("+u[0]+", "+u[1]+", "+u[2]+", "+u[3]+")"}function q(u){return Math.hypot(u[0],u[1],u[2],u[3])}function J(u,O,ue,ye){return u[2]=ye[2]/ye[0],ue[0]=ye[0],ue[1]=ye[1],ue[3]=ye[3]-u[2]*ue[1],[u,O,ue]}function te(u,O,ue){return u[0]=O[0]+ue[0],u[1]=O[1]+ue[1],u[2]=O[2]+ue[2],u[3]=O[3]+ue[3],u}function fe(u,O,ue){return u[0]=O[0]-ue[0],u[1]=O[1]-ue[1],u[2]=O[2]-ue[2],u[3]=O[3]-ue[3],u}function de(u,O){return u[0]===O[0]&&u[1]===O[1]&&u[2]===O[2]&&u[3]===O[3]}function Te(u,O){var ue=u[0],ye=u[1],_e=u[2],ke=u[3],Be=O[0],Ye=O[1],Je=O[2],dt=O[3];return Math.abs(ue-Be)<=y.EPSILON*Math.max(1,Math.abs(ue),Math.abs(Be))&&Math.abs(ye-Ye)<=y.EPSILON*Math.max(1,Math.abs(ye),Math.abs(Ye))&&Math.abs(_e-Je)<=y.EPSILON*Math.max(1,Math.abs(_e),Math.abs(Je))&&Math.abs(ke-dt)<=y.EPSILON*Math.max(1,Math.abs(ke),Math.abs(dt))}function Se(u,O,ue){return u[0]=O[0]*ue,u[1]=O[1]*ue,u[2]=O[2]*ue,u[3]=O[3]*ue,u}function Ie(u,O,ue,ye){return u[0]=O[0]+ue[0]*ye,u[1]=O[1]+ue[1]*ye,u[2]=O[2]+ue[2]*ye,u[3]=O[3]+ue[3]*ye,u}var be=m,pe=fe;function Me(){var u=new y.ARRAY_TYPE(6);return y.ARRAY_TYPE!=Float32Array&&(u[1]=0,u[2]=0,u[4]=0,u[5]=0),u[0]=1,u[3]=1,u}function De(u){var O=new y.ARRAY_TYPE(6);return O[0]=u[0],O[1]=u[1],O[2]=u[2],O[3]=u[3],O[4]=u[4],O[5]=u[5],O}function Ue(u,O){return u[0]=O[0],u[1]=O[1],u[2]=O[2],u[3]=O[3],u[4]=O[4],u[5]=O[5],u}function nt(u){return u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u}function Ze(u,O,ue,ye,_e,ke){var Be=new y.ARRAY_TYPE(6);return Be[0]=u,Be[1]=O,Be[2]=ue,Be[3]=ye,Be[4]=_e,Be[5]=ke,Be}function ht(u,O,ue,ye,_e,ke,Be){return u[0]=O,u[1]=ue,u[2]=ye,u[3]=_e,u[4]=ke,u[5]=Be,u}function Rt(u,O){var ue=O[0],ye=O[1],_e=O[2],ke=O[3],Be=O[4],Ye=O[5],Je=ue*ke-ye*_e;return Je?(Je=1/Je,u[0]=ke*Je,u[1]=-ye*Je,u[2]=-_e*Je,u[3]=ue*Je,u[4]=(_e*Ye-ke*Be)*Je,u[5]=(ye*Be-ue*Ye)*Je,u):null}function tr(u){return u[0]*u[3]-u[1]*u[2]}function Qe(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=O[4],Je=O[5],dt=ue[0],It=ue[1],ir=ue[2],cr=ue[3],nr=ue[4],Or=ue[5];return u[0]=ye*dt+ke*It,u[1]=_e*dt+Be*It,u[2]=ye*ir+ke*cr,u[3]=_e*ir+Be*cr,u[4]=ye*nr+ke*Or+Ye,u[5]=_e*nr+Be*Or+Je,u}function lt(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=O[4],Je=O[5],dt=Math.sin(ue),It=Math.cos(ue);return u[0]=ye*It+ke*dt,u[1]=_e*It+Be*dt,u[2]=ye*-dt+ke*It,u[3]=_e*-dt+Be*It,u[4]=Ye,u[5]=Je,u}function St(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=O[4],Je=O[5],dt=ue[0],It=ue[1];return u[0]=ye*dt,u[1]=_e*dt,u[2]=ke*It,u[3]=Be*It,u[4]=Ye,u[5]=Je,u}function Ct(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=O[4],Je=O[5],dt=ue[0],It=ue[1];return u[0]=ye,u[1]=_e,u[2]=ke,u[3]=Be,u[4]=ye*dt+ke*It+Ye,u[5]=_e*dt+Be*It+Je,u}function _t(u,O){var ue=Math.sin(O),ye=Math.cos(O);return u[0]=ye,u[1]=ue,u[2]=-ue,u[3]=ye,u[4]=0,u[5]=0,u}function pt(u,O){return u[0]=O[0],u[1]=0,u[2]=0,u[3]=O[1],u[4]=0,u[5]=0,u}function rr(u,O){return u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=O[0],u[5]=O[1],u}function xr(u){return"mat2d("+u[0]+", "+u[1]+", "+u[2]+", "+u[3]+", "+u[4]+", "+u[5]+")"}function Vt(u){return Math.hypot(u[0],u[1],u[2],u[3],u[4],u[5],1)}function ft(u,O,ue){return u[0]=O[0]+ue[0],u[1]=O[1]+ue[1],u[2]=O[2]+ue[2],u[3]=O[3]+ue[3],u[4]=O[4]+ue[4],u[5]=O[5]+ue[5],u}function Bt(u,O,ue){return u[0]=O[0]-ue[0],u[1]=O[1]-ue[1],u[2]=O[2]-ue[2],u[3]=O[3]-ue[3],u[4]=O[4]-ue[4],u[5]=O[5]-ue[5],u}function qt(u,O,ue){return u[0]=O[0]*ue,u[1]=O[1]*ue,u[2]=O[2]*ue,u[3]=O[3]*ue,u[4]=O[4]*ue,u[5]=O[5]*ue,u}function br(u,O,ue,ye){return u[0]=O[0]+ue[0]*ye,u[1]=O[1]+ue[1]*ye,u[2]=O[2]+ue[2]*ye,u[3]=O[3]+ue[3]*ye,u[4]=O[4]+ue[4]*ye,u[5]=O[5]+ue[5]*ye,u}function Ur(u,O){return u[0]===O[0]&&u[1]===O[1]&&u[2]===O[2]&&u[3]===O[3]&&u[4]===O[4]&&u[5]===O[5]}function Ae(u,O){var ue=u[0],ye=u[1],_e=u[2],ke=u[3],Be=u[4],Ye=u[5],Je=O[0],dt=O[1],It=O[2],ir=O[3],cr=O[4],nr=O[5];return Math.abs(ue-Je)<=y.EPSILON*Math.max(1,Math.abs(ue),Math.abs(Je))&&Math.abs(ye-dt)<=y.EPSILON*Math.max(1,Math.abs(ye),Math.abs(dt))&&Math.abs(_e-It)<=y.EPSILON*Math.max(1,Math.abs(_e),Math.abs(It))&&Math.abs(ke-ir)<=y.EPSILON*Math.max(1,Math.abs(ke),Math.abs(ir))&&Math.abs(Be-cr)<=y.EPSILON*Math.max(1,Math.abs(Be),Math.abs(cr))&&Math.abs(Ye-nr)<=y.EPSILON*Math.max(1,Math.abs(Ye),Math.abs(nr))}var Hr=Qe,Sr=Bt,qr=z(35600);function Gr(){var u=new y.ARRAY_TYPE(16);return y.ARRAY_TYPE!=Float32Array&&(u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=0,u[12]=0,u[13]=0,u[14]=0),u[0]=1,u[5]=1,u[10]=1,u[15]=1,u}function vn(u){var O=new y.ARRAY_TYPE(16);return O[0]=u[0],O[1]=u[1],O[2]=u[2],O[3]=u[3],O[4]=u[4],O[5]=u[5],O[6]=u[6],O[7]=u[7],O[8]=u[8],O[9]=u[9],O[10]=u[10],O[11]=u[11],O[12]=u[12],O[13]=u[13],O[14]=u[14],O[15]=u[15],O}function Gn(u,O){return u[0]=O[0],u[1]=O[1],u[2]=O[2],u[3]=O[3],u[4]=O[4],u[5]=O[5],u[6]=O[6],u[7]=O[7],u[8]=O[8],u[9]=O[9],u[10]=O[10],u[11]=O[11],u[12]=O[12],u[13]=O[13],u[14]=O[14],u[15]=O[15],u}function mn(u,O,ue,ye,_e,ke,Be,Ye,Je,dt,It,ir,cr,nr,Or,Cr){var hr=new y.ARRAY_TYPE(16);return hr[0]=u,hr[1]=O,hr[2]=ue,hr[3]=ye,hr[4]=_e,hr[5]=ke,hr[6]=Be,hr[7]=Ye,hr[8]=Je,hr[9]=dt,hr[10]=It,hr[11]=ir,hr[12]=cr,hr[13]=nr,hr[14]=Or,hr[15]=Cr,hr}function $r(u,O,ue,ye,_e,ke,Be,Ye,Je,dt,It,ir,cr,nr,Or,Cr,hr){return u[0]=O,u[1]=ue,u[2]=ye,u[3]=_e,u[4]=ke,u[5]=Be,u[6]=Ye,u[7]=Je,u[8]=dt,u[9]=It,u[10]=ir,u[11]=cr,u[12]=nr,u[13]=Or,u[14]=Cr,u[15]=hr,u}function gn(u){return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u}function Rr(u,O){if(u===O){var ue=O[1],ye=O[2],_e=O[3],ke=O[6],Be=O[7],Ye=O[11];u[1]=O[4],u[2]=O[8],u[3]=O[12],u[4]=ue,u[6]=O[9],u[7]=O[13],u[8]=ye,u[9]=ke,u[11]=O[14],u[12]=_e,u[13]=Be,u[14]=Ye}else u[0]=O[0],u[1]=O[4],u[2]=O[8],u[3]=O[12],u[4]=O[1],u[5]=O[5],u[6]=O[9],u[7]=O[13],u[8]=O[2],u[9]=O[6],u[10]=O[10],u[11]=O[14],u[12]=O[3],u[13]=O[7],u[14]=O[11],u[15]=O[15];return u}function ct(u,O){var ue=O[0],ye=O[1],_e=O[2],ke=O[3],Be=O[4],Ye=O[5],Je=O[6],dt=O[7],It=O[8],ir=O[9],cr=O[10],nr=O[11],Or=O[12],Cr=O[13],hr=O[14],rn=O[15],Jn=ue*Ye-ye*Be,qn=ue*Je-_e*Be,Un=ue*dt-ke*Be,Mn=ye*Je-_e*Ye,Cn=ye*dt-ke*Ye,Ga=_e*dt-ke*Je,ei=It*Cr-ir*Or,Ka=It*hr-cr*Or,$a=It*rn-nr*Or,Ha=ir*hr-cr*Cr,fi=ir*rn-nr*Cr,bi=cr*rn-nr*hr,ha=Jn*bi-qn*fi+Un*Ha+Mn*$a-Cn*Ka+Ga*ei;return ha?(ha=1/ha,u[0]=(Ye*bi-Je*fi+dt*Ha)*ha,u[1]=(_e*fi-ye*bi-ke*Ha)*ha,u[2]=(Cr*Ga-hr*Cn+rn*Mn)*ha,u[3]=(cr*Cn-ir*Ga-nr*Mn)*ha,u[4]=(Je*$a-Be*bi-dt*Ka)*ha,u[5]=(ue*bi-_e*$a+ke*Ka)*ha,u[6]=(hr*Un-Or*Ga-rn*qn)*ha,u[7]=(It*Ga-cr*Un+nr*qn)*ha,u[8]=(Be*fi-Ye*$a+dt*ei)*ha,u[9]=(ye*$a-ue*fi-ke*ei)*ha,u[10]=(Or*Cn-Cr*Un+rn*Jn)*ha,u[11]=(ir*Un-It*Cn-nr*Jn)*ha,u[12]=(Ye*Ka-Be*Ha-Je*ei)*ha,u[13]=(ue*Ha-ye*Ka+_e*ei)*ha,u[14]=(Cr*qn-Or*Mn-hr*Jn)*ha,u[15]=(It*Mn-ir*qn+cr*Jn)*ha,u):null}function Wt(u,O){var ue=O[0],ye=O[1],_e=O[2],ke=O[3],Be=O[4],Ye=O[5],Je=O[6],dt=O[7],It=O[8],ir=O[9],cr=O[10],nr=O[11],Or=O[12],Cr=O[13],hr=O[14],rn=O[15];return u[0]=Ye*(cr*rn-nr*hr)-ir*(Je*rn-dt*hr)+Cr*(Je*nr-dt*cr),u[1]=-(ye*(cr*rn-nr*hr)-ir*(_e*rn-ke*hr)+Cr*(_e*nr-ke*cr)),u[2]=ye*(Je*rn-dt*hr)-Ye*(_e*rn-ke*hr)+Cr*(_e*dt-ke*Je),u[3]=-(ye*(Je*nr-dt*cr)-Ye*(_e*nr-ke*cr)+ir*(_e*dt-ke*Je)),u[4]=-(Be*(cr*rn-nr*hr)-It*(Je*rn-dt*hr)+Or*(Je*nr-dt*cr)),u[5]=ue*(cr*rn-nr*hr)-It*(_e*rn-ke*hr)+Or*(_e*nr-ke*cr),u[6]=-(ue*(Je*rn-dt*hr)-Be*(_e*rn-ke*hr)+Or*(_e*dt-ke*Je)),u[7]=ue*(Je*nr-dt*cr)-Be*(_e*nr-ke*cr)+It*(_e*dt-ke*Je),u[8]=Be*(ir*rn-nr*Cr)-It*(Ye*rn-dt*Cr)+Or*(Ye*nr-dt*ir),u[9]=-(ue*(ir*rn-nr*Cr)-It*(ye*rn-ke*Cr)+Or*(ye*nr-ke*ir)),u[10]=ue*(Ye*rn-dt*Cr)-Be*(ye*rn-ke*Cr)+Or*(ye*dt-ke*Ye),u[11]=-(ue*(Ye*nr-dt*ir)-Be*(ye*nr-ke*ir)+It*(ye*dt-ke*Ye)),u[12]=-(Be*(ir*hr-cr*Cr)-It*(Ye*hr-Je*Cr)+Or*(Ye*cr-Je*ir)),u[13]=ue*(ir*hr-cr*Cr)-It*(ye*hr-_e*Cr)+Or*(ye*cr-_e*ir),u[14]=-(ue*(Ye*hr-Je*Cr)-Be*(ye*hr-_e*Cr)+Or*(ye*Je-_e*Ye)),u[15]=ue*(Ye*cr-Je*ir)-Be*(ye*cr-_e*ir)+It*(ye*Je-_e*Ye),u}function Er(u){var O=u[0],ue=u[1],ye=u[2],_e=u[3],ke=u[4],Be=u[5],Ye=u[6],Je=u[7],dt=u[8],It=u[9],ir=u[10],cr=u[11],nr=u[12],Or=u[13],Cr=u[14],hr=u[15],rn=O*Be-ue*ke,Jn=O*Ye-ye*ke,qn=O*Je-_e*ke,Un=ue*Ye-ye*Be,Mn=ue*Je-_e*Be,Cn=ye*Je-_e*Ye,Ga=dt*Or-It*nr,ei=dt*Cr-ir*nr,Ka=dt*hr-cr*nr,$a=It*Cr-ir*Or,Ha=It*hr-cr*Or,fi=ir*hr-cr*Cr;return rn*fi-Jn*Ha+qn*$a+Un*Ka-Mn*ei+Cn*Ga}function Dr(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=O[4],Je=O[5],dt=O[6],It=O[7],ir=O[8],cr=O[9],nr=O[10],Or=O[11],Cr=O[12],hr=O[13],rn=O[14],Jn=O[15],qn=ue[0],Un=ue[1],Mn=ue[2],Cn=ue[3];return u[0]=qn*ye+Un*Ye+Mn*ir+Cn*Cr,u[1]=qn*_e+Un*Je+Mn*cr+Cn*hr,u[2]=qn*ke+Un*dt+Mn*nr+Cn*rn,u[3]=qn*Be+Un*It+Mn*Or+Cn*Jn,qn=ue[4],Un=ue[5],Mn=ue[6],Cn=ue[7],u[4]=qn*ye+Un*Ye+Mn*ir+Cn*Cr,u[5]=qn*_e+Un*Je+Mn*cr+Cn*hr,u[6]=qn*ke+Un*dt+Mn*nr+Cn*rn,u[7]=qn*Be+Un*It+Mn*Or+Cn*Jn,qn=ue[8],Un=ue[9],Mn=ue[10],Cn=ue[11],u[8]=qn*ye+Un*Ye+Mn*ir+Cn*Cr,u[9]=qn*_e+Un*Je+Mn*cr+Cn*hr,u[10]=qn*ke+Un*dt+Mn*nr+Cn*rn,u[11]=qn*Be+Un*It+Mn*Or+Cn*Jn,qn=ue[12],Un=ue[13],Mn=ue[14],Cn=ue[15],u[12]=qn*ye+Un*Ye+Mn*ir+Cn*Cr,u[13]=qn*_e+Un*Je+Mn*cr+Cn*hr,u[14]=qn*ke+Un*dt+Mn*nr+Cn*rn,u[15]=qn*Be+Un*It+Mn*Or+Cn*Jn,u}function Vr(u,O,ue){var ye=ue[0],_e=ue[1],ke=ue[2],Be,Ye,Je,dt,It,ir,cr,nr,Or,Cr,hr,rn;return O===u?(u[12]=O[0]*ye+O[4]*_e+O[8]*ke+O[12],u[13]=O[1]*ye+O[5]*_e+O[9]*ke+O[13],u[14]=O[2]*ye+O[6]*_e+O[10]*ke+O[14],u[15]=O[3]*ye+O[7]*_e+O[11]*ke+O[15]):(Be=O[0],Ye=O[1],Je=O[2],dt=O[3],It=O[4],ir=O[5],cr=O[6],nr=O[7],Or=O[8],Cr=O[9],hr=O[10],rn=O[11],u[0]=Be,u[1]=Ye,u[2]=Je,u[3]=dt,u[4]=It,u[5]=ir,u[6]=cr,u[7]=nr,u[8]=Or,u[9]=Cr,u[10]=hr,u[11]=rn,u[12]=Be*ye+It*_e+Or*ke+O[12],u[13]=Ye*ye+ir*_e+Cr*ke+O[13],u[14]=Je*ye+cr*_e+hr*ke+O[14],u[15]=dt*ye+nr*_e+rn*ke+O[15]),u}function pn(u,O,ue){var ye=ue[0],_e=ue[1],ke=ue[2];return u[0]=O[0]*ye,u[1]=O[1]*ye,u[2]=O[2]*ye,u[3]=O[3]*ye,u[4]=O[4]*_e,u[5]=O[5]*_e,u[6]=O[6]*_e,u[7]=O[7]*_e,u[8]=O[8]*ke,u[9]=O[9]*ke,u[10]=O[10]*ke,u[11]=O[11]*ke,u[12]=O[12],u[13]=O[13],u[14]=O[14],u[15]=O[15],u}function wn(u,O,ue,ye){var _e=ye[0],ke=ye[1],Be=ye[2],Ye=Math.hypot(_e,ke,Be),Je,dt,It,ir,cr,nr,Or,Cr,hr,rn,Jn,qn,Un,Mn,Cn,Ga,ei,Ka,$a,Ha,fi,bi,ha,Oa;return Ye<y.EPSILON?null:(Ye=1/Ye,_e*=Ye,ke*=Ye,Be*=Ye,Je=Math.sin(ue),dt=Math.cos(ue),It=1-dt,ir=O[0],cr=O[1],nr=O[2],Or=O[3],Cr=O[4],hr=O[5],rn=O[6],Jn=O[7],qn=O[8],Un=O[9],Mn=O[10],Cn=O[11],Ga=_e*_e*It+dt,ei=ke*_e*It+Be*Je,Ka=Be*_e*It-ke*Je,$a=_e*ke*It-Be*Je,Ha=ke*ke*It+dt,fi=Be*ke*It+_e*Je,bi=_e*Be*It+ke*Je,ha=ke*Be*It-_e*Je,Oa=Be*Be*It+dt,u[0]=ir*Ga+Cr*ei+qn*Ka,u[1]=cr*Ga+hr*ei+Un*Ka,u[2]=nr*Ga+rn*ei+Mn*Ka,u[3]=Or*Ga+Jn*ei+Cn*Ka,u[4]=ir*$a+Cr*Ha+qn*fi,u[5]=cr*$a+hr*Ha+Un*fi,u[6]=nr*$a+rn*Ha+Mn*fi,u[7]=Or*$a+Jn*Ha+Cn*fi,u[8]=ir*bi+Cr*ha+qn*Oa,u[9]=cr*bi+hr*ha+Un*Oa,u[10]=nr*bi+rn*ha+Mn*Oa,u[11]=Or*bi+Jn*ha+Cn*Oa,O!==u&&(u[12]=O[12],u[13]=O[13],u[14]=O[14],u[15]=O[15]),u)}function Sn(u,O,ue){var ye=Math.sin(ue),_e=Math.cos(ue),ke=O[4],Be=O[5],Ye=O[6],Je=O[7],dt=O[8],It=O[9],ir=O[10],cr=O[11];return O!==u&&(u[0]=O[0],u[1]=O[1],u[2]=O[2],u[3]=O[3],u[12]=O[12],u[13]=O[13],u[14]=O[14],u[15]=O[15]),u[4]=ke*_e+dt*ye,u[5]=Be*_e+It*ye,u[6]=Ye*_e+ir*ye,u[7]=Je*_e+cr*ye,u[8]=dt*_e-ke*ye,u[9]=It*_e-Be*ye,u[10]=ir*_e-Ye*ye,u[11]=cr*_e-Je*ye,u}function In(u,O,ue){var ye=Math.sin(ue),_e=Math.cos(ue),ke=O[0],Be=O[1],Ye=O[2],Je=O[3],dt=O[8],It=O[9],ir=O[10],cr=O[11];return O!==u&&(u[4]=O[4],u[5]=O[5],u[6]=O[6],u[7]=O[7],u[12]=O[12],u[13]=O[13],u[14]=O[14],u[15]=O[15]),u[0]=ke*_e-dt*ye,u[1]=Be*_e-It*ye,u[2]=Ye*_e-ir*ye,u[3]=Je*_e-cr*ye,u[8]=ke*ye+dt*_e,u[9]=Be*ye+It*_e,u[10]=Ye*ye+ir*_e,u[11]=Je*ye+cr*_e,u}function $n(u,O,ue){var ye=Math.sin(ue),_e=Math.cos(ue),ke=O[0],Be=O[1],Ye=O[2],Je=O[3],dt=O[4],It=O[5],ir=O[6],cr=O[7];return O!==u&&(u[8]=O[8],u[9]=O[9],u[10]=O[10],u[11]=O[11],u[12]=O[12],u[13]=O[13],u[14]=O[14],u[15]=O[15]),u[0]=ke*_e+dt*ye,u[1]=Be*_e+It*ye,u[2]=Ye*_e+ir*ye,u[3]=Je*_e+cr*ye,u[4]=dt*_e-ke*ye,u[5]=It*_e-Be*ye,u[6]=ir*_e-Ye*ye,u[7]=cr*_e-Je*ye,u}function Zr(u,O){return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=O[0],u[13]=O[1],u[14]=O[2],u[15]=1,u}function Pn(u,O){return u[0]=O[0],u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=O[1],u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=O[2],u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u}function An(u,O,ue){var ye=ue[0],_e=ue[1],ke=ue[2],Be=Math.hypot(ye,_e,ke),Ye,Je,dt;return Be<y.EPSILON?null:(Be=1/Be,ye*=Be,_e*=Be,ke*=Be,Ye=Math.sin(O),Je=Math.cos(O),dt=1-Je,u[0]=ye*ye*dt+Je,u[1]=_e*ye*dt+ke*Ye,u[2]=ke*ye*dt-_e*Ye,u[3]=0,u[4]=ye*_e*dt-ke*Ye,u[5]=_e*_e*dt+Je,u[6]=ke*_e*dt+ye*Ye,u[7]=0,u[8]=ye*ke*dt+_e*Ye,u[9]=_e*ke*dt-ye*Ye,u[10]=ke*ke*dt+Je,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u)}function ln(u,O){var ue=Math.sin(O),ye=Math.cos(O);return u[0]=1,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=ye,u[6]=ue,u[7]=0,u[8]=0,u[9]=-ue,u[10]=ye,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u}function va(u,O){var ue=Math.sin(O),ye=Math.cos(O);return u[0]=ye,u[1]=0,u[2]=-ue,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=ue,u[9]=0,u[10]=ye,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u}function K(u,O){var ue=Math.sin(O),ye=Math.cos(O);return u[0]=ye,u[1]=ue,u[2]=0,u[3]=0,u[4]=-ue,u[5]=ye,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u}function Dt(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=ye+ye,Je=_e+_e,dt=ke+ke,It=ye*Ye,ir=ye*Je,cr=ye*dt,nr=_e*Je,Or=_e*dt,Cr=ke*dt,hr=Be*Ye,rn=Be*Je,Jn=Be*dt;return u[0]=1-(nr+Cr),u[1]=ir+Jn,u[2]=cr-rn,u[3]=0,u[4]=ir-Jn,u[5]=1-(It+Cr),u[6]=Or+hr,u[7]=0,u[8]=cr+rn,u[9]=Or-hr,u[10]=1-(It+nr),u[11]=0,u[12]=ue[0],u[13]=ue[1],u[14]=ue[2],u[15]=1,u}function rt(u,O){var ue=new y.ARRAY_TYPE(3),ye=-O[0],_e=-O[1],ke=-O[2],Be=O[3],Ye=O[4],Je=O[5],dt=O[6],It=O[7],ir=ye*ye+_e*_e+ke*ke+Be*Be;return ir>0?(ue[0]=(Ye*Be+It*ye+Je*ke-dt*_e)*2/ir,ue[1]=(Je*Be+It*_e+dt*ye-Ye*ke)*2/ir,ue[2]=(dt*Be+It*ke+Ye*_e-Je*ye)*2/ir):(ue[0]=(Ye*Be+It*ye+Je*ke-dt*_e)*2,ue[1]=(Je*Be+It*_e+dt*ye-Ye*ke)*2,ue[2]=(dt*Be+It*ke+Ye*_e-Je*ye)*2),Dt(u,O,ue),u}function ne(u,O){return u[0]=O[12],u[1]=O[13],u[2]=O[14],u}function ae(u,O){var ue=O[0],ye=O[1],_e=O[2],ke=O[4],Be=O[5],Ye=O[6],Je=O[8],dt=O[9],It=O[10];return u[0]=Math.hypot(ue,ye,_e),u[1]=Math.hypot(ke,Be,Ye),u[2]=Math.hypot(Je,dt,It),u}function P(u,O){var ue=new y.ARRAY_TYPE(3);ae(ue,O);var ye=1/ue[0],_e=1/ue[1],ke=1/ue[2],Be=O[0]*ye,Ye=O[1]*_e,Je=O[2]*ke,dt=O[4]*ye,It=O[5]*_e,ir=O[6]*ke,cr=O[8]*ye,nr=O[9]*_e,Or=O[10]*ke,Cr=Be+It+Or,hr=0;return Cr>0?(hr=Math.sqrt(Cr+1)*2,u[3]=.25*hr,u[0]=(ir-nr)/hr,u[1]=(cr-Je)/hr,u[2]=(Ye-dt)/hr):Be>It&&Be>Or?(hr=Math.sqrt(1+Be-It-Or)*2,u[3]=(ir-nr)/hr,u[0]=.25*hr,u[1]=(Ye+dt)/hr,u[2]=(cr+Je)/hr):It>Or?(hr=Math.sqrt(1+It-Be-Or)*2,u[3]=(cr-Je)/hr,u[0]=(Ye+dt)/hr,u[1]=.25*hr,u[2]=(ir+nr)/hr):(hr=Math.sqrt(1+Or-Be-It)*2,u[3]=(Ye-dt)/hr,u[0]=(cr+Je)/hr,u[1]=(ir+nr)/hr,u[2]=.25*hr),u}function S(u,O,ue,ye){var _e=O[0],ke=O[1],Be=O[2],Ye=O[3],Je=_e+_e,dt=ke+ke,It=Be+Be,ir=_e*Je,cr=_e*dt,nr=_e*It,Or=ke*dt,Cr=ke*It,hr=Be*It,rn=Ye*Je,Jn=Ye*dt,qn=Ye*It,Un=ye[0],Mn=ye[1],Cn=ye[2];return u[0]=(1-(Or+hr))*Un,u[1]=(cr+qn)*Un,u[2]=(nr-Jn)*Un,u[3]=0,u[4]=(cr-qn)*Mn,u[5]=(1-(ir+hr))*Mn,u[6]=(Cr+rn)*Mn,u[7]=0,u[8]=(nr+Jn)*Cn,u[9]=(Cr-rn)*Cn,u[10]=(1-(ir+Or))*Cn,u[11]=0,u[12]=ue[0],u[13]=ue[1],u[14]=ue[2],u[15]=1,u}function C(u,O,ue,ye,_e){var ke=O[0],Be=O[1],Ye=O[2],Je=O[3],dt=ke+ke,It=Be+Be,ir=Ye+Ye,cr=ke*dt,nr=ke*It,Or=ke*ir,Cr=Be*It,hr=Be*ir,rn=Ye*ir,Jn=Je*dt,qn=Je*It,Un=Je*ir,Mn=ye[0],Cn=ye[1],Ga=ye[2],ei=_e[0],Ka=_e[1],$a=_e[2],Ha=(1-(Cr+rn))*Mn,fi=(nr+Un)*Mn,bi=(Or-qn)*Mn,ha=(nr-Un)*Cn,Oa=(1-(cr+rn))*Cn,Jo=(hr+Jn)*Cn,Wo=(Or+qn)*Ga,oo=(hr-Jn)*Ga,Qs=(1-(cr+Cr))*Ga;return u[0]=Ha,u[1]=fi,u[2]=bi,u[3]=0,u[4]=ha,u[5]=Oa,u[6]=Jo,u[7]=0,u[8]=Wo,u[9]=oo,u[10]=Qs,u[11]=0,u[12]=ue[0]+ei-(Ha*ei+ha*Ka+Wo*$a),u[13]=ue[1]+Ka-(fi*ei+Oa*Ka+oo*$a),u[14]=ue[2]+$a-(bi*ei+Jo*Ka+Qs*$a),u[15]=1,u}function V(u,O){var ue=O[0],ye=O[1],_e=O[2],ke=O[3],Be=ue+ue,Ye=ye+ye,Je=_e+_e,dt=ue*Be,It=ye*Be,ir=ye*Ye,cr=_e*Be,nr=_e*Ye,Or=_e*Je,Cr=ke*Be,hr=ke*Ye,rn=ke*Je;return u[0]=1-ir-Or,u[1]=It+rn,u[2]=cr-hr,u[3]=0,u[4]=It-rn,u[5]=1-dt-Or,u[6]=nr+Cr,u[7]=0,u[8]=cr+hr,u[9]=nr-Cr,u[10]=1-dt-ir,u[11]=0,u[12]=0,u[13]=0,u[14]=0,u[15]=1,u}function he(u,O,ue,ye,_e,ke,Be){var Ye=1/(ue-O),Je=1/(_e-ye),dt=1/(ke-Be);return u[0]=ke*2*Ye,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=ke*2*Je,u[6]=0,u[7]=0,u[8]=(ue+O)*Ye,u[9]=(_e+ye)*Je,u[10]=(Be+ke)*dt,u[11]=-1,u[12]=0,u[13]=0,u[14]=Be*ke*2*dt,u[15]=0,u}function xe(u,O,ue,ye,_e){var ke=1/Math.tan(O/2),Be;return u[0]=ke/ue,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=ke,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=-1,u[12]=0,u[13]=0,u[15]=0,_e!=null&&_e!==Infinity?(Be=1/(ye-_e),u[10]=(_e+ye)*Be,u[14]=2*_e*ye*Be):(u[10]=-1,u[14]=-2*ye),u}var Ee=xe;function Ne(u,O,ue,ye,_e){var ke=1/Math.tan(O/2),Be;return u[0]=ke/ue,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=ke,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[11]=-1,u[12]=0,u[13]=0,u[15]=0,_e!=null&&_e!==Infinity?(Be=1/(ye-_e),u[10]=_e*Be,u[14]=_e*ye*Be):(u[10]=-1,u[14]=-ye),u}function Et(u,O,ue,ye){var _e=Math.tan(O.upDegrees*Math.PI/180),ke=Math.tan(O.downDegrees*Math.PI/180),Be=Math.tan(O.leftDegrees*Math.PI/180),Ye=Math.tan(O.rightDegrees*Math.PI/180),Je=2/(Be+Ye),dt=2/(_e+ke);return u[0]=Je,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=dt,u[6]=0,u[7]=0,u[8]=-((Be-Ye)*Je*.5),u[9]=(_e-ke)*dt*.5,u[10]=ye/(ue-ye),u[11]=-1,u[12]=0,u[13]=0,u[14]=ye*ue/(ue-ye),u[15]=0,u}function st(u,O,ue,ye,_e,ke,Be){var Ye=1/(O-ue),Je=1/(ye-_e),dt=1/(ke-Be);return u[0]=-2*Ye,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=-2*Je,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=2*dt,u[11]=0,u[12]=(O+ue)*Ye,u[13]=(_e+ye)*Je,u[14]=(Be+ke)*dt,u[15]=1,u}var Pt=st;function $t(u,O,ue,ye,_e,ke,Be){var Ye=1/(O-ue),Je=1/(ye-_e),dt=1/(ke-Be);return u[0]=-2*Ye,u[1]=0,u[2]=0,u[3]=0,u[4]=0,u[5]=-2*Je,u[6]=0,u[7]=0,u[8]=0,u[9]=0,u[10]=dt,u[11]=0,u[12]=(O+ue)*Ye,u[13]=(_e+ye)*Je,u[14]=ke*dt,u[15]=1,u}function Ht(u,O,ue,ye){var _e,ke,Be,Ye,Je,dt,It,ir,cr,nr,Or=O[0],Cr=O[1],hr=O[2],rn=ye[0],Jn=ye[1],qn=ye[2],Un=ue[0],Mn=ue[1],Cn=ue[2];return Math.abs(Or-Un)<y.EPSILON&&Math.abs(Cr-Mn)<y.EPSILON&&Math.abs(hr-Cn)<y.EPSILON?gn(u):(It=Or-Un,ir=Cr-Mn,cr=hr-Cn,nr=1/Math.hypot(It,ir,cr),It*=nr,ir*=nr,cr*=nr,_e=Jn*cr-qn*ir,ke=qn*It-rn*cr,Be=rn*ir-Jn*It,nr=Math.hypot(_e,ke,Be),nr?(nr=1/nr,_e*=nr,ke*=nr,Be*=nr):(_e=0,ke=0,Be=0),Ye=ir*Be-cr*ke,Je=cr*_e-It*Be,dt=It*ke-ir*_e,nr=Math.hypot(Ye,Je,dt),nr?(nr=1/nr,Ye*=nr,Je*=nr,dt*=nr):(Ye=0,Je=0,dt=0),u[0]=_e,u[1]=Ye,u[2]=It,u[3]=0,u[4]=ke,u[5]=Je,u[6]=ir,u[7]=0,u[8]=Be,u[9]=dt,u[10]=cr,u[11]=0,u[12]=-(_e*Or+ke*Cr+Be*hr),u[13]=-(Ye*Or+Je*Cr+dt*hr),u[14]=-(It*Or+ir*Cr+cr*hr),u[15]=1,u)}function Br(u,O,ue,ye){var _e=O[0],ke=O[1],Be=O[2],Ye=ye[0],Je=ye[1],dt=ye[2],It=_e-ue[0],ir=ke-ue[1],cr=Be-ue[2],nr=It*It+ir*ir+cr*cr;nr>0&&(nr=1/Math.sqrt(nr),It*=nr,ir*=nr,cr*=nr);var Or=Je*cr-dt*ir,Cr=dt*It-Ye*cr,hr=Ye*ir-Je*It;return nr=Or*Or+Cr*Cr+hr*hr,nr>0&&(nr=1/Math.sqrt(nr),Or*=nr,Cr*=nr,hr*=nr),u[0]=Or,u[1]=Cr,u[2]=hr,u[3]=0,u[4]=ir*hr-cr*Cr,u[5]=cr*Or-It*hr,u[6]=It*Cr-ir*Or,u[7]=0,u[8]=It,u[9]=ir,u[10]=cr,u[11]=0,u[12]=_e,u[13]=ke,u[14]=Be,u[15]=1,u}function hn(u){return"mat4("+u[0]+", "+u[1]+", "+u[2]+", "+u[3]+", "+u[4]+", "+u[5]+", "+u[6]+", "+u[7]+", "+u[8]+", "+u[9]+", "+u[10]+", "+u[11]+", "+u[12]+", "+u[13]+", "+u[14]+", "+u[15]+")"}function Ot(u){return Math.hypot(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],u[8],u[9],u[10],u[11],u[12],u[13],u[14],u[15])}function Qt(u,O,ue){return u[0]=O[0]+ue[0],u[1]=O[1]+ue[1],u[2]=O[2]+ue[2],u[3]=O[3]+ue[3],u[4]=O[4]+ue[4],u[5]=O[5]+ue[5],u[6]=O[6]+ue[6],u[7]=O[7]+ue[7],u[8]=O[8]+ue[8],u[9]=O[9]+ue[9],u[10]=O[10]+ue[10],u[11]=O[11]+ue[11],u[12]=O[12]+ue[12],u[13]=O[13]+ue[13],u[14]=O[14]+ue[14],u[15]=O[15]+ue[15],u}function pr(u,O,ue){return u[0]=O[0]-ue[0],u[1]=O[1]-ue[1],u[2]=O[2]-ue[2],u[3]=O[3]-ue[3],u[4]=O[4]-ue[4],u[5]=O[5]-ue[5],u[6]=O[6]-ue[6],u[7]=O[7]-ue[7],u[8]=O[8]-ue[8],u[9]=O[9]-ue[9],u[10]=O[10]-ue[10],u[11]=O[11]-ue[11],u[12]=O[12]-ue[12],u[13]=O[13]-ue[13],u[14]=O[14]-ue[14],u[15]=O[15]-ue[15],u}function en(u,O,ue){return u[0]=O[0]*ue,u[1]=O[1]*ue,u[2]=O[2]*ue,u[3]=O[3]*ue,u[4]=O[4]*ue,u[5]=O[5]*ue,u[6]=O[6]*ue,u[7]=O[7]*ue,u[8]=O[8]*ue,u[9]=O[9]*ue,u[10]=O[10]*ue,u[11]=O[11]*ue,u[12]=O[12]*ue,u[13]=O[13]*ue,u[14]=O[14]*ue,u[15]=O[15]*ue,u}function Nr(u,O,ue,ye){return u[0]=O[0]+ue[0]*ye,u[1]=O[1]+ue[1]*ye,u[2]=O[2]+ue[2]*ye,u[3]=O[3]+ue[3]*ye,u[4]=O[4]+ue[4]*ye,u[5]=O[5]+ue[5]*ye,u[6]=O[6]+ue[6]*ye,u[7]=O[7]+ue[7]*ye,u[8]=O[8]+ue[8]*ye,u[9]=O[9]+ue[9]*ye,u[10]=O[10]+ue[10]*ye,u[11]=O[11]+ue[11]*ye,u[12]=O[12]+ue[12]*ye,u[13]=O[13]+ue[13]*ye,u[14]=O[14]+ue[14]*ye,u[15]=O[15]+ue[15]*ye,u}function ta(u,O){return u[0]===O[0]&&u[1]===O[1]&&u[2]===O[2]&&u[3]===O[3]&&u[4]===O[4]&&u[5]===O[5]&&u[6]===O[6]&&u[7]===O[7]&&u[8]===O[8]&&u[9]===O[9]&&u[10]===O[10]&&u[11]===O[11]&&u[12]===O[12]&&u[13]===O[13]&&u[14]===O[14]&&u[15]===O[15]}function kn(u,O){var ue=u[0],ye=u[1],_e=u[2],ke=u[3],Be=u[4],Ye=u[5],Je=u[6],dt=u[7],It=u[8],ir=u[9],cr=u[10],nr=u[11],Or=u[12],Cr=u[13],hr=u[14],rn=u[15],Jn=O[0],qn=O[1],Un=O[2],Mn=O[3],Cn=O[4],Ga=O[5],ei=O[6],Ka=O[7],$a=O[8],Ha=O[9],fi=O[10],bi=O[11],ha=O[12],Oa=O[13],Jo=O[14],Wo=O[15];return Math.abs(ue-Jn)<=y.EPSILON*Math.max(1,Math.abs(ue),Math.abs(Jn))&&Math.abs(ye-qn)<=y.EPSILON*Math.max(1,Math.abs(ye),Math.abs(qn))&&Math.abs(_e-Un)<=y.EPSILON*Math.max(1,Math.abs(_e),Math.abs(Un))&&Math.abs(ke-Mn)<=y.EPSILON*Math.max(1,Math.abs(ke),Math.abs(Mn))&&Math.abs(Be-Cn)<=y.EPSILON*Math.max(1,Math.abs(Be),Math.abs(Cn))&&Math.abs(Ye-Ga)<=y.EPSILON*Math.max(1,Math.abs(Ye),Math.abs(Ga))&&Math.abs(Je-ei)<=y.EPSILON*Math.max(1,Math.abs(Je),Math.abs(ei))&&Math.abs(dt-Ka)<=y.EPSILON*Math.max(1,Math.abs(dt),Math.abs(Ka))&&Math.abs(It-$a)<=y.EPSILON*Math.max(1,Math.abs(It),Math.abs($a))&&Math.abs(ir-Ha)<=y.EPSILON*Math.max(1,Math.abs(ir),Math.abs(Ha))&&Math.abs(cr-fi)<=y.EPSILON*Math.max(1,Math.abs(cr),Math.abs(fi))&&Math.abs(nr-bi)<=y.EPSILON*Math.max(1,Math.abs(nr),Math.abs(bi))&&Math.abs(Or-ha)<=y.EPSILON*Math.max(1,Math.abs(Or),Math.abs(ha))&&Math.abs(Cr-Oa)<=y.EPSILON*Math.max(1,Math.abs(Cr),Math.abs(Oa))&&Math.abs(hr-Jo)<=y.EPSILON*Math.max(1,Math.abs(hr),Math.abs(Jo))&&Math.abs(rn-Wo)<=y.EPSILON*Math.max(1,Math.abs(rn),Math.abs(Wo))}var En=Dr,Rn=pr,Yn=z(77160);function bn(){var u=new y.ARRAY_TYPE(4);return y.ARRAY_TYPE!=Float32Array&&(u[0]=0,u[1]=0,u[2]=0,u[3]=0),u}function je(u){var O=new y.ARRAY_TYPE(4);return O[0]=u[0],O[1]=u[1],O[2]=u[2],O[3]=u[3],O}function Ce(u,O,ue,ye){var _e=new y.ARRAY_TYPE(4);return _e[0]=u,_e[1]=O,_e[2]=ue,_e[3]=ye,_e}function Xe(u,O){return u[0]=O[0],u[1]=O[1],u[2]=O[2],u[3]=O[3],u}function ut(u,O,ue,ye,_e){return u[0]=O,u[1]=ue,u[2]=ye,u[3]=_e,u}function ot(u,O,ue){return u[0]=O[0]+ue[0],u[1]=O[1]+ue[1],u[2]=O[2]+ue[2],u[3]=O[3]+ue[3],u}function bt(u,O,ue){return u[0]=O[0]-ue[0],u[1]=O[1]-ue[1],u[2]=O[2]-ue[2],u[3]=O[3]-ue[3],u}function Xt(u,O,ue){return u[0]=O[0]*ue[0],u[1]=O[1]*ue[1],u[2]=O[2]*ue[2],u[3]=O[3]*ue[3],u}function wr(u,O,ue){return u[0]=O[0]/ue[0],u[1]=O[1]/ue[1],u[2]=O[2]/ue[2],u[3]=O[3]/ue[3],u}function Wr(u,O){return u[0]=Math.ceil(O[0]),u[1]=Math.ceil(O[1]),u[2]=Math.ceil(O[2]),u[3]=Math.ceil(O[3]),u}function on(u,O){return u[0]=Math.floor(O[0]),u[1]=Math.floor(O[1]),u[2]=Math.floor(O[2]),u[3]=Math.floor(O[3]),u}function xn(u,O,ue){return u[0]=Math.min(O[0],ue[0]),u[1]=Math.min(O[1],ue[1]),u[2]=Math.min(O[2],ue[2]),u[3]=Math.min(O[3],ue[3]),u}function zn(u,O,ue){return u[0]=Math.max(O[0],ue[0]),u[1]=Math.max(O[1],ue[1]),u[2]=Math.max(O[2],ue[2]),u[3]=Math.max(O[3],ue[3]),u}function Qn(u,O){return u[0]=Math.round(O[0]),u[1]=Math.round(O[1]),u[2]=Math.round(O[2]),u[3]=Math.round(O[3]),u}function ia(u,O,ue){return u[0]=O[0]*ue,u[1]=O[1]*ue,u[2]=O[2]*ue,u[3]=O[3]*ue,u}function Wa(u,O,ue,ye){return u[0]=O[0]+ue[0]*ye,u[1]=O[1]+ue[1]*ye,u[2]=O[2]+ue[2]*ye,u[3]=O[3]+ue[3]*ye,u}function Ia(u,O){var ue=O[0]-u[0],ye=O[1]-u[1],_e=O[2]-u[2],ke=O[3]-u[3];return Math.hypot(ue,ye,_e,ke)}function Ba(u,O){var ue=O[0]-u[0],ye=O[1]-u[1],_e=O[2]-u[2],ke=O[3]-u[3];return ue*ue+ye*ye+_e*_e+ke*ke}function Ea(u){var O=u[0],ue=u[1],ye=u[2],_e=u[3];return Math.hypot(O,ue,ye,_e)}function qa(u){var O=u[0],ue=u[1],ye=u[2],_e=u[3];return O*O+ue*ue+ye*ye+_e*_e}function si(u,O){return u[0]=-O[0],u[1]=-O[1],u[2]=-O[2],u[3]=-O[3],u}function _a(u,O){return u[0]=1/O[0],u[1]=1/O[1],u[2]=1/O[2],u[3]=1/O[3],u}function So(u,O){var ue=O[0],ye=O[1],_e=O[2],ke=O[3],Be=ue*ue+ye*ye+_e*_e+ke*ke;return Be>0&&(Be=1/Math.sqrt(Be)),u[0]=ue*Be,u[1]=ye*Be,u[2]=_e*Be,u[3]=ke*Be,u}function to(u,O){return u[0]*O[0]+u[1]*O[1]+u[2]*O[2]+u[3]*O[3]}function co(u,O,ue,ye){var _e=ue[0]*ye[1]-ue[1]*ye[0],ke=ue[0]*ye[2]-ue[2]*ye[0],Be=ue[0]*ye[3]-ue[3]*ye[0],Ye=ue[1]*ye[2]-ue[2]*ye[1],Je=ue[1]*ye[3]-ue[3]*ye[1],dt=ue[2]*ye[3]-ue[3]*ye[2],It=O[0],ir=O[1],cr=O[2],nr=O[3];return u[0]=ir*dt-cr*Je+nr*Ye,u[1]=-(It*dt)+cr*Be-nr*ke,u[2]=It*Je-ir*Be+nr*_e,u[3]=-(It*Ye)+ir*ke-cr*_e,u}function ni(u,O,ue,ye){var _e=O[0],ke=O[1],Be=O[2],Ye=O[3];return u[0]=_e+ye*(ue[0]-_e),u[1]=ke+ye*(ue[1]-ke),u[2]=Be+ye*(ue[2]-Be),u[3]=Ye+ye*(ue[3]-Ye),u}function lo(u,O){O=O||1;var ue,ye,_e,ke,Be,Ye;do ue=y.RANDOM()*2-1,ye=y.RANDOM()*2-1,Be=ue*ue+ye*ye;while(Be>=1);do _e=y.RANDOM()*2-1,ke=y.RANDOM()*2-1,Ye=_e*_e+ke*ke;while(Ye>=1);var Je=Math.sqrt((1-Be)/Ye);return u[0]=O*ue,u[1]=O*ye,u[2]=O*_e*Je,u[3]=O*ke*Je,u}function Ss(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3];return u[0]=ue[0]*ye+ue[4]*_e+ue[8]*ke+ue[12]*Be,u[1]=ue[1]*ye+ue[5]*_e+ue[9]*ke+ue[13]*Be,u[2]=ue[2]*ye+ue[6]*_e+ue[10]*ke+ue[14]*Be,u[3]=ue[3]*ye+ue[7]*_e+ue[11]*ke+ue[15]*Be,u}function Ro(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=ue[0],Ye=ue[1],Je=ue[2],dt=ue[3],It=dt*ye+Ye*ke-Je*_e,ir=dt*_e+Je*ye-Be*ke,cr=dt*ke+Be*_e-Ye*ye,nr=-Be*ye-Ye*_e-Je*ke;return u[0]=It*dt+nr*-Be+ir*-Je-cr*-Ye,u[1]=ir*dt+nr*-Ye+cr*-Be-It*-Je,u[2]=cr*dt+nr*-Je+It*-Ye-ir*-Be,u[3]=O[3],u}function mi(u){return u[0]=0,u[1]=0,u[2]=0,u[3]=0,u}function ya(u){return"vec4("+u[0]+", "+u[1]+", "+u[2]+", "+u[3]+")"}function _o(u,O){return u[0]===O[0]&&u[1]===O[1]&&u[2]===O[2]&&u[3]===O[3]}function Yi(u,O){var ue=u[0],ye=u[1],_e=u[2],ke=u[3],Be=O[0],Ye=O[1],Je=O[2],dt=O[3];return Math.abs(ue-Be)<=y.EPSILON*Math.max(1,Math.abs(ue),Math.abs(Be))&&Math.abs(ye-Ye)<=y.EPSILON*Math.max(1,Math.abs(ye),Math.abs(Ye))&&Math.abs(_e-Je)<=y.EPSILON*Math.max(1,Math.abs(_e),Math.abs(Je))&&Math.abs(ke-dt)<=y.EPSILON*Math.max(1,Math.abs(ke),Math.abs(dt))}var Fi=bt,Bo=Xt,_s=wr,Oo=Ia,Hi=Ba,_n=Ea,Fo=qa,Go=function(){var u=bn();return function(O,ue,ye,_e,ke,Be){var Ye,Je;for(ue||(ue=4),ye||(ye=0),_e?Je=Math.min(_e*ue+ye,O.length):Je=O.length,Ye=ye;Ye<Je;Ye+=ue)u[0]=O[Ye],u[1]=O[Ye+1],u[2]=O[Ye+2],u[3]=O[Ye+3],ke(u,u,Be),O[Ye]=u[0],O[Ye+1]=u[1],O[Ye+2]=u[2],O[Ye+3]=u[3];return O}}();function Va(){var u=new y.ARRAY_TYPE(4);return y.ARRAY_TYPE!=Float32Array&&(u[0]=0,u[1]=0,u[2]=0),u[3]=1,u}function Ms(u){return u[0]=0,u[1]=0,u[2]=0,u[3]=1,u}function Ko(u,O,ue){ue=ue*.5;var ye=Math.sin(ue);return u[0]=ye*O[0],u[1]=ye*O[1],u[2]=ye*O[2],u[3]=Math.cos(ue),u}function Li(u,O){var ue=Math.acos(O[3])*2,ye=Math.sin(ue/2);return ye>y.EPSILON?(u[0]=O[0]/ye,u[1]=O[1]/ye,u[2]=O[2]/ye):(u[0]=1,u[1]=0,u[2]=0),ue}function Mo(u,O){var ue=Ya(u,O);return Math.acos(2*ue*ue-1)}function ho(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=ue[0],Je=ue[1],dt=ue[2],It=ue[3];return u[0]=ye*It+Be*Ye+_e*dt-ke*Je,u[1]=_e*It+Be*Je+ke*Ye-ye*dt,u[2]=ke*It+Be*dt+ye*Je-_e*Ye,u[3]=Be*It-ye*Ye-_e*Je-ke*dt,u}function Gi(u,O,ue){ue*=.5;var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=Math.sin(ue),Je=Math.cos(ue);return u[0]=ye*Je+Be*Ye,u[1]=_e*Je+ke*Ye,u[2]=ke*Je-_e*Ye,u[3]=Be*Je-ye*Ye,u}function Di(u,O,ue){ue*=.5;var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=Math.sin(ue),Je=Math.cos(ue);return u[0]=ye*Je-ke*Ye,u[1]=_e*Je+Be*Ye,u[2]=ke*Je+ye*Ye,u[3]=Be*Je-_e*Ye,u}function $o(u,O,ue){ue*=.5;var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=Math.sin(ue),Je=Math.cos(ue);return u[0]=ye*Je+_e*Ye,u[1]=_e*Je-ye*Ye,u[2]=ke*Je+Be*Ye,u[3]=Be*Je-ke*Ye,u}function Ni(u,O){var ue=O[0],ye=O[1],_e=O[2];return u[0]=ue,u[1]=ye,u[2]=_e,u[3]=Math.sqrt(Math.abs(1-ue*ue-ye*ye-_e*_e)),u}function ro(u,O){var ue=O[0],ye=O[1],_e=O[2],ke=O[3],Be=Math.sqrt(ue*ue+ye*ye+_e*_e),Ye=Math.exp(ke),Je=Be>0?Ye*Math.sin(Be)/Be:0;return u[0]=ue*Je,u[1]=ye*Je,u[2]=_e*Je,u[3]=Ye*Math.cos(Be),u}function Qo(u,O){var ue=O[0],ye=O[1],_e=O[2],ke=O[3],Be=Math.sqrt(ue*ue+ye*ye+_e*_e),Ye=Be>0?Math.atan2(Be,ke)/Be:0;return u[0]=ue*Ye,u[1]=ye*Ye,u[2]=_e*Ye,u[3]=.5*Math.log(ue*ue+ye*ye+_e*_e+ke*ke),u}function ns(u,O,ue){return Qo(u,O),Fa(u,u,ue),ro(u,u),u}function zi(u,O,ue,ye){var _e=O[0],ke=O[1],Be=O[2],Ye=O[3],Je=ue[0],dt=ue[1],It=ue[2],ir=ue[3],cr,nr,Or,Cr,hr;return nr=_e*Je+ke*dt+Be*It+Ye*ir,nr<0&&(nr=-nr,Je=-Je,dt=-dt,It=-It,ir=-ir),1-nr>y.EPSILON?(cr=Math.acos(nr),Or=Math.sin(cr),Cr=Math.sin((1-ye)*cr)/Or,hr=Math.sin(ye*cr)/Or):(Cr=1-ye,hr=ye),u[0]=Cr*_e+hr*Je,u[1]=Cr*ke+hr*dt,u[2]=Cr*Be+hr*It,u[3]=Cr*Ye+hr*ir,u}function ga(u){var O=y.RANDOM(),ue=y.RANDOM(),ye=y.RANDOM(),_e=Math.sqrt(1-O),ke=Math.sqrt(O);return u[0]=_e*Math.sin(2*Math.PI*ue),u[1]=_e*Math.cos(2*Math.PI*ue),u[2]=ke*Math.sin(2*Math.PI*ye),u[3]=ke*Math.cos(2*Math.PI*ye),u}function vo(u,O){var ue=O[0],ye=O[1],_e=O[2],ke=O[3],Be=ue*ue+ye*ye+_e*_e+ke*ke,Ye=Be?1/Be:0;return u[0]=-ue*Ye,u[1]=-ye*Ye,u[2]=-_e*Ye,u[3]=ke*Ye,u}function Vs(u,O){return u[0]=-O[0],u[1]=-O[1],u[2]=-O[2],u[3]=O[3],u}function Pi(u,O){var ue=O[0]+O[4]+O[8],ye;if(ue>0)ye=Math.sqrt(ue+1),u[3]=.5*ye,ye=.5/ye,u[0]=(O[5]-O[7])*ye,u[1]=(O[6]-O[2])*ye,u[2]=(O[1]-O[3])*ye;else{var _e=0;O[4]>O[0]&&(_e=1),O[8]>O[_e*3+_e]&&(_e=2);var ke=(_e+1)%3,Be=(_e+2)%3;ye=Math.sqrt(O[_e*3+_e]-O[ke*3+ke]-O[Be*3+Be]+1),u[_e]=.5*ye,ye=.5/ye,u[3]=(O[ke*3+Be]-O[Be*3+ke])*ye,u[ke]=(O[ke*3+_e]+O[_e*3+ke])*ye,u[Be]=(O[Be*3+_e]+O[_e*3+Be])*ye}return u}function Ao(u,O,ue,ye){var _e=.5*Math.PI/180;O*=_e,ue*=_e,ye*=_e;var ke=Math.sin(O),Be=Math.cos(O),Ye=Math.sin(ue),Je=Math.cos(ue),dt=Math.sin(ye),It=Math.cos(ye);return u[0]=ke*Je*It-Be*Ye*dt,u[1]=Be*Ye*It+ke*Je*dt,u[2]=Be*Je*dt-ke*Ye*It,u[3]=Be*Je*It+ke*Ye*dt,u}function as(u){return"quat("+u[0]+", "+u[1]+", "+u[2]+", "+u[3]+")"}var vi=je,Zi=Ce,_i=Xe,no=ut,Ui=ot,da=ho,Fa=ia,Ya=to,Ii=ni,Wi=Ea,ao=Wi,go=qa,po=go,yo=So,ji=_o,ka=Yi,Ys=function(){var u=Yn.create(),O=Yn.fromValues(1,0,0),ue=Yn.fromValues(0,1,0);return function(ye,_e,ke){var Be=Yn.dot(_e,ke);return Be<-.999999?(Yn.cross(u,O,_e),Yn.len(u)<1e-6&&Yn.cross(u,ue,_e),Yn.normalize(u,u),Ko(ye,u,Math.PI),ye):Be>.999999?(ye[0]=0,ye[1]=0,ye[2]=0,ye[3]=1,ye):(Yn.cross(u,_e,ke),ye[0]=u[0],ye[1]=u[1],ye[2]=u[2],ye[3]=1+Be,yo(ye,ye))}}(),_f=function(){var u=Va(),O=Va();return function(ue,ye,_e,ke,Be,Ye){return zi(u,ye,Be,Ye),zi(O,_e,ke,Ye),zi(ue,u,O,2*Ye*(1-Ye)),ue}}(),mo=function(){var u=qr.create();return function(O,ue,ye,_e){return u[0]=ye[0],u[3]=ye[1],u[6]=ye[2],u[1]=_e[0],u[4]=_e[1],u[7]=_e[2],u[2]=-ue[0],u[5]=-ue[1],u[8]=-ue[2],yo(O,Pi(O,u))}}();function lu(){var u=new y.ARRAY_TYPE(8);return y.ARRAY_TYPE!=Float32Array&&(u[0]=0,u[1]=0,u[2]=0,u[4]=0,u[5]=0,u[6]=0,u[7]=0),u[3]=1,u}function na(u){var O=new y.ARRAY_TYPE(8);return O[0]=u[0],O[1]=u[1],O[2]=u[2],O[3]=u[3],O[4]=u[4],O[5]=u[5],O[6]=u[6],O[7]=u[7],O}function an(u,O,ue,ye,_e,ke,Be,Ye){var Je=new y.ARRAY_TYPE(8);return Je[0]=u,Je[1]=O,Je[2]=ue,Je[3]=ye,Je[4]=_e,Je[5]=ke,Je[6]=Be,Je[7]=Ye,Je}function Hs(u,O,ue,ye,_e,ke,Be){var Ye=new y.ARRAY_TYPE(8);Ye[0]=u,Ye[1]=O,Ye[2]=ue,Ye[3]=ye;var Je=_e*.5,dt=ke*.5,It=Be*.5;return Ye[4]=Je*ye+dt*ue-It*O,Ye[5]=dt*ye+It*u-Je*ue,Ye[6]=It*ye+Je*O-dt*u,Ye[7]=-Je*u-dt*O-It*ue,Ye}function Xi(u,O,ue){var ye=ue[0]*.5,_e=ue[1]*.5,ke=ue[2]*.5,Be=O[0],Ye=O[1],Je=O[2],dt=O[3];return u[0]=Be,u[1]=Ye,u[2]=Je,u[3]=dt,u[4]=ye*dt+_e*Je-ke*Ye,u[5]=_e*dt+ke*Be-ye*Je,u[6]=ke*dt+ye*Ye-_e*Be,u[7]=-ye*Be-_e*Ye-ke*Je,u}function zo(u,O){return u[0]=0,u[1]=0,u[2]=0,u[3]=1,u[4]=O[0]*.5,u[5]=O[1]*.5,u[6]=O[2]*.5,u[7]=0,u}function is(u,O){return u[0]=O[0],u[1]=O[1],u[2]=O[2],u[3]=O[3],u[4]=0,u[5]=0,u[6]=0,u[7]=0,u}function ui(u,O){var ue=Va();P(ue,O);var ye=new y.ARRAY_TYPE(3);return ne(ye,O),Xi(u,ue,ye),u}function ai(u,O){return u[0]=O[0],u[1]=O[1],u[2]=O[2],u[3]=O[3],u[4]=O[4],u[5]=O[5],u[6]=O[6],u[7]=O[7],u}function Eo(u){return u[0]=0,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=0,u[7]=0,u}function Yu(u,O,ue,ye,_e,ke,Be,Ye,Je){return u[0]=O,u[1]=ue,u[2]=ye,u[3]=_e,u[4]=ke,u[5]=Be,u[6]=Ye,u[7]=Je,u}var Hu=_i;function du(u,O){return u[0]=O[4],u[1]=O[5],u[2]=O[6],u[3]=O[7],u}var hu=_i;function Ei(u,O){return u[4]=O[0],u[5]=O[1],u[6]=O[2],u[7]=O[3],u}function Ki(u,O){var ue=O[4],ye=O[5],_e=O[6],ke=O[7],Be=-O[0],Ye=-O[1],Je=-O[2],dt=O[3];return u[0]=(ue*dt+ke*Be+ye*Je-_e*Ye)*2,u[1]=(ye*dt+ke*Ye+_e*Be-ue*Je)*2,u[2]=(_e*dt+ke*Je+ue*Ye-ye*Be)*2,u}function Zs(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=ue[0]*.5,Je=ue[1]*.5,dt=ue[2]*.5,It=O[4],ir=O[5],cr=O[6],nr=O[7];return u[0]=ye,u[1]=_e,u[2]=ke,u[3]=Be,u[4]=Be*Ye+_e*dt-ke*Je+It,u[5]=Be*Je+ke*Ye-ye*dt+ir,u[6]=Be*dt+ye*Je-_e*Ye+cr,u[7]=-ye*Ye-_e*Je-ke*dt+nr,u}function Ks(u,O,ue){var ye=-O[0],_e=-O[1],ke=-O[2],Be=O[3],Ye=O[4],Je=O[5],dt=O[6],It=O[7],ir=Ye*Be+It*ye+Je*ke-dt*_e,cr=Je*Be+It*_e+dt*ye-Ye*ke,nr=dt*Be+It*ke+Ye*_e-Je*ye,Or=It*Be-Ye*ye-Je*_e-dt*ke;return Gi(u,O,ue),ye=u[0],_e=u[1],ke=u[2],Be=u[3],u[4]=ir*Be+Or*ye+cr*ke-nr*_e,u[5]=cr*Be+Or*_e+nr*ye-ir*ke,u[6]=nr*Be+Or*ke+ir*_e-cr*ye,u[7]=Or*Be-ir*ye-cr*_e-nr*ke,u}function io(u,O,ue){var ye=-O[0],_e=-O[1],ke=-O[2],Be=O[3],Ye=O[4],Je=O[5],dt=O[6],It=O[7],ir=Ye*Be+It*ye+Je*ke-dt*_e,cr=Je*Be+It*_e+dt*ye-Ye*ke,nr=dt*Be+It*ke+Ye*_e-Je*ye,Or=It*Be-Ye*ye-Je*_e-dt*ke;return Di(u,O,ue),ye=u[0],_e=u[1],ke=u[2],Be=u[3],u[4]=ir*Be+Or*ye+cr*ke-nr*_e,u[5]=cr*Be+Or*_e+nr*ye-ir*ke,u[6]=nr*Be+Or*ke+ir*_e-cr*ye,u[7]=Or*Be-ir*ye-cr*_e-nr*ke,u}function os(u,O,ue){var ye=-O[0],_e=-O[1],ke=-O[2],Be=O[3],Ye=O[4],Je=O[5],dt=O[6],It=O[7],ir=Ye*Be+It*ye+Je*ke-dt*_e,cr=Je*Be+It*_e+dt*ye-Ye*ke,nr=dt*Be+It*ke+Ye*_e-Je*ye,Or=It*Be-Ye*ye-Je*_e-dt*ke;return $o(u,O,ue),ye=u[0],_e=u[1],ke=u[2],Be=u[3],u[4]=ir*Be+Or*ye+cr*ke-nr*_e,u[5]=cr*Be+Or*_e+nr*ye-ir*ke,u[6]=nr*Be+Or*ke+ir*_e-cr*ye,u[7]=Or*Be-ir*ye-cr*_e-nr*ke,u}function ss(u,O,ue){var ye=ue[0],_e=ue[1],ke=ue[2],Be=ue[3],Ye=O[0],Je=O[1],dt=O[2],It=O[3];return u[0]=Ye*Be+It*ye+Je*ke-dt*_e,u[1]=Je*Be+It*_e+dt*ye-Ye*ke,u[2]=dt*Be+It*ke+Ye*_e-Je*ye,u[3]=It*Be-Ye*ye-Je*_e-dt*ke,Ye=O[4],Je=O[5],dt=O[6],It=O[7],u[4]=Ye*Be+It*ye+Je*ke-dt*_e,u[5]=Je*Be+It*_e+dt*ye-Ye*ke,u[6]=dt*Be+It*ke+Ye*_e-Je*ye,u[7]=It*Be-Ye*ye-Je*_e-dt*ke,u}function us(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=ue[0],Je=ue[1],dt=ue[2],It=ue[3];return u[0]=ye*It+Be*Ye+_e*dt-ke*Je,u[1]=_e*It+Be*Je+ke*Ye-ye*dt,u[2]=ke*It+Be*dt+ye*Je-_e*Ye,u[3]=Be*It-ye*Ye-_e*Je-ke*dt,Ye=ue[4],Je=ue[5],dt=ue[6],It=ue[7],u[4]=ye*It+Be*Ye+_e*dt-ke*Je,u[5]=_e*It+Be*Je+ke*Ye-ye*dt,u[6]=ke*It+Be*dt+ye*Je-_e*Ye,u[7]=Be*It-ye*Ye-_e*Je-ke*dt,u}function $s(u,O,ue,ye){if(Math.abs(ye)<y.EPSILON)return ai(u,O);var _e=Math.hypot(ue[0],ue[1],ue[2]);ye=ye*.5;var ke=Math.sin(ye),Be=ke*ue[0]/_e,Ye=ke*ue[1]/_e,Je=ke*ue[2]/_e,dt=Math.cos(ye),It=O[0],ir=O[1],cr=O[2],nr=O[3];u[0]=It*dt+nr*Be+ir*Je-cr*Ye,u[1]=ir*dt+nr*Ye+cr*Be-It*Je,u[2]=cr*dt+nr*Je+It*Ye-ir*Be,u[3]=nr*dt-It*Be-ir*Ye-cr*Je;var Or=O[4],Cr=O[5],hr=O[6],rn=O[7];return u[4]=Or*dt+rn*Be+Cr*Je-hr*Ye,u[5]=Cr*dt+rn*Ye+hr*Be-Or*Je,u[6]=hr*dt+rn*Je+Or*Ye-Cr*Be,u[7]=rn*dt-Or*Be-Cr*Ye-hr*Je,u}function Uo(u,O,ue){return u[0]=O[0]+ue[0],u[1]=O[1]+ue[1],u[2]=O[2]+ue[2],u[3]=O[3]+ue[3],u[4]=O[4]+ue[4],u[5]=O[5]+ue[5],u[6]=O[6]+ue[6],u[7]=O[7]+ue[7],u}function bo(u,O,ue){var ye=O[0],_e=O[1],ke=O[2],Be=O[3],Ye=ue[4],Je=ue[5],dt=ue[6],It=ue[7],ir=O[4],cr=O[5],nr=O[6],Or=O[7],Cr=ue[0],hr=ue[1],rn=ue[2],Jn=ue[3];return u[0]=ye*Jn+Be*Cr+_e*rn-ke*hr,u[1]=_e*Jn+Be*hr+ke*Cr-ye*rn,u[2]=ke*Jn+Be*rn+ye*hr-_e*Cr,u[3]=Be*Jn-ye*Cr-_e*hr-ke*rn,u[4]=ye*It+Be*Ye+_e*dt-ke*Je+ir*Jn+Or*Cr+cr*rn-nr*hr,u[5]=_e*It+Be*Je+ke*Ye-ye*dt+cr*Jn+Or*hr+nr*Cr-ir*rn,u[6]=ke*It+Be*dt+ye*Je-_e*Ye+nr*Jn+Or*rn+ir*hr-cr*Cr,u[7]=Be*It-ye*Ye-_e*Je-ke*dt+Or*Jn-ir*Cr-cr*hr-nr*rn,u}var fs=bo;function Zu(u,O,ue){return u[0]=O[0]*ue,u[1]=O[1]*ue,u[2]=O[2]*ue,u[3]=O[3]*ue,u[4]=O[4]*ue,u[5]=O[5]*ue,u[6]=O[6]*ue,u[7]=O[7]*ue,u}var vu=Ya;function gu(u,O,ue,ye){var _e=1-ye;return vu(O,ue)<0&&(ye=-ye),u[0]=O[0]*_e+ue[0]*ye,u[1]=O[1]*_e+ue[1]*ye,u[2]=O[2]*_e+ue[2]*ye,u[3]=O[3]*_e+ue[3]*ye,u[4]=O[4]*_e+ue[4]*ye,u[5]=O[5]*_e+ue[5]*ye,u[6]=O[6]*_e+ue[6]*ye,u[7]=O[7]*_e+ue[7]*ye,u}function pu(u,O){var ue=cs(O);return u[0]=-O[0]/ue,u[1]=-O[1]/ue,u[2]=-O[2]/ue,u[3]=O[3]/ue,u[4]=-O[4]/ue,u[5]=-O[5]/ue,u[6]=-O[6]/ue,u[7]=O[7]/ue,u}function Ku(u,O){return u[0]=-O[0],u[1]=-O[1],u[2]=-O[2],u[3]=O[3],u[4]=-O[4],u[5]=-O[5],u[6]=-O[6],u[7]=O[7],u}var Co=Wi,Cs=Co,cs=go,$i=cs;function xo(u,O){var ue=cs(O);if(ue>0){ue=Math.sqrt(ue);var ye=O[0]/ue,_e=O[1]/ue,ke=O[2]/ue,Be=O[3]/ue,Ye=O[4],Je=O[5],dt=O[6],It=O[7],ir=ye*Ye+_e*Je+ke*dt+Be*It;u[0]=ye,u[1]=_e,u[2]=ke,u[3]=Be,u[4]=(Ye-ye*ir)/ue,u[5]=(Je-_e*ir)/ue,u[6]=(dt-ke*ir)/ue,u[7]=(It-Be*ir)/ue}return u}function $u(u){return"quat2("+u[0]+", "+u[1]+", "+u[2]+", "+u[3]+", "+u[4]+", "+u[5]+", "+u[6]+", "+u[7]+")"}function Mf(u,O){return u[0]===O[0]&&u[1]===O[1]&&u[2]===O[2]&&u[3]===O[3]&&u[4]===O[4]&&u[5]===O[5]&&u[6]===O[6]&&u[7]===O[7]}function Ts(u,O){var ue=u[0],ye=u[1],_e=u[2],ke=u[3],Be=u[4],Ye=u[5],Je=u[6],dt=u[7],It=O[0],ir=O[1],cr=O[2],nr=O[3],Or=O[4],Cr=O[5],hr=O[6],rn=O[7];return Math.abs(ue-It)<=y.EPSILON*Math.max(1,Math.abs(ue),Math.abs(It))&&Math.abs(ye-ir)<=y.EPSILON*Math.max(1,Math.abs(ye),Math.abs(ir))&&Math.abs(_e-cr)<=y.EPSILON*Math.max(1,Math.abs(_e),Math.abs(cr))&&Math.abs(ke-nr)<=y.EPSILON*Math.max(1,Math.abs(ke),Math.abs(nr))&&Math.abs(Be-Or)<=y.EPSILON*Math.max(1,Math.abs(Be),Math.abs(Or))&&Math.abs(Ye-Cr)<=y.EPSILON*Math.max(1,Math.abs(Ye),Math.abs(Cr))&&Math.abs(Je-hr)<=y.EPSILON*Math.max(1,Math.abs(Je),Math.abs(hr))&&Math.abs(dt-rn)<=y.EPSILON*Math.max(1,Math.abs(dt),Math.abs(rn))}var Cf=z(31437)},38186:function(or){var U=[],z=[],B="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function j(A,N){if(N=N||{},A===void 0)throw new Error(B);var L=N.prepend===!0?"prepend":"append",y=N.container!==void 0?N.container:document.querySelector("head"),x=U.indexOf(y);x===-1&&(x=U.push(y)-1,z[x]={});var v;return z[x]!==void 0&&z[x][L]!==void 0?v=z[x][L]:(v=z[x][L]=R(),L==="prepend"?y.insertBefore(v,y.childNodes[0]):y.appendChild(v)),A.charCodeAt(0)===65279&&(A=A.substr(1,A.length)),v.styleSheet?v.styleSheet.cssText+=A:v.textContent+=A,v}function R(){var A=document.createElement("style");return A.setAttribute("type","text/css"),A}or.exports=j,or.exports.insertCss=j},81763:function(or,U,z){var B=z(44239),j=z(37005),R="[object Number]";function A(N){return typeof N=="number"||j(N)&&B(N)==R}or.exports=A},51496:function(or,U,z){"use strict";z.d(U,{x0:function(){return A}});let B=N=>crypto.getRandomValues(new Uint8Array(N)),j=(N,L,y)=>{let x=(2<<Math.log(N.length-1)/Math.LN2)-1,v=-~(1.6*x*L/N.length);return(g=L)=>{let d="";for(;;){let _=y(v),E=v;for(;E--;)if(d+=N[_[E]&x]||"",d.length===g)return d}}},R=(N,L=21)=>j(N,L,B),A=(N=21)=>crypto.getRandomValues(new Uint8Array(N)).reduce((L,y)=>(y&=63,y<36?L+=y.toString(36):y<62?L+=(y-26).toString(36).toUpperCase():y>62?L+="-":L+="_",L),"")},81550:function(or){(function(U,z){or.exports=z()})(this,function(){"use strict";var U=function(ve){return ve instanceof Uint8Array||ve instanceof Uint16Array||ve instanceof Uint32Array||ve instanceof Int8Array||ve instanceof Int16Array||ve instanceof Int32Array||ve instanceof Float32Array||ve instanceof Float64Array||ve instanceof Uint8ClampedArray},z=function(ve,We){for(var it=Object.keys(We),Zt=0;Zt<it.length;++Zt)ve[it[Zt]]=We[it[Zt]];return ve},B=`
  624. `;function j(ve){return typeof atob!="undefined"?atob(ve):"base64:"+ve}function R(ve){var We=new Error("(regl) "+ve);throw console.error(We),We}function A(ve,We){ve||R(We)}function N(ve){return ve?": "+ve:""}function L(ve,We,it){ve in We||R("unknown parameter ("+ve+")"+N(it)+". possible values: "+Object.keys(We).join())}function y(ve,We){U(ve)||R("invalid parameter type"+N(We)+". must be a typed array")}function x(ve,We){switch(We){case"number":return typeof ve=="number";case"object":return typeof ve=="object";case"string":return typeof ve=="string";case"boolean":return typeof ve=="boolean";case"function":return typeof ve=="function";case"undefined":return typeof ve=="undefined";case"symbol":return typeof ve=="symbol"}}function v(ve,We,it){x(ve,We)||R("invalid parameter type"+N(it)+". expected "+We+", got "+typeof ve)}function g(ve,We){ve>=0&&(ve|0)===ve||R("invalid parameter type, ("+ve+")"+N(We)+". must be a nonnegative integer")}function d(ve,We,it){We.indexOf(ve)<0&&R("invalid value"+N(it)+". must be one of: "+We)}var _=["gl","canvas","container","attributes","pixelRatio","extensions","optionalExtensions","profile","onDone"];function E(ve){Object.keys(ve).forEach(function(We){_.indexOf(We)<0&&R('invalid regl constructor argument "'+We+'". must be one of '+_)})}function w(ve,We){for(ve=ve+"";ve.length<We;)ve=" "+ve;return ve}function T(){this.name="unknown",this.lines=[],this.index={},this.hasErrors=!1}function k(ve,We){this.number=ve,this.line=We,this.errors=[]}function b(ve,We,it){this.file=ve,this.line=We,this.message=it}function m(){var ve=new Error,We=(ve.stack||ve).toString(),it=/compileProcedure.*\n\s*at.*\((.*)\)/.exec(We);if(it)return it[1];var Zt=/compileProcedure.*\n\s*at\s+(.*)(\n|$)/.exec(We);return Zt?Zt[1]:"unknown"}function $(){var ve=new Error,We=(ve.stack||ve).toString(),it=/at REGLCommand.*\n\s+at.*\((.*)\)/.exec(We);if(it)return it[1];var Zt=/at REGLCommand.*\n\s+at\s+(.*)\n/.exec(We);return Zt?Zt[1]:"unknown"}function W(ve,We){var it=ve.split(`
  625. `),Zt=1,dr=0,Yt={unknown:new T,0:new T};Yt.unknown.name=Yt[0].name=We||m(),Yt.unknown.lines.push(new k(0,""));for(var ar=0;ar<it.length;++ar){var Mr=it[ar],Ir=/^\s*#\s*(\w+)\s+(.+)\s*$/.exec(Mr);if(Ir)switch(Ir[1]){case"line":var Ar=/(\d+)(\s+\d+)?/.exec(Ir[2]);Ar&&(Zt=Ar[1]|0,Ar[2]&&(dr=Ar[2]|0,dr in Yt||(Yt[dr]=new T)));break;case"define":var Tr=/SHADER_NAME(_B64)?\s+(.*)$/.exec(Ir[2]);Tr&&(Yt[dr].name=Tr[1]?j(Tr[2]):Tr[2]);break}Yt[dr].lines.push(new k(Zt++,Mr))}return Object.keys(Yt).forEach(function(zr){var f=Yt[zr];f.lines.forEach(function(M){f.index[M.number]=M})}),Yt}function X(ve){var We=[];return ve.split(`
  626. `).forEach(function(it){if(!(it.length<5)){var Zt=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(it);Zt?We.push(new b(Zt[1]|0,Zt[2]|0,Zt[3].trim())):it.length>0&&We.push(new b("unknown",0,it))}}),We}function H(ve,We){We.forEach(function(it){var Zt=ve[it.file];if(Zt){var dr=Zt.index[it.line];if(dr){dr.errors.push(it),Zt.hasErrors=!0;return}}ve.unknown.hasErrors=!0,ve.unknown.lines[0].errors.push(it)})}function Q(ve,We,it,Zt,dr){if(!ve.getShaderParameter(We,ve.COMPILE_STATUS)){var Yt=ve.getShaderInfoLog(We),ar=Zt===ve.FRAGMENT_SHADER?"fragment":"vertex";Se(it,"string",ar+" shader source must be a string",dr);var Mr=W(it,dr),Ir=X(Yt);H(Mr,Ir),Object.keys(Mr).forEach(function(Ar){var Tr=Mr[Ar];if(!Tr.hasErrors)return;var zr=[""],f=[""];function M(G,Y){zr.push(G),f.push(Y||"")}M("file number "+Ar+": "+Tr.name+`
  627. `,"color:red;text-decoration:underline;font-weight:bold"),Tr.lines.forEach(function(G){if(G.errors.length>0){M(w(G.number,4)+"| ","background-color:yellow; font-weight:bold"),M(G.line+B,"color:red; background-color:yellow; font-weight:bold");var Y=0;G.errors.forEach(function(re){var ie=re.message,le=/^\s*'(.*)'\s*:\s*(.*)$/.exec(ie);if(le){var ge=le[1];switch(ie=le[2],ge){case"assign":ge="=";break}Y=Math.max(G.line.indexOf(ge,Y),0)}else Y=0;M(w("| ",6)),M(w("^^^",Y+3)+B,"font-weight:bold"),M(w("| ",6)),M(ie+B,"font-weight:bold")}),M(w("| ",6)+B)}else M(w(G.number,4)+"| "),M(G.line+B,"color:red")}),typeof document!="undefined"&&!window.chrome?(f[0]=zr.join("%c"),console.log.apply(console,f)):console.log(zr.join(""))}),A.raise("Error compiling "+ar+" shader, "+Mr[0].name)}}function q(ve,We,it,Zt,dr){if(!ve.getProgramParameter(We,ve.LINK_STATUS)){var Yt=ve.getProgramInfoLog(We),ar=W(it,dr),Mr=W(Zt,dr),Ir='Error linking program with vertex shader, "'+Mr[0].name+'", and fragment shader "'+ar[0].name+'"';typeof document!="undefined"?console.log("%c"+Ir+B+"%c"+Yt,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(Ir+B+Yt),A.raise(Ir)}}function J(ve){ve._commandRef=m()}function te(ve,We,it,Zt){J(ve);function dr(Ir){return Ir?Zt.id(Ir):0}ve._fragId=dr(ve.static.frag),ve._vertId=dr(ve.static.vert);function Yt(Ir,Ar){Object.keys(Ar).forEach(function(Tr){Ir[Zt.id(Tr)]=!0})}var ar=ve._uniformSet={};Yt(ar,We.static),Yt(ar,We.dynamic);var Mr=ve._attributeSet={};Yt(Mr,it.static),Yt(Mr,it.dynamic),ve._hasCount="count"in ve.static||"count"in ve.dynamic||"elements"in ve.static||"elements"in ve.dynamic}function fe(ve,We){var it=$();R(ve+" in command "+(We||m())+(it==="unknown"?"":" called from "+it))}function de(ve,We,it){ve||fe(We,it||m())}function Te(ve,We,it,Zt){ve in We||fe("unknown parameter ("+ve+")"+N(it)+". possible values: "+Object.keys(We).join(),Zt||m())}function Se(ve,We,it,Zt){x(ve,We)||fe("invalid parameter type"+N(it)+". expected "+We+", got "+typeof ve,Zt||m())}function Ie(ve){ve()}function be(ve,We,it){ve.texture?d(ve.texture._texture.internalformat,We,"unsupported texture format for attachment"):d(ve.renderbuffer._renderbuffer.format,it,"unsupported renderbuffer format for attachment")}var pe=33071,Me=9728,De=9984,Ue=9985,nt=9986,Ze=9987,ht=5120,Rt=5121,tr=5122,Qe=5123,lt=5124,St=5125,Ct=5126,_t=32819,pt=32820,rr=33635,xr=34042,Vt=36193,ft={};ft[ht]=ft[Rt]=1,ft[tr]=ft[Qe]=ft[Vt]=ft[rr]=ft[_t]=ft[pt]=2,ft[lt]=ft[St]=ft[Ct]=ft[xr]=4;function Bt(ve,We){return ve===pt||ve===_t||ve===rr?2:ve===xr?4:ft[ve]*We}function qt(ve){return!(ve&ve-1)&&!!ve}function br(ve,We,it){var Zt,dr=We.width,Yt=We.height,ar=We.channels;A(dr>0&&dr<=it.maxTextureSize&&Yt>0&&Yt<=it.maxTextureSize,"invalid texture shape"),(ve.wrapS!==pe||ve.wrapT!==pe)&&A(qt(dr)&&qt(Yt),"incompatible wrap mode for texture, both width and height must be power of 2"),We.mipmask===1?dr!==1&&Yt!==1&&A(ve.minFilter!==De&&ve.minFilter!==nt&&ve.minFilter!==Ue&&ve.minFilter!==Ze,"min filter requires mipmap"):(A(qt(dr)&&qt(Yt),"texture must be a square power of 2 to support mipmapping"),A(We.mipmask===(dr<<1)-1,"missing or incomplete mipmap data")),We.type===Ct&&(it.extensions.indexOf("oes_texture_float_linear")<0&&A(ve.minFilter===Me&&ve.magFilter===Me,"filter not supported, must enable oes_texture_float_linear"),A(!ve.genMipmaps,"mipmap generation not supported with float textures"));var Mr=We.images;for(Zt=0;Zt<16;++Zt)if(Mr[Zt]){var Ir=dr>>Zt,Ar=Yt>>Zt;A(We.mipmask&1<<Zt,"missing mipmap data");var Tr=Mr[Zt];if(A(Tr.width===Ir&&Tr.height===Ar,"invalid shape for mip images"),A(Tr.format===We.format&&Tr.internalformat===We.internalformat&&Tr.type===We.type,"incompatible type for mip image"),!Tr.compressed)if(Tr.data){var zr=Math.ceil(Bt(Tr.type,ar)*Ir/Tr.unpackAlignment)*Tr.unpackAlignment;A(Tr.data.byteLength===zr*Ar,"invalid data for image, buffer size is inconsistent with image format")}else Tr.element||Tr.copy}else ve.genMipmaps||A((We.mipmask&1<<Zt)==0,"extra mipmap data");We.compressed&&A(!ve.genMipmaps,"mipmap generation for compressed images not supported")}function Ur(ve,We,it,Zt){var dr=ve.width,Yt=ve.height,ar=ve.channels;A(dr>0&&dr<=Zt.maxTextureSize&&Yt>0&&Yt<=Zt.maxTextureSize,"invalid texture shape"),A(dr===Yt,"cube map must be square"),A(We.wrapS===pe&&We.wrapT===pe,"wrap mode not supported by cube map");for(var Mr=0;Mr<it.length;++Mr){var Ir=it[Mr];A(Ir.width===dr&&Ir.height===Yt,"inconsistent cube map face shape"),We.genMipmaps&&(A(!Ir.compressed,"can not generate mipmap for compressed textures"),A(Ir.mipmask===1,"can not specify mipmaps and generate mipmaps"));for(var Ar=Ir.images,Tr=0;Tr<16;++Tr){var zr=Ar[Tr];if(zr){var f=dr>>Tr,M=Yt>>Tr;A(Ir.mipmask&1<<Tr,"missing mipmap data"),A(zr.width===f&&zr.height===M,"invalid shape for mip images"),A(zr.format===ve.format&&zr.internalformat===ve.internalformat&&zr.type===ve.type,"incompatible type for mip image"),zr.compressed||(zr.data?A(zr.data.byteLength===f*M*Math.max(Bt(zr.type,ar),zr.unpackAlignment),"invalid data for image, buffer size is inconsistent with image format"):zr.element||zr.copy)}}}}var Ae=z(A,{optional:Ie,raise:R,commandRaise:fe,command:de,parameter:L,commandParameter:Te,constructor:E,type:v,commandType:Se,isTypedArray:y,nni:g,oneOf:d,shaderError:Q,linkError:q,callSite:$,saveCommandRef:J,saveDrawInfo:te,framebufferFormat:be,guessCommand:m,texture2D:br,textureCube:Ur}),Hr=0,Sr=0,qr=5,Gr=6;function vn(ve,We){this.id=Hr++,this.type=ve,this.data=We}function Gn(ve){return ve.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function mn(ve){if(ve.length===0)return[];var We=ve.charAt(0),it=ve.charAt(ve.length-1);if(ve.length>1&&We===it&&(We==='"'||We==="'"))return['"'+Gn(ve.substr(1,ve.length-2))+'"'];var Zt=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(ve);if(Zt)return mn(ve.substr(0,Zt.index)).concat(mn(Zt[1])).concat(mn(ve.substr(Zt.index+Zt[0].length)));var dr=ve.split(".");if(dr.length===1)return['"'+Gn(ve)+'"'];for(var Yt=[],ar=0;ar<dr.length;++ar)Yt=Yt.concat(mn(dr[ar]));return Yt}function $r(ve){return"["+mn(ve).join("][")+"]"}function gn(ve,We){return new vn(ve,$r(We+""))}function Rr(ve){return typeof ve=="function"&&!ve._reglType||ve instanceof vn}function ct(ve,We){if(typeof ve=="function")return new vn(Sr,ve);if(typeof ve=="number"||typeof ve=="boolean")return new vn(qr,ve);if(Array.isArray(ve))return new vn(Gr,ve.map((it,Zt)=>ct(it,We+"["+Zt+"]")));if(ve instanceof vn)return ve;Ae(!1,"invalid option type in uniform "+We)}var Wt={DynamicVariable:vn,define:gn,isDynamic:Rr,unbox:ct,accessor:$r},Er={next:typeof requestAnimationFrame=="function"?function(ve){return requestAnimationFrame(ve)}:function(ve){return setTimeout(ve,16)},cancel:typeof cancelAnimationFrame=="function"?function(ve){return cancelAnimationFrame(ve)}:clearTimeout},Dr=typeof performance!="undefined"&&performance.now?function(){return performance.now()}:function(){return+new Date};function Vr(){var ve={"":0},We=[""];return{id:function(it){var Zt=ve[it];return Zt||(Zt=ve[it]=We.length,We.push(it),Zt)},str:function(it){return We[it]}}}function pn(ve,We,it){var Zt=document.createElement("canvas");z(Zt.style,{border:0,margin:0,padding:0,top:0,left:0}),ve.appendChild(Zt),ve===document.body&&(Zt.style.position="absolute",z(ve.style,{margin:0,padding:0}));function dr(){var Mr=window.innerWidth,Ir=window.innerHeight;if(ve!==document.body){var Ar=ve.getBoundingClientRect();Mr=Ar.right-Ar.left,Ir=Ar.bottom-Ar.top}Zt.width=it*Mr,Zt.height=it*Ir,z(Zt.style,{width:Mr+"px",height:Ir+"px"})}var Yt;ve!==document.body&&typeof ResizeObserver=="function"?(Yt=new ResizeObserver(function(){setTimeout(dr)}),Yt.observe(ve)):window.addEventListener("resize",dr,!1);function ar(){Yt?Yt.disconnect():window.removeEventListener("resize",dr),ve.removeChild(Zt)}return dr(),{canvas:Zt,onDestroy:ar}}function wn(ve,We){function it(Zt){try{return ve.getContext(Zt,We)}catch(dr){return null}}return it("webgl")||it("experimental-webgl")||it("webgl-experimental")}function Sn(ve){return typeof ve.nodeName=="string"&&typeof ve.appendChild=="function"&&typeof ve.getBoundingClientRect=="function"}function In(ve){return typeof ve.drawArrays=="function"||typeof ve.drawElements=="function"}function $n(ve){return typeof ve=="string"?ve.split():(Ae(Array.isArray(ve),"invalid extension array"),ve)}function Zr(ve){return typeof ve=="string"?(Ae(typeof document!="undefined","not supported outside of DOM"),document.querySelector(ve)):ve}function Pn(ve){var We=ve||{},it,Zt,dr,Yt,ar={},Mr=[],Ir=[],Ar=typeof window=="undefined"?1:window.devicePixelRatio,Tr=!1,zr=function(G){G&&Ae.raise(G)},f=function(){};if(typeof We=="string"?(Ae(typeof document!="undefined","selector queries only supported in DOM enviroments"),it=document.querySelector(We),Ae(it,"invalid query string for element")):typeof We=="object"?Sn(We)?it=We:In(We)?(Yt=We,dr=Yt.canvas):(Ae.constructor(We),"gl"in We?Yt=We.gl:"canvas"in We?dr=Zr(We.canvas):"container"in We&&(Zt=Zr(We.container)),"attributes"in We&&(ar=We.attributes,Ae.type(ar,"object","invalid context attributes")),"extensions"in We&&(Mr=$n(We.extensions)),"optionalExtensions"in We&&(Ir=$n(We.optionalExtensions)),"onDone"in We&&(Ae.type(We.onDone,"function","invalid or missing onDone callback"),zr=We.onDone),"profile"in We&&(Tr=!!We.profile),"pixelRatio"in We&&(Ar=+We.pixelRatio,Ae(Ar>0,"invalid pixel ratio"))):Ae.raise("invalid arguments to regl"),it&&(it.nodeName.toLowerCase()==="canvas"?dr=it:Zt=it),!Yt){if(!dr){Ae(typeof document!="undefined","must manually specify webgl context outside of DOM environments");var M=pn(Zt||document.body,zr,Ar);if(!M)return null;dr=M.canvas,f=M.onDestroy}ar.premultipliedAlpha===void 0&&(ar.premultipliedAlpha=!0),Yt=wn(dr,ar)}return Yt?{gl:Yt,canvas:dr,container:Zt,extensions:Mr,optionalExtensions:Ir,pixelRatio:Ar,profile:Tr,onDone:zr,onDestroy:f}:(f(),zr("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function An(ve,We){var it={};function Zt(ar){Ae.type(ar,"string","extension name must be string");var Mr=ar.toLowerCase(),Ir;try{Ir=it[Mr]=ve.getExtension(Mr)}catch(Ar){}return!!Ir}for(var dr=0;dr<We.extensions.length;++dr){var Yt=We.extensions[dr];if(!Zt(Yt))return We.onDestroy(),We.onDone('"'+Yt+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return We.optionalExtensions.forEach(Zt),{extensions:it,restore:function(){Object.keys(it).forEach(function(ar){if(it[ar]&&!Zt(ar))throw new Error("(regl): error restoring extension "+ar)})}}}function ln(ve,We){for(var it=Array(ve),Zt=0;Zt<ve;++Zt)it[Zt]=We(Zt);return it}var va=5120,K=5121,Dt=5122,rt=5123,ne=5124,ae=5125,P=5126;function S(ve){for(var We=16;We<=1<<28;We*=16)if(ve<=We)return We;return 0}function C(ve){var We,it;return We=(ve>65535)<<4,ve>>>=We,it=(ve>255)<<3,ve>>>=it,We|=it,it=(ve>15)<<2,ve>>>=it,We|=it,it=(ve>3)<<1,ve>>>=it,We|=it,We|ve>>1}function V(){var ve=ln(8,function(){return[]});function We(Yt){var ar=S(Yt),Mr=ve[C(ar)>>2];return Mr.length>0?Mr.pop():new ArrayBuffer(ar)}function it(Yt){ve[C(Yt.byteLength)>>2].push(Yt)}function Zt(Yt,ar){var Mr=null;switch(Yt){case va:Mr=new Int8Array(We(ar),0,ar);break;case K:Mr=new Uint8Array(We(ar),0,ar);break;case Dt:Mr=new Int16Array(We(2*ar),0,ar);break;case rt:Mr=new Uint16Array(We(2*ar),0,ar);break;case ne:Mr=new Int32Array(We(4*ar),0,ar);break;case ae:Mr=new Uint32Array(We(4*ar),0,ar);break;case P:Mr=new Float32Array(We(4*ar),0,ar);break;default:return null}return Mr.length!==ar?Mr.subarray(0,ar):Mr}function dr(Yt){it(Yt.buffer)}return{alloc:We,free:it,allocType:Zt,freeType:dr}}var he=V();he.zero=V();var xe=3408,Ee=3410,Ne=3411,Et=3412,st=3413,Pt=3414,$t=3415,Ht=33901,Br=33902,hn=3379,Ot=3386,Qt=34921,pr=36347,en=36348,Nr=35661,ta=35660,kn=34930,En=36349,Rn=34076,Yn=34024,bn=7936,je=7937,Ce=7938,Xe=35724,ut=34047,ot=36063,bt=34852,Xt=3553,wr=34067,Wr=34069,on=33984,xn=6408,zn=5126,Qn=5121,ia=36160,Wa=36053,Ia=36064,Ba=16384,Ea=function(ve,We){var it=1;We.ext_texture_filter_anisotropic&&(it=ve.getParameter(ut));var Zt=1,dr=1;We.webgl_draw_buffers&&(Zt=ve.getParameter(bt),dr=ve.getParameter(ot));var Yt=!!We.oes_texture_float;if(Yt){var ar=ve.createTexture();ve.bindTexture(Xt,ar),ve.texImage2D(Xt,0,xn,1,1,0,xn,zn,null);var Mr=ve.createFramebuffer();if(ve.bindFramebuffer(ia,Mr),ve.framebufferTexture2D(ia,Ia,Xt,ar,0),ve.bindTexture(Xt,null),ve.checkFramebufferStatus(ia)!==Wa)Yt=!1;else{ve.viewport(0,0,1,1),ve.clearColor(1,0,0,1),ve.clear(Ba);var Ir=he.allocType(zn,4);ve.readPixels(0,0,1,1,xn,zn,Ir),ve.getError()?Yt=!1:(ve.deleteFramebuffer(Mr),ve.deleteTexture(ar),Yt=Ir[0]===1),he.freeType(Ir)}}var Ar=typeof navigator!="undefined"&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent)),Tr=!0;if(!Ar){var zr=ve.createTexture(),f=he.allocType(Qn,36);ve.activeTexture(on),ve.bindTexture(wr,zr),ve.texImage2D(Wr,0,xn,3,3,0,xn,Qn,f),he.freeType(f),ve.bindTexture(wr,null),ve.deleteTexture(zr),Tr=!ve.getError()}return{colorBits:[ve.getParameter(Ee),ve.getParameter(Ne),ve.getParameter(Et),ve.getParameter(st)],depthBits:ve.getParameter(Pt),stencilBits:ve.getParameter($t),subpixelBits:ve.getParameter(xe),extensions:Object.keys(We).filter(function(M){return!!We[M]}),maxAnisotropic:it,maxDrawbuffers:Zt,maxColorAttachments:dr,pointSizeDims:ve.getParameter(Ht),lineWidthDims:ve.getParameter(Br),maxViewportDims:ve.getParameter(Ot),maxCombinedTextureUnits:ve.getParameter(Nr),maxCubeMapSize:ve.getParameter(Rn),maxRenderbufferSize:ve.getParameter(Yn),maxTextureUnits:ve.getParameter(kn),maxTextureSize:ve.getParameter(hn),maxAttributes:ve.getParameter(Qt),maxVertexUniforms:ve.getParameter(pr),maxVertexTextureUnits:ve.getParameter(ta),maxVaryingVectors:ve.getParameter(en),maxFragmentUniforms:ve.getParameter(En),glsl:ve.getParameter(Xe),renderer:ve.getParameter(je),vendor:ve.getParameter(bn),version:ve.getParameter(Ce),readFloat:Yt,npotTextureCube:Tr}};function qa(ve){return!!ve&&typeof ve=="object"&&Array.isArray(ve.shape)&&Array.isArray(ve.stride)&&typeof ve.offset=="number"&&ve.shape.length===ve.stride.length&&(Array.isArray(ve.data)||U(ve.data))}var si=function(ve){return Object.keys(ve).map(function(We){return ve[We]})},_a={shape:Ss,flatten:lo};function So(ve,We,it){for(var Zt=0;Zt<We;++Zt)it[Zt]=ve[Zt]}function to(ve,We,it,Zt){for(var dr=0,Yt=0;Yt<We;++Yt)for(var ar=ve[Yt],Mr=0;Mr<it;++Mr)Zt[dr++]=ar[Mr]}function co(ve,We,it,Zt,dr,Yt){for(var ar=Yt,Mr=0;Mr<We;++Mr)for(var Ir=ve[Mr],Ar=0;Ar<it;++Ar)for(var Tr=Ir[Ar],zr=0;zr<Zt;++zr)dr[ar++]=Tr[zr]}function ni(ve,We,it,Zt,dr){for(var Yt=1,ar=it+1;ar<We.length;++ar)Yt*=We[ar];var Mr=We[it];if(We.length-it==4){var Ir=We[it+1],Ar=We[it+2],Tr=We[it+3];for(ar=0;ar<Mr;++ar)co(ve[ar],Ir,Ar,Tr,Zt,dr),dr+=Yt}else for(ar=0;ar<Mr;++ar)ni(ve[ar],We,it+1,Zt,dr),dr+=Yt}function lo(ve,We,it,Zt){var dr=1;if(We.length)for(var Yt=0;Yt<We.length;++Yt)dr*=We[Yt];else dr=0;var ar=Zt||he.allocType(it,dr);switch(We.length){case 0:break;case 1:So(ve,We[0],ar);break;case 2:to(ve,We[0],We[1],ar);break;case 3:co(ve,We[0],We[1],We[2],ar,0);break;default:ni(ve,We,0,ar,0)}return ar}function Ss(ve){for(var We=[],it=ve;it.length;it=it[0])We.push(it.length);return We}var Ro={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},mi=5120,ya=5122,_o=5124,Yi=5121,Fi=5123,Bo=5125,_s=5126,Oo=5126,Hi={int8:mi,int16:ya,int32:_o,uint8:Yi,uint16:Fi,uint32:Bo,float:_s,float32:Oo},_n=35048,Fo=35040,Go={dynamic:_n,stream:Fo,static:35044},Va=_a.flatten,Ms=_a.shape,Ko=35044,Li=35040,Mo=5121,ho=5126,Gi=[];Gi[5120]=1,Gi[5122]=2,Gi[5124]=4,Gi[5121]=1,Gi[5123]=2,Gi[5125]=4,Gi[5126]=4;function Di(ve){return Ro[Object.prototype.toString.call(ve)]|0}function $o(ve,We){for(var it=0;it<We.length;++it)ve[it]=We[it]}function Ni(ve,We,it,Zt,dr,Yt,ar){for(var Mr=0,Ir=0;Ir<it;++Ir)for(var Ar=0;Ar<Zt;++Ar)ve[Mr++]=We[dr*Ir+Yt*Ar+ar]}function ro(ve,We,it,Zt){var dr=0,Yt={};function ar(Y){this.id=dr++,this.buffer=ve.createBuffer(),this.type=Y,this.usage=Ko,this.byteLength=0,this.dimension=1,this.dtype=Mo,this.persistentData=null,it.profile&&(this.stats={size:0})}ar.prototype.bind=function(){ve.bindBuffer(this.type,this.buffer)},ar.prototype.destroy=function(){f(this)};var Mr=[];function Ir(Y,re){var ie=Mr.pop();return ie||(ie=new ar(Y)),ie.bind(),zr(ie,re,Li,0,1,!1),ie}function Ar(Y){Mr.push(Y)}function Tr(Y,re,ie){Y.byteLength=re.byteLength,ve.bufferData(Y.type,re,ie)}function zr(Y,re,ie,le,ge,me){var Le;if(Y.usage=ie,Array.isArray(re)){if(Y.dtype=le||ho,re.length>0){var ze;if(Array.isArray(re[0])){Le=Ms(re);for(var Fe=1,tt=1;tt<Le.length;++tt)Fe*=Le[tt];Y.dimension=Fe,ze=Va(re,Le,Y.dtype),Tr(Y,ze,ie),me?Y.persistentData=ze:he.freeType(ze)}else if(typeof re[0]=="number"){Y.dimension=ge;var Mt=he.allocType(Y.dtype,re.length);$o(Mt,re),Tr(Y,Mt,ie),me?Y.persistentData=Mt:he.freeType(Mt)}else U(re[0])?(Y.dimension=re[0].length,Y.dtype=le||Di(re[0])||ho,ze=Va(re,[re.length,re[0].length],Y.dtype),Tr(Y,ze,ie),me?Y.persistentData=ze:he.freeType(ze)):Ae.raise("invalid buffer data")}}else if(U(re))Y.dtype=le||Di(re),Y.dimension=ge,Tr(Y,re,ie),me&&(Y.persistentData=new Uint8Array(new Uint8Array(re.buffer)));else if(qa(re)){Le=re.shape;var sr=re.stride,Tt=re.offset,Nt=0,Lt=0,_r=0,Yr=0;Le.length===1?(Nt=Le[0],Lt=1,_r=sr[0],Yr=0):Le.length===2?(Nt=Le[0],Lt=Le[1],_r=sr[0],Yr=sr[1]):Ae.raise("invalid shape"),Y.dtype=le||Di(re.data)||ho,Y.dimension=Lt;var Pr=he.allocType(Y.dtype,Nt*Lt);Ni(Pr,re.data,Nt,Lt,_r,Yr,Tt),Tr(Y,Pr,ie),me?Y.persistentData=Pr:he.freeType(Pr)}else re instanceof ArrayBuffer?(Y.dtype=Mo,Y.dimension=ge,Tr(Y,re,ie),me&&(Y.persistentData=new Uint8Array(new Uint8Array(re)))):Ae.raise("invalid buffer data")}function f(Y){We.bufferCount--,Zt(Y);var re=Y.buffer;Ae(re,"buffer must not be deleted already"),ve.deleteBuffer(re),Y.buffer=null,delete Yt[Y.id]}function M(Y,re,ie,le){We.bufferCount++;var ge=new ar(re);Yt[ge.id]=ge;function me(Fe){var tt=Ko,Mt=null,sr=0,Tt=0,Nt=1;return Array.isArray(Fe)||U(Fe)||qa(Fe)||Fe instanceof ArrayBuffer?Mt=Fe:typeof Fe=="number"?sr=Fe|0:Fe&&(Ae.type(Fe,"object","buffer arguments must be an object, a number or an array"),"data"in Fe&&(Ae(Mt===null||Array.isArray(Mt)||U(Mt)||qa(Mt),"invalid data for buffer"),Mt=Fe.data),"usage"in Fe&&(Ae.parameter(Fe.usage,Go,"invalid buffer usage"),tt=Go[Fe.usage]),"type"in Fe&&(Ae.parameter(Fe.type,Hi,"invalid buffer type"),Tt=Hi[Fe.type]),"dimension"in Fe&&(Ae.type(Fe.dimension,"number","invalid dimension"),Nt=Fe.dimension|0),"length"in Fe&&(Ae.nni(sr,"buffer length must be a nonnegative integer"),sr=Fe.length|0)),ge.bind(),Mt?zr(ge,Mt,tt,Tt,Nt,le):(sr&&ve.bufferData(ge.type,sr,tt),ge.dtype=Tt||Mo,ge.usage=tt,ge.dimension=Nt,ge.byteLength=sr),it.profile&&(ge.stats.size=ge.byteLength*Gi[ge.dtype]),me}function Le(Fe,tt){Ae(tt+Fe.byteLength<=ge.byteLength,"invalid buffer subdata call, buffer is too small. Can't write data of size "+Fe.byteLength+" starting from offset "+tt+" to a buffer of size "+ge.byteLength),ve.bufferSubData(ge.type,tt,Fe)}function ze(Fe,tt){var Mt=(tt||0)|0,sr;if(ge.bind(),U(Fe)||Fe instanceof ArrayBuffer)Le(Fe,Mt);else if(Array.isArray(Fe)){if(Fe.length>0)if(typeof Fe[0]=="number"){var Tt=he.allocType(ge.dtype,Fe.length);$o(Tt,Fe),Le(Tt,Mt),he.freeType(Tt)}else if(Array.isArray(Fe[0])||U(Fe[0])){sr=Ms(Fe);var Nt=Va(Fe,sr,ge.dtype);Le(Nt,Mt),he.freeType(Nt)}else Ae.raise("invalid buffer data")}else if(qa(Fe)){sr=Fe.shape;var Lt=Fe.stride,_r=0,Yr=0,Pr=0,dn=0;sr.length===1?(_r=sr[0],Yr=1,Pr=Lt[0],dn=0):sr.length===2?(_r=sr[0],Yr=sr[1],Pr=Lt[0],dn=Lt[1]):Ae.raise("invalid shape");var sn=Array.isArray(Fe.data)?ge.dtype:Di(Fe.data),tn=he.allocType(sn,_r*Yr);Ni(tn,Fe.data,_r,Yr,Pr,dn,Fe.offset),Le(tn,Mt),he.freeType(tn)}else Ae.raise("invalid data for buffer subdata");return me}return ie||me(Y),me._reglType="buffer",me._buffer=ge,me.subdata=ze,it.profile&&(me.stats=ge.stats),me.destroy=function(){f(ge)},me}function G(){si(Yt).forEach(function(Y){Y.buffer=ve.createBuffer(),ve.bindBuffer(Y.type,Y.buffer),ve.bufferData(Y.type,Y.persistentData||Y.byteLength,Y.usage)})}return it.profile&&(We.getTotalBufferSize=function(){var Y=0;return Object.keys(Yt).forEach(function(re){Y+=Yt[re].stats.size}),Y}),{create:M,createStream:Ir,destroyStream:Ar,clear:function(){si(Yt).forEach(f),Mr.forEach(f)},getBuffer:function(Y){return Y&&Y._buffer instanceof ar?Y._buffer:null},restore:G,_initBuffer:zr}}var Qo=0,ns=0,zi=1,ga=1,vo=4,Vs=4,Pi={points:Qo,point:ns,lines:zi,line:ga,triangles:vo,triangle:Vs,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},Ao=0,as=1,vi=4,Zi=5120,_i=5121,no=5122,Ui=5123,da=5124,Fa=5125,Ya=34963,Ii=35040,Wi=35044;function ao(ve,We,it,Zt){var dr={},Yt=0,ar={uint8:_i,uint16:Ui};We.oes_element_index_uint&&(ar.uint32=Fa);function Mr(G){this.id=Yt++,dr[this.id]=this,this.buffer=G,this.primType=vi,this.vertCount=0,this.type=0}Mr.prototype.bind=function(){this.buffer.bind()};var Ir=[];function Ar(G){var Y=Ir.pop();return Y||(Y=new Mr(it.create(null,Ya,!0,!1)._buffer)),zr(Y,G,Ii,-1,-1,0,0),Y}function Tr(G){Ir.push(G)}function zr(G,Y,re,ie,le,ge,me){G.buffer.bind();var Le;if(Y){var ze=me;!me&&(!U(Y)||qa(Y)&&!U(Y.data))&&(ze=We.oes_element_index_uint?Fa:Ui),it._initBuffer(G.buffer,Y,re,ze,3)}else ve.bufferData(Ya,ge,re),G.buffer.dtype=Le||_i,G.buffer.usage=re,G.buffer.dimension=3,G.buffer.byteLength=ge;if(Le=me,!me){switch(G.buffer.dtype){case _i:case Zi:Le=_i;break;case Ui:case no:Le=Ui;break;case Fa:case da:Le=Fa;break;default:Ae.raise("unsupported type for element array")}G.buffer.dtype=Le}G.type=Le,Ae(Le!==Fa||!!We.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var Fe=le;Fe<0&&(Fe=G.buffer.byteLength,Le===Ui?Fe>>=1:Le===Fa&&(Fe>>=2)),G.vertCount=Fe;var tt=ie;if(ie<0){tt=vi;var Mt=G.buffer.dimension;Mt===1&&(tt=Ao),Mt===2&&(tt=as),Mt===3&&(tt=vi)}G.primType=tt}function f(G){Zt.elementsCount--,Ae(G.buffer!==null,"must not double destroy elements"),delete dr[G.id],G.buffer.destroy(),G.buffer=null}function M(G,Y){var re=it.create(null,Ya,!0),ie=new Mr(re._buffer);Zt.elementsCount++;function le(ge){if(!ge)re(),ie.primType=vi,ie.vertCount=0,ie.type=_i;else if(typeof ge=="number")re(ge),ie.primType=vi,ie.vertCount=ge|0,ie.type=_i;else{var me=null,Le=Wi,ze=-1,Fe=-1,tt=0,Mt=0;Array.isArray(ge)||U(ge)||qa(ge)?me=ge:(Ae.type(ge,"object","invalid arguments for elements"),"data"in ge&&(me=ge.data,Ae(Array.isArray(me)||U(me)||qa(me),"invalid data for element buffer")),"usage"in ge&&(Ae.parameter(ge.usage,Go,"invalid element buffer usage"),Le=Go[ge.usage]),"primitive"in ge&&(Ae.parameter(ge.primitive,Pi,"invalid element buffer primitive"),ze=Pi[ge.primitive]),"count"in ge&&(Ae(typeof ge.count=="number"&&ge.count>=0,"invalid vertex count for elements"),Fe=ge.count|0),"type"in ge&&(Ae.parameter(ge.type,ar,"invalid buffer type"),Mt=ar[ge.type]),"length"in ge?tt=ge.length|0:(tt=Fe,Mt===Ui||Mt===no?tt*=2:(Mt===Fa||Mt===da)&&(tt*=4))),zr(ie,me,Le,ze,Fe,tt,Mt)}return le}return le(G),le._reglType="elements",le._elements=ie,le.subdata=function(ge,me){return re.subdata(ge,me),le},le.destroy=function(){f(ie)},le}return{create:M,createStream:Ar,destroyStream:Tr,getElements:function(G){return typeof G=="function"&&G._elements instanceof Mr?G._elements:null},clear:function(){si(dr).forEach(f)}}}var go=new Float32Array(1),po=new Uint32Array(go.buffer),yo=5123;function ji(ve){for(var We=he.allocType(yo,ve.length),it=0;it<ve.length;++it)if(isNaN(ve[it]))We[it]=65535;else if(ve[it]===Infinity)We[it]=31744;else if(ve[it]===-Infinity)We[it]=64512;else{go[0]=ve[it];var Zt=po[0],dr=Zt>>>31<<15,Yt=(Zt<<1>>>24)-127,ar=Zt>>13&(1<<10)-1;if(Yt<-24)We[it]=dr;else if(Yt<-14){var Mr=-14-Yt;We[it]=dr+(ar+(1<<10)>>Mr)}else Yt>15?We[it]=dr+31744:We[it]=dr+(Yt+15<<10)+ar}return We}function ka(ve){return Array.isArray(ve)||U(ve)}var Ys=function(ve){return!(ve&ve-1)&&!!ve},_f=34467,mo=3553,lu=34067,na=34069,an=6408,Hs=6406,Xi=6407,zo=6409,is=6410,ui=32854,ai=32855,Eo=36194,Yu=32819,Hu=32820,du=33635,hu=34042,Ei=6402,Ki=34041,Zs=35904,Ks=35906,io=36193,os=33776,ss=33777,us=33778,$s=33779,Uo=35986,bo=35987,fs=34798,Zu=35840,vu=35841,gu=35842,pu=35843,Ku=36196,Co=5121,Cs=5123,cs=5125,$i=5126,xo=10242,$u=10243,Mf=10497,Ts=33071,Cf=33648,u=10240,O=10241,ue=9728,ye=9729,_e=9984,ke=9985,Be=9986,Ye=9987,Je=33170,dt=4352,It=4353,ir=4354,cr=34046,nr=3317,Or=37440,Cr=37441,hr=37443,rn=37444,Jn=33984,qn=[_e,Be,ke,Ye],Un=[0,zo,is,Xi,an],Mn={};Mn[zo]=Mn[Hs]=Mn[Ei]=1,Mn[Ki]=Mn[is]=2,Mn[Xi]=Mn[Zs]=3,Mn[an]=Mn[Ks]=4;function Cn(ve){return"[object "+ve+"]"}var Ga=Cn("HTMLCanvasElement"),ei=Cn("OffscreenCanvas"),Ka=Cn("CanvasRenderingContext2D"),$a=Cn("ImageBitmap"),Ha=Cn("HTMLImageElement"),fi=Cn("HTMLVideoElement"),bi=Object.keys(Ro).concat([Ga,ei,Ka,$a,Ha,fi]),ha=[];ha[Co]=1,ha[$i]=4,ha[io]=2,ha[Cs]=2,ha[cs]=4;var Oa=[];Oa[ui]=2,Oa[ai]=2,Oa[Eo]=2,Oa[Ki]=4,Oa[os]=.5,Oa[ss]=.5,Oa[us]=1,Oa[$s]=1,Oa[Uo]=.5,Oa[bo]=1,Oa[fs]=1,Oa[Zu]=.5,Oa[vu]=.25,Oa[gu]=.5,Oa[pu]=.25,Oa[Ku]=.5;function Jo(ve){return Array.isArray(ve)&&(ve.length===0||typeof ve[0]=="number")}function Wo(ve){if(!Array.isArray(ve))return!1;var We=ve.length;return!(We===0||!ka(ve[0]))}function oo(ve){return Object.prototype.toString.call(ve)}function Qs(ve){return oo(ve)===Ga}function Tf(ve){return oo(ve)===ei}function Qu(ve){return oo(ve)===Ka}function Ju(ve){return oo(ve)===$a}function cc(ve){return oo(ve)===Ha}function yu(ve){return oo(ve)===fi}function If(ve){if(!ve)return!1;var We=oo(ve);return bi.indexOf(We)>=0?!0:Jo(ve)||Wo(ve)||qa(ve)}function Of(ve){return Ro[Object.prototype.toString.call(ve)]|0}function qo(ve,We){var it=We.length;switch(ve.type){case Co:case Cs:case cs:case $i:var Zt=he.allocType(ve.type,it);Zt.set(We),ve.data=Zt;break;case io:ve.data=ji(We);break;default:Ae.raise("unsupported texture type, must specify a typed array")}}function Af(ve,We){return he.allocType(ve.type===io?$i:ve.type,We)}function lc(ve,We){ve.type===io?(ve.data=ji(We),he.freeType(We)):ve.data=We}function el(ve,We,it,Zt,dr,Yt){for(var ar=ve.width,Mr=ve.height,Ir=ve.channels,Ar=ar*Mr*Ir,Tr=Af(ve,Ar),zr=0,f=0;f<Mr;++f)for(var M=0;M<ar;++M)for(var G=0;G<Ir;++G)Tr[zr++]=We[it*M+Zt*f+dr*G+Yt];lc(ve,Tr)}function Is(ve,We,it,Zt,dr,Yt){var ar;if(typeof Oa[ve]!="undefined"?ar=Oa[ve]:ar=Mn[ve]*ha[We],Yt&&(ar*=6),dr){for(var Mr=0,Ir=it;Ir>=1;)Mr+=ar*Ir*Ir,Ir/=2;return Mr}else return ar*it*Zt}function mu(ve,We,it,Zt,dr,Yt,ar){var Mr={"don't care":dt,"dont care":dt,nice:ir,fast:It},Ir={repeat:Mf,clamp:Ts,mirror:Cf},Ar={nearest:ue,linear:ye},Tr=z({mipmap:Ye,"nearest mipmap nearest":_e,"linear mipmap nearest":ke,"nearest mipmap linear":Be,"linear mipmap linear":Ye},Ar),zr={none:0,browser:rn},f={uint8:Co,rgba4:Yu,rgb565:du,"rgb5 a1":Hu},M={alpha:Hs,luminance:zo,"luminance alpha":is,rgb:Xi,rgba:an,rgba4:ui,"rgb5 a1":ai,rgb565:Eo},G={};We.ext_srgb&&(M.srgb=Zs,M.srgba=Ks),We.oes_texture_float&&(f.float32=f.float=$i),We.oes_texture_half_float&&(f.float16=f["half float"]=io),We.webgl_depth_texture&&(z(M,{depth:Ei,"depth stencil":Ki}),z(f,{uint16:Cs,uint32:cs,"depth stencil":hu})),We.webgl_compressed_texture_s3tc&&z(G,{"rgb s3tc dxt1":os,"rgba s3tc dxt1":ss,"rgba s3tc dxt3":us,"rgba s3tc dxt5":$s}),We.webgl_compressed_texture_atc&&z(G,{"rgb atc":Uo,"rgba atc explicit alpha":bo,"rgba atc interpolated alpha":fs}),We.webgl_compressed_texture_pvrtc&&z(G,{"rgb pvrtc 4bppv1":Zu,"rgb pvrtc 2bppv1":vu,"rgba pvrtc 4bppv1":gu,"rgba pvrtc 2bppv1":pu}),We.webgl_compressed_texture_etc1&&(G["rgb etc1"]=Ku);var Y=Array.prototype.slice.call(ve.getParameter(_f));Object.keys(G).forEach(function(et){var Jt=G[et];Y.indexOf(Jt)>=0&&(M[et]=Jt)});var re=Object.keys(M);it.textureFormats=re;var ie=[];Object.keys(M).forEach(function(et){var Jt=M[et];ie[Jt]=et});var le=[];Object.keys(f).forEach(function(et){var Jt=f[et];le[Jt]=et});var ge=[];Object.keys(Ar).forEach(function(et){var Jt=Ar[et];ge[Jt]=et});var me=[];Object.keys(Tr).forEach(function(et){var Jt=Tr[et];me[Jt]=et});var Le=[];Object.keys(Ir).forEach(function(et){var Jt=Ir[et];Le[Jt]=et});var ze=re.reduce(function(et,Jt){var jt=M[Jt];return jt===zo||jt===Hs||jt===zo||jt===is||jt===Ei||jt===Ki||We.ext_srgb&&(jt===Zs||jt===Ks)?et[jt]=jt:jt===ai||Jt.indexOf("rgba")>=0?et[jt]=an:et[jt]=Xi,et},{});function Fe(){this.internalformat=an,this.format=an,this.type=Co,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=rn,this.width=0,this.height=0,this.channels=0}function tt(et,Jt){et.internalformat=Jt.internalformat,et.format=Jt.format,et.type=Jt.type,et.compressed=Jt.compressed,et.premultiplyAlpha=Jt.premultiplyAlpha,et.flipY=Jt.flipY,et.unpackAlignment=Jt.unpackAlignment,et.colorSpace=Jt.colorSpace,et.width=Jt.width,et.height=Jt.height,et.channels=Jt.channels}function Mt(et,Jt){if(!(typeof Jt!="object"||!Jt)){if("premultiplyAlpha"in Jt&&(Ae.type(Jt.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),et.premultiplyAlpha=Jt.premultiplyAlpha),"flipY"in Jt&&(Ae.type(Jt.flipY,"boolean","invalid texture flip"),et.flipY=Jt.flipY),"alignment"in Jt&&(Ae.oneOf(Jt.alignment,[1,2,4,8],"invalid texture unpack alignment"),et.unpackAlignment=Jt.alignment),"colorSpace"in Jt&&(Ae.parameter(Jt.colorSpace,zr,"invalid colorSpace"),et.colorSpace=zr[Jt.colorSpace]),"type"in Jt){var jt=Jt.type;Ae(We.oes_texture_float||!(jt==="float"||jt==="float32"),"you must enable the OES_texture_float extension in order to use floating point textures."),Ae(We.oes_texture_half_float||!(jt==="half float"||jt==="float16"),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),Ae(We.webgl_depth_texture||!(jt==="uint16"||jt==="uint32"||jt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Ae.parameter(jt,f,"invalid texture type"),et.type=f[jt]}var nn=et.width,aa=et.height,$e=et.channels,Ge=!1;"shape"in Jt?(Ae(Array.isArray(Jt.shape)&&Jt.shape.length>=2,"shape must be an array"),nn=Jt.shape[0],aa=Jt.shape[1],Jt.shape.length===3&&($e=Jt.shape[2],Ae($e>0&&$e<=4,"invalid number of channels"),Ge=!0),Ae(nn>=0&&nn<=it.maxTextureSize,"invalid width"),Ae(aa>=0&&aa<=it.maxTextureSize,"invalid height")):("radius"in Jt&&(nn=aa=Jt.radius,Ae(nn>=0&&nn<=it.maxTextureSize,"invalid radius")),"width"in Jt&&(nn=Jt.width,Ae(nn>=0&&nn<=it.maxTextureSize,"invalid width")),"height"in Jt&&(aa=Jt.height,Ae(aa>=0&&aa<=it.maxTextureSize,"invalid height")),"channels"in Jt&&($e=Jt.channels,Ae($e>0&&$e<=4,"invalid number of channels"),Ge=!0)),et.width=nn|0,et.height=aa|0,et.channels=$e|0;var mt=!1;if("format"in Jt){var Gt=Jt.format;Ae(We.webgl_depth_texture||!(Gt==="depth"||Gt==="depth stencil"),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Ae.parameter(Gt,M,"invalid texture format");var Ut=et.internalformat=M[Gt];et.format=ze[Ut],Gt in f&&("type"in Jt||(et.type=f[Gt])),Gt in G&&(et.compressed=!0),mt=!0}!Ge&&mt?et.channels=Mn[et.format]:Ge&&!mt?et.channels!==Un[et.format]&&(et.format=et.internalformat=Un[et.channels]):mt&&Ge&&Ae(et.channels===Mn[et.format],"number of channels inconsistent with specified format")}}function sr(et){ve.pixelStorei(Or,et.flipY),ve.pixelStorei(Cr,et.premultiplyAlpha),ve.pixelStorei(hr,et.colorSpace),ve.pixelStorei(nr,et.unpackAlignment)}function Tt(){Fe.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function Nt(et,Jt){var jt=null;if(If(Jt)?jt=Jt:Jt&&(Ae.type(Jt,"object","invalid pixel data type"),Mt(et,Jt),"x"in Jt&&(et.xOffset=Jt.x|0),"y"in Jt&&(et.yOffset=Jt.y|0),If(Jt.data)&&(jt=Jt.data)),Ae(!et.compressed||jt instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),Jt.copy){Ae(!jt,"can not specify copy and data field for the same texture");var nn=dr.viewportWidth,aa=dr.viewportHeight;et.width=et.width||nn-et.xOffset,et.height=et.height||aa-et.yOffset,et.needsCopy=!0,Ae(et.xOffset>=0&&et.xOffset<nn&&et.yOffset>=0&&et.yOffset<aa&&et.width>0&&et.width<=nn&&et.height>0&&et.height<=aa,"copy texture read out of bounds")}else if(!jt)et.width=et.width||1,et.height=et.height||1,et.channels=et.channels||4;else if(U(jt))et.channels=et.channels||4,et.data=jt,!("type"in Jt)&&et.type===Co&&(et.type=Of(jt));else if(Jo(jt))et.channels=et.channels||4,qo(et,jt),et.alignment=1,et.needsFree=!0;else if(qa(jt)){var $e=jt.data;!Array.isArray($e)&&et.type===Co&&(et.type=Of($e));var Ge=jt.shape,mt=jt.stride,Gt,Ut,wt,xt,At,Ke;Ge.length===3?(wt=Ge[2],Ke=mt[2]):(Ae(Ge.length===2,"invalid ndarray pixel data, must be 2 or 3D"),wt=1,Ke=1),Gt=Ge[0],Ut=Ge[1],xt=mt[0],At=mt[1],et.alignment=1,et.width=Gt,et.height=Ut,et.channels=wt,et.format=et.internalformat=Un[wt],et.needsFree=!0,el(et,$e,xt,At,Ke,jt.offset)}else if(Qs(jt)||Tf(jt)||Qu(jt))Qs(jt)||Tf(jt)?et.element=jt:et.element=jt.canvas,et.width=et.element.width,et.height=et.element.height,et.channels=4;else if(Ju(jt))et.element=jt,et.width=jt.width,et.height=jt.height,et.channels=4;else if(cc(jt))et.element=jt,et.width=jt.naturalWidth,et.height=jt.naturalHeight,et.channels=4;else if(yu(jt))et.element=jt,et.width=jt.videoWidth,et.height=jt.videoHeight,et.channels=4;else if(Wo(jt)){var vt=et.width||jt[0].length,Ve=et.height||jt.length,kt=et.channels;ka(jt[0][0])?kt=kt||jt[0][0].length:kt=kt||1;for(var zt=_a.shape(jt),vr=1,gr=0;gr<zt.length;++gr)vr*=zt[gr];var ur=Af(et,vr);_a.flatten(jt,zt,"",ur),lc(et,ur),et.alignment=1,et.width=vt,et.height=Ve,et.channels=kt,et.format=et.internalformat=Un[kt],et.needsFree=!0}et.type===$i?Ae(it.extensions.indexOf("oes_texture_float")>=0,"oes_texture_float extension not enabled"):et.type===io&&Ae(it.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function Lt(et,Jt,jt){var nn=et.element,aa=et.data,$e=et.internalformat,Ge=et.format,mt=et.type,Gt=et.width,Ut=et.height;sr(et),nn?ve.texImage2D(Jt,jt,Ge,Ge,mt,nn):et.compressed?ve.compressedTexImage2D(Jt,jt,$e,Gt,Ut,0,aa):et.needsCopy?(Zt(),ve.copyTexImage2D(Jt,jt,Ge,et.xOffset,et.yOffset,Gt,Ut,0)):ve.texImage2D(Jt,jt,Ge,Gt,Ut,0,Ge,mt,aa||null)}function _r(et,Jt,jt,nn,aa){var $e=et.element,Ge=et.data,mt=et.internalformat,Gt=et.format,Ut=et.type,wt=et.width,xt=et.height;sr(et),$e?ve.texSubImage2D(Jt,aa,jt,nn,Gt,Ut,$e):et.compressed?ve.compressedTexSubImage2D(Jt,aa,jt,nn,mt,wt,xt,Ge):et.needsCopy?(Zt(),ve.copyTexSubImage2D(Jt,aa,jt,nn,et.xOffset,et.yOffset,wt,xt)):ve.texSubImage2D(Jt,aa,jt,nn,wt,xt,Gt,Ut,Ge)}var Yr=[];function Pr(){return Yr.pop()||new Tt}function dn(et){et.needsFree&&he.freeType(et.data),Tt.call(et),Yr.push(et)}function sn(){Fe.call(this),this.genMipmaps=!1,this.mipmapHint=dt,this.mipmask=0,this.images=Array(16)}function tn(et,Jt,jt){var nn=et.images[0]=Pr();et.mipmask=1,nn.width=et.width=Jt,nn.height=et.height=jt,nn.channels=et.channels=4}function Bn(et,Jt){var jt=null;if(If(Jt))jt=et.images[0]=Pr(),tt(jt,et),Nt(jt,Jt),et.mipmask=1;else if(Mt(et,Jt),Array.isArray(Jt.mipmap))for(var nn=Jt.mipmap,aa=0;aa<nn.length;++aa)jt=et.images[aa]=Pr(),tt(jt,et),jt.width>>=aa,jt.height>>=aa,Nt(jt,nn[aa]),et.mipmask|=1<<aa;else jt=et.images[0]=Pr(),tt(jt,et),Nt(jt,Jt),et.mipmask=1;tt(et,et.images[0]),et.compressed&&(et.internalformat===os||et.internalformat===ss||et.internalformat===us||et.internalformat===$s)&&Ae(et.width%4==0&&et.height%4==0,"for compressed texture formats, mipmap level 0 must have width and height that are a multiple of 4")}function Fn(et,Jt){for(var jt=et.images,nn=0;nn<jt.length;++nn){if(!jt[nn])return;Lt(jt[nn],Jt,nn)}}var za=[];function Wn(){var et=za.pop()||new sn;Fe.call(et),et.mipmask=0;for(var Jt=0;Jt<16;++Jt)et.images[Jt]=null;return et}function ti(et){for(var Jt=et.images,jt=0;jt<Jt.length;++jt)Jt[jt]&&dn(Jt[jt]),Jt[jt]=null;za.push(et)}function La(){this.minFilter=ue,this.magFilter=ue,this.wrapS=Ts,this.wrapT=Ts,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=dt}function oa(et,Jt){if("min"in Jt){var jt=Jt.min;Ae.parameter(jt,Tr),et.minFilter=Tr[jt],qn.indexOf(et.minFilter)>=0&&!("faces"in Jt)&&(et.genMipmaps=!0)}if("mag"in Jt){var nn=Jt.mag;Ae.parameter(nn,Ar),et.magFilter=Ar[nn]}var aa=et.wrapS,$e=et.wrapT;if("wrap"in Jt){var Ge=Jt.wrap;typeof Ge=="string"?(Ae.parameter(Ge,Ir),aa=$e=Ir[Ge]):Array.isArray(Ge)&&(Ae.parameter(Ge[0],Ir),Ae.parameter(Ge[1],Ir),aa=Ir[Ge[0]],$e=Ir[Ge[1]])}else{if("wrapS"in Jt){var mt=Jt.wrapS;Ae.parameter(mt,Ir),aa=Ir[mt]}if("wrapT"in Jt){var Gt=Jt.wrapT;Ae.parameter(Gt,Ir),$e=Ir[Gt]}}if(et.wrapS=aa,et.wrapT=$e,"anisotropic"in Jt){var Ut=Jt.anisotropic;Ae(typeof Ut=="number"&&Ut>=1&&Ut<=it.maxAnisotropic,"aniso samples must be between 1 and "),et.anisotropic=Jt.anisotropic}if("mipmap"in Jt){var wt=!1;switch(typeof Jt.mipmap){case"string":Ae.parameter(Jt.mipmap,Mr,"invalid mipmap hint"),et.mipmapHint=Mr[Jt.mipmap],et.genMipmaps=!0,wt=!0;break;case"boolean":wt=et.genMipmaps=Jt.mipmap;break;case"object":Ae(Array.isArray(Jt.mipmap),"invalid mipmap type"),et.genMipmaps=!1,wt=!0;break;default:Ae.raise("invalid mipmap type")}wt&&!("min"in Jt)&&(et.minFilter=_e)}}function Za(et,Jt){ve.texParameteri(Jt,O,et.minFilter),ve.texParameteri(Jt,u,et.magFilter),ve.texParameteri(Jt,xo,et.wrapS),ve.texParameteri(Jt,$u,et.wrapT),We.ext_texture_filter_anisotropic&&ve.texParameteri(Jt,cr,et.anisotropic),et.genMipmaps&&(ve.hint(Je,et.mipmapHint),ve.generateMipmap(Jt))}var ri=0,li={},ii=it.maxTextureUnits,Pa=Array(ii).map(function(){return null});function Hn(et){Fe.call(this),this.mipmask=0,this.internalformat=an,this.id=ri++,this.refCount=1,this.target=et,this.texture=ve.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new La,ar.profile&&(this.stats={size:0})}function Bi(et){ve.activeTexture(Jn),ve.bindTexture(et.target,et.texture)}function Ln(){var et=Pa[0];et?ve.bindTexture(et.target,et.texture):ve.bindTexture(mo,null)}function On(et){var Jt=et.texture;Ae(Jt,"must not double destroy texture");var jt=et.unit,nn=et.target;jt>=0&&(ve.activeTexture(Jn+jt),ve.bindTexture(nn,null),Pa[jt]=null),ve.deleteTexture(Jt),et.texture=null,et.params=null,et.pixels=null,et.refCount=0,delete li[et.id],Yt.textureCount--}z(Hn.prototype,{bind:function(){var et=this;et.bindCount+=1;var Jt=et.unit;if(Jt<0){for(var jt=0;jt<ii;++jt){var nn=Pa[jt];if(nn){if(nn.bindCount>0)continue;nn.unit=-1}Pa[jt]=et,Jt=jt;break}Jt>=ii&&Ae.raise("insufficient number of texture units"),ar.profile&&Yt.maxTextureUnits<Jt+1&&(Yt.maxTextureUnits=Jt+1),et.unit=Jt,ve.activeTexture(Jn+Jt),ve.bindTexture(et.target,et.texture)}return Jt},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&On(this)}});function sa(et,Jt){var jt=new Hn(mo);li[jt.id]=jt,Yt.textureCount++;function nn(Ge,mt){var Gt=jt.texInfo;La.call(Gt);var Ut=Wn();return typeof Ge=="number"?typeof mt=="number"?tn(Ut,Ge|0,mt|0):tn(Ut,Ge|0,Ge|0):Ge?(Ae.type(Ge,"object","invalid arguments to regl.texture"),oa(Gt,Ge),Bn(Ut,Ge)):tn(Ut,1,1),Gt.genMipmaps&&(Ut.mipmask=(Ut.width<<1)-1),jt.mipmask=Ut.mipmask,tt(jt,Ut),Ae.texture2D(Gt,Ut,it),jt.internalformat=Ut.internalformat,nn.width=Ut.width,nn.height=Ut.height,Bi(jt),Fn(Ut,mo),Za(Gt,mo),Ln(),ti(Ut),ar.profile&&(jt.stats.size=Is(jt.internalformat,jt.type,Ut.width,Ut.height,Gt.genMipmaps,!1)),nn.format=ie[jt.internalformat],nn.type=le[jt.type],nn.mag=ge[Gt.magFilter],nn.min=me[Gt.minFilter],nn.wrapS=Le[Gt.wrapS],nn.wrapT=Le[Gt.wrapT],nn}function aa(Ge,mt,Gt,Ut){Ae(!!Ge,"must specify image data");var wt=mt|0,xt=Gt|0,At=Ut|0,Ke=Pr();return tt(Ke,jt),Ke.width=0,Ke.height=0,Nt(Ke,Ge),Ke.width=Ke.width||(jt.width>>At)-wt,Ke.height=Ke.height||(jt.height>>At)-xt,Ae(jt.type===Ke.type&&jt.format===Ke.format&&jt.internalformat===Ke.internalformat,"incompatible format for texture.subimage"),Ae(wt>=0&&xt>=0&&wt+Ke.width<=jt.width&&xt+Ke.height<=jt.height,"texture.subimage write out of bounds"),Ae(jt.mipmask&1<<At,"missing mipmap data"),Ae(Ke.data||Ke.element||Ke.needsCopy,"missing image data"),Bi(jt),_r(Ke,mo,wt,xt,At),Ln(),dn(Ke),nn}function $e(Ge,mt){var Gt=Ge|0,Ut=mt|0||Gt;if(Gt===jt.width&&Ut===jt.height)return nn;nn.width=jt.width=Gt,nn.height=jt.height=Ut,Bi(jt);for(var wt=0;jt.mipmask>>wt;++wt){var xt=Gt>>wt,At=Ut>>wt;if(!xt||!At)break;ve.texImage2D(mo,wt,jt.format,xt,At,0,jt.format,jt.type,null)}return Ln(),ar.profile&&(jt.stats.size=Is(jt.internalformat,jt.type,Gt,Ut,!1,!1)),nn}return nn(et,Jt),nn.subimage=aa,nn.resize=$e,nn._reglType="texture2d",nn._texture=jt,ar.profile&&(nn.stats=jt.stats),nn.destroy=function(){jt.decRef()},nn}function ba(et,Jt,jt,nn,aa,$e){var Ge=new Hn(lu);li[Ge.id]=Ge,Yt.cubeCount++;var mt=new Array(6);function Gt(xt,At,Ke,vt,Ve,kt){var zt,vr=Ge.texInfo;for(La.call(vr),zt=0;zt<6;++zt)mt[zt]=Wn();if(typeof xt=="number"||!xt){var gr=xt|0||1;for(zt=0;zt<6;++zt)tn(mt[zt],gr,gr)}else if(typeof xt=="object")if(At)Bn(mt[0],xt),Bn(mt[1],At),Bn(mt[2],Ke),Bn(mt[3],vt),Bn(mt[4],Ve),Bn(mt[5],kt);else if(oa(vr,xt),Mt(Ge,xt),"faces"in xt){var ur=xt.faces;for(Ae(Array.isArray(ur)&&ur.length===6,"cube faces must be a length 6 array"),zt=0;zt<6;++zt)Ae(typeof ur[zt]=="object"&&!!ur[zt],"invalid input for cube map face"),tt(mt[zt],Ge),Bn(mt[zt],ur[zt])}else for(zt=0;zt<6;++zt)Bn(mt[zt],xt);else Ae.raise("invalid arguments to cube map");for(tt(Ge,mt[0]),it.npotTextureCube||Ae(Ys(Ge.width)&&Ys(Ge.height),"your browser does not support non power or two texture dimensions"),vr.genMipmaps?Ge.mipmask=(mt[0].width<<1)-1:Ge.mipmask=mt[0].mipmask,Ae.textureCube(Ge,vr,mt,it),Ge.internalformat=mt[0].internalformat,Gt.width=mt[0].width,Gt.height=mt[0].height,Bi(Ge),zt=0;zt<6;++zt)Fn(mt[zt],na+zt);for(Za(vr,lu),Ln(),ar.profile&&(Ge.stats.size=Is(Ge.internalformat,Ge.type,Gt.width,Gt.height,vr.genMipmaps,!0)),Gt.format=ie[Ge.internalformat],Gt.type=le[Ge.type],Gt.mag=ge[vr.magFilter],Gt.min=me[vr.minFilter],Gt.wrapS=Le[vr.wrapS],Gt.wrapT=Le[vr.wrapT],zt=0;zt<6;++zt)ti(mt[zt]);return Gt}function Ut(xt,At,Ke,vt,Ve){Ae(!!At,"must specify image data"),Ae(typeof xt=="number"&&xt===(xt|0)&&xt>=0&&xt<6,"invalid face");var kt=Ke|0,zt=vt|0,vr=Ve|0,gr=Pr();return tt(gr,Ge),gr.width=0,gr.height=0,Nt(gr,At),gr.width=gr.width||(Ge.width>>vr)-kt,gr.height=gr.height||(Ge.height>>vr)-zt,Ae(Ge.type===gr.type&&Ge.format===gr.format&&Ge.internalformat===gr.internalformat,"incompatible format for texture.subimage"),Ae(kt>=0&&zt>=0&&kt+gr.width<=Ge.width&&zt+gr.height<=Ge.height,"texture.subimage write out of bounds"),Ae(Ge.mipmask&1<<vr,"missing mipmap data"),Ae(gr.data||gr.element||gr.needsCopy,"missing image data"),Bi(Ge),_r(gr,na+xt,kt,zt,vr),Ln(),dn(gr),Gt}function wt(xt){var At=xt|0;if(At!==Ge.width){Gt.width=Ge.width=At,Gt.height=Ge.height=At,Bi(Ge);for(var Ke=0;Ke<6;++Ke)for(var vt=0;Ge.mipmask>>vt;++vt)ve.texImage2D(na+Ke,vt,Ge.format,At>>vt,At>>vt,0,Ge.format,Ge.type,null);return Ln(),ar.profile&&(Ge.stats.size=Is(Ge.internalformat,Ge.type,Gt.width,Gt.height,!1,!0)),Gt}}return Gt(et,Jt,jt,nn,aa,$e),Gt.subimage=Ut,Gt.resize=wt,Gt._reglType="textureCube",Gt._texture=Ge,ar.profile&&(Gt.stats=Ge.stats),Gt.destroy=function(){Ge.decRef()},Gt}function yi(){for(var et=0;et<ii;++et)ve.activeTexture(Jn+et),ve.bindTexture(mo,null),Pa[et]=null;si(li).forEach(On),Yt.cubeCount=0,Yt.textureCount=0}ar.profile&&(Yt.getTotalTextureSize=function(){var et=0;return Object.keys(li).forEach(function(Jt){et+=li[Jt].stats.size}),et});function Ho(){for(var et=0;et<ii;++et){var Jt=Pa[et];Jt&&(Jt.bindCount=0,Jt.unit=-1,Pa[et]=null)}si(li).forEach(function(jt){jt.texture=ve.createTexture(),ve.bindTexture(jt.target,jt.texture);for(var nn=0;nn<32;++nn)if((jt.mipmask&1<<nn)!=0)if(jt.target===mo)ve.texImage2D(mo,nn,jt.internalformat,jt.width>>nn,jt.height>>nn,0,jt.internalformat,jt.type,null);else for(var aa=0;aa<6;++aa)ve.texImage2D(na+aa,nn,jt.internalformat,jt.width>>nn,jt.height>>nn,0,jt.internalformat,jt.type,null);Za(jt.texInfo,jt.target)})}function Uu(){for(var et=0;et<ii;++et){var Jt=Pa[et];Jt&&(Jt.bindCount=0,Jt.unit=-1,Pa[et]=null),ve.activeTexture(Jn+et),ve.bindTexture(mo,null),ve.bindTexture(lu,null)}}return{create2D:sa,createCube:ba,clear:yi,getTexture:function(et){return null},restore:Ho,refresh:Uu}}var Qr=36161,Os=32854,ca=32855,Lf=36194,Eu=33189,ls=36168,Df=34041,bu=35907,qu=34836,ef=34842,Nf=34843,Lo=[];Lo[Os]=2,Lo[ca]=2,Lo[Lf]=2,Lo[Eu]=2,Lo[ls]=1,Lo[Df]=4,Lo[bu]=4,Lo[qu]=16,Lo[ef]=8,Lo[Nf]=6;function Pf(ve,We,it){return Lo[ve]*We*it}var kf=function(ve,We,it,Zt,dr){var Yt={rgba4:Os,rgb565:Lf,"rgb5 a1":ca,depth:Eu,stencil:ls,"depth stencil":Df};We.ext_srgb&&(Yt.srgba=bu),We.ext_color_buffer_half_float&&(Yt.rgba16f=ef,Yt.rgb16f=Nf),We.webgl_color_buffer_float&&(Yt.rgba32f=qu);var ar=[];Object.keys(Yt).forEach(function(M){var G=Yt[M];ar[G]=M});var Mr=0,Ir={};function Ar(M){this.id=Mr++,this.refCount=1,this.renderbuffer=M,this.format=Os,this.width=0,this.height=0,dr.profile&&(this.stats={size:0})}Ar.prototype.decRef=function(){--this.refCount<=0&&Tr(this)};function Tr(M){var G=M.renderbuffer;Ae(G,"must not double destroy renderbuffer"),ve.bindRenderbuffer(Qr,null),ve.deleteRenderbuffer(G),M.renderbuffer=null,M.refCount=0,delete Ir[M.id],Zt.renderbufferCount--}function zr(M,G){var Y=new Ar(ve.createRenderbuffer());Ir[Y.id]=Y,Zt.renderbufferCount++;function re(le,ge){var me=0,Le=0,ze=Os;if(typeof le=="object"&&le){var Fe=le;if("shape"in Fe){var tt=Fe.shape;Ae(Array.isArray(tt)&&tt.length>=2,"invalid renderbuffer shape"),me=tt[0]|0,Le=tt[1]|0}else"radius"in Fe&&(me=Le=Fe.radius|0),"width"in Fe&&(me=Fe.width|0),"height"in Fe&&(Le=Fe.height|0);"format"in Fe&&(Ae.parameter(Fe.format,Yt,"invalid renderbuffer format"),ze=Yt[Fe.format])}else typeof le=="number"?(me=le|0,typeof ge=="number"?Le=ge|0:Le=me):le?Ae.raise("invalid arguments to renderbuffer constructor"):me=Le=1;if(Ae(me>0&&Le>0&&me<=it.maxRenderbufferSize&&Le<=it.maxRenderbufferSize,"invalid renderbuffer size"),!(me===Y.width&&Le===Y.height&&ze===Y.format))return re.width=Y.width=me,re.height=Y.height=Le,Y.format=ze,ve.bindRenderbuffer(Qr,Y.renderbuffer),ve.renderbufferStorage(Qr,ze,me,Le),Ae(ve.getError()===0,"invalid render buffer format"),dr.profile&&(Y.stats.size=Pf(Y.format,Y.width,Y.height)),re.format=ar[Y.format],re}function ie(le,ge){var me=le|0,Le=ge|0||me;return me===Y.width&&Le===Y.height||(Ae(me>0&&Le>0&&me<=it.maxRenderbufferSize&&Le<=it.maxRenderbufferSize,"invalid renderbuffer size"),re.width=Y.width=me,re.height=Y.height=Le,ve.bindRenderbuffer(Qr,Y.renderbuffer),ve.renderbufferStorage(Qr,Y.format,me,Le),Ae(ve.getError()===0,"invalid render buffer format"),dr.profile&&(Y.stats.size=Pf(Y.format,Y.width,Y.height))),re}return re(M,G),re.resize=ie,re._reglType="renderbuffer",re._renderbuffer=Y,dr.profile&&(re.stats=Y.stats),re.destroy=function(){Y.decRef()},re}dr.profile&&(Zt.getTotalRenderbufferSize=function(){var M=0;return Object.keys(Ir).forEach(function(G){M+=Ir[G].stats.size}),M});function f(){si(Ir).forEach(function(M){M.renderbuffer=ve.createRenderbuffer(),ve.bindRenderbuffer(Qr,M.renderbuffer),ve.renderbufferStorage(Qr,M.format,M.width,M.height)}),ve.bindRenderbuffer(Qr,null)}return{create:zr,clear:function(){si(Ir).forEach(Tr)},restore:f}},xi=36160,tf=36161,As=3553,rf=34069,nf=36064,dc=36096,hc=36128,vc=33306,af=36053,gc=36054,xu=36055,pc=36057,Rf=36061,ds=36193,tl=5121,Do=5126,Bf=6407,hs=6408,Ls=6402,yc=[Bf,hs],wu=[];wu[hs]=4,wu[Bf]=3;var Ds=[];Ds[tl]=1,Ds[Do]=4,Ds[ds]=2;var mc=32854,rl=32855,of=36194,Ff=33189,Gf=36168,Ec=34041,sf=35907,uf=34836,nl=34842,al=34843,bc=[mc,rl,of,sf,nl,al,uf],Js={};Js[af]="complete",Js[gc]="incomplete attachment",Js[pc]="incomplete dimensions",Js[xu]="incomplete, missing attachment",Js[Rf]="unsupported";function il(ve,We,it,Zt,dr,Yt){var ar={cur:null,next:null,dirty:!1,setFBO:null},Mr=["rgba"],Ir=["rgba4","rgb565","rgb5 a1"];We.ext_srgb&&Ir.push("srgba"),We.ext_color_buffer_half_float&&Ir.push("rgba16f","rgb16f"),We.webgl_color_buffer_float&&Ir.push("rgba32f");var Ar=["uint8"];We.oes_texture_half_float&&Ar.push("half float","float16"),We.oes_texture_float&&Ar.push("float","float32");function Tr(Tt,Nt,Lt){this.target=Tt,this.texture=Nt,this.renderbuffer=Lt;var _r=0,Yr=0;Nt?(_r=Nt.width,Yr=Nt.height):Lt&&(_r=Lt.width,Yr=Lt.height),this.width=_r,this.height=Yr}function zr(Tt){Tt&&(Tt.texture&&Tt.texture._texture.decRef(),Tt.renderbuffer&&Tt.renderbuffer._renderbuffer.decRef())}function f(Tt,Nt,Lt){if(!!Tt)if(Tt.texture){var _r=Tt.texture._texture,Yr=Math.max(1,_r.width),Pr=Math.max(1,_r.height);Ae(Yr===Nt&&Pr===Lt,"inconsistent width/height for supplied texture"),_r.refCount+=1}else{var dn=Tt.renderbuffer._renderbuffer;Ae(dn.width===Nt&&dn.height===Lt,"inconsistent width/height for renderbuffer"),dn.refCount+=1}}function M(Tt,Nt){Nt&&(Nt.texture?ve.framebufferTexture2D(xi,Tt,Nt.target,Nt.texture._texture.texture,0):ve.framebufferRenderbuffer(xi,Tt,tf,Nt.renderbuffer._renderbuffer.renderbuffer))}function G(Tt){var Nt=As,Lt=null,_r=null,Yr=Tt;typeof Tt=="object"&&(Yr=Tt.data,"target"in Tt&&(Nt=Tt.target|0)),Ae.type(Yr,"function","invalid attachment data");var Pr=Yr._reglType;return Pr==="texture2d"?(Lt=Yr,Ae(Nt===As)):Pr==="textureCube"?(Lt=Yr,Ae(Nt>=rf&&Nt<rf+6,"invalid cube map target")):Pr==="renderbuffer"?(_r=Yr,Nt=tf):Ae.raise("invalid regl object for attachment"),new Tr(Nt,Lt,_r)}function Y(Tt,Nt,Lt,_r,Yr){if(Lt){var Pr=Zt.create2D({width:Tt,height:Nt,format:_r,type:Yr});return Pr._texture.refCount=0,new Tr(As,Pr,null)}else{var dn=dr.create({width:Tt,height:Nt,format:_r});return dn._renderbuffer.refCount=0,new Tr(tf,null,dn)}}function re(Tt){return Tt&&(Tt.texture||Tt.renderbuffer)}function ie(Tt,Nt,Lt){Tt&&(Tt.texture?Tt.texture.resize(Nt,Lt):Tt.renderbuffer&&Tt.renderbuffer.resize(Nt,Lt),Tt.width=Nt,Tt.height=Lt)}var le=0,ge={};function me(){this.id=le++,ge[this.id]=this,this.framebuffer=ve.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function Le(Tt){Tt.colorAttachments.forEach(zr),zr(Tt.depthAttachment),zr(Tt.stencilAttachment),zr(Tt.depthStencilAttachment)}function ze(Tt){var Nt=Tt.framebuffer;Ae(Nt,"must not double destroy framebuffer"),ve.deleteFramebuffer(Nt),Tt.framebuffer=null,Yt.framebufferCount--,delete ge[Tt.id]}function Fe(Tt){var Nt;ve.bindFramebuffer(xi,Tt.framebuffer);var Lt=Tt.colorAttachments;for(Nt=0;Nt<Lt.length;++Nt)M(nf+Nt,Lt[Nt]);for(Nt=Lt.length;Nt<it.maxColorAttachments;++Nt)ve.framebufferTexture2D(xi,nf+Nt,As,null,0);ve.framebufferTexture2D(xi,vc,As,null,0),ve.framebufferTexture2D(xi,dc,As,null,0),ve.framebufferTexture2D(xi,hc,As,null,0),M(dc,Tt.depthAttachment),M(hc,Tt.stencilAttachment),M(vc,Tt.depthStencilAttachment);var _r=ve.checkFramebufferStatus(xi);!ve.isContextLost()&&_r!==af&&Ae.raise("framebuffer configuration not supported, status = "+Js[_r]),ve.bindFramebuffer(xi,ar.next?ar.next.framebuffer:null),ar.cur=ar.next,ve.getError()}function tt(Tt,Nt){var Lt=new me;Yt.framebufferCount++;function _r(Pr,dn){var sn;Ae(ar.next!==Lt,"can not update framebuffer which is currently in use");var tn=0,Bn=0,Fn=!0,za=!0,Wn=null,ti=!0,La="rgba",oa="uint8",Za=1,ri=null,li=null,ii=null,Pa=!1;if(typeof Pr=="number")tn=Pr|0,Bn=dn|0||tn;else if(!Pr)tn=Bn=1;else{Ae.type(Pr,"object","invalid arguments for framebuffer");var Hn=Pr;if("shape"in Hn){var Bi=Hn.shape;Ae(Array.isArray(Bi)&&Bi.length>=2,"invalid shape for framebuffer"),tn=Bi[0],Bn=Bi[1]}else"radius"in Hn&&(tn=Bn=Hn.radius),"width"in Hn&&(tn=Hn.width),"height"in Hn&&(Bn=Hn.height);("color"in Hn||"colors"in Hn)&&(Wn=Hn.color||Hn.colors,Array.isArray(Wn)&&Ae(Wn.length===1||We.webgl_draw_buffers,"multiple render targets not supported")),Wn||("colorCount"in Hn&&(Za=Hn.colorCount|0,Ae(Za>0,"invalid color buffer count")),"colorTexture"in Hn&&(ti=!!Hn.colorTexture,La="rgba4"),"colorType"in Hn&&(oa=Hn.colorType,ti?(Ae(We.oes_texture_float||!(oa==="float"||oa==="float32"),"you must enable OES_texture_float in order to use floating point framebuffer objects"),Ae(We.oes_texture_half_float||!(oa==="half float"||oa==="float16"),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):oa==="half float"||oa==="float16"?(Ae(We.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),La="rgba16f"):(oa==="float"||oa==="float32")&&(Ae(We.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),La="rgba32f"),Ae.oneOf(oa,Ar,"invalid color type")),"colorFormat"in Hn&&(La=Hn.colorFormat,Mr.indexOf(La)>=0?ti=!0:Ir.indexOf(La)>=0?ti=!1:ti?Ae.oneOf(Hn.colorFormat,Mr,"invalid color format for texture"):Ae.oneOf(Hn.colorFormat,Ir,"invalid color format for renderbuffer"))),("depthTexture"in Hn||"depthStencilTexture"in Hn)&&(Pa=!!(Hn.depthTexture||Hn.depthStencilTexture),Ae(!Pa||We.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in Hn&&(typeof Hn.depth=="boolean"?Fn=Hn.depth:(ri=Hn.depth,za=!1)),"stencil"in Hn&&(typeof Hn.stencil=="boolean"?za=Hn.stencil:(li=Hn.stencil,Fn=!1)),"depthStencil"in Hn&&(typeof Hn.depthStencil=="boolean"?Fn=za=Hn.depthStencil:(ii=Hn.depthStencil,Fn=!1,za=!1))}var Ln=null,On=null,sa=null,ba=null;if(Array.isArray(Wn))Ln=Wn.map(G);else if(Wn)Ln=[G(Wn)];else for(Ln=new Array(Za),sn=0;sn<Za;++sn)Ln[sn]=Y(tn,Bn,ti,La,oa);Ae(We.webgl_draw_buffers||Ln.length<=1,"you must enable the WEBGL_draw_buffers extension in order to use multiple color buffers."),Ae(Ln.length<=it.maxColorAttachments,"too many color attachments, not supported"),tn=tn||Ln[0].width,Bn=Bn||Ln[0].height,ri?On=G(ri):Fn&&!za&&(On=Y(tn,Bn,Pa,"depth","uint32")),li?sa=G(li):za&&!Fn&&(sa=Y(tn,Bn,!1,"stencil","uint8")),ii?ba=G(ii):!ri&&!li&&za&&Fn&&(ba=Y(tn,Bn,Pa,"depth stencil","depth stencil")),Ae(!!ri+!!li+!!ii<=1,"invalid framebuffer configuration, can specify exactly one depth/stencil attachment");var yi=null;for(sn=0;sn<Ln.length;++sn)if(f(Ln[sn],tn,Bn),Ae(!Ln[sn]||Ln[sn].texture&&yc.indexOf(Ln[sn].texture._texture.format)>=0||Ln[sn].renderbuffer&&bc.indexOf(Ln[sn].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+sn+" is invalid"),Ln[sn]&&Ln[sn].texture){var Ho=wu[Ln[sn].texture._texture.format]*Ds[Ln[sn].texture._texture.type];yi===null?yi=Ho:Ae(yi===Ho,"all color attachments much have the same number of bits per pixel.")}return f(On,tn,Bn),Ae(!On||On.texture&&On.texture._texture.format===Ls||On.renderbuffer&&On.renderbuffer._renderbuffer.format===Ff,"invalid depth attachment for framebuffer object"),f(sa,tn,Bn),Ae(!sa||sa.renderbuffer&&sa.renderbuffer._renderbuffer.format===Gf,"invalid stencil attachment for framebuffer object"),f(ba,tn,Bn),Ae(!ba||ba.texture&&ba.texture._texture.format===Ec||ba.renderbuffer&&ba.renderbuffer._renderbuffer.format===Ec,"invalid depth-stencil attachment for framebuffer object"),Le(Lt),Lt.width=tn,Lt.height=Bn,Lt.colorAttachments=Ln,Lt.depthAttachment=On,Lt.stencilAttachment=sa,Lt.depthStencilAttachment=ba,_r.color=Ln.map(re),_r.depth=re(On),_r.stencil=re(sa),_r.depthStencil=re(ba),_r.width=Lt.width,_r.height=Lt.height,Fe(Lt),_r}function Yr(Pr,dn){Ae(ar.next!==Lt,"can not resize a framebuffer which is currently in use");var sn=Math.max(Pr|0,1),tn=Math.max(dn|0||sn,1);if(sn===Lt.width&&tn===Lt.height)return _r;for(var Bn=Lt.colorAttachments,Fn=0;Fn<Bn.length;++Fn)ie(Bn[Fn],sn,tn);return ie(Lt.depthAttachment,sn,tn),ie(Lt.stencilAttachment,sn,tn),ie(Lt.depthStencilAttachment,sn,tn),Lt.width=_r.width=sn,Lt.height=_r.height=tn,Fe(Lt),_r}return _r(Tt,Nt),z(_r,{resize:Yr,_reglType:"framebuffer",_framebuffer:Lt,destroy:function(){ze(Lt),Le(Lt)},use:function(Pr){ar.setFBO({framebuffer:_r},Pr)}})}function Mt(Tt){var Nt=Array(6);function Lt(Yr){var Pr;Ae(Nt.indexOf(ar.next)<0,"can not update framebuffer which is currently in use");var dn={color:null},sn=0,tn=null,Bn="rgba",Fn="uint8",za=1;if(typeof Yr=="number")sn=Yr|0;else if(!Yr)sn=1;else{Ae.type(Yr,"object","invalid arguments for framebuffer");var Wn=Yr;if("shape"in Wn){var ti=Wn.shape;Ae(Array.isArray(ti)&&ti.length>=2,"invalid shape for framebuffer"),Ae(ti[0]===ti[1],"cube framebuffer must be square"),sn=ti[0]}else"radius"in Wn&&(sn=Wn.radius|0),"width"in Wn?(sn=Wn.width|0,"height"in Wn&&Ae(Wn.height===sn,"must be square")):"height"in Wn&&(sn=Wn.height|0);("color"in Wn||"colors"in Wn)&&(tn=Wn.color||Wn.colors,Array.isArray(tn)&&Ae(tn.length===1||We.webgl_draw_buffers,"multiple render targets not supported")),tn||("colorCount"in Wn&&(za=Wn.colorCount|0,Ae(za>0,"invalid color buffer count")),"colorType"in Wn&&(Ae.oneOf(Wn.colorType,Ar,"invalid color type"),Fn=Wn.colorType),"colorFormat"in Wn&&(Bn=Wn.colorFormat,Ae.oneOf(Wn.colorFormat,Mr,"invalid color format for texture"))),"depth"in Wn&&(dn.depth=Wn.depth),"stencil"in Wn&&(dn.stencil=Wn.stencil),"depthStencil"in Wn&&(dn.depthStencil=Wn.depthStencil)}var La;if(tn)if(Array.isArray(tn))for(La=[],Pr=0;Pr<tn.length;++Pr)La[Pr]=tn[Pr];else La=[tn];else{La=Array(za);var oa={radius:sn,format:Bn,type:Fn};for(Pr=0;Pr<za;++Pr)La[Pr]=Zt.createCube(oa)}for(dn.color=Array(La.length),Pr=0;Pr<La.length;++Pr){var Za=La[Pr];Ae(typeof Za=="function"&&Za._reglType==="textureCube","invalid cube map"),sn=sn||Za.width,Ae(Za.width===sn&&Za.height===sn,"invalid cube map shape"),dn.color[Pr]={target:rf,data:La[Pr]}}for(Pr=0;Pr<6;++Pr){for(var ri=0;ri<La.length;++ri)dn.color[ri].target=rf+Pr;Pr>0&&(dn.depth=Nt[0].depth,dn.stencil=Nt[0].stencil,dn.depthStencil=Nt[0].depthStencil),Nt[Pr]?Nt[Pr](dn):Nt[Pr]=tt(dn)}return z(Lt,{width:sn,height:sn,color:La})}function _r(Yr){var Pr,dn=Yr|0;if(Ae(dn>0&&dn<=it.maxCubeMapSize,"invalid radius for cube fbo"),dn===Lt.width)return Lt;var sn=Lt.color;for(Pr=0;Pr<sn.length;++Pr)sn[Pr].resize(dn);for(Pr=0;Pr<6;++Pr)Nt[Pr].resize(dn);return Lt.width=Lt.height=dn,Lt}return Lt(Tt),z(Lt,{faces:Nt,resize:_r,_reglType:"framebufferCube",destroy:function(){Nt.forEach(function(Yr){Yr.destroy()})}})}function sr(){ar.cur=null,ar.next=null,ar.dirty=!0,si(ge).forEach(function(Tt){Tt.framebuffer=ve.createFramebuffer(),Fe(Tt)})}return z(ar,{getFramebuffer:function(Tt){if(typeof Tt=="function"&&Tt._reglType==="framebuffer"){var Nt=Tt._framebuffer;if(Nt instanceof me)return Nt}return null},create:tt,createCube:Mt,clear:function(){si(ge).forEach(ze)},restore:sr})}var xc=5126,Su=34962;function jo(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=xc,this.offset=0,this.stride=0,this.divisor=0}function ol(ve,We,it,Zt,dr){for(var Yt=it.maxAttributes,ar=new Array(Yt),Mr=0;Mr<Yt;++Mr)ar[Mr]=new jo;var Ir=0,Ar={},Tr={Record:jo,scope:{},state:ar,currentVAO:null,targetVAO:null,restore:f()?ge:function(){},createVAO:me,getVAO:G,destroyBuffer:zr,setVAO:f()?Y:re,clear:f()?ie:function(){}};function zr(Le){for(var ze=0;ze<ar.length;++ze){var Fe=ar[ze];Fe.buffer===Le&&(ve.disableVertexAttribArray(ze),Fe.buffer=null)}}function f(){return We.oes_vertex_array_object}function M(){return We.angle_instanced_arrays}function G(Le){return typeof Le=="function"&&Le._vao?Le._vao:null}function Y(Le){if(Le!==Tr.currentVAO){var ze=f();Le?ze.bindVertexArrayOES(Le.vao):ze.bindVertexArrayOES(null),Tr.currentVAO=Le}}function re(Le){if(Le!==Tr.currentVAO){if(Le)Le.bindAttrs();else for(var ze=M(),Fe=0;Fe<ar.length;++Fe){var tt=ar[Fe];tt.buffer?(ve.enableVertexAttribArray(Fe),ve.vertexAttribPointer(Fe,tt.size,tt.type,tt.normalized,tt.stride,tt.offfset),ze&&tt.divisor&&ze.vertexAttribDivisorANGLE(Fe,tt.divisor)):(ve.disableVertexAttribArray(Fe),ve.vertexAttrib4f(Fe,tt.x,tt.y,tt.z,tt.w))}Tr.currentVAO=Le}}function ie(){si(Ar).forEach(function(Le){Le.destroy()})}function le(){this.id=++Ir,this.attributes=[];var Le=f();Le?this.vao=Le.createVertexArrayOES():this.vao=null,Ar[this.id]=this,this.buffers=[]}le.prototype.bindAttrs=function(){for(var Le=M(),ze=this.attributes,Fe=0;Fe<ze.length;++Fe){var tt=ze[Fe];tt.buffer?(ve.enableVertexAttribArray(Fe),ve.bindBuffer(Su,tt.buffer.buffer),ve.vertexAttribPointer(Fe,tt.size,tt.type,tt.normalized,tt.stride,tt.offset),Le&&tt.divisor&&Le.vertexAttribDivisorANGLE(Fe,tt.divisor)):(ve.disableVertexAttribArray(Fe),ve.vertexAttrib4f(Fe,tt.x,tt.y,tt.z,tt.w))}for(var Mt=ze.length;Mt<Yt;++Mt)ve.disableVertexAttribArray(Mt)},le.prototype.refresh=function(){var Le=f();Le&&(Le.bindVertexArrayOES(this.vao),this.bindAttrs(),Tr.currentVAO=this)},le.prototype.destroy=function(){if(this.vao){var Le=f();this===Tr.currentVAO&&(Tr.currentVAO=null,Le.bindVertexArrayOES(null)),Le.deleteVertexArrayOES(this.vao),this.vao=null}Ar[this.id]&&(delete Ar[this.id],Zt.vaoCount-=1)};function ge(){var Le=f();Le&&si(Ar).forEach(function(ze){ze.refresh()})}function me(Le){var ze=new le;Zt.vaoCount+=1;function Fe(tt){Ae(Array.isArray(tt),"arguments to vertex array constructor must be an array"),Ae(tt.length<Yt,"too many attributes"),Ae(tt.length>0,"must specify at least one attribute");var Mt={},sr=ze.attributes;sr.length=tt.length;for(var Tt=0;Tt<tt.length;++Tt){var Nt=tt[Tt],Lt=sr[Tt]=new jo,_r=Nt.data||Nt;if(Array.isArray(_r)||U(_r)||qa(_r)){var Yr;ze.buffers[Tt]&&(Yr=ze.buffers[Tt],U(_r)&&Yr._buffer.byteLength>=_r.byteLength?Yr.subdata(_r):(Yr.destroy(),ze.buffers[Tt]=null)),ze.buffers[Tt]||(Yr=ze.buffers[Tt]=dr.create(Nt,Su,!1,!0)),Lt.buffer=dr.getBuffer(Yr),Lt.size=Lt.buffer.dimension|0,Lt.normalized=!1,Lt.type=Lt.buffer.dtype,Lt.offset=0,Lt.stride=0,Lt.divisor=0,Lt.state=1,Mt[Tt]=1}else dr.getBuffer(Nt)?(Lt.buffer=dr.getBuffer(Nt),Lt.size=Lt.buffer.dimension|0,Lt.normalized=!1,Lt.type=Lt.buffer.dtype,Lt.offset=0,Lt.stride=0,Lt.divisor=0,Lt.state=1):dr.getBuffer(Nt.buffer)?(Lt.buffer=dr.getBuffer(Nt.buffer),Lt.size=(+Nt.size||Lt.buffer.dimension)|0,Lt.normalized=!!Nt.normalized||!1,"type"in Nt?(Ae.parameter(Nt.type,Hi,"invalid buffer type"),Lt.type=Hi[Nt.type]):Lt.type=Lt.buffer.dtype,Lt.offset=(Nt.offset||0)|0,Lt.stride=(Nt.stride||0)|0,Lt.divisor=(Nt.divisor||0)|0,Lt.state=1,Ae(Lt.size>=1&&Lt.size<=4,"size must be between 1 and 4"),Ae(Lt.offset>=0,"invalid offset"),Ae(Lt.stride>=0&&Lt.stride<=255,"stride must be between 0 and 255"),Ae(Lt.divisor>=0,"divisor must be positive"),Ae(!Lt.divisor||!!We.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in Nt?(Ae(Tt>0,"first attribute must not be a constant"),Lt.x=+Nt.x||0,Lt.y=+Nt.y||0,Lt.z=+Nt.z||0,Lt.w=+Nt.w||0,Lt.state=2):Ae(!1,"invalid attribute spec for location "+Tt)}for(var Pr=0;Pr<ze.buffers.length;++Pr)!Mt[Pr]&&ze.buffers[Pr]&&(ze.buffers[Pr].destroy(),ze.buffers[Pr]=null);return ze.refresh(),Fe}return Fe.destroy=function(){for(var tt=0;tt<ze.buffers.length;++tt)ze.buffers[tt]&&ze.buffers[tt].destroy();ze.buffers.length=0,ze.destroy()},Fe._vao=ze,Fe._reglType="vao",Fe(Le)}return Tr}var _u=35632,sl=35633,ul=35718,ki=35721;function fl(ve,We,it,Zt){var dr={},Yt={};function ar(Y,re,ie,le){this.name=Y,this.id=re,this.location=ie,this.info=le}function Mr(Y,re){for(var ie=0;ie<Y.length;++ie)if(Y[ie].id===re.id){Y[ie].location=re.location;return}Y.push(re)}function Ir(Y,re,ie){var le=Y===_u?dr:Yt,ge=le[re];if(!ge){var me=We.str(re);ge=ve.createShader(Y),ve.shaderSource(ge,me),ve.compileShader(ge),Ae.shaderError(ve,ge,me,Y,ie),le[re]=ge}return ge}var Ar={},Tr=[],zr=0;function f(Y,re){this.id=zr++,this.fragId=Y,this.vertId=re,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,Zt.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function M(Y,re,ie){var le,ge,me=Ir(_u,Y.fragId),Le=Ir(sl,Y.vertId),ze=Y.program=ve.createProgram();if(ve.attachShader(ze,me),ve.attachShader(ze,Le),ie)for(le=0;le<ie.length;++le){var Fe=ie[le];ve.bindAttribLocation(ze,Fe[0],Fe[1])}ve.linkProgram(ze),Ae.linkError(ve,ze,We.str(Y.fragId),We.str(Y.vertId),re);var tt=ve.getProgramParameter(ze,ul);Zt.profile&&(Y.stats.uniformsCount=tt);var Mt=Y.uniforms;for(le=0;le<tt;++le)if(ge=ve.getActiveUniform(ze,le),ge)if(ge.size>1)for(var sr=0;sr<ge.size;++sr){var Tt=ge.name.replace("[0]","["+sr+"]");Mr(Mt,new ar(Tt,We.id(Tt),ve.getUniformLocation(ze,Tt),ge))}else Mr(Mt,new ar(ge.name,We.id(ge.name),ve.getUniformLocation(ze,ge.name),ge));var Nt=ve.getProgramParameter(ze,ki);Zt.profile&&(Y.stats.attributesCount=Nt);var Lt=Y.attributes;for(le=0;le<Nt;++le)ge=ve.getActiveAttrib(ze,le),ge&&Mr(Lt,new ar(ge.name,We.id(ge.name),ve.getAttribLocation(ze,ge.name),ge))}Zt.profile&&(it.getMaxUniformsCount=function(){var Y=0;return Tr.forEach(function(re){re.stats.uniformsCount>Y&&(Y=re.stats.uniformsCount)}),Y},it.getMaxAttributesCount=function(){var Y=0;return Tr.forEach(function(re){re.stats.attributesCount>Y&&(Y=re.stats.attributesCount)}),Y});function G(){dr={},Yt={};for(var Y=0;Y<Tr.length;++Y)M(Tr[Y],null,Tr[Y].attributes.map(function(re){return[re.location,re.name]}))}return{clear:function(){var Y=ve.deleteShader.bind(ve);si(dr).forEach(Y),dr={},si(Yt).forEach(Y),Yt={},Tr.forEach(function(re){ve.deleteProgram(re.program)}),Tr.length=0,Ar={},it.shaderCount=0},program:function(Y,re,ie,le){Ae.command(Y>=0,"missing vertex shader",ie),Ae.command(re>=0,"missing fragment shader",ie);var ge=Ar[re];ge||(ge=Ar[re]={});var me=ge[Y];if(me&&(me.refCount++,!le))return me;var Le=new f(re,Y);return it.shaderCount++,M(Le,ie,le),me||(ge[Y]=Le),Tr.push(Le),z(Le,{destroy:function(){if(Le.refCount--,Le.refCount<=0){ve.deleteProgram(Le.program);var ze=Tr.indexOf(Le);Tr.splice(ze,1),it.shaderCount--}ge[Le.vertId].refCount<=0&&(ve.deleteShader(Yt[Le.vertId]),delete Yt[Le.vertId],delete Ar[Le.fragId][Le.vertId]),Object.keys(Ar[Le.fragId]).length||(ve.deleteShader(dr[Le.fragId]),delete dr[Le.fragId],delete Ar[Le.fragId])}})},restore:G,shader:Ir,frag:-1,vert:-1}}var wc=6408,Mu=5121,ff=3333,To=5126;function Sc(ve,We,it,Zt,dr,Yt,ar){function Mr(Tr){var zr;We.next===null?(Ae(dr.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),zr=Mu):(Ae(We.next.colorAttachments[0].texture!==null,"You cannot read from a renderbuffer"),zr=We.next.colorAttachments[0].texture._texture.type,Yt.oes_texture_float?(Ae(zr===Mu||zr===To,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"),zr===To&&Ae(ar.readFloat,"Reading 'float' values is not permitted in your browser. For a fallback, please see: https://www.npmjs.com/package/glsl-read-float")):Ae(zr===Mu,"Reading from a framebuffer is only allowed for the type 'uint8'"));var f=0,M=0,G=Zt.framebufferWidth,Y=Zt.framebufferHeight,re=null;U(Tr)?re=Tr:Tr&&(Ae.type(Tr,"object","invalid arguments to regl.read()"),f=Tr.x|0,M=Tr.y|0,Ae(f>=0&&f<Zt.framebufferWidth,"invalid x offset for regl.read"),Ae(M>=0&&M<Zt.framebufferHeight,"invalid y offset for regl.read"),G=(Tr.width||Zt.framebufferWidth-f)|0,Y=(Tr.height||Zt.framebufferHeight-M)|0,re=Tr.data||null),re&&(zr===Mu?Ae(re instanceof Uint8Array,"buffer must be 'Uint8Array' when reading from a framebuffer of type 'uint8'"):zr===To&&Ae(re instanceof Float32Array,"buffer must be 'Float32Array' when reading from a framebuffer of type 'float'")),Ae(G>0&&G+f<=Zt.framebufferWidth,"invalid width for read pixels"),Ae(Y>0&&Y+M<=Zt.framebufferHeight,"invalid height for read pixels"),it();var ie=G*Y*4;return re||(zr===Mu?re=new Uint8Array(ie):zr===To&&(re=re||new Float32Array(ie))),Ae.isTypedArray(re,"data buffer for regl.read() must be a typedarray"),Ae(re.byteLength>=ie,"data buffer for regl.read() too small"),ve.pixelStorei(ff,4),ve.readPixels(f,M,G,Y,wc,zr,re),re}function Ir(Tr){var zr;return We.setFBO({framebuffer:Tr.framebuffer},function(){zr=Mr(Tr)}),zr}function Ar(Tr){return!Tr||!("framebuffer"in Tr)?Mr(Tr):Ir(Tr)}return Ar}function qs(ve){return Array.prototype.slice.call(ve)}function Ns(ve){return qs(ve).join("")}function Kr(){var ve=0,We=[],it=[];function Zt(zr){for(var f=0;f<it.length;++f)if(it[f]===zr)return We[f];var M="g"+ve++;return We.push(M),it.push(zr),M}function dr(){var zr=[];function f(){zr.push.apply(zr,qs(arguments))}var M=[];function G(){var Y="v"+ve++;return M.push(Y),arguments.length>0&&(zr.push(Y,"="),zr.push.apply(zr,qs(arguments)),zr.push(";")),Y}return z(f,{def:G,toString:function(){return Ns([M.length>0?"var "+M.join(",")+";":"",Ns(zr)])}})}function Yt(){var zr=dr(),f=dr(),M=zr.toString,G=f.toString;function Y(re,ie){f(re,ie,"=",zr.def(re,ie),";")}return z(function(){zr.apply(zr,qs(arguments))},{def:zr.def,entry:zr,exit:f,save:Y,set:function(re,ie,le){Y(re,ie),zr(re,ie,"=",le,";")},toString:function(){return M()+G()}})}function ar(){var zr=Ns(arguments),f=Yt(),M=Yt(),G=f.toString,Y=M.toString;return z(f,{then:function(){return f.apply(f,qs(arguments)),this},else:function(){return M.apply(M,qs(arguments)),this},toString:function(){var re=Y();return re&&(re="else{"+re+"}"),Ns(["if(",zr,"){",G(),"}",re])}})}var Mr=dr(),Ir={};function Ar(zr,f){var M=[];function G(){var ge="a"+M.length;return M.push(ge),ge}f=f||0;for(var Y=0;Y<f;++Y)G();var re=Yt(),ie=re.toString,le=Ir[zr]=z(re,{arg:G,toString:function(){return Ns(["function(",M.join(),"){",ie(),"}"])}});return le}function Tr(){var zr=['"use strict";',Mr,"return {"];Object.keys(Ir).forEach(function(G){zr.push('"',G,'":',Ir[G].toString(),",")}),zr.push("}");var f=Ns(zr).replace(/;/g,`;
  628. `).replace(/}/g,`}
  629. `).replace(/{/g,`{
  630. `),M=Function.apply(null,We.concat(f));return M.apply(null,it)}return{global:Mr,link:Zt,block:dr,proc:Ar,scope:Yt,cond:ar,compile:Tr}}var Cu="xyzw".split(""),_c=5121,so=1,Ps=2,zf=0,ks=1,eu=2,tu=3,Tu=4,Mc=5,Cc=6,Tc="dither",Uf="blend.enable",Wf="blend.color",jf="blend.equation",cf="blend.func",Xf="depth.enable",Vf="depth.func",Iu="depth.range",Rs="depth.mask",Oi="colorMask",gt="cull.enable",cl="cull.face",Ou="frontFace",Yf="lineWidth",ll="polygonOffset.enable",Ic="polygonOffset.offset",dl="sample.alpha",hl="sample.enable",lf="sample.coverage",Hf="stencil.enable",Oc="stencil.mask",Zf="stencil.func",Mi="stencil.opFront",Au="stencil.opBack",gi="scissor.enable",Lu="scissor.box",Xo="viewport",vs="profile",Bs="framebuffer",gs="vert",ru="frag",ps="elements",ra="primitive",wo="count",Fs="offset",df="instances",Du="vao",Kf="Width",$f="Height",ea=Bs+Kf,Io=Bs+$f,nu=Xo+Kf,Qf=Xo+$f,hf="drawingBuffer",Jf=hf+Kf,qf=hf+$f,Ac=[cf,jf,Zf,Mi,Au,lf,Xo,Lu,Ic],Gs=34962,Lc=34963,Dc=35632,Nc=35633,Pc=3553,Vo=34067,vl=2884,kc=3042,Rc=3024,gl=2960,Bc=2929,Fc=3089,Gc=32823,zs=32926,Nu=32928,au=5126,Pu=35664,Us=35665,vf=35666,ec=5124,gf=35667,pf=35668,Ws=35669,tc=35670,yf=35671,mf=35672,ku=35673,iu=35674,Aa=35675,ou=35676,Ru=35678,js=35680,zc=4,Bu=1028,ys=1029,Uc=2304,su=2305,pl=32775,yl=32776,Kn=519,ms=7680,Qi=0,Wc=1,rc=32774,ml=513,jc=36160,El=36064,pi={"0":0,"1":1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Xc=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],uu={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Es={"0":0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Vc={frag:Dc,vert:Nc},Fu={cw:Uc,ccw:su};function Gu(ve){return Array.isArray(ve)||U(ve)||qa(ve)}function Yc(ve){return ve.sort(function(We,it){return We===Xo?-1:it===Xo?1:We<it?-1:1})}function Ji(ve,We,it,Zt){this.thisDep=ve,this.contextDep=We,this.propDep=it,this.append=Zt}function bs(ve){return ve&&!(ve.thisDep||ve.contextDep||ve.propDep)}function ci(ve){return new Ji(!1,!1,!1,ve)}function Ri(ve,We){var it=ve.type;if(it===zf){var Zt=ve.data.length;return new Ji(!0,Zt>=1,Zt>=2,We)}else if(it===Tu){var dr=ve.data;return new Ji(dr.thisDep,dr.contextDep,dr.propDep,We)}else{if(it===Mc)return new Ji(!1,!1,!1,We);if(it===Cc){for(var Yt=!1,ar=!1,Mr=!1,Ir=0;Ir<ve.data.length;++Ir){var Ar=ve.data[Ir];if(Ar.type===ks)Mr=!0;else if(Ar.type===eu)ar=!0;else if(Ar.type===tu)Yt=!0;else if(Ar.type===zf){Yt=!0;var Tr=Ar.data;Tr>=1&&(ar=!0),Tr>=2&&(Mr=!0)}else Ar.type===Tu&&(Yt=Yt||Ar.data.thisDep,ar=ar||Ar.data.contextDep,Mr=Mr||Ar.data.propDep)}return new Ji(Yt,ar,Mr,We)}else return new Ji(it===tu,it===eu,it===ks,We)}}var Ef=new Ji(!1,!1,!1,function(){});function bl(ve,We,it,Zt,dr,Yt,ar,Mr,Ir,Ar,Tr,zr,f,M,G){var Y=Ar.Record,re={add:32774,subtract:32778,"reverse subtract":32779};it.ext_blend_minmax&&(re.min=pl,re.max=yl);var ie=it.angle_instanced_arrays,le=it.webgl_draw_buffers,ge={dirty:!0,profile:G.profile},me={},Le=[],ze={},Fe={};function tt($e){return $e.replace(".","_")}function Mt($e,Ge,mt){var Gt=tt($e);Le.push($e),me[Gt]=ge[Gt]=!!mt,ze[Gt]=Ge}function sr($e,Ge,mt){var Gt=tt($e);Le.push($e),Array.isArray(mt)?(ge[Gt]=mt.slice(),me[Gt]=mt.slice()):ge[Gt]=me[Gt]=mt,Fe[Gt]=Ge}Mt(Tc,Rc),Mt(Uf,kc),sr(Wf,"blendColor",[0,0,0,0]),sr(jf,"blendEquationSeparate",[rc,rc]),sr(cf,"blendFuncSeparate",[Wc,Qi,Wc,Qi]),Mt(Xf,Bc,!0),sr(Vf,"depthFunc",ml),sr(Iu,"depthRange",[0,1]),sr(Rs,"depthMask",!0),sr(Oi,Oi,[!0,!0,!0,!0]),Mt(gt,vl),sr(cl,"cullFace",ys),sr(Ou,Ou,su),sr(Yf,Yf,1),Mt(ll,Gc),sr(Ic,"polygonOffset",[0,0]),Mt(dl,zs),Mt(hl,Nu),sr(lf,"sampleCoverage",[1,!1]),Mt(Hf,gl),sr(Oc,"stencilMask",-1),sr(Zf,"stencilFunc",[Kn,0,-1]),sr(Mi,"stencilOpSeparate",[Bu,ms,ms,ms]),sr(Au,"stencilOpSeparate",[ys,ms,ms,ms]),Mt(gi,Fc),sr(Lu,"scissor",[0,0,ve.drawingBufferWidth,ve.drawingBufferHeight]),sr(Xo,Xo,[0,0,ve.drawingBufferWidth,ve.drawingBufferHeight]);var Tt={gl:ve,context:f,strings:We,next:me,current:ge,draw:zr,elements:Yt,buffer:dr,shader:Tr,attributes:Ar.state,vao:Ar,uniforms:Ir,framebuffer:Mr,extensions:it,timer:M,isBufferArgs:Gu},Nt={primTypes:Pi,compareFuncs:uu,blendFuncs:pi,blendEquations:re,stencilOps:Es,glTypes:Hi,orientationType:Fu};Ae.optional(function(){Tt.isArrayLike=ka}),le&&(Nt.backBuffer=[ys],Nt.drawBuffer=ln(Zt.maxDrawbuffers,function($e){return $e===0?[0]:ln($e,function(Ge){return El+Ge})}));var Lt=0;function _r(){var $e=Kr(),Ge=$e.link,mt=$e.global;$e.id=Lt++,$e.batchId="0";var Gt=Ge(Tt),Ut=$e.shared={props:"a0"};Object.keys(Tt).forEach(function(vt){Ut[vt]=mt.def(Gt,".",vt)}),Ae.optional(function(){$e.CHECK=Ge(Ae),$e.commandStr=Ae.guessCommand(),$e.command=Ge($e.commandStr),$e.assert=function(vt,Ve,kt){vt("if(!(",Ve,"))",this.CHECK,".commandRaise(",Ge(kt),",",this.command,");")},Nt.invalidBlendCombinations=Xc});var wt=$e.next={},xt=$e.current={};Object.keys(Fe).forEach(function(vt){Array.isArray(ge[vt])&&(wt[vt]=mt.def(Ut.next,".",vt),xt[vt]=mt.def(Ut.current,".",vt))});var At=$e.constants={};Object.keys(Nt).forEach(function(vt){At[vt]=mt.def(JSON.stringify(Nt[vt]))}),$e.invoke=function(vt,Ve){switch(Ve.type){case zf:var kt=["this",Ut.context,Ut.props,$e.batchId];return vt.def(Ge(Ve.data),".call(",kt.slice(0,Math.max(Ve.data.length+1,4)),")");case ks:return vt.def(Ut.props,Ve.data);case eu:return vt.def(Ut.context,Ve.data);case tu:return vt.def("this",Ve.data);case Tu:return Ve.data.append($e,vt),Ve.data.ref;case Mc:return Ve.data.toString();case Cc:return Ve.data.map(function(zt){return $e.invoke(vt,zt)})}},$e.attribCache={};var Ke={};return $e.scopeAttrib=function(vt){var Ve=We.id(vt);if(Ve in Ke)return Ke[Ve];var kt=Ar.scope[Ve];kt||(kt=Ar.scope[Ve]=new Y);var zt=Ke[Ve]=Ge(kt);return zt},$e}function Yr($e){var Ge=$e.static,mt=$e.dynamic,Gt;if(vs in Ge){var Ut=!!Ge[vs];Gt=ci(function(xt,At){return Ut}),Gt.enable=Ut}else if(vs in mt){var wt=mt[vs];Gt=Ri(wt,function(xt,At){return xt.invoke(At,wt)})}return Gt}function Pr($e,Ge){var mt=$e.static,Gt=$e.dynamic;if(Bs in mt){var Ut=mt[Bs];return Ut?(Ut=Mr.getFramebuffer(Ut),Ae.command(Ut,"invalid framebuffer object"),ci(function(xt,At){var Ke=xt.link(Ut),vt=xt.shared;At.set(vt.framebuffer,".next",Ke);var Ve=vt.context;return At.set(Ve,"."+ea,Ke+".width"),At.set(Ve,"."+Io,Ke+".height"),Ke})):ci(function(xt,At){var Ke=xt.shared;At.set(Ke.framebuffer,".next","null");var vt=Ke.context;return At.set(vt,"."+ea,vt+"."+Jf),At.set(vt,"."+Io,vt+"."+qf),"null"})}else if(Bs in Gt){var wt=Gt[Bs];return Ri(wt,function(xt,At){var Ke=xt.invoke(At,wt),vt=xt.shared,Ve=vt.framebuffer,kt=At.def(Ve,".getFramebuffer(",Ke,")");Ae.optional(function(){xt.assert(At,"!"+Ke+"||"+kt,"invalid framebuffer object")}),At.set(Ve,".next",kt);var zt=vt.context;return At.set(zt,"."+ea,kt+"?"+kt+".width:"+zt+"."+Jf),At.set(zt,"."+Io,kt+"?"+kt+".height:"+zt+"."+qf),kt})}else return null}function dn($e,Ge,mt){var Gt=$e.static,Ut=$e.dynamic;function wt(Ke){if(Ke in Gt){var vt=Gt[Ke];Ae.commandType(vt,"object","invalid "+Ke,mt.commandStr);var Ve=!0,kt=vt.x|0,zt=vt.y|0,vr,gr;return"width"in vt?(vr=vt.width|0,Ae.command(vr>=0,"invalid "+Ke,mt.commandStr)):Ve=!1,"height"in vt?(gr=vt.height|0,Ae.command(gr>=0,"invalid "+Ke,mt.commandStr)):Ve=!1,new Ji(!Ve&&Ge&&Ge.thisDep,!Ve&&Ge&&Ge.contextDep,!Ve&&Ge&&Ge.propDep,function(yn,Zn){var un=yn.shared.context,Dn=vr;"width"in vt||(Dn=Zn.def(un,".",ea,"-",kt));var jn=gr;return"height"in vt||(jn=Zn.def(un,".",Io,"-",zt)),[kt,zt,Dn,jn]})}else if(Ke in Ut){var ur=Ut[Ke],Lr=Ri(ur,function(yn,Zn){var un=yn.invoke(Zn,ur);Ae.optional(function(){yn.assert(Zn,un+"&&typeof "+un+'==="object"',"invalid "+Ke)});var Dn=yn.shared.context,jn=Zn.def(un,".x|0"),Sa=Zn.def(un,".y|0"),di=Zn.def('"width" in ',un,"?",un,".width|0:","(",Dn,".",ea,"-",jn,")"),qi=Zn.def('"height" in ',un,"?",un,".height|0:","(",Dn,".",Io,"-",Sa,")");return Ae.optional(function(){yn.assert(Zn,di+">=0&&"+qi+">=0","invalid "+Ke)}),[jn,Sa,di,qi]});return Ge&&(Lr.thisDep=Lr.thisDep||Ge.thisDep,Lr.contextDep=Lr.contextDep||Ge.contextDep,Lr.propDep=Lr.propDep||Ge.propDep),Lr}else return Ge?new Ji(Ge.thisDep,Ge.contextDep,Ge.propDep,function(yn,Zn){var un=yn.shared.context;return[0,0,Zn.def(un,".",ea),Zn.def(un,".",Io)]}):null}var xt=wt(Xo);if(xt){var At=xt;xt=new Ji(xt.thisDep,xt.contextDep,xt.propDep,function(Ke,vt){var Ve=At.append(Ke,vt),kt=Ke.shared.context;return vt.set(kt,"."+nu,Ve[2]),vt.set(kt,"."+Qf,Ve[3]),Ve})}return{viewport:xt,scissor_box:wt(Lu)}}function sn($e,Ge){var mt=$e.static,Gt=typeof mt[ru]=="string"&&typeof mt[gs]=="string";if(Gt){if(Object.keys(Ge.dynamic).length>0)return null;var Ut=Ge.static,wt=Object.keys(Ut);if(wt.length>0&&typeof Ut[wt[0]]=="number"){for(var xt=[],At=0;At<wt.length;++At)Ae(typeof Ut[wt[At]]=="number","must specify all vertex attribute locations when using vaos"),xt.push([Ut[wt[At]]|0,wt[At]]);return xt}}return null}function tn($e,Ge,mt){var Gt=$e.static,Ut=$e.dynamic;function wt(Ve){if(Ve in Gt){var kt=We.id(Gt[Ve]);Ae.optional(function(){Tr.shader(Vc[Ve],kt,Ae.guessCommand())});var zt=ci(function(){return kt});return zt.id=kt,zt}else if(Ve in Ut){var vr=Ut[Ve];return Ri(vr,function(gr,ur){var Lr=gr.invoke(ur,vr),yn=ur.def(gr.shared.strings,".id(",Lr,")");return Ae.optional(function(){ur(gr.shared.shader,".shader(",Vc[Ve],",",yn,",",gr.command,");")}),yn})}return null}var xt=wt(ru),At=wt(gs),Ke=null,vt;return bs(xt)&&bs(At)?(Ke=Tr.program(At.id,xt.id,null,mt),vt=ci(function(Ve,kt){return Ve.link(Ke)})):vt=new Ji(xt&&xt.thisDep||At&&At.thisDep,xt&&xt.contextDep||At&&At.contextDep,xt&&xt.propDep||At&&At.propDep,function(Ve,kt){var zt=Ve.shared.shader,vr;xt?vr=xt.append(Ve,kt):vr=kt.def(zt,".",ru);var gr;At?gr=At.append(Ve,kt):gr=kt.def(zt,".",gs);var ur=zt+".program("+gr+","+vr;return Ae.optional(function(){ur+=","+Ve.command}),kt.def(ur+")")}),{frag:xt,vert:At,progVar:vt,program:Ke}}function Bn($e,Ge){var mt=$e.static,Gt=$e.dynamic;function Ut(){if(ps in mt){var Ve=mt[ps];Gu(Ve)?Ve=Yt.getElements(Yt.create(Ve,!0)):Ve&&(Ve=Yt.getElements(Ve),Ae.command(Ve,"invalid elements",Ge.commandStr));var kt=ci(function(vr,gr){if(Ve){var ur=vr.link(Ve);return vr.ELEMENTS=ur,ur}return vr.ELEMENTS=null,null});return kt.value=Ve,kt}else if(ps in Gt){var zt=Gt[ps];return Ri(zt,function(vr,gr){var ur=vr.shared,Lr=ur.isBufferArgs,yn=ur.elements,Zn=vr.invoke(gr,zt),un=gr.def("null"),Dn=gr.def(Lr,"(",Zn,")"),jn=vr.cond(Dn).then(un,"=",yn,".createStream(",Zn,");").else(un,"=",yn,".getElements(",Zn,");");return Ae.optional(function(){vr.assert(jn.else,"!"+Zn+"||"+un,"invalid elements")}),gr.entry(jn),gr.exit(vr.cond(Dn).then(yn,".destroyStream(",un,");")),vr.ELEMENTS=un,un})}return null}var wt=Ut();function xt(){if(ra in mt){var Ve=mt[ra];return Ae.commandParameter(Ve,Pi,"invalid primitve",Ge.commandStr),ci(function(zt,vr){return Pi[Ve]})}else if(ra in Gt){var kt=Gt[ra];return Ri(kt,function(zt,vr){var gr=zt.constants.primTypes,ur=zt.invoke(vr,kt);return Ae.optional(function(){zt.assert(vr,ur+" in "+gr,"invalid primitive, must be one of "+Object.keys(Pi))}),vr.def(gr,"[",ur,"]")})}else if(wt)return bs(wt)?wt.value?ci(function(zt,vr){return vr.def(zt.ELEMENTS,".primType")}):ci(function(){return zc}):new Ji(wt.thisDep,wt.contextDep,wt.propDep,function(zt,vr){var gr=zt.ELEMENTS;return vr.def(gr,"?",gr,".primType:",zc)});return null}function At(Ve,kt){if(Ve in mt){var zt=mt[Ve]|0;return Ae.command(!kt||zt>=0,"invalid "+Ve,Ge.commandStr),ci(function(gr,ur){return kt&&(gr.OFFSET=zt),zt})}else if(Ve in Gt){var vr=Gt[Ve];return Ri(vr,function(gr,ur){var Lr=gr.invoke(ur,vr);return kt&&(gr.OFFSET=Lr,Ae.optional(function(){gr.assert(ur,Lr+">=0","invalid "+Ve)})),Lr})}else if(kt&&wt)return ci(function(gr,ur){return gr.OFFSET="0",0});return null}var Ke=At(Fs,!0);function vt(){if(wo in mt){var Ve=mt[wo]|0;return Ae.command(typeof Ve=="number"&&Ve>=0,"invalid vertex count",Ge.commandStr),ci(function(){return Ve})}else if(wo in Gt){var kt=Gt[wo];return Ri(kt,function(gr,ur){var Lr=gr.invoke(ur,kt);return Ae.optional(function(){gr.assert(ur,"typeof "+Lr+'==="number"&&'+Lr+">=0&&"+Lr+"===("+Lr+"|0)","invalid vertex count")}),Lr})}else if(wt)if(bs(wt)){if(wt)return Ke?new Ji(Ke.thisDep,Ke.contextDep,Ke.propDep,function(gr,ur){var Lr=ur.def(gr.ELEMENTS,".vertCount-",gr.OFFSET);return Ae.optional(function(){gr.assert(ur,Lr+">=0","invalid vertex offset/element buffer too small")}),Lr}):ci(function(gr,ur){return ur.def(gr.ELEMENTS,".vertCount")});var zt=ci(function(){return-1});return Ae.optional(function(){zt.MISSING=!0}),zt}else{var vr=new Ji(wt.thisDep||Ke.thisDep,wt.contextDep||Ke.contextDep,wt.propDep||Ke.propDep,function(gr,ur){var Lr=gr.ELEMENTS;return gr.OFFSET?ur.def(Lr,"?",Lr,".vertCount-",gr.OFFSET,":-1"):ur.def(Lr,"?",Lr,".vertCount:-1")});return Ae.optional(function(){vr.DYNAMIC=!0}),vr}return null}return{elements:wt,primitive:xt(),count:vt(),instances:At(df,!1),offset:Ke}}function Fn($e,Ge){var mt=$e.static,Gt=$e.dynamic,Ut={};return Le.forEach(function(wt){var xt=tt(wt);function At(Ke,vt){if(wt in mt){var Ve=Ke(mt[wt]);Ut[xt]=ci(function(){return Ve})}else if(wt in Gt){var kt=Gt[wt];Ut[xt]=Ri(kt,function(zt,vr){return vt(zt,vr,zt.invoke(vr,kt))})}}switch(wt){case gt:case Uf:case Tc:case Hf:case Xf:case gi:case ll:case dl:case hl:case Rs:return At(function(Ke){return Ae.commandType(Ke,"boolean",wt,Ge.commandStr),Ke},function(Ke,vt,Ve){return Ae.optional(function(){Ke.assert(vt,"typeof "+Ve+'==="boolean"',"invalid flag "+wt,Ke.commandStr)}),Ve});case Vf:return At(function(Ke){return Ae.commandParameter(Ke,uu,"invalid "+wt,Ge.commandStr),uu[Ke]},function(Ke,vt,Ve){var kt=Ke.constants.compareFuncs;return Ae.optional(function(){Ke.assert(vt,Ve+" in "+kt,"invalid "+wt+", must be one of "+Object.keys(uu))}),vt.def(kt,"[",Ve,"]")});case Iu:return At(function(Ke){return Ae.command(ka(Ke)&&Ke.length===2&&typeof Ke[0]=="number"&&typeof Ke[1]=="number"&&Ke[0]<=Ke[1],"depth range is 2d array",Ge.commandStr),Ke},function(Ke,vt,Ve){Ae.optional(function(){Ke.assert(vt,Ke.shared.isArrayLike+"("+Ve+")&&"+Ve+".length===2&&typeof "+Ve+'[0]==="number"&&typeof '+Ve+'[1]==="number"&&'+Ve+"[0]<="+Ve+"[1]","depth range must be a 2d array")});var kt=vt.def("+",Ve,"[0]"),zt=vt.def("+",Ve,"[1]");return[kt,zt]});case cf:return At(function(Ke){Ae.commandType(Ke,"object","blend.func",Ge.commandStr);var vt="srcRGB"in Ke?Ke.srcRGB:Ke.src,Ve="srcAlpha"in Ke?Ke.srcAlpha:Ke.src,kt="dstRGB"in Ke?Ke.dstRGB:Ke.dst,zt="dstAlpha"in Ke?Ke.dstAlpha:Ke.dst;return Ae.commandParameter(vt,pi,xt+".srcRGB",Ge.commandStr),Ae.commandParameter(Ve,pi,xt+".srcAlpha",Ge.commandStr),Ae.commandParameter(kt,pi,xt+".dstRGB",Ge.commandStr),Ae.commandParameter(zt,pi,xt+".dstAlpha",Ge.commandStr),Ae.command(Xc.indexOf(vt+", "+kt)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+vt+", "+kt+")",Ge.commandStr),[pi[vt],pi[kt],pi[Ve],pi[zt]]},function(Ke,vt,Ve){var kt=Ke.constants.blendFuncs;Ae.optional(function(){Ke.assert(vt,Ve+"&&typeof "+Ve+'==="object"',"invalid blend func, must be an object")});function zt(un,Dn){var jn=vt.def('"',un,Dn,'" in ',Ve,"?",Ve,".",un,Dn,":",Ve,".",un);return Ae.optional(function(){Ke.assert(vt,jn+" in "+kt,"invalid "+wt+"."+un+Dn+", must be one of "+Object.keys(pi))}),jn}var vr=zt("src","RGB"),gr=zt("dst","RGB");Ae.optional(function(){var un=Ke.constants.invalidBlendCombinations;Ke.assert(vt,un+".indexOf("+vr+'+", "+'+gr+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var ur=vt.def(kt,"[",vr,"]"),Lr=vt.def(kt,"[",zt("src","Alpha"),"]"),yn=vt.def(kt,"[",gr,"]"),Zn=vt.def(kt,"[",zt("dst","Alpha"),"]");return[ur,yn,Lr,Zn]});case jf:return At(function(Ke){if(typeof Ke=="string")return Ae.commandParameter(Ke,re,"invalid "+wt,Ge.commandStr),[re[Ke],re[Ke]];if(typeof Ke=="object")return Ae.commandParameter(Ke.rgb,re,wt+".rgb",Ge.commandStr),Ae.commandParameter(Ke.alpha,re,wt+".alpha",Ge.commandStr),[re[Ke.rgb],re[Ke.alpha]];Ae.commandRaise("invalid blend.equation",Ge.commandStr)},function(Ke,vt,Ve){var kt=Ke.constants.blendEquations,zt=vt.def(),vr=vt.def(),gr=Ke.cond("typeof ",Ve,'==="string"');return Ae.optional(function(){function ur(Lr,yn,Zn){Ke.assert(Lr,Zn+" in "+kt,"invalid "+yn+", must be one of "+Object.keys(re))}ur(gr.then,wt,Ve),Ke.assert(gr.else,Ve+"&&typeof "+Ve+'==="object"',"invalid "+wt),ur(gr.else,wt+".rgb",Ve+".rgb"),ur(gr.else,wt+".alpha",Ve+".alpha")}),gr.then(zt,"=",vr,"=",kt,"[",Ve,"];"),gr.else(zt,"=",kt,"[",Ve,".rgb];",vr,"=",kt,"[",Ve,".alpha];"),vt(gr),[zt,vr]});case Wf:return At(function(Ke){return Ae.command(ka(Ke)&&Ke.length===4,"blend.color must be a 4d array",Ge.commandStr),ln(4,function(vt){return+Ke[vt]})},function(Ke,vt,Ve){return Ae.optional(function(){Ke.assert(vt,Ke.shared.isArrayLike+"("+Ve+")&&"+Ve+".length===4","blend.color must be a 4d array")}),ln(4,function(kt){return vt.def("+",Ve,"[",kt,"]")})});case Oc:return At(function(Ke){return Ae.commandType(Ke,"number",xt,Ge.commandStr),Ke|0},function(Ke,vt,Ve){return Ae.optional(function(){Ke.assert(vt,"typeof "+Ve+'==="number"',"invalid stencil.mask")}),vt.def(Ve,"|0")});case Zf:return At(function(Ke){Ae.commandType(Ke,"object",xt,Ge.commandStr);var vt=Ke.cmp||"keep",Ve=Ke.ref||0,kt="mask"in Ke?Ke.mask:-1;return Ae.commandParameter(vt,uu,wt+".cmp",Ge.commandStr),Ae.commandType(Ve,"number",wt+".ref",Ge.commandStr),Ae.commandType(kt,"number",wt+".mask",Ge.commandStr),[uu[vt],Ve,kt]},function(Ke,vt,Ve){var kt=Ke.constants.compareFuncs;Ae.optional(function(){function ur(){Ke.assert(vt,Array.prototype.join.call(arguments,""),"invalid stencil.func")}ur(Ve+"&&typeof ",Ve,'==="object"'),ur('!("cmp" in ',Ve,")||(",Ve,".cmp in ",kt,")")});var zt=vt.def('"cmp" in ',Ve,"?",kt,"[",Ve,".cmp]",":",ms),vr=vt.def(Ve,".ref|0"),gr=vt.def('"mask" in ',Ve,"?",Ve,".mask|0:-1");return[zt,vr,gr]});case Mi:case Au:return At(function(Ke){Ae.commandType(Ke,"object",xt,Ge.commandStr);var vt=Ke.fail||"keep",Ve=Ke.zfail||"keep",kt=Ke.zpass||"keep";return Ae.commandParameter(vt,Es,wt+".fail",Ge.commandStr),Ae.commandParameter(Ve,Es,wt+".zfail",Ge.commandStr),Ae.commandParameter(kt,Es,wt+".zpass",Ge.commandStr),[wt===Au?ys:Bu,Es[vt],Es[Ve],Es[kt]]},function(Ke,vt,Ve){var kt=Ke.constants.stencilOps;Ae.optional(function(){Ke.assert(vt,Ve+"&&typeof "+Ve+'==="object"',"invalid "+wt)});function zt(vr){return Ae.optional(function(){Ke.assert(vt,'!("'+vr+'" in '+Ve+")||("+Ve+"."+vr+" in "+kt+")","invalid "+wt+"."+vr+", must be one of "+Object.keys(Es))}),vt.def('"',vr,'" in ',Ve,"?",kt,"[",Ve,".",vr,"]:",ms)}return[wt===Au?ys:Bu,zt("fail"),zt("zfail"),zt("zpass")]});case Ic:return At(function(Ke){Ae.commandType(Ke,"object",xt,Ge.commandStr);var vt=Ke.factor|0,Ve=Ke.units|0;return Ae.commandType(vt,"number",xt+".factor",Ge.commandStr),Ae.commandType(Ve,"number",xt+".units",Ge.commandStr),[vt,Ve]},function(Ke,vt,Ve){Ae.optional(function(){Ke.assert(vt,Ve+"&&typeof "+Ve+'==="object"',"invalid "+wt)});var kt=vt.def(Ve,".factor|0"),zt=vt.def(Ve,".units|0");return[kt,zt]});case cl:return At(function(Ke){var vt=0;return Ke==="front"?vt=Bu:Ke==="back"&&(vt=ys),Ae.command(!!vt,xt,Ge.commandStr),vt},function(Ke,vt,Ve){return Ae.optional(function(){Ke.assert(vt,Ve+'==="front"||'+Ve+'==="back"',"invalid cull.face")}),vt.def(Ve,'==="front"?',Bu,":",ys)});case Yf:return At(function(Ke){return Ae.command(typeof Ke=="number"&&Ke>=Zt.lineWidthDims[0]&&Ke<=Zt.lineWidthDims[1],"invalid line width, must be a positive number between "+Zt.lineWidthDims[0]+" and "+Zt.lineWidthDims[1],Ge.commandStr),Ke},function(Ke,vt,Ve){return Ae.optional(function(){Ke.assert(vt,"typeof "+Ve+'==="number"&&'+Ve+">="+Zt.lineWidthDims[0]+"&&"+Ve+"<="+Zt.lineWidthDims[1],"invalid line width")}),Ve});case Ou:return At(function(Ke){return Ae.commandParameter(Ke,Fu,xt,Ge.commandStr),Fu[Ke]},function(Ke,vt,Ve){return Ae.optional(function(){Ke.assert(vt,Ve+'==="cw"||'+Ve+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),vt.def(Ve+'==="cw"?'+Uc+":"+su)});case Oi:return At(function(Ke){return Ae.command(ka(Ke)&&Ke.length===4,"color.mask must be length 4 array",Ge.commandStr),Ke.map(function(vt){return!!vt})},function(Ke,vt,Ve){return Ae.optional(function(){Ke.assert(vt,Ke.shared.isArrayLike+"("+Ve+")&&"+Ve+".length===4","invalid color.mask")}),ln(4,function(kt){return"!!"+Ve+"["+kt+"]"})});case lf:return At(function(Ke){Ae.command(typeof Ke=="object"&&Ke,xt,Ge.commandStr);var vt="value"in Ke?Ke.value:1,Ve=!!Ke.invert;return Ae.command(typeof vt=="number"&&vt>=0&&vt<=1,"sample.coverage.value must be a number between 0 and 1",Ge.commandStr),[vt,Ve]},function(Ke,vt,Ve){Ae.optional(function(){Ke.assert(vt,Ve+"&&typeof "+Ve+'==="object"',"invalid sample.coverage")});var kt=vt.def('"value" in ',Ve,"?+",Ve,".value:1"),zt=vt.def("!!",Ve,".invert");return[kt,zt]})}}),Ut}function za($e,Ge){var mt=$e.static,Gt=$e.dynamic,Ut={};return Object.keys(mt).forEach(function(wt){var xt=mt[wt],At;if(typeof xt=="number"||typeof xt=="boolean")At=ci(function(){return xt});else if(typeof xt=="function"){var Ke=xt._reglType;Ke==="texture2d"||Ke==="textureCube"?At=ci(function(vt){return vt.link(xt)}):Ke==="framebuffer"||Ke==="framebufferCube"?(Ae.command(xt.color.length>0,'missing color attachment for framebuffer sent to uniform "'+wt+'"',Ge.commandStr),At=ci(function(vt){return vt.link(xt.color[0])})):Ae.commandRaise('invalid data for uniform "'+wt+'"',Ge.commandStr)}else ka(xt)?At=ci(function(vt){var Ve=vt.global.def("[",ln(xt.length,function(kt){return Ae.command(typeof xt[kt]=="number"||typeof xt[kt]=="boolean","invalid uniform "+wt,vt.commandStr),xt[kt]}),"]");return Ve}):Ae.commandRaise('invalid or missing data for uniform "'+wt+'"',Ge.commandStr);At.value=xt,Ut[wt]=At}),Object.keys(Gt).forEach(function(wt){var xt=Gt[wt];Ut[wt]=Ri(xt,function(At,Ke){return At.invoke(Ke,xt)})}),Ut}function Wn($e,Ge){var mt=$e.static,Gt=$e.dynamic,Ut={};return Object.keys(mt).forEach(function(wt){var xt=mt[wt],At=We.id(wt),Ke=new Y;if(Gu(xt))Ke.state=so,Ke.buffer=dr.getBuffer(dr.create(xt,Gs,!1,!0)),Ke.type=0;else{var vt=dr.getBuffer(xt);if(vt)Ke.state=so,Ke.buffer=vt,Ke.type=0;else if(Ae.command(typeof xt=="object"&&xt,"invalid data for attribute "+wt,Ge.commandStr),"constant"in xt){var Ve=xt.constant;Ke.buffer="null",Ke.state=Ps,typeof Ve=="number"?Ke.x=Ve:(Ae.command(ka(Ve)&&Ve.length>0&&Ve.length<=4,"invalid constant for attribute "+wt,Ge.commandStr),Cu.forEach(function(yn,Zn){Zn<Ve.length&&(Ke[yn]=Ve[Zn])}))}else{Gu(xt.buffer)?vt=dr.getBuffer(dr.create(xt.buffer,Gs,!1,!0)):vt=dr.getBuffer(xt.buffer),Ae.command(!!vt,'missing buffer for attribute "'+wt+'"',Ge.commandStr);var kt=xt.offset|0;Ae.command(kt>=0,'invalid offset for attribute "'+wt+'"',Ge.commandStr);var zt=xt.stride|0;Ae.command(zt>=0&&zt<256,'invalid stride for attribute "'+wt+'", must be integer betweeen [0, 255]',Ge.commandStr);var vr=xt.size|0;Ae.command(!("size"in xt)||vr>0&&vr<=4,'invalid size for attribute "'+wt+'", must be 1,2,3,4',Ge.commandStr);var gr=!!xt.normalized,ur=0;"type"in xt&&(Ae.commandParameter(xt.type,Hi,"invalid type for attribute "+wt,Ge.commandStr),ur=Hi[xt.type]);var Lr=xt.divisor|0;"divisor"in xt&&(Ae.command(Lr===0||ie,'cannot specify divisor for attribute "'+wt+'", instancing not supported',Ge.commandStr),Ae.command(Lr>=0,'invalid divisor for attribute "'+wt+'"',Ge.commandStr)),Ae.optional(function(){var yn=Ge.commandStr,Zn=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(xt).forEach(function(un){Ae.command(Zn.indexOf(un)>=0,'unknown parameter "'+un+'" for attribute pointer "'+wt+'" (valid parameters are '+Zn+")",yn)})}),Ke.buffer=vt,Ke.state=so,Ke.size=vr,Ke.normalized=gr,Ke.type=ur||vt.dtype,Ke.offset=kt,Ke.stride=zt,Ke.divisor=Lr}}Ut[wt]=ci(function(yn,Zn){var un=yn.attribCache;if(At in un)return un[At];var Dn={isStream:!1};return Object.keys(Ke).forEach(function(jn){Dn[jn]=Ke[jn]}),Ke.buffer&&(Dn.buffer=yn.link(Ke.buffer),Dn.type=Dn.type||Dn.buffer+".dtype"),un[At]=Dn,Dn})}),Object.keys(Gt).forEach(function(wt){var xt=Gt[wt];function At(Ke,vt){var Ve=Ke.invoke(vt,xt),kt=Ke.shared,zt=Ke.constants,vr=kt.isBufferArgs,gr=kt.buffer;Ae.optional(function(){Ke.assert(vt,Ve+"&&(typeof "+Ve+'==="object"||typeof '+Ve+'==="function")&&('+vr+"("+Ve+")||"+gr+".getBuffer("+Ve+")||"+gr+".getBuffer("+Ve+".buffer)||"+vr+"("+Ve+'.buffer)||("constant" in '+Ve+"&&(typeof "+Ve+'.constant==="number"||'+kt.isArrayLike+"("+Ve+".constant))))",'invalid dynamic attribute "'+wt+'"')});var ur={isStream:vt.def(!1)},Lr=new Y;Lr.state=so,Object.keys(Lr).forEach(function(Dn){ur[Dn]=vt.def(""+Lr[Dn])});var yn=ur.buffer,Zn=ur.type;vt("if(",vr,"(",Ve,")){",ur.isStream,"=true;",yn,"=",gr,".createStream(",Gs,",",Ve,");",Zn,"=",yn,".dtype;","}else{",yn,"=",gr,".getBuffer(",Ve,");","if(",yn,"){",Zn,"=",yn,".dtype;",'}else if("constant" in ',Ve,"){",ur.state,"=",Ps,";","if(typeof "+Ve+'.constant === "number"){',ur[Cu[0]],"=",Ve,".constant;",Cu.slice(1).map(function(Dn){return ur[Dn]}).join("="),"=0;","}else{",Cu.map(function(Dn,jn){return ur[Dn]+"="+Ve+".constant.length>"+jn+"?"+Ve+".constant["+jn+"]:0;"}).join(""),"}}else{","if(",vr,"(",Ve,".buffer)){",yn,"=",gr,".createStream(",Gs,",",Ve,".buffer);","}else{",yn,"=",gr,".getBuffer(",Ve,".buffer);","}",Zn,'="type" in ',Ve,"?",zt.glTypes,"[",Ve,".type]:",yn,".dtype;",ur.normalized,"=!!",Ve,".normalized;");function un(Dn){vt(ur[Dn],"=",Ve,".",Dn,"|0;")}return un("size"),un("offset"),un("stride"),un("divisor"),vt("}}"),vt.exit("if(",ur.isStream,"){",gr,".destroyStream(",yn,");","}"),ur}Ut[wt]=Ri(xt,At)}),Ut}function ti($e,Ge){var mt=$e.static,Gt=$e.dynamic;if(Du in mt){var Ut=mt[Du];return Ut!==null&&Ar.getVAO(Ut)===null&&(Ut=Ar.createVAO(Ut)),ci(function(xt){return xt.link(Ar.getVAO(Ut))})}else if(Du in Gt){var wt=Gt[Du];return Ri(wt,function(xt,At){var Ke=xt.invoke(At,wt);return At.def(xt.shared.vao+".getVAO("+Ke+")")})}return null}function La($e){var Ge=$e.static,mt=$e.dynamic,Gt={};return Object.keys(Ge).forEach(function(Ut){var wt=Ge[Ut];Gt[Ut]=ci(function(xt,At){return typeof wt=="number"||typeof wt=="boolean"?""+wt:xt.link(wt)})}),Object.keys(mt).forEach(function(Ut){var wt=mt[Ut];Gt[Ut]=Ri(wt,function(xt,At){return xt.invoke(At,wt)})}),Gt}function oa($e,Ge,mt,Gt,Ut){var wt=$e.static,xt=$e.dynamic;Ae.optional(function(){var un=[Bs,gs,ru,ps,ra,Fs,wo,df,vs,Du].concat(Le);function Dn(jn){Object.keys(jn).forEach(function(Sa){Ae.command(un.indexOf(Sa)>=0,'unknown parameter "'+Sa+'"',Ut.commandStr)})}Dn(wt),Dn(xt)});var At=sn($e,Ge),Ke=Pr($e,Ut),vt=dn($e,Ke,Ut),Ve=Bn($e,Ut),kt=Fn($e,Ut),zt=tn($e,Ut,At);function vr(un){var Dn=vt[un];Dn&&(kt[un]=Dn)}vr(Xo),vr(tt(Lu));var gr=Object.keys(kt).length>0,ur={framebuffer:Ke,draw:Ve,shader:zt,state:kt,dirty:gr,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(ur.profile=Yr($e,Ut),ur.uniforms=za(mt,Ut),ur.drawVAO=ur.scopeVAO=ti($e,Ut),!ur.drawVAO&&zt.program&&!At&&it.angle_instanced_arrays){var Lr=!0,yn=zt.program.attributes.map(function(un){var Dn=Ge.static[un];return Lr=Lr&&!!Dn,Dn});if(Lr&&yn.length>0){var Zn=Ar.getVAO(Ar.createVAO(yn));ur.drawVAO=new Ji(null,null,null,function(un,Dn){return un.link(Zn)}),ur.useVAO=!0}}return At?ur.useVAO=!0:ur.attributes=Wn(Ge,Ut),ur.context=La(Gt,Ut),ur}function Za($e,Ge,mt){var Gt=$e.shared,Ut=Gt.context,wt=$e.scope();Object.keys(mt).forEach(function(xt){Ge.save(Ut,"."+xt);var At=mt[xt],Ke=At.append($e,Ge);Array.isArray(Ke)?wt(Ut,".",xt,"=[",Ke.join(),"];"):wt(Ut,".",xt,"=",Ke,";")}),Ge(wt)}function ri($e,Ge,mt,Gt){var Ut=$e.shared,wt=Ut.gl,xt=Ut.framebuffer,At;le&&(At=Ge.def(Ut.extensions,".webgl_draw_buffers"));var Ke=$e.constants,vt=Ke.drawBuffer,Ve=Ke.backBuffer,kt;mt?kt=mt.append($e,Ge):kt=Ge.def(xt,".next"),Gt||Ge("if(",kt,"!==",xt,".cur){"),Ge("if(",kt,"){",wt,".bindFramebuffer(",jc,",",kt,".framebuffer);"),le&&Ge(At,".drawBuffersWEBGL(",vt,"[",kt,".colorAttachments.length]);"),Ge("}else{",wt,".bindFramebuffer(",jc,",null);"),le&&Ge(At,".drawBuffersWEBGL(",Ve,");"),Ge("}",xt,".cur=",kt,";"),Gt||Ge("}")}function li($e,Ge,mt){var Gt=$e.shared,Ut=Gt.gl,wt=$e.current,xt=$e.next,At=Gt.current,Ke=Gt.next,vt=$e.cond(At,".dirty");Le.forEach(function(Ve){var kt=tt(Ve);if(!(kt in mt.state)){var zt,vr;if(kt in xt){zt=xt[kt],vr=wt[kt];var gr=ln(ge[kt].length,function(Lr){return vt.def(zt,"[",Lr,"]")});vt($e.cond(gr.map(function(Lr,yn){return Lr+"!=="+vr+"["+yn+"]"}).join("||")).then(Ut,".",Fe[kt],"(",gr,");",gr.map(function(Lr,yn){return vr+"["+yn+"]="+Lr}).join(";"),";"))}else{zt=vt.def(Ke,".",kt);var ur=$e.cond(zt,"!==",At,".",kt);vt(ur),kt in ze?ur($e.cond(zt).then(Ut,".enable(",ze[kt],");").else(Ut,".disable(",ze[kt],");"),At,".",kt,"=",zt,";"):ur(Ut,".",Fe[kt],"(",zt,");",At,".",kt,"=",zt,";")}}}),Object.keys(mt.state).length===0&&vt(At,".dirty=false;"),Ge(vt)}function ii($e,Ge,mt,Gt){var Ut=$e.shared,wt=$e.current,xt=Ut.current,At=Ut.gl;Yc(Object.keys(mt)).forEach(function(Ke){var vt=mt[Ke];if(!(Gt&&!Gt(vt))){var Ve=vt.append($e,Ge);if(ze[Ke]){var kt=ze[Ke];bs(vt)?Ve?Ge(At,".enable(",kt,");"):Ge(At,".disable(",kt,");"):Ge($e.cond(Ve).then(At,".enable(",kt,");").else(At,".disable(",kt,");")),Ge(xt,".",Ke,"=",Ve,";")}else if(ka(Ve)){var zt=wt[Ke];Ge(At,".",Fe[Ke],"(",Ve,");",Ve.map(function(vr,gr){return zt+"["+gr+"]="+vr}).join(";"),";")}else Ge(At,".",Fe[Ke],"(",Ve,");",xt,".",Ke,"=",Ve,";")}})}function Pa($e,Ge){ie&&($e.instancing=Ge.def($e.shared.extensions,".angle_instanced_arrays"))}function Hn($e,Ge,mt,Gt,Ut){var wt=$e.shared,xt=$e.stats,At=wt.current,Ke=wt.timer,vt=mt.profile;function Ve(){return typeof performance=="undefined"?"Date.now()":"performance.now()"}var kt,zt;function vr(un){kt=Ge.def(),un(kt,"=",Ve(),";"),typeof Ut=="string"?un(xt,".count+=",Ut,";"):un(xt,".count++;"),M&&(Gt?(zt=Ge.def(),un(zt,"=",Ke,".getNumPendingQueries();")):un(Ke,".beginQuery(",xt,");"))}function gr(un){un(xt,".cpuTime+=",Ve(),"-",kt,";"),M&&(Gt?un(Ke,".pushScopeStats(",zt,",",Ke,".getNumPendingQueries(),",xt,");"):un(Ke,".endQuery();"))}function ur(un){var Dn=Ge.def(At,".profile");Ge(At,".profile=",un,";"),Ge.exit(At,".profile=",Dn,";")}var Lr;if(vt){if(bs(vt)){vt.enable?(vr(Ge),gr(Ge.exit),ur("true")):ur("false");return}Lr=vt.append($e,Ge),ur(Lr)}else Lr=Ge.def(At,".profile");var yn=$e.block();vr(yn),Ge("if(",Lr,"){",yn,"}");var Zn=$e.block();gr(Zn),Ge.exit("if(",Lr,"){",Zn,"}")}function Bi($e,Ge,mt,Gt,Ut){var wt=$e.shared;function xt(Ke){switch(Ke){case Pu:case gf:case yf:return 2;case Us:case pf:case mf:return 3;case vf:case Ws:case ku:return 4;default:return 1}}function At(Ke,vt,Ve){var kt=wt.gl,zt=Ge.def(Ke,".location"),vr=Ge.def(wt.attributes,"[",zt,"]"),gr=Ve.state,ur=Ve.buffer,Lr=[Ve.x,Ve.y,Ve.z,Ve.w],yn=["buffer","normalized","offset","stride"];function Zn(){Ge("if(!",vr,".buffer){",kt,".enableVertexAttribArray(",zt,");}");var Dn=Ve.type,jn;if(Ve.size?jn=Ge.def(Ve.size,"||",vt):jn=vt,Ge("if(",vr,".type!==",Dn,"||",vr,".size!==",jn,"||",yn.map(function(di){return vr+"."+di+"!=="+Ve[di]}).join("||"),"){",kt,".bindBuffer(",Gs,",",ur,".buffer);",kt,".vertexAttribPointer(",[zt,jn,Dn,Ve.normalized,Ve.stride,Ve.offset],");",vr,".type=",Dn,";",vr,".size=",jn,";",yn.map(function(di){return vr+"."+di+"="+Ve[di]+";"}).join(""),"}"),ie){var Sa=Ve.divisor;Ge("if(",vr,".divisor!==",Sa,"){",$e.instancing,".vertexAttribDivisorANGLE(",[zt,Sa],");",vr,".divisor=",Sa,";}")}}function un(){Ge("if(",vr,".buffer){",kt,".disableVertexAttribArray(",zt,");",vr,".buffer=null;","}if(",Cu.map(function(Dn,jn){return vr+"."+Dn+"!=="+Lr[jn]}).join("||"),"){",kt,".vertexAttrib4f(",zt,",",Lr,");",Cu.map(function(Dn,jn){return vr+"."+Dn+"="+Lr[jn]+";"}).join(""),"}")}gr===so?Zn():gr===Ps?un():(Ge("if(",gr,"===",so,"){"),Zn(),Ge("}else{"),un(),Ge("}"))}Gt.forEach(function(Ke){var vt=Ke.name,Ve=mt.attributes[vt],kt;if(Ve){if(!Ut(Ve))return;kt=Ve.append($e,Ge)}else{if(!Ut(Ef))return;var zt=$e.scopeAttrib(vt);Ae.optional(function(){$e.assert(Ge,zt+".state","missing attribute "+vt)}),kt={},Object.keys(new Y).forEach(function(vr){kt[vr]=Ge.def(zt,".",vr)})}At($e.link(Ke),xt(Ke.info.type),kt)})}function Ln($e,Ge,mt,Gt,Ut){for(var wt=$e.shared,xt=wt.gl,At,Ke=0;Ke<Gt.length;++Ke){var vt=Gt[Ke],Ve=vt.name,kt=vt.info.type,zt=mt.uniforms[Ve],vr=$e.link(vt),gr=vr+".location",ur;if(zt){if(!Ut(zt))continue;if(bs(zt)){var Lr=zt.value;if(Ae.command(Lr!==null&&typeof Lr!="undefined",'missing uniform "'+Ve+'"',$e.commandStr),kt===Ru||kt===js){Ae.command(typeof Lr=="function"&&(kt===Ru&&(Lr._reglType==="texture2d"||Lr._reglType==="framebuffer")||kt===js&&(Lr._reglType==="textureCube"||Lr._reglType==="framebufferCube")),"invalid texture for uniform "+Ve,$e.commandStr);var yn=$e.link(Lr._texture||Lr.color[0]._texture);Ge(xt,".uniform1i(",gr,",",yn+".bind());"),Ge.exit(yn,".unbind();")}else if(kt===iu||kt===Aa||kt===ou){Ae.optional(function(){Ae.command(ka(Lr),"invalid matrix for uniform "+Ve,$e.commandStr),Ae.command(kt===iu&&Lr.length===4||kt===Aa&&Lr.length===9||kt===ou&&Lr.length===16,"invalid length for matrix uniform "+Ve,$e.commandStr)});var Zn=$e.global.def("new Float32Array(["+Array.prototype.slice.call(Lr)+"])"),un=2;kt===Aa?un=3:kt===ou&&(un=4),Ge(xt,".uniformMatrix",un,"fv(",gr,",false,",Zn,");")}else{switch(kt){case au:Ae.commandType(Lr,"number","uniform "+Ve,$e.commandStr),At="1f";break;case Pu:Ae.command(ka(Lr)&&Lr.length===2,"uniform "+Ve,$e.commandStr),At="2f";break;case Us:Ae.command(ka(Lr)&&Lr.length===3,"uniform "+Ve,$e.commandStr),At="3f";break;case vf:Ae.command(ka(Lr)&&Lr.length===4,"uniform "+Ve,$e.commandStr),At="4f";break;case tc:Ae.commandType(Lr,"boolean","uniform "+Ve,$e.commandStr),At="1i";break;case ec:Ae.commandType(Lr,"number","uniform "+Ve,$e.commandStr),At="1i";break;case yf:Ae.command(ka(Lr)&&Lr.length===2,"uniform "+Ve,$e.commandStr),At="2i";break;case gf:Ae.command(ka(Lr)&&Lr.length===2,"uniform "+Ve,$e.commandStr),At="2i";break;case mf:Ae.command(ka(Lr)&&Lr.length===3,"uniform "+Ve,$e.commandStr),At="3i";break;case pf:Ae.command(ka(Lr)&&Lr.length===3,"uniform "+Ve,$e.commandStr),At="3i";break;case ku:Ae.command(ka(Lr)&&Lr.length===4,"uniform "+Ve,$e.commandStr),At="4i";break;case Ws:Ae.command(ka(Lr)&&Lr.length===4,"uniform "+Ve,$e.commandStr),At="4i";break}Ge(xt,".uniform",At,"(",gr,",",ka(Lr)?Array.prototype.slice.call(Lr):Lr,");")}continue}else ur=zt.append($e,Ge)}else{if(!Ut(Ef))continue;ur=Ge.def(wt.uniforms,"[",We.id(Ve),"]")}kt===Ru?(Ae(!Array.isArray(ur),"must specify a scalar prop for textures"),Ge("if(",ur,"&&",ur,'._reglType==="framebuffer"){',ur,"=",ur,".color[0];","}")):kt===js&&(Ae(!Array.isArray(ur),"must specify a scalar prop for cube maps"),Ge("if(",ur,"&&",ur,'._reglType==="framebufferCube"){',ur,"=",ur,".color[0];","}")),Ae.optional(function(){function qi(es,kl){$e.assert(Ge,es,'bad data or missing for uniform "'+Ve+'". '+kl)}function Cl(es){Ae(!Array.isArray(ur),"must not specify an array type for uniform"),qi("typeof "+ur+'==="'+es+'"',"invalid type, expected "+es)}function No(es,kl){Array.isArray(ur)?Ae(ur.length===es,"must have length "+es):qi(wt.isArrayLike+"("+ur+")&&"+ur+".length==="+es,"invalid vector, should have length "+es,$e.commandStr)}function Tl(es){Ae(!Array.isArray(ur),"must not specify a value type"),qi("typeof "+ur+'==="function"&&'+ur+'._reglType==="texture'+(es===Pc?"2d":"Cube")+'"',"invalid texture type",$e.commandStr)}switch(kt){case ec:Cl("number");break;case gf:No(2,"number");break;case pf:No(3,"number");break;case Ws:No(4,"number");break;case au:Cl("number");break;case Pu:No(2,"number");break;case Us:No(3,"number");break;case vf:No(4,"number");break;case tc:Cl("boolean");break;case yf:No(2,"boolean");break;case mf:No(3,"boolean");break;case ku:No(4,"boolean");break;case iu:No(4,"number");break;case Aa:No(9,"number");break;case ou:No(16,"number");break;case Ru:Tl(Pc);break;case js:Tl(Vo);break}});var Dn=1;switch(kt){case Ru:case js:var jn=Ge.def(ur,"._texture");Ge(xt,".uniform1i(",gr,",",jn,".bind());"),Ge.exit(jn,".unbind();");continue;case ec:case tc:At="1i";break;case gf:case yf:At="2i",Dn=2;break;case pf:case mf:At="3i",Dn=3;break;case Ws:case ku:At="4i",Dn=4;break;case au:At="1f";break;case Pu:At="2f",Dn=2;break;case Us:At="3f",Dn=3;break;case vf:At="4f",Dn=4;break;case iu:At="Matrix2fv";break;case Aa:At="Matrix3fv";break;case ou:At="Matrix4fv";break}if(Ge(xt,".uniform",At,"(",gr,","),At.charAt(0)==="M"){var Sa=Math.pow(kt-iu+2,2),di=$e.global.def("new Float32Array(",Sa,")");Array.isArray(ur)?Ge("false,(",ln(Sa,function(qi){return di+"["+qi+"]="+ur[qi]}),",",di,")"):Ge("false,(Array.isArray(",ur,")||",ur," instanceof Float32Array)?",ur,":(",ln(Sa,function(qi){return di+"["+qi+"]="+ur+"["+qi+"]"}),",",di,")")}else Dn>1?Ge(ln(Dn,function(qi){return Array.isArray(ur)?ur[qi]:ur+"["+qi+"]"})):(Ae(!Array.isArray(ur),"uniform value must not be an array"),Ge(ur));Ge(");")}}function On($e,Ge,mt,Gt){var Ut=$e.shared,wt=Ut.gl,xt=Ut.draw,At=Gt.draw;function Ke(){var jn=At.elements,Sa,di=Ge;return jn?((jn.contextDep&&Gt.contextDynamic||jn.propDep)&&(di=mt),Sa=jn.append($e,di)):Sa=di.def(xt,".",ps),Sa&&di("if("+Sa+")"+wt+".bindBuffer("+Lc+","+Sa+".buffer.buffer);"),Sa}function vt(){var jn=At.count,Sa,di=Ge;return jn?((jn.contextDep&&Gt.contextDynamic||jn.propDep)&&(di=mt),Sa=jn.append($e,di),Ae.optional(function(){jn.MISSING&&$e.assert(Ge,"false","missing vertex count"),jn.DYNAMIC&&$e.assert(di,Sa+">=0","missing vertex count")})):(Sa=di.def(xt,".",wo),Ae.optional(function(){$e.assert(di,Sa+">=0","missing vertex count")})),Sa}var Ve=Ke();function kt(jn){var Sa=At[jn];return Sa?Sa.contextDep&&Gt.contextDynamic||Sa.propDep?Sa.append($e,mt):Sa.append($e,Ge):Ge.def(xt,".",jn)}var zt=kt(ra),vr=kt(Fs),gr=vt();if(typeof gr=="number"){if(gr===0)return}else mt("if(",gr,"){"),mt.exit("}");var ur,Lr;ie&&(ur=kt(df),Lr=$e.instancing);var yn=Ve+".type",Zn=At.elements&&bs(At.elements);function un(){function jn(){mt(Lr,".drawElementsInstancedANGLE(",[zt,gr,yn,vr+"<<(("+yn+"-"+_c+")>>1)",ur],");")}function Sa(){mt(Lr,".drawArraysInstancedANGLE(",[zt,vr,gr,ur],");")}Ve?Zn?jn():(mt("if(",Ve,"){"),jn(),mt("}else{"),Sa(),mt("}")):Sa()}function Dn(){function jn(){mt(wt+".drawElements("+[zt,gr,yn,vr+"<<(("+yn+"-"+_c+")>>1)"]+");")}function Sa(){mt(wt+".drawArrays("+[zt,vr,gr]+");")}Ve?Zn?jn():(mt("if(",Ve,"){"),jn(),mt("}else{"),Sa(),mt("}")):Sa()}ie&&(typeof ur!="number"||ur>=0)?typeof ur=="string"?(mt("if(",ur,">0){"),un(),mt("}else if(",ur,"<0){"),Dn(),mt("}")):un():Dn()}function sa($e,Ge,mt,Gt,Ut){var wt=_r(),xt=wt.proc("body",Ut);return Ae.optional(function(){wt.commandStr=Ge.commandStr,wt.command=wt.link(Ge.commandStr)}),ie&&(wt.instancing=xt.def(wt.shared.extensions,".angle_instanced_arrays")),$e(wt,xt,mt,Gt),wt.compile().body}function ba($e,Ge,mt,Gt){Pa($e,Ge),mt.useVAO?mt.drawVAO?Ge($e.shared.vao,".setVAO(",mt.drawVAO.append($e,Ge),");"):Ge($e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"):(Ge($e.shared.vao,".setVAO(null);"),Bi($e,Ge,mt,Gt.attributes,function(){return!0})),Ln($e,Ge,mt,Gt.uniforms,function(){return!0}),On($e,Ge,Ge,mt)}function yi($e,Ge){var mt=$e.proc("draw",1);Pa($e,mt),Za($e,mt,Ge.context),ri($e,mt,Ge.framebuffer),li($e,mt,Ge),ii($e,mt,Ge.state),Hn($e,mt,Ge,!1,!0);var Gt=Ge.shader.progVar.append($e,mt);if(mt($e.shared.gl,".useProgram(",Gt,".program);"),Ge.shader.program)ba($e,mt,Ge,Ge.shader.program);else{mt($e.shared.vao,".setVAO(null);");var Ut=$e.global.def("{}"),wt=mt.def(Gt,".id"),xt=mt.def(Ut,"[",wt,"]");mt($e.cond(xt).then(xt,".call(this,a0);").else(xt,"=",Ut,"[",wt,"]=",$e.link(function(At){return sa(ba,$e,Ge,At,1)}),"(",Gt,");",xt,".call(this,a0);"))}Object.keys(Ge.state).length>0&&mt($e.shared.current,".dirty=true;")}function Ho($e,Ge,mt,Gt){$e.batchId="a1",Pa($e,Ge);function Ut(){return!0}Bi($e,Ge,mt,Gt.attributes,Ut),Ln($e,Ge,mt,Gt.uniforms,Ut),On($e,Ge,Ge,mt)}function Uu($e,Ge,mt,Gt){Pa($e,Ge);var Ut=mt.contextDep,wt=Ge.def(),xt="a0",At="a1",Ke=Ge.def();$e.shared.props=Ke,$e.batchId=wt;var vt=$e.scope(),Ve=$e.scope();Ge(vt.entry,"for(",wt,"=0;",wt,"<",At,";++",wt,"){",Ke,"=",xt,"[",wt,"];",Ve,"}",vt.exit);function kt(yn){return yn.contextDep&&Ut||yn.propDep}function zt(yn){return!kt(yn)}if(mt.needsContext&&Za($e,Ve,mt.context),mt.needsFramebuffer&&ri($e,Ve,mt.framebuffer),ii($e,Ve,mt.state,kt),mt.profile&&kt(mt.profile)&&Hn($e,Ve,mt,!1,!0),Gt)mt.useVAO?mt.drawVAO?kt(mt.drawVAO)?Ve($e.shared.vao,".setVAO(",mt.drawVAO.append($e,Ve),");"):vt($e.shared.vao,".setVAO(",mt.drawVAO.append($e,vt),");"):vt($e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"):(vt($e.shared.vao,".setVAO(null);"),Bi($e,vt,mt,Gt.attributes,zt),Bi($e,Ve,mt,Gt.attributes,kt)),Ln($e,vt,mt,Gt.uniforms,zt),Ln($e,Ve,mt,Gt.uniforms,kt),On($e,vt,Ve,mt);else{var vr=$e.global.def("{}"),gr=mt.shader.progVar.append($e,Ve),ur=Ve.def(gr,".id"),Lr=Ve.def(vr,"[",ur,"]");Ve($e.shared.gl,".useProgram(",gr,".program);","if(!",Lr,"){",Lr,"=",vr,"[",ur,"]=",$e.link(function(yn){return sa(Ho,$e,mt,yn,2)}),"(",gr,");}",Lr,".call(this,a0[",wt,"],",wt,");")}}function et($e,Ge){var mt=$e.proc("batch",2);$e.batchId="0",Pa($e,mt);var Gt=!1,Ut=!0;Object.keys(Ge.context).forEach(function(vr){Gt=Gt||Ge.context[vr].propDep}),Gt||(Za($e,mt,Ge.context),Ut=!1);var wt=Ge.framebuffer,xt=!1;wt?(wt.propDep?Gt=xt=!0:wt.contextDep&&Gt&&(xt=!0),xt||ri($e,mt,wt)):ri($e,mt,null),Ge.state.viewport&&Ge.state.viewport.propDep&&(Gt=!0);function At(vr){return vr.contextDep&&Gt||vr.propDep}li($e,mt,Ge),ii($e,mt,Ge.state,function(vr){return!At(vr)}),(!Ge.profile||!At(Ge.profile))&&Hn($e,mt,Ge,!1,"a1"),Ge.contextDep=Gt,Ge.needsContext=Ut,Ge.needsFramebuffer=xt;var Ke=Ge.shader.progVar;if(Ke.contextDep&&Gt||Ke.propDep)Uu($e,mt,Ge,null);else{var vt=Ke.append($e,mt);if(mt($e.shared.gl,".useProgram(",vt,".program);"),Ge.shader.program)Uu($e,mt,Ge,Ge.shader.program);else{mt($e.shared.vao,".setVAO(null);");var Ve=$e.global.def("{}"),kt=mt.def(vt,".id"),zt=mt.def(Ve,"[",kt,"]");mt($e.cond(zt).then(zt,".call(this,a0,a1);").else(zt,"=",Ve,"[",kt,"]=",$e.link(function(vr){return sa(Uu,$e,Ge,vr,2)}),"(",vt,");",zt,".call(this,a0,a1);"))}}Object.keys(Ge.state).length>0&&mt($e.shared.current,".dirty=true;")}function Jt($e,Ge){var mt=$e.proc("scope",3);$e.batchId="a2";var Gt=$e.shared,Ut=Gt.current;Za($e,mt,Ge.context),Ge.framebuffer&&Ge.framebuffer.append($e,mt),Yc(Object.keys(Ge.state)).forEach(function(xt){var At=Ge.state[xt],Ke=At.append($e,mt);ka(Ke)?Ke.forEach(function(vt,Ve){mt.set($e.next[xt],"["+Ve+"]",vt)}):mt.set(Gt.next,"."+xt,Ke)}),Hn($e,mt,Ge,!0,!0),[ps,Fs,wo,df,ra].forEach(function(xt){var At=Ge.draw[xt];!At||mt.set(Gt.draw,"."+xt,""+At.append($e,mt))}),Object.keys(Ge.uniforms).forEach(function(xt){var At=Ge.uniforms[xt].append($e,mt);Array.isArray(At)&&(At="["+At.join()+"]"),mt.set(Gt.uniforms,"["+We.id(xt)+"]",At)}),Object.keys(Ge.attributes).forEach(function(xt){var At=Ge.attributes[xt].append($e,mt),Ke=$e.scopeAttrib(xt);Object.keys(new Y).forEach(function(vt){mt.set(Ke,"."+vt,At[vt])})}),Ge.scopeVAO&&mt.set(Gt.vao,".targetVAO",Ge.scopeVAO.append($e,mt));function wt(xt){var At=Ge.shader[xt];At&&mt.set(Gt.shader,"."+xt,At.append($e,mt))}wt(gs),wt(ru),Object.keys(Ge.state).length>0&&(mt(Ut,".dirty=true;"),mt.exit(Ut,".dirty=true;")),mt("a1(",$e.shared.context,",a0,",$e.batchId,");")}function jt($e){if(!(typeof $e!="object"||ka($e))){for(var Ge=Object.keys($e),mt=0;mt<Ge.length;++mt)if(Wt.isDynamic($e[Ge[mt]]))return!0;return!1}}function nn($e,Ge,mt){var Gt=Ge.static[mt];if(!Gt||!jt(Gt))return;var Ut=$e.global,wt=Object.keys(Gt),xt=!1,At=!1,Ke=!1,vt=$e.global.def("{}");wt.forEach(function(kt){var zt=Gt[kt];if(Wt.isDynamic(zt)){typeof zt=="function"&&(zt=Gt[kt]=Wt.unbox(zt));var vr=Ri(zt,null);xt=xt||vr.thisDep,Ke=Ke||vr.propDep,At=At||vr.contextDep}else{switch(Ut(vt,".",kt,"="),typeof zt){case"number":Ut(zt);break;case"string":Ut('"',zt,'"');break;case"object":Array.isArray(zt)&&Ut("[",zt.join(),"]");break;default:Ut($e.link(zt));break}Ut(";")}});function Ve(kt,zt){wt.forEach(function(vr){var gr=Gt[vr];if(!!Wt.isDynamic(gr)){var ur=kt.invoke(zt,gr);zt(vt,".",vr,"=",ur,";")}})}Ge.dynamic[mt]=new Wt.DynamicVariable(Tu,{thisDep:xt,contextDep:At,propDep:Ke,ref:vt,append:Ve}),delete Ge.static[mt]}function aa($e,Ge,mt,Gt,Ut){var wt=_r();wt.stats=wt.link(Ut),Object.keys(Ge.static).forEach(function(At){nn(wt,Ge,At)}),Ac.forEach(function(At){nn(wt,$e,At)});var xt=oa($e,Ge,mt,Gt,wt);return yi(wt,xt),Jt(wt,xt),et(wt,xt),z(wt.compile(),{destroy:function(){xt.shader.program.destroy()}})}return{next:me,current:ge,procs:function(){var $e=_r(),Ge=$e.proc("poll"),mt=$e.proc("refresh"),Gt=$e.block();Ge(Gt),mt(Gt);var Ut=$e.shared,wt=Ut.gl,xt=Ut.next,At=Ut.current;Gt(At,".dirty=false;"),ri($e,Ge),ri($e,mt,null,!0);var Ke;ie&&(Ke=$e.link(ie)),it.oes_vertex_array_object&&mt($e.link(it.oes_vertex_array_object),".bindVertexArrayOES(null);");for(var vt=0;vt<Zt.maxAttributes;++vt){var Ve=mt.def(Ut.attributes,"[",vt,"]"),kt=$e.cond(Ve,".buffer");kt.then(wt,".enableVertexAttribArray(",vt,");",wt,".bindBuffer(",Gs,",",Ve,".buffer.buffer);",wt,".vertexAttribPointer(",vt,",",Ve,".size,",Ve,".type,",Ve,".normalized,",Ve,".stride,",Ve,".offset);").else(wt,".disableVertexAttribArray(",vt,");",wt,".vertexAttrib4f(",vt,",",Ve,".x,",Ve,".y,",Ve,".z,",Ve,".w);",Ve,".buffer=null;"),mt(kt),ie&&mt(Ke,".vertexAttribDivisorANGLE(",vt,",",Ve,".divisor);")}return mt($e.shared.vao,".currentVAO=null;",$e.shared.vao,".setVAO(",$e.shared.vao,".targetVAO);"),Object.keys(ze).forEach(function(zt){var vr=ze[zt],gr=Gt.def(xt,".",zt),ur=$e.block();ur("if(",gr,"){",wt,".enable(",vr,")}else{",wt,".disable(",vr,")}",At,".",zt,"=",gr,";"),mt(ur),Ge("if(",gr,"!==",At,".",zt,"){",ur,"}")}),Object.keys(Fe).forEach(function(zt){var vr=Fe[zt],gr=ge[zt],ur,Lr,yn=$e.block();if(yn(wt,".",vr,"("),ka(gr)){var Zn=gr.length;ur=$e.global.def(xt,".",zt),Lr=$e.global.def(At,".",zt),yn(ln(Zn,function(un){return ur+"["+un+"]"}),");",ln(Zn,function(un){return Lr+"["+un+"]="+ur+"["+un+"];"}).join("")),Ge("if(",ln(Zn,function(un){return ur+"["+un+"]!=="+Lr+"["+un+"]"}).join("||"),"){",yn,"}")}else ur=Gt.def(xt,".",zt),Lr=Gt.def(At,".",zt),yn(ur,");",At,".",zt,"=",ur,";"),Ge("if(",ur,"!==",Lr,"){",yn,"}");mt(yn)}),$e.compile()}(),compile:aa}}function Hc(){return{vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0}}var Yo=34918,xl=34919,nc=35007,wl=function(ve,We){if(!We.ext_disjoint_timer_query)return null;var it=[];function Zt(){return it.pop()||We.ext_disjoint_timer_query.createQueryEXT()}function dr(ie){it.push(ie)}var Yt=[];function ar(ie){var le=Zt();We.ext_disjoint_timer_query.beginQueryEXT(nc,le),Yt.push(le),M(Yt.length-1,Yt.length,ie)}function Mr(){We.ext_disjoint_timer_query.endQueryEXT(nc)}function Ir(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var Ar=[];function Tr(){return Ar.pop()||new Ir}function zr(ie){Ar.push(ie)}var f=[];function M(ie,le,ge){var me=Tr();me.startQueryIndex=ie,me.endQueryIndex=le,me.sum=0,me.stats=ge,f.push(me)}var G=[],Y=[];function re(){var ie,le,ge=Yt.length;if(ge!==0){Y.length=Math.max(Y.length,ge+1),G.length=Math.max(G.length,ge+1),G[0]=0,Y[0]=0;var me=0;for(ie=0,le=0;le<Yt.length;++le){var Le=Yt[le];We.ext_disjoint_timer_query.getQueryObjectEXT(Le,xl)?(me+=We.ext_disjoint_timer_query.getQueryObjectEXT(Le,Yo),dr(Le)):Yt[ie++]=Le,G[le+1]=me,Y[le+1]=ie}for(Yt.length=ie,ie=0,le=0;le<f.length;++le){var ze=f[le],Fe=ze.startQueryIndex,tt=ze.endQueryIndex;ze.sum+=G[tt]-G[Fe];var Mt=Y[Fe],sr=Y[tt];sr===Mt?(ze.stats.gpuTime+=ze.sum/1e6,zr(ze)):(ze.startQueryIndex=Mt,ze.endQueryIndex=sr,f[ie++]=ze)}f.length=ie}}return{beginQuery:ar,endQuery:Mr,pushScopeStats:M,update:re,getNumPendingQueries:function(){return Yt.length},clear:function(){it.push.apply(it,Yt);for(var ie=0;ie<it.length;ie++)We.ext_disjoint_timer_query.deleteQueryEXT(it[ie]);Yt.length=0,it.length=0},restore:function(){Yt.length=0,it.length=0}}},Sl=16384,_l=256,ac=1024,zu=34962,bf="webglcontextlost",xf="webglcontextrestored",Zc=1,Ml=2,ic=3;function Kc(ve,We){for(var it=0;it<ve.length;++it)if(ve[it]===We)return it;return-1}function wf(ve){var We=Pn(ve);if(!We)return null;var it=We.gl,Zt=it.getContextAttributes(),dr=it.isContextLost(),Yt=An(it,We);if(!Yt)return null;var ar=Vr(),Mr=Hc(),Ir=Yt.extensions,Ar=wl(it,Ir),Tr=Dr(),zr=it.drawingBufferWidth,f=it.drawingBufferHeight,M={tick:0,time:0,viewportWidth:zr,viewportHeight:f,framebufferWidth:zr,framebufferHeight:f,drawingBufferWidth:zr,drawingBufferHeight:f,pixelRatio:We.pixelRatio},G={},Y={elements:null,primitive:4,count:-1,offset:0,instances:-1},re=Ea(it,Ir),ie=ro(it,Mr,We,ge),le=ol(it,Ir,re,Mr,ie);function ge(On){return le.destroyBuffer(On)}var me=ao(it,Ir,ie,Mr),Le=fl(it,ar,Mr,We),ze=mu(it,Ir,re,function(){Mt.procs.poll()},M,Mr,We),Fe=kf(it,Ir,re,Mr,We),tt=il(it,Ir,re,ze,Fe,Mr),Mt=bl(it,ar,Ir,re,ie,me,ze,tt,G,le,Le,Y,M,Ar,We),sr=Sc(it,tt,Mt.procs.poll,M,Zt,Ir,re),Tt=Mt.next,Nt=it.canvas,Lt=[],_r=[],Yr=[],Pr=[We.onDestroy],dn=null;function sn(){if(Lt.length===0){Ar&&Ar.update(),dn=null;return}dn=Er.next(sn),ii();for(var On=Lt.length-1;On>=0;--On){var sa=Lt[On];sa&&sa(M,null,0)}it.flush(),Ar&&Ar.update()}function tn(){!dn&&Lt.length>0&&(dn=Er.next(sn))}function Bn(){dn&&(Er.cancel(sn),dn=null)}function Fn(On){On.preventDefault(),dr=!0,Bn(),_r.forEach(function(sa){sa()})}function za(On){it.getError(),dr=!1,Yt.restore(),Le.restore(),ie.restore(),ze.restore(),Fe.restore(),tt.restore(),le.restore(),Ar&&Ar.restore(),Mt.procs.refresh(),tn(),Yr.forEach(function(sa){sa()})}Nt&&(Nt.addEventListener(bf,Fn,!1),Nt.addEventListener(xf,za,!1));function Wn(){Lt.length=0,Bn(),Nt&&(Nt.removeEventListener(bf,Fn),Nt.removeEventListener(xf,za)),Le.clear(),tt.clear(),Fe.clear(),ze.clear(),me.clear(),ie.clear(),le.clear(),Ar&&Ar.clear(),Pr.forEach(function(On){On()})}function ti(On){Ae(!!On,"invalid args to regl({...})"),Ae.type(On,"object","invalid args to regl({...})");function sa(Ut){var wt=z({},Ut);delete wt.uniforms,delete wt.attributes,delete wt.context,delete wt.vao,"stencil"in wt&&wt.stencil.op&&(wt.stencil.opBack=wt.stencil.opFront=wt.stencil.op,delete wt.stencil.op);function xt(At){if(At in wt){var Ke=wt[At];delete wt[At],Object.keys(Ke).forEach(function(vt){wt[At+"."+vt]=Ke[vt]})}}return xt("blend"),xt("depth"),xt("cull"),xt("stencil"),xt("polygonOffset"),xt("scissor"),xt("sample"),"vao"in Ut&&(wt.vao=Ut.vao),wt}function ba(Ut,wt){var xt={},At={};return Object.keys(Ut).forEach(function(Ke){var vt=Ut[Ke];if(Wt.isDynamic(vt)){At[Ke]=Wt.unbox(vt,Ke);return}else if(wt&&Array.isArray(vt)){for(var Ve=0;Ve<vt.length;++Ve)if(Wt.isDynamic(vt[Ve])){At[Ke]=Wt.unbox(vt,Ke);return}}xt[Ke]=vt}),{dynamic:At,static:xt}}var yi=ba(On.context||{},!0),Ho=ba(On.uniforms||{},!0),Uu=ba(On.attributes||{},!1),et=ba(sa(On),!1),Jt={gpuTime:0,cpuTime:0,count:0},jt=Mt.compile(et,Uu,Ho,yi,Jt),nn=jt.draw,aa=jt.batch,$e=jt.scope,Ge=[];function mt(Ut){for(;Ge.length<Ut;)Ge.push(null);return Ge}function Gt(Ut,wt){var xt;if(dr&&Ae.raise("context lost"),typeof Ut=="function")return $e.call(this,null,Ut,0);if(typeof wt=="function")if(typeof Ut=="number")for(xt=0;xt<Ut;++xt)$e.call(this,null,wt,xt);else if(Array.isArray(Ut))for(xt=0;xt<Ut.length;++xt)$e.call(this,Ut[xt],wt,xt);else return $e.call(this,Ut,wt,0);else if(typeof Ut=="number"){if(Ut>0)return aa.call(this,mt(Ut|0),Ut|0)}else if(Array.isArray(Ut)){if(Ut.length)return aa.call(this,Ut,Ut.length)}else return nn.call(this,Ut)}return z(Gt,{stats:Jt,destroy:function(){jt.destroy()}})}var La=tt.setFBO=ti({framebuffer:Wt.define.call(null,Zc,"framebuffer")});function oa(On,sa){var ba=0;Mt.procs.poll();var yi=sa.color;yi&&(it.clearColor(+yi[0]||0,+yi[1]||0,+yi[2]||0,+yi[3]||0),ba|=Sl),"depth"in sa&&(it.clearDepth(+sa.depth),ba|=_l),"stencil"in sa&&(it.clearStencil(sa.stencil|0),ba|=ac),Ae(!!ba,"called regl.clear with no buffer specified"),it.clear(ba)}function Za(On){if(Ae(typeof On=="object"&&On,"regl.clear() takes an object as input"),"framebuffer"in On)if(On.framebuffer&&On.framebuffer_reglType==="framebufferCube")for(var sa=0;sa<6;++sa)La(z({framebuffer:On.framebuffer.faces[sa]},On),oa);else La(On,oa);else oa(null,On)}function ri(On){Ae.type(On,"function","regl.frame() callback must be a function"),Lt.push(On);function sa(){var ba=Kc(Lt,On);Ae(ba>=0,"cannot cancel a frame twice");function yi(){var Ho=Kc(Lt,yi);Lt[Ho]=Lt[Lt.length-1],Lt.length-=1,Lt.length<=0&&Bn()}Lt[ba]=yi}return tn(),{cancel:sa}}function li(){var On=Tt.viewport,sa=Tt.scissor_box;On[0]=On[1]=sa[0]=sa[1]=0,M.viewportWidth=M.framebufferWidth=M.drawingBufferWidth=On[2]=sa[2]=it.drawingBufferWidth,M.viewportHeight=M.framebufferHeight=M.drawingBufferHeight=On[3]=sa[3]=it.drawingBufferHeight}function ii(){M.tick+=1,M.time=Hn(),li(),Mt.procs.poll()}function Pa(){ze.refresh(),li(),Mt.procs.refresh(),Ar&&Ar.update()}function Hn(){return(Dr()-Tr)/1e3}Pa();function Bi(On,sa){Ae.type(sa,"function","listener callback must be a function");var ba;switch(On){case"frame":return ri(sa);case"lost":ba=_r;break;case"restore":ba=Yr;break;case"destroy":ba=Pr;break;default:Ae.raise("invalid event, must be one of frame,lost,restore,destroy")}return ba.push(sa),{cancel:function(){for(var yi=0;yi<ba.length;++yi)if(ba[yi]===sa){ba[yi]=ba[ba.length-1],ba.pop();return}}}}var Ln=z(ti,{clear:Za,prop:Wt.define.bind(null,Zc),context:Wt.define.bind(null,Ml),this:Wt.define.bind(null,ic),draw:ti({}),buffer:function(On){return ie.create(On,zu,!1,!1)},elements:function(On){return me.create(On,!1)},texture:ze.create2D,cube:ze.createCube,renderbuffer:Fe.create,framebuffer:tt.create,framebufferCube:tt.createCube,vao:le.createVAO,attributes:Zt,frame:ri,on:Bi,limits:re,hasExtension:function(On){return re.extensions.indexOf(On.toLowerCase())>=0},read:sr,destroy:Wn,_gl:it,_refresh:Pa,poll:function(){ii(),Ar&&Ar.update()},now:Hn,stats:Mr});return We.onDone(null,Ln),Ln}return wf})},86851:function(or,U,z){"use strict";var B=z(89594),j=Array.prototype.concat,R=Array.prototype.slice,A=or.exports=function(L){for(var y=[],x=0,v=L.length;x<v;x++){var g=L[x];B(g)?y=j.call(y,R.call(g)):y.push(g)}return y};A.wrap=function(N){return function(){return N(A(arguments))}}},89594:function(or){or.exports=function(z){return!z||typeof z=="string"?!1:z instanceof Array||Array.isArray(z)||z.length>=0&&(z.splice instanceof Function||Object.getOwnPropertyDescriptor(z,z.length-1)&&z.constructor.name!=="String")}}}]);