commit e6f53a72728ecba31977ee63a4c2577f56fdfa33 Author: afc163 Date: Wed Jul 19 05:05:21 2023 +0000 deploy: 614228ae50251fb7fee9213adcafe3a2d052aca4 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.surgeignore b/.surgeignore new file mode 100644 index 0000000000..514190ab9d --- /dev/null +++ b/.surgeignore @@ -0,0 +1 @@ +!.dumi* diff --git a/2494.cd156764.async.js b/2494.cd156764.async.js new file mode 100644 index 0000000000..0984b2ad20 --- /dev/null +++ b/2494.cd156764.async.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunkantd=self.webpackChunkantd||[]).push([[2494],{192494:function(f,u,n){n.r(u);var e=n(667294),o=n(303459),c=n(370917),i=function(a){var r=(0,e.useRef)(null),d=(0,e.useRef)(null);return(0,e.useEffect)(function(){return r.current=new o.q9({target:d.current,props:{mode:o.AR.text}}),function(){var t;(t=r.current)===null||t===void 0||t.destroy()}},[]),(0,e.useEffect)(function(){var t;(t=r.current)===null||t===void 0||t.updateProps(a)},[a.content]),(0,c.tZ)("div",{ref:d,className:"vanilla-jsoneditor-react"})};u.default=i}}]); diff --git a/2539.b046b82e.async.js b/2539.b046b82e.async.js new file mode 100644 index 0000000000..54ac661a4c --- /dev/null +++ b/2539.b046b82e.async.js @@ -0,0 +1,832 @@ +!(function(){var DS=Object.defineProperty,LS=Object.defineProperties;var PS=Object.getOwnPropertyDescriptors;var Th=Object.getOwnPropertySymbols;var B0=Object.prototype.hasOwnProperty,F0=Object.prototype.propertyIsEnumerable;var Dv=Math.pow,k0=(Ve,z,C)=>z in Ve?DS(Ve,z,{enumerable:!0,configurable:!0,writable:!0,value:C}):Ve[z]=C,Da=(Ve,z)=>{for(var C in z||(z={}))B0.call(z,C)&&k0(Ve,C,z[C]);if(Th)for(var C of Th(z))F0.call(z,C)&&k0(Ve,C,z[C]);return Ve},mo=(Ve,z)=>LS(Ve,PS(z));var Ah=(Ve,z)=>{var C={};for(var x in Ve)B0.call(Ve,x)&&z.indexOf(x)<0&&(C[x]=Ve[x]);if(Ve!=null&&Th)for(var x of Th(Ve))z.indexOf(x)<0&&F0.call(Ve,x)&&(C[x]=Ve[x]);return C};var z0=(Ve,z,C)=>new Promise((x,k)=>{var w=P=>{try{L(C.next(P))}catch(p){k(p)}},T=P=>{try{L(C.throw(P))}catch(p){k(p)}},L=P=>P.done?x(P.value):Promise.resolve(P.value).then(w,T);L((C=C.apply(Ve,z)).next())});(self.webpackChunkantd=self.webpackChunkantd||[]).push([[2539],{62238:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var C=function(w,T){var L=w.nodes,P=w.edges,p=[],m={};if(!L)throw new Error("invalid nodes data!");return L&&L.forEach(function(S,y){m[S.id]=y;var g=[];p.push(g)}),P&&P.forEach(function(S){var y=S.source,g=S.target,A=m[y],E=m[g];!A&&A!==0||!E&&E!==0||(p[A][E]=1,T||(p[E][A]=1))}),p},x=C;z.default=x},810369:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),Object.defineProperty(z,"GADDIAsync",{enumerable:!0,get:function(){return x.GADDIAsync}}),Object.defineProperty(z,"connectedComponentAsync",{enumerable:!0,get:function(){return x.connectedComponentAsync}}),z.default=void 0,Object.defineProperty(z,"detectAllCyclesAsync",{enumerable:!0,get:function(){return x.detectAllCyclesAsync}}),Object.defineProperty(z,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return x.detectAllDirectedCycleAsync}}),Object.defineProperty(z,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return x.detectAllUndirectedCycleAsync}}),Object.defineProperty(z,"detectCycleAsync",{enumerable:!0,get:function(){return x.detectCycleAsync}}),z.detectDirectedCycleAsync=void 0,Object.defineProperty(z,"dijkstraAsync",{enumerable:!0,get:function(){return x.dijkstraAsync}}),Object.defineProperty(z,"findAllPathAsync",{enumerable:!0,get:function(){return x.findAllPathAsync}}),Object.defineProperty(z,"findShortestPathAsync",{enumerable:!0,get:function(){return x.findShortestPathAsync}}),Object.defineProperty(z,"floydWarshallAsync",{enumerable:!0,get:function(){return x.floydWarshallAsync}}),Object.defineProperty(z,"getAdjMatrixAsync",{enumerable:!0,get:function(){return x.getAdjMatrixAsync}}),Object.defineProperty(z,"getDegreeAsync",{enumerable:!0,get:function(){return x.getDegreeAsync}}),Object.defineProperty(z,"getInDegreeAsync",{enumerable:!0,get:function(){return x.getInDegreeAsync}}),Object.defineProperty(z,"getNeighborsAsync",{enumerable:!0,get:function(){return x.getNeighborsAsync}}),Object.defineProperty(z,"getOutDegreeAsync",{enumerable:!0,get:function(){return x.getOutDegreeAsync}}),Object.defineProperty(z,"labelPropagationAsync",{enumerable:!0,get:function(){return x.labelPropagationAsync}}),Object.defineProperty(z,"louvainAsync",{enumerable:!0,get:function(){return x.louvainAsync}}),Object.defineProperty(z,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return x.minimumSpanningTreeAsync}}),Object.defineProperty(z,"pageRankAsync",{enumerable:!0,get:function(){return x.pageRankAsync}});var x=C(430485),k=x.detectCycleAsync;z.detectDirectedCycleAsync=k;var w={getAdjMatrixAsync:x.getAdjMatrixAsync,connectedComponentAsync:x.connectedComponentAsync,getDegreeAsync:x.getDegreeAsync,getInDegreeAsync:x.getInDegreeAsync,getOutDegreeAsync:x.getOutDegreeAsync,detectCycleAsync:x.detectCycleAsync,detectDirectedCycleAsync:k,detectAllCyclesAsync:x.detectAllCyclesAsync,detectAllDirectedCycleAsync:x.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:x.detectAllUndirectedCycleAsync,dijkstraAsync:x.dijkstraAsync,findAllPathAsync:x.findAllPathAsync,findShortestPathAsync:x.findShortestPathAsync,floydWarshallAsync:x.floydWarshallAsync,labelPropagationAsync:x.labelPropagationAsync,louvainAsync:x.louvainAsync,minimumSpanningTreeAsync:x.minimumSpanningTreeAsync,pageRankAsync:x.pageRankAsync,getNeighborsAsync:x.getNeighborsAsync,GADDIAsync:x.GADDIAsync};z.default=w},683764:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var x=w(C(893026)),k=C(770643);function w(p){return p&&p.__esModule?p:{default:p}}function T(p){p===void 0&&(p={});var m=p,S=function(){},y=function(){var g={};return function(A){var E=A.next,D=E;return g[D]?!1:(g[D]=!0,!0)}}();return m.allowTraversal=p.allowTraversal||y,m.enter=p.enter||S,m.leave=p.leave||S,m}var L=function(m,S,y,g){g===void 0&&(g=!0);var A=T(y),E=new x.default,D=m.edges,F=D===void 0?[]:D;E.enqueue(S);for(var Y="",b=function(){var $=E.dequeue();A.enter({current:$,previous:Y}),(0,k.getNeighbors)($,F,g?"target":void 0).forEach(function(U){A.allowTraversal({previous:Y,current:$,next:U})&&E.enqueue(U)}),A.leave({current:$,previous:Y}),Y=$};!E.isEmpty();)b()},P=L;z.default=P},759527:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=T,z.detectStrongConnectComponents=z.detectConnectedComponents=void 0;var x=C(770643),k=function(P){for(var p=P.nodes,m=p===void 0?[]:p,S=P.edges,y=S===void 0?[]:S,g=[],A={},E=[],D=function h($){E.push($),A[$.id]=!0;for(var U=(0,x.getNeighbors)($.id,y),W=function(q){var tt=U[q];if(!A[tt]){var rt=m.filter(function(ft){return ft.id===tt});rt.length>0&&h(rt[0])}},V=0;V0;)b.push(E.pop());g.push(b)}}return g};z.detectConnectedComponents=k;var w=function(P){for(var p=P.nodes,m=p===void 0?[]:p,S=P.edges,y=S===void 0?[]:S,g=[],A={},E={},D={},F=[],Y=0,b=function W(V){E[V.id]=Y,D[V.id]=Y,Y+=1,g.push(V),A[V.id]=!0;for(var H=(0,x.getNeighbors)(V.id,y,"target").filter(function(it){return m.map(function(bt){return bt.id}).indexOf(it)>-1}),q=function(bt){var gt=H[bt];if(!E[gt]&&E[gt]!==0){var Xt=m.filter(function(Ct){return Ct.id===gt});Xt.length>0&&W(Xt[0]),D[V.id]=Math.min(D[V.id],D[gt])}else A[gt]&&(D[V.id]=Math.min(D[V.id],E[gt]))},tt=0;tt0;){var ft=g.pop();if(A[ft.id]=!1,rt.push(ft),ft===V)break}rt.length>0&&F.push(rt)}},h=0,$=m;h<$.length;h++){var U=$[h];!E[U.id]&&E[U.id]!==0&&b(U)}return F};z.detectStrongConnectComponents=w;function T(L,P){return P?w(L):k(L)}},592935:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.secondReg=z.dateReg=void 0;var C=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/;z.secondReg=C;var x=/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;z.dateReg=x},182556:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.getOutDegree=z.getInDegree=z.default=void 0;var C=function(L){var P={},p=L.nodes,m=p===void 0?[]:p,S=L.edges,y=S===void 0?[]:S;return m.forEach(function(g){P[g.id]={degree:0,inDegree:0,outDegree:0}}),y.forEach(function(g){P[g.source].degree++,P[g.source].outDegree++,P[g.target].degree++,P[g.target].inDegree++}),P},x=C;z.default=x;var k=function(L,P){var p=C(L);return p[P]?C(L)[P].inDegree:0};z.getInDegree=k;var w=function(L,P){var p=C(L);return p[P]?C(L)[P].outDegree:0};z.getOutDegree=w},994282:function(Ve,z,C){"use strict";function x(E){"@babel/helpers - typeof";return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(D){return typeof D}:function(D){return D&&typeof Symbol=="function"&&D.constructor===Symbol&&D!==Symbol.prototype?"symbol":typeof D},x(E)}Object.defineProperty(z,"__esModule",{value:!0}),z.detectAllUndirectedCycle=z.detectAllDirectedCycle=z.detectAllCycles=z.default=void 0;var k=p(C(45891)),w=P(C(759527)),T=C(770643);function L(E){if(typeof WeakMap!="function")return null;var D=new WeakMap,F=new WeakMap;return(L=function(b){return b?F:D})(E)}function P(E,D){if(!D&&E&&E.__esModule)return E;if(E===null||x(E)!=="object"&&typeof E!="function")return{default:E};var F=L(D);if(F&&F.has(E))return F.get(E);var Y={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in E)if(h!=="default"&&Object.prototype.hasOwnProperty.call(E,h)){var $=b?Object.getOwnPropertyDescriptor(E,h):null;$&&($.get||$.set)?Object.defineProperty(Y,h,$):Y[h]=E[h]}return Y.default=E,F&&F.set(E,Y),Y}function p(E){return E&&E.__esModule?E:{default:E}}var m=function(D){var F=null,Y=D.nodes,b=Y===void 0?[]:Y,h={},$={},U={},W={};b.forEach(function(q){$[q.id]=q});for(var V={enter:function(tt){var rt=tt.current,ft=tt.previous;if(U[rt]){F={};for(var it=rt,bt=ft;bt!==rt;)F[it]=bt,it=bt,bt=h[bt];F[it]=bt}else U[rt]=rt,delete $[rt],h[rt]=ft},leave:function(tt){var rt=tt.current;W[rt]=rt,delete U[rt]},allowTraversal:function(tt){var rt=tt.next;return F?!1:!W[rt]}};Object.keys($).length;){var H=Object.keys($)[0];(0,k.default)(D,H,V)}return F},S=function(D,F,Y){var b,h;Y===void 0&&(Y=!0);for(var $=[],U=(0,w.default)(D,!1),W=0,V=U;W0;)for(var bt=rt.pop(),gt=bt.id,Xt=(0,T.getNeighbors)(gt,D.edges),Ct=function(J){var yt,_t=Xt[J],nt=D.nodes.find(function(Qt){return Qt.id===_t});if(_t===gt)$.push((yt={},yt[_t]=bt,yt));else if(!(_t in it))ft[_t]=bt,rt.push(nt),it[_t]=new Set([bt]);else if(!it[gt].has(nt)){for(var vt=!0,It=[nt,bt],Pt=ft[gt];it[_t].size&&!it[_t].has(Pt)&&(It.push(Pt),Pt!==ft[Pt.id]);)Pt=ft[Pt.id];if(It.push(Pt),F&&Y?(vt=!1,It.findIndex(function(Qt){return F.indexOf(Qt.id)>-1})>-1&&(vt=!0)):F&&!Y&&It.findIndex(function(Qt){return F.indexOf(Qt.id)>-1})>-1&&(vt=!1),vt){for(var St={},Dt=1;Dt0;){var Dt=St.pop();h.has(Dt)&&(h.delete(Dt),$[Dt.id].forEach(function(Qt){St.push(Qt)}),$[Dt.id].clear())}},q=function It(Pt,St,Dt){var Qt=!1;if(F&&Y===!1&&F.indexOf(Pt.id)>-1)return Qt;b.push(Pt),h.add(Pt);for(var ue=Dt[Pt.id],ie=0;ie-1});Ce-1)?U.push((St={},St[ae.id]=ae,St)):Wt[ae.id].push(V[Jt])}}return{component:ve,adjList:Wt,minIdx:Qt}},Ct=0;Ct=Ct}),Z=(0,w.detectStrongConnectComponents)({nodes:At,edges:D.edges}).filter(function(It){return It.length>1});if(Z.length===0)break;var J=Xt(Z),yt=J.minIdx,_t=J.adjList,nt=J.component;if(nt.length>1){nt.forEach(function(It){$[It.id]=new Set});var vt=W[yt];if(F&&Y&&F.indexOf(vt.id)===-1)return U;q(vt,vt,_t),Ct=yt+1}else break}return U};z.detectAllDirectedCycle=y;var g=function(D,F,Y,b){return b===void 0&&(b=!0),F?y(D,Y,b):S(D,Y,b)};z.detectAllCycles=g;var A=m;z.default=A},45891:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=T;var x=C(770643);function k(L){L===void 0&&(L={});var P=L,p=function(){},m=function(){var S={};return function(y){var g=y.next;return S[g]?!1:(S[g]=!0,!0)}}();return P.allowTraversal=L.allowTraversal||m,P.enter=L.enter||p,P.leave=L.leave||p,P}function w(L,P,p,m){m.enter({current:P,previous:p});var S=L.edges,y=S===void 0?[]:S;(0,x.getNeighbors)(P,y,"target").forEach(function(g){m.allowTraversal({previous:p,current:P,next:g})&&w(L,g,P,m)}),m.leave({current:P,previous:p})}function T(L,P,p){w(L,P,"",k(p))}},878089:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var x=C(197582),k=C(413810),w=C(770643),T=function(S,y,g){for(var A=1/0,E,D=0;D$[bt.id]+yt?($[J]=$[bt.id]+yt,U[J]=[bt.id]):$[J]===$[bt.id]+yt&&U[J].push(bt.id)})},H=0;H0&&Y.length>0;){var $=Y[Y.length-1];if($.length){var U=$.shift();U&&(D.push(U),F[U]=!0,h=y?(0,k.getNeighbors)(U,E,"target"):(0,k.getNeighbors)(U,E),Y.push(h.filter(function(H){return!F[H]})))}else{var W=D.pop();F[W]=!1,Y.pop();continue}if(D[D.length-1]===S){var V=D.map(function(q){return q});b.push(V);var W=D.pop();F[W]=!1,Y.pop()}}return b};z.findAllPath=L},975033:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var x=k(C(62238));function k(L){return L&&L.__esModule?L:{default:L}}var w=function(P,p){for(var m=(0,x.default)(P,p),S=[],y=m.length,g=0;gS[g][E]+S[E][A]&&(S[g][A]=S[g][E]+S[E][A]);return S},T=w;z.default=T},821146:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var x=C(413810),k=C(368575),w=function(){function A(E,D,F,Y,b){this.fromNode=E,this.toNode=D,this.nodeEdgeNodeLabel={nodeLabel1:F||k.VACANT_NODE_LABEL,edgeLabel:Y||k.VACANT_EDGE_LABEL,nodeLabel2:b||k.VACANT_NODE_LABEL}}return A.prototype.equalTo=function(E){return this.fromNode===E.formNode&&this.toNode===E.toNode&&this.nodeEdgeNodeLabel===E.nodeEdgeNodeLabel},A.prototype.notEqualTo=function(E){return!this.equalTo(E)},A}(),T=function(){function A(){this.rmpath=[],this.dfsEdgeList=[]}return A.prototype.equalTo=function(E){var D=this.dfsEdgeList.length,F=E.length;if(D!==F)return!1;for(var Y=0;Y=0;F--){var Y=this.dfsEdgeList[F],b=Y.fromNode,h=Y.toNode;btt||Y.hasNode(h[q.to])||(D.labelXt;At--){var Z=Ct(At);if(Z==="break")break}if(bt){var J=E.findMinLabel(it);h.dfsEdgeList.push(new w(ft,gt,k.VACANT_NODE_LABEL,J.edgeLabel,k.VACANT_NODE_LABEL));var yt=h.dfsEdgeList.length-1;return E.dfsCode.dfsEdgeList[yt]!==h.dfsEdgeList[yt]?!1:H(it[J.edgeLabel].projected)}var _t={};bt=!1;var nt=0;q.forEach(function(Qt){var ue=new L(Qt),ie=E.findForwardPureEdges(Y,ue.edges[tt[0]],rt,ue);ie.length>0&&(bt=!0,nt=ft,ie.forEach(function(Lt){var ne="".concat(Lt.label,"-").concat(b[Lt.to].label);_t[ne]||(_t[ne]={projected:[],edgeLabel:Lt.label,nodeLabel2:b[Lt.to].label}),_t[ne].projected.push({graphId:Y.id,edge:Lt,preNode:Qt})}))});for(var vt=tt.length,It=function(ue){if(bt)return"break";var ie=tt[ue];q.forEach(function(Lt){var ne=new L(Lt),ve=E.findForwardRmpathEdges(Y,ne.edges[ie],rt,ne);ve.length>0&&(bt=!0,nt=h.dfsEdgeList[ie].fromNode,ve.forEach(function(Wt){var ae="".concat(Wt.label,"-").concat(b[Wt.to].label);_t[ae]||(_t[ae]={projected:[],edgeLabel:Wt.label,nodeLabel2:b[Wt.to].label}),_t[ae].projected.push({graphId:Y.id,edge:Wt,preNode:Lt})}))})},At=0;At=0;rt--){var ft=D.findBackwardEdge(H,tt.edges[b[rt]],tt.edges[b[0]],tt);if(ft){var it="".concat(D.dfsCode.dfsEdgeList[b[rt]].fromNode,"-").concat(ft.label);W[it]||(W[it]={projected:[],toNodeId:D.dfsCode.dfsEdgeList[b[rt]].fromNode,edgeLabel:ft.label}),W[it].projected.push({graphId:V.graphId,edge:ft,preNode:V})}}if(!(Y>=D.maxNodeNum)){var bt=D.findForwardPureEdges(H,tt.edges[b[0]],$,tt);bt.forEach(function(Xt){var Ct="".concat(h,"-").concat(Xt.label,"-").concat(q[Xt.to].label);U[Ct]||(U[Ct]={projected:[],fromNodeId:h,edgeLabel:Xt.label,nodeLabel2:q[Xt.to].label}),U[Ct].projected.push({graphId:V.graphId,edge:Xt,preNode:V})});for(var gt=function(Ct){var At=D.findForwardRmpathEdges(H,tt.edges[b[Ct]],$,tt);At.forEach(function(Z){var J="".concat(D.dfsCode.dfsEdgeList[b[Ct]].fromNode,"-").concat(Z.label,"-").concat(q[Z.to].label);U[J]||(U[J]={projected:[],fromNodeId:D.dfsCode.dfsEdgeList[b[Ct]].fromNode,edgeLabel:Z.label,nodeLabel2:q[Z.to].label}),U[J].projected.push({graphId:V.graphId,edge:Z,preNode:V})})},rt=0;rtXt){var Ct=Xt;Xt=gt,gt=Ct}var At=bt.label,Z="".concat(W,"-").concat(gt,"-").concat(At,"-").concat(Xt),J="".concat(gt,"-").concat(At,"-").concat(Xt);if(!h[J]){var yt=h[J]||0;yt++,h[J]=yt}U[Z]={graphId:W,nodeLabel1:gt,edgeLabel:At,nodeLabel2:Xt}})})}),Object.keys(b).forEach(function(W){var V=b[W];if(!(V2*V)););if(yt<2*V&&(ft["".concat(gt,"-").concat(J)]={start:gt,end:J,distance:tt[gt][J]},Xt++,it++,it>=H))return ft;if(Ct++,Ct>2*V)break}if(XtCt&&(it=Ct);var At=H[Xt.id].inDegree;bt>At&&(bt=At);var Z=H[Xt.id].outDegree;gt>Z&&(gt=Z)}),W[V]={degree:it,inDegree:bt,outDegree:gt}),{minPatternNodeLabelDegree:it,minPatternNodeLabelInDegree:bt,minPatternNodeLabelOutDegree:gt}},h=function(W,V,H,q,tt,rt,ft){var it;if(H===void 0&&(H=!1),rt===void 0&&(rt="cluster"),ft===void 0&&(ft="cluster"),!(!W||!W.nodes)){var bt=W.nodes.length;if(bt){var gt=(0,k.default)(W,H),Xt=(0,k.default)(V,H),Ct=F(W.nodes,gt,H),At=F(V.nodes,Xt,H),Z=E(W.nodes,rt),J=Z.nodeMap,yt=Z.nodeLabelMap,_t=E(V.nodes,rt),nt=_t.nodeMap,vt=_t.nodeLabelMap;D(W.edges,ft,J);var It=D(V.edges,ft,nt).edgeLabelMap,Pt=[];Xt==null||Xt.forEach(function(sn){Pt=Pt.concat(sn)}),tt||(tt=Math.max.apply(Math,(0,x.__spreadArray)((0,x.__spreadArray)([],Pt,!1),[2],!1))),q||(q=tt);var St=p(W,gt,rt,q),Dt=p(V,Xt,rt,q),Qt=Math.min(100,bt*(bt-1)/2),ue=S(q,bt,Qt,St,gt),ie=y(ue,St,W),Lt=10,ne=1,ve=1,Wt=4,ae={graphs:ie,nodeLabelProp:rt,edgeLabelProp:ft,minSupport:ne,minNodeNum:ve,maxNodeNum:Wt,directed:H},Ce=(0,w.default)(ae).slice(0,Lt),xe=Ce.length,Jt=[];Ce.forEach(function(sn,Wn){Jt[Wn]={},Object.keys(ie).forEach(function(Mn){var In=ie[Mn],jn=g(In,sn,rt,ft);Jt[Wn][Mn]=jn})});var we=A(Jt,xe,Ce),Tt=we.structure,Pe=we.structureCountMap,_r=V.nodes[0],Ar=[],Or=(it=V.nodes[0])===null||it===void 0?void 0:it[rt],Br=-1/0;V.nodes.forEach(function(sn){var Wn=sn[rt],Mn=yt[Wn];(Mn==null?void 0:Mn.length)>Br&&(Br=Mn.length,Ar=Mn,Or=Wn,_r=sn)});var cn={},an={},Dn={},Un={},Xn={},xr={};Object.keys(vt).forEach(function(sn,Wn){Xn[sn]=[],H&&(xr[sn]=[]);var Mn=-1/0,In=vt[sn],jn={};In.forEach(function(wt){var Me=At["".concat(_r.id,"-").concat(wt.id)];if(Me&&Xn[sn].push(Me),MnXn[sn][ot]){Q=!0;break}if(Q)return Ar.splice(Me,1),"continue";var R={};qt.neighbors.forEach(function(X){var mt=Ct["".concat(kt.id,"-").concat(X.id)];R["".concat(kt.id,"-").concat(X.id)]={start:J[kt.id].idx,end:J[X.id].idx,distance:mt}}),ie=y(R,St,W,ie);var M=[];Object.keys(R).forEach(function(X){if(Pe[X]){M.push(Pe[X]);return}var mt=ie[X];Pe[X]=g(mt,Tt,rt,ft),M.push(Pe[X])}),M=M.sort(function(X,mt){return mt-X});for(var O=!1,ot=0;ot=0;te--)Ht(te)});var $e=[];Ar==null||Ar.forEach(function(sn){for(var Wn=J[sn.id].idx,Mn=m(W.nodes,gt[Wn],Wn,rt,tt),In=Mn.neighbors,jn=In.length,at=!1,Je=jn-1;Je>=0;Je--){if(In.length+1qt){In.splice(Je,1);continue}if(H){var dt="".concat(Ht.id,"-").concat(sn.id),Ut=Ct[dt];kt=xr[te].length-1;var Q=xr[te][kt];if(Ut>Q){In.splice(Je,1);continue}}var ot=Pe[wt]?Pe[wt]:Y(W,sn,Ht,J,Me,St,Tt,rt,ft,Pe,ie),R="".concat(_r.id,"-").concat(te),M=Un[R][Un[R].length-1];if(ot=0;Me--){var Q=Ut(Me);if(Q==="break")break}if(dt)return $e.splice(Wn,1),"continue";Mn.edges=Je;var ot=(0,T.default)(Mn,Mn.nodes[0].id,!1).length;if(Object.keys(ot).reverse().forEach(function(Dr){if(!(Dr===Mn.nodes[0].id||dt)){if(ot[Dr]===1/0){var ce=at[Dr].node[rt];if(jn[ce]--,jn[ce]qr[pe][qr[pe].length-1]){var ce=at[Dr].node[rt];if(jn[ce]--,jn[ce]=0;mt--){var Ft=Mn.nodes[mt],Bt=at[Ft.id].degree,ee=at[Ft.id].inDegree,Le=at[Ft.id].outDegree,me=Ft[rt],Xe=b(cn,me,nt,vt),pr=Xe.minPatternNodeLabelDegree,Ze=Xe.minPatternNodeLabelInDegree,Pr=Xe.minPatternNodeLabelOutDegree,un=H?Bt=0;Ke--){var lr=Je[Ke];if(!at[lr.source]||!at[lr.target]){Je.splice(Ke,1);var Rr=lr[ft];if(Ht[Rr]--,at[lr.source]&&(at[lr.source].degree--,at[lr.source].outDegree--),at[lr.target]&&(at[lr.target].degree--,at[lr.target].inDegree--),It[Rr]&&Ht[Rr]=0;Rn--){var Mr=xn(Rn);if(Mr==="break")break}for(var dn=$e.length,hn=function(Wn){var Mn=$e[Wn],In={};Mn.edges.forEach(function(Je){var Ht="".concat(Je.source,"-").concat(Je.target,"-").concat(Je.label);In[Ht]?In[Ht]++:In[Ht]=1});for(var jn=function(Ht){var te=$e[Ht],wt={};te.edges.forEach(function(kt){var qt="".concat(kt.source,"-").concat(kt.target,"-").concat(kt.label);wt[qt]?wt[qt]++:wt[qt]=1});var Me=!0;Object.keys(wt).length!==Object.keys(In).length?Me=!1:Object.keys(In).forEach(function(kt){wt[kt]!==In[kt]&&(Me=!1)}),Me&&$e.splice(Ht,1)},at=dn-1;at>Wn;at--)jn(at);dn=$e.length},Rn=0;Rn<=dn-1;Rn++)hn(Rn);return $e}}},$=h;z.default=$},505170:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var x=w(C(62238)),k=C(770643);function w(P){return P&&P.__esModule?P:{default:P}}var T=function(p,m,S,y){m===void 0&&(m=!1),S===void 0&&(S="weight"),y===void 0&&(y=1e3);var g=p.nodes,A=g===void 0?[]:g,E=p.edges,D=E===void 0?[]:E,F={},Y={};A.forEach(function(rt,ft){var it=(0,k.uniqueId)();rt.clusterId=it,F[it]={id:it,nodes:[rt]},Y[rt.id]={node:rt,idx:ft}});var b=(0,x.default)(p,m),h=[],$={};b.forEach(function(rt,ft){var it=0,bt=A[ft].id;$[bt]={},rt.forEach(function(gt,Xt){if(gt){it+=gt;var Ct=A[Xt].id;$[bt][Ct]=gt}}),h.push(it)});for(var U=0,W=function(){var ft=!1;if(A.forEach(function(it){var bt={};Object.keys($[it.id]).forEach(function(_t){var nt=$[it.id][_t],vt=Y[_t].node,It=vt.clusterId;bt[It]||(bt[It]=0),bt[It]+=nt});var gt=-1/0,Xt=[];if(Object.keys(bt).forEach(function(_t){gt=0&&Xt.splice(Ct,1),Xt&&Xt.length){ft=!0;var At=F[it.clusterId],Z=At.nodes.indexOf(it);At.nodes.splice(Z,1);var J=Math.floor(Math.random()*Xt.length),yt=F[Xt[J]];yt.nodes.push(it),it.clusterId=yt.id}}}),!ft)return"break";U++};U0&&J>yt&&J-ytyt&&(nt=V.map(function(ie){return{node:ie,clusterId:ie.clusterId}}),vt=(0,x.clone)(bt),yt=J),It||_t>100)break;_t++,Object.keys(bt).forEach(function(ie){var Lt=0;q.forEach(function(ne){var ve=ne.source,Wt=ne.target,ae=gt[ve].node.clusterId,Ce=gt[Wt].node.clusterId;(ae===ie&&Ce!==ie||Ce===ie&&ae!==ie)&&(Lt=Lt+(ne[D]||1))}),bt[ie].sumTot=Lt}),V.forEach(function(ie,Lt){var ne=bt[ie.clusterId],ve=0,Wt,ae=Ct[Lt]/(2*Z),Ce=0,xe=ne.nodes;xe.forEach(function(an){var Dn=gt[an.id].idx;Ce+=Xt[Lt][Dn]||0});var Jt=Ce-ne.sumTot*ae,we=xe.filter(function(an){return an.id!==ie.id}),Tt=[];we.forEach(function(an,Dn){Tt[Dn]=tt[an.originIndex]});var Pe=m(we,tt)*U,_r=At[ie.id];if(Object.keys(_r).forEach(function(an){var Dn=gt[an].node,Un=Dn.clusterId;if(Un!==ie.clusterId){var Xn=bt[Un],xr=Xn.nodes;if(!(!xr||!xr.length)){var $e=0;xr.forEach(function(Mr){var dn=gt[Mr.id].idx;$e+=Xt[Lt][dn]||0});var Tr=$e-Xn.sumTot*ae,qr=xr.concat([ie]),gn=[];qr.forEach(function(Mr,dn){gn[dn]=tt[Mr.originIndex]});var xn=m(qr,tt)*U,Rn=Tr-Jt;Y&&(Rn=Tr+xn-(Jt+Pe)),Rn>ve&&(ve=Rn,Wt=Xn)}}}),ve>0){Wt.nodes.push(ie);var Ar=ie.clusterId;ie.clusterId=Wt.id;var Or=ne.nodes.indexOf(ie);ne.nodes.splice(Or,1);var Br=0,cn=0;q.forEach(function(an){var Dn=an.source,Un=an.target,Xn=gt[Dn].node.clusterId,xr=gt[Un].node.clusterId;(Xn===Wt.id&&xr!==Wt.id||xr===Wt.id&&Xn!==Wt.id)&&(Br=Br+(an[D]||1)),(Xn===Ar&&xr!==Ar||xr===Ar&&Xn!==Ar)&&(cn=cn+(an[D]||1))}),Wt.sumTot=Br,ne.sumTot=cn}})}var Pt={},St=0;Object.keys(vt).forEach(function(ie){var Lt=vt[ie];if(!Lt.nodes||!Lt.nodes.length){delete vt[ie];return}var ne=String(St+1);ne!==ie&&(Lt.id=ne,Lt.nodes=Lt.nodes.map(function(ve){return{id:ve.id,clusterId:ne}}),vt[ne]=Lt,Pt[ie]=ne,delete vt[ie],St++)}),nt.forEach(function(ie){var Lt=ie.node,ne=ie.clusterId;Lt&&(Lt.clusterId=ne,Lt.clusterId&&Pt[Lt.clusterId]&&(Lt.clusterId=Pt[Lt.clusterId]))});var Dt=[],Qt={};q.forEach(function(ie){var Lt=ie.source,ne=ie.target,ve=ie[D]||1,Wt=gt[Lt].node.clusterId,ae=gt[ne].node.clusterId;if(!(!Wt||!ae)){var Ce="".concat(Wt,"---").concat(ae);if(Qt[Ce])Qt[Ce].weight+=ve,Qt[Ce].count++;else{var xe={source:Wt,target:ae,weight:ve,count:1};Qt[Ce]=xe,Dt.push(xe)}}});var ue=[];return Object.keys(vt).forEach(function(ie){ue.push(vt[ie])}),{clusters:ue,clusterEdges:Dt}},y=S;z.default=y},689454:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var x=T(C(838823)),k=T(C(257085)),w=C(770643);function T(S){return S&&S.__esModule?S:{default:S}}var L=function(y,g){var A=[],E=y.nodes,D=E===void 0?[]:E,F=y.edges,Y=F===void 0?[]:F;if(D.length===0)return A;var b=D[0],h=new Set;h.add(b);var $=function(tt,rt){return g?tt.weight-rt.weight:0},U=new k.default($);for((0,w.getEdgesByNodeId)(b.id,Y).forEach(function(q){U.insert(q)});!U.isEmpty();){var W=U.delMin(),V=W.source,H=W.target;h.has(V)&&h.has(H)||(A.push(W),h.has(V)||(h.add(V),(0,w.getEdgesByNodeId)(V,Y).forEach(function(q){U.insert(q)})),h.has(H)||(h.add(H),(0,w.getEdgesByNodeId)(H,Y).forEach(function(q){U.insert(q)})))}return A},P=function(y,g){var A=[],E=y.nodes,D=E===void 0?[]:E,F=y.edges,Y=F===void 0?[]:F;if(D.length===0)return A;var b=Y.map(function(V){return V});g&&b.sort(function(V,H){return V.weight-H.weight});for(var h=new x.default(D.map(function(V){return V.id}));b.length>0;){var $=b.shift(),U=$.source,W=$.target;h.connected(U,W)||(A.push($),h.union(U,W))}return A},p=function(y,g,A){var E={prim:L,kruskal:P};return A?E[A](y,g):P(y,g)},m=p;z.default=m},274926:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var x=w(C(182556)),k=C(770643);function w(P){return P&&P.__esModule?P:{default:P}}var T=function(p,m,S){typeof m!="number"&&(m=1e-6),typeof S!="number"&&(S=.85);for(var y=1,g=0,A=1e3,E=p.nodes,D=E===void 0?[]:E,F=p.edges,Y=F===void 0?[]:F,b=D.length,h,$={},U={},W=0;W0&&y>m;){g=0;for(var W=0;W0&&(h+=U[ft]/it)}$[H]=S*h,g+=$[H]}}g=(1-g)/b,y=0;for(var W=0;W0&&(this.list[0]=L,this.moveDown(0)),T},w.prototype.insert=function(T){if(T!==null){this.list.push(T);var L=this.list.length-1;return this.moveUp(L),!0}return!1},w.prototype.moveUp=function(T){for(var L=this.getParent(T);T&&T>0&&this.compareFn(this.list[L],this.list[T])>0;){var P=this.list[L];this.list[L]=this.list[T],this.list[T]=P,T=L,L=this.getParent(T)}},w.prototype.moveDown=function(T){var L,P=T,p=this.getLeft(T),m=this.getRight(T),S=this.list.length;p!==null&&p0?P=p:m!==null&&m0&&(P=m),T!==P&&(L=[this.list[P],this.list[T]],this.list[T]=L[0],this.list[P]=L[1],this.moveDown(P))},w}(),k=x;z.default=k},488481:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=z.LinkedListNode=void 0;var C=function(L,P){return L===P},x=function(){function T(L,P){P===void 0&&(P=null),this.value=L,this.next=P}return T.prototype.toString=function(L){return L?L(this.value):"".concat(this.value)},T}();z.LinkedListNode=x;var k=function(){function T(L){L===void 0&&(L=C),this.head=null,this.tail=null,this.compare=L}return T.prototype.prepend=function(L){var P=new x(L,this.head);return this.head=P,this.tail||(this.tail=P),this},T.prototype.append=function(L){var P=new x(L);return this.head?(this.tail.next=P,this.tail=P,this):(this.head=P,this.tail=P,this)},T.prototype.delete=function(L){if(!this.head)return null;for(var P=null;this.head&&this.compare(this.head.value,L);)P=this.head,this.head=this.head.next;var p=this.head;if(p!==null)for(;p.next;)this.compare(p.next.value,L)?(P=p.next,p.next=p.next.next):p=p.next;return this.compare(this.tail.value,L)&&(this.tail=p),P},T.prototype.find=function(L){var P=L.value,p=P===void 0?void 0:P,m=L.callback,S=m===void 0?void 0:m;if(!this.head)return null;for(var y=this.head;y;){if(S&&S(y.value)||p!==void 0&&this.compare(y.value,p))return y;y=y.next}return null},T.prototype.deleteTail=function(){var L=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,L;for(var P=this.head;P.next;)P.next.next?P=P.next:P.next=null;return this.tail=P,L},T.prototype.deleteHead=function(){if(!this.head)return null;var L=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),L},T.prototype.fromArray=function(L){var P=this;return L.forEach(function(p){return P.append(p)}),this},T.prototype.toArray=function(){for(var L=[],P=this.head;P;)L.push(P),P=P.next;return L},T.prototype.reverse=function(){for(var L=this.head,P=null,p=null;L;)p=L.next,L.next=P,P=L,L=p;this.tail=this.head,this.head=P},T.prototype.toString=function(L){return L===void 0&&(L=void 0),this.toArray().map(function(P){return P.toString(L)}).toString()},T}(),w=k;z.default=w},893026:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var x=k(C(488481));function k(L){return L&&L.__esModule?L:{default:L}}var w=function(){function L(){this.linkedList=new x.default}return L.prototype.isEmpty=function(){return!this.linkedList.head},L.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},L.prototype.enqueue=function(P){this.linkedList.append(P)},L.prototype.dequeue=function(){var P=this.linkedList.deleteHead();return P?P.value:null},L.prototype.toString=function(P){return this.linkedList.toString(P)},L}(),T=w;z.default=T},838823:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var C=function(){function k(w){this.count=w.length,this.parent={};for(var T=0,L=w;T0&&qt[0]!==void 0?qt[0]:1,!this.dirty){Ut.next=6;break}return this.compiledBundle.context&&(Me>1?this.compiledBundle.context.maxIteration=Me:this.compiledBundle.context.maxIteration++),Ut.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(Q){var ot=Q.isReferer;return ot}).forEach(function(Q){var ot=Q.data,R=Q.name;wt.model.confirmInput(ot.model,R)}),kt=0;kt16)throw new Error("invalid data type ".concat(ot));wt[Q]=function(){return Ut.data}}});var Me=this.getOuputDataTexture(),kt=Me.textureWidth,qt=Me.texelCount;wt.u_OutputTextureSize=[kt,kt],wt.u_OutputTexelCount=qt,this.context.output.textureSize=[kt,kt];var dt={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 + precision highp float; +#else + precision mediump float; +#endif +`.concat(this.context.shader),uniforms:wt,vert:Un,primitive:"triangle strip",count:4};this.computeCommand=this.reGl(dt)}return(0,T.Z)(at,[{key:"run",value:function(){var Ht=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(){Ht.computeCommand()}),xr&&console.log("[".concat(this.entity,"]: output ").concat(this.getOuputDataTexture().id))}},{key:"readData",value:function(){var Je=(0,x.Z)(A().mark(function te(){var wt=this,Me,kt,qt,dt,Ut,Q,ot,R;return A().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:if(this.reGl({framebuffer:this.texFBO})(function(){Me=wt.reGl.read()}),!Me){O.next=6;break}if(kt=this.getOuputDataTexture(),qt=kt.originalDataLength,dt=kt.elementsPerTexel,Ut=kt.typedArrayConstructor,Q=Ut===void 0?Float32Array:Ut,ot=[],dt!==4)for(R=0;R2&&arguments[2]!==void 0?arguments[2]:0,Me=this.context.uniforms.find(function(Ut){var Q=Ut.name;return Q===Ht});if(Me){var kt=this.calcDataTexture(Ht,Me.type,te),qt=kt.texture,dt=kt.data;this.textureCache[Ht].data=dt,this.textureCache[Ht].texture=qt}}},{key:"destroy",value:function(){}},{key:"swap",value:function(){if(this.swapOutputTextureName||this.createSwapOutputDataTexture(),this.compiledPingpong){var Ht=this.context.output.name;this.textureCache[Ht].id=this.getOuputDataTexture().id,this.textureCache[Ht].texture=this.getOuputDataTexture().texture}var te=this.outputTextureName;this.outputTextureName=this.swapOutputTextureName,this.swapOutputTextureName=te,xr&&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 Ht=this.cloneDataTexture(this.getOuputDataTexture());this.swapOutputTextureName="".concat(this.entity,"-swap"),this.textureCache[this.swapOutputTextureName]=Ht}},{key:"cloneDataTexture",value:function(Ht){var te=Ht.data,wt=Ht.textureWidth;return Dn(Dn({},Ht),{},{id:Xn++,texture:this.reGl.texture({width:wt,height:wt,data:te,type:"float"})})}},{key:"calcDataTexture",value:function(Ht,te,wt){var Me=1;te===W.Vector4FloatArray&&(Me=4);for(var kt=[],qt=0;qt0&&arguments[0]!==void 0?arguments[0]:{},te=new at;return te.setConfig(Ht),te.setEngine(new In),te}}]),at}()},904097:function(Ve,z,C){"use strict";C.d(z,{ZP:function(){return MS}});var x={};C.r(x),C.d(x,{GADDI:function(){return no},Stack:function(){return vo},breadthFirstSearch:function(){return ve},connectedComponent:function(){return Ce},cosineSimilarity:function(){return ee},default:function(){return ao},depthFirstSearch:function(){return Ar},detectAllCycles:function(){return an},detectAllDirectedCycle:function(){return cn},detectAllUndirectedCycle:function(){return Br},detectCycle:function(){return Dn},detectDirectedCycle:function(){return Si},dijkstra:function(){return xr},findAllPath:function(){return qr},findShortestPath:function(){return Tr},floydWarshall:function(){return xn},getAdjMatrix:function(){return yt},getDegree:function(){return Jt},getInDegree:function(){return we},getNeighbors:function(){return Dt},getOutDegree:function(){return Tt},iLouvain:function(){return R},kCore:function(){return O},kMeans:function(){return Ft},labelPropagation:function(){return Mr},louvain:function(){return Q},minimumSpanningTree:function(){return Dr},nodesCosineSimilarity:function(){return me},pageRank:function(){return jt}});var k={};C.r(k),C.d(k,{Line:function(){return yi},applyMatrix:function(){return fn},compare:function(){return Ge},distance:function(){return Zn},floydWarshall:function(){return ya},fractionToLine:function(){return Wi},getAdjMatrix:function(){return di},getBBoxBoundLine:function(){return mi},getCircleCenterByPoints:function(){return sa},getCircleIntersectByPoint:function(){return Sr},getDegree:function(){return Fa},getEllipseIntersectByPoint:function(){return en},getLineIntersect:function(){return Lr},getPointsCenter:function(){return Ao},getRectIntersectByPoint:function(){return Nr},intersectBBox:function(){return La},invertMatrix:function(){return Pn},isPointInPolygon:function(){return fi},isPointsOverlap:function(){return $i},isPolygonsIntersect:function(){return za},itemIntersectByLine:function(){return po},lerp:function(){return io},lerpArray:function(){return Qa},move:function(){return oa},pointLineDistance:function(){return Yi},pointLineSquareDist:function(){return os},pointRectSquareDist:function(){return qa},rotate:function(){return $a},scale:function(){return si},scaleMatrix:function(){return pa},squareDist:function(){return Vo},translate:function(){return Ma}});var w={};C.r(w),C.d(w,{cloneBesidesImg:function(){return Us},getAnimateCfgWithCallback:function(){return ws},getBBox:function(){return Ci},getComboBBox:function(){return Vs},getLabelPosition:function(){return Go},getLetterWidth:function(){return Gs},getLoopCfgs:function(){return Io},getTextSize:function(){return vs},plainCombosToTrees:function(){return Qs},reconstructTree:function(){return Js},shouldRefreshEdge:function(){return Rs},traverseTree:function(){return ji},traverseTreeUp:function(){return xo},truncateLabelByLength:function(){return qs}});var T={};C.r(T),C.d(T,{catmullRomToBezier:function(){return Et},fillPath:function(){return So},fillPathByDiff:function(){return Bi},formatPath:function(){return ps},intersection:function(){return Oo},parsePathArray:function(){return ur},parsePathString:function(){return G},pathToAbsolute:function(){return re},pathToCurve:function(){return ze},rectPath:function(){return Qr}});var L={};C.r(L),C.d(L,{easeBack:function(){return Nc},easeBackIn:function(){return Lc},easeBackInOut:function(){return Nc},easeBackOut:function(){return Pc},easeBounce:function(){return tf},easeBounceIn:function(){return Hl},easeBounceInOut:function(){return Kf},easeBounceOut:function(){return tf},easeCircle:function(){return ml},easeCircleIn:function(){return Ju},easeCircleInOut:function(){return ml},easeCircleOut:function(){return Gl},easeCubic:function(){return Lu},easeCubicIn:function(){return $u},easeCubicInOut:function(){return Lu},easeCubicOut:function(){return qu},easeElastic:function(){return $f},easeElasticIn:function(){return xl},easeElasticInOut:function(){return Rc},easeElasticOut:function(){return $f},easeExp:function(){return gl},easeExpIn:function(){return vl},easeExpInOut:function(){return gl},easeExpOut:function(){return pl},easeLinear:function(){return xf},easePoly:function(){return Oc},easePolyIn:function(){return Ic},easePolyInOut:function(){return Oc},easePolyOut:function(){return Hf},easeQuad:function(){return Ku},easeQuadIn:function(){return Zu},easeQuadInOut:function(){return Ku},easeQuadOut:function(){return Du},easeSin:function(){return hl},easeSinIn:function(){return Ks},easeSinInOut:function(){return hl},easeSinOut:function(){return dl}});var P={};C.r(P),C.d(P,{calculationItemsBBox:function(){return Lv},cloneEvent:function(){return G0},formatPadding:function(){return Oh},isNaN:function(){return _f},isViewportChanged:function(){return U0},processParallelEdges:function(){return W0},uniqueId:function(){return Ih}});var p={};C.r(p),C.d(p,{getClosedSpline:function(){return zh},getControlPoint:function(){return Zd},getSpline:function(){return Zv},getStarPath:function(){return um},paddedHull:function(){return Qv},pathToPoints:function(){return Fh},pointsToPolygon:function(){return sm},roundedHull:function(){return Gh}});var m={};C.r(m),C.d(m,{defaultSubjectColors:function(){return Im}});var S={};C.r(S),C.d(S,{isForce:function(){return fp}});var y={};C.r(y),C.d(y,{Base:function(){return uf},Circle:function(){return ty},Ellipse:function(){return ry},Image:function(){return ay},Line:function(){return oy},Marker:function(){return fy},Path:function(){return Jh},Polygon:function(){return yy},Polyline:function(){return by},Rect:function(){return My},Text:function(){return Cy}});var g={};C.r(g),C.d(g,{Base:function(){return Fu},Circle:function(){return Ny},Dom:function(){return ky},Ellipse:function(){return Fy},Image:function(){return Gy},Line:function(){return Wy},Marker:function(){return Xy},Path:function(){return Vy},Polygon:function(){return Zy},Polyline:function(){return $y},Rect:function(){return e1},Text:function(){return o1}});var A={};C.r(A),C.d(A,{getColorSetsBySubjectColors:function(){return N1},getColorsWithSubjectColor:function(){return nv},mixColor:function(){return Ps}});var E={};C.r(E),C.d(E,{arrayToTextureData:function(){return H1},attributesToTextureData:function(){return V1},buildTextureData:function(){return Y1},buildTextureDataWithOneEdgeAttr:function(){return X1},buildTextureDataWithTwoEdgeAttr:function(){return j1},proccessToFunc:function(){return W1},radialLayout:function(){return Z1}});var D={};C.r(D),C.d(D,{gpuDetector:function(){return Qp}});var F={};C.r(F),C.d(F,{getBrowserName:function(){return Jp}});var Y={};C.r(Y),C.d(Y,{assign:function(){return Zc},default:function(){return Rg},defaultI18n:function(){return vv},format:function(){return Pg},parse:function(){return Ng},setGlobalDateI18n:function(){return _g},setGlobalDateMasks:function(){return Lg}});var b=C(197582),h=C(413810),$={getDefaultCfg:function(){return{}},getEvents:function(){return{}},updateCfg:function(e){return Object.assign(this,e),!0},shouldBegin:function(){return!0},shouldUpdate:function(){return!0},shouldEnd:function(){return!0},bind:function(e){var t=this,r=this.events;this.graph=e,(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!0),(0,h.each)(r,function(n,a){e.on(a,n)}),document.addEventListener("visibilitychange",function(){t.keydown=!1})},unbind:function(e){var t=this.events,r=e.get("canvas").get("draggable");(this.type==="drag-canvas"||this.type==="brush-select"||this.type==="lasso-select")&&e.get("canvas").set("draggable",!1),(0,h.each)(t,function(n,a){e.off(a,n)}),e.get("canvas").set("draggable",r)},get:function(e){return this[e]},set:function(e,t){return this[e]=t,this}},U=function(){function i(){}return i.registerBehavior=function(e,t){if(!t)throw new Error("please specify handler for this behavior: ".concat(e));var r=(0,h.clone)($);Object.assign(r,t);var n=function(o){var s=this;Object.assign(this,this.getDefaultCfg(),o);var u=this.getEvents();this.events=null;var f={};u&&((0,h.each)(u,function(c,l){f[l]=(0,h.wrapBehavior)(s,c)}),this.events=f)};n.prototype=r,i.types[e]=n},i.hasBehavior=function(e){return!!i.types[e]},i.getBehavior=function(e){return i.types[e]},i.types={},i}(),W=U,V=W,H="*",q=function(){function i(){this._events={}}return i.prototype.on=function(e,t,r){return this._events[e]||(this._events[e]=[]),this._events[e].push({callback:t,once:!!r}),this},i.prototype.once=function(e,t){return this.on(e,t,!0)},i.prototype.emit=function(e){for(var t=this,r=[],n=1;n=0;return t?n?Math.PI*2-r:r:n?r:Math.PI*2-r}function Z(i,e,t){return t?(i[0]=e[1],i[1]=-1*e[0]):(i[0]=-1*e[1],i[1]=e[0]),i}var J=function(e,t){var r=e.nodes,n=e.edges,a=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(s,u){o[s.id]=u;var f=[];a.push(f)}),n&&n.forEach(function(s){var u=s.source,f=s.target,c=o[u],l=o[f];!c&&c!==0||!l&&l!==0||(a[c][l]=1,t||(a[l][c]=1))}),a},yt=J,_t=function(e,t){return e===t},nt=function(){function i(e,t){t===void 0&&(t=null),this.value=e,this.next=t}return i.prototype.toString=function(e){return e?e(this.value):"".concat(this.value)},i}(),vt=function(){function i(e){e===void 0&&(e=_t),this.head=null,this.tail=null,this.compare=e}return i.prototype.prepend=function(e){var t=new nt(e,this.head);return this.head=t,this.tail||(this.tail=t),this},i.prototype.append=function(e){var t=new nt(e);return this.head?(this.tail.next=t,this.tail=t,this):(this.head=t,this.tail=t,this)},i.prototype.delete=function(e){if(!this.head)return null;for(var t=null;this.head&&this.compare(this.head.value,e);)t=this.head,this.head=this.head.next;var r=this.head;if(r!==null)for(;r.next;)this.compare(r.next.value,e)?(t=r.next,r.next=r.next.next):r=r.next;return this.compare(this.tail.value,e)&&(this.tail=r),t},i.prototype.find=function(e){var t=e.value,r=t===void 0?void 0:t,n=e.callback,a=n===void 0?void 0:n;if(!this.head)return null;for(var o=this.head;o;){if(a&&a(o.value)||r!==void 0&&this.compare(o.value,r))return o;o=o.next}return null},i.prototype.deleteTail=function(){var e=this.tail;if(this.head===this.tail)return this.head=null,this.tail=null,e;for(var t=this.head;t.next;)t.next.next?t=t.next:t.next=null;return this.tail=t,e},i.prototype.deleteHead=function(){if(!this.head)return null;var e=this.head;return this.head.next?this.head=this.head.next:(this.head=null,this.tail=null),e},i.prototype.fromArray=function(e){var t=this;return e.forEach(function(r){return t.append(r)}),this},i.prototype.toArray=function(){for(var e=[],t=this.head;t;)e.push(t),t=t.next;return e},i.prototype.reverse=function(){for(var e=this.head,t=null,r=null;e;)r=e.next,e.next=t,t=e,e=r;this.tail=this.head,this.head=t},i.prototype.toString=function(e){return e===void 0&&(e=void 0),this.toArray().map(function(t){return t.toString(e)}).toString()},i}(),It=vt,Pt=function(){function i(){this.linkedList=new It}return i.prototype.isEmpty=function(){return!this.linkedList.head},i.prototype.peek=function(){return this.linkedList.head?this.linkedList.head.value:null},i.prototype.enqueue=function(e){this.linkedList.append(e)},i.prototype.dequeue=function(){var e=this.linkedList.deleteHead();return e?e.value:null},i.prototype.toString=function(e){return this.linkedList.toString(e)},i}(),St=Pt,Dt=function(e,t,r){t===void 0&&(t=[]);var n=t.filter(function(u){return u.source===e||u.target===e});if(r==="target"){var a=function(f){return f.source===e};return n.filter(a).map(function(u){return u.target})}if(r==="source"){var o=function(f){return f.target===e};return n.filter(o).map(function(u){return u.source})}var s=function(f){return f.source===e?f.target:f.source};return n.map(s)},Qt=function(e,t){return t.filter(function(r){return r.source===e})},ue=function(e,t){return t.filter(function(r){return r.source===e||r.target===e})},ie=function(e){e===void 0&&(e=0);var t="".concat(Math.random()).split(".")[1].substr(0,5),r="".concat(Math.random()).split(".")[1].substr(0,5);return"".concat(e,"-").concat(t).concat(r)};function Lt(i){i===void 0&&(i={});var e=i,t=function(){},r=function(){var n={};return function(a){var o=a.next,s=o;return n[s]?!1:(n[s]=!0,!0)}}();return e.allowTraversal=i.allowTraversal||r,e.enter=i.enter||t,e.leave=i.leave||t,e}var ne=function(e,t,r,n){n===void 0&&(n=!0);var a=Lt(r),o=new St,s=e.edges,u=s===void 0?[]:s;o.enqueue(t);for(var f="",c=function(){var _=o.dequeue();a.enter({current:_,previous:f}),Dt(_,u,n?"target":void 0).forEach(function(I){a.allowTraversal({previous:f,current:_,next:I})&&o.enqueue(I)}),a.leave({current:_,previous:f}),f=_};!o.isEmpty();)c()},ve=ne,Wt=function(e){for(var t=e.nodes,r=t===void 0?[]:t,n=e.edges,a=n===void 0?[]:n,o=[],s={},u=[],f=function I(B){u.push(B),s[B.id]=!0;for(var j=Dt(B.id,a),et=function(pt){var Mt=j[pt];if(!s[Mt]){var Zt=r.filter(function(se){return se.id===Mt});Zt.length>0&&I(Zt[0])}},ut=0;ut0;)_.push(u.pop());o.push(_)}}return o},ae=function(e){for(var t=e.nodes,r=t===void 0?[]:t,n=e.edges,a=n===void 0?[]:n,o=[],s={},u={},f={},c=[],l=0,_=function et(ut){u[ut.id]=l,f[ut.id]=l,l+=1,o.push(ut),s[ut.id]=!0;for(var ct=Dt(ut.id,a,"target").filter(function(oe){return r.map(function(_e){return _e.id}).indexOf(oe)>-1}),pt=function(_e){var Ue=ct[_e];if(!u[Ue]&&u[Ue]!==0){var Re=r.filter(function(qe){return qe.id===Ue});Re.length>0&&et(Re[0]),f[ut.id]=Math.min(f[ut.id],f[Ue])}else s[Ue]&&(f[ut.id]=Math.min(f[ut.id],u[Ue]))},Mt=0;Mt0;){var se=o.pop();if(s[se.id]=!1,Zt.push(se),se===ut)break}Zt.length>0&&c.push(Zt)}},I=0,B=r;I0;)for(var et=I.pop(),ut=et.id,ct=Dt(ut,e.edges),pt=function(se){var oe,_e=ct[se],Ue=e.nodes.find(function(En){return En.id===_e});if(_e===ut)o.push((oe={},oe[_e]=et,oe));else if(!(_e in j))B[_e]=et,I.push(Ue),j[_e]=new Set([et]);else if(!j[ut].has(Ue)){for(var Re=!0,qe=[Ue,et],hr=B[ut];j[_e].size&&!j[_e].has(hr)&&(qe.push(hr),hr!==B[hr.id]);)hr=B[hr.id];if(qe.push(hr),t&&r?(Re=!1,qe.findIndex(function(En){return t.indexOf(En.id)>-1})>-1&&(Re=!0)):t&&!r&&qe.findIndex(function(En){return t.indexOf(En.id)>-1})>-1&&(Re=!1),Re){for(var nn={},kn=1;kn0;){var kn=nn.pop();a.has(kn)&&(a.delete(kn),o[kn.id].forEach(function(En){nn.push(En)}),o[kn.id].clear())}},l=function qe(hr,nn,kn){var En=!1;if(t&&r===!1&&t.indexOf(hr.id)>-1)return En;n.push(hr),a.add(hr);for(var Kr=kn[hr.id],ta=0;ta-1});ia-1)?s.push((nn={},nn[zn.id]=zn,nn)):Fn[zn.id].push(f[Wa])}}return{component:yn,adjList:Fn,minIdx:En}},pt=0;pt=pt}),Zt=ae({nodes:Mt,edges:e.edges}).filter(function(qe){return qe.length>1});if(Zt.length===0)break;var se=ct(Zt),oe=se.minIdx,_e=se.adjList,Ue=se.component;if(Ue.length>1){Ue.forEach(function(qe){o[qe.id]=new Set});var Re=u[oe];if(t&&r&&t.indexOf(Re.id)===-1)return s;l(Re,Re,_e),pt=oe+1}else break}return s},an=function(e,t,r,n){return n===void 0&&(n=!0),t?cn(e,r,n):Br(e,r,n)},Dn=Or,Un=function(e,t,r){for(var n=1/0,a,o=0;ol[Zt.id]+hr?(l[qe]=l[Zt.id]+hr,_[qe]=[Zt.id]):l[qe]===l[Zt.id]+hr&&_[qe].push(Zt.id)})},j=0;j0&&c.length>0;){var I=c[c.length-1];if(I.length){var B=I.shift();B&&(u.push(B),f[B]=!0,_=n?Dt(B,s,"target"):Dt(B,s),c.push(_.filter(function(ut){return!f[ut]})))}else{var j=u.pop();f[j]=!1,c.pop();continue}if(u[u.length-1]===r){var et=u.map(function(ct){return ct});l.push(et);var j=u.pop();f[j]=!1,c.pop()}}return l},gn=function(e,t){for(var r=yt(e,t),n=[],a=r.length,o=0;on[o][u]+n[u][s]&&(n[o][s]=n[o][u]+n[u][s]);return n},xn=gn,Rn=function(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r="weight"),n===void 0&&(n=1e3);var a=e.nodes,o=a===void 0?[]:a,s=e.edges,u=s===void 0?[]:s,f={},c={};o.forEach(function(Mt,Zt){var se=ie();Mt.clusterId=se,f[se]={id:se,nodes:[Mt]},c[Mt.id]={node:Mt,idx:Zt}});var l=yt(e,t),_=[],I={};l.forEach(function(Mt,Zt){var se=0,oe=o[Zt].id;I[oe]={},Mt.forEach(function(_e,Ue){if(_e){se+=_e;var Re=o[Ue].id;I[oe][Re]=_e}}),_.push(se)});for(var B=0,j=function(){var Zt=!1;if(o.forEach(function(se){var oe={};Object.keys(I[se.id]).forEach(function(En){var Kr=I[se.id][En],ta=c[En].node,$n=ta.clusterId;oe[$n]||(oe[$n]=0),oe[$n]+=Kr});var _e=-1/0,Ue=[];if(Object.keys(oe).forEach(function(En){_e=0&&Ue.splice(Re,1),Ue&&Ue.length){Zt=!0;var qe=f[se.clusterId],hr=qe.nodes.indexOf(se);qe.nodes.splice(hr,1);var nn=Math.floor(Math.random()*Ue.length),kn=f[Ue[nn]];kn.nodes.push(se),se.clusterId=kn.id}}}),!Zt)return"break";B++};B0&&_e>Ue&&_e-UeUe&&(qe=l.map(function($r){return{node:$r,clusterId:$r.clusterId}}),hr=(0,h.clone)(ct),Ue=_e),nn||Re>100)break;Re++,Object.keys(ct).forEach(function($r){var yn=0;I.forEach(function(Fn){var zn=Fn.source,ia=Fn.target,da=pt[zn].node.clusterId,Wa=pt[ia].node.clusterId;(da===$r&&Wa!==$r||Wa===$r&&da!==$r)&&(yn=yn+(Fn[r]||1))}),ct[$r].sumTot=yn}),l.forEach(function($r,yn){var Fn=ct[$r.clusterId],zn=0,ia,da=Zt[yn]/(2*oe),Wa=0,oi=Fn.nodes;oi.forEach(function(As){var Is=pt[As.id].idx;Wa+=Mt[yn][Is]||0});var Qi=Wa-Fn.sumTot*da,Li=oi.filter(function(As){return As.id!==$r.id}),Ji=[];Li.forEach(function(As,Is){Ji[Is]=B[As.originIndex]});var co=dt(Li,B)*f,jo=se[$r.id];if(Object.keys(jo).forEach(function(As){var Is=pt[As].node,wu=Is.clusterId;if(wu!==$r.clusterId){var js=ct[wu],au=js.nodes;if(!(!au||!au.length)){var gi=0;au.forEach(function(Ei){var _i=pt[Ei.id].idx;gi+=Mt[yn][_i]||0});var Zi=gi-js.sumTot*da,vi=au.concat([$r]),Ki=[];vi.forEach(function(Ei,_i){Ki[_i]=B[Ei.originIndex]});var Mo=dt(vi,B)*f,Aa=Zi-Qi;a&&(Aa=Zi+Mo-(Qi+co)),Aa>zn&&(zn=Aa,ia=js)}}}),zn>0){ia.nodes.push($r);var Lo=$r.clusterId;$r.clusterId=ia.id;var Uu=Fn.nodes.indexOf($r);Fn.nodes.splice(Uu,1);var Ts=0,Wu=0;I.forEach(function(As){var Is=As.source,wu=As.target,js=pt[Is].node.clusterId,au=pt[wu].node.clusterId;(js===ia.id&&au!==ia.id||au===ia.id&&js!==ia.id)&&(Ts=Ts+(As[r]||1)),(js===Lo&&au!==Lo||au===Lo&&js!==Lo)&&(Wu=Wu+(As[r]||1))}),ia.sumTot=Ts,Fn.sumTot=Wu}})}var kn={},En=0;Object.keys(hr).forEach(function($r){var yn=hr[$r];if(!yn.nodes||!yn.nodes.length){delete hr[$r];return}var Fn=String(En+1);Fn!==$r&&(yn.id=Fn,yn.nodes=yn.nodes.map(function(zn){return{id:zn.id,clusterId:Fn}}),hr[Fn]=yn,kn[$r]=Fn,delete hr[$r],En++)}),qe.forEach(function($r){var yn=$r.node,Fn=$r.clusterId;yn&&(yn.clusterId=Fn,yn.clusterId&&kn[yn.clusterId]&&(yn.clusterId=kn[yn.clusterId]))});var Kr=[],ta={};I.forEach(function($r){var yn=$r.source,Fn=$r.target,zn=$r[r]||1,ia=pt[yn].node.clusterId,da=pt[Fn].node.clusterId;if(!(!ia||!da)){var Wa="".concat(ia,"---").concat(da);if(ta[Wa])ta[Wa].weight+=zn,ta[Wa].count++;else{var oi={source:ia,target:da,weight:zn,count:1};ta[Wa]=oi,Kr.push(oi)}}});var $n=[];return Object.keys(hr).forEach(function($r){$n.push(hr[$r])}),{clusters:$n,clusterEdges:Kr}},Q=Ut,ot=function(e,t,r,n,a,o,s,u){return t===void 0&&(t=!1),r===void 0&&(r="weight"),n===void 0&&(n=1e-4),a===void 0&&(a=void 0),o===void 0&&(o=[]),s===void 0&&(s=["id"]),u===void 0&&(u=1),Q(e,t,r,n,!0,a,o,s,u)},R=ot,M=function(e,t){var r;t===void 0&&(t=1);for(var n=(0,h.clone)(e),a=n.nodes,o=a===void 0?[]:a,s=n.edges,u=s===void 0?[]:s,f=function(){var _=Jt({nodes:o,edges:u}),I=Object.keys(_);I.sort(function(et,ut){var ct,pt;return((ct=_[et])===null||ct===void 0?void 0:ct.degree)-((pt=_[ut])===null||pt===void 0?void 0:pt.degree)});var B=I[0];if(!o.length||((r=_[B])===null||r===void 0?void 0:r.degree)>=t)return"break";var j=o.findIndex(function(et){return et.id===B});o.splice(j,1),u=u.filter(function(et){return!(et.source===B||et.target===B)})};;){var c=f();if(c==="break")break}return{nodes:o,edges:u}},O=M,X=function(e,t,r){var n=[];switch(e){case Ht.EuclideanDistance:n=t[r];break;default:n=[];break}return n},mt=function(e,t,r,n,a,o){t===void 0&&(t=3),r===void 0&&(r=void 0),n===void 0&&(n=[]),a===void 0&&(a=["id"]),o===void 0&&(o=Ht.EuclideanDistance);var s=e.nodes,u=s===void 0?[]:s,f=e.edges,c=f===void 0?[]:f,l={clusters:[{id:"0",nodes:u}],clusterEdges:[]};if(o===Ht.EuclideanDistance&&!u.every(function(Fn){return Fn.hasOwnProperty(r)}))return l;var _=[],I=[];if(o===Ht.EuclideanDistance&&(_=at(u,r),I=wt(_,n,a)),!I.length)return l;for(var B=(0,h.uniq)(I.map(function(Fn){return Fn.join("")})),j=Math.min(t,u.length,B.length),et=0;etZt&&!ut.find(function(Li){return(0,h.isEqual)(Li,X(o,I,u[ia].originIndex))})&&(Zt=Qi,se=ia)}},_e=0;_e=0;kn--)pt[Number(u[et].clusterId)][kn].id===u[et].id&&pt[Number(u[et].clusterId)].splice(kn,1);u[et].clusterId=String(Re),pt[Re].push(u[et])}}for(var En=!1,et=0;et=1e3)break}var $r=[],yn={};return c.forEach(function(Fn){var zn,ia,da=Fn.source,Wa=Fn.target,oi=(zn=u.find(function(co){return co.id===da}))===null||zn===void 0?void 0:zn.clusterId,Qi=(ia=u.find(function(co){return co.id===Wa}))===null||ia===void 0?void 0:ia.clusterId,Li="".concat(oi,"---").concat(Qi);if(yn[Li])yn[Li].count++;else{var Ji={source:oi,target:Qi,count:1};yn[Li]=Ji,$r.push(Ji)}}),{clusters:pt,clusterEdges:$r}},Ft=mt,Bt=function(e,t){var r=new hn(t),n=r.norm2(),a=new hn(e),o=a.norm2(),s=r.dot(a),u=n*o,f=u?s/u:0;return f},ee=Bt,Le=function(e,t,r,n,a){e===void 0&&(e=[]),r===void 0&&(r=void 0),n===void 0&&(n=[]),a===void 0&&(a=[]);var o=(0,h.clone)(e.filter(function(_){return _.id!==t.id})),s=e.findIndex(function(_){return _.id===t.id}),u=at(e,r),f=wt(u,n,a),c=f[s],l=[];return o.forEach(function(_,I){if(_.id!==t.id){var B=f[I],j=ee(B,c);l.push(j),_.cosineSimilarity=j}}),o.sort(function(_,I){return I.cosineSimilarity-_.cosineSimilarity}),{allCosineSimilarity:l,similarNodes:o}},me=Le,Xe=function(){function i(e){this.count=e.length,this.parent={};for(var t=0,r=e;t0&&(this.list[0]=t,this.moveDown(0)),e},i.prototype.insert=function(e){if(e!==null){this.list.push(e);var t=this.list.length-1;return this.moveUp(t),!0}return!1},i.prototype.moveUp=function(e){for(var t=this.getParent(e);e&&e>0&&this.compareFn(this.list[t],this.list[e])>0;){var r=this.list[t];this.list[t]=this.list[e],this.list[e]=r,e=t,t=this.getParent(e)}},i.prototype.moveDown=function(e){var t,r=e,n=this.getLeft(e),a=this.getRight(e),o=this.list.length;n!==null&&n0?r=n:a!==null&&a0&&(r=a),e!==r&&(t=[this.list[r],this.list[e]],this.list[e]=t[0],this.list[r]=t[1],this.moveDown(r))},i}(),un=Pr,Ke=function(e,t){var r=[],n=e.nodes,a=n===void 0?[]:n,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return r;var u=a[0],f=new Set;f.add(u);var c=function(et,ut){return t?et.weight-ut.weight:0},l=new un(c);for(ue(u.id,s).forEach(function(j){l.insert(j)});!l.isEmpty();){var _=l.delMin(),I=_.source,B=_.target;f.has(I)&&f.has(B)||(r.push(_),f.has(I)||(f.add(I),ue(I,s).forEach(function(j){l.insert(j)})),f.has(B)||(f.add(B),ue(B,s).forEach(function(j){l.insert(j)})))}return r},lr=function(e,t){var r=[],n=e.nodes,a=n===void 0?[]:n,o=e.edges,s=o===void 0?[]:o;if(a.length===0)return r;var u=s.map(function(I){return I});t&&u.sort(function(I,B){return I.weight-B.weight});for(var f=new pr(a.map(function(I){return I.id}));u.length>0;){var c=u.shift(),l=c.source,_=c.target;f.connected(l,_)||(r.push(c),f.union(l,_))}return r},Rr=function(e,t,r){var n={prim:Ke,kruskal:lr};return r?n[r](e,t):lr(e,t)},Dr=Rr,ce=function(e,t,r){typeof t!="number"&&(t=1e-6),typeof r!="number"&&(r=.85);for(var n=1,a=0,o=1e3,s=e.nodes,u=s===void 0?[]:s,f=e.edges,c=f===void 0?[]:f,l=u.length,_,I={},B={},j=0;j0&&n>t;){a=0;for(var j=0;j0&&(_+=B[Zt]/se)}I[ut]=r*_,a+=I[ut]}}a=(1-a)/l,n=0;for(var j=0;j=0;r--){var n=this.dfsEdgeList[r],a=n.fromNode,o=n.toNode;aI||n.hasNode(o[_.to])||(t.label<_.label||t.label===_.label&&s<=I)&&a.push(_)}return a},i.prototype.getSupport=function(e){var t={};return e.forEach(function(r){t[r.graphId]||(t[r.graphId]=!0)}),Object.keys(t).length},i.prototype.findMinLabel=function(e){var t=void 0;return Object.keys(e).forEach(function(r){var n=e[r],a=n.nodeLabel1,o=n.edgeLabel,s=n.nodeLabel2;if(!t){t={nodeLabel1:a,edgeLabel:o,nodeLabel2:s};return}(apt;Zt--){var se=Mt(Zt);if(se==="break")break}if(ut){var oe=e.findMinLabel(et);o.dfsEdgeList.push(new qn(j,ct,Fe,oe.edgeLabel,Fe));var _e=o.dfsEdgeList.length-1;return e.dfsCode.dfsEdgeList[_e]!==o.dfsEdgeList[_e]?!1:l(et[oe.edgeLabel].projected)}var Ue={};ut=!1;var Re=0;_.forEach(function(Kr){var ta=new Vn(Kr),$n=e.findForwardPureEdges(n,ta.edges[I[0]],B,ta);$n.length>0&&(ut=!0,Re=j,$n.forEach(function($r){var yn="".concat($r.label,"-").concat(a[$r.to].label);Ue[yn]||(Ue[yn]={projected:[],edgeLabel:$r.label,nodeLabel2:a[$r.to].label}),Ue[yn].projected.push({graphId:n.id,edge:$r,preNode:Kr})}))});for(var qe=I.length,hr=function(ta){if(ut)return"break";var $n=I[ta];_.forEach(function($r){var yn=new Vn($r),Fn=e.findForwardRmpathEdges(n,yn.edges[$n],B,yn);Fn.length>0&&(ut=!0,Re=o.dfsEdgeList[$n].fromNode,Fn.forEach(function(zn){var ia="".concat(zn.label,"-").concat(a[zn.to].label);Ue[ia]||(Ue[ia]={projected:[],edgeLabel:zn.label,nodeLabel2:a[zn.to].label}),Ue[ia].projected.push({graphId:n.id,edge:zn,preNode:$r})}))})},Zt=0;Zt=0;B--){var j=t.findBackwardEdge(l,I.edges[a[B]],I.edges[a[0]],I);if(j){var et="".concat(t.dfsCode.dfsEdgeList[a[B]].fromNode,"-").concat(j.label);f[et]||(f[et]={projected:[],toNodeId:t.dfsCode.dfsEdgeList[a[B]].fromNode,edgeLabel:j.label}),f[et].projected.push({graphId:c.graphId,edge:j,preNode:c})}}if(!(n>=t.maxNodeNum)){var ut=t.findForwardPureEdges(l,I.edges[a[0]],s,I);ut.forEach(function(pt){var Mt="".concat(o,"-").concat(pt.label,"-").concat(_[pt.to].label);u[Mt]||(u[Mt]={projected:[],fromNodeId:o,edgeLabel:pt.label,nodeLabel2:_[pt.to].label}),u[Mt].projected.push({graphId:c.graphId,edge:pt,preNode:c})});for(var ct=function(Mt){var Zt=t.findForwardRmpathEdges(l,I.edges[a[Mt]],s,I);Zt.forEach(function(se){var oe="".concat(t.dfsCode.dfsEdgeList[a[Mt]].fromNode,"-").concat(se.label,"-").concat(_[se.to].label);u[oe]||(u[oe]={projected:[],fromNodeId:t.dfsCode.dfsEdgeList[a[Mt]].fromNode,edgeLabel:se.label,nodeLabel2:_[se.to].label}),u[oe].projected.push({graphId:c.graphId,edge:se,preNode:c})})},B=0;Bpt){var Mt=pt;pt=ct,ct=Mt}var Zt=ut.label,se="".concat(f,"-").concat(ct,"-").concat(Zt,"-").concat(pt),oe="".concat(ct,"-").concat(Zt,"-").concat(pt);if(!o[oe]){var _e=o[oe]||0;_e++,o[oe]=_e}u[se]={graphId:f,nodeLabel1:ct,edgeLabel:Zt,nodeLabel2:pt}})})}),Object.keys(a).forEach(function(f){var c=a[f];if(!(c2*t)););if(et<2*t&&(s["".concat(c,"-").concat(j)]={start:c,end:j,distance:a[c][j]},l++,u++,u>=r))return s;if(_++,_>2*t)break}if(l_&&(u=_);var I=r[l.id].inDegree;f>I&&(f=I);var B=r[l.id].outDegree;c>B&&(c=B)}),e[t]={degree:u,inDegree:f,outDegree:c}),{minPatternNodeLabelDegree:u,minPatternNodeLabelInDegree:f,minPatternNodeLabelOutDegree:c}},ro=function(e,t,r,n,a,o,s){var u;if(r===void 0&&(r=!1),o===void 0&&(o="cluster"),s===void 0&&(s="cluster"),!(!e||!e.nodes)){var f=e.nodes.length;if(f){var c=xn(e,r),l=xn(t,r),_=Ri(e.nodes,c,r),I=Ri(t.nodes,l,r),B=To(e.nodes,o),j=B.nodeMap,et=B.nodeLabelMap,ut=To(t.nodes,o),ct=ut.nodeMap,pt=ut.nodeLabelMap;ni(e.edges,s,j);var Mt=ni(t.edges,s,ct).edgeLabelMap,Zt=[];l==null||l.forEach(function(gi){Zt=Zt.concat(gi)}),a||(a=Math.max.apply(Math,(0,b.__spreadArray)((0,b.__spreadArray)([],Zt,!1),[2],!1))),n||(n=a);var se=wi(e,c,o,n),oe=wi(t,l,o,n),_e=Math.min(100,f*(f-1)/2),Ue=Co(n,f,_e,se,c),Re=eo(Ue,se,e),qe=10,hr=1,nn=1,kn=4,En={graphs:Re,nodeLabelProp:o,edgeLabelProp:s,minSupport:hr,minNodeNum:nn,maxNodeNum:kn,directed:r},Kr=ei(En).slice(0,qe),ta=Kr.length,$n=[];Kr.forEach(function(gi,Zi){$n[Zi]={},Object.keys(Re).forEach(function(vi){var Ki=Re[vi],Mo=ga(Ki,gi,o,s);$n[Zi][vi]=Mo})});var $r=lo($n,ta,Kr),yn=$r.structure,Fn=$r.structureCountMap,zn=t.nodes[0],ia=[],da=(u=t.nodes[0])===null||u===void 0?void 0:u[o],Wa=-1/0;t.nodes.forEach(function(gi){var Zi=gi[o],vi=et[Zi];(vi==null?void 0:vi.length)>Wa&&(Wa=vi.length,ia=vi,da=Zi,zn=gi)});var oi={},Qi={},Li={},Ji={},co={},jo={};Object.keys(pt).forEach(function(gi,Zi){co[gi]=[],r&&(jo[gi]=[]);var vi=-1/0,Ki=pt[gi],Mo={};Ki.forEach(function(Ti){var zi=I["".concat(zn.id,"-").concat(Ti.id)];if(zi&&co[gi].push(zi),vico[gi][iu]){fd=!0;break}if(fd)return ia.splice(zi,1),"continue";var Yu={};Su.neighbors.forEach(function(ou){var cf=_["".concat(ts.id,"-").concat(ou.id)];Yu["".concat(ts.id,"-").concat(ou.id)]={start:j[ts.id].idx,end:j[ou.id].idx,distance:cf}}),Re=eo(Yu,se,e,Re);var Lf=[];Object.keys(Yu).forEach(function(ou){if(Fn[ou]){Lf.push(Fn[ou]);return}var cf=Re[ou];Fn[ou]=ga(cf,yn,o,s),Lf.push(Fn[ou])}),Lf=Lf.sort(function(ou,cf){return cf-ou});for(var $c=!1,iu=0;iu=0;_o--)_i(_o)});var Lo=[];ia==null||ia.forEach(function(gi){for(var Zi=j[gi.id].idx,vi=Gi(e.nodes,c[Zi],Zi,o,a),Ki=vi.neighbors,Mo=Ki.length,Aa=!1,Ei=Mo-1;Ei>=0;Ei--){if(Ki.length+1Su){Ki.splice(Ei,1);continue}if(r){var bs="".concat(_i.id,"-").concat(gi.id),Rl=_[bs];ts=jo[_o].length-1;var fd=jo[_o][ts];if(Rl>fd){Ki.splice(Ei,1);continue}}var iu=Fn[Ti]?Fn[Ti]:ho(e,gi,_i,j,zi,se,yn,o,s,Fn,Re),Yu="".concat(zn.id,"-").concat(_o),Lf=Ji[Yu][Ji[Yu].length-1];if(iu=0;zi--){var fd=Rl(zi);if(fd==="break")break}if(bs)return Lo.splice(Zi,1),"continue";vi.edges=Ei;var iu=xr(vi,vi.nodes[0].id,!1).length;if(Object.keys(iu).reverse().forEach(function(Qo){if(!(Qo===vi.nodes[0].id||bs)){if(iu[Qo]===1/0){var Mu=Aa[Qo].node[o];if(Mo[Mu]--,Mo[Mu]Ts[Pf][Ts[Pf].length-1]){var Mu=Aa[Qo].node[o];if(Mo[Mu]--,Mo[Mu]=0;cf--){var lc=vi.nodes[cf],I0=Aa[lc.id].degree,_S=Aa[lc.id].inDegree,CS=Aa[lc.id].outDegree,TS=lc[o],Iv=Po(oi,TS,ct,pt),O0=Iv.minPatternNodeLabelDegree,AS=Iv.minPatternNodeLabelInDegree,IS=Iv.minPatternNodeLabelOutDegree,OS=r?I0=0;_h--){var dc=Ei[_h];if(!Aa[dc.source]||!Aa[dc.target]){Ei.splice(_h,1);var Ch=dc[s];if(_i[Ch]--,Aa[dc.source]&&(Aa[dc.source].degree--,Aa[dc.source].outDegree--),Aa[dc.target]&&(Aa[dc.target].degree--,Aa[dc.target].inDegree--),Mt[Ch]&&_i[Ch]=0;Is--){var wu=As(Is);if(wu==="break")break}for(var js=Lo.length,au=function(Zi){var vi=Lo[Zi],Ki={};vi.edges.forEach(function(Ei){var _i="".concat(Ei.source,"-").concat(Ei.target,"-").concat(Ei.label);Ki[_i]?Ki[_i]++:Ki[_i]=1});for(var Mo=function(_i){var _o=Lo[_i],Ti={};_o.edges.forEach(function(ts){var Su="".concat(ts.source,"-").concat(ts.target,"-").concat(ts.label);Ti[Su]?Ti[Su]++:Ti[Su]=1});var zi=!0;Object.keys(Ti).length!==Object.keys(Ki).length?zi=!1:Object.keys(Ki).forEach(function(ts){Ti[ts]!==Ki[ts]&&(zi=!1)}),zi&&Lo.splice(_i,1)},Aa=js-1;Aa>Zi;Aa--)Mo(Aa);js=Lo.length},Is=0;Is<=js-1;Is++)au(Is);return Lo}}},no=ro,es=function(){function i(e){e===void 0&&(e=10),this.linkedList=new It,this.maxStep=e}return Object.defineProperty(i.prototype,"length",{get:function(){return this.linkedList.toArray().length},enumerable:!1,configurable:!0}),i.prototype.isEmpty=function(){return!this.linkedList.head},i.prototype.isMaxStack=function(){return this.toArray().length>=this.maxStep},i.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},i.prototype.push=function(e){this.linkedList.prepend(e),this.length>this.maxStep&&this.linkedList.deleteTail()},i.prototype.pop=function(){var e=this.linkedList.deleteHead();return e?e.value:null},i.prototype.toArray=function(){return this.linkedList.toArray().map(function(e){return e.value})},i.prototype.clear=function(){for(;!this.isEmpty();)this.pop()},i}(),vo=es,Si=Dn,ao={getAdjMatrix:yt,breadthFirstSearch:ve,connectedComponent:Ce,getDegree:Jt,getInDegree:we,getOutDegree:Tt,detectCycle:Dn,detectDirectedCycle:Si,detectAllCycles:an,detectAllDirectedCycle:cn,detectAllUndirectedCycle:Br,depthFirstSearch:Ar,dijkstra:xr,findAllPath:qr,findShortestPath:Tr,floydWarshall:xn,labelPropagation:Mr,louvain:Q,iLouvain:R,kCore:O,kMeans:Ft,cosineSimilarity:ee,nodesCosineSimilarity:me,minimumSpanningTree:Dr,pageRank:jt,getNeighbors:Dt,Stack:vo,GADDI:no},Jo=C(277160),Yt=C(631437),de=Xt,Ge=function(e){return function(t,r){return t[e]-r[e]}},sr=function(e,t,r){return e>=t&&e<=r},Lr=function(e,t,r,n){var a=1e-4,o={x:r.x-e.x,y:r.y-e.y},s={x:t.x-e.x,y:t.y-e.y},u={x:n.x-r.x,y:n.y-r.y},f=s.x*u.y-s.y*u.x,c=f*f,l=1/f,_=s.x*s.x+s.y*s.y,I=u.x*u.x+u.y*u.y;if(c>a*_*I){var B=(o.x*u.y-o.y*u.x)*l,j=(o.x*s.y-o.y*s.x)*l;return!sr(B,0,1)||!sr(j,0,1)?null:{x:e.x+B*s.x,y:e.y+B*s.y}}return null},Nr=function(e,t){var r=e.x,n=e.y,a=e.width,o=e.height,s=r+a/2,u=n+o/2,f=[],c={x:s,y:u};f.push({x:r,y:n}),f.push({x:r+a,y:n}),f.push({x:r+a,y:n+o}),f.push({x:r,y:n+o}),f.push({x:r,y:n});for(var l=null,_=1;_t[n][o]+t[o][a]&&(t[n][a]=t[n][o]+t[o][a]);return t},di=function(e,t){var r=e.nodes,n=e.edges,a=[],o={};if(!r)throw new Error("invalid nodes data!");return r&&r.forEach(function(s,u){o[s.id]=u;var f=[];a.push(f)}),n&&n.forEach(function(s){var u=s.source,f=s.target,c=o[u],l=o[f];a[c][l]=1,t||(a[l][c]=1)}),a},Ma=function(e,t){e.translate(t.x,t.y)},oa=function(e,t,r,n){n===void 0&&(n={duration:500});var a=e.getMatrix();a||(a=[1,0,0,0,1,0,0,0,1]);var o=e.getCanvasBBox(),s=t.x-o.minX,u=t.y-o.minY;if(r){var f=s*a[0],c=u*a[4],l=0,_=0,I=0,B=0;e.animate(function(et){return I=f*et,B=c*et,a=de(a,[["t",I-l,B-_]]),l=I,_=B,{matrix:a}},n)}else{var j=de(a,[["t",s,u]]);e.setMatrix(j)}},si=function(e,t){var r=e.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]);var n=t;(0,h.isArray)(t)||(n=[t,t]),(0,h.isArray)(t)&&t.length===1&&(n=[t[0],t[0]]),r=de(r,[["s",n[0],n[1]]]),e.setMatrix(r)},$a=function(e,t){var r=e.getMatrix();r||(r=[1,0,0,0,1,0,0,0,1]),r=de(r,[["r",t]]),e.setMatrix(r)},Fa=function(e,t,r){for(var n=[],a=0;a0!=s(c[1]-r)>0&&s(t-(r-f[1])*(f[0]-c[0])/(f[1]-c[1])-f[0])<0&&(n=!n)}return n},La=function(e,t){return!(t.minX>e.maxX||t.maxXe.maxY||t.maxY1){var ct=_[0],pt=_[B-1];I.push({from:{x:pt[0],y:pt[1]},to:{x:ct[0],y:ct[1]}})}return I};if(e.length<2||t.length<2)return!1;var a=r(e),o=r(t);if(!La(a,o))return!1;var s=!1;if((0,h.each)(t,function(l){if(fi(e,l[0],l[1]))return s=!0,!1}),s||((0,h.each)(e,function(l){if(fi(t,l[0],l[1]))return s=!0,!1}),s))return!0;var u=n(e),f=n(t),c=!1;return(0,h.each)(f,function(l){if(ja(u,l))return c=!0,!1}),c},yi=function(){function i(e,t,r,n){this.x1=e,this.y1=t,this.x2=r,this.y2=n}return i.prototype.getBBox=function(){var e=Math.min(this.x1,this.x2),t=Math.min(this.y1,this.y2),r=Math.max(this.x1,this.x2),n=Math.max(this.y1,this.y2),a={x:e,y:t,minX:e,minY:t,maxX:r,maxY:n,width:r-e,height:n-t};return a},i}(),mi=function(e,t){var r={top:[e.minX,e.minY,e.maxX,e.minY],left:[e.minX,e.minY,e.minX,e.maxY],bottom:[e.minX,e.maxY,e.maxX,e.maxY],right:[e.maxX,e.minY,e.maxX,e.maxY]};return r[t]},ki=function(e,t){var r=(t.x2-t.x1)*(e.y1-t.y1)-(t.y2-t.y1)*(e.x1-t.x1),n=(e.x2-e.x1)*(e.y1-t.y1)-(e.y2-e.y1)*(e.x1-t.x1),a=(t.y2-t.y1)*(e.x2-e.x1)-(t.x2-t.x1)*(e.y2-e.y1);if(a){var o=r/a,s=n/a;if(o>=0&&o<=1&&s>=0&&s<=1)return o}return Number.POSITIVE_INFINITY},po=function(e,t){for(var r=["top","left","bottom","right"],n=e.getBBox(),a=0,o=[],s=0;s<4;s++){var u=mi(n,r[s]),f=u[0],c=u[1],l=u[2],_=u[3];o[s]=Lr({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},{x:f,y:c},{x:l,y:_}),o[s]&&(a+=1)}return[o,a]},Wi=function(e,t){for(var r=["top","left","bottom","right"],n=e.getBBox(),a=Number.POSITIVE_INFINITY,o=0,s=0;s<4;s++){var u=mi(n,r[s]),f=u[0],c=u[1],l=u[2],_=u[3],I=ki(t,new yi(f,c,l,_));I=Math.abs(I-.5),I>=0&&I<=1&&(o+=1,a=I0){for(var n=0,a=e;nt.x+t.width,a=e.y>t.y+t.height,o=e.y":.604998779296875,"/":.5,"?":.53699951171875},dr=Math.PI,Zr=Math.sin,Ln=Math.cos,Qn=Zr(dr/8),Sa=Ln(dr/8),Ci=function(e,t){var r=e.getBBox(),n={x:r.minX,y:r.minY},a={x:r.maxX,y:r.maxY};if(t){var o=t.getMatrix();o||(o=[1,0,0,0,1,0,0,0,1]),n=fn(n,o),a=fn(a,o)}var s=n.x,u=n.y,f=a.x,c=a.y;return{x:s,y:u,minX:s,minY:u,maxX:f,maxY:c,width:f-s,height:c-u}},Io=function(e){var t=e.sourceNode||e.targetNode,r=t.get("group"),n=r.getMatrix();n||(n=[1,0,0,0,1,0,0,0,1]);var a=t.getKeyShape(),o=a.getBBox(),s=e.loopCfg||{},u=s.dist||Math.max(o.width,o.height)*2,f=s.position||ye.defaultLoopPosition,c=[(o.minX+o.maxX)/2+n[6],(o.minY+o.maxY)/2+n[7]],l=[e.startPoint.x,e.startPoint.y],_=[e.endPoint.x,e.endPoint.y],I=o.height/2,B=o.width/2,j=I,et=I,ut=j*Qn,ct=j*Sa,pt=et*Qn,Mt=et*Sa,Zt=a.get("type"),se=Math.min(I/2,B/2),oe=Math.min(I,B),_e=s!=null&&s.pointPadding?Math.min(oe,s==null?void 0:s.pointPadding):se;if(l[0]===_[0]&&l[1]===_[1]){switch(f){case"top":Zt==="circle"?(l=[c[0]-ut,c[1]-ct],_=[c[0]+pt,c[1]-Mt]):(l=[c[0]-_e,c[1]-I],_=[c[0]+_e,c[1]-I]);break;case"top-right":j=I,et=B,Zt==="circle"?(ut=j*Qn,ct=j*Sa,pt=et*Qn,Mt=et*Sa,l=[c[0]+ut,c[1]-ct],_=[c[0]+Mt,c[1]-pt]):(l=[c[0]+B-_e,c[1]-I],_=[c[0]+B,c[1]-I+_e]);break;case"right":j=B,et=B,Zt==="circle"?(ut=j*Qn,ct=j*Sa,pt=et*Qn,Mt=et*Sa,l=[c[0]+ct,c[1]-ut],_=[c[0]+Mt,c[1]+pt]):(l=[c[0]+B,c[1]-_e],_=[c[0]+B,c[1]+_e]);break;case"bottom-right":j=B,et=I,Zt==="circle"?(ut=j*Qn,ct=j*Sa,pt=et*Qn,Mt=et*Sa,l=[c[0]+ct,c[1]+ut],_=[c[0]+pt,c[1]+Mt]):(l=[c[0]+B,c[1]+I-_e],_=[c[0]+B-_e,c[1]+I]);break;case"bottom":j=I,et=I,Zt==="circle"?(ut=j*Qn,ct=j*Sa,pt=et*Qn,Mt=et*Sa,l=[c[0]+ut,c[1]+ct],_=[c[0]-pt,c[1]+Mt]):(l=[c[0]-_e,c[1]+I],_=[c[0]+_e,c[1]+I]);break;case"bottom-left":j=I,et=B,Zt==="circle"?(ut=j*Qn,ct=j*Sa,pt=et*Qn,Mt=et*Sa,l=[c[0]-ut,c[1]+ct],_=[c[0]-Mt,c[1]+pt]):(l=[c[0]-B,c[1]+I-_e],_=[c[0]-B+_e,c[1]+I]);break;case"left":j=B,et=B,Zt==="circle"?(ut=j*Qn,ct=j*Sa,pt=et*Qn,Mt=et*Sa,l=[c[0]-ct,c[1]+ut],_=[c[0]-Mt,c[1]-pt]):(l=[c[0]-B,c[1]-_e],_=[c[0]-B,c[1]+_e]);break;case"top-left":j=B,et=I,Zt==="circle"?(ut=j*Qn,ct=j*Sa,pt=et*Qn,Mt=et*Sa,l=[c[0]-ct,c[1]-ut],_=[c[0]-pt,c[1]-Mt]):(l=[c[0]-B+_e,c[1]-I],_=[c[0]-B,c[1]-I+_e]);break;default:j=B,et=B,ut=j*Qn,ct=j*Sa,pt=et*Qn,Mt=et*Sa,l=[c[0]-ut,c[1]-ct],_=[c[0]+pt,c[1]-Mt]}if(s.clockwise===!1){var Ue=[l[0],l[1]];l=[_[0],_[1]],_=[Ue[0],Ue[1]]}}var Re=[l[0]-c[0],l[1]-c[1]],qe=(j+u)/j,hr=(et+u)/et;s.clockwise===!1&&(qe=(et+u)/et,hr=(j+u)/j);var nn=Yt.scale([0,0],Re,qe),kn=[c[0]+nn[0],c[1]+nn[1]],En=[_[0]-c[0],_[1]-c[1]],Kr=Yt.scale([0,0],En,hr),ta=[c[0]+Kr[0],c[1]+Kr[1]];return e.startPoint={x:l[0],y:l[1]},e.endPoint={x:_[0],y:_[1]},e.controlPoints=[{x:kn[0],y:kn[1]},{x:ta[0],y:ta[1]}],e},Go=function(e,t,r,n,a){var o=1e-4,s=[],u=e==null?void 0:e.getPoint(t);if(!u)return{x:0,y:0,angle:0};if(t1-o)s=e.getEndTangent();else{var f=e==null?void 0:e.getPoint(t+o);s.push([u.x,u.y]),s.push([f.x,f.y])}var c=Math.atan2(s[1][1]-s[0][1],s[1][0]-s[0][0]);if(c<0&&(c+=dr*2),r&&(u.x+=Ln(c)*r,u.y+=Zr(c)*r),n){var l=c-dr/2;c>1/2*dr&&c<3*1/2*dr&&(l-=dr),u.x+=Ln(l)*n,u.y+=Zr(l)*n}var _={x:u.x,y:u.y,angle:c};return a?(c>.5*dr&&c<1.5*dr&&(c-=dr),(0,b.__assign)({rotate:c},_)):_},zs=function i(e,t,r,n){if(n(e,t,r)===!1)return!1;if(e&&e.children){for(var a=e.children.length-1;a>=0;a--)if(!i(e.children[a],e,a,n))return!1}return!0},Ds=function i(e,t,r,n){if(e&&e.children){for(var a=e.children.length-1;a>=0;a--)if(!i(e.children[a],e,a,n))return}return n(e,t,r)!==!1},ji=function(e,t){typeof t=="function"&&zs(e,null,-1,t)},xo=function(e,t){typeof t=="function"&&Ds(e,null,-1,t)},Gs=function(e,t){return t*(ir[e]||1)},vs=function(e,t){var r=0,n=new RegExp("[\u4E00-\u9FA5]+");return e.split("").forEach(function(a){n.test(a)?r+=t:r+=Gs(a,t)}),[r,t]},qs=function(e,t){return typeof t!="number"||t<=0||t>=e.length?e:e.substring(0,t)+"..."},Qs=function(e,t){var r=[],n={},a={};e.forEach(function(u){a[u.id]=u}),e.forEach(function(u,f){var c=(0,h.clone)(u);c.itemType="combo",c.children=void 0,c.parentId===c.id?(console.warn("The parentId for combo ".concat(c.id," can not be the same as the combo's id")),delete c.parentId):c.parentId&&!a[c.parentId]&&(console.warn("The parent combo for combo ".concat(c.id," does not exist!")),delete c.parentId);var l=n[c.id];if(l){if(c.children=l.children,n[c.id]=c,l=c,!l.parentId){r.push(l);return}var _=n[l.parentId];if(_)_.children?_.children.push(c):_.children=[c];else{var I={id:l.parentId,children:[l]};n[l.parentId]=I,n[c.id]=c}return}if((0,h.isString)(u.parentId)){var B=n[u.parentId];if(B)B.children?B.children.push(c):B.children=[c],n[c.id]=c;else{var j={id:u.parentId,children:[c]};n[j.id]=j,n[c.id]=c}}else r.push(c),n[c.id]=c});var o={};(t||[]).forEach(function(u){o[u.id]=u;var f=n[u.comboId];if(f){var c={id:u.id,comboId:u.comboId};f.children?f.children.push(c):f.children=[c],c.itemType="node",n[u.id]=c}});var s=0;return r.forEach(function(u){u.depth=s+10,ji(u,function(f){var c,l=n[f.id].itemType;l==="node"?c=n[f.comboId]:c=n[f.parentId],c&&l==="node"?f.depth=s+1:f.depth=s+10,s-1&&a.splice(c,1),u||(o={id:t,itemType:"node",comboId:r},s[t]={children:void 0}),t){var l=!1;if(r){var _=0;(e||[]).forEach(function(B){l||ji(B,function(j){return r===j.id?(l=!0,j.children?j.children.push(o):j.children=[o],_=j.depth,o.itemType==="node"?o.depth=_+2:o.depth=_+1,!1):!0})})}else(!r||!l)&&o.itemType!=="node"&&e.push(o);var I=o.depth;ji(o,function(B){return B.itemType==="node"?I+=2:I+=1,B.depth=I,!0})}return e},Vs=function(e,t,r){var n={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,x:void 0,y:void 0,width:void 0,height:void 0,centerX:void 0,centerY:void 0};if(!e||e.length===0){var a=r==null?void 0:r.getModel(),o=a||{},s=o.x,u=o.y,f=o.fixSize,c=o.collapsed,l=o.fixCollapseSize,_=c?l:f,I=(0,h.isArray)(_)?_:[_,_],B=I[0],j=I[1],et=[B/2,j/2];return{minX:s-et[0],minY:u-et[1],maxX:s+et[0],maxY:u+et[1],x:s,y:u,width:B,height:j}}return e.forEach(function(ut){var ct=t.findById(ut.id);if(!(!ct||!ct.isVisible())){ct.set("bboxCanvasCache",void 0);var pt=ct.getCanvasBBox();pt.x&&n.minX>pt.minX&&(n.minX=pt.minX),pt.y&&n.minY>pt.minY&&(n.minY=pt.minY),pt.x&&n.maxX2&&(t.push([n].concat(o.splice(0,2))),s="l",n=n==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([n,o[0]]),s==="r")t.push([n].concat(o));else for(;o.length>=e[s]&&(t.push([n].concat(o.splice(0,e[s]))),!!e[s]););return i}),t},Et=function(i,e){for(var t=[],r=0,n=i.length;n-2*!e>r;r+=2){var a=[{x:+i[r-2],y:+i[r-1]},{x:+i[r],y:+i[r+1]},{x:+i[r+2],y:+i[r+3]},{x:+i[r+4],y:+i[r+5]}];e?r?n-4===r?a[3]={x:+i[0],y:+i[1]}:n-2===r&&(a[2]={x:+i[0],y:+i[1]},a[3]={x:+i[2],y:+i[3]}):a[0]={x:+i[n-2],y:+i[n-1]}:n-4===r?a[3]=a[2]:r||(a[0]={x:+i[r],y:+i[r+1]}),t.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return t},Gt=function(i,e,t,r,n){var a=[];if(n===null&&r===null&&(r=t),i=+i,e=+e,t=+t,r=+r,n!==null){var o=Math.PI/180,s=i+t*Math.cos(-r*o),u=i+t*Math.cos(-n*o),f=e+t*Math.sin(-r*o),c=e+t*Math.sin(-n*o);a=[["M",s,f],["A",t,t,0,+(n-r>180),0,u,c]]}else a=[["M",i,e],["m",0,-r],["a",t,r,0,1,1,0,2*r],["a",t,r,0,1,1,0,-2*r],["z"]];return a},re=function(i){if(i=G(i),!i||!i.length)return[["M",0,0]];var e=[],t=0,r=0,n=0,a=0,o=0,s,u;i[0][0]==="M"&&(t=+i[0][1],r=+i[0][2],n=t,a=r,o++,e[0]=["M",t,r]);for(var f=i.length===3&&i[0][0]==="M"&&i[1][0].toUpperCase()==="R"&&i[2][0].toUpperCase()==="Z",c=void 0,l=void 0,_=o,I=i.length;_1&&(Zt=Math.sqrt(Zt),t=Zt*t,r=Zt*r);var se=t*t,oe=r*r,_e=(a===o?-1:1)*Math.sqrt(Math.abs((se*oe-se*Mt*Mt-oe*pt*pt)/(se*Mt*Mt+oe*pt*pt)));et=_e*t*Mt/r+(i+s)/2,ut=_e*-r*pt/t+(e+u)/2,B=Math.asin(((e-ut)/r).toFixed(9)),j=Math.asin(((u-ut)/r).toFixed(9)),B=ij&&(B=B-Math.PI*2),!o&&j>B&&(j=j-Math.PI*2)}var Ue=j-B;if(Math.abs(Ue)>c){var Re=j,qe=s,hr=u;j=B+c*(o&&j>B?1:-1),s=et+t*Math.cos(j),u=ut+r*Math.sin(j),_=De(s,u,t,r,n,0,o,qe,hr,[j,Re,et,ut])}Ue=j-B;var nn=Math.cos(B),kn=Math.sin(B),En=Math.cos(j),Kr=Math.sin(j),ta=Math.tan(Ue/4),$n=4/3*t*ta,$r=4/3*r*ta,yn=[i,e],Fn=[i+$n*kn,e-$r*nn],zn=[s+$n*Kr,u-$r*En],ia=[s,u];if(Fn[0]=2*yn[0]-Fn[0],Fn[1]=2*yn[1]-Fn[1],f)return[Fn,zn,ia].concat(_);_=[Fn,zn,ia].concat(_).join().split(",");for(var da=[],Wa=0,oi=_.length;Wa7){pt[Mt].shift();for(var Zt=pt[Mt];Zt.length;)o[Mt]="A",r&&(s[Mt]="A"),pt.splice(Mt++,0,["C"].concat(Zt.splice(0,6)));pt.splice(Mt,1),c=Math.max(t.length,r&&r.length||0)}},I=function(pt,Mt,Zt,se,oe){pt&&Mt&&pt[oe][0]==="M"&&Mt[oe][0]!=="M"&&(Mt.splice(oe,0,["M",se.x,se.y]),Zt.bx=0,Zt.by=0,Zt.x=pt[oe][1],Zt.y=pt[oe][2],c=Math.max(t.length,r&&r.length||0))};c=Math.max(t.length,r&&r.length||0);for(var B=0;B1?1:u<0?0:u;for(var f=u/2,c=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],_=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],I=0,B=0;B0&&I<1&&u.push(I);continue}var j=l*l-4*_*c,et=Math.sqrt(j);if(!(j<0)){var ut=(-l+et)/(2*c);ut>0&&ut<1&&u.push(ut);var ct=(-l-et)/(2*c);ct>0&&ct<1&&u.push(ct)}}for(var pt=u.length,Mt=pt,Zt;pt--;)I=u[pt],Zt=1-I,f[0][pt]=Zt*Zt*Zt*i+3*Zt*Zt*I*t+3*Zt*I*I*n+I*I*I*o,f[1][pt]=Zt*Zt*Zt*e+3*Zt*Zt*I*r+3*Zt*I*I*a+I*I*I*s;return f[0][Mt]=i,f[1][Mt]=e,f[0][Mt+1]=o,f[1][Mt+1]=s,f[0].length=f[1].length=Mt+2,{min:{x:Math.min.apply(0,f[0]),y:Math.min.apply(0,f[1])},max:{x:Math.max.apply(0,f[0]),y:Math.max.apply(0,f[1])}}},Tn=function(i,e,t,r,n,a,o,s){if(!(Math.max(i,t)Math.max(n,o)||Math.max(e,r)Math.max(a,s))){var u=(i*r-e*t)*(n-o)-(i-t)*(n*s-a*o),f=(i*r-e*t)*(a-s)-(e-r)*(n*s-a*o),c=(i-t)*(a-s)-(e-r)*(n-o);if(c){var l=u/c,_=f/c,I=+l.toFixed(2),B=+_.toFixed(2);if(!(I<+Math.min(i,t).toFixed(2)||I>+Math.max(i,t).toFixed(2)||I<+Math.min(n,o).toFixed(2)||I>+Math.max(n,o).toFixed(2)||B<+Math.min(e,r).toFixed(2)||B>+Math.max(e,r).toFixed(2)||B<+Math.min(a,s).toFixed(2)||B>+Math.max(a,s).toFixed(2)))return{x:l,y:_}}}},On=function(i,e,t){return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},Qr=function(i,e,t,r,n){if(n)return[["M",+i+ +n,e],["l",t-n*2,0],["a",n,n,0,0,1,n,n],["l",0,r-n*2],["a",n,n,0,0,1,-n,n],["l",n*2-t,0],["a",n,n,0,0,1,-n,-n],["l",0,n*2-r],["a",n,n,0,0,1,n,-n],["z"]];var a=[["M",i,e],["l",t,0],["l",0,r],["l",-t,0],["z"]];return a.parsePathArray=ur,a},ra=function(i,e,t,r){return i===null&&(i=e=t=r=0),e===null&&(e=i.y,t=i.width,r=i.height,i=i.x),{x:i,y:e,width:t,w:t,height:r,h:r,x2:i+t,y2:e+r,cx:i+t/2,cy:e+r/2,r1:Math.min(t,r)/2,r2:Math.max(t,r)/2,r0:Math.sqrt(t*t+r*r)/2,path:Qr(i,e,t,r),vb:[i,e,t,r].join(" ")}},Ha=function(i,e){return i=ra(i),e=ra(e),On(e,i.x,i.y)||On(e,i.x2,i.y)||On(e,i.x,i.y2)||On(e,i.x2,i.y2)||On(i,e.x,e.y)||On(i,e.x2,e.y)||On(i,e.x,e.y2)||On(i,e.x2,e.y2)||(i.xe.x||e.xi.x)&&(i.ye.y||e.yi.y)},Va=function(i,e,t,r,n,a,o,s){(0,h.isArray)(i)||(i=[i,e,t,r,n,a,o,s]);var u=Wr.apply(null,i);return ra(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},Ra=function(i,e,t,r,n,a,o,s,u){var f=1-u,c=Math.pow(f,3),l=Math.pow(f,2),_=u*u,I=_*u,B=c*i+l*3*u*t+f*3*u*u*n+I*o,j=c*e+l*3*u*r+f*3*u*u*a+I*s,et=i+2*u*(t-i)+_*(n-2*t+i),ut=e+2*u*(r-e)+_*(a-2*r+e),ct=t+2*u*(n-t)+_*(o-2*n+t),pt=r+2*u*(a-r)+_*(s-2*a+r),Mt=f*i+u*t,Zt=f*e+u*r,se=f*n+u*o,oe=f*a+u*s,_e=90-Math.atan2(et-ct,ut-pt)*180/Math.PI;return{x:B,y:j,m:{x:et,y:ut},n:{x:ct,y:pt},start:{x:Mt,y:Zt},end:{x:se,y:oe},alpha:_e}},_a=function(i,e,t){var r=Va(i),n=Va(e);if(!Ha(r,n))return t?0:[];for(var a=Xr.apply(0,i),o=Xr.apply(0,e),s=~~(a/8),u=~~(o/8),f=[],c=[],l={},_=t?0:[],I=0;I=0&&oe<=1&&_e>=0&&_e<=1&&(t?_+=1:_.push({x:se.x,y:se.y,t1:oe,t2:_e}))}}return _},Pa=function(i,e,t){i=ze(i),e=ze(e);for(var r,n,a,o,s,u,f,c,l,_,I=t?0:[],B=0,j=i.length;B=3&&(l.length===3&&_.push("Q"),_=_.concat(l[1])),l.length===2&&_.push("L"),_=_.concat(l[l.length-1]),_});return c}var wo=function(i,e,t){if(t===1)return[[].concat(i)];var r=[];if(e[0]==="L"||e[0]==="C"||e[0]==="Q")r=r.concat(go(i,e,t));else{var n=[].concat(i);n[0]==="M"&&(n[0]="L");for(var a=0;a<=t-1;a++)r.push(n)}return r},So=function(i,e){if(i.length===1)return i;var t=i.length-1,r=e.length-1,n=t/r,a=[];if(i.length===1&&i[0][0]==="M"){for(var o=0;o=0;u--)o=a[u].index,a[u].type==="add"?i.splice(o,0,[].concat(i[o])):i.splice(o,1)}r=i.length;var l=n-r;if(r0)t=Hs(t,i[r-1],1);else{i[r]=e[r];break}i[r]=["Q"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;case"T":i[r]=["T"].concat(t[0]);break;case"C":if(t.length<3)if(r>0)t=Hs(t,i[r-1],2);else{i[r]=e[r];break}i[r]=["C"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;case"S":if(t.length<2)if(r>0)t=Hs(t,i[r-1],1);else{i[r]=e[r];break}i[r]=["S"].concat(t.reduce(function(n,a){return n.concat(a)},[]));break;default:i[r]=e[r]}return i},Tu=function(){function i(e,t){this.bubbles=!0,this.target=null,this.currentTarget=null,this.delegateTarget=null,this.delegateObject=null,this.defaultPrevented=!1,this.propagationStopped=!1,this.shape=null,this.fromShape=null,this.toShape=null,this.propagationPath=[],this.type=e,this.name=e,this.originalEvent=t,this.timeStamp=t.timeStamp}return i.prototype.preventDefault=function(){this.defaultPrevented=!0,this.originalEvent.preventDefault&&this.originalEvent.preventDefault()},i.prototype.stopPropagation=function(){this.propagationStopped=!0},i.prototype.toString=function(){var e=this.type;return"[Event (type="+e+")]"},i.prototype.save=function(){},i.prototype.restore=function(){},i}(),Nf=Tu;function hc(i,e){var t=i.indexOf(e);t!==-1&&i.splice(t,1)}var vc=typeof window!="undefined"&&typeof window.document!="undefined";function pc(i,e){if(i.isCanvas())return!0;for(var t=e.getParent(),r=!1;t;){if(t===i){r=!0;break}t=t.getParent()}return r}function Rf(i){return i.cfg.visible&&i.cfg.capture}var kf=function(i){(0,b.__extends)(e,i);function e(t){var r=i.call(this)||this;r.destroyed=!1;var n=r.getDefaultCfg();return r.cfg=(0,h.mix)(n,t),r}return e.prototype.getDefaultCfg=function(){return{}},e.prototype.get=function(t){return this.cfg[t]},e.prototype.set=function(t,r){this.cfg[t]=r},e.prototype.destroy=function(){this.cfg={destroyed:!0},this.off(),this.destroyed=!0},e}(tt),gc=kf,du=C(734155),lf=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,a;ro.delay&&(0,h.each)(e.toAttrs,function(s,u){a.call(o.toAttrs,u)&&(delete o.toAttrs[u],delete o.fromAttrs[u])})}),i}var Ja=function(i){(0,b.__extends)(e,i);function e(t){var r=i.call(this,t)||this;r.attrs={};var n=r.getDefaultAttrs();return(0,h.mix)(n,t.attrs),r.attrs=n,r.initAttrs(n),r.initAnimate(),r}return e.prototype.getDefaultCfg=function(){return{visible:!0,capture:!0,zIndex:0}},e.prototype.getDefaultAttrs=function(){return{matrix:this.getDefaultMatrix(),opacity:1}},e.prototype.onCanvasChange=function(t){},e.prototype.initAttrs=function(t){},e.prototype.initAnimate=function(){this.set("animable",!0),this.set("animating",!1)},e.prototype.isGroup=function(){return!1},e.prototype.getParent=function(){return this.get("parent")},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.attr=function(){for(var t,r=[],n=0;n0?a=Oa(a,Mt):n.addAnimator(this),a.push(Mt),this.set("animations",a),this.set("_pause",{isPaused:!1})}},e.prototype.stopAnimate=function(t){var r=this;t===void 0&&(t=!0);var n=this.get("animations");(0,h.each)(n,function(a){t&&(a.onFrame?r.attr(a.onFrame(1)):r.attr(a.toAttrs)),a.callback&&a.callback()}),this.set("animating",!1),this.set("animations",[])},e.prototype.pauseAnimate=function(){var t=this.get("timeline"),r=this.get("animations"),n=t.getTime();return(0,h.each)(r,function(a){a._paused=!0,a._pauseTime=n,a.pauseCallback&&a.pauseCallback()}),this.set("_pause",{isPaused:!0,pauseTime:n}),this},e.prototype.resumeAnimate=function(){var t=this.get("timeline"),r=t.getTime(),n=this.get("animations"),a=this.get("_pause").pauseTime;return(0,h.each)(n,function(o){o.startTime=o.startTime+(r-a),o._paused=!1,o._pauseTime=null,o.resumeCallback&&o.resumeCallback()}),this.set("_pause",{isPaused:!1}),this.set("animations",n),this},e.prototype.emitDelegation=function(t,r){var n=this,a=r.propagationPath,o=this.getEvents(),s;t==="mouseenter"?s=r.fromShape:t==="mouseleave"&&(s=r.toShape);for(var u=function(_){var I=a[_],B=I.get("name");if(B){if((I.isGroup()||I.isCanvas&&I.isCanvas())&&s&&pc(I,s))return"break";(0,h.isArray)(B)?(0,h.each)(B,function(j){n.emitDelegateEvent(I,j,r)}):f.emitDelegateEvent(I,B,r)}},f=this,c=0;c=0}function ma(i,e,t){t===void 0&&(t=!0),t?e.destroy():(e.set("parent",null),e.set("canvas",null)),hc(i.getChildren(),e)}function ri(i){return function(e,t){var r=i(e,t);return r===0?e[ka]-t[ka]:r}}var xi=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.isCanvas=function(){return!1},e.prototype.getBBox=function(){var t=1/0,r=-1/0,n=1/0,a=-1/0,o=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});o.length>0?(0,h.each)(o,function(u){var f=u.getBBox(),c=f.minX,l=f.maxX,_=f.minY,I=f.maxY;cr&&(r=l),_a&&(a=I)}):(t=0,r=0,n=0,a=0);var s={x:t,y:n,minX:t,minY:n,maxX:r,maxY:a,width:r-t,height:a-n};return s},e.prototype.getCanvasBBox=function(){var t=1/0,r=-1/0,n=1/0,a=-1/0,o=this.getChildren().filter(function(u){return u.get("visible")&&(!u.isGroup()||u.isGroup()&&u.getChildren().length>0)});o.length>0?(0,h.each)(o,function(u){var f=u.getCanvasBBox(),c=f.minX,l=f.maxX,_=f.minY,I=f.maxY;cr&&(r=l),_a&&(a=I)}):(t=0,r=0,n=0,a=0);var s={x:t,y:n,minX:t,minY:n,maxX:r,maxY:a,width:r-t,height:a-n};return s},e.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return t.children=[],t},e.prototype.onAttrChange=function(t,r,n){if(i.prototype.onAttrChange.call(this,t,r,n),t==="matrix"){var a=this.getTotalMatrix();this._applyChildrenMarix(a)}},e.prototype.applyMatrix=function(t){var r=this.getTotalMatrix();i.prototype.applyMatrix.call(this,t);var n=this.getTotalMatrix();n!==r&&this._applyChildrenMarix(n)},e.prototype._applyChildrenMarix=function(t){var r=this.getChildren();(0,h.each)(r,function(n){n.applyMatrix(t)})},e.prototype.addShape=function(){for(var t=[],r=0;r=0;s--){var u=t[s];if(Rf(u)&&(u.isGroup()?o=u.getShape(r,n,a):u.isHit(r,n)&&(o=u)),o)break}return o},e.prototype.add=function(t){var r=this.getCanvas(),n=this.getChildren(),a=this.get("timeline"),o=t.getParent();o&&ma(o,t,!1),t.set("parent",this),r&&ha(t,r),a&&Ya(t,a),n.push(t),t.onCanvasChange("add"),this._applyElementMatrix(t)},e.prototype._applyElementMatrix=function(t){var r=this.getTotalMatrix();r&&t.applyMatrix(r)},e.prototype.getChildren=function(){return this.get("children")},e.prototype.sort=function(){var t=this.getChildren();(0,h.each)(t,function(r,n){return r[ka]=n,r}),t.sort(ri(function(r,n){return r.get("zIndex")-n.get("zIndex")})),this.onCanvasChange("sort")},e.prototype.clear=function(){if(this.set("clearing",!0),!this.destroyed){for(var t=this.getChildren(),r=t.length-1;r>=0;r--)t[r].destroy();this.set("children",[]),this.onCanvasChange("clear"),this.set("clearing",!1)}},e.prototype.destroy=function(){this.get("destroyed")||(this.clear(),i.prototype.destroy.call(this))},e.prototype.getFirst=function(){return this.getChildByIndex(0)},e.prototype.getLast=function(){var t=this.getChildren();return this.getChildByIndex(t.length-1)},e.prototype.getChildByIndex=function(t){var r=this.getChildren();return r[t]},e.prototype.getCount=function(){var t=this.getChildren();return t.length},e.prototype.contain=function(t){var r=this.getChildren();return r.indexOf(t)>-1},e.prototype.removeChild=function(t,r){r===void 0&&(r=!0),this.contain(t)&&t.remove(r)},e.prototype.findAll=function(t){var r=[],n=this.getChildren();return(0,h.each)(n,function(a){t(a)&&r.push(a),a.isGroup()&&(r=r.concat(a.findAll(t)))}),r},e.prototype.find=function(t){var r=null,n=this.getChildren();return(0,h.each)(n,function(a){if(t(a)?r=a:a.isGroup()&&(r=a.find(t)),r)return!1}),r},e.prototype.findById=function(t){return this.find(function(r){return r.get("id")===t})},e.prototype.findByClassName=function(t){return this.find(function(r){return r.get("className")===t})},e.prototype.findAllByName=function(t){return this.findAll(function(r){return r.get("name")===t})},e}(Na),Vi=xi,Ai=C(235374),hi=C(952677);function to(i,e,t){i.prototype=e.prototype=t,t.constructor=i}function ko(i,e){var t=Object.create(i.prototype);for(var r in e)t[r]=e[r];return t}function so(){}var ks=.7,Ou=1/ks,Ls="\\s*([+-]?\\d+)\\s*",uu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ss="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",tu=/^#([0-9a-f]{3,8})$/,Ff=new RegExp("^rgb\\(".concat(Ls,",").concat(Ls,",").concat(Ls,"\\)$")),Qc=new RegExp("^rgb\\(".concat(Ss,",").concat(Ss,",").concat(Ss,"\\)$")),ju=new RegExp("^rgba\\(".concat(Ls,",").concat(Ls,",").concat(Ls,",").concat(uu,"\\)$")),vf=new RegExp("^rgba\\(".concat(Ss,",").concat(Ss,",").concat(Ss,",").concat(uu,"\\)$")),Ec=new RegExp("^hsl\\(".concat(uu,",").concat(Ss,",").concat(Ss,"\\)$")),Vu=new RegExp("^hsla\\(".concat(uu,",").concat(Ss,",").concat(Ss,",").concat(uu,"\\)$")),vu={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};to(so,ru,{copy:function(e){return Object.assign(new this.constructor,this,e)},displayable:function(){return this.rgb().displayable()},hex:zf,formatHex:zf,formatHex8:Gf,formatHsl:wc,formatRgb:eu,toString:eu});function zf(){return this.rgb().formatHex()}function Gf(){return this.rgb().formatHex8()}function wc(){return _c(this).formatHsl()}function eu(){return this.rgb().formatRgb()}function ru(i){var e,t;return i=(i+"").trim().toLowerCase(),(e=tu.exec(i))?(t=e[1].length,e=parseInt(e[1],16),t===6?Sc(e):t===3?new us(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Hu(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Hu(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ff.exec(i))?new us(e[1],e[2],e[3],1):(e=Qc.exec(i))?new us(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=ju.exec(i))?Hu(e[1],e[2],e[3],e[4]):(e=vf.exec(i))?Hu(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Ec.exec(i))?Mc(e[1],e[2]/100,e[3]/100,1):(e=Vu.exec(i))?Mc(e[1],e[2]/100,e[3]/100,e[4]):vu.hasOwnProperty(i)?Sc(vu[i]):i==="transparent"?new us(NaN,NaN,NaN,0):null}function Sc(i){return new us(i>>16&255,i>>8&255,i&255,1)}function Hu(i,e,t,r){return r<=0&&(i=e=t=NaN),new us(i,e,t,r)}function cd(i){return i instanceof so||(i=ru(i)),i?(i=i.rgb(),new us(i.r,i.g,i.b,i.opacity)):new us}function pu(i,e,t,r){return arguments.length===1?cd(i):new us(i,e,t,r==null?1:r)}function us(i,e,t,r){this.r=+i,this.g=+e,this.b=+t,this.opacity=+r}to(us,pu,ko(so,{brighter:function(e){return e=e==null?Ou:Math.pow(Ou,e),new us(this.r*e,this.g*e,this.b*e,this.opacity)},darker:function(e){return e=e==null?ks:Math.pow(ks,e),new us(this.r*e,this.g*e,this.b*e,this.opacity)},rgb:function(){return this},clamp:function(){return new us(mu(this.r),mu(this.g),mu(this.b),gu(this.opacity))},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Jc,formatHex:Jc,formatHex8:pf,formatRgb:tl,toString:tl}));function Jc(){return"#".concat(yu(this.r)).concat(yu(this.g)).concat(yu(this.b))}function pf(){return"#".concat(yu(this.r)).concat(yu(this.g)).concat(yu(this.b)).concat(yu((isNaN(this.opacity)?1:this.opacity)*255))}function tl(){var i=gu(this.opacity);return"".concat(i===1?"rgb(":"rgba(").concat(mu(this.r),", ").concat(mu(this.g),", ").concat(mu(this.b)).concat(i===1?")":", ".concat(i,")"))}function gu(i){return isNaN(i)?1:Math.max(0,Math.min(1,i))}function mu(i){return Math.max(0,Math.min(255,Math.round(i)||0))}function yu(i){return i=mu(i),(i<16?"0":"")+i.toString(16)}function Mc(i,e,t,r){return r<=0?i=e=t=NaN:t<=0||t>=1?i=e=NaN:e<=0&&(i=NaN),new Bs(i,e,t,r)}function _c(i){if(i instanceof Bs)return new Bs(i.h,i.s,i.l,i.opacity);if(i instanceof so||(i=ru(i)),!i)return new Bs;if(i instanceof Bs)return i;i=i.rgb();var e=i.r/255,t=i.g/255,r=i.b/255,n=Math.min(e,t,r),a=Math.max(e,t,r),o=NaN,s=a-n,u=(a+n)/2;return s?(e===a?o=(t-r)/s+(t0&&u<1?0:o,new Bs(o,s,u,i.opacity)}function el(i,e,t,r){return arguments.length===1?_c(i):new Bs(i,e,t,r==null?1:r)}function Bs(i,e,t,r){this.h=+i,this.s=+e,this.l=+t,this.opacity=+r}to(Bs,el,ko(so,{brighter:function(e){return e=e==null?Ou:Math.pow(Ou,e),new Bs(this.h,this.s,this.l*e,this.opacity)},darker:function(e){return e=e==null?ks:Math.pow(ks,e),new Bs(this.h,this.s,this.l*e,this.opacity)},rgb:function(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new us(Cc(e>=240?e-240:e+120,a,n),Cc(e,a,n),Cc(e<120?e+240:e-120,a,n),this.opacity)},clamp:function(){return new Bs(rl(this.h),Uf(this.s),Uf(this.l),gu(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var e=gu(this.opacity);return"".concat(e===1?"hsl(":"hsla(").concat(rl(this.h),", ").concat(Uf(this.s)*100,"%, ").concat(Uf(this.l)*100,"%").concat(e===1?")":", ".concat(e,")"))}}));function rl(i){return i=(i||0)%360,i<0?i+360:i}function Uf(i){return Math.max(0,Math.min(1,i||0))}function Cc(i,e,t){return(i<60?e+(t-e)*i/60:i<180?t:i<240?e+(t-e)*(240-i)/60:e)*255}function nl(i,e,t,r,n){var a=i*i,o=a*i;return((1-3*i+3*a-o)*e+(4-6*a+3*o)*t+(1+3*i+3*a-3*o)*r+o*n)/6}function Bl(i){var e=i.length-1;return function(t){var r=t<=0?t=0:t>=1?(t=1,e-1):Math.floor(t*e),n=i[r],a=i[r+1],o=r>0?i[r-1]:2*n-a,s=r180||t<-180?t-360*Math.round(t/360):t):constant(isNaN(i)?e:i)}function Yf(i){return(i=+i)==1?Tc:function(e,t){return t-e?Fl(e,t,i):Wf(isNaN(e)?t:e)}}function Tc(i,e){var t=e-i;return t?il(i,t):Wf(isNaN(i)?e:i)}var tr=function i(e){var t=Yf(e);function r(n,a){var o=t((n=pu(n)).r,(a=pu(a)).r),s=t(n.g,a.g),u=t(n.b,a.b),f=Tc(n.opacity,a.opacity);return function(c){return n.r=o(c),n.g=s(c),n.b=u(c),n.opacity=f(c),n+""}}return r.gamma=i,r}(1);function ol(i){return function(e){var t=e.length,r=new Array(t),n=new Array(t),a=new Array(t),o,s;for(o=0;ot&&(a=e.slice(t,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,u.push({i:o,x:gf(r,n)})),t=Zo.lastIndex;return tf.length?(u=G(a[s]),f=G(n[s]),f=Bi(f,u),f=ps(f,u),e.fromAttrs.path=f,e.toAttrs.path=u):e.pathFormatted||(u=G(a[s]),f=G(n[s]),f=ps(f,u),e.fromAttrs.path=f,e.toAttrs.path=u,e.pathFormatted=!0),r[s]=[];for(var c=0;c0){for(var s=e.animators.length-1;s>=0;s--){if(r=e.animators[s],r.destroyed){e.removeAnimator(s);continue}if(!r.isAnimatePaused()){n=r.get("animations");for(var u=n.length-1;u>=0;u--)a=n[u],t=tc(r,a,o),t&&(n.splice(u,1),t=!1,a.callback&&a.callback())}n.length===0&&e.removeAnimator(s)}var f=e.canvas.get("autoDraw");f||e.canvas.draw()}})},i.prototype.addAnimator=function(e){this.animators.push(e)},i.prototype.removeAnimator=function(e){this.animators.splice(e,1)},i.prototype.isAnimating=function(){return!!this.animators.length},i.prototype.stop=function(){this.timer&&this.timer.stop()},i.prototype.stopAllAnimations=function(e){e===void 0&&(e=!0),this.animators.forEach(function(t){t.stopAnimate(e)}),this.animators=[],this.canvas.draw()},i.prototype.getTime=function(){return this.current},i}(),Kl=nf,Bc=40,$l=0,vd=":",ql=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function af(i,e){for(var t in i)if(i.hasOwnProperty(t)&&t.indexOf(vd+e)>=0)return!0;return!1}function bl(i,e,t){t.name=e,t.target=i,t.currentTarget=i,t.delegateTarget=i,i.emit(e,t)}function Ql(i,e,t){if(t.bubbles){var r=void 0,n=!1;if(e==="mouseenter"?(r=t.fromShape,n=!0):e==="mouseleave"&&(n=!0,r=t.toShape),i.isCanvas()&&n)return;if(r&&pc(i,r)){t.bubbles=!1;return}t.name=e,t.currentTarget=i,t.delegateTarget=i,i.emit(e,t)}}var Jl=function(){function i(e){var t=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(r){var n=r.type;t._triggerEvent(n,r)},this._onDocumentMove=function(r){var n=t.canvas,a=n.get("el");if(a!==r.target&&(t.dragging||t.currentShape)){var o=t._getPointInfo(r);t.dragging&&t._emitEvent("drag",r,o,t.draggingShape)}},this._onDocumentMouseUp=function(r){var n=t.canvas,a=n.get("el");if(a!==r.target&&t.dragging){var o=t._getPointInfo(r);t.draggingShape&&t._emitEvent("drop",r,o,null),t._emitEvent("dragend",r,o,t.draggingShape),t._afterDrag(t.draggingShape,o,r)}},this.canvas=e.canvas}return i.prototype.init=function(){this._bindEvents()},i.prototype._bindEvents=function(){var e=this,t=this.canvas.get("el");(0,h.each)(ql,function(r){t.addEventListener(r,e._eventCallback)}),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},i.prototype._clearEvents=function(){var e=this,t=this.canvas.get("el");(0,h.each)(ql,function(r){t.removeEventListener(r,e._eventCallback)}),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},i.prototype._getEventObj=function(e,t,r,n,a,o){var s=new Nf(e,t);return s.fromShape=a,s.toShape=o,s.x=r.x,s.y=r.y,s.clientX=r.clientX,s.clientY=r.clientY,s.propagationPath.push(n),s},i.prototype._getShape=function(e,t){return this.canvas.getShape(e.x,e.y,t)},i.prototype._getPointInfo=function(e){var t=this.canvas,r=t.getClientByEvent(e),n=t.getPointByEvent(e);return{x:n.x,y:n.y,clientX:r.x,clientY:r.y}},i.prototype._triggerEvent=function(e,t){var r=this._getPointInfo(t),n=this._getShape(r,t),a=this["_on"+e],o=!1;if(a)a.call(this,r,n,t);else{var s=this.currentShape;e==="mouseenter"||e==="dragenter"||e==="mouseover"?(this._emitEvent(e,t,r,null,null,n),n&&this._emitEvent(e,t,r,n,null,n),e==="mouseenter"&&this.draggingShape&&this._emitEvent("dragenter",t,r,null)):e==="mouseleave"||e==="dragleave"||e==="mouseout"?(o=!0,s&&this._emitEvent(e,t,r,s,s,null),this._emitEvent(e,t,r,null,s,null),e==="mouseleave"&&this.draggingShape&&this._emitEvent("dragleave",t,r,null)):this._emitEvent(e,t,r,n,null,null)}if(o||(this.currentShape=n),n&&!n.get("destroyed")){var u=this.canvas,f=u.get("el");f.style.cursor=n.attr("cursor")||u.get("cursor")}},i.prototype._onmousedown=function(e,t,r){r.button===$l&&(this.mousedownShape=t,this.mousedownPoint=e,this.mousedownTimeStamp=r.timeStamp),this._emitEvent("mousedown",r,e,t,null,null)},i.prototype._emitMouseoverEvents=function(e,t,r,n){var a=this.canvas.get("el");r!==n&&(r&&(this._emitEvent("mouseout",e,t,r,r,n),this._emitEvent("mouseleave",e,t,r,r,n),(!n||n.get("destroyed"))&&(a.style.cursor=this.canvas.get("cursor"))),n&&(this._emitEvent("mouseover",e,t,n,r,n),this._emitEvent("mouseenter",e,t,n,r,n)))},i.prototype._emitDragoverEvents=function(e,t,r,n,a){n?(n!==r&&(r&&this._emitEvent("dragleave",e,t,r,r,n),this._emitEvent("dragenter",e,t,n,r,n)),a||this._emitEvent("dragover",e,t,n)):r&&this._emitEvent("dragleave",e,t,r,r,n),a&&this._emitEvent("dragover",e,t,n)},i.prototype._afterDrag=function(e,t,r){e&&(e.set("capture",!0),this.draggingShape=null),this.dragging=!1;var n=this._getShape(t,r);n!==e&&this._emitMouseoverEvents(r,t,e,n),this.currentShape=n},i.prototype._onmouseup=function(e,t,r){if(r.button===$l){var n=this.draggingShape;this.dragging?(n&&this._emitEvent("drop",r,e,t),this._emitEvent("dragend",r,e,n),this._afterDrag(n,e,r)):(this._emitEvent("mouseup",r,e,t),t===this.mousedownShape&&this._emitEvent("click",r,e,t),this.mousedownShape=null,this.mousedownPoint=null)}},i.prototype._ondragover=function(e,t,r){r.preventDefault();var n=this.currentShape;this._emitDragoverEvents(r,e,n,t,!0)},i.prototype._onmousemove=function(e,t,r){var n=this.canvas,a=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(r,e,a,t,!1),this._emitEvent("drag",r,e,o);else{var s=this.mousedownPoint;if(s){var u=this.mousedownShape,f=r.timeStamp,c=f-this.mousedownTimeStamp,l=s.clientX-e.clientX,_=s.clientY-e.clientY,I=l*l+_*_;c>120||I>Bc?u&&u.get("draggable")?(o=this.mousedownShape,o.set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",r,e,o),this.mousedownShape=null,this.mousedownPoint=null):!u&&n.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",r,e,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(r,e,a,t),this._emitEvent("mousemove",r,e,t)):(this._emitMouseoverEvents(r,e,a,t),this._emitEvent("mousemove",r,e,t))}else this._emitMouseoverEvents(r,e,a,t),this._emitEvent("mousemove",r,e,t)}},i.prototype._emitEvent=function(e,t,r,n,a,o){var s=this._getEventObj(e,t,r,n,a,o);if(n){s.shape=n,bl(n,e,s);for(var u=n.getParent();u;)u.emitDelegation(e,s),s.propagationStopped||Ql(u,e,s),s.propagationPath.push(u),u=u.getParent()}else{var f=this.canvas;bl(f,e,s)}},i.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},i}(),pd=Jl,El="px",td=Bf(),gs=td&&td.name==="firefox",ed=function(i){(0,b.__extends)(e,i);function e(t){var r=i.call(this,t)||this;return r.initContainer(),r.initDom(),r.initEvents(),r.initTimeline(),r}return e.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return t.cursor="default",t.supportCSSTransform=!1,t},e.prototype.initContainer=function(){var t=this.get("container");(0,h.isString)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t);var r=this.get("container");r.appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new pd({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new Kl(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,r){var n=this.get("el");vc&&(n.style.width=t+El,n.style.height=r+El)},e.prototype.changeSize=function(t,r){this.setDOMSize(t,r),this.set("width",t),this.set("height",r),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var r=this.get("el");vc&&r&&(r.style.cursor=t)},e.prototype.getPointByEvent=function(t){var r=this.get("supportCSSTransform");if(r){if(gs&&!(0,h.isNil)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!(0,h.isNil)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var n=this.getClientByEvent(t),a=n.x,o=n.y;return this.getPointByClient(a,o)},e.prototype.getClientByEvent=function(t){var r=t;return t.touches&&(t.type==="touchend"?r=t.changedTouches[0]:r=t.touches[0]),{x:r.clientX,y:r.clientY}},e.prototype.getPointByClient=function(t,r){var n=this.get("el"),a=n.getBoundingClientRect();return{x:t-a.left,y:r-a.top}},e.prototype.getClientByPoint=function(t,r){var n=this.get("el"),a=n.getBoundingClientRect();return{x:t+a.left,y:r+a.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){var t=this.get("eventController");t.destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var t=this.get("timeline");this.get("destroyed")||(this.clear(),t&&t.stop(),this.clearEvents(),this.removeDom(),i.prototype.destroy.call(this))},e}(Vi),of=ed,Pu=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.isGroup=function(){return!0},e.prototype.isEntityGroup=function(){return!1},e.prototype.clone=function(){for(var t=i.prototype.clone.call(this),r=this.getChildren(),n=0;n=t&&n.minY<=r&&n.maxY>=r},e.prototype.afterAttrsChange=function(t){i.prototype.afterAttrsChange.call(this,t),this.clearCacheBBox()},e.prototype.getBBox=function(){var t=this.cfg.bbox;return t||(t=this.calculateBBox(),this.set("bbox",t)),t},e.prototype.getCanvasBBox=function(){var t=this.cfg.canvasBBox;return t||(t=this.calculateCanvasBBox(),this.set("canvasBBox",t)),t},e.prototype.applyMatrix=function(t){i.prototype.applyMatrix.call(this,t),this.set("canvasBBox",null)},e.prototype.calculateCanvasBBox=function(){var t=this.getBBox(),r=this.getTotalMatrix(),n=t.minX,a=t.minY,o=t.maxX,s=t.maxY;if(r){var u=Vt(r,[t.minX,t.minY]),f=Vt(r,[t.maxX,t.minY]),c=Vt(r,[t.minX,t.maxY]),l=Vt(r,[t.maxX,t.maxY]);n=Math.min(u[0],f[0],c[0],l[0]),o=Math.max(u[0],f[0],c[0],l[0]),a=Math.min(u[1],f[1],c[1],l[1]),s=Math.max(u[1],f[1],c[1],l[1])}var _=this.attrs;if(_.shadowColor){var I=_.shadowBlur,B=I===void 0?0:I,j=_.shadowOffsetX,et=j===void 0?0:j,ut=_.shadowOffsetY,ct=ut===void 0?0:ut,pt=n-B+et,Mt=o+B+et,Zt=a-B+ct,se=s+B+ct;n=Math.min(n,pt),o=Math.max(o,Mt),a=Math.min(a,Zt),s=Math.max(s,se)}return{x:n,y:a,minX:n,minY:a,maxX:o,maxY:s,width:o-n,height:s-a}},e.prototype.clearCacheBBox=function(){this.set("bbox",null),this.set("canvasBBox",null)},e.prototype.isClipShape=function(){return this.get("isClipShape")},e.prototype.isInShape=function(t,r){return!1},e.prototype.isOnlyHitBox=function(){return!1},e.prototype.isHit=function(t,r){var n=this.get("startArrowShape"),a=this.get("endArrowShape"),o=[t,r,1];o=this.invertFromMatrix(o);var s=o[0],u=o[1],f=this._isInBBox(s,u);return this.isOnlyHitBox()?f:!!(f&&!this.isClipped(s,u)&&(this.isInShape(s,u)||n&&n.isHit(s,u)||a&&a.isHit(s,u)))},e}(Na),ec=Sl,Ml=new Map;function Bo(i,e){Ml.set(i,e)}function bu(i){return Ml.get(i)}function Wo(i){var e=i.attr(),t=e.x,r=e.y,n=e.width,a=e.height;return{x:t,y:r,width:n,height:a}}function ms(i){var e=i.attr(),t=e.x,r=e.y,n=e.r;return{x:t-n,y:r-n,width:n*2,height:n*2}}function fs(i,e,t,r){var n=i-t,a=e-r;return Math.sqrt(n*n+a*a)}function Fc(i,e){return Math.abs(i-e)<.001}function sf(i,e){var t=(0,h.min)(i),r=(0,h.min)(e),n=(0,h.max)(i),a=(0,h.max)(e);return{x:t,y:r,width:n-t,height:a-r}}function Gd(i,e,t,r){return{minX:(0,h.min)([i,t]),maxX:(0,h.max)([i,t]),minY:(0,h.min)([e,r]),maxY:(0,h.max)([e,r])}}function zc(i){return(i+Math.PI*2)%(Math.PI*2)}var cs={box:function(i,e,t,r){return sf([i,t],[e,r])},length:function(i,e,t,r){return fs(i,e,t,r)},pointAt:function(i,e,t,r,n){return{x:(1-n)*i+n*t,y:(1-n)*e+n*r}},pointDistance:function(i,e,t,r,n,a){var o=(t-i)*(n-i)+(r-e)*(a-e);if(o<0)return fs(i,e,n,a);var s=(t-i)*(t-i)+(r-e)*(r-e);return o>s?fs(t,r,n,a):this.pointToLine(i,e,t,r,n,a)},pointToLine:function(i,e,t,r,n,a){var o=[t-i,r-e];if(Yt.exactEquals(o,[0,0]))return Math.sqrt((n-i)*(n-i)+(a-e)*(a-e));var s=[-o[1],o[0]];Yt.normalize(s,s);var u=[n-i,a-e];return Math.abs(Yt.dot(u,s))},tangentAngle:function(i,e,t,r){return Math.atan2(r-e,t-i)}},gd=1e-4;function rd(i,e,t,r,n,a){var o,s=1/0,u=[t,r],f=20;a&&a>200&&(f=a/10);for(var c=1/f,l=c/10,_=0;_<=f;_++){var I=_*c,B=[n.apply(null,i.concat([I])),n.apply(null,e.concat([I]))],j=fs(u[0],u[1],B[0],B[1]);j=0&&j=0?[n]:[]}function Gc(i,e,t,r){return 2*(1-r)*(e-i)+2*r*(t-e)}function rc(i,e,t,r,n,a,o){var s=Nu(i,t,n,o),u=Nu(e,r,a,o),f=cs.pointAt(i,e,t,r,o),c=cs.pointAt(t,r,n,a,o);return[[i,e,f.x,f.y,s,u],[s,u,c.x,c.y,n,a]]}function Uc(i,e,t,r,n,a,o){if(o===0)return(fs(i,e,t,r)+fs(t,r,n,a)+fs(i,e,n,a))/2;var s=rc(i,e,t,r,n,a,.5),u=s[0],f=s[1];return u.push(o-1),f.push(o-1),Uc.apply(null,u)+Uc.apply(null,f)}var nd={box:function(i,e,t,r,n,a){var o=_l(i,t,n)[0],s=_l(e,r,a)[0],u=[i,n],f=[e,a];return o!==void 0&&u.push(Nu(i,t,n,o)),s!==void 0&&f.push(Nu(e,r,a,s)),sf(u,f)},length:function(i,e,t,r,n,a){return Uc(i,e,t,r,n,a,3)},nearestPoint:function(i,e,t,r,n,a,o,s){return rd([i,t,n],[e,r,a],o,s,Nu)},pointDistance:function(i,e,t,r,n,a,o,s){var u=this.nearestPoint(i,e,t,r,n,a,o,s);return fs(u.x,u.y,o,s)},interpolationAt:Nu,pointAt:function(i,e,t,r,n,a,o){return{x:Nu(i,t,n,o),y:Nu(e,r,a,o)}},divide:function(i,e,t,r,n,a,o){return rc(i,e,t,r,n,a,o)},tangentAngle:function(i,e,t,r,n,a,o){var s=Gc(i,t,n,o),u=Gc(e,r,a,o),f=Math.atan2(u,s);return zc(f)}};function Eu(i,e,t,r,n){var a=1-n;return a*a*a*i+3*e*n*a*a+3*t*n*n*a+r*n*n*n}function Cl(i,e,t,r,n){var a=1-n;return 3*(a*a*(e-i)+2*a*n*(t-e)+n*n*(r-t))}function Mf(i,e,t,r){var n=-3*i+9*e-9*t+3*r,a=6*i-12*e+6*t,o=3*e-3*i,s=[],u,f,c;if(Fc(n,0))Fc(a,0)||(u=-o/a,u>=0&&u<=1&&s.push(u));else{var l=a*a-4*n*o;Fc(l,0)?s.push(-a/(2*n)):l>0&&(c=Math.sqrt(l),u=(-a+c)/(2*n),f=(-a-c)/(2*n),u>=0&&u<=1&&s.push(u),f>=0&&f<=1&&s.push(f))}return s}function Rt(i,e,t,r,n,a,o,s,u){var f=Eu(i,t,n,o,u),c=Eu(e,r,a,s,u),l=cs.pointAt(i,e,t,r,u),_=cs.pointAt(t,r,n,a,u),I=cs.pointAt(n,a,o,s,u),B=cs.pointAt(l.x,l.y,_.x,_.y,u),j=cs.pointAt(_.x,_.y,I.x,I.y,u);return[[i,e,l.x,l.y,B.x,B.y,f,c],[f,c,j.x,j.y,I.x,I.y,o,s]]}function Ae(i,e,t,r,n,a,o,s,u){if(u===0)return md([i,t,n,o],[e,r,a,s]);var f=Rt(i,e,t,r,n,a,o,s,.5),c=f[0],l=f[1];return c.push(u-1),l.push(u-1),Ae.apply(null,c)+Ae.apply(null,l)}var je={extrema:Mf,box:function(i,e,t,r,n,a,o,s){for(var u=[i,o],f=[e,s],c=Mf(i,t,n,o),l=Mf(e,r,a,s),_=0;_0?t:t*-1}var rn={box:function(i,e,t,r){return{x:i-t,y:e-r,width:t*2,height:r*2}},length:function(i,e,t,r){return Math.PI*(3*(t+r)-Math.sqrt((3*t+r)*(t+3*r)))},nearestPoint:function(i,e,t,r,n,a){var o=t,s=r;if(o===0||s===0)return{x:i,y:e};for(var u=n-i,f=a-e,c=Math.abs(u),l=Math.abs(f),_=o*o,I=s*s,B=Math.PI/4,j,et,ut=0;ut<4;ut++){j=o*Math.cos(B),et=s*Math.sin(B);var ct=(_-I)*Math.pow(Math.cos(B),3)/o,pt=(I-_)*Math.pow(Math.sin(B),3)/s,Mt=j-ct,Zt=et-pt,se=c-ct,oe=l-pt,_e=Math.hypot(Zt,Mt),Ue=Math.hypot(oe,se),Re=_e*Math.asin((Mt*oe-Zt*se)/(_e*Ue)),qe=Re/Math.sqrt(_+I-j*j-et*et);B+=qe,B=Math.min(Math.PI/2,Math.max(0,B))}return{x:i+zr(j,u),y:e+zr(et,f)}},pointDistance:function(i,e,t,r,n,a){var o=this.nearestPoint(i,e,t,r,n,a);return fs(o.x,o.y,n,a)},pointAt:function(i,e,t,r,n){var a=2*Math.PI*n;return{x:i+t*Math.cos(a),y:e+r*Math.sin(a)}},tangentAngle:function(i,e,t,r,n){var a=2*Math.PI*n,o=Math.atan2(r*Math.cos(a),-t*Math.sin(a));return zc(o)}};function Fr(i,e,t,r,n,a,o,s){return-1*t*Math.cos(n)*Math.sin(s)-r*Math.sin(n)*Math.cos(s)}function jr(i,e,t,r,n,a,o,s){return-1*t*Math.sin(n)*Math.sin(s)+r*Math.cos(n)*Math.cos(s)}function bn(i,e,t){return Math.atan(-e/i*Math.tan(t))}function _n(i,e,t){return Math.atan(e/(i*Math.tan(t)))}function Cn(i,e,t,r,n,a){return t*Math.cos(n)*Math.cos(a)-r*Math.sin(n)*Math.sin(a)+i}function wn(i,e,t,r,n,a){return t*Math.sin(n)*Math.cos(a)+r*Math.cos(n)*Math.sin(a)+e}function Bn(i,e,t,r){var n=Math.atan2(r*i,t*e);return(n+Math.PI*2)%(Math.PI*2)}function v(i,e,t){return{x:i*Math.cos(t),y:e*Math.sin(t)}}function N(i,e,t){var r=Math.cos(t),n=Math.sin(t);return[i*r-e*n,i*n+e*r]}var K={box:function(i,e,t,r,n,a,o){for(var s=bn(t,r,n),u=1/0,f=-1/0,c=[a,o],l=-Math.PI*2;l<=Math.PI*2;l+=Math.PI){var _=s+l;af&&(f=I)}for(var B=_n(t,r,n),j=1/0,et=-1/0,ut=[a,o],l=-Math.PI*2;l<=Math.PI*2;l+=Math.PI){var ct=B+l;aet&&(et=pt)}return{x:u,y:j,width:f-u,height:et-j}},length:function(i,e,t,r,n,a,o){},nearestPoint:function(i,e,t,r,n,a,o,s,u){var f=N(s-i,u-e,-n),c=f[0],l=f[1],_=rn.nearestPoint(0,0,t,r,c,l),I=Bn(t,r,_.x,_.y);Io&&(_=v(t,r,o));var B=N(_.x,_.y,n);return{x:B[0]+i,y:B[1]+e}},pointDistance:function(i,e,t,r,n,a,o,s,u){var f=this.nearestPoint(i,e,t,r,s,u);return fs(f.x,f.y,s,u)},pointAt:function(i,e,t,r,n,a,o,s){var u=(o-a)*s+a;return{x:Cn(i,e,t,r,n,u),y:wn(i,e,t,r,n,u)}},tangentAngle:function(i,e,t,r,n,a,o,s){var u=(o-a)*s+a,f=Fr(i,e,t,r,n,a,o,u),c=jr(i,e,t,r,n,a,o,u);return zc(Math.atan2(c,f))}};function st(i){for(var e=0,t=[],r=0;r1||e<0||i.length<2)return null;var t=st(i),r=t.segments,n=t.totalLength;if(n===0)return{x:i[0][0],y:i[0][1]};for(var a=0,o=null,s=0;s=a&&e<=a+l){var _=(e-a)/l;o=cs.pointAt(f[0],f[1],c[0],c[1],_);break}a+=l}return o}function Ot(i,e){if(e>1||e<0||i.length<2)return 0;for(var t=st(i),r=t.segments,n=t.totalLength,a=0,o=0,s=0;s=a&&e<=a+l){o=Math.atan2(c[1]-f[1],c[0]-f[0]);break}a+=l}return o}function zt(i,e,t){for(var r=1/0,n=0;n1){var n=Sn(e,t);return e*r+n*(r-1)}return e}function Sn(i,e){return e?e-i:i*.14}function Yn(i,e){var t=wr(),r=0;if((0,h.isNil)(i)||i==="")return r;if(t.save(),t.font=e,(0,h.isString)(i)&&i.includes(` +`)){var n=i.split(` +`);(0,h.each)(n,function(a){var o=t.measureText(a).width;r1){var n=t[0].charAt(0);t.splice(1,0,t[0].substr(1)),t[0]=n}(0,h.each)(t,function(a,o){isNaN(a)||(t[o]=+a)}),e[r]=t}),e}var Ia=Ba;function uo(i,e,t,r){var n=[],a=!!r,o,s,u,f,c,l,_;if(a){u=r[0],f=r[1];for(var I=0,B=i.length;I=0;u--)o=a[u].index,a[u].type==="add"?i.splice(o,0,[].concat(i[o])):i.splice(o,1)}if(r=i.length,r2&&(t.push([n].concat(o.splice(0,2))),s="l",n=n==="m"?"l":"L"),s==="o"&&o.length===1&&t.push([n,o[0]]),s==="r")t.push([n].concat(o));else for(;o.length>=e[s]&&(t.push([n].concat(o.splice(0,e[s]))),!!e[s]););return""}),t}var Ka=/[a-z]/;function ys(i,e){return[e[0]+(e[0]-i[0]),e[1]+(e[1]-i[1])]}function Ii(i){var e=Yo(i);if(!e||!e.length)return[["M",0,0]];for(var t=!1,r=0;r=0){t=!0;break}}if(!t)return e;var a=[],o=0,s=0,u=0,f=0,c=0,l,_,I=e[0];(I[0]==="M"||I[0]==="m")&&(o=+I[1],s=+I[2],u=o,f=s,c++,a[0]=["M",o,s]);for(var r=c,B=e.length;r1&&(a=1),a<-1&&(a=-1),n*Math.acos(a)},Ru=function(i,e,t,r,n,a,o,s,u,f,c,l){var _=Math.pow(n,2),I=Math.pow(a,2),B=Math.pow(c,2),j=Math.pow(l,2),et=_*I-_*j-I*B;et<0&&(et=0),et/=_*j+I*B,et=Math.sqrt(et)*(o===s?-1:1);var ut=et*n/a*l,ct=et*-a/n*c,pt=f*ut-u*ct+(i+t)/2,Mt=u*ut+f*ct+(e+r)/2,Zt=(c-ut)/n,se=(l-ct)/a,oe=(-c-ut)/n,_e=(-l-ct)/a,Ue=Ko(1,0,Zt,se),Re=Ko(Zt,se,oe,_e);return s===0&&Re>0&&(Re-=xa),s===1&&Re<0&&(Re+=xa),[pt,Mt,Ue,Re]},nc=function(i){var e=i.px,t=i.py,r=i.cx,n=i.cy,a=i.rx,o=i.ry,s=i.xAxisRotation,u=s===void 0?0:s,f=i.largeArcFlag,c=f===void 0?0:f,l=i.sweepFlag,_=l===void 0?0:l,I=[];if(a===0||o===0)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:n}];var B=Math.sin(u*xa/360),j=Math.cos(u*xa/360),et=j*(e-r)/2+B*(t-n)/2,ut=-B*(e-r)/2+j*(t-n)/2;if(et===0&&ut===0)return[{x1:0,y1:0,x2:0,y2:0,x:r,y:n}];a=Math.abs(a),o=Math.abs(o);var ct=Math.pow(et,2)/Math.pow(a,2)+Math.pow(ut,2)/Math.pow(o,2);ct>1&&(a*=Math.sqrt(ct),o*=Math.sqrt(ct));var pt=Ru(e,t,r,n,a,o,c,_,B,j,et,ut),Mt=pt[0],Zt=pt[1],se=pt[2],oe=pt[3],_e=Math.abs(oe)/(xa/4);Math.abs(1-_e)<1e-7&&(_e=1);var Ue=Math.max(Math.ceil(_e),1);oe/=Ue;for(var Re=0;Re7){i[t].shift();for(var r=i[t],n=t;r.length;)e[t]="A",i.splice(n+=1,0,["C"].concat(r.splice(0,6)));i.splice(t,1)}}var ii=function(i,e,t,r,n){var a=-3*e+9*t-9*r+3*n,o=i*a+6*e-12*t+6*r;return i*o-3*e+3*t},ke=function(i,e,t,r,n,a,o,s,u){u===null&&(u=1),u=u>1?1:u<0?0:u;for(var f=u/2,c=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],_=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],I=0,B=0;B0&&I<1&&u.push(I);continue}var j=l*l-4*_*c,et=Math.sqrt(j);if(!(j<0)){var ut=(-l+et)/(2*c);ut>0&&ut<1&&u.push(ut);var ct=(-l-et)/(2*c);ct>0&&ct<1&&u.push(ct)}}for(var pt=u.length,Mt=pt,Zt;pt--;)I=u[pt],Zt=1-I,f[0][pt]=Zt*Zt*Zt*i+3*Zt*Zt*I*t+3*Zt*I*I*n+I*I*I*o,f[1][pt]=Zt*Zt*Zt*e+3*Zt*Zt*I*r+3*Zt*I*I*a+I*I*I*s;return f[0][Mt]=i,f[1][Mt]=e,f[0][Mt+1]=o,f[1][Mt+1]=s,f[0].length=f[1].length=Mt+2,{min:{x:Math.min.apply(0,f[0]),y:Math.min.apply(0,f[1])},max:{x:Math.max.apply(0,f[0]),y:Math.max.apply(0,f[1])}}},er=function(i,e,t,r,n,a,o,s){if(!(Math.max(i,t)Math.max(n,o)||Math.max(e,r)Math.max(a,s))){var u=(i*r-e*t)*(n-o)-(i-t)*(n*s-a*o),f=(i*r-e*t)*(a-s)-(e-r)*(n*s-a*o),c=(i-t)*(a-s)-(e-r)*(n-o);if(c){var l=u/c,_=f/c,I=+l.toFixed(2),B=+_.toFixed(2);if(!(I<+Math.min(i,t).toFixed(2)||I>+Math.max(i,t).toFixed(2)||I<+Math.min(n,o).toFixed(2)||I>+Math.max(n,o).toFixed(2)||B<+Math.min(e,r).toFixed(2)||B>+Math.max(e,r).toFixed(2)||B<+Math.min(a,s).toFixed(2)||B>+Math.max(a,s).toFixed(2)))return{x:l,y:_}}}},br=function(i,e,t){return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},Cr=function(i,e,t,r){return i===null&&(i=e=t=r=0),e===null&&(e=i.y,t=i.width,r=i.height,i=i.x),{x:i,y:e,width:t,w:t,height:r,h:r,x2:i+t,y2:e+r,cx:i+t/2,cy:e+r/2,r1:Math.min(t,r)/2,r2:Math.max(t,r)/2,r0:Math.sqrt(t*t+r*r)/2,path:rectPath(i,e,t,r),vb:[i,e,t,r].join(" ")}},ar=function(i,e){return i=Cr(i),e=Cr(e),br(e,i.x,i.y)||br(e,i.x2,i.y)||br(e,i.x,i.y2)||br(e,i.x2,i.y2)||br(i,e.x,e.y)||br(i,e.x2,e.y)||br(i,e.x,e.y2)||br(i,e.x2,e.y2)||(i.xe.x||e.xi.x)&&(i.ye.y||e.yi.y)},rr=function(i,e,t,r,n,a,o,s){isArray(i)||(i=[i,e,t,r,n,a,o,s]);var u=Ee.apply(null,i);return Cr(u.min.x,u.min.y,u.max.x-u.min.x,u.max.y-u.min.y)},vr=function(i,e,t,r,n,a,o,s,u){var f=1-u,c=Math.pow(f,3),l=Math.pow(f,2),_=u*u,I=_*u,B=c*i+l*3*u*t+f*3*u*u*n+I*o,j=c*e+l*3*u*r+f*3*u*u*a+I*s,et=i+2*u*(t-i)+_*(n-2*t+i),ut=e+2*u*(r-e)+_*(a-2*r+e),ct=t+2*u*(n-t)+_*(o-2*n+t),pt=r+2*u*(a-r)+_*(s-2*a+r),Mt=f*i+u*t,Zt=f*e+u*r,se=f*n+u*o,oe=f*a+u*s,_e=90-Math.atan2(et-ct,ut-pt)*180/Math.PI;return{x:B,y:j,m:{x:et,y:ut},n:{x:ct,y:pt},start:{x:Mt,y:Zt},end:{x:se,y:oe},alpha:_e}},Be=function(i,e,t){var r=rr(i),n=rr(e);if(!ar(r,n))return t?0:[];for(var a=ke.apply(0,i),o=ke.apply(0,e),s=~~(a/8),u=~~(o/8),f=[],c=[],l={},_=t?0:[],I=0;I=0&&oe<=1&&_e>=0&&_e<=1&&(t?_++:_.push({x:se.x,y:se.y,t1:oe,t2:_e}))}}return _},Qe=function(i,e,t){i=path2Curve(i),e=path2Curve(e);for(var r,n,a,o,s,u,f,c,l,_,I=t?0:[],B=0,j=i.length;B1&&(t*=Math.sqrt(I),r*=Math.sqrt(I));var B=t*t*(_*_)+r*r*(l*l),j=B?Math.sqrt((t*t*(r*r)-B)/B):1;a===o&&(j*=-1),isNaN(j)&&(j=0);var et=r?j*t*_/r:0,ut=t?j*-r*l/t:0,ct=(s+f)/2+Math.cos(n)*et-Math.sin(n)*ut,pt=(u+c)/2+Math.sin(n)*et+Math.cos(n)*ut,Mt=[(l-et)/t,(_-ut)/r],Zt=[(-1*l-et)/t,(-1*_-ut)/r],se=tn([1,0],Mt),oe=tn(Mt,Zt);return Ir(Mt,Zt)<=-1&&(oe=Math.PI),Ir(Mt,Zt)>=1&&(oe=0),o===0&&oe>0&&(oe=oe-2*Math.PI),o===1&&oe<0&&(oe=oe+2*Math.PI),{cx:ct,cy:pt,rx:on(i,[f,c])?0:t,ry:on(i,[f,c])?0:r,startAngle:se,endAngle:se+oe,xRotation:n,arcFlag:a,sweepFlag:o}}function An(i,e){return[e[0]+(e[0]-i[0]),e[1]+(e[1]-i[1])]}function va(i){i=Ia(i);for(var e=[],t=null,r=null,n=null,a=0,o=i.length,s=0;s1){var o=i[0],s=i[t-1];e.push({from:{x:s[0],y:s[1]},to:{x:o[0],y:o[1]}})}return e}function fa(i,e){var t=!1;return each(i,function(r){if(getLineIntersect(r.from,r.to,e.from,e.to))return t=!0,!1}),t}function Ca(i){var e=i.map(function(r){return r[0]}),t=i.map(function(r){return r[1]});return{minX:Math.min.apply(null,e),maxX:Math.max.apply(null,e),minY:Math.min.apply(null,t),maxY:Math.max.apply(null,t)}}function Xa(i,e){return!(e.minX>i.maxX||e.maxXi.maxY||e.maxYMath.PI/2?Math.PI-f:f,c=c>Math.PI/2?Math.PI-c:c;var l={xExtra:Math.cos(u/2-f)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(c-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0};return l}function yd(i){var e=i.attr(),t=e.path,r=e.stroke,n=r?e.lineWidth:0,a=i.get("segments")||va(t),o=$o(a,n),s=o.x,u=o.y,f=o.width,c=o.height,l={minX:s,minY:u,maxX:s+f,maxY:u+c};return l=We(i,l),{x:l.minX,y:l.minY,width:l.maxX-l.minX,height:l.maxY-l.minY}}function fu(i){var e=i.attr(),t=e.x1,r=e.y1,n=e.x2,a=e.y2,o=Math.min(t,n),s=Math.max(t,n),u=Math.min(r,a),f=Math.max(r,a),c={minX:o,maxX:s,minY:u,maxY:f};return c=We(i,c),{x:c.minX,y:c.minY,width:c.maxX-c.minX,height:c.maxY-c.minY}}function Ud(i){var e=i.attr(),t=e.x,r=e.y,n=e.rx,a=e.ry;return{x:t-n,y:r-a,width:n*2,height:a*2}}Bo("rect",Wo),Bo("image",Wo),Bo("circle",ms),Bo("marker",ms),Bo("polyline",cr),Bo("polygon",Vr),Bo("text",la),Bo("path",yd),Bo("line",fu),Bo("ellipse",Ud);var ku="0.5.11",Wd=function(i){(0,b.__extends)(e,i);function e(t,r){var n=i.call(this,t,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 e}(Nf),Ih=function(e){return"".concat(e,"-").concat(Math.random()).concat(Date.now())},Oh=function(e){if((0,h.isArray)(e))switch(e.length){case 4:return e;case 3:return e.push(e[1]),e;case 2:return e.concat(e);case 1:return[e[0],e[0],e[0],e[0]];default:return[0,0,0,0]}if((0,h.isNumber)(e))return[e,e,e,e];if((0,h.isString)(e)){var t=parseInt(e,10);return[t,t,t,t]}return[0,0,0,0]},G0=function(e){var t=new Wd(e.type,e);return t.clientX=e.clientX,t.clientY=e.clientY,t.x=e.x,t.y=e.y,t.target=e.target,t.currentTarget=e.currentTarget,t.bubbles=!0,t.item=e.item,t},U0=function(e){if(!e)return!1;for(var t=9,r=[1,0,0,0,1,0,0,0,1],n=0;nr&&(r=l),_>a&&(a=_)}var I=Math.floor(t),B=Math.floor(n),j=Math.ceil(r)-Math.floor(t),et=Math.ceil(a)-Math.floor(n);return{x:I,y:B,width:j,height:et,minX:t,minY:n,maxX:r,maxY:a}},W0=function(e,t,r,n,a){t===void 0&&(t=15),r===void 0&&(r="quadratic"),n===void 0&&(n=void 0),a===void 0&&(a=void 0);for(var o=e.length,s=t*2,u=["top","top-right","right","bottom-right","bottom","bottom-left","left","top-left"],f={},c=[],l={},_=0;_r.get("optimizeThreshold")){var s=1/0,u=1/0,f=-1/0,c=-1/0;o.forEach(function(Mt){var Zt=Mt.getModel(),se=Zt.x,oe=Zt.y;s>se&&(s=se),u>oe&&(u=oe),fet&&(ut=et,console.warn("fitview failed, ratio out of range, ratio: %f",s,"graph maxzoom has been used instead"));var ct=(0,Pv.vs)(I,[["t",-a.x,-a.y],["s",ut,ut],["t",a.x,a.y]]),pt=ws({animateCfg:r,callback:function(){e.setMatrix(ct),f.emit("viewportchange",{action:"translate",matrix:I}),f.emit("viewportchange",{action:"zoom",matrix:ct})}});e.stopAnimate(),e.setMatrix(t),e.animate(function(Mt){return{matrix:Qa(t,ct,Mt)}},pt)}},i.prototype.fitView=function(e,t){var r=this.graph,n=this.getFormatPadding(),a=r.get("width"),o=r.get("height"),s=r.get("group"),u=s.getMatrix()||[1,0,0,0,1,0,0,0,1];s.resetMatrix();var f,c=r.getNodes();if(c.length>r.get("optimizeThreshold")){var l=1/0,_=1/0,I=-1/0,B=-1/0;c.forEach(function(se){var oe=se.getModel(),_e=oe.x,Ue=oe.y;l>_e&&(l=_e),_>Ue&&(_=Ue),I<_e&&(I=_e),Bct&&(pt=ct),e)this.animatedFitView(s,u,t,f,j,et,pt,!0);else{var Mt=j.x-et.x,Zt=j.y-et.y;if(_f(Mt)||_f(Zt))return;r.translate(Mt,Zt),r.zoom(pt,j)||console.warn("zoom failed, ratio out of range, ratio: %f",pt)}}},i.prototype.fitViewByRules=function(e,t,r){var n=e.onlyOutOfViewPort,a=n===void 0?!1:n,o=e.direction,s=o===void 0?"both":o,u=e.ratioRule,f=u===void 0?"min":u,c=this.graph,l=this.getFormatPadding(),_=c.get("width"),I=c.get("height"),B=c.get("group"),j=B.getMatrix()||[1,0,0,0,1,0,0,0,1];B.resetMatrix();var et,ut=c.getNodes();if(ut.length>c.get("optimizeThreshold")){var ct=1/0,pt=1/0,Mt=-1/0,Zt=-1/0;ut.forEach(function(kn){var En=kn.getModel(),Kr=En.x,ta=En.y;ct>Kr&&(ct=Kr),pt>ta&&(pt=ta),Mtl.maxX&&(l.maxX=j.maxX),j.maxY>l.maxY&&(l.maxY=j.maxY)}if(l.x=l.minX,l.y=l.minY,l.width=l.maxX-l.minX,l.height=l.maxY-l.minY,!(l.width===0||l.height===0)){var et=this.getViewCenter(),ut={x:l.x+l.width/2,y:l.y+l.height/2},ct=(s-o[1]-o[3])/l.width,pt=(u-o[0]-o[2])/l.height,Mt=ct;ct>pt&&(Mt=pt),r?this.animatedFitView(f,c,n,l,et,ut,Mt,t):(a.translate(et.x-ut.x,et.y-ut.y),t&&!a.zoom(Mt,et)&&console.warn("zoom failed, ratio out of range, ratio: %f",Mt))}}},i.prototype.changeSize=function(e,t){var r=this.graph;if(!(0,h.isNumber)(e)||!(0,h.isNumber)(t))throw Error("invalid canvas width & height, please make sure width & height type is number");r.set({width:e,height:t});var n=r.get("canvas");n.changeSize(e,t);var a=r.get("plugins");a.forEach(function(o){o.get("gridContainer")&&o.positionInit()})},i.prototype.destroy=function(){this.graph=null,this.destroyed=!1},i}(),X0=Y0;function Dh(i){"@babel/helpers - typeof";return Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dh(i)}function Nv(i){if(typeof i!="string")return i;var e=function(oe){if(typeof oe!="string")return oe;try{return JSON.parse(oe.trim())}catch(_e){return oe.trim()}},t=e(i);if(typeof t!="string")return t;for(var r=function(oe){return oe[oe.length-1]},n=i.trim(),a=[],o=[],s=function(){for(var oe=[],_e=0;_e=0&&(a.height=o),s>=0&&(a.width=s),n.marginTop&&(a.y+=n.marginTop),n.marginLeft&&(a.x+=n.marginLeft),a}function kv(i,e){var t;e===void 0&&(e={x:0,y:0});var r=(0,b.__assign)({x:0,y:0,width:0,height:0},e);if(!((t=i.children)===null||t===void 0)&&t.length){var n=i.attrs,a=n===void 0?{}:n,o=a.marginTop,s=(0,b.__assign)({},e);o&&(s.y+=o);for(var u=0;ur.width&&(r.width=c.width+c.x),c.height+c.y>r.height&&(r.height=c.height+c.y)}}}return i.bbox=H0(i,e,r),i.attrs=(0,b.__assign)((0,b.__assign)({},i.attrs),i.bbox),i}function Bv(i,e){var t,r,n,a,o=(i||{}).type,s=((e==null?void 0:e.attrs)||{}).key;if(s&&i&&(i.attrs.key=s),!i&&e)return{action:"delete",val:e,type:o,key:s};if(i&&!e)return{action:"add",val:i,type:o};if(!i&&!e)return{action:"same",type:o};var u=[];if(((t=i.children)===null||t===void 0?void 0:t.length)>0||((r=e.children)===null||r===void 0?void 0:r.length)>0)for(var f=Math.max((n=i.children)===null||n===void 0?void 0:n.length,(a=e.children)===null||a===void 0?void 0:a.length),c=e.children||[],l=i.children||[],_=0;_-1)return;r.push(a)}else u>-1&&r.splice(u,1)}else if((0,h.isString)(t)){var f=r.filter(function(_){return _.includes(o)});f.length>0&&this.clearStates(f),s=s.filter(function(_){return!_.includes(o)}),s.push(a),this.set("states",s)}if(n){var c=this.get("model"),l=c.type;n.setState(l,e,t,this)}},i.prototype.clearStates=function(e){var t=this,r=t.getStates(),n=t.get("shapeFactory"),a=t.get("model"),o=a.type;e||(e=r),(0,h.isString)(e)&&(e=[e]);var s=r.filter(function(u){return e.indexOf(u)===-1});t.set("states",s),e.forEach(function(u){n.setState(o,u,!1,t)})},i.prototype.setOptimize=function(e){this.optimize=e},i.prototype.getContainer=function(){return this.get("group")},i.prototype.getKeyShape=function(){return this.get("keyShape")},i.prototype.getModel=function(){return this.get("model")},i.prototype.getType=function(){return this.get("type")},i.prototype.getID=function(){return this.get("id")},i.prototype.isItem=function(){return!0},i.prototype.getStates=function(){return this.get("states")},i.prototype.hasState=function(e){var t=this.getStates();return t.indexOf(e)>=0},i.prototype.refresh=function(e){var t=this.get("model");this.updatePosition(t),this.updateShape(e),this.afterUpdate(),this.clearCache()},i.prototype.getUpdateType=function(e){},i.prototype.update=function(e,t){t===void 0&&(t=void 0);var r=this.get("model");if(t==="move")this.updatePosition(e);else{var n=r.visible,a=e.visible;n!==a&&a!==void 0&&this.changeVisibility(a);var o={x:r.x,y:r.y};e.x=isNaN(+e.x)?r.x:+e.x,e.y=isNaN(+e.y)?r.y:+e.y;var s=this.get("styles");if(e.stateStyles){var u=e.stateStyles;(0,h.mix)(s,u),delete e.stateStyles}Object.assign(r,e),(o.x!==e.x||o.y!==e.y)&&this.updatePosition(e),this.updateShape(t)}this.afterUpdate(),this.clearCache()},i.prototype.updateShape=function(e){var t=this.get("shapeFactory"),r=this.get("model"),n=r.type;if(t.shouldUpdate(n)&&n===this.get("currentShape")){var a=this.getShapeCfg(r,e);t.baseUpdate(n,a,this,e),e!=="move"&&this.setOriginStyle()}else this.draw();this.restoreStates(t,n)},i.prototype.updatePosition=function(e){var t=this.get("model"),r=isNaN(+e.x)?+t.x:+e.x,n=isNaN(+e.y)?+t.y:+e.y,a=this.get("group");if(isNaN(r)||isNaN(n))return!1;t.x=r,t.y=n;var o=a.getMatrix();return o&&o[6]===r&&o[7]===n?!1:(a.resetMatrix(),Ma(a,{x:r,y:n}),this.clearCache(),!0)},i.prototype.getBBox=function(){var e=this.get(Nh);return e||(e=this.calculateBBox(),this.set(Nh,e)),e},i.prototype.getCanvasBBox=function(){var e=this.get(Rh);return e||(e=this.calculateCanvasBBox(),this.set(Rh,e)),e},i.prototype.toFront=function(){var e=this.get("group");e.toFront()},i.prototype.toBack=function(){var e=this.get("group");e.toBack()},i.prototype.show=function(){this.changeVisibility(!0)},i.prototype.hide=function(){this.changeVisibility(!1)},i.prototype.changeVisibility=function(e){var t=this.get("group");e?t.show():t.hide(),this.set("visible",e)},i.prototype.isVisible=function(){return this.get("visible")},i.prototype.enableCapture=function(e){var t=this.get("group");t&&t.set("capture",e)},i.prototype.destroy=function(){if(!this.destroyed){var e=this.get("animate"),t=this.get("group");e&&t.stopAnimate(),t.shapeMap={},this.clearCache(),t.remove(),this._cfg=null,this.destroyed=!0}},i}(),Gv=K0,Xd={source:"start",target:"end"},Cf="Node",ad="Point",$0="Anchor",q0=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){return{type:"edge",sourceNode:null,targetNode:null,startPoint:null,endPoint:null,linkCenter:!1}},e.prototype.setEnd=function(t,r){var n=Xd[t]+ad,a=t+Cf,o=this.get(a);o&&!o.destroyed&&o.removeEdge(this),(0,h.isPlainObject)(r)?(this.set(n,r),this.set(a,null)):r&&(r.addEdge(this),this.set(a,r),this.set(n,null))},e.prototype.getLinkPoint=function(t,r,n){var a=Xd[t]+ad,o=t+Cf,s=this.get(a);if(!s){var u=this.get(o),f=t+$0,c=this.getPrePoint(t,n),l=r[f];(0,h.isNil)(l)||(s=u.getLinkPointByAnchor(l)),s=s||u.getLinkPoint(c),(0,h.isNil)(s.index)||this.set("".concat(t,"AnchorIndex"),s.index)}return s},e.prototype.getPrePoint=function(t,r){if(r&&r.length){var n=t==="source"?0:r.length-1;return r[n]}var a=t==="source"?"target":"source";return this.getEndPoint(a)},e.prototype.getEndPoint=function(t){var r=t+Cf,n=Xd[t]+ad,a=this.get(r);return a&&!a.destroyed?a.get("model"):this.get(n)},e.prototype.getControlPointsByCenter=function(t){var r=this.getEndPoint("source"),n=this.getEndPoint("target"),a=this.get("shapeFactory"),o=t.type;return a.getControlPoints(o,{startPoint:r,endPoint:n})},e.prototype.getEndCenter=function(t){var r=t+Cf,n=Xd[t]+ad,a=this.get(r);if(a){var o=a.getBBox();return{x:o.centerX,y:o.centerY}}return this.get(n)},e.prototype.init=function(){i.prototype.init.call(this),this.setSource(this.get("source")),this.setTarget(this.get("target"))},e.prototype.getShapeCfg=function(t,r){var n=this,a=n.get("linkCenter"),o=r!=null&&r.includes("move")?t:i.prototype.getShapeCfg.call(this,t);if(a)o.startPoint=n.getEndCenter("source"),o.endPoint=n.getEndCenter("target");else{var s=o.controlPoints||n.getControlPointsByCenter(o);o.startPoint=n.getLinkPoint("source",t,s),o.endPoint=n.getLinkPoint("target",t,s)}return o.sourceNode=n.get("sourceNode"),o.targetNode=n.get("targetNode"),o},e.prototype.getModel=function(){var t=this.get("model"),r=this.get("source".concat(Cf)),n=this.get("target".concat(Cf));return r?delete t["source".concat(Cf)]:t.source=this.get("start".concat(ad)),n?delete t["target".concat(Cf)]:t.target=this.get("end".concat(ad)),!(0,h.isString)(t.source)&&!(0,h.isPlainObject)(t.source)&&(t.source=t.source.getID()),!(0,h.isString)(t.target)&&!(0,h.isPlainObject)(t.target)&&(t.target=t.target.getID()),t},e.prototype.setSource=function(t){this.setEnd("source",t),this.set("source",t)},e.prototype.setTarget=function(t){this.setEnd("target",t),this.set("target",t)},e.prototype.getSource=function(){return this.get("source")},e.prototype.getTarget=function(){return this.get("target")},e.prototype.updatePosition=function(){return!1},e.prototype.update=function(t,r){r===void 0&&(r=void 0);var n=this.get("model"),a=n.visible,o=t.visible;a!==o&&o!==void 0&&this.changeVisibility(o);var s=this.get("source"),u=this.get("target");if(!(!s||s.destroyed||!u||u.destroyed)){var f=this.get("styles");if(t.stateStyles){var c=t.stateStyles;(0,h.mix)(f,c),delete t.stateStyles}Object.assign(n,t),this.updateShape(r),this.afterUpdate(),this.clearCache()}},e.prototype.destroy=function(){var t=this.get("source".concat(Cf)),r=this.get("target".concat(Cf));t&&!t.destroyed&&t.removeEdge(this),r&&!r.destroyed&&r.removeEdge(this),i.prototype.destroy.call(this)},e}(Gv),Uv=q0,kh="anchorPointsCache",Q0="bboxCache",J0=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.getNearestPoint=function(t,r){for(var n=0,a=t[0],o=Zn(t[0],r),s=0;s-1&&r.splice(n,1)},e.prototype.clearCache=function(){this.set(Q0,null),this.set(kh,null)},e.prototype.getUpdateType=function(t){var r,n,a,o,s;if(t){var u=!(0,h.isNil)(t.x),f=!(0,h.isNil)(t.y),c=Object.keys(t);if(c.length===1&&(u||f)||c.length===2&&u&&f)return"move";if((0,h.isNumber)(t.x)||(0,h.isNumber)(t.y)||t.type||t.anchorPoints||t.size||t!=null&&t.style&&(!((r=t==null?void 0:t.style)===null||r===void 0)&&r.r||!((n=t==null?void 0:t.style)===null||n===void 0)&&n.width||!((a=t==null?void 0:t.style)===null||a===void 0)&&a.height||!((o=t==null?void 0:t.style)===null||o===void 0)&&o.rx||!((s=t==null?void 0:t.style)===null||s===void 0)&&s.ry))return"bbox|label";var l=c.includes("label")||c.includes("labelCfg");return l?"style|label":"style"}},e.prototype.setState=function(t,r){var n=this;if(this.optimize){i.prototype.setState.call(this,t,r);return}this.runWithBBoxAffected(function(){return i.prototype.setState.call(n,t,r)})},e.prototype.clearStates=function(t){var r=this;if(this.optimize){i.prototype.clearStates.call(this,t);return}this.runWithBBoxAffected(function(){return i.prototype.clearStates.call(r,t)})},e.prototype.runWithBBoxAffected=function(t){var r=["r","width","height","rx","ry","lineWidth"],n=this.getKeyShape().attr(),a={};Object.keys(this.getKeyShape().attr()).forEach(function(f){r.includes(f)&&(a[f]=n[f])}),t();for(var o=this.getKeyShape().attr(),s=0;s-1?(r.splice(n,1),!0):!1}},e.prototype.removeNode=function(t){if(t){var r=this.getNodes(),n=r.indexOf(t);return n>-1?(r.splice(n,1),!0):!1}},e.prototype.getUpdateType=function(t){},e.prototype.getBBox=function(){this.set(Yv,null);var t=this.calculateCanvasBBox();return t},e.prototype.clearCache=function(){this.set(Wv,null),this.set(Yv,null),this.set(Xv,null)},e.prototype.destroy=function(){if(!this.destroyed){var t=this.get("animate"),r=this.get("group");t&&r.stopAnimate(),r.shapeMap={},this.clearCache(),this.set(jd,null),this.set("bbox",null),r.remove(),this._cfg=null,this.destroyed=!0}},e}(Bh),jv=tm,Vd="node",Hd="edge",Vv="vedge",xd="combo",em="default",Hv="Mapper",ac="stateStyles",rm=function(){function i(e){var t=this;this.edgeToBeUpdateMap={},this.throttleRefresh=(0,h.throttle)(function(r){var n=t.graph;if(!(!n||n.get("destroyed"))){var a=t.edgeToBeUpdateMap;if(a){var o=Object.values(a);o.length&&(o.forEach(function(s){var u=s.edge;if(!(!u||u.destroyed)){var f=u.getSource(),c=u.getTarget();!f||f.destroyed||!c||c.destroyed||u.refresh(s.updateType)}}),t.edgeToBeUpdateMap={})}}},16,{trailing:!0,leading:!0}),this.graph=e,this.destroyed=!1}return i.prototype.addItem=function(e,t){var r=this.graph,n=e===Vv?Hd:e,a=r.get("".concat(n,"Group"))||r.get("group"),o=(0,h.upperFirst)(n),s=null,u=r.get(n+(0,h.upperFirst)(ac))||{},f=r.get(em+o);t[ac]&&(u=t[ac]),f&&(0,h.each)(f,function(se,oe){(0,h.isObject)(se)&&!(0,h.isArray)(se)?t[oe]=(0,h.deepMix)({},se,t[oe]):(0,h.isArray)(se)?t[oe]=t[oe]||(0,h.clone)(f[oe]):t[oe]=t[oe]||f[oe]});var c=r.get(n+Hv);if(c){var l=c(t);l[ac]&&(u=l[ac],delete l[ac]),(0,h.each)(l,function(se,oe){(0,h.isObject)(se)&&!(0,h.isArray)(se)?t[oe]=(0,h.deepMix)({},t[oe],se):t[oe]=l[oe]||t[oe]})}if(r.emit("beforeadditem",{type:e,model:t}),e===Hd||e===Vv){var _=void 0,I=void 0;if(_=t.source,I=t.target,_&&(0,h.isString)(_)&&(_=r.findById(_)),I&&(0,h.isString)(I)&&(I=r.findById(I)),!_||!I){console.warn("The source or target node of edge ".concat(t.id," does not exist!"));return}_.getType&&_.getType()==="combo"&&(t.isComboEdge=!0),I.getType&&I.getType()==="combo"&&(t.isComboEdge=!0),s=new Uv({model:t,source:_,target:I,styles:u,linkCenter:r.get("linkCenter"),group:a.addGroup()})}else if(e===Vd)s=new Bh({model:t,styles:u,group:a.addGroup()});else if(e===xd){var B=t.children,j=Vs(B,r),et=void 0,ut=void 0;if(isNaN(j.x)?isNaN(t.x)&&(et=Math.random()*100):et=j.x,isNaN(j.y)?isNaN(t.y)&&(ut=Math.random()*100):ut=j.y,isNaN(t.x)||isNaN(t.y))t.x=et,t.y=ut;else{var ct=t.x-et,pt=t.y-ut;this.updateComboSucceeds(t.id,ct,pt,B)}var Mt=a.addGroup();Mt.setZIndex(t.depth),s=new jv({model:t,styles:u,animate:r.get("animate"),bbox:t.collapsed?Vs([],r):j,group:Mt}),!t.collapsed&&s.getKeyShape().get("type")==="circle"&&(j.width=Math.hypot(j.height,j.width),j.height=j.width,s.set("bbox",j),s.refresh());var Zt=s.getModel();(B||[]).forEach(function(se){var oe=r.findById(se.id);s.addChild(oe),se.depth=Zt.depth+2})}if(s)return s.setOptimize(r.getNodes().length>r.get("optimizeThreshold")),r.get("".concat(e,"s")).push(s),r.get("itemMap")[s.get("id")]=s,r.emit("afteradditem",{item:s,model:t}),s},i.prototype.updateItem=function(e,t){var r=this,n,a,o=this.graph;if((0,h.isString)(e)&&(e=o.findById(e)),!(!e||e.destroyed)){var s="";e.getType&&(s=e.getType());var u=o.get(s+Hv),f=e.getModel(),c=f.x,l=f.y,_=e.getUpdateType(t);if(u){var I=(0,h.deepMix)({},f,t),B=u(I),j=(0,h.deepMix)({},f,B,t);B[ac]&&(e.set("styles",j[ac]),delete j[ac]),(0,h.each)(j,function(Re,qe){t[qe]=Re})}else(0,h.each)(t,function(Re,qe){f[qe]&&(0,h.isObject)(Re)&&!(0,h.isArray)(Re)&&(t[qe]=(0,b.__assign)((0,b.__assign)({},f[qe]),t[qe]))});if(o.emit("beforeupdateitem",{item:e,cfg:t}),s===Hd){if(t.source){var et=t.source;(0,h.isString)(et)&&(et=o.findById(et)),e.setSource(et)}if(t.target){var ut=t.target;(0,h.isString)(ut)&&(ut=o.findById(ut)),e.setTarget(ut)}e.update(t)}else if(s===Vd){e.update(t,_);var ct=e.getEdges();_==="move"?(0,h.each)(ct,function(Re){r.edgeToBeUpdateMap[Re.getID()]={edge:Re,updateType:_},r.throttleRefresh()}):_!=null&&_.includes("bbox")&&(0,h.each)(ct,function(Re){Re.refresh(_)})}else if(s===xd){if(e.update(t,_),!isNaN(t.x)||!isNaN(t.y)){var pt=t.x-c||0,Mt=t.y-l||0;this.updateComboSucceeds(f.id,pt,Mt)}var Zt=e.getEdges(),se=(_==null?void 0:_.includes("bbox"))||_==="move";if(se&&s===xd){var oe=e.get("shapeFactory"),_e=f.type||"circle",Ue=f.animate===void 0||t.animate===void 0?(a=(n=oe[_e])===null||n===void 0?void 0:n.options)===null||a===void 0?void 0:a.animate:f.animate||t.animate;Ue?setTimeout(function(){if(!(!e||e.destroyed)){var Re=e.getKeyShape();!Re||Re.destroyed||(0,h.each)(Zt,function(qe){qe&&!qe.destroyed&&qe.refresh()})}},201):(0,h.each)(Zt,function(Re){Re.refresh()})}}e.setOptimize(o.getNodes().length>o.get("optimizeThreshold")),o.emit("afterupdateitem",{item:e,cfg:t})}},i.prototype.updateCombo=function(e,t,r){var n=this,a,o,s=this.graph;if((0,h.isString)(e)&&(e=s.findById(e)),!(!e||e.destroyed)){var u=e.getModel(),f=Vs(t,s,e),c=f.x,l=f.y;e.set("bbox",f);var _=c,I=l;r?(_=isNaN(u.x)?c:u.x,I=isNaN(u.y)?l:u.y):(_=isNaN(c)?u.x:c,I=isNaN(l)?u.y:l),e.update({x:_,y:I});var B=e.get("shapeFactory"),j=u.type||"circle",et=u.animate===void 0?(o=(a=B[j])===null||a===void 0?void 0:a.options)===null||o===void 0?void 0:o.animate:u.animate;et?setTimeout(function(){if(!(!e||e.destroyed)){var ut=e.getKeyShape();!ut||ut.destroyed||(e.getShapeCfg(u),n.updateComboEdges(e))}},201):this.updateComboEdges(e)}},i.prototype.updateComboEdges=function(e){for(var t,r,n=e.getEdges()||[],a=0;a-1&&o.splice(s,1),a===Hd){var u=r.get("v".concat(a,"s")),f=u.indexOf(e);f>-1&&u.splice(f,1)}var c=e.get("id"),l=r.get("itemMap");delete l[c];var _=r.get("comboTrees"),I=e.get("id");if(a===Vd){var B=e.getModel().comboId;if(_&&B){var j=_,et=!1;_.forEach(function(se){et||ji(se,function(oe){if(oe.id===I&&j){var _e=j.indexOf(oe);return j.splice(_e,1),et=!0,!1}return j=oe.children,!0})})}for(var ut=e.getEdges(),ct=ut.length-1;ct>=0;ct--)r.removeItem(ut[ct],!1);B&&r.updateCombo(B)}else if(a===xd){var pt=e.getModel().parentId,Mt,Zt=!1;(_||[]).forEach(function(oe){Zt||ji(oe,function(_e){return _e.id===I?(Mt=_e,Zt=!0,!1):!0})}),Mt.removed=!0,Mt&&Mt.children&&Mt.children.forEach(function(oe){t.removeItem(oe.id)});for(var ut=e.getEdges(),ct=ut.length;ct>=0;ct--)r.removeItem(ut[ct],!1);pt&&r.updateCombo(pt)}e.destroy(),r.emit("afterremoveitem",{item:n,type:a})}},i.prototype.setItemState=function(e,t,r){var n=this.graph,a=t;(0,h.isString)(r)&&(a="".concat(t,":").concat(r)),!(e.hasState(a)===r&&r||(0,h.isString)(r)&&e.hasState(a))&&(n.emit("beforeitemstatechange",{item:e,state:a,enabled:r}),e.setState(t,r),n.autoPaint(),n.emit("afteritemstatechange",{item:e,state:a,enabled:r}))},i.prototype.priorityState=function(e,t){var r=this.graph,n=e;(0,h.isString)(e)&&(n=r.findById(e)),this.setItemState(n,t,!1),this.setItemState(n,t,!0)},i.prototype.clearItemStates=function(e,t){var r=this.graph;(0,h.isString)(e)&&(e=r.findById(e)),r.emit("beforeitemstatesclear",{item:e,states:t}),e.clearStates(t),r.emit("afteritemstatesclear",{item:e,states:t})},i.prototype.refreshItem=function(e){var t=this.graph;(0,h.isString)(e)&&(e=t.findById(e)),t.emit("beforeitemrefresh",{item:e}),e.refresh(),t.emit("afteritemrefresh",{item:e})},i.prototype.addCombos=function(e,t){var r=this,n=this.graph;(e||[]).forEach(function(o){xo(o,function(s){var u;return t.forEach(function(f){f.id===s.id&&(f.children=s.children,f.depth=s.depth,u=f)}),u&&r.addItem("combo",u),!0})});var a=n.get("comboGroup");a&&a.sort()},i.prototype.changeItemVisibility=function(e,t){var r=this,n=this.graph;if((0,h.isString)(e)&&(e=n.findById(e)),!e){console.warn("The item to be shown or hidden does not exist!");return}if(n.emit("beforeitemvisibilitychange",{item:e,visible:t}),e.changeVisibility(t),e.getType&&e.getType()===Vd){var a=e.getEdges();(0,h.each)(a,function(c){t&&!(c.get("source").isVisible()&&c.get("target").isVisible())||r.changeItemVisibility(c,t)})}else if(e.getType&&e.getType()===xd){var o=n.get("comboTrees"),s=e.get("id"),u=[],f=!1;(o||[]).forEach(function(l){f||!l.children||l.children.length===0||ji(l,function(_){return _.id===s?(u=_.children,f=!0,!1):!0})}),u&&(!t||t&&!e.getModel().collapsed)&&u.forEach(function(l){var _=n.findById(l.id);r.changeItemVisibility(_,t)});var a=e.getEdges();(0,h.each)(a,function(l){t&&!(l.get("source").isVisible()&&l.get("target").isVisible())||r.changeItemVisibility(l,t)})}return n.emit("afteritemvisibilitychange",{item:e,visible:t}),e},i.prototype.destroy=function(){this.graph=null,this.destroyed=!0},i}(),nm=rm,am=function(){function i(e){this.graph=e,this.destroyed=!1}return i.prototype.updateState=function(e,t,r){var n=this.graph.get("states"),a=t;(0,h.isString)(r)&&(a="".concat(t,":").concat(r)),n[a]||(n[a]=[]),r?n[a].push(e):n[a]=n[a].filter(function(o){return o!==e}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:n})},i.prototype.updateStates=function(e,t,r){var n=this.graph.get("states"),a=(0,h.isString)(t)?[t]:t;a.forEach(function(o){var s=o;n[s]||(n[s]=[]),(0,h.isString)(r)&&(s="".concat(o,":").concat(r)),r?n[s].push(e):n[s]=n[s].filter(function(u){return u!==e})}),this.graph.set("states",n),this.graph.emit("graphstatechange",{states:t})},i.prototype.destroy=function(){this.graph=null,this.destroyed=!0},i}(),im=am,om=function(e,t){return!e||!t?e:e.replace(/\\?\{([^{}]+)\}/g,function(r,n){if(r.charAt(0)==="\\")return r.slice(1);var a=t[n];return a===0&&(a="0"),a||""})},Zv=function(e){var t=[];if(e.length<2)throw new Error("point length must largn than 2, now it's ".concat(e.length));for(var r=0,n=e;r0?o-1:t-1,u=Yt.normalize([0,0],Yt.add([0,0],a[s].v,Yt.scale([0,0],a[o].v,-1)));a[o].p=Yt.add([0,0],a[o].p,Yt.scale([0,0],u,e))}return a.map(function(f){var c=f.p;return{x:c[0],y:c[1]}})}var um=function(e,t){for(var r=[],n=0;n<5;n++){var a=Math.cos((18+72*n)/180*Math.PI)*e,o=Math.sin((18+72*n)/180*Math.PI)*e,s=Math.cos((54+72*n)/180*Math.PI)*t,u=Math.sin((54+72*n)/180*Math.PI)*t;n===0?r.push(["M",a,-o]):r.push(["L",a,-o]),r.push(["L",s,-u])}return r.push(["Z"]),r},Jv=function(e,t,r){return(e.y-r.y)*(t.x-r.x)-(e.x-r.x)*(t.y-r.y)},tp=function(e){var t=e.map(function(l){return{x:l.getModel().x,y:l.getModel().y}});t.sort(function(l,_){return l.x===_.x?l.y-_.y:l.x-_.x});for(var r={},n=t.length-1;n>=0;n--){var a=t[n],o=a.x,s=a.y;r["".concat(o,"-").concat(s)]&&t.splice(n,1),r["".concat(o,"-").concat(s)]=!0}if(t.length===1)return t;for(var u=[],n=0;n=2&&Jv(u[u.length-2],u[u.length-1],t[n])<=0;)u.pop();u.push(t[n])}for(var f=[],n=t.length-1;n>=0;n--){for(;f.length>=2&&Jv(f[f.length-2],f[f.length-1],t[n])<=0;)f.pop();f.push(t[n])}f.pop(),u.pop();var c=u.concat(f);return c},fm={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 cm(i,e,t){var r=!1,n=function(u,f){return e.cells[u+f*e.width]},a=function(u,f){var c=0;return n(u-1,f-1)>=t&&(c+=1),n(u,f-1)>t&&(c+=2),n(u-1,f)>t&&(c+=4),n(u,f)>t&&(c+=8),c},o=function(u,f){for(var c=u,l=f,_,I,B=0;B-1){if(!(i[0].x!==c||i[0].y!==l))return!0}else i.push({x:c,y:l});var j=a(c,l);switch(j){case-1:return console.warn("Marched out of bounds"),!0;case 0:case 3:case 2:case 7:c++;break;case 12:case 14:case 4:c--;break;case 6:_===0&&(I===-1?c-=1:c+=1);break;case 1:case 13:case 5:l--;break;case 9:_===1&&(I===0?l-=1:l+=1);break;case 10:case 8:case 11:l++;break;default:return console.warn("Marching squares invalid state: ".concat(j)),!0}}};this.march=function(){for(var s=0;st&&a(s,u)!==15&&(r=o(s,u));return r}}var lm=function(e,t,r){var n=Math.ceil(e/r),a=Math.ceil(t/r),o=new Float32Array(Math.max(0,n*a)).fill(0);return{cells:o,width:n,height:a}},dm=function(e,t,r){var n=null,a=Number.POSITIVE_INFINITY;return t.forEach(function(o){var s={x:e.getModel().x,y:e.getModel().y},u={x:o.getModel().x,y:o.getModel().y},f=Vo(s,u),c=new yi(s.x,s.y,u.x,u.y),l=r.reduce(function(_,I){return Wi(I,c)>0?_+1:_},0);f*Math.pow(l+1,2)=0&&o=1;)Zt/=1.5,se=rp(B,Zt,et,Mt),oe=f(se,o)||f(se,a),_e=c(se,t);se&&!oe&&(!Mt||!_e)&&(o.push(new yi(I.x1,I.y1,se.x,se.y)),o.push(new yi(se.x,se.y,I.x2,I.y2)),s=!0)};ct(!0),s||ct(!1)}}s||a.push(I),u+=1};!s&&o.length;)l()}for(;o.length;)a.push(o.pop());return a};function vm(i,e,t,r,n){var a=dm(i,t,e);if(a===null)return[];var o=function(l){for(var _=[];l.length>0;){var I=l.pop();if(l.length===0){_.push(I);break}var B=l.pop(),j=new yi(I.x1,I.y1,B.x2,B.y2),et=ep(e,j);et?(_.push(I),l.push(B)):l.push(j)}return _},s=new yi(i.getModel().x,i.getModel().y,a.getModel().x,a.getModel().y),u=hm(s,e,r,n),f=o(u);return f}var pm=function(e,t,r){var n=Object.assign(fm,r),a=Ao(e.map(function(ct){return{x:ct.getModel().x,y:ct.getModel().y}}));e=e.sort(function(ct,pt){return Vo({x:ct.getModel().x,y:ct.getModel().y},a)-Vo({x:pt.getModel().x,y:pt.getModel().y},a)});var o=[],s=[];e.forEach(function(ct){var pt=vm(ct,t,o,n.maxRoutingIterations,n.morphBuffer);pt.forEach(function(Mt){s.push(Mt)}),o.push(ct)});for(var u=gm(e,s,n.nodeR0),f=lm(u.width,u.height,n.pixelGroupSize),c=[],l=[],_=0;_1)for(B=Math.floor(I.length/n.skip);B<3&&n.skip>1;)n.skip-=1,B=Math.floor(I.length/n.skip);for(var j=0,et=0;et0)n.nonMemberInfluenceFactor*=.8;else break}return l};function gm(i,e,t){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=[];i.forEach(function(u){n.push(u.getBBox())}),e.forEach(function(u){n.push(u.getBBox())});for(var a=0,o=n;ar.maxX?s.maxX:r.maxX)+t,r.maxY=(s.maxY>r.maxY?s.maxY:r.maxY)+t}return r.width=r.maxX-r.minX,r.height=r.maxY-r.minY,r.x=r.minX,r.y=r.minY,r}function mm(i,e,t,r,n,a){function o(I,B){var j=Math.floor((I-B)/a.pixelGroupSize);return j<0?0:j}function s(I,B){return I*a.pixelGroupSize+B}var u=(a.nodeR0-a.nodeR1)*(a.nodeR0-a.nodeR1),f=(a.edgeR0-a.edgeR1)*(a.edgeR0-a.edgeR1),c=function(B,j){var et=Math.min(o(B.minX,j+r.minX),n.width),ut=Math.min(o(B.minY,j+r.minY),n.height),ct=Math.min(o(B.maxX,-j+r.minX),n.width),pt=Math.min(o(B.maxY,-j+r.minY),n.height);return[et,ut,ct,pt]},l=function(B,j){for(var et=B.getBBox(),ut=c(et,a.nodeR1),ct=ut[0],pt=ut[1],Mt=ut[2],Zt=ut[3],se=pt;seu.y?r?f.topLeft:f.bottomRight:r?f.topRight:f.bottomLeft:o.ys.x?r?f.topLeft:f.bottomRight:r?f.bottomLeft:f.topRight:a.x0?this.cfg.padding+e:10+e,this.cfg.bubbleCfg={nodeR0:this.padding-e,nodeR1:this.padding-e,morphBuffer:this.padding-e}},i.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")},i.prototype.calcPath=function(e,t){var r,n,a;switch(this.type){case"round-convex":r=tp(e),a=Gh(r.map(function(o){return[o.x,o.y]}),this.padding),n=Yo(a);break;case"smooth-convex":r=tp(e),r.length===2?(a=Gh(r.map(function(o){return[o.x,o.y]}),this.padding),n=Yo(a)):r.length>2&&(a=Qv(r.map(function(o){return[o.x,o.y]}),this.padding),n=zh(a));break;case"bubble":r=pm(e,t,this.cfg.bubbleCfg),n=r.length>=2&&zh(r);break;default:}return n},i.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()},i.prototype.addMember=function(e){if(e){(0,h.isString)(e)&&(e=this.graph.findById(e)),this.members.push(e);var t=this.nonMembers.indexOf(e);return t>-1&&this.nonMembers.splice(t,1),this.updateData(this.members,this.nonMembers),!0}},i.prototype.addNonMember=function(e){if(e){(0,h.isString)(e)&&(e=this.graph.findById(e)),this.nonMembers.push(e);var t=this.members.indexOf(e);return t>-1&&this.members.splice(t,1),this.updateData(this.members,this.nonMembers),!0}},i.prototype.removeMember=function(e){if(e){(0,h.isString)(e)&&(e=this.graph.findById(e));var t=this.members.indexOf(e);return t>-1?(this.members.splice(t,1),this.updateData(this.members,this.nonMembers),!0):!1}},i.prototype.removeNonMember=function(e){if(e){(0,h.isString)(e)&&(e=this.graph.findById(e));var t=this.nonMembers.indexOf(e);return t>-1?(this.nonMembers.splice(t,1),this.updateData(this.members,this.nonMembers),!0):!1}},i.prototype.updateData=function(e,t){var r=this;this.group.findById(this.id).remove(),e&&(this.members=e.map(function(n){return(0,h.isString)(n)?r.graph.findById(n):n})),t&&(this.nonMembers=t.map(function(n){return(0,h.isString)(n)?r.graph.findById(n):n})),this.path=this.calcPath(this.members,this.nonMembers),this.render()},i.prototype.updateStyle=function(e){var t=this.group.findById(this.id);t.attr((0,b.__assign)({},e))},i.prototype.updateCfg=function(e){var t=this;this.cfg=(0,h.deepMix)(this.cfg,e),this.id=this.cfg.id,this.group=this.cfg.group,e.members&&(this.members=this.cfg.members.map(function(r){return(0,h.isString)(r)?t.graph.findById(r):r})),e.nonMembers&&(this.nonMembers=this.cfg.nonMembers.map(function(r){return(0,h.isString)(r)?t.graph.findById(r):r})),this.setPadding(),this.setType(),this.path=this.calcPath(this.members,this.nonMembers),this.render()},i.prototype.contain=function(e){var t=this,r;(0,h.isString)(e)?r=this.graph.findById(e):r=e;var n,a=r.getKeyShape();if(r.get("type")==="path")n=Fh(a.attr("path"));else{var o=a.getCanvasBBox();n=[[o.minX,o.minY],[o.maxX,o.minY],[o.maxX,o.maxY],[o.minX,o.maxY]]}return n=n.map(function(s){var u=t.graph.getPointByCanvas(s[0],s[1]);return[u.x,u.y]}),za(n,Fh(this.path))},i.prototype.destroy=function(){this.group.remove(),this.cfg=null},i}(),np=ym,bd=Xt,xm="node",bm=function(i){(0,b.__extends)(e,i);function e(t){var r=i.call(this)||this;return r.sortCombos=(0,h.debounce)(function(){var n=r.get("comboSorted");if(!(!r||r.destroyed||n)){r.set("comboSorted",!0);var a=[],o={},s=r.get("comboTrees");(s||[]).forEach(function(f){ji(f,function(c){return a[c.depth]?a[c.depth].push(c.id):a[c.depth]=[c.id],o[c.id]=c.depth,!0})});var u=r.getEdges().concat(r.get("vedges"));(u||[]).forEach(function(f){var c=f.getModel(),l=o[c.source]||0,_=o[c.target]||0,I=Math.max(l,_);a[I]?a[I].push(c.id):a[I]=[c.id]}),a.forEach(function(f){if(!(!f||!f.length))for(var c=f.length-1;c>=0;c--){var l=r.findById(f[c]);l&&l.toFront()}})}},500,!1),r.cfg=(0,h.deepMix)(r.getDefaultCfg(),t),r.init(),r.animating=!1,r.destroyed=!1,r.cfg.enabledStack&&(r.undoStack=new vo(r.cfg.maxStep),r.redoStack=new vo(r.cfg.maxStep)),r}return e.prototype.init=function(){this.initCanvas();var t=new X0(this),r=new Uo(this),n=new nm(this),a=new im(this);this.set({viewController:t,modeController:r,itemController:n,stateController:a}),this.initLayoutController(),this.initEventController(),this.initGroups(),this.initPlugins()},e.prototype.initGroups=function(){var t=this.get("canvas");if(t){var r=t.get("el"),n=(r||{}).id,a=n===void 0?"g6":n,o=t.addGroup({id:"".concat(a,"-root"),className:ye.rootContainerClassName});if(this.get("groupByTypes")){var s=o.addGroup({id:"".concat(a,"-edge"),className:ye.edgeContainerClassName}),u=o.addGroup({id:"".concat(a,"-node"),className:ye.nodeContainerClassName}),f=o.addGroup({id:"".concat(a,"-combo"),className:ye.comboContainerClassName});f.toBack(),this.set({nodeGroup:u,edgeGroup:s,comboGroup:f})}var c=o.addGroup({id:"".concat(a,"-delegate"),className:ye.delegateContainerClassName});this.set({delegateGroup:c}),this.set("group",o)}},e.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}},e.prototype.set=function(t,r){return(0,h.isPlainObject)(t)?this.cfg=(0,b.__assign)((0,b.__assign)({},this.cfg),t):this.cfg[t]=r,t==="enabledStack"&&r&&!this.undoStack&&!this.redoStack&&(this.undoStack=new vo(this.cfg.maxStep),this.redoStack=new vo(this.cfg.maxStep)),this},e.prototype.get=function(t){var r;return(r=this.cfg)===null||r===void 0?void 0:r[t]},e.prototype.getGroup=function(){return this.get("group")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.getMinZoom=function(){return this.get("minZoom")},e.prototype.setMinZoom=function(t){return this.set("minZoom",t)},e.prototype.getMaxZoom=function(){return this.get("maxZoom")},e.prototype.setMaxZoom=function(t){return this.set("maxZoom",t)},e.prototype.getWidth=function(){return this.get("width")},e.prototype.getHeight=function(){return this.get("height")},e.prototype.clearItemStates=function(t,r){(0,h.isString)(t)&&(t=this.findById(t));var n=this.get("itemController");r||(r=t.get("states")),n.clearItemStates(t,r);var a=this.get("stateController");a.updateStates(t,r,!1)},e.prototype.node=function(t){typeof t=="function"&&this.set("nodeMapper",t)},e.prototype.edge=function(t){typeof t=="function"&&this.set("edgeMapper",t)},e.prototype.combo=function(t){typeof t=="function"&&this.set("comboMapper",t)},e.prototype.findById=function(t){return this.get("itemMap")[t]},e.prototype.find=function(t,r){var n,a=this.get("".concat(t,"s"));return(0,h.each)(a,function(o,s){if(r(o,s))return n=o,n}),n},e.prototype.findAll=function(t,r){var n=[];return(0,h.each)(this.get("".concat(t,"s")),function(a,o){r(a,o)&&n.push(a)}),n},e.prototype.findAllByState=function(t,r,n){return n?this.findAll(t,function(a){return a.hasState(r)&&n(a)}):this.findAll(t,function(a){return a.hasState(r)})},e.prototype.translate=function(t,r,n,a){var o=this,s=this.get("group"),u=(0,h.clone)(s.getMatrix());if(u||(u=[1,0,0,0,1,0,0,0,1]),n){var f=ws({animateCfg:a,callback:function(){return o.emit("viewportchange",{action:"translate",matrix:s.getMatrix()})}});oa(s,{x:s.getCanvasBBox().x+t,y:s.getCanvasBBox().y+r},n,f||{duration:500,easing:"easeCubic"})}else u=bd(u,[["t",t,r]]),s.setMatrix(u),this.emit("viewportchange",{action:"translate",matrix:u}),this.autoPaint()},e.prototype.moveTo=function(t,r,n,a){var o=this.get("group");oa(o,{x:t,y:r},n,a||{duration:500,easing:"easeCubic"}),this.emit("viewportchange",{action:"move",matrix:o.getMatrix()})},e.prototype.fitView=function(t,r,n,a){t&&this.set("fitViewPadding",t);var o=this.get("viewController");r?o.fitViewByRules(r,n,a):o.fitView(n,a),this.autoPaint()},e.prototype.fitCenter=function(t,r){var n=this.get("viewController");n.fitCenter(t,r),this.autoPaint()},e.prototype.addBehaviors=function(t,r){var n=this.get("modeController");return n.manipulateBehaviors(t,r,!0),this},e.prototype.removeBehaviors=function(t,r){var n=this.get("modeController");return n.manipulateBehaviors(t,r,!1),this},e.prototype.updateBehavior=function(t,r,n){var a=this.get("modeController");return a.updateBehavior(t,r,n),this},e.prototype.zoom=function(t,r,n,a){var o=this,s=this.get("group"),u=(0,h.clone)(s.getMatrix())||[1,0,0,0,1,0,0,0,1],f=this.get("minZoom"),c=this.get("maxZoom"),l=this.getZoom()||1,_=l*t,I=t,B=!1;if(f&&_c&&(I=c/l,B=!0),r?u=bd(u,[["t",-r.x,-r.y],["s",I,I],["t",r.x,r.y]]):u=bd(u,[["s",I,I]]),n){var j=(0,h.clone)(s.getMatrix());j||(j=[1,0,0,0,1,0,0,0,1]);var et=j[0],ut=et*I,ct=ws({animateCfg:a,callback:function(){return o.emit("viewportchange",{action:"zoom",matrix:s.getMatrix()})}});s.animate(function(pt){if(pt===1)j=u;else{var Mt=io(et,ut,pt)/j[0];r?j=bd(j,[["t",-r.x,-r.y],["s",Mt,Mt],["t",r.x,r.y]]):j=bd(j,[["s",Mt,Mt]])}return{matrix:j}},ct)}else s.setMatrix(u),this.emit("viewportchange",{action:"zoom",matrix:u}),this.autoPaint();return!B},e.prototype.zoomTo=function(t,r,n,a){var o=t/this.getZoom();return this.zoom(o,r,n,a)},e.prototype.focusItem=function(t,r,n){var a=this.get("viewController"),o=!1;r?o=!0:r===void 0&&(o=this.get("animate"));var s={};n?s=n:n===void 0&&(s=this.get("animateCfg")),a.focus(t,o,s),this.autoPaint()},e.prototype.focusItems=function(t,r,n,a){var o=this.get("viewController");o.focusItems(t,r,n,a)},e.prototype.autoPaint=function(){this.get("autoPaint")&&this.paint()},e.prototype.paint=function(){this.emit("beforepaint"),this.get("canvas").draw(),this.emit("afterpaint")},e.prototype.getPointByClient=function(t,r){var n=this.get("viewController");return n.getPointByClient(t,r)},e.prototype.getClientByPoint=function(t,r){var n=this.get("viewController");return n.getClientByPoint(t,r)},e.prototype.getPointByCanvas=function(t,r){var n=this.get("viewController");return n.getPointByCanvas(t,r)},e.prototype.getCanvasByPoint=function(t,r){var n=this.get("viewController");return n.getCanvasByPoint(t,r)},e.prototype.getGraphCenterPoint=function(){var t=this.get("group").getCanvasBBox();return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2}},e.prototype.getViewPortCenterPoint=function(){return this.getPointByCanvas(this.get("width")/2,this.get("height")/2)},e.prototype.showItem=function(t,r){r===void 0&&(r=!0);var n=this.get("itemController"),a=n.changeItemVisibility(t,!0);if(r&&this.get("enabledStack")){var o=a.getID(),s=a.getType(),u={},f={};switch(s){case"node":u.nodes=[{id:o,visible:!1}],f.nodes=[{id:o,visible:!0}];break;case"edge":u.nodes=[{id:o,visible:!1}],f.edges=[{id:o,visible:!0}];break;case"combo":u.nodes=[{id:o,visible:!1}],f.combos=[{id:o,visible:!0}];break;default:break}this.pushStack("visible",{before:u,after:f})}},e.prototype.hideItem=function(t,r){r===void 0&&(r=!0);var n=this.get("itemController"),a=n.changeItemVisibility(t,!1);if(r&&this.get("enabledStack")){var o=a.getID(),s=a.getType(),u={},f={};switch(s){case"node":u.nodes=[{id:o,visible:!0}],f.nodes=[{id:o,visible:!1}];break;case"edge":u.nodes=[{id:o,visible:!0}],f.edges=[{id:o,visible:!1}];break;case"combo":u.nodes=[{id:o,visible:!0}],f.combos=[{id:o,visible:!1}];break;default:break}this.pushStack("visible",{before:u,after:f})}},e.prototype.refreshItem=function(t){var r=this.get("itemController");r.refreshItem(t)},e.prototype.setAutoPaint=function(t){var r=this;r.set("autoPaint",t);var n=r.get("canvas");n.set("autoDraw",t)},e.prototype.remove=function(t,r){r===void 0&&(r=!0),this.removeItem(t,r)},e.prototype.removeItem=function(t,r){r===void 0&&(r=!0);var n=t;if((0,h.isString)(t)&&(n=this.findById(t)),!n&&(0,h.isString)(t))console.warn("The item ".concat(t," to be removed does not exist!"));else if(n){var a="";if(n.getType&&(a=n.getType()),r&&this.get("enabledStack")){var o=(0,b.__assign)((0,b.__assign)({},n.getModel()),{itemType:a}),s={};switch(a){case"node":{s.nodes=[o],s.edges=[];for(var u=n.getEdges(),f=u.length-1;f>=0;f--)s.edges.push((0,b.__assign)((0,b.__assign)({},u[f].getModel()),{itemType:"edge"}));break}case"edge":s.edges=[o];break;case"combo":s.combos=[o];break;default:break}this.pushStack("delete",{before:s,after:{}})}if(a==="node"){var c=n.getModel();c.comboId&&this.updateComboTree(n,void 0,!1)}var l=this.get("itemController");if(l.removeItem(n),a==="combo"){var _=Js(this.get("comboTrees"));this.set("comboTrees",_)}}},e.prototype.innerAddItem=function(t,r,n){if(!_u(t,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,o=this.get("comboTrees")||[];if(t==="combo"){var s=this.get("itemMap"),u=!1;if(o.forEach(function(B){u||xo(B,function(j){if(r.parentId===j.id){u=!0;var et=(0,b.__assign)({id:r.id,depth:j.depth+2},r);j.children?j.children.push(et):j.children=[et],r.depth=et.depth,a=n.addItem(t,r)}var ut=s[j.id];return u&&ut&&ut.getType&&ut.getType()==="combo"&&n.updateCombo(ut,j.children),!0})}),!u){var f=(0,b.__assign)({id:r.id,depth:0},r);r.depth=f.depth,o.push(f),a=n.addItem(t,r)}this.set("comboTrees",o),r.collapsed&&(this.collapseCombo(a,!1),this.updateCombo(a))}else if(t==="node"&&(0,h.isString)(r.comboId)&&o){var c=this.findById(r.comboId);c&&c.getType&&c.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(t,r);var l=this.get("itemMap"),_=!1,I=!1;o.forEach(function(B){I||_||xo(B,function(j){if(j.id===r.id)return I=!0,!1;if(r.comboId===j.id&&!I){_=!0;var et=(0,h.clone)(r);et.itemType="node",j.children?j.children.push(et):j.children=[et],et.depth=j.depth+1}return _&&l[j.id].getType&&l[j.id].getType()==="combo"&&n.updateCombo(l[j.id],j.children),!0})})}else a=n.addItem(t,r);if(t==="node"&&r.comboId||t==="combo"&&r.parentId){var c=this.findById(r.comboId||r.parentId);c&&c.getType&&c.getType()==="combo"&&c.addChild(a)}return a},e.prototype.addItem=function(t,r,n,a){n===void 0&&(n=!0),a===void 0&&(a=!0);var o=this.get("comboSorted");this.set("comboSorted",o&&!a);var s=this.get("itemController"),u=this.innerAddItem(t,r,s);if(u===!1||u===!0)return u;var f=this.get("combos");if(f&&f.length>0&&this.sortCombos(),this.autoPaint(),n&&this.get("enabledStack")){var c=(0,b.__assign)((0,b.__assign)({},u.getModel()),{itemType:t}),l={};switch(t){case"node":l.nodes=[c];break;case"edge":l.edges=[c];break;case"combo":l.combos=[c];break;default:break}this.pushStack("add",{before:{},after:l})}return u},e.prototype.addItems=function(t,r,n){t===void 0&&(t=[]),r===void 0&&(r=!0),n===void 0&&(n=!0);var a=this.get("comboSorted");this.set("comboSorted",a&&!n);for(var o=this.get("itemController"),s=[],u=0;u0&&this.sortCombos()}if(this.autoPaint(),r&&this.get("enabledStack")){for(var l={nodes:[],edges:[],combos:[]},u=0;u=0;et--)B[et].destroyed&&B.splice(et,1);_&&(o.addCombos(_),this.get("groupByTypes")||this.sortCombos()),this.diffItems("edge",l,s.edges),(0,h.each)(c,function(ct,pt){ct.getType&&(ct.getType()==="node"||ct.getType()==="combo")||l.edges.indexOf(ct)<0&&(delete c[pt],o.remove(ct,!1))}),(this.get("comboTrees")||[]).forEach(function(ct){xo(ct,function(pt){var Mt=n.findById(pt.id);return Mt.getType()==="combo"&&pt.collapsed&&n.collapseCombo(pt.id,!1),!0})}),this.set({nodes:l.nodes,edges:l.edges});var ut=this.get("layoutController");return ut&&(ut.changeData(function(){setTimeout(function(){var ct;(ct=o.getCombos())===null||ct===void 0||ct.forEach(function(pt){pt.set("animate",!0)})},0)}),o.get("animate")&&!ut.getLayoutType()?(o.positionsAnimate(),(a=o.getCombos())===null||a===void 0||a.forEach(function(ct){return ct.set("animate",!0)})):o.autoPaint()),setTimeout(function(){u.set("localRefresh",f)},16),this.set("data",s),this.emit("afterchangedata"),this},e.prototype.addCombos=function(t){var r=this,n=r.get("comboTrees"),a=this.get("itemController");a.addCombos(n,t)},e.prototype.createCombo=function(t,r,n){var a=this;n===void 0&&(n=!0);var o=this.get("itemController");this.set("comboSorted",!1);var s="",u;if(t){if((0,h.isString)(t))s=t,u={id:t};else{if(s=t.id,!s){console.warn("Create combo failed. Please assign a unique string id for the adding combo.");return}u=t}var f=n&&this.get("enabledStack"),c={nodes:[],combos:[]};f&&r.forEach(function(ut){var ct=a.findById(ut),pt=ct.getType();if(!(pt!=="node"&&pt!=="combo")){var Mt=ct.getModel();c["".concat(pt,"s")].push({id:ut,parentId:pt==="node"?Mt.comboId:Mt.parentId})}});var l=this.get("comboTrees"),_=new Set(r),I=new Map;l&&(l.forEach(function(ut){xo(ut,function(ct,pt,Mt){if(_.has(ct.id)){if(pt){var Zt=a.findById(pt.id),se=a.findById(ct.id);pt.children.splice(Mt,1),Zt.removeChild(se),o.updateCombo(Zt,pt.children)}ct.itemType==="combo"&&I.set(ct.id,ct)}return!0})}),l=l.filter(function(ut){return!_.has(ut.id)}),this.set("comboTrees",l));var B={nodes:[],combos:[]},j=r.map(function(ut){var ct=a.findById(ut),pt=ct.getModel(),Mt="";ct.getType&&(Mt=ct.getType());var Zt=I.get(ut)||{id:ct.getID(),itemType:Mt};return Mt==="combo"?(Zt.parentId=s,pt.parentId=s):Mt==="node"&&(Zt.comboId=s,pt.comboId=s),f&&B["".concat(Mt,"s")].push({id:pt.id,parentId:s}),Zt});u.children=j,this.addItem("combo",u,!1),this.set("comboSorted",!1),l&&(l.forEach(function(ut){ji(ut,function(ct){return ct.id===s?(ct.itemType="combo",ct.children=j,!1):!0})}),this.sortCombos()),f&&(B.combos.push(u),this.pushStack("createCombo",{before:c,after:B}));var et=this.findById(s);!et.getModel().parentId&&et.getChildren().combos.length&&this.updateComboTree(et,void 0,!1),setTimeout(function(){et.set("animate",!0)},0)}},e.prototype.uncombo=function(t,r){var n=this,a,o;r===void 0&&(r=!0);var s=this,u=t;if((0,h.isString)(t)&&(u=this.findById(t)),!u||u.getType&&u.getType()!=="combo"){console.warn("The item is not a combo!");return}var f=u.getModel(),c=u.getModel().parentId,l=s.get("comboTrees");l||(l=[]);var _=this.get("itemMap"),I=u.get("id"),B,j=[],et=this.get("combos"),ut=this.findById(c),ct=r&&this.get("enabledStack"),pt={};if(ct&&(pt=(0,h.clone)(f),pt.children=[]),l.forEach(function(oe){B||xo(oe,function(_e){var Ue;if(_e.id===I){B=_e;var Re=u.getEdges().map(function(nn){return nn.getID()});Re.forEach(function(nn){n.removeItem(nn,!1)});var qe=et.indexOf(u);et.splice(qe,1),delete _[I];var hr=(0,h.clone)(u.getModel());u.destroy(),n.emit("afterremoveitem",{item:hr,type:"combo"})}if(c&&B&&_e.id===c){ut.removeCombo(u),j=_e.children;var qe=j.indexOf(B);return qe!==-1&&j.splice(qe,1),(Ue=B.children)===null||Ue===void 0||Ue.forEach(function(kn){var En=n.findById(kn.id),Kr=En.getModel();En.getType&&En.getType()==="combo"?(kn.parentId=c,delete kn.comboId,Kr.parentId=c,delete Kr.comboId):En.getType&&En.getType()==="node"&&(kn.comboId=c,Kr.comboId=c),ut.addChild(En),j.push(kn)}),n.updateCombo(ut),!1}return!0})}),!c&&B){var Mt=l.indexOf(B);l.splice(Mt,1),(a=B.children)===null||a===void 0||a.forEach(function(oe){oe.parentId=void 0;var _e=n.findById(oe.id).getModel();delete _e.parentId,delete _e.comboId,oe.itemType!=="node"&&l.push(oe)})}if(ct){var Zt={nodes:[],combos:[]},se={nodes:[],combos:[]};(o=B.children)===null||o===void 0||o.forEach(function(oe){var _e=n.findById(oe.id),Ue=_e.getType();Ue!=="node"&&Ue!=="combo"||(Zt["".concat(Ue,"s")].push({id:oe.id,parentId:I}),se["".concat(Ue,"s")].push({id:oe.id,parentId:c}))}),Zt.combos.push(pt),this.pushStack("uncombo",{before:Zt,after:se})}},e.prototype.updateCombos=function(t){var r=this;t===void 0&&(t=!1);var n=this,a=this.get("comboTrees"),o=n.get("itemController"),s=n.get("itemMap");(a||[]).forEach(function(u){xo(u,function(f){var c;if(!f)return!0;var l=s[f.id];if(((c=l==null?void 0:l.getType)===null||c===void 0?void 0:c.call(l))==="combo"){var _=(0,b.__spreadArray)([],l.getStates(),!0);(0,h.each)(_,function(I){return r.setItemState(l,I,!1)}),o.updateCombo(l,f.children,t),(0,h.each)(_,function(I){return r.setItemState(l,I,!0)})}return!0})}),n.sortCombos()},e.prototype.updateCombo=function(t){var r=this,n=this,a=t,o;if((0,h.isString)(t)&&(a=this.findById(t)),!a||a.getType&&a.getType()!=="combo"){console.warn("The item to be updated is not a combo!");return}o=a.get("id");var s=this.get("comboTrees"),u=n.get("itemController"),f=n.get("itemMap");(s||[]).forEach(function(c){xo(c,function(l){if(!l)return!0;var _=f[l.id];if(o===l.id&&_&&_.getType&&_.getType()==="combo"){var I=(0,b.__spreadArray)([],_.getStates(),!0);(0,h.each)(I,function(B){_.getStateStyle(B)&&r.setItemState(_,B,!1)}),u.updateCombo(_,l.children),(0,h.each)(I,function(B){_.getStateStyle(B)&&r.setItemState(_,B,!0)}),o&&(o=l.parentId)}return!0})})},e.prototype.updateComboTree=function(t,r,n){n===void 0&&(n=!0);var a=this;this.set("comboSorted",!1);var o;(0,h.isString)(t)?o=a.findById(t):o=t;var s=o.getModel(),u=s.comboId||s.parentId,f="";if(o.getType&&(f=o.getType()),r&&f==="combo"){var c=this.get("comboTrees"),l=!0,_;if((c||[]).forEach(function(ct){_||ji(ct,function(pt){if(!_)return pt.id===o.getID()&&(_=pt),!0})}),ji(_,function(ct){return ct.id===r?(l=!1,!1):!0}),!l){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={},B={};f==="combo"?(I.combos=[{id:s.id,parentId:s.parentId}],B.combos=[{id:s.id,parentId:r}]):f==="node"&&(I.nodes=[{id:s.id,parentId:s.comboId}],B.nodes=[{id:s.id,parentId:r}]),this.pushStack("updateComboTree",{before:I,after:B})}if(s.parentId||s.comboId){var j=this.findById(s.parentId||s.comboId);j&&j.removeChild(o)}if(f==="combo"?s.parentId=r:f==="node"&&(s.comboId=r),r){var et=this.findById(r);et&&et.addChild(o)}if(u){var et=this.findById(u);et&&et.removeChild(o)}var ut=Js(this.get("comboTrees"),s.id,r);this.set("comboTrees",ut),this.updateCombos()},e.prototype.save=function(){var t=[],r=[],n=[];return(0,h.each)(this.get("nodes"),function(a){t.push(a.getModel())}),(0,h.each)(this.get("edges"),function(a){r.push(a.getModel())}),(0,h.each)(this.get("combos"),function(a){n.push(a.getModel())}),{nodes:t,edges:r,combos:n}},e.prototype.changeSize=function(t,r){var n=this.get("viewController");return n.changeSize(t,r),this},e.prototype.refresh=function(){var t=this;if(t.emit("beforegraphrefresh"),t.get("animate"))t.positionsAnimate();else{var r=t.get("nodes"),n=t.get("edges"),a=t.get("edges");(0,h.each)(r,function(o){o.refresh()}),(0,h.each)(n,function(o){o.refresh()}),(0,h.each)(a,function(o){o.refresh()})}t.emit("aftergraphrefresh"),t.autoPaint()},e.prototype.getNodes=function(){return this.get("nodes")},e.prototype.getEdges=function(){return this.get("edges")},e.prototype.getCombos=function(){return this.get("combos")},e.prototype.getComboChildren=function(t){if((0,h.isString)(t)&&(t=this.findById(t)),!t||t.getType&&t.getType()!=="combo"){console.warn("The combo does not exist!");return}return t.getChildren()},e.prototype.positionsAnimate=function(t){var r=this;r.emit("beforeanimate");var n=r.get("animateCfg"),a=n.onFrame,o=t?r.getNodes().concat(r.getCombos()):r.getNodes(),s=o.map(function(f){var c=f.getModel();return{id:c.id,x:c.x,y:c.y}});r.stopAnimate();var u=r.get("canvas");r.animating=!0,setTimeout(function(){u.animate(function(f){(0,h.each)(s,function(c){var l=r.findById(c.id);if(!(!l||l.destroyed)){var _=l.get("originAttrs"),I=l.get("model"),B=l.getContainer().getMatrix();if(_==null&&(B&&(_={x:B[6],y:B[7]}),l.set("originAttrs",_||0)),a){var j=a(l,f,c,_||{x:0,y:0});l.set("model",Object.assign(I,j))}else _?(I.x=_.x+(c.x-_.x)*f,I.y=_.y+(c.y-_.y)*f):(I.x=c.x,I.y=c.y)}}),r.refreshPositions(t)},{duration:n.duration,easing:n.easing,callback:function(){(0,h.each)(o,function(c){c.set("originAttrs",null)}),n.callback&&n.callback(),r.emit("afteranimate"),r.animating=!1}})},0)},e.prototype.refreshPositions=function(t){var r=this;r.emit("beforegraphrefreshposition");var n=r.get("nodes"),a=r.get("edges"),o=r.get("vedges"),s=r.get("combos"),u,f={},c=function(_){(0,h.each)(_,function(I){u=I.getModel();var B=I.get("originAttrs");if(!(B&&u.x===B.x&&u.y===B.y)){var j=I.updatePosition({x:u.x,y:u.y});f[u.id]=j,u.comboId&&(f[u.comboId]=f[u.comboId]||j),u.parentId&&(f[u.parentId]=f[u.parentId]||j)}})};c(s),c(n),s&&s.length!==0&&(t&&c(s),r.updateCombos()),(0,h.each)(a,function(l){var _=l.getSource().getModel(),I=l.getTarget();if(!(0,h.isPlainObject)(I)){var B=I.getModel();(f[_.id]||f[B.id]||l.getModel().isComboEdge)&&l.refresh()}}),(0,h.each)(o,function(l){l.refresh()}),r.emit("aftergraphrefreshposition"),r.autoPaint()},e.prototype.stopAnimate=function(){var t=this.get("canvas"),r=t.cfg.timeline;r&&r.stopAllAnimations()},e.prototype.isAnimating=function(){return this.animating},e.prototype.getZoom=function(){var t=this.get("group").getMatrix();return t?t[0]:1},e.prototype.getCurrentMode=function(){var t=this.get("modeController");return t.getMode()},e.prototype.setMode=function(t){var r=this.get("modeController");return r.setMode(t),this},e.prototype.clear=function(t){var r;return t===void 0&&(t=!1),(r=this.get("canvas"))===null||r===void 0||r.clear(),this.initGroups(),this.set({itemMap:{},nodes:[],edges:[],vedges:[],groups:[],combos:[],comboTrees:[]}),t||this.emit("afterrender"),this},e.prototype.updateLayout=function(t,r,n,a){var o=this;t===void 0&&(t={}),a===void 0&&(a=!0);var s=this.get("layoutController");if((0,h.isString)(t)&&(t={type:t}),r){var u=n;u||(r==="begin"?u={x:0,y:0}:u={x:this.getWidth()/2,y:this.getHeight()/2}),u=this.getPointByCanvas(u.x,u.y);var f=["force","gForce","fruchterman","force2"];f.includes(t.type)||!t.type&&f.includes(s==null?void 0:s.layoutType)?t.center=[u.x,u.y]:this.once("afterlayout",function(_){var I=o.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];u.x=u.x*I[0]+I[6],u.y=u.y*I[0]+I[7];var B=o.getGroup().getCanvasBBox(),j=B.minX,et=B.maxX,ut=B.minY,ct=B.maxY,pt={x:(j+et)/2,y:(ut+ct)/2};r==="begin"&&(pt.x=j,pt.y=ut),o.translate(u.x-pt.x,u.y-pt.y)})}var c=(0,b.__assign)({},this.get("layout")),l={};Object.assign(l,c,t),t.pipes&&!t.type?delete l.type:!t.pipes&&l.type&&delete l.pipes,this.set("layout",l),s&&(s.isLayoutTypeSame(l)&&l.gpuEnabled===c.gpuEnabled?s.updateLayoutCfg(l):s.changeLayout(l),a&&this.get("enabledStack")&&this.pushStack("layout",{before:c,after:l}))},e.prototype.destroyLayout=function(){var t=this.get("layoutController");t==null||t.destroyLayout()},e.prototype.layout=function(){var t,r=this.get("layoutController"),n=this.get("layout");if(!(!n||!r)){if(n.workerEnabled){r.layout();return}!((t=r.layoutMethods)===null||t===void 0)&&t.length?r.relayout(!0):r.layout()}},e.prototype.collapseCombo=function(t,r){var n=this;if(r===void 0&&(r=!0),!this.destroyed){if((0,h.isString)(t)&&(t=this.findById(t)),!t){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"collapse",item:t});var a=t.getModel(),o=this.get("itemController");o.collapseCombo(t,r),a.collapsed=!0;var s=this.getEdges().concat(this.get("vedges")),u=[],f=this.get("comboTrees"),c=!1;(f||[]).forEach(function(_){c||ji(_,function(I){if(c&&I.depth<=a.depth)return!1;if(a.id===I.id&&(c=!0),c){var B=n.findById(I.id);B&&B.getType&&B.getType()==="combo"&&(u=u.concat(B.getNodes()),u=u.concat(B.getCombos()))}return!0})});var l={};s.forEach(function(_){var I=_.getModel(),B=I.isVEdge,j=I.size,et=j===void 0?1:j;if(!(_.isVisible()&&!B)){var ut=_.getSource(),ct=_.getTarget(),pt=null,Mt;if(ut.getModel().id===a.id||u.includes(ut)&&!u.includes(ct)?(pt=ct,Mt=!1):(ct.getModel().id===a.id||!u.includes(ut)&&u.includes(ct))&&(pt=ut,Mt=!0),pt){if(B){n.removeItem(_,!1);return}for(var Zt=pt.getModel();!pt.isVisible();){var se=Zt.parentId,oe=Zt.comboId,_e=se||oe;if(pt=n.findById(_e),!pt||!_e)return;Zt=pt.getModel()}var Ue=Zt.id,Re=Mt?{source:Ue,target:a.id,size:et,isVEdge:!0}:{source:a.id,target:Ue,size:et,isVEdge:!0},qe="".concat(Re.source,"-").concat(Re.target);if(l[qe]){l[qe].size+=et;return}l[qe]=Re}}}),this.addItems(Object.values(l).map(function(_){return{type:"vedge",model:_}}),!1),this.emit("aftercollapseexpandcombo",{action:"collapse",item:t})}},e.prototype.expandCombo=function(t,r){var n=this;if(r===void 0&&(r=!0),(0,h.isString)(t)&&(t=this.findById(t)),!t||t.getType&&t.getType()!=="combo"){console.warn("The combo to be collapsed does not exist!");return}this.emit("beforecollapseexpandcombo",{action:"expand",item:t});var a=t.getModel(),o=this.get("itemController");o.expandCombo(t,r),a.collapsed=!1;var s=this.getEdges().concat(this.get("vedges")),u=[],f=this.get("comboTrees"),c=!1;(f||[]).forEach(function(_){c||ji(_,function(I){if(c&&I.depth<=a.depth)return!1;if(a.id===I.id&&(c=!0),c){var B=n.findById(I.id);B&&B.getType&&B.getType()==="combo"&&(u=u.concat(B.getNodes()),u=u.concat(B.getCombos()))}return!0})});var l={};s.forEach(function(_){if(!(_.isVisible()&&!_.getModel().isVEdge)){var I=_.getSource(),B=_.getTarget(),j=I.get("id"),et=B.get("id"),ut=null,ct;if(j===a.id||u.includes(I)&&!u.includes(B)?(ut=B,ct=!1):et===a.id||!u.includes(I)&&u.includes(B)?(ut=I,ct=!0):u.includes(I)&&u.includes(B)&&I.isVisible()&&B.isVisible()&&_.show(),ut){var pt=_.getModel(),Mt=pt.isVEdge,Zt=pt.size,se=Zt===void 0?1:Zt;if(Mt){n.removeItem(_,!1);return}for(var oe=ut.getModel();!ut.isVisible();){var _e=oe.parentId,Ue=oe.comboId,Re=_e||Ue;if(ut=n.findById(Re),!ut||!Re)return;oe=ut.getModel()}for(var qe=oe.id,hr=ct?B:I,nn=hr.getModel();!hr.isVisible();){var kn=nn.parentId,En=nn.comboId,Kr=kn||En;if(hr=n.findById(Kr),!hr||!Kr)return;if(nn.comboId===a.id||nn.parentId===a.id)break;nn=hr.getModel()}var ta=nn.id;if(qe){var $n=ct?{source:qe,target:ta,isVEdge:!0,size:se}:{source:ta,target:qe,isVEdge:!0,size:se},$r="".concat($n.source,"-").concat($n.target);if(l[$r]){l[$r].size+=se;return}l[$r]=$n}}}}),this.addItems(Object.values(l).map(function(_){return{type:"vedge",model:_}}),!1),this.emit("aftercollapseexpandcombo",{action:"expand",item:t})},e.prototype.collapseExpandCombo=function(t,r){if(r===void 0&&(r=!0),(0,h.isString)(t)&&(t=this.findById(t)),!(!t||t.getType&&t.getType()!=="combo")){for(var n=t.getModel(),a=this.findById(n.parentId);a;){var o=a.getModel();if(o.collapsed){console.warn("Fail to expand the combo since it's ancestor combo is collapsed."),a=void 0;return}a=this.findById(o.parentId)}var s=n.collapsed;s?this.expandCombo(t,r):this.collapseCombo(t,r),this.updateCombo(t)}},e.prototype.getNeighbors=function(t,r){var n=t;return(0,h.isString)(t)&&(n=this.findById(t)),n.getNeighbors(r)},e.prototype.getNodeDegree=function(t,r,n){r===void 0&&(r=void 0),n===void 0&&(n=!1);var a=t;(0,h.isString)(t)&&(a=this.findById(t));var o=this.get("degrees");(!o||n)&&(o=Jt(this.save()),this.set("degrees",o));var s=o[a.getID()],u=0;if(!s)return 0;switch(r){case"in":u=s.inDegree;break;case"out":u=s.outDegree;break;case"all":u=s;break;default:u=s.degree;break}return u},e.prototype.getUndoStack=function(){return this.undoStack},e.prototype.getRedoStack=function(){return this.redoStack},e.prototype.getStackData=function(){return this.get("enabledStack")?{undoStack:this.undoStack.toArray(),redoStack:this.redoStack.toArray()}:null},e.prototype.clearStack=function(){this.get("enabledStack")&&(this.undoStack.clear(),this.redoStack.clear(),this.emit("stackchange",{undoStack:this.undoStack,redoStack:this.redoStack}))},e.prototype.pushStack=function(t,r,n){if(t===void 0&&(t="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,h.clone)(r):{before:{},after:(0,h.clone)(this.save())};n==="redo"?this.redoStack.push({action:t,data:a}):this.undoStack.push({action:t,data:a}),this.emit("stackchange",{action:t,stackType:n,undoStack:this.undoStack,redoStack:this.redoStack})},e.prototype.getAdjMatrix=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=this.get("directed"));var n=this.get("adjMatrix");return(!n||!t)&&(n=yt(this.save(),r),this.set("adjMatrix",n)),n},e.prototype.getShortestPathMatrix=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=this.get("directed"));var n=this.get("adjMatrix"),a=this.get("shortestPathMatrix");return(!n||!t)&&(n=yt(this.save(),r),this.set("adjMatrix",n)),(!a||!t)&&(a=xn(this.save(),r),this.set("shortestPathMatrix",a)),a},e.prototype.on=function(t,r,n){return i.prototype.on.call(this,t,r,n)},e.prototype.destroy=function(){var t,r,n,a,o;this.emit("beforedestroy"),this.clear(),this.clearStack(),(t=this.get("itemController"))===null||t===void 0||t.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(),(o=this.get("canvas"))===null||o===void 0||o.destroy(),this.cfg=null,this.destroyed=!0,this.redoStack=null,this.undoStack=null,this.emit("afterdestroy")},e.prototype.createHull=function(t){if(!t.members||t.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[t.id])return console.warn("Existed hull id."),n[t.id];var a=r.addGroup({id:"".concat(t.id,"-container")}),o=new np(this,(0,b.__assign)((0,b.__assign)({},t),{group:a})),s=o.id;return n[s]=o,o},e.prototype.getHulls=function(){return this.get("hullMap")},e.prototype.getHullById=function(t){return this.get("hullMap")[t]},e.prototype.removeHull=function(t){var r,n;(0,h.isString)(t)?n=this.getHullById(t):n=t,(r=this.get("hullMap"))===null||r===void 0||delete r[n.id],n.destroy()},e.prototype.removeHulls=function(){var t=this.getHulls();!t||!Object.keys(t).length||(Object.keys(t).forEach(function(r){var n=t[r];n.destroy()}),this.set("hullMap",{}))},e}(tt),ap=bm;function Uh(i){"@babel/helpers - typeof";return Uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uh(i)}var id=Xt,ip="-shape",Wh="-label",Kd=["startArrow","endArrow"],op={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},Em={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},$d={edge:Em,node:op,combo:op},Yh="-label-bg",Xh={options:{labelCfg:{style:{fontFamily:ye.windowFontFamily}},descriptionCfg:{style:{fontFamily:ye.windowFontFamily}}},itemType:"",type:"",getCustomConfig:function(e){return{}},getOptions:function(e,t){return t==="move"||t!=null&&t.includes("bbox")?e:(0,h.deepMix)({},this.options,this.getCustomConfig(e)||{},e)},draw:function(e,t){t.shapeMap={},this.mergeStyle=this.getOptions(e);var r=this.drawShape(e,t);if(r.set("className",this.itemType+ip),t.shapeMap[this.itemType+ip]=r,e.label){var n=this.drawLabel(e,t);n.set("className",this.itemType+Wh),t.shapeMap[this.itemType+Wh]=n}return r},afterDraw:function(e,t,r){},drawShape:function(e,t){return null},drawLabel:function(e,t){var r=(this.mergeStyle||this.getOptions(e)||{}).labelCfg,n=r||{},a=this.getLabelStyle(e,n,t),o=a.rotate;delete a.rotate;var s=t.addShape("text",{attrs:a,draggable:!0,className:"text-shape",name:"text-shape",labelRelated:!0});if(t.shapeMap["text-shape"]=s,!isNaN(o)&&o!==""){var u=s.getBBox(),f=[1,0,0,0,1,0,0,0,1];if(a.rotateCenter)switch(a.rotateCenter){case"center":f=id(f,[["t",-u.width/2,-u.height/2],["r",o],["t",u.width/2,u.height/2]]);break;case"lefttop":f=id(f,[["t",-a.x,-a.y],["r",o],["t",a.x,a.y]]);break;case"leftcenter":f=id(f,[["t",-a.x,-a.y-u.height/2],["r",o],["t",a.x,a.y+u.height/2]]);break;default:f=id(f,[["t",-u.width/2,-u.height/2],["r",o],["t",u.width/2,u.height/2]]);break}else f=id(f,[["t",-a.x,-a.y-u.height/2],["r",o],["t",a.x,a.y+u.height/2]]);s.setMatrix(f)}if(a.background){var c=this.drawLabelBg(e,t,s),l=this.itemType+Yh;c.set("classname",l),t.shapeMap[l]=c,s.toFront()}return s},drawLabelBg:function(e,t,r){var n=this.options.labelCfg,a=(0,h.mix)({},n,e.labelCfg),o=this.getLabelBgStyleByPosition(r,a),s=t.addShape("rect",{name:"text-bg-shape",attrs:o,labelRelated:!0});return t.shapeMap["text-bg-shape"]=s,s},getLabelStyleByPosition:function(e,t,r){return{text:e.label}},getLabelBgStyleByPosition:function(e,t){return{}},getLabelStyle:function(e,t,r){var n=this.getLabelStyleByPosition(e,t,r),a="".concat(this.itemType,"Label"),o=ye[a]?ye[a].style:null;return(0,b.__assign)((0,b.__assign)((0,b.__assign)({},o),n),t.style)},getShapeStyle:function(e){return e.style},update:function(e,t,r){this.updateShapeStyle(e,t,r),this.updateLabel(e,t,r)},updateShapeStyle:function(e,t,r){var n,a=t.getContainer(),o=t.getKeyShape(),s=(0,h.mix)({},o.attr(),e.style),u=function(l){var _,I=s[l];if((0,h.isPlainObject)(I)){var B=((n=a.shapeMap)===null||n===void 0?void 0:n[l])||a.find(function(j){return j.get("name")===l});B==null||B.attr(I)}else o.attr((_={},_[l]=I,_))};for(var f in s)u(f)},updateLabel:function(e,t,r){var n,a,o=t.getContainer(),s=(this.mergeStyle||this.getOptions({},r)||{}).labelCfg,u=s===void 0?{}:s,f=this.itemType+Wh,c=o.shapeMap[f]||o.find(function(Mt){return Mt.get("className")===f}),l=this.itemType+Yh,_=o.shapeMap[l]||o.find(function(Mt){return Mt.get("className")===l});if(c&&e.label===void 0&&(o.removeChild(c),delete o.shapeMap[f],_&&(o.removeChild(_),delete o.shapeMap[l])),e.label||e.label==="")if(c){(!r||r==="bbox|label"||this.itemType==="edge"&&r!=="style")&&(u=(0,h.deepMix)(u,e.labelCfg));var B=this.getLabelStyleByPosition(e,u,o),j=(n=e.labelCfg)===null||n===void 0?void 0:n.style,et=(0,b.__assign)((0,b.__assign)({},B),j),ut=et.rotate;if(delete et.rotate,!isNaN(ut)&&ut!==""){var ct=[1,0,0,0,1,0,0,0,1];ct=id(ct,[["t",-et.x,-et.y],["r",ut],["t",et.x,et.y]]),et.matrix=ct,c.attr(et)}else((a=c.getMatrix())===null||a===void 0?void 0:a[4])!==1&&c.resetMatrix(),c.attr(et);if(!_)et.background&&(_=this.drawLabelBg(e,o,c),_.set("classname",l),o.shapeMap[l]=_,c.toFront());else if(et.background){var pt=this.getLabelBgStyleByPosition(c,u);_.attr(pt)}else o.removeChild(_)}else{var I=this.drawLabel(e,o);I.set("className",f),o.shapeMap[f]=I}},afterUpdate:function(e,t){},setState:function(e,t,r){var n,a,o,s=r.get("keyShape");if(!(!s||s.destroyed)){var u=r.getType(),f=(0,h.isBoolean)(t)?e:"".concat(e,":").concat(t),c=this.getStateStyle(f,r),l=r.getStateStyle(f);if(!(!l&&!c)){var _=(0,h.mix)({},l||c),I=r.getContainer(),B={x:1,y:1,cx:1,cy:1,matrix:1};if(u==="combo"&&(B.r=1,B.width=1,B.height=1),t){var j=function(Kr){var ta,$n=_[Kr];if((0,h.isPlainObject)($n)&&!Kd.includes(Kr)){var $r=((o=I.shapeMap)===null||o===void 0?void 0:o[Kr])||I.find(function(yn){return yn.get("name")===Kr});$r==null||$r.attr($n)}else s.attr((ta={},ta[Kr]=$n,ta))};for(var et in _)j(et)}else{var ut=Us(r.getCurrentStatesStyle()),ct=r.getModel(),pt=(0,h.mix)({},ct.style,Us(r.getOriginStyle())),Mt=s.get("name"),Zt=s.attr(),se={};Object.keys(Zt).forEach(function(En){if(En!=="img"){var Kr=Zt[En];Kr&&Uh(Kr)==="object"?se[En]=(0,h.clone)(Kr):se[En]=Kr}});var oe={},_e=function(Kr){var ta=_[Kr];if((0,h.isPlainObject)(ta)&&!Kd.includes(Kr)){var $n=I.shapeMap[Kr]||I.find(function(Fn){return Fn.get("name")===Kr});if($n){var $r=Us($n.attr());(0,h.each)(ta,function(Fn,zn){if(Kr===Mt&&se[zn]&&!B[zn]){delete se[zn];var ia=pt[Kr][zn]||$d[u][zn];s.attr(zn,ia)}else if($r[zn]||$r[zn]===0){delete $r[zn];var da=pt[Kr][zn]||$d[u][zn];$n.attr(zn,da)}}),oe[Kr]=$r}}else if(se[Kr]&&!B[Kr]){delete se[Kr];var yn=pt[Kr]||(pt[Mt]?pt[Mt][Kr]:void 0)||$d[u][Kr];s.attr(Kr,yn)}};for(var Ue in _)_e(Ue);Mt?oe[Mt]=se:(0,h.mix)(oe,se);for(var et in ut)if(!B[et]){var Re=ut[et];(!(0,h.isPlainObject)(Re)||Kd.includes(et))&&(Mt?((0,h.mix)(pt[Mt],(a={},a[et]=Re,a)),delete pt[et]):(0,h.mix)(pt,(n={},n[et]=Re,n)),delete ut[et])}var qe={};(0,h.deepMix)(qe,pt,oe,ut);var hr=!1,nn=function(Kr){var ta,$n,$r=qe[Kr];if((0,h.isPlainObject)($r)&&!Kd.includes(Kr)){var yn=I.shapeMap[Kr]||I.find(function(zn){return zn.get("name")===Kr});yn&&((yn.get("type")==="text"||yn.get("labelRelated"))&&(delete $r.x,delete $r.y,delete $r.matrix),Kr===Mt&&(u==="combo"&&(delete $r.r,delete $r.width,delete $r.height),hr=!0),yn.attr($r))}else if(!hr){var Fn=$r||$d[u][Kr];u==="combo"?Mt||s.attr((ta={},ta[Kr]=Fn,ta)):s.attr(($n={},$n[Kr]=Fn,$n))}};for(var kn in qe)nn(kn)}}}},getStateStyle:function(e,t){var r=t.getModel(),n=t.getType(),a=this.getOptions(r),o=a.stateStyles,s=a.style,u=s===void 0?{}:s,f=r.stateStyles?r.stateStyles[e]:o&&o[e];return n==="combo"?(0,h.clone)(f):(0,h.mix)({},u,f)},getControlPoints:function(e){return e.controlPoints},getAnchorPoints:function(e){var t,r,n=(e==null?void 0:e.anchorPoints)||((t=this.getCustomConfig(e))===null||t===void 0?void 0:t.anchorPoints)||((r=this.options)===null||r===void 0?void 0:r.anchorPoints);return n}},wm={itemType:"node",shapeType:"single-node",labelPosition:"center",offset:ye.nodeLabel.offset,getSize:function(e){var t,r=((t=this.mergeStyle)===null||t===void 0?void 0:t.size)||e.size||this.getOptions({}).size||ye.defaultNode.size;return(0,h.isArray)(r)&&r.length===1&&(r=[r[0],r[0]]),(0,h.isArray)(r)||(r=[r,r]),r},getLabelStyleByPosition:function(e,t){var r=t.maxLength,n=e.label;r&&(n=qs(n,r));var a=t.position||this.labelPosition;if(a==="center")return{x:0,y:0,text:n,textBaseline:"middle",textAlign:"center"};var o=t.offset;(0,h.isNil)(o)&&(o=this.offset);var s=this.getSize(e),u;switch(a){case"top":u={x:0,y:-s[1]/2-o,textBaseline:"bottom",textAlign:"center"};break;case"bottom":u={x:0,y:s[1]/2+o,textBaseline:"top",textAlign:"center"};break;case"left":u={x:-s[0]/2-o,y:0,textBaseline:"middle",textAlign:"right"};break;default:u={x:s[0]/2+o,y:0,textBaseline:"middle",textAlign:"left"};break}return u.text=n,u},getLabelBgStyleByPosition:function(e,t){var r;if(!e)return{};var n=(r=t.style)===null||r===void 0?void 0:r.background;if(!n)return{};var a=e.getBBox(),o=Oh(n.padding),s=a.width+o[1]+o[3],u=a.height+o[0]+o[2];return(0,b.__assign)((0,b.__assign)({x:a.minX-o[3],y:a.minY-o[0]},n),{width:s,height:u})},drawShape:function(e,t){var r=this.shapeType,n=this.getShapeStyle(e),a=t.addShape(r,{attrs:n,draggable:!0,name:"node-shape"});return t.shapeMap["node-shape"]=a,a},updateLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,n=t.shapeMap["link-point-left"]||t.find(function(qe){return qe.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(qe){return qe.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(qe){return qe.get("className")==="link-point-top"}),s=t.shapeMap["link-point-bottom"]||t.find(function(qe){return qe.get("className")==="link-point-bottom"}),u;n&&(u=n.attr()),a&&!u&&(u=a.attr()),o&&!u&&(u=o.attr()),s&&!u&&(u=s.attr()),u||(u=r);var f=(0,h.mix)({},u,e.linkPoints),c=f.fill,l=f.stroke,_=f.lineWidth,I=f.size/2;I||(I=f.r);var B=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},j=B.left,et=B.right,ut=B.top,ct=B.bottom,pt=this.getSize(e),Mt=pt[0],Zt=pt[1],se={r:I,fill:c,stroke:l,lineWidth:_};if(n)!j&&j!==void 0?(n.remove(),delete t.shapeMap["link-point-left"]):n.attr((0,b.__assign)((0,b.__assign)({},se),{x:-Mt/2,y:0}));else if(j){var oe="link-point-left";t.shapeMap[oe]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},se),{x:-Mt/2,y:0}),className:oe,name:oe,isAnchorPoint:!0})}if(a)!et&&et!==void 0&&(a.remove(),delete t.shapeMap["link-point-right"]),a.attr((0,b.__assign)((0,b.__assign)({},se),{x:Mt/2,y:0}));else if(et){var _e="link-point-right";t.shapeMap[_e]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},se),{x:Mt/2,y:0}),className:_e,name:_e,isAnchorPoint:!0})}if(o)!ut&&ut!==void 0&&(o.remove(),delete t.shapeMap["link-point-top"]),o.attr((0,b.__assign)((0,b.__assign)({},se),{x:0,y:-Zt/2}));else if(ut){var Ue="link-point-top";t.shapeMap[Ue]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},se),{x:0,y:-Zt/2}),className:Ue,name:Ue,isAnchorPoint:!0})}if(s)!ct&&ct!==void 0?(s.remove(),delete t.shapeMap["link-point-bottom"]):s.attr((0,b.__assign)((0,b.__assign)({},se),{x:0,y:Zt/2}));else if(ct){var Re="link-point-bottom";t.shapeMap[Re]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},se),{x:0,y:Zt/2}),className:Re,name:Re,isAnchorPoint:!0})}},updateShape:function(e,t,r,n,a){var o=t.get("keyShape");o.attr((0,b.__assign)({},r)),this.updateLabel(e,t,a),n&&this.updateIcon(e,t)},updateIcon:function(e,t){var r=this,n=t.getContainer(),a=(this.mergeStyle||this.getOptions(e)).icon,o=e.icon?e.icon:{show:void 0,text:void 0},s=o.show,u=o.text,f=n.shapeMap["".concat(this.type,"-icon")]||n.find(function(ut){return ut.get("name")==="".concat(r.type,"-icon")});if(f)if(s||s===void 0){var c=(0,h.mix)({},f.attr(),a),l=c.width,_=l===void 0?20:l,I=c.height,B=I===void 0?20:I;(c.fontFamily==="iconfont"||c.hasOwnProperty("text"))&&(_=0,B=0),f.attr((0,b.__assign)((0,b.__assign)({},c),{x:-_/2,y:-B/2}))}else f.remove(),delete n.shapeMap["".concat(this.type,"-icon")];else if(s){var j="".concat(this.type,"-icon");if(u)n.shapeMap[j]=n.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},a),className:j,name:j});else{var _=a.width,B=a.height;n.shapeMap[j]=n.addShape("image",{attrs:(0,b.__assign)((0,b.__assign)({},a),{x:-_/2,y:-B/2}),className:j,name:j})}var et=n.shapeMap["node-label"]||n.find(function(ut){return ut.get("name")==="node-label"});et&&et.toFront()}}},Sm=(0,b.__assign)((0,b.__assign)({},Xh),wm);Fs.registerNode("single-node",Sm);var qd="edge-shape";function Mm(i){var e=i;return i==="start"?e="end":i==="end"&&(e="start"),e}var _m={itemType:"edge",labelPosition:"center",refX:0,refY:0,labelAutoRotate:!1,options:{size:ye.defaultEdge.size,style:{x:0,y:0,stroke:ye.defaultEdge.style.stroke,lineAppendWidth:ye.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:ye.edgeLabel.style.fill,fontSize:ye.edgeLabel.style.fontSize,fontFamily:ye.windowFontFamily}},stateStyles:(0,b.__assign)({},ye.edgeStateStyles)},getPath:function(e){var t=[];return(0,h.each)(e,function(r,n){n===0?t.push(["M",r.x,r.y]):t.push(["L",r.x,r.y])}),t},getShapeStyle:function(e){var t=this.options.style,r={stroke:e.color},n=(0,h.mix)({},t,r,e.style),a=e.size||ye.defaultEdge.size;e=this.getPathPoints(e);var o=e.startPoint,s=e.endPoint,u=this.getControlPoints(e),f=[o];u&&(f=f.concat(u)),f.push(s);var c=this.getPath(f),l=(0,h.mix)({},ye.defaultEdge.style,{stroke:ye.defaultEdge.color,lineWidth:a,path:c},n);return l},updateShapeStyle:function(e,t,r){var n,a=t.getContainer(),o=((n=t.getKeyShape)===null||n===void 0?void 0:n.call(t))||a.shapeMap["edge-shape"],s=e.size;e=this.getPathPoints(e);var u=e.startPoint,f=e.endPoint,c=this.getControlPoints(e),l=[u];c&&(l=l.concat(c)),l.push(f);var _=o.attr(),I=e.style||{};I.stroke===void 0&&(I.stroke=e.color);var B=e.sourceNode,j=e.targetNode,et={radius:I.radius};c||(et={source:B,target:j,offset:I.offset,radius:I.radius});var ut=this.getPath(l,et),ct={};r==="move"?ct={path:ut}:(_.endArrow&&I.endArrow===!1&&(e.style.endArrow={path:""}),_.startArrow&&I.startArrow===!1&&(e.style.startArrow={path:""}),ct=(0,b.__assign)({},e.style),ct.lineWidth===void 0&&(ct.lineWdith=((0,h.isNumber)(s)?s:s==null?void 0:s[0])||_.lineWidth),ct.path===void 0&&(ct.path=ut),ct.stroke===void 0&&(ct.stroke=_.stroke||e.color)),o&&o.attr(ct)},getLabelStyleByPosition:function(e,t,r){var n=t.position||this.labelPosition,a={},o=r==null?void 0:r.shapeMap[qd],s;n==="start"?s=0:n==="end"?s=1:s=.5;var u=t.refX||this.refX,f=t.refY||this.refY;if(e.startPoint.x===e.endPoint.x&&e.startPoint.y===e.endPoint.y)return a.x=e.startPoint.x+u,a.y=e.startPoint.y+f,a.text=e.label,a;var c;(0,h.isNil)(t.autoRotate)?c=this.labelAutoRotate:c=t.autoRotate;var l=Go(o,s,u,f,c);return a.x=l.x,a.y=l.y,a.rotate=l.rotate,a.textAlign=this._getTextAlign(n,l.angle),a.text=e.label,a},getLabelBgStyleByPosition:function(e,t){if(!e)return{};var r=e.getBBox(),n=t.style&&t.style.background;if(!n)return{};var a=n.padding,o=r.width+a[1]+a[3],s=r.height+a[0]+a[2],u=(0,b.__assign)((0,b.__assign)({},n),{width:o,height:s,x:r.minX-a[3],y:r.minY-a[0],matrix:[1,0,0,0,1,0,0,0,1]}),f;return(0,h.isNil)(t.autoRotate)?f=this.labelAutoRotate:f=t.autoRotate,f&&(u.matrix=e.attr("matrix")||[1,0,0,0,1,0,0,0,1]),u},_getTextAlign:function(e,t){var r="center";return t?(t=t%(Math.PI*2),e!=="center"&&(t>=0&&t<=Math.PI/2||t>=3/2*Math.PI&&t<2*Math.PI?r=e:r=Mm(e)),r):e},getControlPoints:function(e){return e.controlPoints},getPathPoints:function(e){return e},drawShape:function(e,t){var r=this.getShapeStyle(e),n=t.addShape("path",{className:qd,name:qd,attrs:r});return t.shapeMap[qd]=n,n},drawLabel:function(e,t){var r=this.options.labelCfg,n=(0,h.deepMix)({},r,e.labelCfg),a=this.getLabelStyle(e,n,t),o=a.rotate;delete a.rotate;var s=t.addShape("text",{attrs:a,name:"text-shape",labelRelated:!0,draggable:!0});if(t.shapeMap["text-shape"]=s,!isNaN(o)&&o!==""&&s.rotateAtStart(o),a.background){var u=this.drawLabelBg(e,t,s,a,o),f=this.itemType+Yh;u.set("classname",f),t.shapeMap[f]=u,s.toFront()}return s},drawLabelBg:function(e,t,r,n,a){var o=this.options.labelCfg,s=(0,h.deepMix)({},o,e.labelCfg),u=this.getLabelBgStyleByPosition(r,s),f=t.addShape("rect",{name:"text-bg-shape",attrs:u,labelRelated:!0});return t.shapeMap["text-bg-shape"]=f,f}},Cm=(0,b.__assign)((0,b.__assign)({},Xh),_m);Fs.registerEdge("single-edge",Cm),Fs.registerEdge("line",{getControlPoints:function(){}},"single-edge"),Fs.registerEdge("spline",{getPath:function(e){var t=Zv(e);return t}},"single-edge"),Fs.registerEdge("arc",{curveOffset:20,clockwise:1,getControlPoints:function(e){var t=e.startPoint,r=e.endPoint,n={x:(t.x+r.x)/2,y:(t.y+r.y)/2},a,o;if(e.controlPoints!==void 0){if(o=e.controlPoints[0],a=sa(t,o,r),t.x<=r.x&&t.y>r.y?this.clockwise=a.x>o.x?0:1:t.x<=r.x&&t.yo.x?1:0:t.x>r.x&&t.y<=r.y?this.clockwise=a.y=i&&n<=i+t&&a>=e&&a<=e+r}function Ed(i,e){return!(e.minX>i.maxX||e.maxXi.maxY||e.maxY=0&&n<1/2*Math.PI?(s={x:o.minX,y:o.minY},u={x:o.maxX,y:o.maxY}):1/2*Math.PI<=n&&n1&&(t*=Math.sqrt(I),r*=Math.sqrt(I));var B=t*t*(_*_)+r*r*(l*l),j=B?Math.sqrt((t*t*(r*r)-B)/B):1;a===o&&(j*=-1),isNaN(j)&&(j=0);var et=r?j*t*_/r:0,ut=t?j*-r*l/t:0,ct=(s+f)/2+Math.cos(n)*et-Math.sin(n)*ut,pt=(u+c)/2+Math.sin(n)*et+Math.cos(n)*ut,Mt=[(l-et)/t,(_-ut)/r],Zt=[(-1*l-et)/t,(-1*_-ut)/r],se=yp([1,0],Mt),oe=yp(Mt,Zt);return jh(Mt,Zt)<=-1&&(oe=Math.PI),jh(Mt,Zt)>=1&&(oe=0),o===0&&oe>0&&(oe=oe-2*Math.PI),o===1&&oe<0&&(oe=oe+2*Math.PI),{cx:ct,cy:pt,rx:pp(i,[f,c])?0:t,ry:pp(i,[f,c])?0:r,startAngle:se,endAngle:se+oe,xRotation:n,arcFlag:a,sweepFlag:o}}var Jd=Math.sin,th=Math.cos,Vh=Math.atan2,eh=Math.PI;function bp(i,e,t,r,n,a,o){var s=e.stroke,u=e.lineWidth,f=t-n,c=r-a,l=Vh(c,f),_=new Jh({type:"path",canvas:i.get("canvas"),isArrowShape:!0,attrs:{path:"M"+10*th(eh/6)+","+10*Jd(eh/6)+" L0,0 L"+10*th(eh/6)+",-"+10*Jd(eh/6),stroke:s,lineWidth:u}});_.translate(n,a),_.rotateAtPoint(n,a,l),i.set(o?"startArrowShape":"endArrowShape",_)}function Ep(i,e,t,r,n,a,o){var s=e.startArrow,u=e.endArrow,f=e.stroke,c=e.lineWidth,l=o?s:u,_=l.d,I=l.fill,B=l.stroke,j=l.lineWidth,et=(0,b.__rest)(l,["d","fill","stroke","lineWidth"]),ut=t-n,ct=r-a,pt=Vh(ct,ut);_&&(n=n-th(pt)*_,a=a-Jd(pt)*_);var Mt=new Jh({type:"path",canvas:i.get("canvas"),isArrowShape:!0,attrs:(0,b.__assign)((0,b.__assign)({},et),{stroke:B||f,lineWidth:j||c,fill:I})});Mt.translate(n,a),Mt.rotateAtPoint(n,a,pt),i.set(o?"startArrowShape":"endArrowShape",Mt)}function Al(i,e,t,r,n){var a=Vh(r-e,t-i);return{dx:th(a)*n,dy:Jd(a)*n}}function Hh(i,e,t,r,n,a){typeof e.startArrow=="object"?Ep(i,e,t,r,n,a,!0):e.startArrow?bp(i,e,t,r,n,a,!0):i.set("startArrowShape",null)}function Zh(i,e,t,r,n,a){typeof e.endArrow=="object"?Ep(i,e,t,r,n,a,!1):e.endArrow?bp(i,e,t,r,n,a,!1):i.set("startArrowShape",null)}var wp={fill:"fillStyle",stroke:"strokeStyle",opacity:"globalAlpha"};function od(i,e){var t=e.attr();for(var r in t){var n=t[r],a=wp[r]?wp[r]:r;a==="matrix"&&n?i.transform(n[0],n[1],n[3],n[4],n[6],n[7]):a==="lineDash"&&i.setLineDash?(0,h.isArray)(n)&&i.setLineDash(n):(a==="strokeStyle"||a==="fillStyle"?n=Xm(i,e,n):a==="globalAlpha"&&(n=n*i.globalAlpha),i[a]=n)}}function Kh(i,e,t){for(var r=0;rZt?Mt:Zt,qe=Mt>Zt?1:Mt/Zt,hr=Mt>Zt?Zt/Mt:1;e.translate(ct,pt),e.rotate(_e),e.scale(qe,hr),e.arc(0,0,Re,se,oe,1-Ue),e.scale(1/qe,1/hr),e.rotate(-_e),e.translate(-ct,-pt)}break}case"Z":e.closePath();break;default:break}if(_==="Z")s=u;else{var nn=l.length;s=[l[nn-2],l[nn-1]]}}}}function _p(i,e){var t=i.get("canvas");t&&(e==="remove"&&(i._cacheCanvasBBox=i.get("cacheCanvasBBox")),i.get("hasChanged")||(i.set("hasChanged",!0),i.cfg.parent&&i.cfg.parent.get("hasChanged")||(t.refreshElement(i,e,t),t.get("autoDraw")&&t.draw())))}function Zm(i){var e;if(i.destroyed)e=i._cacheCanvasBBox;else{var t=i.get("cacheCanvasBBox"),r=t&&!!(t.width&&t.height),n=i.getCanvasBBox(),a=n&&!!(n.width&&n.height);r&&a?e=Bm(t,n):r?e=t:a&&(e=n)}return e}function Km(i){if(!i.length)return null;var e=[],t=[],r=[],n=[];return(0,h.each)(i,function(a){var o=Zm(a);o&&(e.push(o.minX),t.push(o.minY),r.push(o.maxX),n.push(o.maxY))}),{minX:(0,h.min)(e),minY:(0,h.min)(t),maxX:(0,h.max)(r),maxY:(0,h.max)(n)}}function $m(i,e){return!i||!e||!Ed(i,e)?null:{minX:Math.max(i.minX,e.minX),minY:Math.max(i.minY,e.minY),maxX:Math.min(i.maxX,e.maxX),maxY:Math.min(i.maxY,e.maxY)}}var qm=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.onCanvasChange=function(t){_p(this,t)},e.prototype.getShapeBase=function(){return y},e.prototype.getGroupBase=function(){return e},e.prototype._applyClip=function(t,r){r&&(t.save(),od(t,r),r.createPath(t),t.restore(),t.clip(),r._afterDraw())},e.prototype.cacheCanvasBBox=function(){var t=this.cfg.children,r=[],n=[];(0,h.each)(t,function(_){var I=_.cfg.cacheCanvasBBox;I&&_.cfg.isInView&&(r.push(I.minX,I.maxX),n.push(I.minY,I.maxY))});var a=null;if(r.length){var o=(0,h.min)(r),s=(0,h.max)(r),u=(0,h.min)(n),f=(0,h.max)(n);a={minX:o,minY:u,x:o,y:u,maxX:s,maxY:f,width:s-o,height:f-u};var c=this.cfg.canvas;if(c){var l=c.getViewRange();this.set("isInView",Ed(a,l))}}else this.set("isInView",!1);this.set("cacheCanvasBBox",a)},e.prototype.draw=function(t,r){var n=this.cfg.children,a=r?this.cfg.refresh:!0;n.length&&a&&(t.save(),od(t,this),this._applyClip(t,this.getClip()),Kh(t,n,r),t.restore(),this.cacheCanvasBBox()),this.cfg.refresh=null,this.set("hasChanged",!1)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("hasChanged",!1)},e}(wl),Cp=qm,Qm=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{lineWidth:1,lineAppendWidth:0,strokeOpacity:1,fillOpacity:1})},e.prototype.getShapeBase=function(){return y},e.prototype.getGroupBase=function(){return Cp},e.prototype.onCanvasChange=function(t){_p(this,t)},e.prototype.calculateBBox=function(){var t=this.get("type"),r=this.getHitLineWidth(),n=bu(t),a=n(this),o=r/2,s=a.x-o,u=a.y-o,f=a.x+a.width+o,c=a.y+a.height+o;return{x:s,minX:s,y:u,minY:u,width:a.width+r,height:a.height+r,maxX:f,maxY:c}},e.prototype.isFill=function(){return!!this.attrs.fill||this.isClipShape()},e.prototype.isStroke=function(){return!!this.attrs.stroke},e.prototype._applyClip=function(t,r){r&&(t.save(),od(t,r),r.createPath(t),t.restore(),t.clip(),r._afterDraw())},e.prototype.draw=function(t,r){var n=this.cfg.clipShape;if(r){if(this.cfg.refresh===!1){this.set("hasChanged",!1);return}var a=this.getCanvasBBox();if(!Ed(r,a)){this.set("hasChanged",!1),this.cfg.isInView&&this._afterDraw();return}}t.save(),od(t,this),this._applyClip(t,n),this.drawPath(t),t.restore(),this._afterDraw()},e.prototype.getCanvasViewBox=function(){var t=this.cfg.canvas;return t?t.getViewRange():null},e.prototype.cacheCanvasBBox=function(){var t=this.getCanvasViewBox();if(t){var r=this.getCanvasBBox(),n=Ed(r,t);this.set("isInView",n),n?this.set("cacheCanvasBBox",r):this.set("cacheCanvasBBox",null)}},e.prototype._afterDraw=function(){this.cacheCanvasBBox(),this.set("hasChanged",!1),this.set("refresh",null)},e.prototype.skipDraw=function(){this.set("cacheCanvasBBox",null),this.set("isInView",null),this.set("hasChanged",!1)},e.prototype.drawPath=function(t){this.createPath(t),this.strokeAndFill(t),this.afterDrawPath(t)},e.prototype.fill=function(t){t.fill()},e.prototype.stroke=function(t){t.stroke()},e.prototype.strokeAndFill=function(t){var r=this.attrs,n=r.lineWidth,a=r.opacity,o=r.strokeOpacity,s=r.fillOpacity;this.isFill()&&(!(0,h.isNil)(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.isStroke()&&n>0&&(!(0,h.isNil)(o)&&o!==1&&(t.globalAlpha=o),this.stroke(t)),this.afterDrawPath(t)},e.prototype.createPath=function(t){},e.prototype.afterDrawPath=function(t){},e.prototype.isInShape=function(t,r){var n=this.isStroke(),a=this.isFill(),o=this.getHitLineWidth();return this.isInStrokeOrPath(t,r,n,a,o)},e.prototype.isInStrokeOrPath=function(t,r,n,a,o){return!1},e.prototype.getHitLineWidth=function(){if(!this.isStroke())return 0;var t=this.attrs;return t.lineWidth+t.lineAppendWidth},e}(ec),uf=Qm,Jm=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x:0,y:0,r:0})},e.prototype.isInStrokeOrPath=function(t,r,n,a,o){var s=this.attr(),u=s.x,f=s.y,c=s.r,l=o/2,_=vp(u,f,t,r);return a&&n?_<=c+l:a?_<=c:n?_>=c-l&&_<=c+l:!1},e.prototype.createPath=function(t){var r=this.attr(),n=r.x,a=r.y,o=r.r;t.beginPath(),t.arc(n,a,o,0,Math.PI*2,!1),t.closePath()},e}(uf),ty=Jm;function rh(i,e,t,r){return i/(t*t)+e/(r*r)}var ey=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.isInStrokeOrPath=function(t,r,n,a,o){var s=this.attr(),u=o/2,f=s.x,c=s.y,l=s.rx,_=s.ry,I=(t-f)*(t-f),B=(r-c)*(r-c);return a&&n?rh(I,B,l+u,_+u)<=1:a?rh(I,B,l,_)<=1:n?rh(I,B,l-u,_-u)>=1&&rh(I,B,l+u,_+u)<=1:!1},e.prototype.createPath=function(t){var r=this.attr(),n=r.x,a=r.y,o=r.rx,s=r.ry;if(t.beginPath(),t.ellipse)t.ellipse(n,a,o,s,0,0,Math.PI*2,!1);else{var u=o>s?o:s,f=o>s?1:o/s,c=o>s?s/o:1;t.save(),t.translate(n,a),t.scale(f,c),t.arc(0,0,u,0,Math.PI*2),t.restore(),t.closePath()}},e}(uf),ry=ey;function Tp(i){return i instanceof HTMLElement&&(0,h.isString)(i.nodeName)&&i.nodeName.toUpperCase()==="CANVAS"}var ny=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x:0,y:0,width:0,height:0})},e.prototype.initAttrs=function(t){this._setImage(t.img)},e.prototype.isStroke=function(){return!1},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._afterLoading=function(){if(this.get("toDraw")===!0){var t=this.get("canvas");t?t.draw():this.createPath(this.get("context"))}},e.prototype._setImage=function(t){var r=this,n=this.attrs;if((0,h.isString)(t)){var a=new Image;a.onload=function(){if(r.destroyed)return!1;r.attr("img",a),r.set("loading",!1),r._afterLoading();var o=r.get("callback");o&&o.call(r)},a.crossOrigin="Anonymous",a.src=t,this.set("loading",!0)}else t instanceof Image?(n.width||(n.width=t.width),n.height||(n.height=t.height)):Tp(t)&&(n.width||(n.width=Number(t.getAttribute("width"))),n.height||(n.height,Number(t.getAttribute("height"))))},e.prototype.onAttrChange=function(t,r,n){i.prototype.onAttrChange.call(this,t,r,n),t==="img"&&this._setImage(r)},e.prototype.createPath=function(t){if(this.get("loading")){this.set("toDraw",!0),this.set("context",t);return}var r=this.attr(),n=r.x,a=r.y,o=r.width,s=r.height,u=r.sx,f=r.sy,c=r.swidth,l=r.sheight,_=r.img;(_ instanceof Image||Tp(_))&&(!(0,h.isNil)(u)&&!(0,h.isNil)(f)&&!(0,h.isNil)(c)&&!(0,h.isNil)(l)?t.drawImage(_,u,f,c,l,n,a,o,s):t.drawImage(_,n,a,o,s))},e}(uf),ay=ny;function Yc(i,e,t,r,n,a,o){var s=Math.min(i,t),u=Math.max(i,t),f=Math.min(e,r),c=Math.max(e,r),l=n/2;return a>=s-l&&a<=u+l&&o>=f-l&&o<=c+l?cs.pointToLine(i,e,t,r,a,o)<=n/2:!1}var iy=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.initAttrs=function(t){this.setArrow()},e.prototype.onAttrChange=function(t,r,n){i.prototype.onAttrChange.call(this,t,r,n),this.setArrow()},e.prototype.setArrow=function(){var t=this.attr(),r=t.x1,n=t.y1,a=t.x2,o=t.y2,s=t.startArrow,u=t.endArrow;s&&Hh(this,t,a,o,r,n),u&&Zh(this,t,r,n,a,o)},e.prototype.isInStrokeOrPath=function(t,r,n,a,o){if(!n||!o)return!1;var s=this.attr(),u=s.x1,f=s.y1,c=s.x2,l=s.y2;return Yc(u,f,c,l,o,t,r)},e.prototype.createPath=function(t){var r=this.attr(),n=r.x1,a=r.y1,o=r.x2,s=r.y2,u=r.startArrow,f=r.endArrow,c={dx:0,dy:0},l={dx:0,dy:0};u&&u.d&&(c=Al(n,a,o,s,r.startArrow.d)),f&&f.d&&(l=Al(n,a,o,s,r.endArrow.d)),t.beginPath(),t.moveTo(n+c.dx,a+c.dy),t.lineTo(o-l.dx,s-l.dy)},e.prototype.afterDrawPath=function(t){var r=this.get("startArrowShape"),n=this.get("endArrowShape");r&&r.draw(t),n&&n.draw(t)},e.prototype.getTotalLength=function(){var t=this.attr(),r=t.x1,n=t.y1,a=t.x2,o=t.y2;return cs.length(r,n,a,o)},e.prototype.getPoint=function(t){var r=this.attr(),n=r.x1,a=r.y1,o=r.x2,s=r.y2;return cs.pointAt(n,a,o,s,t)},e}(uf),oy=iy,sy={circle:function(i,e,t){return[["M",i-t,e],["A",t,t,0,1,0,i+t,e],["A",t,t,0,1,0,i-t,e]]},square:function(i,e,t){return[["M",i-t,e-t],["L",i+t,e-t],["L",i+t,e+t],["L",i-t,e+t],["Z"]]},diamond:function(i,e,t){return[["M",i-t,e],["L",i,e-t],["L",i+t,e],["L",i,e+t],["Z"]]},triangle:function(i,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,e+r],["L",i,e-r],["L",i+t,e+r],["Z"]]},"triangle-down":function(i,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,e-r],["L",i+t,e-r],["L",i,e+r],["Z"]]}},uy=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.initAttrs=function(t){this._resetParamsCache()},e.prototype._resetParamsCache=function(){this.set("paramsCache",{})},e.prototype.onAttrChange=function(t,r,n){i.prototype.onAttrChange.call(this,t,r,n),["symbol","x","y","r","radius"].indexOf(t)!==-1&&this._resetParamsCache()},e.prototype.isOnlyHitBox=function(){return!0},e.prototype._getR=function(t){return(0,h.isNil)(t.r)?t.radius:t.r},e.prototype._getPath=function(){var t=this.attr(),r=t.x,n=t.y,a=t.symbol||"circle",o=this._getR(t),s,u;if((0,h.isFunction)(a))s=a,u=s(r,n,o),u=Ii(u);else{if(s=e.Symbols[a],!s)return console.warn(a+" marker is not supported."),null;u=s(r,n,o)}return u},e.prototype.createPath=function(t){var r=this._getPath(),n=this.get("paramsCache");Mp(this,t,{path:r},n)},e.Symbols=sy,e}(uf),fy=uy;function Ap(i,e,t){var r=wr();return i.createPath(r),r.isPointInPath(e,t)}var cy=1e-6;function Qh(i){return Math.abs(i)0!=Qh(s[1]-t)>0&&Qh(e-(t-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(r=!r)}return r}function wd(i,e,t,r,n,a,o,s){var u=(Math.atan2(s-e,o-i)+Math.PI*2)%(Math.PI*2);if(un)return!1;var f={x:i+t*Math.cos(u),y:e+t*Math.sin(u)};return vp(f.x,f.y,o,s)<=a/2}var dy=Xt;function hy(i){for(var e=!1,t=i.length,r=0;rpt?ct:pt,Ue=ct>pt?1:ct/pt,Re=ct>pt?pt/ct:1,qe=dy(null,[["t",-et,-ut],["r",-se],["s",1/Ue,1/Re]]);Jo.transformMat3(oe,oe,qe),a=wd(0,0,_e,Mt,Zt,e,oe[0],oe[1]);break;default:break}if(a)break}}return a}function py(i){for(var e=i.length,t=[],r=[],n=[],a=0;a0&&r.push(n),{polygons:t,polylines:r}}var nh=(0,b.__assign)({hasArc:hy,extractPolygons:py,isPointInStroke:vy},T);function Op(i,e,t){for(var r=!1,n=0;n=c[0]&&t<=c[1]&&(n=(t-c[0])/(c[1]-c[0]),a=l)});var s=o[a];if((0,h.isNil)(s)||(0,h.isNil)(a))return null;var u=s.length,f=o[a+1];return je.pointAt(s[u-2],s[u-1],f[1],f[2],f[3],f[4],f[5],f[6],n)},e.prototype._calculateCurve=function(){var t=this.attr().path;this.set("curve",nh.pathToCurve(t))},e.prototype._setTcache=function(){var t=0,r=0,n=[],a,o,s,u,f=this.get("curve");if(f){if((0,h.each)(f,function(c,l){s=f[l+1],u=c.length,s&&(t+=je.length(c[u-2],c[u-1],s[1],s[2],s[3],s[4],s[5],s[6])||0)}),this.set("totalLength",t),t===0){this.set("tCache",[]);return}(0,h.each)(f,function(c,l){s=f[l+1],u=c.length,s&&(a=[],a[0]=r/t,o=je.length(c[u-2],c[u-1],s[1],s[2],s[3],s[4],s[5],s[6]),r+=o||0,a[1]=r/t,n.push(a))}),this.set("tCache",n)}},e.prototype.getStartTangent=function(){var t=this.getSegments(),r;if(t.length>1){var n=t[0].currentPoint,a=t[1].currentPoint,o=t[1].startTangent;r=[],o?(r.push([n[0]-o[0],n[1]-o[1]]),r.push([n[0],n[1]])):(r.push([a[0],a[1]]),r.push([n[0],n[1]]))}return r},e.prototype.getEndTangent=function(){var t=this.getSegments(),r=t.length,n;if(r>1){var a=t[r-2].currentPoint,o=t[r-1].currentPoint,s=t[r-1].endTangent;n=[],s?(n.push([o[0]-s[0],o[1]-s[1]]),n.push([o[0],o[1]])):(n.push([a[0],a[1]]),n.push([o[0],o[1]]))}return n},e}(uf),Jh=gy;function Dp(i,e,t,r,n){var a=i.length;if(a<2)return!1;for(var o=0;o=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=u)}),cs.pointAt(r[o][0],r[o][1],r[o+1][0],r[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var r=this.getTotalLength();if(!(r<=0)){var n=0,a=[],o,s;(0,h.each)(t,function(u,f){t[f+1]&&(o=[],o[0]=n/r,s=cs.length(u[0],u[1],t[f+1][0],t[f+1][1]),n+=s,o[1]=n/r,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,r=[];return r.push([t[1][0],t[1][1]]),r.push([t[0][0],t[0][1]]),r},e.prototype.getEndTangent=function(){var t=this.attr().points,r=t.length-1,n=[];return n.push([t[r-1][0],t[r-1][1]]),n.push([t[r][0],t[r][1]]),n},e}(uf),by=xy;function Ey(i,e,t,r,n,a,o){var s=n/2;return Tl(i-s,e-s,t,n,a,o)||Tl(i+t-s,e-s,n,r,a,o)||Tl(i+s,e+r-s,t,n,a,o)||Tl(i-s,e+s,n,r,a,o)}function wy(i,e,t,r,n,a,o,s){var u=a/2;return Yc(i+n,e,i+t-n,e,a,o,s)||Yc(i+t,e+n,i+t,e+r-n,a,o,s)||Yc(i+t-n,e+r,i+n,e+r,a,o,s)||Yc(i,e+r-n,i,e+n,a,o,s)||wd(i+t-n,e+n,n,1.5*Math.PI,2*Math.PI,a,o,s)||wd(i+t-n,e+r-n,n,0,.5*Math.PI,a,o,s)||wd(i+n,e+r-n,n,.5*Math.PI,Math.PI,a,o,s)||wd(i+n,e+n,n,Math.PI,1.5*Math.PI,a,o,s)}var Sy=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.isInStrokeOrPath=function(t,r,n,a,o){var s=this.attr(),u=s.x,f=s.y,c=s.width,l=s.height,_=s.radius;if(_){var B=!1;return n&&(B=wy(u,f,c,l,_,o,t,r)),!B&&a&&(B=Ap(this,t,r)),B}else{var I=o/2;if(a&&n)return Tl(u-I,f-I,c+I,l+I,t,r);if(a)return Tl(u,f,c,l,t,r);if(n)return Ey(u,f,c,l,o,t,r)}},e.prototype.createPath=function(t){var r=this.attr(),n=r.x,a=r.y,o=r.width,s=r.height,u=r.radius;if(t.beginPath(),u===0)t.rect(n,a,o,s);else{var f=jm(u),c=f[0],l=f[1],_=f[2],I=f[3];t.moveTo(n+c,a),t.lineTo(n+o-l,a),l!==0&&t.arc(n+o-l,a+l,l,-Math.PI/2,0),t.lineTo(n+o,a+s-_),_!==0&&t.arc(n+o-_,a+s-_,_,0,Math.PI/2),t.lineTo(n+I,a+s),I!==0&&t.arc(n+I,a+s-I,I,Math.PI/2,Math.PI),t.lineTo(n,a+c),c!==0&&t.arc(n+c,a+c,c,Math.PI,Math.PI*1.5),t.closePath()}},e}(uf),My=Sy,_y=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.isOnlyHitBox=function(){return!0},e.prototype.initAttrs=function(t){this._assembleFont(),t.text&&this._setText(t.text)},e.prototype._assembleFont=function(){var t=this.attrs;t.font=Nn(t)},e.prototype._setText=function(t){var r=null;(0,h.isString)(t)&&t.indexOf(` +`)!==-1&&(r=t.split(` +`)),this.set("textArr",r)},e.prototype.onAttrChange=function(t,r,n){i.prototype.onAttrChange.call(this,t,r,n),t.startsWith("font")&&this._assembleFont(),t==="text"&&this._setText(r)},e.prototype._getSpaceingY=function(){var t=this.attrs,r=t.lineHeight,n=t.fontSize*1;return r?r-n:n*.14},e.prototype._drawTextArr=function(t,r,n){var a=this.attrs,o=a.textBaseline,s=a.x,u=a.y,f=a.fontSize*1,c=this._getSpaceingY(),l=Er(a.text,a.fontSize,a.lineHeight),_;(0,h.each)(r,function(I,B){_=u+B*(c+f)-l+f,o==="middle"&&(_+=l-f-(l-f)/2),o==="top"&&(_+=l-f),(0,h.isNil)(I)||(n?t.fillText(I,s,_):t.strokeText(I,s,_))})},e.prototype._drawText=function(t,r){var n=this.attr(),a=n.x,o=n.y,s=this.get("textArr");if(s)this._drawTextArr(t,s,r);else{var u=n.text;(0,h.isNil)(u)||(r?t.fillText(u,a,o):t.strokeText(u,a,o))}},e.prototype.strokeAndFill=function(t){var r=this.attrs,n=r.lineWidth,a=r.opacity,o=r.strokeOpacity,s=r.fillOpacity;this.isStroke()&&n>0&&(!(0,h.isNil)(o)&&o!==1&&(t.globalAlpha=a),this.stroke(t)),this.isFill()&&(!(0,h.isNil)(s)&&s!==1?(t.globalAlpha=s,this.fill(t),t.globalAlpha=a):this.fill(t)),this.afterDrawPath(t)},e.prototype.fill=function(t){this._drawText(t,!0)},e.prototype.stroke=function(t){this._drawText(t,!1)},e}(uf),Cy=_y;function Ty(i,e){if(e){var t=le(e);return Vt(t,i)}return i}function Lp(i,e,t){var r=i.getTotalMatrix();if(r){var n=Ty([e,t,1],r),a=n[0],o=n[1];return[a,o]}return[e,t]}function Pp(i,e,t){if(i.isCanvas&&i.isCanvas())return!0;if(!Rf(i)||i.cfg.isInView===!1)return!1;if(i.cfg.clipShape){var r=Lp(i,e,t),n=r[0],a=r[1];if(i.isClipped(n,a))return!1}var o=i.cfg.cacheCanvasBBox||i.getCanvasBBox();return e>=o.minX&&e<=o.maxX&&t>=o.minY&&t<=o.maxY}function Np(i,e,t){if(!Pp(i,e,t))return null;for(var r=null,n=i.getChildren(),a=n.length,o=a-1;o>=0;o--){var s=n[o];if(s.isGroup())r=Np(s,e,t);else if(Pp(s,e,t)){var u=s,f=Lp(s,e,t),c=f[0],l=f[1];u.isInShape(c,l)&&(r=s)}if(r)break}return r}var Ay=function(i){(0,b.__extends)(e,i);function e(){return i!==null&&i.apply(this,arguments)||this}return e.prototype.getDefaultCfg=function(){var t=i.prototype.getDefaultCfg.call(this);return t.renderer="canvas",t.autoDraw=!0,t.localRefresh=!0,t.refreshElements=[],t.clipView=!0,t.quickHit=!1,t},e.prototype.onCanvasChange=function(t){(t==="attr"||t==="sort"||t==="changeSize")&&(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return y},e.prototype.getGroupBase=function(){return Cp},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||km();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),r=t.getContext("2d");return this.set("context",r),t},e.prototype.setDOMSize=function(t,r){i.prototype.setDOMSize.call(this,t,r);var n=this.get("context"),a=this.get("el"),o=this.getPixelRatio();a.width=o*t,a.height=o*r,o>1&&n.scale(o,o)},e.prototype.clear=function(){i.prototype.clear.call(this),this._clearFrame();var t=this.get("context"),r=this.get("el");t.clearRect(0,0,r.width,r.height)},e.prototype.getShape=function(t,r){var n;return this.get("quickHit")?n=Np(this,t,r):n=i.prototype.getShape.call(this,t,r,null),n},e.prototype._getRefreshRegion=function(){var t=this.get("refreshElements"),r=this.getViewRange(),n;if(t.length&&t[0]===this)n=r;else if(n=Km(t),n){n.minX=Math.floor(n.minX),n.minY=Math.floor(n.minY),n.maxX=Math.ceil(n.maxX),n.maxY=Math.ceil(n.maxY),n.maxY+=1;var a=this.get("clipView");a&&(n=$m(n,r))}return n},e.prototype.refreshElement=function(t){var r=this.get("refreshElements");r.push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&((0,h.clearAnimationFrame)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),r=this.get("el"),n=this.getChildren();t.clearRect(0,0,r.width,r.height),od(t,this),Kh(t,n),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),r=this.get("refreshElements"),n=this.getChildren(),a=this._getRefreshRegion();a?(t.clearRect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.save(),t.beginPath(),t.rect(a.minX,a.minY,a.maxX-a.minX,a.maxY-a.minY),t.clip(),od(t,this),Vm(this,n,a),Kh(t,n,a),t.restore()):r.length&&Sp(r),(0,h.each)(r,function(o){o.get("hasChanged")&&o.set("hasChanged",!1)}),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,r=this.get("drawFrame");r||(r=(0,h.requestAnimationFrame)(function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)}),this.set("drawFrame",r))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(of),oc=Ay,kS="0.5.12",tv={rect:"path",circle:"circle",line:"line",path:"path",marker:"path",text:"text",polyline:"polyline",polygon:"polygon",image:"image",ellipse:"ellipse",dom:"foreignObject"},Fi={opacity:"opacity",fillStyle:"fill",fill:"fill",fillOpacity:"fill-opacity",strokeStyle:"stroke",strokeOpacity:"stroke-opacity",stroke:"stroke",x:"x",y:"y",r:"r",rx:"rx",ry:"ry",width:"width",height:"height",x1:"x1",x2:"x2",y1:"y1",y2:"y2",lineCap:"stroke-linecap",lineJoin:"stroke-linejoin",lineWidth:"stroke-width",lineDash:"stroke-dasharray",lineDashOffset:"stroke-dashoffset",miterLimit:"stroke-miterlimit",font:"font",fontSize:"font-size",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",fontFamily:"font-family",startArrow:"marker-start",endArrow:"marker-end",path:"d",class:"class",id:"id",style:"style",preserveAspectRatio:"preserveAspectRatio"},BS=null;function Bu(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Rp(i){var e=tv[i.type],t=i.getParent();if(!e)throw new Error("the type "+i.type+" is not supported by svg");var r=Bu(e);if(i.get("id")&&(r.id=i.get("id")),i.set("el",r),i.set("attrs",{}),t){var n=t.get("el");n||(n=t.createDom(),t.set("el",n)),n.appendChild(r)}return r}function kp(i,e){var t=i.get("el"),r=(0,h.toArray)(t.children).sort(e),n=document.createDocumentFragment();r.forEach(function(a){n.appendChild(a)}),t.appendChild(n)}function Iy(i,e){var t=i.parentNode,r=Array.from(t.childNodes).filter(function(s){return s.nodeType===1&&s.nodeName.toLowerCase()!=="defs"}),n=r[e],a=r.indexOf(i);if(n){if(a>e)t.insertBefore(i,n);else if(a0&&(r?"stroke"in n?this._setColor(t,"stroke",s):"strokeStyle"in n&&this._setColor(t,"stroke",u):this._setColor(t,"stroke",s||u),c&&_.setAttribute(Fi.strokeOpacity,c),l&&_.setAttribute(Fi.lineWidth,l))},e.prototype._setColor=function(t,r,n){var a=this.get("el");if(!n){a.setAttribute(Fi[r],"none");return}if(n=n.trim(),/^[r,R,L,l]{1}[\s]*\(/.test(n)){var o=t.find("gradient",n);o||(o=t.addGradient(n)),a.setAttribute(Fi[r],"url(#"+o+")")}else if(/^[p,P]{1}[\s]*\(/.test(n)){var o=t.find("pattern",n);o||(o=t.addPattern(n)),a.setAttribute(Fi[r],"url(#"+o+")")}else a.setAttribute(Fi[r],n)},e.prototype.shadow=function(t,r){var n=this.attr(),a=r||n,o=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,f=a.shadowColor;(o||s||u||f)&&Oy(this,t)},e.prototype.transform=function(t){var r=this.attr(),n=(t||r).matrix;n&&Sd(this)},e.prototype.isInShape=function(t,r){return this.isPointInPath(t,r)},e.prototype.isPointInPath=function(t,r){var n=this.get("el"),a=this.get("canvas"),o=a.get("el").getBoundingClientRect(),s=t+o.left,u=r+o.top,f=document.elementFromPoint(s,u);return!!(f&&f.isEqualNode(n))},e.prototype.getHitLineWidth=function(){var t=this.attrs,r=t.lineWidth,n=t.lineAppendWidth;return this.isStroke()?r+n:0},e}(ec),Fu=Ly,Py=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="circle",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x:0,y:0,r:0})},e.prototype.createPath=function(t,r){var n=this.attr(),a=this.get("el");(0,h.each)(r||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):Fi[s]&&a.setAttribute(Fi[s],o)})},e}(Fu),Ny=Py,Ry=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="dom",t.canFill=!1,t.canStroke=!1,t}return e.prototype.createPath=function(t,r){var n=this.attr(),a=this.get("el");if((0,h.each)(r||n,function(f,c){Fi[c]&&a.setAttribute(Fi[c],f)}),typeof n.html=="function"){var o=n.html.call(this,n);if(o instanceof Element||o instanceof HTMLDocument){for(var s=a.childNodes,u=s.length-1;u>=0;u--)a.removeChild(s[u]);a.appendChild(o)}else a.innerHTML=o}else a.innerHTML=n.html},e}(Fu),ky=Ry,By=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="ellipse",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x:0,y:0,rx:0,ry:0})},e.prototype.createPath=function(t,r){var n=this.attr(),a=this.get("el");(0,h.each)(r||n,function(o,s){s==="x"||s==="y"?a.setAttribute("c"+s,o):Fi[s]&&a.setAttribute(Fi[s],o)})},e}(Fu),Fy=By,zy=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="image",t.canFill=!1,t.canStroke=!1,t}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x:0,y:0,width:0,height:0})},e.prototype.createPath=function(t,r){var n=this,a=this.attr(),o=this.get("el");(0,h.each)(r||a,function(s,u){u==="img"?n._setImage(a.img):Fi[u]&&o.setAttribute(Fi[u],s)})},e.prototype.setAttr=function(t,r){this.attrs[t]=r,t==="img"&&this._setImage(r)},e.prototype._setImage=function(t){var r=this.attr(),n=this.get("el");if((0,h.isString)(t))n.setAttribute("href",t);else if(t instanceof window.Image)r.width||(n.setAttribute("width",t.width),this.attr("width",t.width)),r.height||(n.setAttribute("height",t.height),this.attr("height",t.height)),n.setAttribute("href",t.src);else if(t instanceof HTMLElement&&(0,h.isString)(t.nodeName)&&t.nodeName.toUpperCase()==="CANVAS")n.setAttribute("href",t.toDataURL());else if(t instanceof ImageData){var a=document.createElement("canvas");a.setAttribute("width",""+t.width),a.setAttribute("height",""+t.height),a.getContext("2d").putImageData(t,0,0),r.width||(n.setAttribute("width",""+t.width),this.attr("width",t.width)),r.height||(n.setAttribute("height",""+t.height),this.attr("height",t.height)),n.setAttribute("href",a.toDataURL())}},e}(Fu),Gy=zy,Uy=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="line",t.canFill=!1,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x1:0,y1:0,x2:0,y2:0,startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,r){var n=this.attr(),a=this.get("el");(0,h.each)(r||n,function(o,s){if(s==="startArrow"||s==="endArrow")if(o){var u=(0,h.isObject)(o)?t.addArrow(n,Fi[s]):t.getDefaultArrow(n,Fi[s]);a.setAttribute(Fi[s],"url(#"+u+")")}else a.removeAttribute(Fi[s]);else Fi[s]&&a.setAttribute(Fi[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr(),r=t.x1,n=t.y1,a=t.x2,o=t.y2;return cs.length(r,n,a,o)},e.prototype.getPoint=function(t){var r=this.attr(),n=r.x1,a=r.y1,o=r.x2,s=r.y2;return cs.pointAt(n,a,o,s,t)},e}(Fu),Wy=Uy,ah={circle:function(i,e,t){return[["M",i,e],["m",-t,0],["a",t,t,0,1,0,t*2,0],["a",t,t,0,1,0,-t*2,0]]},square:function(i,e,t){return[["M",i-t,e-t],["L",i+t,e-t],["L",i+t,e+t],["L",i-t,e+t],["Z"]]},diamond:function(i,e,t){return[["M",i-t,e],["L",i,e-t],["L",i+t,e],["L",i,e+t],["Z"]]},triangle:function(i,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,e+r],["L",i,e-r],["L",i+t,e+r],["z"]]},triangleDown:function(i,e,t){var r=t*Math.sin(.3333333333333333*Math.PI);return[["M",i-t,e-r],["L",i+t,e-r],["L",i,e+r],["Z"]]}},Gp={get:function(i){return ah[i]},register:function(i,e){ah[i]=e},remove:function(i){delete ah[i]},getAll:function(){return ah}},Yy=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="marker",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t){var r=this.get("el");r.setAttribute("d",this._assembleMarker())},e.prototype._assembleMarker=function(){var t=this._getPath();return(0,h.isArray)(t)?t.map(function(r){return r.join(" ")}).join(""):t},e.prototype._getPath=function(){var t=this.attr(),r=t.x,n=t.y,a=t.r||t.radius,o=t.symbol||"circle",s;return(0,h.isFunction)(o)?s=o:s=Gp.get(o),s?s(r,n,a):(console.warn(s+" symbol is not exist."),null)},e.symbolsFactory=Gp,e}(Fu),Xy=Yy,jy=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="path",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{startArrow:!1,endArrow:!1})},e.prototype.createPath=function(t,r){var n=this,a=this.attr(),o=this.get("el");(0,h.each)(r||a,function(s,u){if(u==="path"&&(0,h.isArray)(s))o.setAttribute("d",n._formatPath(s));else if(u==="startArrow"||u==="endArrow")if(s){var f=(0,h.isObject)(s)?t.addArrow(a,Fi[u]):t.getDefaultArrow(a,Fi[u]);o.setAttribute(Fi[u],"url(#"+f+")")}else o.removeAttribute(Fi[u]);else Fi[u]&&o.setAttribute(Fi[u],s)})},e.prototype._formatPath=function(t){var r=t.map(function(n){return n.join(" ")}).join("");return~r.indexOf("NaN")?"":r},e.prototype.getTotalLength=function(){var t=this.get("el");return t?t.getTotalLength():null},e.prototype.getPoint=function(t){var r=this.get("el"),n=this.getTotalLength();if(n===0)return null;var a=r?r.getPointAtLength(t*n):null;return a?{x:a.x,y:a.y}:null},e}(Fu),Vy=jy,Hy=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="polygon",t.canFill=!0,t.canStroke=!0,t}return e.prototype.createPath=function(t,r){var n=this.attr(),a=this.get("el");(0,h.each)(r||n,function(o,s){s==="points"&&(0,h.isArray)(o)&&o.length>=2?a.setAttribute("points",o.map(function(u){return u[0]+","+u[1]}).join(" ")):Fi[s]&&a.setAttribute(Fi[s],o)})},e}(Fu),Zy=Hy,Ky=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="polyline",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{startArrow:!1,endArrow:!1})},e.prototype.onAttrChange=function(t,r,n){i.prototype.onAttrChange.call(this,t,r,n),["points"].indexOf(t)!==-1&&this._resetCache()},e.prototype._resetCache=function(){this.set("totalLength",null),this.set("tCache",null)},e.prototype.createPath=function(t,r){var n=this.attr(),a=this.get("el");(0,h.each)(r||n,function(o,s){s==="points"&&(0,h.isArray)(o)&&o.length>=2?a.setAttribute("points",o.map(function(u){return u[0]+","+u[1]}).join(" ")):Fi[s]&&a.setAttribute(Fi[s],o)})},e.prototype.getTotalLength=function(){var t=this.attr().points,r=this.get("totalLength");return(0,h.isNil)(r)?(this.set("totalLength",Kt.length(t)),this.get("totalLength")):r},e.prototype.getPoint=function(t){var r=this.attr().points,n=this.get("tCache");n||(this._setTcache(),n=this.get("tCache"));var a,o;return(0,h.each)(n,function(s,u){t>=s[0]&&t<=s[1]&&(a=(t-s[0])/(s[1]-s[0]),o=u)}),cs.pointAt(r[o][0],r[o][1],r[o+1][0],r[o+1][1],a)},e.prototype._setTcache=function(){var t=this.attr().points;if(!(!t||t.length===0)){var r=this.getTotalLength();if(!(r<=0)){var n=0,a=[],o,s;(0,h.each)(t,function(u,f){t[f+1]&&(o=[],o[0]=n/r,s=cs.length(u[0],u[1],t[f+1][0],t[f+1][1]),n+=s,o[1]=n/r,a.push(o))}),this.set("tCache",a)}}},e.prototype.getStartTangent=function(){var t=this.attr().points,r=[];return r.push([t[1][0],t[1][1]]),r.push([t[0][0],t[0][1]]),r},e.prototype.getEndTangent=function(){var t=this.attr().points,r=t.length-1,n=[];return n.push([t[r-1][0],t[r-1][1]]),n.push([t[r][0],t[r][1]]),n},e}(Fu),$y=Ky,qy=/[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/gi,Qy=/[^\s,]+/gi;function Jy(i){var e=0,t=0,r=0,n=0;return(0,h.isArray)(i)?i.length===1?e=t=r=n=i[0]:i.length===2?(e=r=i[0],t=n=i[1]):i.length===3?(e=i[0],t=n=i[1],r=i[2]):(e=i[0],t=i[1],r=i[2],n=i[3]):e=t=r=n=i,{r1:e,r2:t,r3:r,r4:n}}function FS(i){if(i=i||[],isArray(i))return i;if(isString(i))return i=i.match(qy),each(i,function(e,t){if(e=e.match(Qy),e[0].length>1){var r=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=r}each(e,function(n,a){isNaN(n)||(e[a]=+n)}),i[t]=e}),i}var t1=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="rect",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x:0,y:0,width:0,height:0,radius:0})},e.prototype.createPath=function(t,r){var n=this,a=this.attr(),o=this.get("el"),s=!1,u=["x","y","width","height","radius"];(0,h.each)(r||a,function(f,c){u.indexOf(c)!==-1&&!s?(o.setAttribute("d",n._assembleRect(a)),s=!0):u.indexOf(c)===-1&&Fi[c]&&o.setAttribute(Fi[c],f)})},e.prototype._assembleRect=function(t){var r=t.x,n=t.y,a=t.width,o=t.height,s=t.radius;if(!s)return"M "+r+","+n+" l "+a+",0 l 0,"+o+" l"+-a+" 0 z";var u=Jy(s);(0,h.isArray)(s)?s.length===1?u.r1=u.r2=u.r3=u.r4=s[0]:s.length===2?(u.r1=u.r3=s[0],u.r2=u.r4=s[1]):s.length===3?(u.r1=s[0],u.r2=u.r4=s[1],u.r3=s[2]):(u.r1=s[0],u.r2=s[1],u.r3=s[2],u.r4=s[3]):u.r1=u.r2=u.r3=u.r4=s;var f=[["M "+(r+u.r1)+","+n],["l "+(a-u.r1-u.r2)+",0"],["a "+u.r2+","+u.r2+",0,0,1,"+u.r2+","+u.r2],["l 0,"+(o-u.r2-u.r3)],["a "+u.r3+","+u.r3+",0,0,1,"+-u.r3+","+u.r3],["l "+(u.r3+u.r4-a)+",0"],["a "+u.r4+","+u.r4+",0,0,1,"+-u.r4+","+-u.r4],["l 0,"+(u.r4+u.r1-o)],["a "+u.r1+","+u.r1+",0,0,1,"+u.r1+","+-u.r1],["z"]];return f.join(" ")},e}(Fu),e1=t1,Up=.3,r1={top:"before-edge",middle:"central",bottom:"after-edge",alphabetic:"baseline",hanging:"hanging"},n1={top:"text-before-edge",middle:"central",bottom:"text-after-edge",alphabetic:"alphabetic",hanging:"hanging"},a1={left:"left",start:"left",center:"middle",right:"end",end:"end"},i1=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="text",t.canFill=!0,t.canStroke=!0,t}return e.prototype.getDefaultAttrs=function(){var t=i.prototype.getDefaultAttrs.call(this);return(0,b.__assign)((0,b.__assign)({},t),{x:0,y:0,text:null,fontSize:12,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",textAlign:"start",textBaseline:"bottom"})},e.prototype.createPath=function(t,r){var n=this,a=this.attr(),o=this.get("el");this._setFont(),(0,h.each)(r||a,function(s,u){u==="text"?n._setText(""+s):u==="matrix"&&s?Sd(n):Fi[u]&&o.setAttribute(Fi[u],s)}),o.setAttribute("paint-order","stroke"),o.setAttribute("style","stroke-linecap:butt; stroke-linejoin:miter;")},e.prototype._setFont=function(){var t=this.get("el"),r=this.attr(),n=r.textBaseline,a=r.textAlign,o=Bf();o&&o.name==="firefox"?t.setAttribute("dominant-baseline",n1[n]||"alphabetic"):t.setAttribute("alignment-baseline",r1[n]||"baseline"),t.setAttribute("text-anchor",a1[a]||"left")},e.prototype._setText=function(t){var r=this.get("el"),n=this.attr(),a=n.x,o=n.textBaseline,s=o===void 0?"bottom":o;if(!t)r.innerHTML="";else if(~t.indexOf(` +`)){var u=t.split(` +`),f=u.length-1,c="";(0,h.each)(u,function(l,_){_===0?s==="alphabetic"?c+=''+l+"":s==="top"?c+=''+l+"":s==="middle"?c+=''+l+"":s==="bottom"?c+=''+l+"":s==="hanging"&&(c+=''+l+""):c+=''+l+""}),r.innerHTML=c}else r.innerHTML=t},e}(Fu),o1=i1,s1=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,u1=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,f1=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function Wp(i){var e=i.match(f1);if(!e)return"";var t="";return e.sort(function(r,n){return r=r.split(":"),n=n.split(":"),Number(r[0])-Number(n[0])}),(0,h.each)(e,function(r){r=r.split(":"),t+=''}),t}function c1(i,e){var t=s1.exec(i),r=(0,h.mod)((0,h.toRadian)(parseFloat(t[1])),Math.PI*2),n=t[2],a,o;r>=0&&r<.5*Math.PI?(a={x:0,y:0},o={x:1,y:1}):.5*Math.PI<=r&&r`;t.innerHTML=r},i}(),m1=g1,y1=function(){function i(e,t){this.cfg={};var r=Bu("marker"),n=(0,h.uniqueId)("marker_");r.setAttribute("id",n);var a=Bu("path");a.setAttribute("stroke",e.stroke||"none"),a.setAttribute("fill",e.fill||"none"),r.appendChild(a),r.setAttribute("overflow","visible"),r.setAttribute("orient","auto-start-reverse"),this.el=r,this.child=a,this.id=n;var o=e[t==="marker-start"?"startArrow":"endArrow"];return this.stroke=e.stroke||"#000",o===!0?this._setDefaultPath(t,a):(this.cfg=o,this._setMarker(e.lineWidth,a)),this}return i.prototype.match=function(){return!1},i.prototype._setDefaultPath=function(e,t){var r=this.el;t.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),r.setAttribute("refX",""+10*Math.cos(Math.PI/6)),r.setAttribute("refY","5")},i.prototype._setMarker=function(e,t){var r=this.el,n=this.cfg.path,a=this.cfg.d;(0,h.isArray)(n)&&(n=n.map(function(o){return o.join(" ")}).join("")),t.setAttribute("d",n),r.appendChild(t),a&&r.setAttribute("refX",""+a/e)},i.prototype.update=function(e){var t=this.child;t.attr?t.attr("fill",e):t.setAttribute("fill",e)},i}(),Yp=y1,x1=function(){function i(e){this.type="clip",this.cfg={};var t=Bu("clipPath");this.el=t,this.id=(0,h.uniqueId)("clip_"),t.id=this.id;var r=e.cfg.el;return t.appendChild(r),this.cfg=e,this}return i.prototype.match=function(){return!1},i.prototype.remove=function(){var e=this.el;e.parentNode.removeChild(e)},i}(),b1=x1,E1=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,w1=function(){function i(e){this.cfg={};var t=Bu("pattern");t.setAttribute("patternUnits","userSpaceOnUse");var r=Bu("image");t.appendChild(r);var n=(0,h.uniqueId)("pattern_");t.id=n,this.el=t,this.id=n,this.cfg=e;var a=E1.exec(e),o=a[2];r.setAttribute("href",o);var s=new Image;o.match(/^data:/i)||(s.crossOrigin="Anonymous"),s.src=o;function u(){t.setAttribute("width",""+s.width),t.setAttribute("height",""+s.height)}return s.complete?u():(s.onload=u,s.src=s.src),this}return i.prototype.match=function(e,t){return this.cfg===t},i}(),S1=w1,M1=function(){function i(e){var t=Bu("defs"),r=(0,h.uniqueId)("defs_");t.id=r,e.appendChild(t),this.children=[],this.defaultArrow={},this.el=t,this.canvas=e}return i.prototype.find=function(e,t){for(var r=this.children,n=null,a=0;a=60&&Math.round(i.h)<=240?r=t?Math.round(i.h)-oh*e:Math.round(i.h)+oh*e:r=t?Math.round(i.h)+oh*e:Math.round(i.h)-oh*e,r<0?r+=360:r>=360&&(r-=360),r}function Zp(i,e,t){if(i.h===0&&i.s===0)return i.s;var r;return t?r=i.s-Xp*e:e===Vp?r=i.s+Xp:r=i.s+A1*e,r>1&&(r=1),t&&e===jp&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function Kp(i,e,t){var r;return t?r=i.v+I1*e:r=i.v-O1*e,r>1&&(r=1),Number(r.toFixed(2))}function sh(i){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=[],r=(0,ih.Z)(i),n=jp;n>0;n-=1){var a=r.toHsv(),o=(0,ih.Z)({h:Hp(a,n,!0),s:Zp(a,n,!0),v:Kp(a,n,!0)}).toHexString();t.push(o)}t.push(r.toHexString());for(var s=1;s<=Vp;s+=1){var u=r.toHsv(),f=(0,ih.Z)({h:Hp(u,s),s:Zp(u,s),v:Kp(u,s)}).toHexString();t.push(f)}return e.theme==="dark"?D1.map(function(c){var l=c.index,_=c.opacity,I=ih.Z.mix(e.backgroundColor||"#141414",t[l],_*100).toHexString();return I}):t}var ev={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"},$s={},rv={};Object.keys(ev).forEach(function(i){$s[i]=sh(ev[i]),$s[i].primary=$s[i][5],rv[i]=sh(ev[i],{theme:"dark",backgroundColor:"#141414"}),rv[i].primary=rv[i][5]});var GS=$s.red,US=$s.volcano,WS=$s.gold,YS=$s.orange,XS=$s.yellow,jS=$s.lime,VS=$s.green,HS=$s.cyan,ZS=$s.blue,KS=$s.geekblue,$S=$s.purple,qS=$s.magenta,QS=$s.grey,Ps=function(e,t,r){var n=Cd()(e),a=Cd()(t);return Cd()([(1-r)*n.red()+r*a.red(),(1-r)*n.green()+r*a.green(),(1-r)*n.blue()+r*a.blue()]).rgb()},L1=function(e,t,r){t===void 0&&(t="#fff"),r===void 0&&(r="rgb(150, 150, 150)");var n=Ps(t,e,.05).rgb().toString(),a=Ps(t,e,.1).rgb().toString(),o=Ps(t,e,.2).rgb().toString(),s=Ps(t,e,.4).rgb().toString(),u=Ps(t,r,.02).rgb().toString(),f=Ps(t,r,.05).rgb().toString(),c=Ps(t,r,.1).rgb().toString(),l=Ps(t,r,.2).rgb().toString(),_=Ps(t,r,.3).rgb().toString(),I=sh(e,{theme:"default",backgroundColor:t}),B=Cd()(e).hex().toLowerCase(),j=I.indexOf(B),et=e;return j!==-1&&(et=I[j+1]),{mainStroke:e,mainFill:a,activeStroke:e,activeFill:n,inactiveStroke:s,inactiveFill:n,selectedStroke:e,selectedFill:t,highlightStroke:et,highlightFill:o,disableStroke:_,disableFill:f,edgeMainStroke:_,edgeActiveStroke:e,edgeInactiveStroke:l,edgeSelectedStroke:e,edgeHighlightStroke:e,edgeDisableStroke:c,comboMainStroke:_,comboMainFill:u,comboActiveStroke:e,comboActiveFill:n,comboInactiveStroke:_,comboInactiveFill:u,comboSelectedStroke:e,comboSelectedFill:u,comboHighlightStroke:et,comboHighlightFill:u,comboDisableStroke:l,comboDisableFill:f}},P1=function(e,t,r){t===void 0&&(t="#fff"),r===void 0&&(r="#777");var n=Ps(t,e,.2).rgb().toString(),a=Ps(t,e,.3).rgb().toString(),o=Ps(t,e,.6).rgb().toString(),s=Ps(t,e,.8).rgb().toString(),u=Ps(t,r,.2).rgb().toString(),f=Ps(t,r,.25).rgb().toString(),c=Ps(t,r,.3).rgb().toString(),l=Ps(t,r,.4).rgb().toString(),_=Ps(t,r,.5).rgb().toString(),I=sh(e,{theme:"dark",backgroundColor:t}),B=Cd()(e).hex().toLowerCase(),j=I.indexOf(B),et=e;return j!==-1&&(et=I[j+1]),{mainStroke:s,mainFill:n,activeStroke:e,activeFill:a,inactiveStroke:s,inactiveFill:n,selectedStroke:e,selectedFill:n,highlightStroke:e,highlightFill:o,disableStroke:_,disableFill:f,edgeMainStroke:r,edgeActiveStroke:e,edgeInactiveStroke:r,edgeSelectedStroke:e,edgeHighlightStroke:e,edgeDisableStroke:c,comboMainStroke:l,comboMainFill:f,comboActiveStroke:e,comboActiveFill:u,comboInactiveStroke:l,comboInactiveFill:f,comboSelectedStroke:e,comboSelectedFill:u,comboHighlightStroke:et,comboHighlightFill:f,comboDisableStroke:l,comboDisableFill:u}},nv=function(e,t,r,n){return t===void 0&&(t="#fff"),r===void 0&&(r="default"),n===void 0&&(n="rgb(150, 150, 150)"),r==="default"?L1(e,t,"rgb(150, 150, 150)"):P1(e,t,"#777")},N1=function(e,t,r,n){t===void 0&&(t="#fff"),r===void 0&&(r="default"),n===void 0&&(n="rgb(150, 150, 150)");var a=[];return e.forEach(function(o){a.push(nv(o,t,r,n))}),a},R1="rgb(95, 149, 255)",k1="rgb(255, 255, 255)",$p="rgb(0, 0, 0)",Di=nv(R1,k1),Il={version:"0.8.20",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:Di.mainStroke,fill:Di.mainFill},size:20,color:Di.mainStroke,linkPoints:{size:8,lineWidth:1,fill:Di.activeFill,stroke:Di.activeStroke}},nodeStateStyles:{active:{fill:Di.activeFill,stroke:Di.activeStroke,lineWidth:2,shadowColor:Di.mainStroke,shadowBlur:10},selected:{fill:Di.selectedFill,stroke:Di.selectedStroke,lineWidth:4,shadowColor:Di.selectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{fill:Di.highlightFill,stroke:Di.highlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{fill:Di.inactiveFill,stroke:Di.inactiveStroke,lineWidth:1},disable:{fill:Di.disableFill,stroke:Di.disableStroke,lineWidth:1}},edgeLabel:{style:{fill:$p,textAlign:"center",textBaseline:"middle",fontSize:12}},defaultEdge:{type:"line",size:1,style:{stroke:Di.edgeMainStroke,lineAppendWidth:2},color:Di.edgeMainStroke},edgeStateStyles:{active:{stroke:Di.edgeActiveStroke,lineWidth:1},selected:{stroke:Di.edgeSelectedStroke,lineWidth:2,shadowColor:Di.edgeSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Di.edgeHighlightStroke,lineWidth:2,"text-shape":{fontWeight:500}},inactive:{stroke:Di.edgeInactiveStroke,lineWidth:1},disable:{stroke:Di.edgeDisableStroke,lineWidth:1}},comboLabel:{style:{fill:$p,textBaseline:"middle",fontSize:12},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:Di.comboMainFill,lineWidth:1,stroke:Di.comboMainStroke,r:5,width:20,height:10},size:[20,5],color:Di.comboMainStroke,padding:[25,20,15,20]},comboStateStyles:{active:{stroke:Di.comboActiveStroke,lineWidth:1,fill:Di.comboActiveFill},selected:{stroke:Di.comboSelectedStroke,lineWidth:2,fill:Di.comboSelectedFill,shadowColor:Di.comboSelectedStroke,shadowBlur:10,"text-shape":{fontWeight:500}},highlight:{stroke:Di.comboHighlightStroke,lineWidth:2,fill:Di.comboHighlightFill,"text-shape":{fontWeight:500}},inactive:{stroke:Di.comboInactiveStroke,fill:Di.comboInactiveFill,lineWidth:1},disable:{stroke:Di.comboDisableStroke,fill:Di.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"};function uh(i,e,t){if(i){if(typeof i.addEventListener=="function")return i.addEventListener(e,t,!1),{remove:function(){i.removeEventListener(e,t,!1)}};if(typeof i.attachEvent=="function")return i.attachEvent("on"+e,t),{remove:function(){i.detachEvent("on"+e,t)}}}}var B1=Xs.cloneEvent,F1=Xs.isViewportChanged,z1=function(i){(0,b.__extends)(e,i);function e(t){var r=i.call(this,t)||this;return r.extendEvents=[],r.dragging=!1,r.mousedown=!1,r.preItem=null,r.destroy(),r.graph=t,r.destroyed=!1,r.initEvents(),r}return e.prototype.initEvents=function(){var t=this,r=t.graph,n=t.extendEvents,a=n===void 0?[]:n,o=r.get("canvas"),s=o.get("el"),u=(0,h.wrapBehavior)(this,"onCanvasEvents"),f=(0,h.wrapBehavior)(this,"onExtendEvents"),c=(0,h.wrapBehavior)(this,"onWheelEvent");o.off("*").on("*",u),this.canvasHandler=u,a.push(uh(s,"wheel",c)),typeof window!="undefined"&&(a.push(uh(window,"keydown",f)),a.push(uh(window,"keyup",f)),a.push(uh(window,"focus",f))),this.resetHandler&&r.off("afterchangedata",this.resetHandler),this.resetHandler=(0,h.wrapBehavior)(this,"resetStatus"),r.on("afterchangedata",this.resetHandler)},e.getItemRoot=function(t){for(;t&&!t.get("item");)t=t.get("parent");return t},e.prototype.onCanvasEvents=function(t){var r=this,n=this.graph,a=n.get("canvas"),o=t.target,s=t.type;switch(s){case"drag":this.onCanvasEvents(Object.assign({},t,{type:"mousemove"}));break;case"dragend":this.onCanvasEvents(Object.assign({},t,{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}t.canvasX=t.x,t.canvasY=t.y;var u={x:t.canvasX,y:t.canvasY},f=n.get("group"),c=f.getMatrix();if(c||(c=[1,0,0,0,1,0,0,0,1]),F1(c)&&(u=n.getPointByClient(t.clientX,t.clientY)),t.x=u.x,t.y=u.y,t.currentTarget=n,o===a){(s==="mousemove"||s==="mouseleave")&&this.handleMouseMove(t,"canvas"),t.target=a,t.item=null,n.emit(s,t),n.emit("canvas:".concat(s),t);return}var l=e.getItemRoot(o);if(!l){n.emit(s,t);return}var _=l.get("item");if(!_.destroyed){var I=_.getType();if(t.target=o,t.item=_,t.canvasX===t.x&&t.canvasY===t.y){var B=n.getCanvasByPoint(t.x,t.y);t.canvasX=B.x,t.canvasY=B.y}t.name&&!t.name.includes(":")?(n.emit("".concat(I,":").concat(s),t),n.emit(s,t)):t.name&&n.emit(t.name,t),s==="dragstart"&&(this.dragging=!0),s==="dragend"&&(this.dragging=!1),s==="mousemove"&&this.handleMouseMove(t,I)}},e.prototype.onExtendEvents=function(t){this.graph.emit(t.type,t)},e.prototype.onWheelEvent=function(t){(0,h.isNil)(t.wheelDelta)&&(t.wheelDelta=-t.detail),this.graph.emit("wheel",t)},e.prototype.handleMouseMove=function(t,r){var n=this,a=n.graph,o=n.preItem,s=a.get("canvas"),u=t.target===s?null:t.item;t=B1(t),o&&o!==u&&!o.destroyed&&(t.item=o,this.emitCustomEvent(o.getType(),"mouseleave",t),this.dragging&&this.emitCustomEvent(o.getType(),"dragleave",t)),u&&o!==u&&(t.item=u,this.emitCustomEvent(r,"mouseenter",t),this.dragging&&this.emitCustomEvent(r,"dragenter",t)),this.preItem=u},e.prototype.emitCustomEvent=function(t,r,n){n.type=r,this.graph.emit("".concat(t,":").concat(r),n)},e.prototype.resetStatus=function(){this.mousedown=!1,this.dragging=!1,this.preItem=null},e.prototype.destroy=function(){var t=this,r=t.graph,n=t.canvasHandler,a=t.extendEvents,o=r.get("canvas");o.off("*",n),(0,h.each)(a,function(s){s.remove()}),this.resetStatus(),this.extendEvents.length=0,this.canvasHandler=null,this.resetHandler=null,this.destroyed=!0},e}(lp),G1=z1,Mi=C(483360),U1=C(981746),fh=C.n(U1),qp=Xs.traverseTree,W1=function(e,t){var r;return e?(0,h.isNumber)(e)?r=function(a){return e}:r=e:r=function(a){return t||1},r},Y1=function(e,t){var r=[],n=[],a={},o=0;for(o=0;o=0&&(s="x",o="y");var u=0;qp(e,function(l){return u++,l.x>a.x&&(a.x=l.x),l.xa.y&&(a.y=l.y),l.yWebGL.
','Find out how to get it here.'].join(` +`):['Your browser does not seem to support WebGL.
','Find out how to get it here.'].join(` +`)),t},addGetWebGLMessage:function(t){t=t||{};var r=t.parent!==void 0?t.parent:document.body,n=t.id!==void 0?t.id:"oldie",a=i().getWebGLErrorMessage();a.id=n,r.appendChild(a)}}},Jp=function(){var e=navigator.userAgent.toLowerCase();return e.indexOf("firefox")>-1?"firefox":e.indexOf("safari")>-1?"safari":e.indexOf("opr")>-1?"opera":e.indexOf("chrome")>-1?"chrome":e.indexOf("trident")>-1?"ie 11":e.indexOf("ie")>-1?"ie":"unknown"},K1=(0,b.__assign)((0,b.__assign)((0,b.__assign)((0,b.__assign)((0,b.__assign)({},Xs),A),E),D),F),sc=K1,$1=sc.radialLayout,q1=function(){function i(e){this.type=e.type,this.radial=e.radial,this.config=e}return i.prototype.init=function(e){var t=this;if(this.data=e,this.radial){this.layoutMethod=function(r){var n=fh()[t.type](r,t.config);return $1(n),n};return}this.layoutMethod=function(r){return fh()[t.type](r,t.config)}},i.prototype.execute=function(){return this.layoutMethod(this.data,this.config)},i.prototype.layout=function(e){return this.init(e),this.execute()},i}(),Q1=q1;(0,Mi.registerLayout)("grid",Mi.GridLayout),(0,Mi.registerLayout)("random",Mi.RandomLayout),(0,Mi.registerLayout)("force",Mi.ForceLayout),(0,Mi.registerLayout)("circular",Mi.CircularLayout),(0,Mi.registerLayout)("dagre",Mi.DagreLayout),(0,Mi.registerLayout)("dagreCompound",Mi.DagreCompoundLayout),(0,Mi.registerLayout)("radial",Mi.RadialLayout),(0,Mi.registerLayout)("concentric",Mi.ConcentricLayout),(0,Mi.registerLayout)("mds",Mi.MDSLayout),(0,Mi.registerLayout)("fruchterman",Mi.FruchtermanLayout),(0,Mi.registerLayout)("fruchterman-gpu",Mi.FruchtermanGPULayout),(0,Mi.registerLayout)("gForce",Mi.GForceLayout),(0,Mi.registerLayout)("force2",Mi.Force2Layout),(0,Mi.registerLayout)("gForce-gpu",Mi.GForceGPULayout),(0,Mi.registerLayout)("comboForce",Mi.ComboForceLayout),(0,Mi.registerLayout)("comboCombined",Mi.ComboCombinedLayout),(0,Mi.registerLayout)("forceAtlas2",Mi.ForceAtlas2Layout);var J1=function(e,t){t.isCustomLayout=!0,Mi.Layouts[e]=(0,Mi.registerLayout)(e,t)},tx=function(){function i(e,t){var r=e.toString(),n=new Blob(["importScripts('".concat(t,"');(").concat(r,")()")],{type:"text/javascript"});return new Worker(URL.createObjectURL(n))}return i}(),ex=tx,rx=function(e){e===void 0&&(e="https://unpkg.com/@antv/layout@0.3.23/dist/layout.min.js");function t(){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(s){var u=s.data.type;return u===n.RUN||u===n.GPURUN}function o(s){var u=this,f=s.data.type;switch(f){case n.RUN:{var c=s.data,l=c.nodes,_=c.edges,I=c.layoutCfg,B=I===void 0?{}:I,j=B.type,et=layout.getLayoutByName(j);if(!et){this.postMessage({type:n.ERROR,message:"layout ".concat(j," not found")});break}var ut;B.onLayoutEnd=function(){u.postMessage({type:n.END,nodes:l}),ut==null||ut.destroy()},ut=new et(B),ut.init({nodes:l,edges:_}),ut.execute();break}case n.GPURUN:{var ct=s.data,pt=ct.nodes,_=ct.edges,Mt=ct.layoutCfg,B=Mt===void 0?{}:Mt,Zt=ct.canvas,j=B.type,et=layout.getLayoutByName(j);if(!et){this.postMessage({type:n.ERROR,message:"layout ".concat(j," not found")});break}if(j.split("-")[1]!=="gpu"){this.postMessage({type:n.ERROR,message:"layout ".concat(j," does not support GPU")});break}var se=new et(B);se.init({nodes:pt,edges:_}),se.executeWithWorker(Zt,this);break}default:break}}onmessage=function(u){a(u)&&o(u)}}var r=new ex(t,e);return r},sd={RUN:"LAYOUT_RUN",END:"LAYOUT_END",ERROR:"LAYOUT_ERROR",TICK:"LAYOUT_TICK",GPURUN:"GPU_LAYOUT_RUN",GPUEND:"GPU_LAYOUT_END"};function av(i){"@babel/helpers - typeof";return av=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},av(i)}var tg=function(e){return setTimeout(e,16)},eg=function(e){return clearTimeout(e)},ch={requestAnimationFrame:function(e){var t=typeof window!="undefined"&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame)||tg;return t(e)},cancelAnimationFrame:function(e){var t=typeof window!="undefined"&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame)||eg;return t(e)}},nx=["fruchterman","gForce"],ax=["force","grid","circular"],ix=function(i){(0,b.__extends)(e,i);function e(t){var r=i.call(this,t)||this;return r.graph=t,r.layoutCfg=t.get("layout")||{},r.layoutType=r.getLayoutType(),r.worker=null,r.workerData={},r.initLayout(),r}return e.prototype.initLayout=function(){},e.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=rx(this.layoutCfg.workerScriptURL),this.worker)},e.prototype.stopWorker=function(){var t=this.workerData;this.worker&&(this.worker.terminate(),this.worker=null,t.requestId&&(ch.cancelAnimationFrame(t.requestId),t.requestId=null),t.requestId2&&(ch.cancelAnimationFrame(t.requestId2),t.requestId2=null))},e.prototype.execLayoutMethod=function(t,r){var n=this;return new Promise(function(a,o){return(0,b.__awaiter)(n,void 0,void 0,function(){var s,u,f,c,l,j,_,I,B,j,et;return(0,b.__generator)(this,function(ut){switch(ut.label){case 0:if(s=this.graph,!s||s.get("destroyed"))return[2];u=t.type,t.onLayoutEnd=function(){s.emit("aftersublayout",{type:u}),a()},u&&this.isGPU&&(rg(u)?u="".concat(u,"-gpu"):console.warn("The '".concat(u,"' layout does not support GPU calculation for now, it will run in CPU."))),Xs.isForce(u)?(f=t.onTick,c=t.animate,l=c===void 0&&(u==="force"||u==="force2"),j=function(){f&&f(),(c||l)&&s.refreshPositions()},t.tick=j):(u==="comboForce"||u==="comboCombined")&&(t.comboTrees=s.get("comboTrees")),_=!1;try{I=new Mi.Layouts[u](t),this.layoutMethods[r]&&this.layoutMethods[r].destroy(),this.layoutMethods[r]=I}catch(ct){console.warn("The layout method: '".concat(u,"' does not exist! Please specify it first.")),o()}return _=I.enableTick,_&&(B=t.onTick,j=function(){B&&B(),s.refreshPositions()},I.tick=j),et=this.filterLayoutData(this.data,t),fx(et,r),I.init(et),s.emit("beforesublayout",{type:u}),[4,I.execute()];case 1:return ut.sent(),I.isCustomLayout&&t.onLayoutEnd&&t.onLayoutEnd(),[2]}})})})},e.prototype.updateLayoutMethod=function(t,r){var n=this;return new Promise(function(a,o){return(0,b.__awaiter)(n,void 0,void 0,function(){var s,u,f,c,l,_,I;return(0,b.__generator)(this,function(B){switch(B.label){case 0:return s=this.graph,u=r==null?void 0:r.type,r.onLayoutEnd=function(){s.emit("aftersublayout",{type:u}),a()},Xs.isForce(u)&&(f=r.onTick,c=r.animate,l=c===void 0&&(u==="force"||u==="force2"),_=function(){f==null||f(),(c||l)&&s.refreshPositions()},r.tick=_),I=this.filterLayoutData(this.data,r),t.init(I),t.updateCfg(r),s.emit("beforesublayout",{type:u}),[4,t.execute()];case 1:return B.sent(),t.isCustomLayout&&r.onLayoutEnd&&r.onLayoutEnd(),[2]}})})})},e.prototype.layout=function(t){var r=this,n,a=this.graph;if(!(!a||a.get("destroyed"))){this.data=this.setDataFromGraph();var o=this.data,s=o.nodes,u=o.hiddenNodes;if(!s)return!1;var f=a.get("width"),c=a.get("height"),l={};Object.assign(l,{width:f,height:c,center:[f/2,c/2]},this.layoutCfg),this.layoutCfg=l;var _=l.type,I=!1;(n=this.layoutMethods)===null||n===void 0||n.forEach(function(Zt){var se;return I=!!(!((se=Zt.nodes)===null||se===void 0)&&se.length)||I});var B=this.destoryLayoutMethods();a.emit("beforelayout");var j=Promise.resolve();I&&_&&(B==null?void 0:B.length)===1&&B[0]===_?this.tweakInit():j=this.initPositions(l.center,s);var et=this.initPositions(l.center,u);et.then(),this.isGPU=ng(l,_);var ut=l.onLayoutEnd,ct=l.layoutEndFormatted,pt=l.adjust;if(ct||(l.layoutEndFormatted=!0,l.onAllLayoutEnd=function(){return(0,b.__awaiter)(r,void 0,void 0,function(){return(0,b.__generator)(this,function(Zt){switch(Zt.label){case 0:return ut&&ut(s),this.refreshLayout(),pt&&l.pipes?[4,this.adjustPipesBox(this.data,pt)]:[3,2];case 1:Zt.sent(),this.refreshLayout(),Zt.label=2;case 2:return a.emit("afterlayout"),[2]}})})}),this.stopWorker(),l.workerEnabled&&this.layoutWithWorker(this.data,t))return!0;var Mt=!1;return l.type?(Mt=!0,j=j.then(function(){return(0,b.__awaiter)(r,void 0,void 0,function(){return(0,b.__generator)(this,function(Zt){switch(Zt.label){case 0:return[4,this.execLayoutMethod(l,0)];case 1:return[2,Zt.sent()]}})})})):l.pipes&&(Mt=!0,l.pipes.forEach(function(Zt,se){j=j.then(function(){return(0,b.__awaiter)(r,void 0,void 0,function(){return(0,b.__generator)(this,function(oe){switch(oe.label){case 0:return[4,this.execLayoutMethod(Zt,se)];case 1:return[2,oe.sent()]}})})})})),Mt?j.then(function(){l.onAllLayoutEnd&&l.onAllLayoutEnd(),t&&t()}).catch(function(Zt){console.warn("graph layout failed,",Zt)}):(a.refreshPositions(),t==null||t()),!1}},e.prototype.tweakInit=function(){var t=this,r=t.data,n=t.graph,a=r.nodes,o=r.edges;if(a!=null&&a.length){var s={};a.forEach(function(c){var l=c.x,_=c.y;!isNaN(l)&&!isNaN(_)&&(s[c.id]={x:l,y:_},c.mass=c.mass||2)}),o.forEach(function(c){var l=c.source,_=c.target,I=s[l],B=s[_];!I&&B?s[l]={x:B.x+(Math.random()-.5)*80,y:B.y+(Math.random()-.5)*80}:!B&&I&&(s[_]={x:I.x+(Math.random()-.5)*80,y:I.y+(Math.random()-.5)*80})});var u=n.get("width"),f=n.get("height");a.forEach(function(c){var l=s[c.id]||{x:u/2+(Math.random()-.5)*20,y:f/2+(Math.random()-.5)*20};c.x=l.x,c.y=l.y})}},e.prototype.initWithPreset=function(t,r){var n=this;return new Promise(function(a,o){return(0,b.__awaiter)(n,void 0,void 0,function(){var s,u,f,c,l,_,I;return(0,b.__generator)(this,function(B){switch(B.label){case 0:return s=this,u=s.layoutCfg,f=s.data,c=u.preset,!(c!=null&&c.type)||!Mi.Layouts[c==null?void 0:c.type]?(r==null||r(),a(),[2,!1]):(l=ng(c,c.type),_=l?"".concat(c.type,"-gpu"):c.type,I=new Mi.Layouts[_](c),delete u.preset,I.init(f),[4,I.execute()]);case 1:return B.sent(),t==null||t(),a(),[2,!0]}})})})},e.prototype.layoutWithWorker=function(t,r){var n=this,a=this,o=a.layoutCfg,s=a.graph,u=this.getWorker(),f=this.workerData;if(!u)return!1;f.requestId=null,f.requestId2=null,f.currentTick=null,f.currentTickData=null,s.emit("beforelayout");var c=Promise.resolve(),l=!1;if(o.type)l=!0,c=c.then(function(){return n.runWebworker(u,t,o)});else if(o.pipes){l=!0;for(var _=function(ut){c=c.then(function(){return n.runWebworker(u,t,ut)})},I=0,B=o.pipes;I]*>/,sv={tr:document.createElement("tbody"),tbody:Td,thead:Td,tfoot:Td,td:ov,th:ov,"*":document.createElement("div")}}function qo(i){Td||cx();var e=ag.test(i)&&RegExp.$1;(!e||!(e in sv))&&(e="*");var t=sv[e];i=typeof i=="string"?i.replace(/(^\s*)|(\s*$)/g,""):i,t.innerHTML=""+i;var r=t.childNodes[0];return r&&t.contains(r)&&t.removeChild(r),r}var lx=function(e){var t=e.clone();return dx(e,t),t},dx=function i(e,t){var r;e.isGroup()&&t.isGroup()&&((r=e.get("children"))===null||r===void 0||r.forEach(function(s,u){var f=t.get("children")[u];i(s,f)}));var n=e.get("type"),a=t.get("type");if(!(n!=="image"||a!=="image")){var o=e.get("clipShape");o&&t.setClip({type:o.get("type"),attrs:o.attr()})}},ig=Xt,hx="svg",vx=function(i){(0,b.__extends)(e,i);function e(t){var r=i.call(this,t)||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 e.prototype.initLayoutController=function(){var t=new ox(this);this.set({layoutController:t})},e.prototype.initEventController=function(){var t=new G1(this);this.set({eventController:t})},e.prototype.initCanvas=function(){var t=this.get("container");if(typeof t=="string"&&(t=document.getElementById(t),this.set("container",t)),!t)throw new Error("invalid container");var r=t.clientWidth,n=t.clientHeight,a=this.get("width")||r,o=this.get("height")||n;!this.get("width")&&!this.get("height")&&(this.set("width",r),this.set("height",n));var s=this.get("renderer"),u;if(s===hx)u=new _d({container:t,width:a,height:o});else{var f={container:t,width:a,height:o},c=this.get("pixelRatio");c&&(f.pixelRatio=c,window.devicePixelRatio=c),u=new oc(f)}this.set("canvas",u)},e.prototype.initPlugins=function(){var t=this;(0,h.each)(t.get("plugins"),function(r){!r.destroyed&&r.initPlugin&&r.initPlugin(t)})},e.prototype.downloadImageWatermark=function(t,r,n,a){return(0,b.__awaiter)(this,void 0,void 0,function(){var o,s,u;return(0,b.__generator)(this,function(f){switch(f.label){case 0:return o=t.style.backgroundImage,s=o.slice(5,o.length-2),u=new Image,u.src=s,[4,new Promise(function(c){u.onload=function(){var l=r.createPattern(u,"repeat");r.rect(0,0,n,a),r.fillStyle=l,r.fill(),c("")}})];case 1:return f.sent(),[2]}})})},e.prototype.asyncToDataUrl=function(t,r,n,a,o,s){var u=this,f=document.querySelector(".g6-graph-watermarker"),c=this.get("canvas"),l=c.getRenderer(),_=s||c.get("el"),I="";t||(t="image/png"),setTimeout(function(){return(0,b.__awaiter)(u,void 0,void 0,function(){var B,j,et,ut,ct,pt,Mt,Zt,se,oe;return(0,b.__generator)(this,function(_e){switch(_e.label){case 0:return l!=="svg"?[3,1]:(B=_.cloneNode(!0),j=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),et=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",j),et.replaceChild(B,et.documentElement),ut=new XMLSerializer().serializeToString(et),I="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(ut)),[3,4]);case 1:return ct=void 0,pt=_.getContext("2d"),Mt=a||this.get("width"),Zt=o||this.get("height"),se=void 0,f?[4,this.downloadImageWatermark(f,pt,Mt,Zt)]:[3,3];case 2:_e.sent(),_e.label=3;case 3:if(r){oe=typeof window!="undefined"?window.devicePixelRatio:1;try{ct=pt.getImageData(0,0,Mt*oe,Zt*oe),se=pt.globalCompositeOperation,pt.globalCompositeOperation="destination-over",pt.fillStyle=r,pt.fillRect(0,0,Mt,Zt)}catch(Ue){console.error("Download image failed. Out of memory at ImageData creation")}}I=_.toDataURL(t),r&&(pt.clearRect(0,0,Mt,Zt),pt.putImageData(ct,0,0),pt.globalCompositeOperation=se),_e.label=4;case 4:return n&&n(I),[2]}})})},16)},e.prototype.toDataURL=function(t,r){var n=this.get("canvas"),a=n.getRenderer(),o=n.get("el");t||(t="image/png");var s="";if(a==="svg"){var u=o.cloneNode(!0),f=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),c=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",f);c.replaceChild(u,c.documentElement);var l=new XMLSerializer().serializeToString(c);s="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(l))}else{var _=void 0,I=o.getContext("2d"),B=Math.max(this.get("width"),500),j=Math.max(this.get("height"),500),et=void 0;if(r){var ut=typeof window!="undefined"&&window.devicePixelRatio||1;try{_=I.getImageData(0,0,B*ut,j*ut),et=I.globalCompositeOperation,I.globalCompositeOperation="destination-over",I.fillStyle=r,I.fillRect(0,0,B,j)}catch(ct){console.error("Download image failed. Out of memory at ImageData creation")}}s=o.toDataURL(t),r&&(I.clearRect(0,0,B,j),I.putImageData(_,0,0),I.globalCompositeOperation=et)}return s},e.prototype.toFullDataURL=function(t,r,n){var a=this.get("group").getCanvasBBox(),o=a.height,s=a.width,u=this.get("renderer"),f=qo('
'),c=n?n.backgroundColor:void 0,l=n?n.padding:void 0;l?(0,h.isNumber)(l)&&(l=[l,l,l,l]):l=[0,0,0,0];var _=o+l[0]+l[2],I=s+l[1]+l[3],B={container:f,height:_,width:I,quickHit:!0},j=u==="svg"?new _d(B):new oc(B),et=this.get("group"),ut=et.clone(),ct=(0,h.clone)(ut.getMatrix());ct||(ct=[1,0,0,0,1,0,0,0,1]);var pt=(a.maxX+a.minX)/2,Mt=(a.maxY+a.minY)/2;ct=ig(ct,[["t",-pt,-Mt],["t",s/2+l[3],o/2+l[0]]]),ut.resetMatrix(),ut.setMatrix(ct),j.add(ut);var Zt=j.get("el"),se="";r||(r="image/png"),setTimeout(function(){if(u==="svg"){var oe=Zt.cloneNode(!0),_e=document.implementation.createDocumentType("svg","-//W3C//DTD SVG 1.1//EN","http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"),Ue=document.implementation.createDocument("http://www.w3.org/2000/svg","svg",_e);Ue.replaceChild(oe,Ue.documentElement);var Re=new XMLSerializer().serializeToString(Ue);se="data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(Re))}else{var qe=void 0,hr=Zt.getContext("2d"),nn=void 0;if(c){var kn=typeof window!="undefined"?window.devicePixelRatio:1;try{qe=hr.getImageData(0,0,I*kn,_*kn),nn=hr.globalCompositeOperation,hr.globalCompositeOperation="destination-over",hr.fillStyle=c,hr.fillRect(0,0,I,_)}catch(En){console.error("Download image failed. Out of memory at ImageData creation")}}se=Zt.toDataURL(r),c&&(hr.clearRect(0,0,I,_),hr.putImageData(qe,0,0),hr.globalCompositeOperation=nn)}t&&t(se)},16)},e.prototype.downloadFullImage=function(t,r,n){var a=this,o=this.get("group").getCanvasBBox(),s=o.height,u=o.width,f=this.get("renderer"),c=qo('
'),l=document.querySelector(".g6-graph-watermarker"),_=n?n.backgroundColor:void 0,I=n?n.padding:void 0;I?(0,h.isNumber)(I)&&(I=[I,I,I,I]):I=[0,0,0,0];var B=s+I[0]+I[2],j=u+I[1]+I[3];if(l){var et=this.get("graphWaterMarker").cfg||{},ut=et.width,ct=et.height;B=Math.ceil(B/ct)*ct,j=Math.ceil(j/ut)*ut}var pt={container:c,height:B,width:j},Mt=f==="svg"?new _d(pt):new oc(pt),Zt=this.get("group"),se=lx(Zt),oe=(0,h.clone)(se.getMatrix());oe||(oe=[1,0,0,0,1,0,0,0,1]);var _e=(o.maxX+o.minX)/2,Ue=(o.maxY+o.minY)/2;oe=ig(oe,[["t",-_e,-Ue],["t",u/2+I[3],s/2+I[0]]]),se.resetMatrix(),se.setMatrix(oe),Mt.add(se);var Re=Mt.get("el");r||(r="image/png"),this.asyncToDataUrl(r,_,function(qe){var hr=document.createElement("a"),nn=(t||"graph")+(f==="svg"?".svg":".".concat(r.split("/")[1]));a.dataURLToImage(qe,f,hr,nn);var kn=document.createEvent("MouseEvents");kn.initEvent("click",!1,!1),hr.dispatchEvent(kn)},j,B,Re)},e.prototype.downloadImage=function(t,r,n){var a=this,o=this;o.stopAnimate();var s=o.get("canvas"),u=s.getRenderer();r||(r="image/png");var f=(t||"graph")+(u==="svg"?".svg":r.split("/")[1]),c=document.createElement("a");o.asyncToDataUrl(r,n,function(l){a.dataURLToImage(l,u,c,f);var _=document.createEvent("MouseEvents");_.initEvent("click",!1,!1),c.dispatchEvent(_)})},e.prototype.dataURLToImage=function(t,r,n,a){if(!t||t==="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 o=t.split(","),s="";if(o&&o.length>0){var u=o[0].match(/:(.*?);/);u&&u.length>=2&&(s=u[1])}for(var f=atob(o[1]),c=f.length,l=new Uint8Array(c);c--;)l[c]=f.charCodeAt(c);var _=new Blob([l],{type:s});window.navigator.msSaveBlob?window.navigator.msSaveBlob(_,a):n.addEventListener("click",function(){n.download=a,n.href=window.URL.createObjectURL(_)})}else n.addEventListener("click",function(){n.download=a,n.href=t})},e.prototype.addPlugin=function(t){var r=this;t.destroyed||(r.get("plugins").push(t),t.initPlugin(r))},e.prototype.removePlugin=function(t){var r=this.get("plugins"),n=r.indexOf(t);n>=0&&(t.destroyPlugin(),r.splice(n,1))},e.prototype.setImageWaterMarker=function(t,r){t===void 0&&(t=Il.waterMarkerImage);var n=this.get("container");(0,h.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var a=this.get("graphWaterMarker"),o=(0,h.deepMix)({},Il.imageWaterMarkerConfig,r),s=o.width,u=o.height,f=o.compatible,c=o.image;if(!t){var l=f?n:document.querySelector(".g6-graph-watermarker");l&&(l.style.cssText=void 0),a&&a.clear();return}if(a)a.clear();else{var _={container:n,width:s,height:u,capture:!1},I=this.get("pixelRatio");I&&(_.pixelRatio=I,window.devicePixelRatio=I),a=new oc(_),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var B=a.get("context"),j=c.rotate,et=c.x,ut=c.y;B.rotate(-j*Math.PI/180);var ct=new Image;ct.crossOrigin="anonymous",ct.src=t,ct.onload=function(){if(B.drawImage(ct,et,ut,c.width,c.height),B.rotate(j*Math.PI/180),f)n.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var pt=document.querySelector(".g6-graph-watermarker");pt||(pt=document.createElement("div"),pt.className="g6-graph-watermarker"),pt.className="g6-graph-watermarker",a.destroyed||(pt.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(pt))}}},e.prototype.setTextWaterMarker=function(t,r){var n=this.get("container");(0,h.isString)(n)&&(n=document.getElementById(n)),n.style.position||(n.style.position="relative");var a=this.get("graphWaterMarker"),o=(0,h.deepMix)({},Il.textWaterMarkerConfig,r),s=o.width,u=o.height,f=o.compatible,c=o.text;if(!(t!=null&&t.length)){var l=f?n:document.querySelector(".g6-graph-watermarker");l&&(l.style.cssText=void 0),a&&a.clear();return}if(a)a.clear();else{var _={container:n,width:s,height:u,capture:!1},I=this.get("pixelRatio");I&&(_.pixelRatio=I,window.devicePixelRatio=I),a=new oc(_),this.set("graphWaterMarker",a)}a.get("el").style.display="none";var B=a.get("context"),j=c.rotate,et=c.fill,ut=c.fontFamily,ct=c.fontSize,pt=c.baseline,Mt=c.x,Zt=c.y,se=c.lineHeight;B.rotate(-j*Math.PI/180),B.font="".concat(ct,"px ").concat(ut),B.fillStyle=et,B.textBaseline=pt;for(var oe=(0,h.isString)(t)?[t]:t,_e=oe.length-1;_e>=0;_e--)B.fillText(oe[_e],Mt,Zt+_e*se);if(B.rotate(j*Math.PI/180),f)n.style.cssText="background-image: url(".concat(a.get("el").toDataURL("image/png"),");background-repeat:repeat;");else{var Ue=document.querySelector(".g6-graph-watermarker");Ue||(Ue=document.createElement("div"),Ue.className="g6-graph-watermarker"),Ue.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(Ue)}},e.prototype.destroy=function(){var t,r,n,a;(0,h.each)(this.get("plugins"),function(c){c.destroyPlugin()});var o=this.get("tooltips");if(o)for(var s=0;s0)for(var f=s.length-1;f>=0;f--){var c=s[f].getModel();e.indexOfChild(t.children||[],c.id)===-1&&(a.innerRemoveChild(c.id,{x:t.x,y:t.y},n),s.splice(f,1))}}var l,_;o.get("originAttrs")&&(l=o.get("originAttrs").x,_=o.get("originAttrs").y);var I=o.getModel();n&&o.set("originAttrs",{x:I.x,y:I.y}),o.set("model",Object.assign(I,t.data)),(l!==t.x||_!==t.y)&&o.updatePosition({x:t.x,y:t.y})},e.prototype.innerRemoveChild=function(t,r,n){var a=this,o=a.findById(t);if(o)if((0,h.each)(o.get("children"),function(u){a.innerRemoveChild(u.getModel().id,r,n)}),n){var s=o.getModel();o.set("to",r),o.set("originAttrs",{x:s.x,y:s.y}),a.get("removeList").push(o)}else a.removeItem(o,!1)},e.prototype.changeData=function(t,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:t||n.get("data")}),t?(n.data(t),n.render(!1)):n.layout(this.get("fitView"))},e.prototype.changeLayout=function(t){console.warn("Please call updateLayout instead of changeLayout. changeLayout will be discarded soon");var r=this;r.updateLayout(t)},e.prototype.updateLayout=function(t,r,n,a){a===void 0&&(a=!0);var o=this;if(!t){console.warn("layout cannot be null");return}if(a&&this.get("enabledStack")&&this.pushStack("layout",{before:o.get("layout"),after:t}),o.set("layout",t),o.set("layoutMethod",o.getLayout()),o.layout(),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 u=this.getGroup().getMatrix()||[1,0,0,0,1,0,0,0,1];s.x=s.x*u[0]+u[6],s.y=s.y*u[0]+u[7];var f=this.getGroup().getCanvasBBox(),c=f.minX,l=f.maxX,_=f.minY,I=f.maxY,B={x:(c+l)/2,y:(_+I)/2};r==="begin"&&(B.x=c,B.y=_),this.translate(s.x-B.x,s.y-B.y)}},e.prototype.refreshLayout=function(t){console.warn("Please call layout instead of refreshLayout. refreshLayout will be discarded soon");var r=this;r.layout(t)},e.prototype.layout=function(t){var r=this,n=this,a=n.get("data"),o=n.get("layoutMethod"),s=n.get("layout"),u=a;if(s!=null&&s.excludeInvisibles){a=(0,h.clone)(n.get("data"));var f={};uv(a,function(_){var I=_.children;if(!(I!=null&&I.length))return!0;for(var B=I.length-1;B>=0;B--){var j=r.findById(I[B].id),et=j?!j.isVisible():I[B].visible===!1;et&&(f[_.id]=f[_.id]||[],f[_.id].push({idx:B,child:I.splice(B,1)[0]}))}}),u=o?o(a,n.get("layout")):a,uv(u,function(_){var I=f[_.id];if(I!=null&&I.length)for(var B=I.length-1;B>=0;B--){var j=I[B],et=j.idx,ut=j.child;_.children.splice(et,0,ut)}})}else u=o?o(a,n.get("layout")):a;var c=n.get("animate");if(n.emit("beforerefreshlayout",{data:a,layoutData:u}),n.emit("beforelayout"),n.innerUpdateChild(u,void 0,c),t){var l=n.get("viewController");l.fitView()}c?n.layoutAnimate(u):(n.refresh(),n.paint()),n.emit("afterrefreshlayout",{data:a,layoutData:u}),n.emit("afterlayout")},e.prototype.addChild=function(t,r,n){n===void 0&&(n=!0);var a=this;a.emit("beforeaddchild",{model:t,parent:r}),(0,h.isString)(r)||(r=r.get("id"));var o=a.findDataById(r);if(o){o.children||(o.children=[]),o.children.push(t);var s=a.findById(r);s.refresh(),a.changeData(void 0,n)}},e.prototype.updateChildren=function(t,r,n){n===void 0&&(n=!0);var a=this,o=a.findById(r);if(!r||!o){console.warn("Update children failed! There is no node with id '".concat(r,"'"));return}var s=a.findDataById(r);s.children=t,o.refresh(),a.changeData(void 0,n)},e.prototype.updateChild=function(t,r,n){n===void 0&&(n=!0);var a=this;if(!r||!a.findById(r)){a.changeData(t,n);return}var o=a.findDataById(r),s=a.findById(t.id);if(o.children||(o.children=[]),!s)o.children.push(t);else{var u=e.indexOfChild(o.children,t.id);u>-1&&(o.children[u]=t)}var f=a.findById(r);f==null||f.refresh(),a.changeData(void 0,n)},e.prototype.removeChild=function(t,r){r===void 0&&(r=!0);var n=this,a=n.findById(t),o;if(a?o=a==null?void 0:a.get("parent"):o=n.getNodes().find(function(l){var _=l.getModel().children||[];return!!_.find(function(I){return I.id===t})}),o&&!o.destroyed){var s=o.get("id"),u=n.findDataById(s),f=u&&u.children||[],c=e.indexOfChild(f,t);f.splice(c,1),o.refresh()}n.changeData(void 0,r)},e.prototype.findDataById=function(t,r){var n=this;if(r||(r=n.get("data")),t===r.id)return r;var a=null;return(0,h.each)(r.children||[],function(o){if(o.id===t)return a=o,!1;if(a=n.findDataById(t,o),a)return!1}),a},e.prototype.layoutAnimate=function(t,r){var n=this,a=this.get("animateCfg");n.emit("beforeanimate",{data:t}),n.getEdges().forEach(function(o){var s=o.get("model");s.sourceAnchor||(s.sourceAnchor=o.get("sourceAnchorIndex"))}),this.get("canvas").animate(function(o){uv(t,function(s){var u=n.findById(s.id);if(u){var f=u.get("originAttrs"),c=u.get("model");if(f||(f={x:c.x,y:c.y},u.set("originAttrs",f)),r){var l=r(u,o,f,t);u.set("model",Object.assign(c,l))}else c.x=f.x+(s.x-f.x)*o,c.y=f.y+(s.y-f.y)*o}return!0}),(0,h.each)(n.get("removeList"),function(s){var u=s.getModel(),f=s.get("originAttrs"),c=s.get("to");u.x=f.x+(c.x-f.x)*o,u.y=f.y+(c.y-f.y)*o}),n.refreshPositions()},{duration:a.duration,easing:a.ease,callback:function(){(0,h.each)(n.getNodes(),function(s){s.set("originAttrs",null)}),(0,h.each)(n.get("removeList"),function(s){n.removeItem(s,!1)}),n.set("removeList",[]),a.callback&&a.callback(),n.emit("afteranimate",{data:t})},delay:a.delay})},e.prototype.stopLayoutAnimate=function(){this.get("canvas").stopAnimate(),this.emit("layoutanimateend",{data:this.get("data")}),this.layoutAnimating=!1},e.prototype.isLayoutAnimating=function(){return this.layoutAnimating},e.prototype.render=function(t){t===void 0&&(t=!0);var r=this,n=r.get("data");if(!n||!(0,h.isObject)(n)||!Object.keys(n).length)throw new Error("data must be defined first");r.clear(),t&&this.get("enabledStack")&&this.clearStack(),r.emit("beforerender"),r.layout(this.get("fitView")),r.emit("afterrender")},e.prototype.save=function(){return this.get("data")},e.prototype.data=function(t){i.prototype.data.call(this,t),this.set("originData",JSON.parse(JSON.stringify(t)))},e}(og),mx=gx;function pi(i,e){if(i)for(var t in e)e.hasOwnProperty(t)&&(i.style[t]=e[t]);return i}var yx=function(){function i(e){this._cfgs=(0,h.deepMix)(this.getDefaultCfgs(),e),this._events={},this.destroyed=!1}return i.prototype.getDefaultCfgs=function(){return{}},i.prototype.initPlugin=function(e){var t=this;t.set("graph",e);var r=t.getEvents(),n={};(0,h.each)(r,function(a,o){var s=(0,h.wrapBehavior)(t,a);n[o]=s,e.on(o,s)}),this._events=n,this.init()},i.prototype.getEvents=function(){return{}},i.prototype.get=function(e){var t;return(t=this._cfgs)===null||t===void 0?void 0:t[e]},i.prototype.set=function(e,t){this._cfgs[e]=t},i.prototype.destroy=function(){},i.prototype.destroyPlugin=function(){this.destroy();var e=this.get("graph"),t=this._events;(0,h.each)(t,function(r,n){e.off(n,r)}),this._events=null,this._cfgs=null,this.destroyed=!0},i}(),cu=yx,xx=function(){var i=function(t,r){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},i(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),sg="url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)",bx=function(i){xx(e,i);function e(t){return i.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{img:sg,follow:!0}},e.prototype.init=function(){var t=this.get("graph"),r=t.get("container"),n=t.get("canvas").get("el"),a=this.get("img")||sg;a.includes("url(")||(a='url("'.concat(a,'")'));var o=qo(`
`),s=qo(`
`));this.set("container",o),this.set("gridContainer",s),this.positionInit(),o.appendChild(s),r.insertBefore(o,n)},e.prototype.positionInit=function(){var t=this.get("graph"),r=t.get("minZoom"),n=t.get("width"),a=t.get("height");pi(this.get("container"),{width:"".concat(n,"px"),height:"".concat(a,"px")});var o=n*80/r,s=a*80/r;pi(this.get("gridContainer"),{width:"".concat(o,"px"),height:"".concat(s,"px"),left:"-".concat(o/2,"px"),top:"-".concat(s/2,"px")})},e.prototype.getEvents=function(){return{viewportchange:"updateGrid"}},e.prototype.updateGrid=function(t){var r=this.get("gridContainer"),n=t.matrix;n||(n=[1,0,0,0,1,0,0,0,1]);var a=this.get("follow"),o="matrix(".concat(n[0],", ").concat(n[1],", ").concat(n[3],", ").concat(n[4],", ").concat(a?n[6]:"0",", ").concat(a?n[7]:"0",")");pi(r,{transform:o})},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t=this.get("graph"),r=t.get("container"),n=this.get("container");r.removeChild(n)},e}(cu),Ex=bx,wx=C(738186),lh=C.n(wx),Sx=function(){var i=function(t,r){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},i(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();typeof document!="undefined"&&lh()(` + .g6-component-contextmenu { + border: 1px solid #e2e2e2; + border-radius: 4px; + font-size: 12px; + color: #545454; + background-color: rgba(255, 255, 255, 0.9); + padding: 10px 8px; + box-shadow: rgb(174, 174, 174) 0px 0px 10px; + } + .g6-contextmenu-ul { + padding: 0; + margin: 0; + list-style: none; + } + +`);var Mx=function(i){Sx(e,i);function e(t){return i.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{offsetX:6,offsetY:6,handleMenuClick:void 0,getContent:function(r){return` +
    +
  • \u83DC\u5355\u98791
  • +
  • \u83DC\u5355\u98792
  • +
+ `},shouldBegin:function(r){return!0},onHide:function(){return!0},itemTypes:["node","edge","combo"],trigger:"contextmenu"}},e.prototype.getEvents=function(){return this.get("trigger")==="click"?{click:"onMenuShow",touchend:"onMenuShow"}:{contextmenu:"onMenuShow"}},e.prototype.init=function(){var t=this.get("className"),r=qo("
"));pi(r,{top:"0px",position:"absolute",visibility:"hidden"});var n=this.get("container");n||(n=this.get("graph").get("container")),(0,h.isString)(n)&&(n=document.getElementById(n)),n.appendChild(r),this.set("menu",r)},e.prototype.onMenuShow=function(t){var r=this;t.preventDefault();var n=this.get("itemTypes");if(t.item){if(t.item&&t.item.getType&&n.indexOf(t.item.getType())===-1){r.onMenuHide();return}}else if(n.indexOf("canvas")===-1){r.onMenuHide();return}var a=this.get("shouldBegin");if(a(t)){var o=this.get("menu"),s=this.get("getContent"),u=this.get("graph"),f=s(t,u);(0,h.isString)(f)?o.innerHTML=f:o.innerHTML=f.outerHTML,this.removeMenuEventListener();var c=this.get("handleMenuClick");if(c){var l=function(_e){c(_e.target,t.item,u)};this.set("handleMenuClickWrapper",l),o.addEventListener("click",l)}var _=u.get("width"),I=u.get("height"),B=o.getBoundingClientRect(),j=this.get("offsetX")||0,et=this.get("offsetY")||0,ut=u.getContainer().offsetTop,ct=u.getContainer().offsetLeft,pt=t.canvasX+ct+j,Mt=t.canvasY+ut+et;pt+B.width>_&&(pt=t.canvasX-B.width-j+ct),Mt+B.height>I&&(Mt=t.canvasY-B.height-et+ut),pi(o,{top:"".concat(Mt,"px"),left:"".concat(pt,"px"),visibility:"visible"});var Zt=this.get("trigger")==="click",se=function(_e){if(Zt){Zt=!1;return}r.onMenuHide()};document.body.addEventListener("click",se),this.set("handler",se)}},e.prototype.removeMenuEventListener=function(){var t=this.get("handleMenuClickWrapper"),r=this.get("handler");if(t){var n=this.get("menu");n.removeEventListener("click",t),this.set("handleMenuClickWrapper",null)}r&&document.body.removeEventListener("click",r)},e.prototype.onMenuHide=function(){var t=this.get("menu");t&&pi(t,{visibility:"hidden"}),this.removeMenuEventListener()},e.prototype.destroy=function(){var t=this.get("menu");if(this.removeMenuEventListener(),t){var r=this.get("container");r||(r=this.get("graph").get("container")),(0,h.isString)(r)&&(r=document.getElementById(r)),r.removeChild(t)}},e}(cu),_x=Mx,Cx=function(){var i=function(t,r){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},i(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),fv=function(){return fv=Object.assign||function(i){for(var e,t=1,r=arguments.length;t-1,f=navigator.userAgent.toLowerCase().indexOf("safari")>-1,c=qo(` +
`)),l=0,_=0,I=!1,B=0,j=0,et=0,ut=0,ct=0,pt=0,Mt=f||u?"mousedown":"dragstart";c.addEventListener(Mt,function(_e){var Ue,Re;if(_e.dataTransfer){var qe=new Image;qe.src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E",(Re=(Ue=_e.dataTransfer).setDragImage)===null||Re===void 0||Re.call(Ue,qe,0,0);try{_e.dataTransfer.setData("text/html","view-port-minimap")}catch(nn){_e.dataTransfer.setData("text","view-port-minimap")}}if(r.refresh=!1,_e.target===c){var hr=c.style;B=parseInt(hr.left,10),j=parseInt(hr.top,10),et=parseInt(hr.width,10),ut=parseInt(hr.height,10),!(et>n[0]||ut>n[1])&&(pt=a.getZoom(),ct=t.get("ratio"),I=!0,l=_e.clientX,_=_e.clientY)}},!1);var Zt=function(Ue){if(!(!I||(0,h.isNil)(Ue.clientX)||(0,h.isNil)(Ue.clientY))){var Re=l-Ue.clientX,qe=_-Ue.clientY;(B-Re<0||B-Re+et>=n[0])&&(Re=0),(j-qe<0||j-qe+ut>=n[1])&&(qe=0),B-=Re,j-=qe,pi(c,{left:"".concat(B,"px"),top:"".concat(j,"px")}),a.translate(Re*pt/ct,qe*pt/ct),l=Ue.clientX,_=Ue.clientY}};!f&&!u&&c.addEventListener("drag",Zt,!1);var se=function(){I=!1,r.refresh=!0},oe=f||u?"mouseup":"dragend";c.addEventListener(oe,se,!1),s.addEventListener("mouseleave",se),s.addEventListener("mouseup",se),(f||u)&&s.addEventListener("mousemove",Zt,!1),this.set("viewport",c),s.appendChild(c)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),r=this.get("totaldx"),n=this.get("totaldy"),a=this.get("graph"),o=this.get("size"),s=a.get("canvas").get("el"),u=a.get("width")||s.scrollWidth||500,f=a.get("height")||s.scrollHeight||500,c=a.getPointByCanvas(0,0),l=a.getPointByCanvas(u,f),_=this.get("viewport");_||this.initViewport();var I=(l.x-c.x)*t,B=(l.y-c.y)*t,j=c.x*t+r,et=c.y*t+n,ut=j+I,ct=et+B;j<0&&(I+=j,j=0),ut>o[0]&&(I=I-(ut-o[0])),et<0&&(B+=et,et=0),ct>o[1]&&(B=B-(ct-o[1])),this.set("ratio",t);var pt="".concat(j,"px"),Mt="".concat(et,"px");pi(_,{left:pt,top:Mt,width:"".concat(I,"px"),height:"".concat(B,"px")})}},e.prototype.updateGraphShapes=function(){var t=this._cfgs.graph,r=this.get("canvas"),n=t.get("group");if(!n.destroyed){r.clear();var a;this.get("hideEdge")?(a=r.addGroup(),n.get("children").forEach(function(s){s.get("id").includes("-edge")||a.add(s.clone())})):(a=n.clone(),a.resetMatrix(),r.add(a));var o=t.get("renderer");o===fg&&this.updateVisible(a)}},e.prototype.updateVisible=function(t){var r=this;if(!t.isGroup()&&!t.get("visible"))t.hide();else{var n=t.get("children");if(!n||!n.length)return;n.forEach(function(a){a.get("visible")||a.hide(),r.updateVisible(a)})}},e.prototype.updateKeyShapes=function(){var t=this,r=this._cfgs.graph,n=this.get("canvas"),a=n.get("children")[0]||n.addGroup();this.get("hideEdge")||(0,h.each)(r.getEdges(),function(u){t.updateOneEdgeKeyShape(u,a)}),(0,h.each)(r.getNodes(),function(u){t.updateOneNodeKeyShape(u,a)});var o=r.getCombos();if(o&&o.length){var s=a.find(function(u){return u.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,h.each)(o,function(u){t.updateOneComboKeyShape(u,s)}),s==null||s.sort(),s==null||s.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.updateOneComboKeyShape=function(t,r){if(!this.destroyed){var n=this.get("itemMap")||{},a=n[t.get("id")],o=t.getBBox(),s=t.get("keyShape").clone(),u=s.attr(),f={x:o.centerX,y:o.centerY};a?f=Object.assign(u,f):(a=s,r.add(a));var c=a.get("type");(c==="rect"||c==="image")&&(f.x=o.minX,f.y=o.minY),a.attr(f),t.isVisible()?a.show():a.hide(),a.exist=!0;var l=t.getModel().depth;isNaN(l)||a.set("zIndex",l),n[t.get("id")]=a,this.set("itemMap",n)}},e.prototype.updateOneNodeKeyShape=function(t,r){var n=this.get("itemMap")||{},a=n[t.get("id")],o=t.getBBox(),s=t.get("keyShape").clone(),u=s.attr(),f={x:o.centerX,y:o.centerY};a?(f=Object.assign(u,f),a.toFront()):(a=s,r.add(a));var c=a.get("type");(c==="rect"||c==="image")&&(f.x=o.minX,f.y=o.minY),a.attr(f),t.isVisible()?a.show():a.hide(),a.exist=!0;var l=t.getModel().depth;isNaN(l)||a.set("zIndex",l),n[t.get("id")]=a,this.set("itemMap",n)},e.prototype.updateDelegateShapes=function(){var t=this,r=this._cfgs.graph,n=this.get("canvas"),a=n.get("children")[0]||n.addGroup();this.get("hideEdge")||(0,h.each)(r.getEdges(),function(u){t.updateOneEdgeKeyShape(u,a)}),(0,h.each)(r.getNodes(),function(u){t.updateOneNodeDelegateShape(u,a)});var o=r.getCombos();if(o&&o.length){var s=a.find(function(u){return u.get("name")==="comboGroup"})||a.addGroup({name:"comboGroup"});setTimeout(function(){t.destroyed||((0,h.each)(o,function(u){t.updateOneComboKeyShape(u,s)}),s==null||s.sort(),s==null||s.toBack(),t.updateCanvas())},250)}this.clearDestroyedShapes()},e.prototype.clearDestroyedShapes=function(){var t=this.get("itemMap")||{},r=Object.keys(t);if(!(!r||r.length===0))for(var n=r.length-1;n>=0;n--){var a=t[r[n]],o=a.exist;a.exist=!1,o||(a.remove(),delete t[r[n]])}},e.prototype.updateOneEdgeKeyShape=function(t,r){var n=this.get("itemMap")||{},a=n[t.get("id")];if(a){var o=t.get("keyShape").attr("path");a.attr("path",o)}else a=t.get("keyShape").clone(),r.add(a);t.isVisible()?a.show():a.hide(),a.exist=!0,n[t.get("id")]=a,this.set("itemMap",n)},e.prototype.updateOneNodeDelegateShape=function(t,r){var n=this.get("delegateStyle"),a=this.get("itemMap")||{},o=a[t.get("id")],s=t.getBBox();if(o){var u={x:s.minX,y:s.minY,width:s.width,height:s.height};o.attr(u),o.toFront()}else o=r.addShape("rect",{attrs:fv({x:s.minX,y:s.minY,width:s.width,height:s.height},n),name:"minimap-node-shape"});t.isVisible()?o.show():o.hide(),o.exist=!0,a[t.get("id")]=o,this.set("itemMap",a)},e.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)},e.prototype.initContainer=function(){var t=this,r=t.get("graph"),n=t.get("size"),a=t.get("className"),o=t.get("container"),s=qo("
"));(0,h.isString)(o)&&(o=document.getElementById(o)),o?o.appendChild(s):r.get("container").appendChild(s),t.set("container",s);var u=qo('
');s.appendChild(u),u.addEventListener("dragenter",function(l){l.preventDefault()}),u.addEventListener("dragover",function(l){l.preventDefault()});var f,c=r.get("renderer");c===fg?f=new _d({container:u,width:n[0],height:n[1]}):f=new oc({container:u,width:n[0],height:n[1]}),t.set("canvas",f),t.updateCanvas()},e.prototype.updateCanvas=function(){if(!this.destroyed){var t=this.get("refresh");if(t){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"),o=this.get("type"),s=this.get("padding");if(!a.destroyed){switch(o){case Ax:this.updateGraphShapes();break;case Ix:this.updateKeyShapes();break;case Ox:this.updateDelegateShapes();break;default:break}var u=a.get("children")[0];if(u){u.resetMatrix();var f=u.getCanvasBBox(),c=r.get("canvas").getCanvasBBox(),l=r.getZoom()||1,_=c.width/l,I=c.height/l;Number.isFinite(f.width)&&(_=ug(f.width,_),I=ug(f.height,I)),_+=2*s,I+=2*s;var B=Math.min(n[0]/_,n[1]/I),j=[1,0,0,0,1,0,0,0,1],et=0,ut=0;Number.isFinite(f.minX)&&(et=-f.minX),Number.isFinite(f.minY)&&(ut=-f.minY);var ct=(n[0]-(_-2*s)*B)/2,pt=(n[1]-(I-2*s)*B)/2;j=Tx(j,[["t",et,ut],["s",B,B],["t",ct,pt]]),u.setMatrix(j),this.set("ratio",B),this.set("totaldx",ct+et*B),this.set("totaldy",pt+ut*B),this.set("dx",ct),this.set("dy",pt),this.updateViewport()}}}}}},e.prototype.getCanvas=function(){return this.get("canvas")},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.destroy=function(){var t;(t=this.get("canvas"))===null||t===void 0||t.destroy();var r=this.get("container");r!=null&&r.parentNode&&r.parentNode.removeChild(r)},e}(cu),Lx=Dx,Px=function(){var i=function(t,r){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},i(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}();function Tf(i,e,t){var r=i.x-e.x,n=i.y-e.y;return!t||Math.abs(r)>t||Math.abs(n)>t?Math.sqrt(r*r+n*n):t}function Nx(i,e){return i.x*e.x+i.y*e.y}function cg(i,e){var t=(e.source.y-e.target.y)/(e.source.x-e.target.x),r=(t*t*e.source.x+t*(i.y-e.source.y)+i.x)/(t*t+1),n=t*(r-e.source.x)+e.source.y;return{x:r,y:n}}var Rx=function(i){Px(e,i);function e(t){return i.call(this,t)||this}return e.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(){}}},e.prototype.init=function(){var t=this.get("graph"),r=this.get("onTick"),n=function(){r&&r(),t.refreshPositions()};this.set("tick",n)},e.prototype.bundling=function(t){var r=this;if(r.set("data",t),!r.isTicking()){var n=t.edges||[],a=t.nodes||[],o={},s=!1;if(a.forEach(function(Mt){(Mt.x===null||!Mt.y===null||Mt.x===void 0||!Mt.y===void 0)&&(s=!0),o[Mt.id]=Mt}),s)throw new Error("please layout the graph or assign x and y for nodes first");r.set("nodeIdMap",o);var u=r.get("divisions"),f=r.get("divRate"),c=r.divideEdges(u);r.set("edgePoints",c);var l=r.getEdgeBundles();r.set("edgeBundles",l);for(var _=r.get("cycles"),I=r.get("iterations"),B=r.get("iterRate"),j=r.get("lambda"),et=0;et<_;et++){for(var ut=function(Zt){var se=[];n.forEach(function(oe,_e){if(oe.source!==oe.target){var Ue=o[oe.source],Re=o[oe.target];se[_e]=r.getEdgeForces({source:Ue,target:Re},_e,u,j);for(var qe=0;qeB;){var pt=B/ct,Mt={x:o[u][ut-1].x,y:o[u][ut-1].y};Mt.x+=pt*(et.x-o[u][ut-1].x),Mt.y+=pt*(et.y-o[u][ut-1].y),j.push(Mt),ct-=B,B=I}B-=ct}}),j.push({x:l.x,y:l.y}),o[u]=j}}),o},e.prototype.getEdgeLength=function(t){var r=0;return t.forEach(function(n,a){a!==0&&(r+=Tf(n,t[a-1]))}),r},e.prototype.getEdgeBundles=function(){var t=this,r=t.get("data"),n=r.edges||[],a=t.get("bundleThreshold"),o=t.get("nodeIdMap"),s=t.get("edgeBundles");return s||(s=[]),n.forEach(function(u,f){(!s[f]||s[f]===void 0)&&(s[f]=[])}),n.forEach(function(u,f){var c=o[u.source],l=o[u.target];n.forEach(function(_,I){if(!(I<=f)){var B=o[_.source],j=o[_.target],et=t.getBundleScore({source:c,target:l},{source:B,target:j});et>=a&&(s[f].push(I),s[I].push(f))}})}),s},e.prototype.getBundleScore=function(t,r){var n=this;t.vx=t.target.x-t.source.x,t.vy=t.target.y-t.source.y,r.vx=r.target.x-r.source.x,r.vy=r.target.y-r.source.y,t.length=Tf({x:t.source.x,y:t.source.y},{x:t.target.x,y:t.target.y}),r.length=Tf({x:r.source.x,y:r.source.y},{x:r.target.x,y:r.target.y});var a=n.getAngleScore(t,r),o=n.getScaleScore(t,r),s=n.getPositionScore(t,r),u=n.getVisibilityScore(t,r);return a*o*s*u},e.prototype.getAngleScore=function(t,r){var n=Nx({x:t.vx,y:t.vy},{x:r.vx,y:r.vy});return n/(t.length*r.length)},e.prototype.getScaleScore=function(t,r){var n=(t.length+r.length)/2,a=2/(n/Math.min(t.length,r.length)+Math.max(t.length,r.length)/n);return a},e.prototype.getPositionScore=function(t,r){var n=(t.length+r.length)/2,a={x:(t.source.x+t.target.x)/2,y:(t.source.y+t.target.y)/2},o={x:(r.source.x+r.target.x)/2,y:(r.source.y+r.target.y)/2},s=Tf(a,o);return n/(n+s)},e.prototype.getVisibilityScore=function(t,r){var n=this.getEdgeVisibility(t,r),a=this.getEdgeVisibility(r,t);return na||Math.abs(l.y)>a){var _=Tf(s[c][t],s[r][t]),I=1/_;f.x+=l.x*I,f.y+=l.y*I}}),f},e.prototype.isTicking=function(){return this.get("ticking")},e.prototype.getSimulation=function(){return this.get("forceSimulation")},e.prototype.destroy=function(){this.get("ticking")&&this.getSimulation().stop(),i.prototype.destroy.call(this)},e}(cu),kx=Rx,Bx=function(){var i=function(t,r){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},i(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),cv=function(){return cv=Object.assign||function(i){for(var e,t=1,r=arguments.length;t(f||n.get("height"))&&a>1||l<(c||n.get("height")*.05)&&a<1)&&(a=1),l*=a,r.set("r",l),r.set("r2",l*l);var _=r.get("d");r.set("molecularParam",(_+1)*l),r.set("delegateCenterDiff",void 0),r.magnify(t,u)}},e.prototype.scaleRByDrag=function(t){var r=this;if(t){var n=r.get("dragPrePos"),a=r.get("graph"),o,s=a.getPointByClient(t.clientX,t.clientY);t.x-n.x<0?o=1-dh:o=1/(1-dh);var u=r.get("maxR"),f=r.get("minR"),c=r.get("r");(c>(u||a.get("height"))&&o>1||c<(f||a.get("height")*.05)&&o<1)&&(o=1),c*=o,r.set("r",c),r.set("r2",c*c);var l=r.get("d");r.set("molecularParam",(l+1)*c),r.magnify(t,s),r.set("dragPrePos",{x:t.x,y:t.y})}},e.prototype.scaleDByWheel=function(t){var r=this;if(!(!t&&!t.originalEvent)){t.preventDefault&&t.preventDefault();var n=0;t.originalEvent.wheelDelta<0?n=-.1:n=.1;var a=r.get("d"),o=a+n,s=r.get("maxD"),u=r.get("minD");if(ou){r.set("d",o);var f=r.get("r");r.set("molecularParam",(o+1)*f);var c=r.get("delegate"),l=c?{x:c.attr("x"),y:c.attr("y")}:void 0;r.set("delegateCenterDiff",void 0),r.magnify(t,l)}}},e.prototype.scaleDByDrag=function(t){var r=this,n=r.get("dragPrePos"),a=t.x-n.x>0?.1:-.1,o=r.get("d"),s=o+a,u=r.get("maxD"),f=r.get("minD");if(sf){r.set("d",s);var c=r.get("r");r.set("molecularParam",(s+1)*c),r.magnify(t)}r.set("dragPrePos",{x:t.x,y:t.y})},e.prototype.magnify=function(t,r){var n=this;n.restoreCache();var a=n.get("graph"),o=n.get("cachedMagnifiedModels"),s=n.get("cachedOriginPositions"),u=n.get("showLabel"),f=n.get("r"),c=n.get("r2"),l=n.get("d"),_=n.get("molecularParam"),I=a.getNodes(),B=I.length,j=r?{x:r.x,y:r.y}:{x:t.x,y:t.y};n.get("dragging")&&(n.get("trigger")==="mousemove"||n.get("trigger")==="click")&&(j=n.get("cacheCenter"));var et=n.get("delegateCenterDiff");et&&(j.x+=et.x,j.y+=et.y),n.updateDelegate(j,f);for(var ut=0;ut +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • + + `},zoomSensitivity:2}},e.prototype.init=function(){var t=this,r=this.get("graph"),n=this.get("getContent"),a=n(r),o=a;(0,h.isString)(a)&&(o=qo(a));var s=this.get("className");o.setAttribute("class",s||"g6-component-toolbar");var u=this.get("container");u||(u=this.get("graph").get("container")),(0,h.isString)(u)&&(u=document.getElementById(u)),u.appendChild(o),this.set("toolBar",o);var f=this.get("handleClick");o.addEventListener("click",function(l){var _=Ux(l).filter(function(B){return B.nodeName==="LI"});if(_.length!==0){var I=_[0].getAttribute("code");I&&(f?f(I,r):t.handleDefaultOperator(I))}});var c=this.get("position");c&&pi(o,{top:"".concat(c.y,"px"),left:"".concat(c.x,"px")}),this.bindUndoRedo()},e.prototype.bindUndoRedo=function(){var t=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"]'),o=document.querySelector('.g6-component-toolbar li[code="redo"] svg');!r||!n||!a||!o||(r.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4"),a.setAttribute("style","cursor: not-allowed"),o.setAttribute("style","opacity: 0.4"),t.on("stackchange",function(s){var u=s.undoStack,f=s.redoStack,c=u.length,l=f.length;c===0?(r.setAttribute("style","cursor: not-allowed"),n.setAttribute("style","opacity: 0.4")):(r.removeAttribute("style"),n.removeAttribute("style")),l===0?(a.setAttribute("style","cursor: not-allowed"),o.setAttribute("style","opacity: 0.4")):(a.removeAttribute("style"),o.removeAttribute("style"))}))},e.prototype.undo=function(){var t=this.get("graph"),r=t.getUndoStack();if(!(!r||r.length===0)){var n=r.pop();if(n){var a=n.action;t.pushStack(a,(0,h.clone)(n.data),"redo");var o=n.data.before;if(a==="add"&&(o=n.data.after),!o)return;switch(a){case"visible":{Object.keys(o).forEach(function(l){var _=o[l];_&&_.forEach(function(I){var B=t.findById(I.id);I.visible?t.showItem(B,!1):t.hideItem(B,!1)})});break}case"render":case"update":Object.keys(o).forEach(function(l){var _=o[l];_&&_.forEach(function(I){var B=t.findById(I.id);delete I.id,t.updateItem(B,I,!1),B.getType()==="combo"&&t.updateCombo(B)})});break;case"changedata":t.changeData(o,!1);break;case"delete":{Object.keys(o).forEach(function(l){var _=o[l];_&&_.forEach(function(I){var B=I.itemType;delete I.itemType,t.addItem(B,I,!1)})});break}case"add":Object.keys(o).forEach(function(l){var _=o[l];_&&_.forEach(function(I){t.removeItem(I.id,!1)})});break;case"updateComboTree":Object.keys(o).forEach(function(l){var _=o[l];_&&_.forEach(function(I){t.updateComboTree(I.id,I.parentId,!1)})});break;case"createCombo":var s=n.data.after.combos,u=s[s.length-1];Object.keys(o).forEach(function(l){var _=o[l];_&&_.forEach(function(I){t.updateComboTree(I.id,I.parentId,!1)})}),t.removeItem(u.id,!1);break;case"uncombo":var f=o.combos[o.combos.length-1],c=o.nodes.concat(o.combos).map(function(l){return l.id}).filter(function(l){return l!==f.id});t.createCombo(f,c,!1);break;case"layout":t.updateLayout(o,void 0,void 0,!1);break;default:}}}},e.prototype.redo=function(){var t=this.get("graph"),r=t.getRedoStack();if(!(!r||r.length===0)){var n=r.pop();if(n){var a=n.action,o=n.data.after;if(t.pushStack(a,(0,h.clone)(n.data)),a==="delete"&&(o=n.data.before),!o)return;switch(a){case"visible":{Object.keys(o).forEach(function(c){var l=o[c];l&&l.forEach(function(_){var I=t.findById(_.id);_.visible?t.showItem(I,!1):t.hideItem(I,!1)})});break}case"render":case"update":Object.keys(o).forEach(function(c){var l=o[c];l&&l.forEach(function(_){var I=t.findById(_.id);delete _.id,t.updateItem(I,_,!1),I.getType()==="combo"&&t.updateCombo(I)})});break;case"changedata":t.changeData(o,!1);break;case"delete":o.edges&&o.edges.forEach(function(c){t.removeItem(c.id,!1)}),o.nodes&&o.nodes.forEach(function(c){t.removeItem(c.id,!1)}),o.combos&&o.combos.forEach(function(c){t.removeItem(c.id,!1)});break;case"add":{Object.keys(o).forEach(function(c){var l=o[c];l&&l.forEach(function(_){var I=_.itemType;delete _.itemType,t.addItem(I,_,!1)})});break}case"updateComboTree":Object.keys(o).forEach(function(c){var l=o[c];l&&l.forEach(function(_){t.updateComboTree(_.id,_.parentId,!1)})});break;case"createCombo":var s=o.combos[o.combos.length-1];t.createCombo(s,s.children.map(function(c){return c.id}),!1);break;case"uncombo":var u=n.data.before.combos,f=u[u.length-1];t.uncombo(f.id,!1);break;case"layout":t.updateLayout(o,void 0,void 0,!1);break;default:}}}},e.prototype.zoomOut=function(){var t=this.get("graph"),r=t.getZoom(),n=1/(1-dg*this.get("zoomSensitivity")),a=this.get("maxZoom")||t.get("maxZoom");n*r>a||t.zoomTo(r*n)},e.prototype.zoomIn=function(){var t=this.get("graph"),r=t.getZoom(),n=1-dg*this.get("zoomSensitivity"),a=this.get("minZoom")||t.get("minZoom");n*r\u7C7B\u578B\uFF1A`.concat(r.item.getType(),` + ID\uFF1A`).concat(r.item.getID(),` + `)},shouldBegin:function(r){return!0},itemTypes:["node","edge","combo"],trigger:"mouseenter",fixToNode:void 0}},e.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"}},e.prototype.init=function(){var t=this,r=t.get("className")||"g6-component-tooltip",n=qo("
    ")),a=t.get("container");a||(a=t.get("graph").get("container")),(0,h.isString)(a)&&(a=document.getElementById(a)),pi(n,{position:"absolute",visibility:"hidden",display:"none"}),a.appendChild(n),t.get("trigger")!=="click"&&(n.addEventListener("mouseenter",function(o){pi(n,{visibility:"visible",display:"unset"})}),n.addEventListener("mouseleave",function(o){t.hideTooltip()})),t.set("tooltip",n)},e.prototype.onClick=function(t){var r=this.get("itemTypes");if(!(t.item&&t.item.getType&&r.indexOf(t.item.getType())===-1)){var n=t.item,a=this.get("graph");this.currentTarget===n?(this.currentTarget=null,this.hideTooltip(),a.emit("tooltipchange",{item:t.item,action:"hide"})):(this.currentTarget=n,this.showTooltip(t),a.emit("tooltipchange",{item:t.item,action:"show"}))}},e.prototype.onMouseEnter=function(t){var r=this.get("itemTypes");if(!(t.item&&t.item.getType&&r.indexOf(t.item.getType())===-1)){var n=t.item,a=this.get("graph");this.currentTarget=n,this.showTooltip(t),a.emit("tooltipchange",{item:t.item,action:"show"})}},e.prototype.onMouseMove=function(t){var r=this.get("itemTypes");t.item&&t.item.getType&&r.indexOf(t.item.getType())===-1||!this.currentTarget||t.item!==this.currentTarget||this.showTooltip(t)},e.prototype.onMouseLeave=function(){this.hideTooltip();var t=this.get("graph");t.emit("tooltipchange",{item:this.currentTarget,action:"hide"}),this.currentTarget=null},e.prototype.clearContainer=function(){var t=this.get("tooltip");t&&(t.innerHTML="")},e.prototype.showTooltip=function(t){if(t.item){var r=this.get("itemTypes");if(!(t.item.getType&&r.indexOf(t.item.getType())===-1)){var n=this.get("tooltip"),a=this.get("getContent"),o=a(t);(0,h.isString)(o)?n.innerHTML=o:(this.clearContainer(),n.appendChild(o)),this.updatePosition(t)}}},e.prototype.hideTooltip=function(){var t=this.get("tooltip");t&&pi(t,{visibility:"hidden",display:"none"})},e.prototype.updatePosition=function(t){var r=this.get("shouldBegin"),n=this.get("tooltip");if(!r(t)){pi(n,{visibility:"hidden",display:"none"});return}var a=this.get("graph"),o=a.get("width"),s=a.get("height"),u=this.get("offsetX")||0,f=this.get("offsetY")||0,c=a.getPointByClient(t.clientX,t.clientY),l=this.get("fixToNode"),_=t.item;if(_.getType&&_.getType()==="node"&&l&&(0,h.isArray)(l)&&l.length>=2){var I=_.getBBox();c={x:I.minX+I.width*l[0],y:I.minY+I.height*l[1]}}var B=a.getCanvasByPoint(c.x,c.y),j=B.x,et=B.y,ut=a.getContainer(),ct={x:j+ut.offsetLeft+u,y:et+ut.offsetTop+f};pi(n,{visibility:"visible",display:"unset"});var pt=n.getBoundingClientRect();j+pt.width+u>o&&(ct.x-=pt.width+u),et+pt.height+f>s&&(ct.y-=pt.height+f,ct.y<0&&(ct.y=0)),pi(n,{left:"".concat(ct.x,"px"),top:"".concat(ct.y,"px")})},e.prototype.hide=function(){this.onMouseLeave()},e.prototype.destroy=function(){var t=this.get("tooltip");if(t){var r=this.get("container");r||(r=this.get("graph").get("container")),(0,h.isString)(r)&&(r=document.getElementById(r)),r.removeChild(t)}},e}(cu),Vx=jx,hg="timebarstartplay",vg="timebarendplay",Af="valuechange",Ol="timebarConfigChanged",Xc="playPauseBtn",Ad="nextStepBtn",Id="preStepBtn",JS={opacity:.5,fill:"#000"},tM={opacity:.5,fill:"#000",r:5},eM={fill:"#fff",fontSize:12},Hx=function(){function i(e){var t=e.x,r=t===void 0?0:t,n=e.y,a=n===void 0?0:n,o=e.container,s=e.text,u=e.padding,f=u===void 0?[4,4,4,4]:u,c=e.className,l=c===void 0?"g6-component-timebar-tooltip":c,_=e.backgroundColor,I=_===void 0?"#000":_,B=e.textColor,j=B===void 0?"#fff":B,et=e.opacity,ut=et===void 0?.8:et,ct=e.fontSize,pt=ct===void 0?12:ct;this.container=o,this.className=l,this.backgroundColor=I,this.textColor=j,this.x=r,this.y=a,this.text=s,this.padding=f,this.opacity=ut,this.fontSize=pt,this.render()}return i.prototype.render=function(){var e=this,t=e.className,r=e.x,n=e.y,a=e.backgroundColor,o=e.textColor,s=e.text,u=e.padding,f=e.opacity,c=e.fontSize,l=e.container,_=qo("
    '));(0,h.isString)(l)&&(l=document.getElementById(l)),l.appendChild(_),e.parentHeight=l.offsetHeight,e.parentWidth=l.offsetWidth,pi(_,{visibility:"hidden",top:0,left:0});var I=qo(` +
    "));I.innerHTML=s,_.appendChild(I),e.backgroundDOM=I;var B=qo("
    "));_.appendChild(B),e.arrowDOM=B,e.container=_},i.prototype.show=function(e){var t=this,r=e.text,n=e.x,a=e.y,o=e.clientX,s=e.clientY;t.backgroundDOM.innerHTML=r;var u=t.backgroundDOM.offsetWidth,f=t.backgroundDOM.offsetHeight,c=t.arrowDOM.offsetWidth,l=t.arrowDOM.offsetHeight;pi(t.container,{top:"".concat(-f-l,"px"),left:"".concat(n,"px"),visibility:"visible"}),pi(t.backgroundDOM,{marginLeft:"".concat(-u/2,"px")}),pi(t.arrowDOM,{marginLeft:"".concat(-c/2,"px"),top:"".concat(f,"px")});var _=n-u/2,I=n+u/2;_<0?pi(t.backgroundDOM,{marginLeft:"".concat(-u/2-_,"px")}):I>t.parentWidth&&pi(t.backgroundDOM,{marginLeft:"".concat(-u/2-I+t.parentWidth+12,"px")})},i.prototype.hide=function(){pi(this.container,{top:0,left:0,visibility:"hidden"})},i}(),Zx=Hx,lv=function(){return lv=Object.assign||function(i){for(var e,t=1,r=arguments.length;tc&&(o=c,a=f)})}t.originalEvent.deltaY>0?a=Math.max(0,a-1):a=Math.min(e.speedAxisY.length-1,a+1);var s=e.speedAxisY[a]-n;r=Od(r,[["t",0,s]]),e.speedPoint.setMatrix(r),e.currentSpeed=e.speedAxisY.length-a,e.speedText.attr("text","".concat(e.currentSpeed,".0X")),e.group.emit(Ol,{speed:e.currentSpeed,type:e.currentType})}),this.toggleGroup&&this.toggleGroup.on("toggle-model:click",function(t){var r,n,a=t.target.get("isChecked");a?(e.checkedIcon.hide(),e.checkedText.attr("text",((n=e.controllerCfg)===null||n===void 0?void 0:n.timePointControllerText)||"\u5355\u4E00\u65F6\u95F4"),e.currentType=If.RANGE):(e.checkedIcon.show(),e.checkedText.attr("text",((r=e.controllerCfg)===null||r===void 0?void 0:r.timeRangeControllerText)||"\u65F6\u95F4\u8303\u56F4"),e.currentType=If.SINGLE),t.target.set("isChecked",!a),e.group.emit(Ol,{type:e.currentType,speed:e.currentSpeed})})},i.prototype.destroy=function(){this.speedGroup.off("speed-rect:click"),this.toggleGroup&&(this.toggleGroup.off("toggle-model:click"),this.toggleGroup.destroy()),this.speedGroup.destroy()},i}(),mg=nb,Dd=function(){return Dd=Object.assign||function(i){for(var e,t=1,r=arguments.length;t=_e&&nn<=Ue,En=kn?c:l,Kr=Zt.addShape("rect",{attrs:Dd({x:a+nn*(Mt+ct),y:a,width:Mt,height:ut},En),draggable:!0,name:"tick-rect-".concat(nn)}),ta=Zt.addShape("rect",{attrs:{x:a+nn*Mt+ct*(2*nn-1)/2,y:a,width:nn===0||nn===pt-1?Mt+ct/2:Mt+ct,height:ut,fill:"#fff",opacity:0},draggable:!0,name:"pick-rect-".concat(nn)});ta.toFront();var $n=Kr.getBBox(),$r=($n.minX+$n.maxX)/2;se.push({rect:Kr,pickRect:ta,value:hr.date,x:$r,y:$n.minY});var yn;if(f?(yn=f(hr),!(0,h.isString)(yn)&&yn&&(yn=hr.date)):nn%Math.round(pt/10)===0&&(yn=hr.date),yn){oe.push(yn);var Fn=$n.maxY+a*2;Zt.addShape("line",{attrs:{stroke:"#BFBFBF",x1:$r,y1:Fn,x2:$r,y2:Fn+j},name:"tick-line"});var zn=Fn+j+a,ia=Zt.addShape("text",{attrs:Dd({fill:"#8c8c8c",stroke:"#fff",lineWidth:1,x:$r,y:zn,textAlign:"center",text:yn,textBaseline:"top",fontSize:10,fontFamily:e.fontFamily||"Arial, sans-serif"},_),capture:!1,name:"tick-label"}),da=ia.getBBox();if(da.maxX>r?ia.attr("textAlign","right"):da.minX<0&&ia.attr("textAlign","left"),(0,h.isNumber)(Re)&&oe.length!==10){var Wa=ab([1,0,0,0,1,0,0,0,1],[["t",-$r,-zn],["r",Re],["t",$r-5,zn+2]]);ia.attr({textAlign:"left",matrix:Wa})}oe.length===1?ia.attr({textAlign:"left"}):oe.length===10&&ia.attr({textAlign:"right"})}}),this.tickRects=se;var qe=this.group;this.currentSpeed=1,this.controllerBtnGroup=new mg(Dd({group:qe,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))},i.prototype.initEvent=function(){var e=this,t=this.sliceGroup;t.on("click",function(c){var l=c.target;if(!(l.get("type")!=="rect"||!l.get("name"))){var _=parseInt(l.get("name").split("-")[2],10);if(!isNaN(_)){var I=e.tickRects,B=e.unselectedTickStyle;I.forEach(function(ct){ct.rect.attr(B)});var j=e.selectedTickStyle;I[_].rect.attr(j),e.startTickRectId=_,e.endTickRectId=_;var et=I.length,ut=_/et;e.graph.emit(Af,{value:[ut,ut]})}}}),t.on("dragstart",function(c){var l=e.tickRects,_=e.unselectedTickStyle;l.forEach(function(ct){ct.rect.attr(_)});var I=c.target,B=parseInt(I.get("name").split("-")[2],10),j=e.selectedTickStyle;l[B].rect.attr(j),e.startTickRectId=B;var et=l.length,ut=B/et;e.graph.emit(Af,{value:[ut,ut]}),e.dragging=!0}),t.on("dragover",function(c){if(e.dragging&&c.target.get("type")==="rect"){for(var l=parseInt(c.target.get("name").split("-")[2],10),_=e.startTickRectId,I=e.tickRects,B=e.selectedTickStyle,j=e.unselectedTickStyle,et=0;et=_&&et<=l?B:j;I[et].rect.attr(ut)}var ct=I.length;e.endTickRectId=l;var pt=_/ct,Mt=l/ct;e.graph.emit(Af,{value:[pt,Mt]})}}),t.on("drop",function(c){if(e.dragging&&(e.dragging=!1,c.target.get("type")==="rect")){var l=e.startTickRectId,_=parseInt(c.target.get("name").split("-")[2],10);if(!(_0?t.endTickRectId++:(r[t.endTickRectId].rect.attr(a),t.endTickRectId--),s!==t.startTickRectId)t.endTickRectIdthis.max?NaN:this.values[a]},e.prototype.getText=function(t){for(var r=[],n=1;n1?t-1:t}this.translateIndexMap&&(this.translateIndexMap=void 0)},e}(hv),Ld=lb,xg=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,Vc="\\d\\d?",Hc="\\d\\d",db="\\d{3}",hb="\\d{4}",Pd="[^\\s]+",bg=/\[([^]*?)\]/gm;function Eg(i,e){for(var t=[],r=0,n=i.length;r-1?n:null}};function Zc(i){for(var e=[],t=1;t3?0:(i-i%10!==10?1:0)*i%10]}},hh=Zc({},vv),_g=function(i){return hh=Zc(hh,i)},Cg=function(i){return i.replace(/[|\\{()[^$+*?.-]/g,"\\$&")},lu=function(i,e){for(e===void 0&&(e=2),i=String(i);i.length0?"-":"+")+lu(Math.floor(Math.abs(e)/60)*100+Math.abs(e)%60,4)},Z:function(i){var e=i.getTimezoneOffset();return(e>0?"-":"+")+lu(Math.floor(Math.abs(e)/60),2)+":"+lu(Math.abs(e)%60,2)}},Tg=function(i){return+i-1},Ag=[null,Vc],Ig=[null,Pd],Og=["isPm",Pd,function(i,e){var t=i.toLowerCase();return t===e.amPm[0]?0:t===e.amPm[1]?1:null}],Dg=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(i){var e=(i+"").match(/([+-]|\d\d)/gi);if(e){var t=+e[1]*60+parseInt(e[2],10);return e[0]==="+"?t:-t}return 0}],mb={D:["day",Vc],DD:["day",Hc],Do:["day",Vc+Pd,function(i){return parseInt(i,10)}],M:["month",Vc,Tg],MM:["month",Hc,Tg],YY:["year",Hc,function(i){var e=new Date,t=+(""+e.getFullYear()).substr(0,2);return+(""+(+i>68?t-1:t)+i)}],h:["hour",Vc,void 0,"isPm"],hh:["hour",Hc,void 0,"isPm"],H:["hour",Vc],HH:["hour",Hc],m:["minute",Vc],mm:["minute",Hc],s:["second",Vc],ss:["second",Hc],YYYY:["year",hb],S:["millisecond","\\d",function(i){return+i*100}],SS:["millisecond",Hc,function(i){return+i*10}],SSS:["millisecond",db],d:Ag,dd:Ag,ddd:Ig,dddd:Ig,MMM:["month",Pd,wg("monthNamesShort")],MMMM:["month",Pd,wg("monthNames")],a:Og,A:Og,ZZ:Dg,Z:Dg},vh={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},Lg=function(i){return Zc(vh,i)},Pg=function(i,e,t){if(e===void 0&&(e=vh.default),t===void 0&&(t={}),typeof i=="number"&&(i=new Date(i)),Object.prototype.toString.call(i)!=="[object Date]"||isNaN(i.getTime()))throw new Error("Invalid Date pass to format");e=vh[e]||e;var r=[];e=e.replace(bg,function(a,o){return r.push(o),"@@@"});var n=Zc(Zc({},hh),t);return e=e.replace(xg,function(a){return gb[a](i,n)}),e.replace(/@@@/g,function(){return r.shift()})};function Ng(i,e,t){if(t===void 0&&(t={}),typeof e!="string")throw new Error("Invalid format in fecha parse");if(e=vh[e]||e,i.length>1e3)return null;var r=new Date,n={year:r.getFullYear(),month:0,day:1,hour:0,minute:0,second:0,millisecond:0,isPm:null,timezoneOffset:null},a=[],o=[],s=e.replace(bg,function(Mt,Zt){return o.push(Cg(Zt)),"@@@"}),u={},f={};s=Cg(s).replace(xg,function(Mt){var Zt=mb[Mt],se=Zt[0],oe=Zt[1],_e=Zt[3];if(u[se])throw new Error("Invalid format. "+se+" specified twice in format");return u[se]=!0,_e&&(f[_e]=!0),a.push(Zt),"("+oe+")"}),Object.keys(f).forEach(function(Mt){if(!u[Mt])throw new Error("Invalid format. "+Mt+" is required in specified format")}),s=s.replace(/@@@/g,function(){return o.shift()});var c=i.match(new RegExp(s,"i"));if(!c)return null;for(var l=Zc(Zc({},hh),t),_=1;_11||n.month<0||n.day>31||n.day<1||n.hour>23||n.hour<0||n.minute>59||n.minute<0||n.second>59||n.second<0)return null;return ut}var yb={format:Pg,parse:Ng,defaultI18n:vv,setGlobalDateI18n:_g,setGlobalDateMasks:Lg},Rg=yb;function xb(i){return function(e,t,r,n){for(var a=(0,h.isNil)(r)?0:r,o=(0,h.isNil)(n)?e.length:n;a>>1;i(e[s])>t?o=s:a=s+1}return a}}var kg="format";function Bg(i,e){var t=Y[kg]||Rg[kg];return t(i,e)}function ph(i){return(0,h.isString)(i)&&(i.indexOf("T")>0?i=new Date(i).getTime():i=new Date(i.replace(/-/gi,"/")).getTime()),(0,h.isDate)(i)&&(i=i.getTime()),i}var ff=1e3,Dl=60*ff,Ll=60*Dl,uc=24*Ll,Nd=uc*31,Fg=uc*365,Rd=[["HH:mm:ss",ff],["HH:mm:ss",ff*10],["HH:mm:ss",ff*30],["HH:mm",Dl],["HH:mm",Dl*10],["HH:mm",Dl*30],["HH",Ll],["HH",Ll*6],["HH",Ll*12],["YYYY-MM-DD",uc],["YYYY-MM-DD",uc*4],["YYYY-WW",uc*7],["YYYY-MM",Nd],["YYYY-MM",Nd*4],["YYYY-MM",Nd*6],["YYYY",uc*380]];function bb(i,e,t){var r=(e-i)/t,n=xb(function(o){return o[1]})(Rd,r)-1,a=Rd[n];return n<0?a=Rd[0]:n>=Rd.length&&(a=(0,h.last)(Rd)),a}var Eb=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="timeCat",t}return e.prototype.translate=function(t){t=ph(t);var r=this.values.indexOf(t);return r===-1&&((0,h.isNumber)(t)&&t-1){var a=this.values[n],o=this.formatter;return a=o?o(a,r):Bg(a,this.mask),a}return t},e.prototype.initCfg=function(){this.tickMethod="time-cat",this.mask="YYYY-MM-DD",this.tickCount=7},e.prototype.setDomain=function(){var t=this.values;(0,h.each)(t,function(r,n){t[n]=ph(r)}),t.sort(function(r,n){return r-n}),i.prototype.setDomain.call(this)},e}(Ld),wb=Eb,Sb=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.isContinuous=!0,t}return e.prototype.scale=function(t){if((0,h.isNil)(t))return NaN;var r=this.rangeMin(),n=this.rangeMax(),a=this.max,o=this.min;if(a===o)return r;var s=this.getScalePercent(t);return r+s*(n-r)},e.prototype.init=function(){i.prototype.init.call(this);var t=this.ticks,r=(0,h.head)(t),n=(0,h.last)(t);rthis.max&&(this.max=n),(0,h.isNil)(this.minLimit)||(this.min=r),(0,h.isNil)(this.maxLimit)||(this.max=n)},e.prototype.setDomain=function(){var t=(0,h.getRange)(this.values),r=t.min,n=t.max;(0,h.isNil)(this.min)&&(this.min=r),(0,h.isNil)(this.max)&&(this.max=n),this.min>this.max&&(this.min=r,this.max=n)},e.prototype.calculateTicks=function(){var t=this,r=i.prototype.calculateTicks.call(this);return this.nice||(r=(0,h.filter)(r,function(n){return n>=t.min&&n<=t.max})),r},e.prototype.getScalePercent=function(t){var r=this.max,n=this.min;return(t-n)/(r-n)},e.prototype.getInvertPercent=function(t){return(t-this.rangeMin())/(this.rangeMax()-this.rangeMin())},e}(hv),gh=Sb,Mb=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="linear",t.isLinear=!0,t}return e.prototype.invert=function(t){var r=this.getInvertPercent(t);return this.min+r*(this.max-this.min)},e.prototype.initCfg=function(){this.tickMethod="wilkinson-extended",this.nice=!1},e}(gh),kd=Mb;function Kc(i,e){var t=Math.E,r;return e>=0?r=Math.pow(t,Math.log(e)/i):r=Math.pow(t,Math.log(-e)/i)*-1,r}function zu(i,e){return i===1?1:Math.log(e)/Math.log(i)}function zg(i,e,t){(0,h.isNil)(t)&&(t=Math.max.apply(null,i));var r=t;return(0,h.each)(i,function(n){n>0&&n1&&(r=1),r}function Gg(i){var e=i.toString().split(/[eE]/),t=(e[0].split(".")[1]||"").length-+(e[1]||0);return t>0?t:0}function rM(i,e){var t=Gg(i),r=Gg(e),n=Math.pow(10,Math.max(t,r));return(i*n+e*n)/n}var _b=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="log",t}return e.prototype.invert=function(t){var r=this.base,n=zu(r,this.max),a=this.rangeMin(),o=this.rangeMax()-a,s,u=this.positiveMin;if(u){if(t===0)return 0;s=zu(r,u/r);var f=1/(n-s)*o;if(t=0?1:-1;return Math.pow(s,n)*u},e.prototype.initCfg=function(){this.tickMethod="pow",this.exponent=2,this.tickCount=5,this.nice=!0},e.prototype.getScalePercent=function(t){var r=this.max,n=this.min;if(r===n)return 0;var a=this.exponent,o=(Kc(a,t)-Kc(a,n))/(Kc(a,r)-Kc(a,n));return o},e}(gh),Ab=Tb,Ib=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="time",t}return e.prototype.getText=function(t,r){var n=this.translate(t),a=this.formatter;return a?a(n,r):Bg(n,this.mask)},e.prototype.scale=function(t){var r=t;return((0,h.isString)(r)||(0,h.isDate)(r))&&(r=this.translate(r)),i.prototype.scale.call(this,r)},e.prototype.translate=function(t){return ph(t)},e.prototype.initCfg=function(){this.tickMethod="time-pretty",this.mask="YYYY-MM-DD",this.tickCount=7,this.nice=!1},e.prototype.setDomain=function(){var t=this.values,r=this.getConfig("min"),n=this.getConfig("max");if((!(0,h.isNil)(r)||!(0,h.isNumber)(r))&&(this.min=this.translate(this.min)),(!(0,h.isNil)(n)||!(0,h.isNumber)(n))&&(this.max=this.translate(this.max)),t&&t.length){var a=[],o=1/0,s=o,u=0;(0,h.each)(t,function(f){var c=ph(f);if(isNaN(c))throw new TypeError("Invalid Time: "+f+" in time scale!");o>c?(s=o,o=c):s>c&&(s=c),u1&&(this.minTickInterval=s-o),(0,h.isNil)(r)&&(this.min=o),(0,h.isNil)(n)&&(this.max=u)}},e}(kd),Ob=Ib,Db=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="quantize",t}return e.prototype.invert=function(t){var r=this.ticks,n=r.length,a=this.getInvertPercent(t),o=Math.floor(a*(n-1));if(o>=n-1)return(0,h.last)(r);if(o<0)return(0,h.head)(r);var s=r[o],u=r[o+1],f=o/(n-1),c=(o+1)/(n-1);return s+(a-f)/(c-f)*(u-s)},e.prototype.initCfg=function(){this.tickMethod="r-pretty",this.tickCount=5,this.nice=!0},e.prototype.calculateTicks=function(){var t=i.prototype.calculateTicks.call(this);return this.nice||((0,h.last)(t)!==this.max&&t.push(this.max),(0,h.head)(t)!==this.min&&t.unshift(this.min)),t},e.prototype.getScalePercent=function(t){var r=this.ticks;if(t<(0,h.head)(r))return 0;if(t>(0,h.last)(r))return 1;var n=0;return(0,h.each)(r,function(a,o){if(t>=a)n=o;else return!1}),n/(r.length-1)},e}(gh),Ug=Db,Lb=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="quantile",t}return e.prototype.initCfg=function(){this.tickMethod="quantile",this.tickCount=5,this.nice=!0},e}(Ug),Pb=Lb,Wg={};function Nb(i){return Wg[i]}function Df(i,e){if(Nb(i))throw new Error("type '"+i+"' existed.");Wg[i]=e}var Rb=function(i){(0,b.__extends)(e,i);function e(){var t=i!==null&&i.apply(this,arguments)||this;return t.type="identity",t.isIdentity=!0,t}return e.prototype.calculateTicks=function(){return this.values},e.prototype.scale=function(t){return this.values[0]!==t&&(0,h.isNumber)(t)?t:this.range[0]},e.prototype.invert=function(t){var r=this.range;return tr[1]?NaN:this.values[0]},e}(hv),kb=Rb;function Yg(i){var e=i.values,t=i.tickInterval,r=i.tickCount,n=i.showLast;if((0,h.isNumber)(t)){var a=(0,h.filter)(e,function(B,j){return j%t===0}),o=(0,h.last)(e);return n&&(0,h.last)(a)!==o&&a.push(o),a}var s=e.length,u=i.min,f=i.max;if((0,h.isNil)(u)&&(u=0),(0,h.isNil)(f)&&(f=e.length-1),!(0,h.isNumber)(r)||r>=s)return e.slice(u,f+1);if(r<=0||f<=0)return[];for(var c=r===1?s:Math.floor(s/(r-1)),l=[],_=u,I=0;I=f);I++)_=Math.min(u+I*c,f),I===r-1&&n?l.push(e[f]):l.push(e[_]);return l}function Bb(i){var e=i.min,t=i.max,r=i.nice,n=i.tickCount,a=new Fb;return a.domain([e,t]),r&&a.nice(n),a.ticks(n)}var pv=5,Xg=Math.sqrt(50),jg=Math.sqrt(10),Vg=Math.sqrt(2),Fb=function(){function i(){this._domain=[0,1]}return i.prototype.domain=function(e){return e?(this._domain=Array.from(e,Number),this):this._domain.slice()},i.prototype.nice=function(e){var t,r;e===void 0&&(e=pv);var n=this._domain.slice(),a=0,o=this._domain.length-1,s=this._domain[a],u=this._domain[o],f;return u0?(s=Math.floor(s/f)*f,u=Math.ceil(u/f)*f,f=mh(s,u,e)):f<0&&(s=Math.ceil(s*f)/f,u=Math.floor(u*f)/f,f=mh(s,u,e)),f>0?(n[a]=Math.floor(s/f)*f,n[o]=Math.ceil(u/f)*f,this.domain(n)):f<0&&(n[a]=Math.ceil(s*f)/f,n[o]=Math.floor(u*f)/f,this.domain(n)),this},i.prototype.ticks=function(e){return e===void 0&&(e=pv),zb(this._domain[0],this._domain[this._domain.length-1],e||pv)},i}();function zb(i,e,t){var r,n=-1,a,o,s;if(e=+e,i=+i,t=+t,i===e&&t>0)return[i];if((r=e0)for(i=Math.ceil(i/s),e=Math.floor(e/s),o=new Array(a=Math.ceil(e-i+1));++n=0?(a>=Xg?10:a>=jg?5:a>=Vg?2:1)*Math.pow(10,n):-Math.pow(10,-n)/(a>=Xg?10:a>=jg?5:a>=Vg?2:1)}function Hg(i,e,t){var r;return t==="ceil"?r=Math.ceil(i/e):t==="floor"?r=Math.floor(i/e):r=Math.round(i/e),r*e}function gv(i,e,t){var r=Hg(i,t,"floor"),n=Hg(e,t,"ceil");r=(0,h.fixedBase)(r,t),n=(0,h.fixedBase)(n,t);for(var a=[],o=Math.max((n-r)/(Math.pow(2,12)-1),t),s=r;s<=n;s=s+o){var u=(0,h.fixedBase)(s,o);a.push(u)}return{min:r,max:n,ticks:a}}function mv(i,e,t){var r,n=i.minLimit,a=i.maxLimit,o=i.min,s=i.max,u=i.tickCount,f=u===void 0?5:u,c=(0,h.isNil)(n)?(0,h.isNil)(e)?o:e:n,l=(0,h.isNil)(a)?(0,h.isNil)(t)?s:t:a;if(c>l&&(r=[c,l],l=r[0],c=r[1]),f<=2)return[c,l];for(var _=(l-c)/(f-1),I=[],B=0;B=0&&(u=1),1-s/(o-1)-t+u}function jb(i,e,t){var r=(0,h.size)(e),n=(0,h.indexOf)(e,i),a=1;return 1-n/(r-1)-t+a}function Vb(i,e,t,r,n,a){var o=(i-1)/(a-n),s=(e-1)/(Math.max(a,r)-Math.min(t,n));return 2-Math.max(o/s,s/o)}function Hb(i,e){return i>=e?2-(i-1)/(e-1):1}function Zb(i,e,t,r){var n=e-i;return 1-.5*(Math.pow(e-r,2)+Math.pow(i-t,2))/Math.pow(.1*n,2)}function Kb(i,e,t){var r=e-i;if(t>r){var n=(t-r)/2;return 1-Math.pow(n,2)/Math.pow(.1*r,2)}return 1}function $b(){return 1}function qb(i,e,t,r,n,a){t===void 0&&(t=5),r===void 0&&(r=!0),n===void 0&&(n=Ub),a===void 0&&(a=[.25,.2,.5,.05]);var o=t<0?0:Math.round(t);if(Number.isNaN(i)||Number.isNaN(e)||typeof i!="number"||typeof e!="number"||!o)return{min:0,max:0,ticks:[]};if(e-i<1e-15||o===1)return{min:i,max:e,ticks:[i]};if(e-i>1e148){var s=t||5,u=(e-i)/s;return{min:i,max:e,ticks:Array(s).fill(null).map(function(Fn,zn){return Pl(i+u*zn)})}}for(var f={score:-2,lmin:0,lmax:0,lstep:0},c=1;c<1/0;){for(var l=0;lf.score&&(!r||_e<=i&&Ue>=e)&&(f.lmin=_e,f.lmax=Ue,f.lstep=Re,f.score=En)}ut+=1}B+=1}}c+=1}var Kr=Pl(f.lmax),ta=Pl(f.lmin),$n=Pl(f.lstep),$r=Math.floor(Yb((Kr-ta)/$n))+1,yn=new Array($r);yn[0]=Pl(ta);for(var l=1;l<$r;l++)yn[l]=Pl(yn[l-1]+$n);return{min:Math.min(i,(0,h.head)(yn)),max:Math.max(e,(0,h.last)(yn)),ticks:yn}}function Qb(i){var e=i.min,t=i.max,r=i.tickCount,n=i.nice,a=i.tickInterval,o=i.minLimit,s=i.maxLimit,u=qb(e,t,r,n).ticks;return!(0,h.isNil)(o)||!(0,h.isNil)(s)?mv(i,(0,h.head)(u),(0,h.last)(u)):a?gv(e,t,a).ticks:u}function Jb(i){var e=i.base,t=i.tickCount,r=i.min,n=i.max,a=i.values,o,s=zu(e,n);if(r>0)o=Math.floor(zu(e,r));else{var u=zg(a,e,n);o=Math.floor(zu(e,u))}for(var f=s-o,c=Math.ceil(f/t),l=[],_=o;_=0?1:-1;return Math.pow(o,e)*s})}function eE(i,e){var t=i.length*e;return e===1?i[i.length-1]:e===0?i[0]:t%1!==0?i[Math.ceil(t)-1]:i.length%2===0?(i[t-1]+i[t])/2:i[t]}function rE(i){var e=i.tickCount,t=i.values;if(!t||!t.length)return[];for(var r=t.slice().sort(function(s,u){return s-u}),n=[],a=0;a1&&(n=n*Math.ceil(s)),r&&nFg)for(var u=yh(t),f=Math.ceil(a/Fg),c=s;c<=u+f;c=c+f)o.push(oE(c));else if(a>Nd)for(var l=Math.ceil(a/Nd),_=yv(e),I=sE(e,t),c=0;c<=I+l;c=c+l)o.push(uE(s,c+_));else if(a>uc)for(var B=new Date(e),j=B.getFullYear(),et=B.getMonth(),ut=B.getDate(),ct=Math.ceil(a/uc),pt=fE(e,t),c=0;cLl)for(var B=new Date(e),j=B.getFullYear(),et=B.getMonth(),ct=B.getDate(),Mt=B.getHours(),Zt=Math.ceil(a/Ll),se=cE(e,t),c=0;c<=se+Zt;c=c+Zt)o.push(new Date(j,et,ct,Mt+c).getTime());else if(a>Dl)for(var oe=lE(e,t),_e=Math.ceil(a/Dl),c=0;c<=oe+_e;c=c+_e)o.push(e+c*Dl);else{var Ue=a;Ue=512&&console.warn("Notice: current ticks length("+o.length+') >= 512, may cause performance issues, even out of memory. Because of the configure "tickInterval"(in milliseconds, current is '+a+") is too small, increase the value to solve the problem!"),o}Of("cat",Yg),Of("time-cat",iE),Of("wilkinson-extended",Qb),Of("r-pretty",nE),Of("time",aE),Of("time-pretty",dE),Of("log",Jb),Of("pow",tE),Of("quantile",rE),Of("d3-linear",Gb),Df("cat",Ld),Df("category",Ld),Df("identity",kb),Df("linear",kd),Df("log",Cb),Df("pow",Ab),Df("time",Ob),Df("timeCat",wb),Df("quantize",Ug),Df("quantile",Pb);var hE=function(i,e,t){if(t||arguments.length===2)for(var r=0,n=e.length,a;rj?(se.show(),_e.show(),j=Ue.minX+Ue.width+10):(se.hide(),_e.hide()),se}),this.controllerBtnGroup=new mg(Xo({group:this.group,x:this.x,y:this.y+n+25,width:r,height:35},this.controllerCfg)),this.updateStartEnd(0),this.updateUI(),s.move(this.x,this.y),this.bindEvents(),this.currentMode===If.SINGLE&&(this.minHandlerShape.hide(),this.foregroundShape.hide(),this.minTextShape.hide())},i.prototype.bindEvents=function(){var e=this,t=this.group.find(function(n){return n.get("name")==="minHandlerShape"});t&&(t.on("minHandlerShape-handler:mousedown",this.onMouseDown(this.minHandlerShape)),t.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(Xc,":click"),function(){e.isPlay=!e.isPlay,e.currentHandler=e.maxHandlerShape,e.changePlayStatus()}),this.group.on("".concat(Ad,":click"),function(){e.currentHandler=e.maxHandlerShape,e.updateStartEnd(.01),e.updateUI()}),this.group.on("".concat(Id,":click"),function(){e.currentHandler=e.maxHandlerShape,e.updateStartEnd(-.01),e.updateUI()}),this.group.on(Ol,function(n){var a=n.type,o=n.speed;e.currentSpeed=o,e.currentMode=a,a===If.SINGLE?(e.minHandlerShape.hide(),e.foregroundShape.hide(),e.minTextShape.hide()):a===If.RANGE&&(e.minHandlerShape.show(),e.foregroundShape.show(),e.minTextShape.show())})},i.prototype.adjustTickIndex=function(e){for(var t=0;t1&&(this.start=1),this.end>1&&(this.end=1),this.end<0&&(this.end=0);var t=this.x+this.start*this.width,r=this.x+this.end*this.width;this.foregroundShape.attr("x",t),this.foregroundShape.attr("width",r-t);var n=(0,h.get)(this.handlerStyle,"width",xv);this.setText(this.minText,this.maxText);var a=this.dodgeText([t,r]),o=a[0],s=a[1];this.minHandlerShape.setX(t-n/2),(0,h.each)(o,function(u,f){return e.minTextShape.attr(f,u)}),this.maxHandlerShape.setX(r-n/2),(0,h.each)(s,function(u,f){return e.maxTextShape.attr(f,u)}),this.currentMode===If.RANGE?this.graph.emit(Af,{value:[this.start,this.end].sort()}):this.currentMode===If.SINGLE&&this.graph.emit(Af,{value:[this.end,this.end]})},i.prototype.dodgeText=function(e){var t,r,n=2,a=(0,h.get)(this.handlerStyle,"width",xv),o=this.minTextShape,s=this.maxTextShape,u=e[0],f=e[1],c=!1;u>f&&(t=[f,u],u=t[0],f=t[1],r=[s,o],o=r[0],s=r[1],c=!0);var l=o.getBBox(),_=s.getBBox(),I=null,B=null;return this.timeBarType==="trend"?(I=u-l.widththis.x+this.width?{x:f-a/2-n,textAlign:"right"}:{x:f+a/2+n,textAlign:"left"}):this.timeBarType==="simple"&&(I=o.attr("x")>l.width?{x:u,textAlign:"center"}:{x:u,textAlign:"left"},B=s.attr("x")>this.width-_.width?{x:f,textAlign:"right"}:{x:f,textAlign:"center"}),c?[B,I]:[I,B]},i.prototype.startPlay=function(){var e=this;return typeof window!="undefined"?window.requestAnimationFrame(function(){var t=e,r=t.ticks,n=t.width,a=e.currentSpeed,o=n/r.length,s=o/((10-a)*1e3/60),u=e.adjustOffsetRange(s/e.width);e.updateStartEnd(u),e.updateUI(),e.isPlay&&(e.playHandler=e.startPlay())}):void 0},i.prototype.changePlayStatus=function(e){e===void 0&&(e=!0),this.controllerBtnGroup.playButton.update({isPlay:this.isPlay}),this.isPlay?(this.playHandler=this.startPlay(),this.graph.emit(hg,null)):this.playHandler&&(typeof window!="undefined"&&window.cancelAnimationFrame(this.playHandler),e&&this.graph.emit(vg,null))},i.prototype.destory=function(){this.graph.off(Af,function(){});var e=this.group,t=e.find(function(n){return n.get("name")==="minHandlerShape"});t&&(t.off("minHandlerShape-handler:mousedown"),t.off("minHandlerShape-handler:touchstart"),t.destroy());var r=e.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(),e.off("".concat(Xc,":click")),e.off("".concat(Ad,":click")),e.off("".concat(Id,":click")),e.off(Ol),e.destroy(),this.trendComponent&&this.trendComponent.destory()},i}(),FE=BE,zE=function(){var i=function(t,r){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},i(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),fc=function(){return fc=Object.assign||function(i){for(var e,t=1,r=arguments.length;t
    ")),pi(f,{position:"relative"})),o){var c=this.get("graph").get("container");c.appendChild(f)}this.set("timeBarContainer",f);var l,_=t.get("renderer");_==="SVG"?l=new _d({container:f,width:n,height:a}):l=new oc({container:f,width:n,height:a}),this.get("containerCSS")&&pi(f,this.get("containerCSS")),this.set("canvas",l)},e.prototype.init=function(){this.initContainer();var t=this.get("canvas"),r=t.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)},e.prototype.play=function(){this.togglePlay(!0)},e.prototype.pause=function(){this.togglePlay(!1)},e.prototype.togglePlay=function(t){var r=this.get("timebar");r&&(r.isPlay=!!t,r.changePlayStatus())},e.prototype.renderTrend=function(){var t=this,r=this._cfgs,n=r.width,a=r.x,o=r.y,s=r.padding,u=r.type,f=r.trend,c=r.slider,l=r.controllerCfg,_=r.textStyle,I=r.tick,B=r.backgroundStyle,j=r.foregroundStyle,et=f.data,ut=GE(f,["data"]),ct=n-2*s,pt=u==="trend"?WE:UE,Mt=this.get("graph"),Zt=this.get("timeBarGroup"),se=this.get("canvas"),oe=null;if(u==="trend"||u==="simple"){var _e=this.get("getValue");oe=new FE(fc(fc({graph:Mt,canvas:se,group:Zt,type:u,x:a+s,y:u==="trend"?o+s:o+s+15,width:ct,height:pt,padding:s,backgroundStyle:B,foregroundStyle:j,trendCfg:fc(fc({},ut),{data:et.map(function(Re){return(_e==null?void 0:_e(Re))||Re.value})})},c),{tick:{ticks:et,tickLabelFormatter:I.tickLabelFormatter,tickLabelStyle:I.tickLabelStyle,tickLineStyle:I.tickLineStyle},handlerStyle:fc(fc({},c.handlerStyle),{height:c.height||pt}),controllerCfg:l,textStyle:_}))}else u==="tick"&&(oe=new ub(fc({graph:Mt,canvas:se,group:Zt,x:a+s,y:o+s,width:n,height:42,padding:2,controllerCfg:l},I)));var Ue=function Re(){var qe=t.get("timebar");qe.draggingHandler=!1,qe.isPlay&&(qe.isPlay=!1,qe.currentHandler=qe.maxHandlerShape,qe.changePlayStatus()),document.removeEventListener("mouseup",Re)};se.on("mousedown",function(Re){(Re.target.get("name")==="maxHandlerShape-handler"||Re.target.get("name")==="minHandlerShape-handler"||Re.target===oe.foregroundShape)&&document.addEventListener("mouseup",Ue)}),this.set("timebar",oe)},e.prototype.filterData=function(t){var r,n=t.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 o=null,s=this._cfgs.type;if(s==="trend"||s==="simple"?o=this._cfgs.trend.data:s==="tick"&&(o=this._cfgs.tick.data),!o||o.length===0){console.warn("\u8BF7\u914D\u7F6E TimeBar \u7EC4\u4EF6\u7684\u6570\u636E");return}var u=this.get("rangeChange"),f=this.get("graph"),c=Math.round(o.length*n[0]),l=Math.round(o.length*n[1]);l=l>=o.length?o.length-1:l,c=c>=o.length?o.length-1:c;var _=(r=this._cfgs.tick)===null||r===void 0?void 0:r.tickLabelFormatter,I=_?_(o[c]):o[c].date,B=_?_(o[l]):o[l].date;if(s!=="tick"){var j=this.get("timebar");j.setText(I,B)}if(u)u(f,I,B);else{(!this.cacheGraphData||this.cacheGraphData.nodes&&this.cacheGraphData.nodes.length===0)&&(this.cacheGraphData=f.get("data"));var et=this.get("filterItemTypes"),ut=this.get("changeData"),ct=this.get("getDate"),pt=this.get("shouldIgnore"),Mt=o[c].date,Zt=o[l].date;if(ut||ut===void 0){var se=this.cacheGraphData.nodes,oe=this.cacheGraphData.edges,_e={},Ue={};f.getNodes().forEach(function(Re){return _e[Re.getID()]=!0}),f.getEdges().forEach(function(Re){return Ue[Re.getID()]=!0}),et.includes("node")&&(se==null||se.forEach(function(Re){var qe=+((ct==null?void 0:ct(Re))||Re.date),hr=qe>=Mt&&qe<=Zt||(pt==null?void 0:pt("node",Re,{min:Mt,max:Zt})),nn=_e[Re.id];nn&&!hr?(f.removeItem(Re.id),_e[Re.id]=!1):!nn&&hr&&(f.addItem("node",Re),_e[Re.id]=!0)}),oe==null||oe.forEach(function(Re){var qe=_e[Re.source]&&_e[Re.target]||(pt==null?void 0:pt("edge",Re,{min:Mt,max:Zt})),hr=!!f.findById(Re.id);hr&&!qe?(f.removeItem(Re.id),Ue[Re.id]=!1):!hr&&qe?(f.addItem("edge",Re),Ue[Re.id]=!0):hr||(Ue[Re.id]=!1)})),(this.get("filterEdge")||et.includes("edge"))&&(oe==null||oe.filter(function(Re){var qe=+((ct==null?void 0:ct(Re))||Re.date),hr=qe>=Mt&&qe<=Zt||(pt==null?void 0:pt("edge",Re,{min:Mt,max:Zt})),nn=_e[Re.source]&&_e[Re.target],kn=hr&&nn,En=Ue[Re.id];En&&!kn?(Ue[Re.id]=!1,f.removeItem(Re.id)):!En&&kn&&(Ue[Re.id]=!0,f.addItem("edge",Re))}))}else et.includes("node")&&f.getNodes().forEach(function(Re){var qe=Re.getModel();if(!(pt!=null&&pt("node",qe,{min:Mt,max:Zt}))){var hr=+((ct==null?void 0:ct(qe))||qe.date);hrZt?f.hideItem(Re):f.showItem(Re)}}),(this.get("filterEdge")||et.includes("edge"))&&f.getEdges().forEach(function(Re){var qe=Re.getModel();if(!(pt!=null&&pt("edge",qe,{min:o[c].date,max:o[l].date}))){var hr=+((ct==null?void 0:ct(qe))||qe.date);if(hro[l].date)f.hideItem(Re);else{var nn=Re.getSource().isVisible(),kn=Re.getTarget().isVisible();nn&&kn&&f.showItem(Re)}}})}},e.prototype.initEvent=function(){var t=this.get("graph");t.on("afterchangedata",this.changeData),t.on("afterrender",this.afterrenderListener),t.on(Af,this.valueChangeListener)},e.prototype.destroy=function(){var t=this.get("graph");t.off("afterchangedata",this.changeData),t.off("afterrender",this.afterrenderListener),t.off(Af,this.valueChangeListener);var r=this.get("timebar");r&&r.destory&&r.destory(),i.prototype.destroy.call(this);var n=this.get("timeBarContainer");if(n){var a=this.get("container");a||(a=this.get("graph").get("container")),(0,h.isString)(a)&&(a=document.getElementById(a)),a===n&&(a=a.parentElement),a.removeChild(n)}},e}(cu),XE=YE,jE=function(){var i=function(t,r){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},i(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),VE=Xs.applyMatrix;function HE(i,e){var t,r;if(i.naturalWidth)t=i.naturalWidth,r=i.naturalHeight;else{var n=new Image;n.src=i.src,n.onload=function(){e&&e(n.width,n.height)}}return[t,r]}var ZE=function(i){jE(e,i);function e(t){return i.call(this,t)||this}return e.prototype.getDefaultCfgs=function(){return{container:null,className:"g6-minimap",viewportClassName:"g6-minimap-viewport",width:200,delegateStyle:{fill:"#40a9ff",stroke:"#096dd9"},refresh:!0}},e.prototype.getEvents=function(){return{beforepaint:"updateViewport",beforeanimate:"disableRefresh",afteranimate:"enableRefresh",viewportchange:"disableOneRefresh"}},e.prototype.disableRefresh=function(){this.set("refresh",!1)},e.prototype.enableRefresh=function(){this.set("refresh",!0),this.updateCanvas()},e.prototype.disableOneRefresh=function(){this.set("viewportChange",!0)},e.prototype.initViewport=function(){var t=this,r=this._cfgs,n=r.graph;if(!this.destroyed){var a=this.get("container");(0,h.isString)(a)&&(a=document.getElementById(a));var o=qo("
    ct||I>pt||(j=n.getZoom(),B=t.get("ratio"),f=!0,s=et.clientX,u=et.clientY)}},!1),a.addEventListener("mousemove",function(et){if(!(!f||(0,h.isNil)(et.clientX)||(0,h.isNil)(et.clientY))){var ut=t.get("width"),ct=t.get("height"),pt=o.style;c=parseInt(pt.left,10),l=parseInt(pt.top,10),_=parseInt(pt.width,10),I=parseInt(pt.height,10);var Mt=s-et.clientX,Zt=u-et.clientY;c-Mt<0?Mt=c:c-Mt+_>=ut&&(Mt=0),l-Zt<0?Zt=l:l-Zt+I>=ct&&(Zt=0),c-=Mt,l-=Zt,pi(o,{left:"".concat(c,"px"),top:"".concat(l,"px")}),n.translate(Mt*j/B,Zt*j/B),s=et.clientX,u=et.clientY}},!1),a.addEventListener("mouseleave",function(){f=!1,r.refresh=!0},!1),a.addEventListener("mouseup",function(){f=!1,r.refresh=!0},!1),this.set("viewport",o),a.appendChild(o)}},e.prototype.updateViewport=function(){if(!this.destroyed){var t=this.get("ratio"),r=this.get("width"),n=this.get("height"),a=this.get("graph"),o=a.get("width"),s=a.get("height"),u=o/s,f=a.getGroup(),c=f.getCanvasBBox(),l=[(c.minX+c.maxX)/2,(c.minY+c.maxY)/2],_=[c.maxX-c.minX,c.maxY-c.minY],I={centerX:l[0],centerY:l[1],width:0,height:0,minX:0,minY:0};c[0]/c[1]>u?(I.width=_[0],I.height=I.width/u):(I.height=_[1],I.width=I.height*u),I.minX=l[0]-I.width/2,I.minY=l[1]-I.height/2;var B=f.getMatrix();B||(B=[1,0,0,0,1,0,0,0,1]);var j=rt.invert([1,0,0,0,1,0,0,0,1],B),et=VE({x:I.minX,y:I.minY},j),ut=a.getCanvasByPoint(et.x,et.y),ct=this.get("viewport");ct||this.initViewport();var pt=o/I.width,Mt=pt*r,Zt=pt*n,se=r*-ut.x/I.width,oe=n*-ut.y/I.height,_e=se+Mt,Ue=oe+Zt;se<0&&(Mt+=se,se=0),_e>r&&(Mt=Mt-(_e-r)),oe<0&&(Zt+=oe,oe=0),Ue>n&&(Zt=Zt-(Ue-n)),this.set("ratio",t);var Re="".concat(se,"px"),qe="".concat(oe,"px");pi(ct,{left:Re,top:qe,width:"".concat(Mt,"px"),height:"".concat(Zt,"px")})}},e.prototype.init=function(){this.initContainer()},e.prototype.initContainer=function(){var t=this,r=t.get("graph"),n=r.get("width"),a=r.get("height"),o=a/n,s=t.get("className"),u=t.get("container"),f=t.get("width"),c=t.get("height");!f&&!c&&(f=200),f?(c=o*f,t.set("height",c)):(f=1/o*c,t.set("width",f));var l=qo("
    "));(0,h.isString)(u)&&(u=document.getElementById(u)),u?u.appendChild(l):r.get("container").appendChild(l),t.set("container",l);var _=qo('
    ');l.appendChild(_);var I=qo('');_.appendChild(I),t.set("containerDOM",_),t.set("containerSpan",I);var B=qo(''));t.set("imgDOM",B),t.updateImgSize(),I.appendChild(B),t.updateCanvas()},e.prototype.updateImgSize=function(){var t=this,r=t.get("imgDOM"),n=t.get("width"),a=t.get("height");r.onload=function(){var o=HE(r);o[0]>o[1]?r.width=n:r.height=a}},e.prototype.updateCanvas=function(){var t=this.get("refresh");if(t){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(),o=a.width,s=n/o;this.set("ratio",s),this.updateViewport()}}},e.prototype.getViewport=function(){return this.get("viewport")},e.prototype.getContainer=function(){return this.get("container")},e.prototype.updateGraphImg=function(t){var r=this,n=r.get("imgDOM");n.remove(),r.set("graphImg",t);var a=qo(''));r.set("imgDOM",a),a.src=t,r.updateImgSize();var o=r.get("containerSpan");o.appendChild(a),r.updateCanvas()},e.prototype.destroy=function(){var t=this.get("container");t.parentNode.removeChild(t)},e}(cu),KE=ZE,$E=function(){var i=function(t,r){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},i(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),bv=function(){return bv=Object.assign||function(i){for(var e,t=1,r=arguments.length;t(f||n.get("height"))&&a>1||l<(c||n.get("height")*.05)&&a<1)&&(a=1),l*=a,r.set("r",l),r.filter(t)}},e.prototype.filter=function(t){var r=this,n=r.get("graph"),a=n.getNodes(),o={},s=r.get("r"),u=r.get("type"),f={x:t.x,y:t.y};r.updateDelegate(f,s);var c=r.get("shouldShow"),l=r.get("vShapes");l&&l.forEach(function(ut){ut.remove(),ut.destroy()}),l=[],a.forEach(function(ut){var ct=ut.getModel(),pt=ct.x,Mt=ct.y;qE({x:pt,y:Mt},f)
    `);s.appendChild(u),this.set("container",u);var f=this.render();pi(u,this.getContainerPos(f)),this.bindEvents()},e.prototype.getContainerPos=function(t){t===void 0&&(t=[0,0]);var r=this,n=r.get("graph"),a=this.get("offsetX"),o=this.get("offsetY"),s=this.get("margin"),u=this.get("position").split("-"),f={top:0,right:1,bottom:2,left:3},c=0,l=0,_={left:(n.getWidth()-t[0])/2+c,top:(n.getHeight()-t[1])/2+l};return u.forEach(function(I){var B=s[f[I]],j=I;switch(I){case"top":B+=l;break;case"left":B+=c;break;case"bottom":B=n.getHeight()-t[1]-B+l,j="top";break;default:B=n.getWidth()-t[0]-B+c,j="left";break}_[j]=B}),_.top+=o+n.getContainer().offsetTop,_.left+=a+n.getContainer().offsetLeft,Object.keys(_).forEach(function(I){_[I]="".concat(_[I],"px")}),_},e.prototype.bindEvents=function(){var t=this,r=t.get("filter");if(!(!r||!r.enable)){var n=r.trigger||"click";ow.includes(n)||(console.warn("Trigger for legend filterling must be 'click' or 'mouseenter', 'click' will take effect by default."),n="click");var a=t.get("legendCanvas");n==="mouseenter"?(a.on("node-container:mouseenter",function(o){return t.filterData(o)}),a.on("node-container:mouseleave",function(o){t.clearFilter(),t.clearActiveLegend()})):(a.on("node-container:click",function(o){return t.filterData(o)}),a.on("click",function(o){o.target&&o.target.isCanvas&&o.target.isCanvas()&&(t.clearFilter(),t.clearActiveLegend())}))}},e.prototype.changeData=function(t){this.set("data",t);var r=this.render();pi(this.get("container"),this.getContainerPos(r))},e.prototype.activateLegend=function(t){var r=this.get("filter"),n=r==null?void 0:r.multiple;n||this.clearActiveLegend();var a=t.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(l){l.set("inactive",!0)}):this.clearActiveLegend();var o=(r==null?void 0:r.legendStateStyles)||{},s=(o==null?void 0:o.inactive)||{opacity:.5,"text-shape":{opacity:.5}},u=s["text-shape"]||{};this.findLegendItemsByState("inactive").forEach(function(l){var _=l.get("children"),I=_[0],B=_[1];I.attr(is(is({},I.get("oriAttrs")),s)),B.attr(is(is({},B.get("oriAttrs")),u))});var f=(o==null?void 0:o.active)||{stroke:"#000",lineWidth:2,"text-shape":{fontWeight:"bold"}},c=f["text-shape"]||{};this.findLegendItemsByState("active").forEach(function(l){var _=l.get("children"),I=_[0],B=_[1];I.attr(is(is({},I.get("oriAttrs")),f)),B.attr(is(is({},B.get("oriAttrs")),c))})},e.prototype.findLegendItemsByState=function(t,r,n){r===void 0&&(r="all"),n===void 0&&(n=!0);var a=this.get("legendCanvas").find(function(u){return u.get("name")==="root"}),o=a.find(function(u){return u.get("name")==="node-group"}),s=a.find(function(u){return u.get("name")==="edge-group"});return r==="node"?o.get("children").filter(function(u){return!!u.get(t)===n}):r==="edge"?s.get("children").filter(function(u){return!!u.get(t)===n}):o.get("children").filter(function(u){return!!u.get(t)===n}).concat(s.get("children").filter(function(u){return!!u.get(t)===n}))},e.prototype.clearActiveLegend=function(){var t=this.get("legendCanvas"),r=t.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(o){o.set("active",!1),o.set("inactive",!1);var s=o.get("children"),u=s[0],f=s[1];u.attr(u.get("oriAttrs")),f.attr(f.get("oriAttrs"))})})},e.prototype.filterData=function(t){var r=this.get("filter"),n=r==null?void 0:r.filterFunctions;if(!(!r||!n)){var a=this.get("legendCanvas"),o=this.get("graph"),s=r.graphActiveState||"active",u=r.graphInactiveState||"inactive",f=r.multiple;this.clearFilter(),f||this.clearActiveLegend(),this.activateLegend(t.target);var c=a.find(function(ut){return ut.get("name")==="root"}),l=c.find(function(ut){return ut.get("name")==="node-group"}),_=c.find(function(ut){return ut.get("name")==="edge-group"}),I=l.get("children").filter(function(ut){return ut.get("active")}),B=_.get("children").filter(function(ut){return ut.get("active")}),j=0,et=["getNodes","getEdges"];et.forEach(function(ut){o[ut]().forEach(function(ct){var pt=!1,Mt=ut==="getNodes"?I:B;Mt.forEach(function(Zt){var se=n[Zt.get("id")];pt=pt||se(ct.getModel())}),pt?(o.setItemState(ct,u,!1),o.setItemState(ct,s,!0),j++):(o.setItemState(ct,s,!1),o.setItemState(ct,u,!0))})}),j||et.forEach(function(ut){o[ut]().forEach(function(ct){o.clearItemStates(ct,[u])})})}},e.prototype.clearFilter=function(){var t=this.get("graph"),r=this.get("filter");if(r){var n=r.graphActiveState||"active",a=r.graphInactiveState||"inactive";t.getNodes().forEach(function(o){t.clearItemStates(o,[n,a])}),t.getEdges().forEach(function(o){t.clearItemStates(o,[n,a])})}},e.prototype.render=function(){var t=this;this.processData();var r=this.get("legendCanvas");r?r.clear():r=new oc({container:this.get("container"),width:200,height:200});var n=r.addGroup({name:"root"}),a=n.addGroup({name:"node-group"}),o=n.addGroup({name:"edge-group"});this.set("legendCanvas",r);var s=this.get("itemsData"),u=["nodes","edges"],f=[a,o];u.forEach(function(Kr,ta){s[Kr].forEach(function($n){var $r,yn=f[ta].addGroup({id:$n.id,name:"node-container"}),Fn,zn=$n.type,ia=t.getShapeSize($n),da=ia.width,Wa=ia.height,oi=ia.r,Qi=t.getStyle(Kr.substr(0,4),$n);switch($n.type){case"circle":Fn={r:oi,x:0,y:0};break;case"rect":Fn={width:da,height:Wa,x:-da/2,y:-Wa/2};break;case"ellipse":Fn={rx:da,ry:Wa,x:0,y:0},zn="ellipse";break;case"line":Fn={x1:-da/2,y1:0,x2:da/2,y2:0},zn="line";break;case"quadratic":Fn={path:[["M",-da/2,0],["Q",0,da/2,da/2,0]]},zn="path";break;case"cubic":Fn={path:[["M",-da/2,0],["C",-da/6,da/2,da/6,-da/2,da/2,0]]},zn="path";break;case"diamond":Fn={path:[["M",0,-Wa],["L",da,0],["L",0,Wa],["L",-da,0],["Z"]]},zn="path";break;case"triangle":Fn={path:[["M",-da,Wa],["L",0,-Wa],["L",da,Wa],["Z"]]},zn="path";break;case"star":Fn={path:Xs.getStarPath(oi*3,oi*1.2)},zn="path";break;default:Fn={r:oi,x:0,y:0};break}var Li=yn.addShape(zn,{attrs:is(is({},Fn),Qi),name:"".concat($n.type,"-node-keyShape"),oriAttrs:is({opacity:1},Qi)});if($n.label){var Ji=Li.getBBox(),co=(($r=$n.labelCfg)===null||$r===void 0?void 0:$r.style)||{},jo=is({textAlign:"begin",fontSize:12,textBaseline:"middle",fill:"#000",opacity:1,fontWeight:"normal"},co);yn.addShape("text",{attrs:is({x:Ji.maxX+4,y:0,text:$n.label},jo),className:"legend-label",name:"".concat($n.type,"-node-text"),oriAttrs:jo})}})});var c=this.get("padding"),l,_=n.find(function(Kr){return Kr.get("name")==="title-container"}),I={height:0,maxY:0,width:0};if(this.get("title")){_||(_=n.addGroup({name:"title-container"}));var B={fontSize:20,fontFamily:"Arial",fontWeight:300,textBaseline:"top",textAlign:"center",fill:"#000",x:0,y:c[0]},j=this.get("titleConfig")||{},et=Object.assign(B,j.style||{});l=_.addShape("text",{attrs:is({text:this.get("title")},et)}),I=_.getCanvasBBox(),_.setMatrix([1,0,0,0,1,0,j.offsetX,j.offsetY,1])}this.layoutItems();var ut=n.getCanvasBBox(),ct=a.getCanvasBBox(),pt=ct.minX<0?Math.abs(ct.minX)+c[3]:c[3],Mt=I.maxYl.max&&(l.max=s[0]),qe>_&&(_=qe),Mt.setMatrix([1,0,0,0,1,0,hr,nn,1])});var I=l.max-l.min,B={min:0,max:-1/0},j=f.getCanvasBBox();s[0]=0,s[1]=a==="vertical"?j.maxX+r:j.maxY+n,c.get("children").forEach(function(Mt,Zt){Zt===0&&(B.min=s[0]);var se=Mt.get("children")[0],oe=Mt.getCanvasBBox(),_e=se.getBBox(),Ue=_e.width,Re=_e.height,qe=0,hr=0;a==="vertical"?(qe=s[1],hr=s[0],s[0]=hr+oe.height+n,Mt.setMatrix([1,0,0,0,1,0,0,hr+Re/2,1])):(qe=s[0],hr=s[1],s[0]=qe+oe.width+r,Mt.setMatrix([1,0,0,0,1,0,qe+Ue/2,0,1])),s[0]>B.max&&(B.max=s[0])});var et=B.max-B.min;if(o&&o!==""&&o!=="left"){var ut=I-et,ct=o==="center"?Math.abs(ut)/2:Math.abs(ut),pt=ut<0?f:c;pt.get("children").forEach(function(Mt){var Zt=Mt.getMatrix()||[1,0,0,0,1,0,0,0,1];a==="vertical"?Zt[7]+=ct:Zt[6]+=ct,Mt.setMatrix(Zt)})}},e.prototype.processData=function(){var t=this.get("data"),r={nodes:[],edges:[]};t.nodes&&(t.nodes.sort(function(n,a){return n.order-a.order}),t.nodes.forEach(function(n){var a,o,s,u,f,c=n.size||[((a=n.style)===null||a===void 0?void 0:a.width)||((o=n.style)===null||o===void 0?void 0:o.r)||8,((s=n.style)===null||s===void 0?void 0:s.height)||((u=n.style)===null||u===void 0?void 0:u.r)||8],l=((f=n.labelCfg)===null||f===void 0?void 0:f.style)||{};r.nodes.push({id:n.id||(0,h.uniqueId)(),type:n.type||"circle",style:is({},n.style),order:n.order,label:n.label,itemType:"node",size:c,labelCfg:{position:"right",style:is({fontFamily:"Arial"},l)}})})),t.edges&&(t.edges.sort(function(n,a){return n.order-a.order}),t.edges.forEach(function(n){var a,o,s=n.type||"line";n.type==="cubic-horizontal"&&(s="cubic");var u=((a=n.labelCfg)===null||a===void 0?void 0:a.style)||{},f=n.size||[((o=n.style)===null||o===void 0?void 0:o.width)||8,1];r.edges.push({id:n.id||(0,h.uniqueId)(),type:s,size:f,style:is({lineWidth:(0,h.isArray)(f)?f[1]:1},n.style),order:n.order,label:n.label,itemType:"edge",labelCfg:{position:"right",style:is({fontFamily:"Arial"},u)}})})),this.set("itemsData",r)},e.prototype.getContainer=function(){return this.get("container")},e.prototype.formatArray=function(t){var r=this.get(t);if((0,h.isNumber)(r))this.set(t,[r,r,r,r]);else if((0,h.isArray)(r))switch(r.length){case 0:this.set(t,[0,0,0,0]);break;case 1:this.set(t,[r[0],r[0],r[0],r[0]]);break;case 2:this.set(t,[r[0],r[1],r[0],r[1]]);break;case 3:this.set(t,[r[0],r[1],r[2],r[1]]);break;default:break}return this.get(t)},e.prototype.getShapeSize=function(t){var r,n,a;return t.size&&((0,h.isArray)(t.size)?(r=t.size[0],n=t.size[1]||t.size[0],a=t.size[0]/2):(0,h.isNumber)(t.size)&&(r=t.size,n=t.size,a=t.size/2)),t.style&&(t.style.width&&(r=t.style.width),t.style.height&&(n=t.style.height),t.style.r&&(a=t.style.r)),a||(a=5),r||(r=a),n||(n=a),{width:r,height:n,r:a}},e.prototype.getStyle=function(t,r){var n=t==="node"?{fill:"#ccc",lineWidth:0}:{stroke:"#000",lineWidth:1};return is(is({},n),r.style||{})},e.prototype.destroy=function(){var t=this.get("legendCanvas");t==null||t.destroy();var r=this.get("graph"),n=r.get("container"),a=this.get("container");n.removeChild(a)},e}(cu),uw=sw,fw=function(){var i=function(t,r){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(n[o]=a[o])},i(t,r)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}}(),Gu=function(){return Gu=Object.assign||function(i){for(var e,t=1,r=arguments.length;t+

    ":"

    -

    ",_=r?"":"

    ".concat(u,"

    "),I="

    x

    ",B=r?"".concat(c,"px"):"".concat(c,"px ").concat(c,"px 0 0");return'
    +
    +

    `).concat(o,`

    + `).concat(l,` + `).concat(I,` +
    + `).concat(_,` +
    `)}},e.prototype.init=function(){var t=this;if(!t.destroyed){var r=t.get("graph"),n=r.getContainer(),a=t.get("container"),o=this.get("containerCfg");o?(a=this.createContainer(),n.appendChild(a)):a=n,this.set("container",a);var s=n.getBoundingClientRect(),u=new oc({container:n,width:s.right-s.left,height:s.bottom-s.top});pi(u.get("el"),{position:"absolute",top:0,left:0,pointerEvents:"none"}),window.addEventListener("resize",(0,h.debounce)(function(){return t.resizeCanvas(t)},100));var f=u.addGroup({id:"annotation-link-group"});t.set("linkGroup",f),t.set("canvas",u),t.get("getTitle")||t.set("getTitle",function(l){var _,I=((_=l==null?void 0:l.getModel)===null||_===void 0?void 0:_.call(l))||{},B=I.label,j=I.id;return B||j||"-"}),t.get("getContent")||t.set("getContent",function(l){var _,I;if(!l)return"-";var B=((_=l.getModel)===null||_===void 0?void 0:_.call(l))||{},j=B.label,et=B.id,ut=(I=l.getType)===null||I===void 0?void 0:I.call(l),ct=ut?"".concat(ut,": "):"";return"".concat(ct).concat(j||et||"")});var c=t.get("defaultData");c&&this.readData(c)}},e.prototype.createContainer=function(){var t=this;if(!this.destroyed){var r=this.get("containerCfg"),n=this.get("graph"),a=n.getContainer(),o=a.getBoundingClientRect(),s=o.left,u=o.right,f=o.top,c=o.bottom,l=c-f,_=u-s,I=r.position,B=I===void 0?"top":I,j=r.offsetX,et=j===void 0?0:j,ut=r.offsetY,ct=ut===void 0?0:ut,pt=t0(r,["position","offsetX","offsetY"]),Mt=r.height,Zt=Mt===void 0?"fit-content":Mt,se=r.width,oe=se===void 0?n.getWidth():se;Zt==="100%"&&(Zt=l),oe==="100%"&&(oe=_);var _e="unset",Ue="unset",Re={};switch(B){case"right":_e="".concat(l,"px"),Re={top:0,right:0},Re.right+=s+et,Re.top+=f+ct;break;case"bottom":Ue="".concat(_,"px"),Re={bottom:0,left:0},Re.left+=s+et,Re.bottom+=f+ct;break;case"top":Ue="".concat(_,"px");case"left":_e="".concat(l,"px");default:Re={top:0,left:0},Re.left+=s+et,Re.top+=f+ct;break}Object.keys(Re).forEach(function(hr){Re[hr]="".concat(Re[hr],"px")});var qe=qo("
    "));return pi(qe,Gu(Gu({position:"absolute",display:B==="top"||B==="bottom"?"inline-flex":"unset",width:(0,h.isNumber)(oe)?"".concat(oe,"px"):oe,height:(0,h.isNumber)(Zt)?"".concat(Zt,"px"):Zt,maxHeight:_e,maxWidth:Ue,overflow:"scroll"},Re),pt)),a.appendChild(qe),qe.addEventListener("scroll",function(hr){t.updateLinks()}),qe}},e.prototype.resizeCanvas=function(t){clearTimeout(t.resizeTimer),t.resizeTimer=setTimeout(function(){if(!(!t||t.destroyed)){var r=t.get("container").getBoundingClientRect(),n=r.right-r.left,a=r.bottom-r.top;t.get("canvas").changeSize(n,a),t.updateOutsideCards(t)}},250)},e.prototype.updateOutsideCards=function(t){var r=t||this,n=r.get("cardInfoMap")||{},a=r.get("graph"),o=a.getPointByCanvas(0,0),s=a.getPointByCanvas(a.getWidth(),a.getHeight()),u=a.getClientByPoint(o.x,o.y),f=u.x,c=u.y,l=a.getClientByPoint(s.x,s.y),_=l.x,I=l.y;Object.values(n).forEach(function(B){var j=B.card;if(j){var et=j.style,ut=Nl(et.left),ct=Nl(et.top),pt=j.getBoundingClientRect(),Mt=pt.width,Zt=pt.height,se=ut,oe=ct;ut+Mt>_-f&&(se=_-f-Mt),ut<0&&(se=0),ct+Zt>I-c&&(oe=I-c-Zt),ct<0&&(oe=0),pi(j,{left:"".concat(se,"px"),top:"".concat(oe,"px")})}}),r.updateLinks()},e.prototype.showAnnotation=function(t){if(!this.destroyed){var r=t.item;this.toggleAnnotation(r)}},e.prototype.hideCards=function(){var t=this;if(!t.destroyed){var r=t.get("cardInfoMap")||{};Object.keys(r).forEach(function(n){t.hideCard(n)})}},e.prototype.toggleAnnotation=function(t,r){var n,a;r===void 0&&(r={});var o=this;if(!o.destroyed){var s=o.get("cardInfoMap")||{},u=o.get("graph"),f=o.get("container"),c=o.get("containerCfg"),l=Object.assign({},o.get("cardCfg")||{},r),_=l.minHeight,I=l.minWidth,B=l.width,j=l.height,et=l.collapsed,ut=et===void 0?!1:et,ct=l.x,pt=l.y,Mt=l.title,Zt=l.content,se=l.maxTitleLength,oe=l.defaultBegin,_e=t0(l,["minHeight","minWidth","width","height","collapsed","x","y","title","content","maxTitleLength","defaultBegin"]),Ue=o.get("linkGroup"),Re=this.get("rows")||[[]],qe=(n=t.isCanvas)===null||n===void 0?void 0:n.call(t),hr=qe?e0:t.getID(),nn=s[hr]||{},kn=nn.card,En=nn.link,Kr=nn.x,ta=nn.y,$n=nn.title,$r=nn.content,yn=this.get("getTitle"),Fn=this.get("getContent"),zn=this.get("getContentPlaceholder")||function(){return""},ia=this.get("getTitlePlaceHolder")||function(){return""},da=zn(t),Wa=ia(t),oi=qo(this.getDOMContent(Gu({itemId:hr,collapsed:ut,title:((a=$n||Mt||(yn==null?void 0:yn(t)))===null||a===void 0?void 0:a.substr(0,se))||Wa,content:$r||Zt||(Fn==null?void 0:Fn(t))||da},_e))),Qi=(0,h.isNumber)(_)?"".concat(_,"px"):_;pi(oi,{minHeight:ut?"unset":Qi,minWidth:(0,h.isNumber)(I)?"".concat(I,"px"):I,height:j,width:B});var Li=!!kn;Li?(En==null||En.remove(!0),f.replaceChild(oi,kn)):f.appendChild(oi);var Ji;if(!c){if(Ji=f.getBoundingClientRect()||{},ct!==void 0&&pt!==void 0)Kr=ct,ta=pt;else if(!Li&&!qe){var co=Ji.top,jo=oe||{},Lo=jo.left,Uu=jo.right,Ts=Uu===void 0?16:Uu,Wu=jo.top,As=Wu===void 0?8:Wu,Is=jo.bottom,wu=Ts,js=As;isNaN(Lo)||(wu=f.scrollWidth-Lo),isNaN(Is)||(js=f.scrollHeight-Is);var au=(0,h.isNumber)(I)?I:100;Kr=f.scrollWidth-oi.scrollWidth-(Re.length-1)*au-wu;var gi=Re[Re.length-1],Zi=(gi[gi.length-1]||{}).bbox;ta=(Zi==null?void 0:Zi.bottom)-co||js}pi(oi,{position:"absolute",left:"".concat(Kr,"px"),top:"".concat(ta,"px"),cusor:c?"unset":"move"})}this.bindListener(oi,hr);var vi=oi.getBoundingClientRect();if(!qe){var Ki=Ev(t,vi,u,this.get("canvas")),Mo=this.get("linkStyle");En=Ue.addShape("path",{attrs:Gu({lineWidth:1,lineDash:[5,5],stroke:"#ccc",path:Ki},Mo)})}if(s[hr]=Gu(Gu({},s[hr]||{}),{id:hr,collapsed:ut,card:oi,link:En,x:Kr,y:ta,cardBBox:vi,content:$r||Zt,title:$n||Mt,contentPlaceholder:da,titlePlaceholder:Wa,isCanvas:qe}),o.set("cardInfoMap",s),c)this.updateCardPositionsInConatainer(),this.updateLinks();else{var Aa=!isNaN(ct)&&!isNaN(pt);if(!Li&&!qe&&!Aa){var Ei=Ji.bottom,_i=Ei===void 0?0:Ei,co=Ji.top;Re[Re.length-1].push({id:hr,bbox:vi}),vi.top>_i-co-vi.height-16&&Re.push([]),this.set("rows",Re)}}this.updateCardSize(hr);var _o=this.get("onAnnotationChange");_o==null||_o(s[hr],Li?"update":"create")}},e.prototype.updateCardPositionsInConatainer=function(){if(!this.destroyed){var t=this.get("cardInfoMap");if(t){var r=this.get("container"),n=this.get("containerCfg").position,a=r.getBoundingClientRect().width,o=getComputedStyle(r),s=Nl(o.paddingLeft)+Nl(o.paddingRight);a-=s,Object.values(t).forEach(function(u){var f=u.card,c=f.getBoundingClientRect().width;switch(n){case"right":pi(f,{marginLeft:a?"".concat(a-c,"px"):"0px"});break;case"top":case"bottom":pi(f,{marginLeft:"8px"});default:break}})}}},e.prototype.handleExpandCollapseCard=function(t){if(!this.destroyed){var r=this.get("graph"),n=this.get("cardInfoMap");if(n){var a=n[t].collapsed,o=r.findById(t);if(o){var s=this.get("cardCfg").collapseType;s==="hide"&&!a?this.hideCard(t):this.toggleAnnotation(o,{collapsed:!a}),n[t]=Gu(Gu({},n[t]),{collapsed:!a})}}}},e.prototype.hideCard=function(t){if(!this.destroyed){var r=this.get("cardInfoMap");if(!(!r||!r[t])){var n=r[t],a=n.card,o=n.link;pi(a,{display:"none"}),o==null||o.hide();var s=this.get("onAnnotationChange");s(r[t],"hide")}}},e.prototype.removeCard=function(t){if(!this.destroyed){var r=this.get("cardInfoMap");if(r){var n=r[t],a=n.card,o=n.link,s=this.get("container");s.removeChild(a),o==null||o.remove(!0),delete r[t];var u=this.get("onAnnotationChange");u(n,"remove")}}},e.prototype.bindListener=function(t,r){var n=this;if(!this.destroyed){t.addEventListener("mousemove",function(u){var f;if(u.target.className==="g6-annotation-collapse"?f="collapse":u.target.className==="g6-annotation-expand"?f="expand":u.target.className==="g6-annotation-close"&&(f="close"),f){var c=n.get("cardCfg").onMouseEnterIcon,l=c===void 0?function(){}:c;l(u,r,f)}}),t.addEventListener("mouseout",function(u){var f;if(u.target.className==="g6-annotation-collapse"?f="collapse":u.target.className==="g6-annotation-expand"?f="expand":u.target.className==="g6-annotation-close"&&(f="close"),f){var c=n.get("cardCfg").onMouseLeaveIcon,l=c===void 0?function(){}:c;l(u,r,f)}}),t.addEventListener("mouseenter",function(u){var f=n.get("cardInfoMap");if(f){var c=n.get("graph"),l=c.findById(r);if(l){var _=n.get("itemHighlightState");c.setItemState(l,_,!0)}var I=f[r].link;if(I){var B=n.get("linkHighlightStyle")||{};I.attr(B)}}}),t.addEventListener("mouseleave",function(u){var f=n.get("cardInfoMap");if(f){var c=n.get("graph"),l=c.findById(r);if(l){var _=n.get("itemHighlightState");c.setItemState(l,_,!1)}var I=f[r].link;if(I){var B=n.get("linkHighlightStyle")||{};Object.keys(B).forEach(function(et){I.attr(et,void 0),I.attr(et,void 0)});var j=n.get("linkStyle");I.attr(j)}}}),t.addEventListener("click",function(u){var f=(n.get("cardCfg")||{}).onClickIcon;if(u.target.className==="g6-annotation-collapse"||u.target.className==="g6-annotation-expand"){var c=n.get("cardCfg").collapseType;c==="hide"?n.hideCard(r):n.handleExpandCollapseCard(r),f==null||f(u,r,u.target.className==="g6-annotation-collapse"?"collapse":"expand")}else if(u.target.className==="g6-annotation-close"){var l=n.get("cardCfg").closeType;l==="remove"?n.removeCard(r):n.hideCard(r),f==null||f(u,r,"close")}});var a=this.get("editable");a&&t.addEventListener("dblclick",function(u){var f=n.get("cardInfoMap"),c=(n.get("cardCfg")||{}).maxTitleLength,l=c===void 0?20:c;if(f){var _=u.target,I=_.className;if(!(I!=="g6-annotation-title"&&I!=="g6-annotation-content")){var B=I==="g6-annotation-title"?_.getBoundingClientRect():_.parentNode.getBoundingClientRect(),j=B.width,et=B.height,ut=getComputedStyle(_),ct=I==="g6-annotation-title"?"input":"textarea",pt=qo("<".concat(ct,' class="').concat(I,'-input" type="textarea" style="width:').concat(j,"px; height: ").concat(et,'px; min-width: 16px;"/>')),Mt=qo('
    '));Mt.appendChild(pt),_.parentNode.replaceChild(Mt,_);var Zt=f[r],se=Zt.contentPlaceholder,oe=Zt.titlePlaceholder,_e=Zt.content,Ue=Zt.title,Re=_e;I==="g6-annotation-title"?(pt.name="title",pt.maxLength=l,Re=Ue):pt.name="content",Re?(pt.innerHTML=_.innerHTML,pt.value=_.innerHTML):pt.placeholder=I==="g6-annotation-title"?oe:se,pt.focus(),pt.addEventListener("blur",function(qe){pt.value&&(_.innerHTML=pt.value,Zt[pt.name||"title"]=pt.value),Mt.parentNode.replaceChild(_,Mt),n.updateCardSize(r);var hr=n.get("onAnnotationChange");hr==null||hr(Zt,"update")})}}});var o=["g6-annotation-title","g6-annotation-content","g6-annotation-title-input","g6-annotation-content-input"];t.draggable=!0,t.addEventListener("dragstart",function(u){var f=u.target.className;if(!o.includes(f)){var c=t.style;n.set("dragging",{card:t,x:u.clientX,y:u.clientY,left:Nl(c.left),top:Nl(c.top)})}}),t.addEventListener("drag",function(u){u.preventDefault();var f=n.get("cardInfoMap");if(f){var c=u.clientX,l=u.clientY,_=n.get("dragging");if(!(isNaN(c)||isNaN(l)||!_)){var I=_.x,B=_.y,j=_.left,et=_.top,ut=_.card,ct=c-I,pt=l-B;j+=ct,et+=pt;var Mt=n.get("graph"),Zt=Mt.getPointByCanvas(0,0),se=Mt.getPointByCanvas(Mt.getWidth(),Mt.getHeight()),oe=Mt.getClientByPoint(Zt.x,Zt.y),_e=oe.x,Ue=oe.y,Re=Mt.getClientByPoint(se.x,se.y),qe=Re.x,hr=Re.y,nn=ut.getBoundingClientRect(),kn=nn.right-nn.left,En=nn.bottom-nn.top;(j>qe-_e-kn&&ct>0||j<0&&ct<0)&&(j-=ct),(et>hr-Ue-En&&pt>0||et<0&&pt<0)&&(et-=pt),pi(ut,{left:"".concat(j,"px"),top:"".concat(et,"px"),visibility:"hidden"}),I=c,B=l;var Kr=(f[r]||{}).link;if(Kr){var ta=Mt.findById(r);Kr.attr("path",Ev(ta,nn,Mt,n.get("canvas")))}n.set("dragging",{x:I,y:B,left:j,top:et,card:ut})}}});var s=function(f){var c=n.get("cardInfoMap");if(c){var l=n.get("dragging");if(l){var _=l.left,I=l.top,B=l.card;c[r].x=_,c[r].y=I,pi(B,{visibility:"visible"}),n.set("dragging",!1);var j=n.get("rows");j==null||j.forEach(function(ut){for(var ct=ut.length-1;ct>=0;ct--)ut[ct].id===r&&ut.splice(ct,1)});var et=n.get("onAnnotationChange");et==null||et(c[r],"update")}}};t.addEventListener("dragend",s)}},e.prototype.updateCardSize=function(t){var r=this.get("cardInfoMap");if(r){var n=r[t].card,a=n.getBoundingClientRect().width,o=n.getElementsByClassName("g6-annotation-title")[0];if(o){var s=getComputedStyle(o),u=Nl(s.marginLeft),f=o.getBoundingClientRect().width;pi(o,{marginRight:"".concat(a-u-24-16-f,"px")})}}},e.prototype.updateLink=function(t){var r=t.item;if(r){var n=this.get("cardInfoMap");if(n){var a=this.get("canvas"),o=this.get("graph"),s=r.getID(),u=n[s]||{},f=u.link,c=u.card;if(f){var l=Ev(r,c.getBoundingClientRect(),o,a);f.attr("path",l)}}}},e.prototype.updateLinks=function(){var t=this;if(!this.destroyed){var r=this.get("cardInfoMap");if(r){var n=this.get("graph");Object.values(r).forEach(function(a){var o=a.id,s=n.findById(o);t.updateLink({item:s})})}}},e.prototype.onGraphDataChange=function(){var t=this,r=this.get("cardInfoMap");if(r){var n=this.get("graph");Object.values(r).forEach(function(a){var o=a.id,s=a.card,u=a.isCanvas;if(!(!s||u||s.style.display==="none")){var f=n.findById(o);f&&f.isVisible()?t.toggleAnnotation(f):t.hideCard(o)}})}},e.prototype.onGraphItemVisibilityChange=function(t){var r=t.item,n=t.visible;if(!(!r||r.destroyed)){var a=this.get("cardInfoMap");if(a){var o=r.getID();a[o]&&(n||this.hideCard(o))}}},e.prototype.saveData=function(t){t===void 0&&(t=!1);var r=this.get("cardInfoMap");if(r){var n=this.get("graph"),a=this.get("getTitle"),o=this.get("getContent"),s=[];return Object.values(r).forEach(function(u){var f=u.title,c=u.content,l=u.x,_=u.y,I=u.id,B=u.collapsed,j=u.card;if(!(j&&j.style.display==="none"&&!t)){var et=n.findById(I)||n.get("canvas");s.push({id:I,x:l,y:_,collapsed:B,title:f||(a==null?void 0:a(et)),content:c||(o==null?void 0:o(et)),visible:j&&j.style.display!=="none"})}}),s}},e.prototype.readData=function(t){var r=this,n=this.get("graph");t.forEach(function(a){var o=a.id,s=a.x,u=a.y,f=a.title,c=a.content,l=a.collapsed,_=a.visible,I=n.findById(o);if(!I&&o===e0&&(I=n.get("canvas")),!I){var B=r.get("cardInfoMap")||{};B[o]=a,r.set("cardInfoMap",B);return}r.toggleAnnotation(I,{x:s,y:u,title:f,content:c,collapsed:l}),_||r.hideCard(o)})},e.prototype.clear=function(){var t=this.get("cardInfoMap");if(t){var r=this.get("container");Object.values(t).forEach(function(n){var a=n.card,o=n.link;r.removeChild(a),o==null||o.remove(!0)}),this.set("cardInfoMap",{})}},e.prototype.destroy=function(){var t;this.clear(),(t=this.get("canvas"))===null||t===void 0||t.destroy();var r=this.get("graph");!r||r.destroyed||(this.get("containerCfg")&&r.getContainer().removeChild(this.get("container")),this.destroyed=!0)},e}(cu),lw=cw,dw=function(e,t){var r,n,a,o=1/0;Object.keys(e).forEach(function(f){var c=e[f];Object.keys(t).forEach(function(l){var _=t[l],I=c.x-_.x,B=c.y-_.y,j=I*I+B*B;o>j&&(o=j,r=c,n=_,a=[f,l])})});var s=20,u=Xs.getControlPoint(r,n,.5,s);return[["M",r.x,r.y],["Q",u.x,u.y,n.x,n.y]]},Ev=function(e,t,r,n){var a,o,s=e.getType();if(s==="edge")o=[e.getKeyShape().getPoint(.5)];else{var u=(a=e.getKeyShape)===null||a===void 0?void 0:a.call(e).getBBox(),f=u.minX,c=u.minY,l=u.maxX,_=u.maxY,I=e.getModel(),B=I.x,j=I.y;f+=B,c+=j,l+=B,_+=j,o={left:{x:f,y:(c+_)/2},right:{x:l,y:(c+_)/2},top:{x:(f+l)/2,y:c},bottom:{x:(f+l)/2,y:_}}}Object.keys(o).forEach(function(Ue){var Re=o[Ue],qe=Re.x,hr=Re.y,nn=r.getClientByPoint(qe,hr);o[Ue]=n.getPointByClient(nn.x,nn.y)});var et=t.top,ut=et===void 0?0:et,ct=t.left,pt=ct===void 0?0:ct,Mt=t.right,Zt=Mt===void 0?0:Mt,se=t.bottom,oe=se===void 0?0:se,_e={left:n.getPointByClient(pt,(ut+oe)/2),right:n.getPointByClient(Zt,(ut+oe)/2),top:n.getPointByClient((pt+Zt)/2,ut),bottom:n.getPointByClient((pt+Zt)/2,oe)};return dw(o,_e)},Nl=function(e){return Number(e.replace(/\s+|px/gi,""))||0},hw={PluginBase:cu,Menu:_x,Grid:Ex,Minimap:Lx,Bundling:kx,ToolBar:Yx,Tooltip:Vx,Fisheye:zx,TimeBar:XE,ImageMinimap:KE,EdgeFilterLens:JE,SnapLine:aw,Legend:uw,Annotation:lw},vw=hw,Cs=vw;ic("circle",{options:{size:Jn.defaultNode.size,style:{x:0,y:0,stroke:Jn.defaultNode.style.stroke,fill:Jn.defaultNode.style.fill,lineWidth:Jn.defaultNode.style.lineWidth},labelCfg:{style:{fill:Jn.nodeLabel.style.fill,fontSize:Jn.nodeLabel.style.fontSize,fontFamily:Jn.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Jn.defaultNode.linkPoints.size,lineWidth:Jn.defaultNode.linkPoints.lineWidth,fill:Jn.defaultNode.linkPoints.fill,stroke:Jn.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)({},Jn.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(e),o=(0,h.deepMix)({},n,e.icon),s="".concat(this.type,"-keyShape"),u=t.addShape("circle",{attrs:a,className:s,name:s,draggable:!0});t.shapeMap[s]=u;var f=o.width,c=o.height,l=o.show,_=o.text;if(l){var I="".concat(this.type,"-icon");_?t.shapeMap[I]=t.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:I,name:I,draggable:!0}):t.shapeMap[I]=t.addShape("image",{attrs:(0,b.__assign)({x:-f/2,y:-c/2},o),className:I,name:I,draggable:!0})}return this.drawLinkPoints(e,t),u},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints;if(r){var n=r||{},a=n.top,o=n.left,s=n.right,u=n.bottom,f=n.size,c=n.r,l=(0,b.__rest)(n,["top","left","right","bottom","size","r"]),_=this.getSize(e),I=_[0]/2;if(o){var B="link-point-left";t.shapeMap[B]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:-I,y:0,r:f/2||c||5}),className:B,name:B,isAnchorPoint:!0})}if(s){var j="link-point-right";t.shapeMap[j]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:I,y:0,r:f/2||c||5}),className:j,name:j,isAnchorPoint:!0})}if(a){var et="link-point-top";t.shapeMap[et]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:0,y:-I,r:f/2||c||5}),className:et,name:et,isAnchorPoint:!0})}if(u){var ut="link-point-bottom";t.shapeMap[ut]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:0,y:I,r:f/2||c||5}),className:ut,name:ut,isAnchorPoint:!0})}}},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},n=(0,h.deepMix)({},t,r),a=this.getSize(e),o=a[0]/2,s=(0,b.__assign)({x:0,y:0,r:o},n);return s},update:function(e,t,r){var n=t.getContainer(),a=this.getSize(e),o=(0,b.__assign)({},e.style);e.style.stroke===void 0&&e.color&&(o.stroke=e.color),e.style.r===void 0&&!isNaN(a[0])&&(o.r=a[0]/2),this.updateShape(e,t,o,!0,r),this.updateLinkPoints(e,n)}},"single-node"),ic("rect",{options:{size:[100,30],style:{radius:0,stroke:Jn.defaultNode.style.stroke,fill:Jn.defaultNode.style.fill,lineWidth:Jn.defaultNode.style.lineWidth},labelCfg:{style:{fill:Jn.nodeLabel.style.fill,fontSize:Jn.nodeLabel.style.fontSize,fontFamily:Jn.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Jn.defaultNode.linkPoints.size,lineWidth:Jn.defaultNode.linkPoints.lineWidth,fill:Jn.defaultNode.linkPoints.fill,stroke:Jn.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)({},Jn.nodeStateStyles)},shapeType:"rect",labelPosition:"center",drawShape:function(e,t){var r=this.getShapeStyle(e),n=t.addShape("rect",{attrs:r,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});return t.shapeMap["".concat(this.type,"-keyShape")]=n,this.drawLinkPoints(e,t),n},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,n=r===void 0?{}:r,a=n.top,o=n.left,s=n.right,u=n.bottom,f=n.size,c=n.r,l=(0,b.__rest)(n,["top","left","right","bottom","size","r"]),_=this.getSize(e),I=_[0],B=_[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:-I/2,y:0,r:f/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:I/2,y:0,r:f/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:0,y:-B/2,r:f/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:0,y:B/2,r:f/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},n=(0,h.mix)({},t,r),a=this.getSize(e),o=n.width||a[0],s=n.height||a[1],u=(0,b.__assign)({x:-o/2,y:-s/2,width:o,height:s},n);return u},update:function(e,t,r){var n=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s=t.get("keyShape");e.size||(o[0]=s.attr("width")||a.width,o[1]=s.attr("height")||a.height);var u={stroke:e.color,x:-o[0]/2,y:-o[1]/2,width:o[0],height:o[1]},f=(0,h.mix)({},a,s.attr(),u);f=(0,h.mix)(f,e.style),this.updateShape(e,t,f,!1,r),this.updateLinkPoints(e,n)}},"single-node"),ic("ellipse",{options:{size:[80,40],style:{x:0,y:0,stroke:Jn.defaultNode.style.stroke,fill:Jn.defaultNode.style.fill,lineWidth:Jn.defaultNode.style.lineWidth},labelCfg:{style:{fill:Jn.nodeLabel.style.fill,fontSize:Jn.nodeLabel.style.fontSize,fontFamily:Jn.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Jn.defaultNode.linkPoints.size,lineWidth:Jn.defaultNode.linkPoints.lineWidth,fill:Jn.defaultNode.linkPoints.fill,stroke:Jn.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)({},Jn.nodeStateStyles)},shapeType:"ellipse",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(e),o=t.addShape("ellipse",{attrs:a,className:"ellipse-keyShape",name:"ellipse-keyShape",draggable:!0});t.shapeMap["ellipse-keyShape"]=o;var s=n.width,u=n.height,f=n.show,c=n.text;return f&&(c?t.shapeMap["".concat(this.type,"-icon")]=t.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}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:(0,b.__assign)({x:-s/2,y:-u/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,n=r===void 0?{}:r,a=n.top,o=n.left,s=n.right,u=n.bottom,f=n.size,c=n.r,l=(0,b.__rest)(n,["top","left","right","bottom","size","r"]),_=this.getSize(e),I=_[0]/2,B=_[1]/2;o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:-I,y:0,r:f/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:I,y:0,r:f/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:0,y:-B,r:f/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:0,y:B,r:f/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},n=(0,h.mix)({},t,r),a=this.getSize(e),o=a[0]/2,s=a[1]/2,u=(0,b.__assign)({x:0,y:0,rx:o,ry:s},n);return u},update:function(e,t,r){var n=t.getContainer(),a=this.getOptions({}).style,o=this.getSize(e),s={stroke:e.color,rx:o[0]/2,ry:o[1]/2},u=t.get("keyShape"),f=(0,h.mix)({},a,u.attr(),s);f=(0,h.mix)(f,e.style),this.updateShape(e,t,f,!0,r),this.updateLinkPoints(e,n)}},"single-node"),ic("diamond",{options:{size:[80,80],style:{stroke:Jn.defaultNode.style.stroke,fill:Jn.defaultNode.style.fill,lineWidth:Jn.defaultNode.style.lineWidth},labelCfg:{style:{fill:Jn.nodeLabel.style.fill,fontSize:Jn.nodeLabel.style.fontSize,fontFamily:Jn.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Jn.defaultNode.linkPoints.size,lineWidth:Jn.defaultNode.linkPoints.lineWidth,fill:Jn.defaultNode.linkPoints.fill,stroke:Jn.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)({},Jn.nodeStateStyles)},shapeType:"diamond",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=n.width,u=n.height,f=n.show,c=n.text;return f&&(c?t.shapeMap["".concat(this.type,"-icon")]=t.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}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:(0,b.__assign)({x:-s/2,y:-u/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,n=r===void 0?{}:r,a=n.top,o=n.left,s=n.right,u=n.bottom,f=n.size,c=n.r,l=(0,b.__rest)(n,["top","left","right","bottom","size","r"]),_=this.getSize(e),I=_[0],B=_[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:-I/2,y:0,r:f/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:I/2,y:0,r:f/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:0,y:-B/2,r:f/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:0,y:B/2,r:f/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},getPath:function(e){var t=this.getSize(e),r=t[0],n=t[1],a=[["M",0,-n/2],["L",r/2,0],["L",0,n/2],["L",-r/2,0],["Z"]];return a},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},n=(0,h.mix)({},t,r),a=this.getPath(e),o=(0,b.__assign)({path:a},n);return o},update:function(e,t,r){var n=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},u=t.get("keyShape"),f=(0,h.mix)({},a,u.attr(),s);f=(0,h.mix)(f,e.style),this.updateShape(e,t,f,!0,r),this.updateLinkPoints(e,n)}},"single-node"),ic("triangle",{options:{size:40,direction:"up",style:{stroke:Jn.defaultNode.style.stroke,fill:Jn.defaultNode.style.fill,lineWidth:Jn.defaultNode.style.lineWidth},labelCfg:{style:{fill:Jn.nodeLabel.style.fill,fontSize:Jn.nodeLabel.style.fontSize},offset:15},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Jn.defaultNode.linkPoints.size,lineWidth:Jn.defaultNode.linkPoints.lineWidth,fill:Jn.defaultNode.linkPoints.fill,stroke:Jn.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)({},Jn.nodeStateStyles)},shapeType:"triangle",labelPosition:"bottom",drawShape:function(e,t){var r=this.mergeStyle||this.getOptions(e),n=r.icon,a=n===void 0?{}:n,o=r.direction,s=this.getShapeStyle(e),u=e.direction||o,f=t.addShape("path",{attrs:s,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=f;var c=a.width,l=a.height,_=a.show,I=a.offset,B=a.text;if(_)if(B)t.shapeMap["".concat(this.type,"-icon")]=t.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 j=-c/2,et=-l/2;(u==="up"||u==="down")&&(et+=I),(u==="left"||u==="right")&&(j+=I),t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:(0,b.__assign)({x:j,y:et},a),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})}return this.drawLinkPoints(e,t),f},drawLinkPoints:function(e,t){var r=this.mergeStyle||this.getOptions(e),n=r.linkPoints,a=n===void 0?{}:n,o=r.direction,s=e.direction||o,u=a.top,f=a.left,c=a.right,l=a.bottom,_=a.size,I=a.r,B=(0,b.__rest)(a,["top","left","right","bottom","size","r"]),j=this.getSize(e),et=j[0];if(f){var ut=null,ct=et*Math.sin(1/3*Math.PI),pt=et*Math.sin(1/3*Math.PI);s==="up"?ut=[-pt,ct]:s==="down"?ut=[-pt,-ct]:s==="left"&&(ut=[-pt,pt-ct]),ut&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},B),{x:ut[0],y:ut[1],r:_/2||I||5}),className:"link-point-left",name:"link-point-left"}))}if(c){var Mt=null,ct=et*Math.sin(1/3*Math.PI),pt=et*Math.sin(1/3*Math.PI);s==="up"?Mt=[pt,ct]:s==="down"?Mt=[pt,-ct]:s==="right"&&(Mt=[pt,pt-ct]),Mt&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},B),{x:Mt[0],y:Mt[1],r:_/2||I||5}),className:"link-point-right",name:"link-point-right"}))}if(u){var Zt=null,ct=et*Math.sin(1/3*Math.PI),pt=et*Math.sin(1/3*Math.PI);s==="up"?Zt=[pt-ct,-ct]:s==="left"?Zt=[pt,-ct]:s==="right"&&(Zt=[-pt,-ct]),Zt&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},B),{x:Zt[0],y:Zt[1],r:_/2||I||5}),className:"link-point-top",name:"link-point-top"}))}if(l){var se=null,ct=et*Math.sin(1/3*Math.PI),pt=et*Math.sin(1/3*Math.PI);s==="down"?se=[-pt+ct,ct]:s==="left"?se=[pt,ct]:s==="right"&&(se=[-pt,ct]),se&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},B),{x:se[0],y:se[1],r:_/2||I||5}),className:"link-point-bottom",name:"link-point-bottom"}))}},getPath:function(e){var t=(this.mergeStyle||this.getOptions(e)).direction,r=e.direction||t,n=this.getSize(e),a=n[0],o=a*Math.sin(1/3*Math.PI),s=a*Math.sin(1/3*Math.PI),u=[["M",-s,o],["L",0,-o],["L",s,o],["Z"]];return r==="down"?u=[["M",-s,-o],["L",s,-o],["L",0,o],["Z"]]:r==="left"?u=[["M",-s,s-o],["L",s,-s],["L",s,s],["Z"]]:r==="right"&&(u=[["M",s,s-o],["L",-s,s],["L",-s,-s],["Z"]]),u},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},n=(0,h.mix)({},t,r),a=this.getPath(e),o=(0,b.__assign)({path:a},n);return o},update:function(e,t,r){var n=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},u=t.get("keyShape"),f=(0,h.mix)({},a,u.attr(),s);f=(0,h.mix)(f,e.style),this.updateShape(e,t,f,!0,r),this.updateLinkPoints(e,n)},updateLinkPoints:function(e,t){var r=this.getOptions({}),n=r.linkPoints,a=r.direction,o=e.direction||a,s=t.shapeMap["link-point-left"]||t.find(function(Kr){return Kr.get("className")==="link-point-left"}),u=t.shapeMap["link-point-right"]||t.find(function(Kr){return Kr.get("className")==="link-point-right"}),f=t.shapeMap["link-point-top"]||t.find(function(Kr){return Kr.get("className")==="link-point-top"}),c=t.shapeMap["link-point-bottom"]||t.find(function(Kr){return Kr.get("className")==="link-point-bottom"}),l=n,_=s||u||f||c;_&&(l=_.attr());var I=(0,h.mix)({},l,e.linkPoints),B=I.fill,j=I.stroke,et=I.lineWidth,ut=I.size/2;ut||(ut=I.r);var ct=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,bottom:void 0},pt=ct.left,Mt=ct.right,Zt=ct.top,se=ct.bottom,oe=this.getSize(e),_e=oe[0],Ue={r:ut,fill:B,stroke:j,lineWidth:et},Re=null,qe=_e*Math.sin(1/3*Math.PI),hr=_e*Math.sin(1/3*Math.PI);o==="up"?Re=[-hr,qe]:o==="down"?Re=[-hr,-qe]:o==="left"&&(Re=[-hr,hr-qe]),Re&&(s?!pt&&pt!==void 0?(s.remove(),delete t.shapeMap["link-point-left"]):s.attr((0,b.__assign)((0,b.__assign)({},Ue),{x:Re[0],y:Re[1]})):pt&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},Ue),{x:Re[0],y:Re[1]}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})));var nn=null;o==="up"?nn=[hr,qe]:o==="down"?nn=[hr,-qe]:o==="right"&&(nn=[hr,hr-qe]),nn&&(u?!Mt&&Mt!==void 0?(u.remove(),delete t.shapeMap["link-point-right"]):u.attr((0,b.__assign)((0,b.__assign)({},Ue),{x:nn[0],y:nn[1]})):Mt&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},Ue),{x:nn[0],y:nn[1]}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})));var kn=null;o==="up"?kn=[hr-qe,-qe]:o==="left"?kn=[hr,-qe]:o==="right"&&(kn=[-hr,-qe]),kn&&(f?!Zt&&Zt!==void 0?(f.remove(),delete t.shapeMap["link-point-top"]):f.attr((0,b.__assign)((0,b.__assign)({},Ue),{x:kn[0],y:kn[1]})):Zt&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},Ue),{x:kn[0],y:kn[1]}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})));var En=null;o==="down"?En=[-hr+qe,qe]:o==="left"?En=[hr,qe]:o==="right"&&(En=[-hr,qe]),En&&(c?!se&&se!==void 0?(c.remove(),delete t.shapeMap["link-point-bottom"]):c.attr((0,b.__assign)((0,b.__assign)({},Ue),{x:En[0],y:En[1]})):se&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},Ue),{x:En[0],y:En[1]}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0})))}},"single-node"),ic("modelRect",{options:{size:[185,70],style:{radius:5,stroke:"#69c0ff",fill:"#ffffff",lineWidth:Jn.defaultNode.style.lineWidth,fillOpacity:1},labelCfg:{style:{fill:"#595959",fontSize:14,fontFamily:Jn.windowFontFamily},offset:30},descriptionCfg:{style:{fontSize:12,fill:"#bfbfbf",fontFamily:Jn.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(e,t){var r=(this.mergeStyle||this.getOptions(e)).preRect,n=r===void 0?{}:r,a=this.getShapeStyle(e),o=this.getSize(e),s=o[0],u=o[1],f=t.addShape("rect",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=f;var c=n.show,l=(0,b.__rest)(n,["show"]);return c&&(t.shapeMap["pre-rect"]=t.addShape("rect",{attrs:(0,b.__assign)({x:-s/2,y:-u/2,height:u},l),className:"pre-rect",name:"pre-rect",draggable:!0})),this.drawLogoIcon(e,t),this.drawStateIcon(e,t),this.drawLinkPoints(e,t),f},drawLogoIcon:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).logoIcon,n=r===void 0?{}:r,a=this.getSize(e),o=a[0];if(n.show){var s=n.width,u=n.height,f=n.x,c=n.y,l=n.offset,_=n.text,I=(0,b.__rest)(n,["width","height","x","y","offset","text"]);_?t.shapeMap["rect-logo-icon"]=t.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}):t.shapeMap["rect-logo-icon"]=t.addShape("image",{attrs:(0,b.__assign)((0,b.__assign)({},I),{x:f||-o/2+s+l,y:c||-u/2,width:s,height:u}),className:"rect-logo-icon",name:"rect-logo-icon",draggable:!0})}},drawStateIcon:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).stateIcon,n=r===void 0?{}:r,a=this.getSize(e),o=a[0];if(n.show){var s=n.width,u=n.height,f=n.x,c=n.y,l=n.offset,_=n.text,I=(0,b.__rest)(n,["width","height","x","y","offset","text"]);_?t.shapeMap["rect-state-icon"]=t.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}):t.shapeMap["rect-state-icon"]=t.addShape("image",{attrs:(0,b.__assign)((0,b.__assign)({},I),{x:f||o/2-s+l,y:c||-u/2,width:s,height:u}),className:"rect-state-icon",name:"rect-state-icon",draggable:!0})}},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,n=r===void 0?{}:r,a=n.top,o=n.left,s=n.right,u=n.bottom,f=n.size,c=n.r,l=(0,b.__rest)(n,["top","left","right","bottom","size","r"]),_=this.getSize(e),I=_[0],B=_[1];o&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:-I/2,y:0,r:f/2||c||5}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),s&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:I/2,y:0,r:f/2||c||5}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),a&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:0,y:-B/2,r:f/2||c||5}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),u&&(t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},l),{x:0,y:B/2,r:f/2||c||5}),className:"link-point-bottom",name:"link-point-bottom",isAnchorPoint:!0}))},drawLabel:function(e,t){var r=this.getOptions(e),n=r.labelCfg,a=n===void 0?{}:n,o=r.logoIcon,s=o===void 0?{}:o,u=r.descriptionCfg,f=u===void 0?{}:u,c=this.getSize(e),l=c[0],_=null,I=s.show,B=s.width,j=-l/2+a.offset;I&&(j=-l/2+B+a.offset);var et=a.style,ut=f.style,ct=f.paddingTop;return(0,h.isString)(e.description)?(_=t.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},et),{x:j,y:-5,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=_,t.shapeMap["rect-description"]=t.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},ut),{x:j,y:17+(ct||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0})):(_=t.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},et),{x:j,y:7,text:e.label}),className:"text-shape",name:"text-shape",draggable:!0,labelRelated:!0}),t.shapeMap["text-shape"]=_),_},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},n=(0,h.mix)({},t,r),a=this.getSize(e),o=n.width||a[0],s=n.height||a[1],u=(0,b.__assign)({x:-o/2,y:-s/2,width:o,height:s},n);return u},update:function(e,t){var r=this.mergeStyle||this.getOptions(e),n=r.style,a=n===void 0?{}:n,o=r.labelCfg,s=o===void 0?{}:o,u=r.descriptionCfg,f=u===void 0?{}:u,c=this.getSize(e),l=c[0],_=c[1],I=t.get("keyShape");I.attr((0,b.__assign)((0,b.__assign)({},a),{x:-l/2,y:-_/2,width:l,height:_}));var B=t.getContainer(),j=B.shapeMap["rect-logo-icon"]||B.find(function(oi){return oi.get("className")==="rect-logo-icon"}),et=j?j.attr():{},ut=(0,h.mix)({},et,e.logoIcon),ct=ut.width;ct===void 0&&(ct=this.options.logoIcon.width);var pt=e.logoIcon?e.logoIcon.show:void 0,Mt=s.offset,Zt=-l/2+ct+Mt;!pt&&pt!==void 0&&(Zt=-l/2+Mt);var se=B.shapeMap["node-label"]||B.find(function(oi){return oi.get("className")==="node-label"}),oe=B.shapeMap["rect-description"]||B.find(function(oi){return oi.get("className")==="rect-description"});if(e.label)if(!se)B.shapeMap["node-label"]=B.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},s.style),{x:Zt,y:e.description?-5:7,text:e.label}),className:"node-label",name:"node-label",draggable:!0,labelRelated:!0});else{var _e=e.labelCfg?e.labelCfg.style:{},Ue=(0,h.mix)({},se.attr(),_e);e.label&&(Ue.text=e.label),Ue.x=Zt,(0,h.isString)(e.description)&&(Ue.y=-5),oe&&(oe.resetMatrix(),oe.attr({x:Zt})),se.resetMatrix(),se.attr(Ue)}if((0,h.isString)(e.description)){var Re=f.paddingTop;if(!oe)B.shapeMap["rect-description"]=B.addShape("text",{attrs:(0,b.__assign)((0,b.__assign)({},f.style),{x:Zt,y:17+(Re||0),text:e.description}),className:"rect-description",name:"rect-description",draggable:!0,labelRelated:!0});else{var _e=e.descriptionCfg?e.descriptionCfg.style:{},qe=(0,h.mix)({},oe.attr(),_e);(0,h.isString)(e.description)&&(qe.text=e.description),qe.x=Zt,oe.resetMatrix(),oe.attr((0,b.__assign)((0,b.__assign)({},qe),{y:17+(Re||0)}))}}var hr=B.shapeMap["pre-rect"]||B.find(function(oi){return oi.get("className")==="pre-rect"});if(hr&&!hr.destroyed){var nn=(0,h.mix)({},hr.attr(),e.preRect);hr.attr((0,b.__assign)((0,b.__assign)({},nn),{x:-l/2,y:-_/2,height:_}))}if(j&&!j.destroyed)if(!pt&&pt!==void 0)j.remove(),delete B.shapeMap["pre-rect"];else{var kn=ut.width,En=ut.height,Kr=ut.x,ta=ut.y,$n=ut.offset,$r=(0,b.__rest)(ut,["width","height","x","y","offset"]);j.attr((0,b.__assign)((0,b.__assign)({},$r),{x:Kr||-l/2+kn+$n,y:ta||-En/2,width:kn,height:En}))}else pt&&this.drawLogoIcon(e,B);var yn=B.shapeMap["rect-state-icon"]||B.find(function(oi){return oi.get("className")==="rect-state-icon"}),Fn=yn?yn.attr():{},zn=(0,h.mix)({},Fn,e.stateIcon);if(yn){!zn.show&&zn.show!==void 0&&(yn.remove(),delete B.shapeMap["rect-state-icon"]);var ia=zn.width,En=zn.height,Kr=zn.x,ta=zn.y,da=zn.offset,Wa=(0,b.__rest)(zn,["width","height","x","y","offset"]);yn.attr((0,b.__assign)((0,b.__assign)({},Wa),{x:Kr||l/2-ia+da,y:ta||-En/2,width:ia,height:En}))}else zn.show&&this.drawStateIcon(e,B);this.updateLinkPoints(e,B)},getOptions:function(e,t){return t==="move"?e:(0,h.deepMix)({},this.options,this.getCustomConfig(e)||{},e)}},"single-node"),ic("star",{options:{size:60,style:{stroke:Jn.defaultNode.style.stroke,fill:Jn.defaultNode.style.fill,lineWidth:Jn.defaultNode.style.lineWidth},labelCfg:{style:{fill:Jn.nodeLabel.style.fill,fontSize:Jn.nodeLabel.style.fontSize,fontFamily:Jn.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Jn.defaultNode.linkPoints.size,lineWidth:Jn.defaultNode.linkPoints.lineWidth,fill:Jn.defaultNode.linkPoints.fill,stroke:Jn.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)({},Jn.nodeStateStyles)},shapeType:"star",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(e),o=t.addShape("path",{attrs:a,className:"".concat(this.type,"-keyShape"),name:"".concat(this.type,"-keyShape"),draggable:!0});t.shapeMap["".concat(this.type,"-keyShape")]=o;var s=n.width,u=n.height,f=n.show,c=n.text;return f&&(c?t.shapeMap["".concat(this.type,"-icon")]=t.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}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:(0,b.__assign)({x:-s/2,y:-u/2},n),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),this.drawLinkPoints(e,t),o},drawLinkPoints:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).linkPoints,n=r===void 0?{}:r,a=n.top,o=n.left,s=n.right,u=n.leftBottom,f=n.rightBottom,c=n.size,l=n.r,_=(0,b.__rest)(n,["top","left","right","leftBottom","rightBottom","size","r"]),I=this.getSize(e),B=I[0];if(s){var j=Math.cos(.1*Math.PI)*B,et=Math.sin((18+72*0)/180*Math.PI)*B;t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},_),{x:j,y:-et,r:c/2||l||5}),className:"link-point-right",name:"link-point-right"})}if(a){var j=Math.cos(.5*Math.PI)*B,et=Math.sin((18+72*1)/180*Math.PI)*B;t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},_),{x:j,y:-et,r:c/2||l||5}),className:"link-point-top",name:"link-point-top"})}if(o){var j=Math.cos(.9*Math.PI)*B,et=Math.sin((18+72*2)/180*Math.PI)*B;t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},_),{x:j,y:-et,r:c/2||l||5}),className:"link-point-left",name:"link-point-left"})}if(u){var j=Math.cos(1.3*Math.PI)*B,et=Math.sin((18+72*3)/180*Math.PI)*B;t.shapeMap["link-point-bottom"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},_),{x:j,y:-et,r:c/2||l||5}),className:"link-point-left-bottom",name:"link-point-left-bottom"})}if(f){var j=Math.cos(1.7*Math.PI)*B,et=Math.sin((18+72*4)/180*Math.PI)*B;t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},_),{x:j,y:-et,r:c/2||l||5}),className:"link-point-right-bottom",name:"link-point-right-bottom"})}},getPath:function(e){var t=this.getSize(e),r=t[0],n=r*3/8,a=e.innerR||n;return Xs.getStarPath(r,a)},getShapeStyle:function(e){var t=(this.mergeStyle||this.getOptions(e)).style,r={stroke:e.color},n=(0,h.mix)({},t,r),a=this.getPath(e),o=(0,b.__assign)({path:a},n);return o},update:function(e,t,r){var n=t.getContainer(),a=this.getOptions({}).style,o=this.getPath(e),s={stroke:e.color,path:o},u=t.get("keyShape"),f=(0,h.mix)({},a,u.attr(),s);f=(0,h.mix)(f,e.style),this.updateShape(e,t,f,!0,r),this.updateLinkPoints(e,n)},updateLinkPoints:function(e,t){var r=this.getOptions({}).linkPoints,n=t.shapeMap["link-point-left"]||t.find(function(qe){return qe.get("className")==="link-point-left"}),a=t.shapeMap["link-point-right"]||t.find(function(qe){return qe.get("className")==="link-point-right"}),o=t.shapeMap["link-point-top"]||t.find(function(qe){return qe.get("className")==="link-point-top"}),s=t.shapeMap["link-point-left-bottom"]||t.find(function(qe){return qe.get("className")==="link-point-left-bottom"}),u=t.shapeMap["link-point-left-bottom"]||t.find(function(qe){return qe.get("className")==="link-point-right-bottom"}),f=r,c=n||a||o||s||u;c&&(f=c.attr());var l=(0,h.mix)({},f,e.linkPoints),_=l.fill,I=l.stroke,B=l.lineWidth,j=l.size/2;j||(j=l.r);var et=e.linkPoints?e.linkPoints:{left:void 0,right:void 0,top:void 0,leftBottom:void 0,rightBottom:void 0},ut=et.left,ct=et.right,pt=et.top,Mt=et.leftBottom,Zt=et.rightBottom,se=this.getSize(e),oe=se[0],_e={r:j,fill:_,stroke:I,lineWidth:B},Ue=Math.cos((18+72*0)/180*Math.PI)*oe,Re=Math.sin((18+72*0)/180*Math.PI)*oe;a?!ct&&ct!==void 0?(a.remove(),delete t.shapeMap["link-point-right"]):a.attr((0,b.__assign)((0,b.__assign)({},_e),{x:Ue,y:-Re})):ct&&(t.shapeMap["link-point-right"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},_e),{x:Ue,y:-Re}),className:"link-point-right",name:"link-point-right",isAnchorPoint:!0})),Ue=Math.cos((18+72*1)/180*Math.PI)*oe,Re=Math.sin((18+72*1)/180*Math.PI)*oe,o?!pt&&pt!==void 0?(o.remove(),delete t.shapeMap["link-point-top"]):o.attr((0,b.__assign)((0,b.__assign)({},_e),{x:Ue,y:-Re})):pt&&(t.shapeMap["link-point-top"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},_e),{x:Ue,y:-Re}),className:"link-point-top",name:"link-point-top",isAnchorPoint:!0})),Ue=Math.cos((18+72*2)/180*Math.PI)*oe,Re=Math.sin((18+72*2)/180*Math.PI)*oe,n?!ut&&ut!==void 0?(n.remove(),delete t.shapeMap["link-point-left"]):n.attr((0,b.__assign)((0,b.__assign)({},_e),{x:Ue,y:-Re})):ut&&(t.shapeMap["link-point-left"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},_e),{x:Ue,y:-Re}),className:"link-point-left",name:"link-point-left",isAnchorPoint:!0})),Ue=Math.cos((18+72*3)/180*Math.PI)*oe,Re=Math.sin((18+72*3)/180*Math.PI)*oe,s?!Mt&&Mt!==void 0?(s.remove(),delete t.shapeMap["link-point-left-bottom"]):s.attr((0,b.__assign)((0,b.__assign)({},_e),{x:Ue,y:-Re})):Mt&&(t.shapeMap["link-point-left-bottom"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},_e),{x:Ue,y:-Re}),className:"link-point-left-bottom",name:"link-point-left-bottom",isAnchorPoint:!0})),Ue=Math.cos((18+72*4)/180*Math.PI)*oe,Re=Math.sin((18+72*4)/180*Math.PI)*oe,u?!Zt&&Zt!==void 0?(u.remove(),delete t.shapeMap["link-point-right-bottom"]):u.attr((0,b.__assign)((0,b.__assign)({},_e),{x:Ue,y:-Re})):Zt&&(t.shapeMap["link-point-right-bottom"]=t.addShape("circle",{attrs:(0,b.__assign)((0,b.__assign)({},_e),{x:Ue,y:-Re}),className:"link-point-right-bottom",name:"link-point-right-bottom",isAnchorPoint:!0}))}},"single-node");var r0=Xs.defaultSubjectColors,Fd="fan-shape-";ic("donut",{options:{size:Jn.defaultNode.size,style:{x:0,y:0,stroke:Jn.defaultNode.style.stroke,fill:Jn.defaultNode.style.fill,lineWidth:Jn.defaultNode.style.lineWidth},labelCfg:{style:{fill:Jn.nodeLabel.style.fill,fontSize:Jn.nodeLabel.style.fontSize,fontFamily:Jn.windowFontFamily}},linkPoints:{top:!1,right:!1,bottom:!1,left:!1,size:Jn.defaultNode.linkPoints.size,lineWidth:Jn.defaultNode.linkPoints.lineWidth,fill:Jn.defaultNode.linkPoints.fill,stroke:Jn.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)({},Jn.nodeStateStyles)},shapeType:"circle",labelPosition:"center",drawShape:function(e,t){var r=(this.mergeStyle||this.getOptions(e)).icon,n=r===void 0?{}:r,a=this.getShapeStyle(e),o=(0,h.deepMix)({},n,e.icon),s=t.addShape("circle",{attrs:a,className:"".concat(this.type,"-keyShape"),draggable:!0,name:"".concat(this.type,"-keyShape")});t.shapeMap["".concat(this.type,"-keyShape")]=s;var u=o.width,f=o.height,c=o.show,l=o.text;return c&&(l?t.shapeMap["".concat(this.type,"-icon")]=t.addShape("text",{attrs:(0,b.__assign)({x:0,y:0,fontSize:12,fill:"#000",stroke:"#000",textBaseline:"middle",textAlign:"center"},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0}):t.shapeMap["".concat(this.type,"-icon")]=t.addShape("image",{attrs:(0,b.__assign)({x:-u/2,y:-f/2},o),className:"".concat(this.type,"-icon"),name:"".concat(this.type,"-icon"),draggable:!0})),pw(e,t,s),this.drawLinkPoints(e,t),s},updateShape:function(e,t,r,n,a){var o=t.get("keyShape");o.attr((0,b.__assign)({},r)),gw(e,t,o),this.updateLabel(e,t,a),n&&this.updateIcon(e,t)}},"circle");var pw=function(e,t,r){var n=e.donutAttrs,a=n===void 0?{}:n,o=e.donutColorMap,s=o===void 0?{}:o,u=Object.keys(a).length;if(a&&u>1){var f=n0(a,s),c=f.configs,l=f.totalValue;if(l){var _=a0(r),I=_.lineWidth,B=_.arcR,j=[B,0],et=0;if(u===1){wv(t,{arcR:B,arcBegin:j,beginAngle:et,config:c[0],fanIndex:0,lineWidth:I,totalValue:l,drawWhole:!0});return}for(var ut=0;ut.999)j=[r,1e-4],ut=1;else{var ct=B*Math.PI*2;et=a+ct,j=[r*Math.cos(et),-r*Math.sin(et)],ut=ct>Math.PI?1:0}var pt={path:[["M",n[0],n[1]],["A",r,r,0,ut,0,j[0],j[1]]],stroke:o.color||(I==null?void 0:I.attr("stroke"))||r0[s%r0.length],lineWidth:u};return I?I.attr(pt):e.shapeMap["".concat(Fd).concat(s)]=e.addShape("path",{attrs:pt,name:"".concat(Fd).concat(s),draggable:!0}),{beginAngle:et,arcBegin:j,shape:e.shapeMap["".concat(Fd).concat(s)],shouldEnd:l||B>.999}},gw=function(e,t,r){var n=e.donutAttrs,a=e.donutColorMap,o=a===void 0?{}:a,s={},u=t.getContainer();if(n){var f=n0(n,o),c=f.configs,l=f.totalValue;if(l)for(var _=a0(r),I=_.lineWidth,B=_.arcR,j=[B,0],et=0,ut=0;ut=0;a--){var o=e[a];o.id="".concat(o.x,"|||").concat(o.y),r[o.id]||(r[o.id]=o,t.push(o))}return t},i0=function(e){return Sv(e)},iM=function(e,t){return[e,{x:e.x,y:t.y},t]},bh=function(e,t){return e.width||e.height?{centerX:e.centerX,centerY:e.centerY,minX:e.minX-t,minY:e.minY-t,maxX:e.maxX+t,maxY:e.maxY+t,height:e.height+2*t,width:e.width+2*t}:e},yw=function(e,t){var r=Math.abs(e.x-t.centerX),n=Math.abs(e.y-t.centerY);return r===0&&n===0?0:r/t.width>n/t.height},Mv=function(e,t,r){var n=yw(t,e);if(n===0){var a=e.centerX,o=e.centerY;return r.yt.x?a=e.maxX:r.xe.centerX?e.maxX:e.minX,y:t.y}:{x:t.x,y:t.y>e.centerY?e.maxY:e.minY}},o0=function(e,t){var r=Math.min(e.minX,t.minX),n=Math.min(e.minY,t.minY),a=Math.max(e.maxX,t.maxX),o=Math.max(e.maxY,t.maxY);return{centerX:(r+a)/2,centerY:(n+o)/2,minX:r,minY:n,maxX:a,maxY:o,height:o-n,width:a-r}},_v=function(e){return[{x:e.minX,y:e.minY},{x:e.maxX,y:e.minY},{x:e.maxX,y:e.maxY},{x:e.minX,y:e.maxY}]},Eh=function(e,t){var r=e.x,n=e.y;return rt.maxX||nt.maxY},xw=function(e,t){return te.maxX?[]:[{x:t,y:e.minY},{x:t,y:e.maxY}]},bw=function(e,t){return te.maxY?[]:[{x:e.minX,y:t},{x:e.maxX,y:t}]},Ew=function(e,t){return xw(e,t.x).concat(bw(e,t.y))},zd=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},ww=function(e,t){var r=-2,n=0;return t.forEach(function(a){a&&(e.x===a.x&&(n+=r),e.y===a.y&&(n+=r))}),n},s0=function(e,t,r,n,a){return zd(e,t)+zd(e,r)+ww(e,[t,r,n,a])},Sw=function i(e,t,r,n,a){a===void 0&&(a=0),e.unshift(t[n]),r[n]&&r[n]!==n&&a<=100&&i(e,t,r,r[n],a+1)},oM=function(e,t){var r=e.indexOf(t);r>-1&&e.splice(r,1)},wh=function(e,t,r,n){var a=r.x-e.x,o=r.y-e.y,s=n.x-e.x,u=n.y-e.y,f=r.x-t.x,c=r.y-t.y,l=n.x-t.x,_=n.y-t.y,I=a*u-o*s,B=f*_-c*l,j=a*c-o*f,et=s*_-u*l;return I*B<=0&&j*et<=0},Cv=function(e,t,r){if(r.width||r.height){var n=_v(r),a=n[0],o=n[1],s=n[2],u=n[3];return wh(e,t,a,o)||wh(e,t,a,u)||wh(e,t,o,s)||wh(e,t,s,u)}return!1},Mw=function(e,t,r,n){var a=[];return e.forEach(function(o){if(o!==t&&(o.x===t.x||o.y===t.y)){if(Cv(o,t,r)||Cv(o,t,n))return;a.push(o)}}),Sv(a)},_w=function(e,t,r,n,a,o,s){var u,f=[],c=(u={},u[t.id]=t,u),l={},_={},I={};_[t.id]=0,I[t.id]=s0(t,r,t);var B=new c0;B.add({id:t.id,value:I[t.id]});var j={};e.forEach(function(Zt){j[Zt.id]=Zt});for(var et;Object.keys(c).length;){var ut=B.minId(!1);if(ut)et=c[ut];else break;if(et===r){var ct=[];return Sw(ct,j,l,r.id),ct}delete c[et.id],B.remove(et.id),f.push(et);var pt=Mw(e,et,n,a),Mt=function(se){se.forEach(function(oe){if(f.indexOf(oe)===-1){var _e=oe.id;c[_e]||(c[_e]=oe);var Ue=I[et.id]+zd(et,oe);if(_[_e]&&Ue>=_[_e]){B.add({id:_e,value:I[_e]});return}l[_e]=et.id,_[_e]=Ue,I[_e]=_[_e]+s0(oe,r,t,o,s),B.add({id:_e,value:I[_e]})}})};Mt(pt)}return[t,r]},Cw=function(e,t,r){return!(e.x===t.x&&t.x===r.x||e.y===t.y&&t.y===r.y)},Tw=function(e,t,r,n){var a=zd(e,t),o=zd(r,t);a=0;o--){var s=e[o];if(s.x===r.x?n.push(s):(n=[s],r.x=s.x),s.y===r.y?a.push(s):(a=[s],r.y=s.y),n.length>2){var u=e.indexOf(n[1]);u>-1&&e.splice(u,1);continue}if(a.length>2){var u=e.indexOf(a[1]);u>-1&&e.splice(u,1)}}return e},c0=function(){function i(){this.arr=[],this.map={},this.arr=[],this.map={}}return i.prototype._innerAdd=function(e,t){for(var r=[0,t-1];r[1]-r[0]>1;){var n=Math.floor((r[0]+r[1])/2);if(this.arr[n].value>e.value)r[1]=n;else if(this.arr[n].value=0;t--)this.map[this.arr[t].id]?e=this.arr[t].id:this.arr.splice(t,1);return e},i.prototype._findFirstId=function(){for(;this.arr.length;){var e=this.arr.shift();if(this.map[e.id])return e.id}},i.prototype.minId=function(e){return e?this._clearAndGetMinId():this._findFirstId()},i}(),Iw=function(e,t){return Math.abs(e.x-t.x)+Math.abs(e.y-t.y)},Ow=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},Dw=function(e,t){return[e,t]},Lw=function(e,t,r,n,a){return i0(f0(e,t,r,n,a.offset))},Pw={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:Iw,fallbackRoute:Lw},sM={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:Ow,fallbackRoute:Dw},cc=function(e,t){var r=Math.round(Math.abs(e/t)),n=e<0?-1:1;return r<0?0:n*r},Nw=function(e,t,r){var n={};return e.forEach(function(a){if(a)for(var o=bh(a.getBBox(),r),s=cc(o.minX,t);s<=cc(o.maxX,t);s+=1)for(var u=cc(o.minY,t);u<=cc(o.maxY,t);u+=1)n["".concat(s,"|||").concat(u)]=!0}),n},Tv=function(e,t){var r=t.x-e.x,n=t.y-e.y;return r||n?Math.atan2(n,r):0},l0=function(e,t){var r=Math.abs(e-t);return r>Math.PI?2*Math.PI-r:r},d0=function(e,t,r){for(var n=1/0,a=0,o=t.length;af.minX&&t.xf.minY&&t.y0&&se>0;){var En=pt.minId((se+1)%30===0);if(En)oe=B[En];else break;if(kn["".concat(oe.x,"|||").concat(oe.y)])return Rw(oe,et,c,t,e,l,u);delete B[oe.id],pt.remove(oe.id),j[oe.id]=!0;for(var Mt=0;Mto.maxAllowedDirectionChange)&&!f[Kr])){B[Kr]||(B[Kr]=Ue);var ta=s[hr];Re=o.distFunc(oe,Ue)+(isNaN(ta)?u:ta),qe=ut[oe.id]+Re;var $n=ut[Kr];$n&&qe>=$n||(et[Kr]=oe,ut[Kr]=qe,ct[Kr]=qe+d0(Ue,I,o.distFunc),pt.add({id:Kr,value:ct[Kr]}))}}se-=1}return o.fallbackRoute(e,t,r,n,o)};dp("polyline",{options:{color:Jn.defaultEdge.color,size:Jn.defaultEdge.size,style:{radius:0,offset:15,x:0,y:0,stroke:Jn.defaultEdge.style.stroke,lineAppendWidth:Jn.defaultEdge.style.lineAppendWidth},labelCfg:{style:{fill:Jn.edgeLabel.style.fill,fontSize:Jn.edgeLabel.style.fontSize,fontFamily:Jn.windowFontFamily}},routeCfg:{obstacles:[],maxAllowedDirectionChange:Math.PI,maximumLoops:500,gridSize:10},stateStyles:(0,b.__assign)({},Jn.edgeStateStyles)},shapeType:"polyline",labelPosition:"center",drawShape:function(e,t){var r=this.getShapeStyle(e);r.radius===0&&delete r.radius;var n=t.addShape("path",{className:"edge-shape",name:"edge-shape",attrs:r});return t.shapeMap["edge-shape"]=n,n},getShapeStyle:function(e){var t=this.options.style,r={stroke:e.color},n=(0,h.mix)({},t,r,e.style);e=this.getPathPoints(e),this.radius=n.radius,this.offset=n.offset;var a=e.startPoint,o=e.endPoint,s=this.getControlPoints(e),u=[a];s&&(u=u.concat(s)),u.push(o);var f=e.sourceNode,c=e.targetNode,l=n.radius,_=this.options.routeCfg,I=(0,h.mix)({},_,e.routeCfg);I.offset=n.offset;var B=this.getPath(u,f,c,l,I,!s);((0,h.isArray)(B)&&B.length<=1||(0,h.isString)(B)&&B.indexOf("L")===-1)&&(B="M0 0, L0 0"),(isNaN(a.x)||isNaN(a.y)||isNaN(o.x)||isNaN(o.y))&&(B="M0 0, L0 0");var j=(0,h.mix)({},Jn.defaultEdge.style,n,{lineWidth:e.size,path:B});return j},updateShapeStyle:function(e,t){var r=t.getContainer();if(t.isVisible()){var n={stroke:e.color},a=r.shapeMap["edge-shape"]||r.find(function(Mt){return Mt.get("className")==="edge-shape"})||t.getKeyShape(),o=e.size;e=this.getPathPoints(e);var s=e.startPoint,u=e.endPoint,f=this.getControlPoints(e),c=[s];f&&(c=c.concat(f)),c.push(u);var l=a.attr(),_=(0,h.mix)({},n,l,e.style),I=e.sourceNode,B=e.targetNode,j=_.radius,et=this.options.routeCfg,ut=(0,h.mix)({},et,e.routeCfg);ut.offset=_.offset;var ct=this.getPath(c,I,B,j,ut,!f);((0,h.isArray)(ct)&&ct.length<=1||(0,h.isString)(ct)&&ct.indexOf("L")===-1)&&(ct="M0 0, L0 0"),(isNaN(s.x)||isNaN(s.y)||isNaN(u.x)||isNaN(u.y))&&(ct="M0 0, L0 0"),l.endArrow&&_.endArrow===!1&&(e.style.endArrow={path:""}),l.startArrow&&_.startArrow===!1&&(e.style.startArrow={path:""});var pt=(0,h.mix)(n,a.attr(),{lineWidth:o,path:ct},e.style);a&&a.attr(pt)}},getPath:function(e,t,r,n,a,o){var s=a.offset,u=a.obstacles,f=a.simple;if(!s||e.length>2||o===!1){if(n)return u0(e,n);var c=[];return(0,h.each)(e,function(B,j){j===0?c.push(["M",B.x,B.y]):c.push(["L",B.x,B.y])}),c}f!==!1&&!(u!=null&&u.length)&&(f=!0);var l=f?f0(e[e.length-1],e[0],r,t,s):kw(e[0],e[e.length-1],t,r,a);if(!l||!l.length)return"M0 0, L0 0";if(n){var _=u0(l,n);return _}l=Aw(l);var I=Xs.pointsToPolygon(l);return I}},"single-edge");var v0=sc.cloneEvent,p0=sc.isNaN,g0=Math.abs,Bw=10,Fw=["shift","ctrl","alt","control"],zw={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(e){var t=this.origin,r=+e.clientX,n=+e.clientY;if(!(p0(r)||p0(n))){var a=r-t.x,o=n-t.y;this.get("direction")==="x"?o=0:this.get("direction")==="y"&&(a=0),this.origin={x:r,y:n};var s=this.graph.get("width"),u=this.graph.get("height"),f=this.graph.get("canvas").getCanvasBBox(),c=this.scalableRange,l=this.scalableRange;c<1&&c>-1&&(c=s*c,l=u*l),(f.minX<=s+c&&f.minX+a>s+c||f.maxX+c>=0&&f.maxX+c+a<0)&&(a=0),(f.minY<=u+l&&f.minY+o>u+l||f.maxY+l>=0&&f.maxY+l+o<0)&&(o=0),this.graph.translate(a,o)}},onTouchStart:function(e){var t=this,r=e.originalEvent.touches,n=r[0],a=r[1];n&&a||(e.preventDefault(),this.mousedown=!0,t.onDragStart(e))},onMouseDown:function(e){this.mousedown=!0},onDragMove:function(e){this.mousedown&&(this.dragstart?this.onDrag(e):(this.dragstart=!0,this.onDragStart(e)))},onDragStart:function(e){var t=this,r=e.originalEvent;if(!(r&&e.name!=="touchstart"&&r.button!==0)&&!(e.name!=="touchstart"&&typeof window!="undefined"&&window.event&&!window.event.buttons&&!window.event.button)&&this.shouldBegin(e,this)&&!t.keydown&&this.allowDrag(e)){if(t.origin={x:e.clientX,y:e.clientY},t.dragging=!1,this.enableOptimize){for(var n=this.graph,a=n.getEdges(),o=0,s=a.length;ou)for(var I=n.getNodes(),B=0,j=I.length;B-1?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){this.keydown=!1,this.origin=null,this.dragging=!1,this.dragbegin=!1},allowDrag:function(e){var t,r,n=e.target,a=n&&n.isCanvas&&n.isCanvas();if((0,h.isBoolean)(this.allowDragOnItem)&&!this.allowDragOnItem&&!a)return!1;if((0,h.isObject)(this.allowDragOnItem)){var o=this.allowDragOnItem,s=o.node,u=o.edge,f=o.combo,c=(r=(t=e.item)===null||t===void 0?void 0:t.getType)===null||r===void 0?void 0:r.call(t);if(!s&&c==="node"||!u&&c==="edge"||!f&&c==="combo")return!1}return!0}},Gw={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(e){if(!this.origin||!e||e.destroyed)return!1;var t=e.getType();return t==="combo"},onTouchStart:function(e){if(e.item){var t=this;try{var r=e.originalEvent.touches,n=r[0],a=r[1];if(n&&a)return;e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}this.mousedown={item:e.item,target:e.target,origin:{x:e.x,y:e.y}},this.dragstart=!0,t.onDragStart(e)}},onTouchMove:function(e){var t=this;try{var r=e.originalEvent.touches,n=r[0],a=r[1];if(n&&a){t.onDragEnd(e);return}e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.onDrag(e)},onMouseDown:function(e){this.mousedown={item:e.item,target:e.target,origin:{x:e.x,y:e.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(e){var t,r;if(((r=(t=e.item)===null||t===void 0?void 0:t.getType)===null||r===void 0?void 0:r.call(t))!=="node"){this.onDragEnd();return}this.mousedown&&(this.dragstart?this.onDrag((0,b.__assign)((0,b.__assign)({},e),this.mousedown)):(this.dragstart=!0,this.onDragStart(e)))},onDragStart:function(e){var t=this;if(this.currentShouldEnd=!0,!!this.shouldBegin((0,b.__assign)((0,b.__assign)({},e),this.mousedown),this)){var r=this.mousedown,n=r.item,a=r.target;if(!(!n||n.destroyed||n.hasLocked())){var o=n.getContainer();if(o.set("capture",!1),this.cachedCaptureItems||(this.cachedCaptureItems=[]),this.cachedCaptureItems.push(n),a){var s=a.get("isAnchorPoint");if(s)return}var u=this.graph;this.targets=[],this.targetCombo=null;var f=u.findAllByState("node",this.selectedState),c=n.get("id"),l=f.filter(function(I){var B=I.get("id");return c===B});if(l.length===0?this.targets.push(n):f.length>1?f.forEach(function(I){var B=I.hasLocked();B||t.targets.push(I)}):this.targets.push(n),this.graph.get("enabledStack")&&this.enableStack){var _=[];this.targets.forEach(function(I){var B=I.getModel(),j=B.x,et=B.y,ut=B.id;_.push({x:j,y:et,id:ut})}),this.set("beforeDragNodes",_)}this.hidenEdge={},this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(I){var B=I.getEdges();B.forEach(function(j){j.isVisible()&&(t.hidenEdge[j.getID()]=!0,j.hide())})}),this.origin=this.mousedown.origin,this.point={},this.originPoint={}}}},onDrag:function(e){var t=this;if(!(!this.mousedown||!this.origin)&&this.shouldUpdate(e,this))if(this.get("enableDelegate"))this.updateDelegate(e);else if(this.enableDebounce)this.debounceUpdate({targets:this.targets,graph:this.graph,point:this.point,origin:this.origin,evt:e,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos});else{var r={};this.targets.map(function(n){t.update(n,e);var a=n.getModel().comboId;a&&(r[a]=t.graph.findById(a))}),this.onlyChangeComboSize&&this.updateParentCombos()}},onDragEnd:function(e){var t=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(o){var s=o.getContainer();s.set("capture",!0)}),this.cachedCaptureItems=[],this.delegateRect&&(this.delegateRect.remove(),this.delegateRect=null),this.get("updateEdge")&&this.enableOptimize&&!this.enableDelegate&&this.targets.forEach(function(o){var s=o.getEdges();s.forEach(function(u){t.hidenEdge[u.getID()]&&u.show(),u.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(o){a.before.nodes.push(o)}),this.targets.forEach(function(o){var s=o.getModel(),u=s.x,f=s.y,c=s.id;a.after.nodes.push({x:u,y:f,id:c})}),n.pushStack("update",(0,h.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(e){var t=e.item;if(this.currentShouldEnd=this.shouldEnd(e,t,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!this.validationCombo(t))){var r=this.graph;if(this.comboActiveState&&r.setItemState(t,this.comboActiveState,!1),this.targetCombo=t,this.onlyChangeComboSize)r.updateCombos();else{var n=t.getModel();this.targets.map(function(a){var o=a.getModel();o.comboId!==n.id&&r.updateComboTree(a,n.id)}),r.updateCombo(t)}r.emit("dragnodeend",{items:this.targets,targetItem:this.targetCombo})}},onDropCanvas:function(e){var t=this.graph;this.currentShouldEnd=this.shouldEnd(e,void 0,this),this.updatePositions(e,!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&&t.updateComboTree(r)}))},onDropNode:function(e){if(!(!this.targets||this.targets.length===0)){var t=this,r=e.item,n=t.graph,a=r.getModel().comboId,o=a?n.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(e,o,this),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){if(this.onlyChangeComboSize)this.updateParentCombos();else if(a){var s=n.findById(a);t.comboActiveState&&n.setItemState(s,t.comboActiveState,!1),this.targets.map(function(u){var f=u.getModel();a!==f.comboId&&n.updateComboTree(u,a)}),n.updateCombo(s)}else this.targets.map(function(u){var f=u.getModel();f.comboId&&n.updateComboTree(u)});n.emit("dragnodeend",{items:this.targets,targetItem:r})}}},onDragEnter:function(e){var t=e.item;if(this.validationCombo(t)){var r=this.graph;this.comboActiveState&&r.setItemState(t,this.comboActiveState,!0)}},onDragLeave:function(e){var t=e.item;if(this.validationCombo(t)){var r=this.graph;this.comboActiveState&&r.setItemState(t,this.comboActiveState,!1)}},updatePositions:function(e,t){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:e,updateEdge:this.get("updateEdge"),onlyChangeComboSize:this.onlyChangeComboSize,updateParentCombos:this.updateParentCombos}):t||this.targets.map(function(n){return r.update(n,e)}):this.targets.map(function(n){return r.update(n,e,t)}))},update:function(e,t,r){var n=this.origin,a=e.get("model"),o=e.get("id");this.point[o]||(this.point[o]={x:a.x||0,y:a.y||0});var s=t.x-n.x+this.point[o].x,u=t.y-n.y+this.point[o].y;r&&(s+=n.x-t.x,u+=n.y-t.y);var f={x:s,y:u};this.get("updateEdge")?this.graph.updateItem(e,f,!1):e.updatePosition(f)},debounceUpdate:(0,h.debounce)(function(i){var e=i.targets,t=i.graph,r=i.point,n=i.origin,a=i.evt,o=i.updateEdge,s=i.onlyChangeComboSize,u=i.updateParentCombos;e.map(function(f){var c=f.get("model"),l=f.get("id");r[l]||(r[l]={x:c.x||0,y:c.y||0});var _=a.x-n.x+r[l].x,I=a.y-n.y+r[l].y,B={x:_,y:I};o?t.updateItem(f,B,!1):f.updatePosition(B)}),s&&u(t,e)},50,!0),updateDelegate:function(e){var t=this.graph;if(this.delegateRect){var _=e.x-this.origin.x+this.originPoint.minX,I=e.y-this.origin.y+this.originPoint.minY;this.delegateRect.attr({x:_,y:I})}else{var r=t.get("group"),n=(0,h.deepMix)({},Il.delegateStyle,this.delegateStyle),a=this.calculationGroupPosition(e),o=a.x,s=a.y,u=a.width,f=a.height,c=a.minX,l=a.minY;this.originPoint={x:o,y:s,width:u,height:f,minX:c,minY:l},this.delegateRect=r.addShape("rect",{attrs:(0,b.__assign)({width:u,height:f,x:o,y:s},n),name:"rect-delegate-shape"}),this.delegate=this.delegateRect,this.delegateRect.set("capture",!1)}},calculationGroupPosition:function(e){var t=this.targets;t.length===0&&t.push(e.item);for(var r=1/0,n=-1/0,a=1/0,o=-1/0,s=0;sn&&(n=_),I>o&&(o=I)}var B=Math.floor(r),j=Math.floor(a),et=Math.ceil(n)-Math.floor(r),ut=Math.ceil(o)-Math.floor(a);return{x:B,y:j,width:et,height:ut,minX:r,minY:a}},updateParentCombos:function(e,t){var r=e||this.graph,n=t||this.targets,a={};n==null||n.forEach(function(o){var s=o.getModel().comboId;s&&(a[s]=r.findById(s))}),Object.values(a).forEach(function(o){o&&r.updateCombo(o)})}},Uw={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(e){var t=this;try{var r=e.originalEvent.touches,n=r[0],a=r[1];if(n&&a)return;e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.setAllItemStates(e)},clearOnTouchStart:function(e){var t=this;try{var r=e.originalEvent.touches,n=r[0],a=r[1];if(n&&a)return;e.preventDefault()}catch(o){console.warn("Touch original event not exist!")}t.clearActiveState(e)},setAllItemStates:function(e){clearTimeout(this.timer),this.throttleSetAllItemStates(e,this)},clearActiveState:function(e){var t=this;this.timer=setTimeout(function(){t.throttleClearActiveState(e,t)},50)},throttleSetAllItemStates:(0,h.throttle)(function(i,e){var t=i.item,r=e.graph;if(!(!r||r.destroyed)&&(e.item=t,!!e.shouldUpdate(i.item,{event:i,action:"activate"},e))){for(var n=e.activeState,a=e.inactiveState,o=r.getNodes(),s=r.getCombos(),u=r.getEdges(),f=r.get("vedges"),c=o.length,l=s.length,_=u.length,I=f.length,B=e.inactiveItems||{},j=e.activeItems||{},et=0;et-1||(this.trigger=x0,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(e){var t=e.item,r=this.brush;t||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates(),r||(r=this.createBrush()),this.originPoint={x:e.canvasX,y:e.canvasY},r.attr({width:0,height:0}),r.show(),this.dragging=!0)},onMouseMove:function(e){this.dragging&&(this.trigger!=="drag"&&!this.keydown||this.updateBrush(e))},onMouseUp:function(e){var t=this.graph;!this.brush&&!this.dragging||this.trigger!=="drag"&&!this.keydown||(this.brush.remove(!0),this.brush=null,this.getSelectedNodes(e),this.dragging=!1)},clearStates:function(){var e=this,t=e.graph,r=e.selectedState,n=t.findAllByState("node",r),a=t.findAllByState("edge",r),o=t.findAllByState("combo",r);n.forEach(function(s){return t.setItemState(s,r,!1)}),a.forEach(function(s){return t.setItemState(s,r,!1)}),o.forEach(function(s){return t.setItemState(s,r,!1)}),this.selectedNodes=[],this.selectedEdges=[],this.selectedCombos=[],this.onDeselect&&this.onDeselect(this.selectedNodes,this.selectedEdges,this.selectedCombos),t.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})},isBBoxCenterInRect:function(e,t,r,n,a){var o=e.getBBox();return o.centerX>=t&&o.centerX<=r&&o.centerY>=n&&o.centerY<=a},getSelectedNodes:function(e){var t=this,r=this,n=r.graph,a=r.originPoint,o=r.shouldUpdate,s=r.isBBoxCenterInRect,u=this.selectedState,f={x:e.x,y:e.y},c=n.getPointByCanvas(a.x,a.y),l=Sh(f.x,c.x),_=m0(f.x,c.x),I=Sh(f.y,c.y),B=m0(f.y,c.y),j=[],et=[];n.getNodes().forEach(function(pt){if(pt.isVisible()&&s(pt,l,_,I,B)&&o(pt,"select",t)){j.push(pt);var Mt=pt.getModel();et.push(Mt.id),n.setItemState(pt,u,!0)}});var ut=[];this.includeEdges&&j.forEach(function(pt){var Mt=pt.getOutEdges();Mt.forEach(function(Zt){if(Zt.isVisible()){var se=Zt.getModel(),oe=se.source,_e=se.target;et.includes(oe)&&et.includes(_e)&&o(Zt,"select",t)&&(ut.push(Zt),n.setItemState(Zt,t.selectedState,!0))}})});var ct=[];this.includeCombos&&n.getCombos().forEach(function(pt){if(pt.isVisible()&&s(pt,l,_,I,B)&&o(pt,"select",t)){ct.push(pt);var Mt=pt.getModel();et.push(Mt.id),n.setItemState(pt,u,!0)}}),this.selectedEdges=ut,this.selectedNodes=j,this.selectedCombos=ct,this.onSelect&&this.onSelect(j,ut,ct),n.emit("nodeselectchange",{selectedItems:{nodes:j,edges:ut,combos:ct},select:!0})},createBrush:function(){var e=this,t=e.graph.get("canvas").addShape("rect",{attrs:e.brushStyle,capture:!1,name:"brush-shape"});return this.brush=t,this.delegate=t,t},updateBrush:function(e){var t=this.originPoint;this.brush.attr({width:y0(e.canvasX-t.x),height:y0(e.canvasY-t.y),x:Sh(e.canvasX,t.x),y:Sh(e.canvasY,t.y)})},onKeyDown:function(e){var t=e.key;if(t){var r=this.trigger.toLowerCase(),n=t.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}},b0="shift",Xw=["shift","ctrl","alt","control"],jw={getDefaultCfg:function(){return{multiple:!0,trigger:b0,selectedState:"selected",selectNode:!0,selectEdge:!1,selectCombo:!0}},getEvents:function(){var e=this;return Xw.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=b0,console.warn("Behavior click-select \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'drag'\u3001'shift'\u3001'ctrl' \u6216 'alt'")),e.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(e){var t=this,r=e.item;if(!(!r||r.destroyed)){var n=r.getType(),a=t.graph,o=t.keydown,s=t.multiple,u=t.shouldUpdate,f=t.shouldBegin;if(f(e,t)){if(!o||!s){var c=a.findAllByState("node",t.selectedState).concat(a.findAllByState("edge",t.selectedState)).concat(a.findAllByState("combo",t.selectedState));(0,h.each)(c,function(j){j!==r&&a.setItemState(j,t.selectedState,!1)})}var l=function(){switch(n){case"node":return t.selectNode;case"edge":return t.selectEdge;case"combo":return t.selectCombo;default:return!1}}();if(!l){var _=a.findAllByState("node",t.selectedState),I=a.findAllByState("edge",t.selectedState),B=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{selectedItems:{nodes:_,edges:I,combos:B},select:!1});return}if(r.hasState(t.selectedState)){u(e,t)&&a.setItemState(r,t.selectedState,!1);var _=a.findAllByState("node",t.selectedState),I=a.findAllByState("edge",t.selectedState),B=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:r,selectedItems:{nodes:_,edges:I,combos:B},select:!1})}else{u(e,t)&&a.setItemState(r,t.selectedState,!0);var _=a.findAllByState("node",t.selectedState),I=a.findAllByState("edge",t.selectedState),B=a.findAllByState("combo",t.selectedState);a.emit("nodeselectchange",{target:r,selectedItems:{nodes:_,edges:I,combos:B},select:!0})}}}},onCanvasClick:function(e){var t=this,r=this,n=r.graph,a=r.shouldBegin;if(a(e,this)){var o=n.findAllByState("node",this.selectedState);(0,h.each)(o,function(f){n.setItemState(f,t.selectedState,!1)});var s=n.findAllByState("edge",this.selectedState);(0,h.each)(s,function(f){n.setItemState(f,t.selectedState,!1)});var u=n.findAllByState("combo",this.selectedState);(0,h.each)(u,function(f){n.setItemState(f,t.selectedState,!1)}),n.emit("nodeselectchange",{selectedItems:{nodes:[],edges:[],combos:[]},select:!1})}},onKeyDown:function(e){var t=this,r=e.key;r&&(r.toLowerCase()===this.trigger.toLowerCase()||r.toLowerCase()==="control"?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.keydown=!1}},Vw=Xt,Mh=.05,Hw={getDefaultCfg:function(){return this.isFireFox=Jp()==="firefox",{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 e=this.fixSelectedItems;return e.fixState||(e.fixState="selected"),e.fixAll&&(e.fixLineWidth=!0,e.fixLabel=!0),{wheel:"onWheel",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd"}},onTouchStart:function(e){var t=e.originalEvent.touches,r=t[0],n=t[1];e.preventDefault(),n&&(this.shouldBegin&&!this.shouldBegin(e,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(e){if(this.moveable){e.preventDefault();var t=e.originalEvent.touches,r=t[0],n=t[1];if(n){this.endPoint||(this.endPoint={pageX:n.pageX,pageY:n.pageY});var a=function(j,et){return Math.hypot(et.x-j.x,et.y-j.y)},o=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}),s=this.originScale*o;this.currentScale=s;var u=this.get("minZoom")||this.graph.get("minZoom"),f=this.get("maxZoom")||this.graph.get("maxZoom");if(!(s>f||s0||e.wheelDelta<0?c=1-Mh*u:c=1/(1-Mh*u):e.wheelDelta<0?c=1-Mh*u:c=1/(1-Mh*u),l=f*c;var _=this.get("minZoom")||n.get("minZoom"),I=this.get("maxZoom")||n.get("maxZoom");l>I?l=I:l<_&&(l=_);var B=this.get("enableOptimize");if(B){var j=this.get("optimizeZoom"),et=this.get("optimized"),ut=n.getNodes(),ct=n.getEdges(),pt=ut.length,Mt=ct.length;if(!et){for(var Zt=0;Ztn/2?c-=_.width:c+=this.offset,l>a/2?l-=_.height:l+=this.offset;var I="".concat(c,"px"),B="".concat(l,"px");pi(this.container,{left:I,top:B,visibility:"visible"})},createTooltip:function(e){var t=e.get("el");t.style.position="relative";var r=qo('
    '));return t.parentNode.appendChild(r),pi(r,{position:"absolute",visibility:"visible"}),this.width=e.get("width"),this.height=e.get("height"),this.container=r,this.graph.get("tooltips").push(r),r}},Zw=(0,b.__assign)({getDefaultCfg:function(){return{item:"node",offset:12,formatText:function(t){return t.label}}},getEvents:function(){return{"node:mouseenter":"onMouseEnter","node:mouseleave":"onMouseLeave","node:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},E0),Kw=(0,b.__assign)({getDefaultCfg:function(){return{item:"edge",offset:12,formatText:function(t){return"source: ".concat(t.source," target: ").concat(t.target)}}},getEvents:function(){return{"edge:mouseenter":"onMouseEnter","edge:mouseleave":"onMouseLeave","edge:mousemove":"onMouseMove",afterremoveitem:"onMouseLeave"}}},E0),w0="click",$w=["click","dblclick"],qw={getDefaultCfg:function(){return{trigger:w0,onChange:function(){}}},getEvents:function(){var e,t;return $w.includes(this.trigger)?t=this.trigger:(t=w0,console.warn("Behavior collapse-expand \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),e={},e["node:".concat(t)]="onNodeClick",e.touchstart="onNodeClick",e},onNodeClick:function(e){var t=this;if(this.trigger==="click"){if(this.timer){clearTimeout(this.timer),this.timer=0;return}this.timer=setTimeout(function(){t.toggle(e),clearTimeout(t.timer),t.timer=0},200)}else this.toggle(e)},toggle:function(e){var t=e.item;if(t){var r=this.graph.findDataById(t.get("id"));if(r){var n=r.children;if(!(!n||n.length===0)){var a=!r.collapsed;this.shouldBegin(e,a,this)&&(r.collapsed=a,t.getModel().collapsed=a,this.graph.emit("itemcollapsed",{item:e.item,collapsed:a}),this.shouldUpdate(e,a,this)&&(this.onChange(t,a,this),this.graph.layout()))}}}}},Qw=sc.calculationItemsBBox,Jw=function i(e,t){if(t(e)!==!1&&e){var r=e.get("combos");if(r.length===0)return!1;(0,h.each)(r,function(n){i(n,t)})}},tS={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(e){var t=e.item;if(!t||t.destroyed||!this.shouldUpdate(e,this))return!1;var r=t.getType();return r==="combo"},onMouseDown:function(e){this.origin={x:e.x,y:e.y}},onDragStart:function(e){var t=this,r=this.graph,n=e.item;if(this.currentShouldEnd=!0,!!this.validationCombo(e)){this.targets=[];var a=r.findAllByState("combo",this.selectedState),o=n.get("id"),s=a.filter(function(f){var c=f.get("id");return o===c});s.length===0?this.targets.push(n):this.targets=a;var u=[];this.targets.forEach(function(f){var c=f.getModel(),l=c.x,_=c.y,I=c.id;u.push({x:l,y:_,id:I})}),this.set("beforeDragItems",u),this.activeState&&this.targets.map(function(f){var c=f.getModel();if(c.parentId){var l=r.findById(c.parentId);l&&r.setItemState(l,t.activeState,!0)}}),this.point={},this.originPoint={},this.currentItemChildCombos=[],Jw(n,function(f){if(f.destroyed)return!1;var c=f.getModel();return t.currentItemChildCombos.push(c.id),!0})}},onDrag:function(e){var t=this;if(this.origin&&this.validationCombo(e))if(this.enableDelegate)this.updateDelegate(e);else{if(this.activeState){var r=this.graph,n=e.item,a=n.getModel(),o=r.getCombos(),s=n.getBBox(),u=s.centerX,f=s.centerY,c=s.width,l=o.filter(function(_){var I=_.getModel();return a.parentId,I.id!==a.id&&!t.currentItemChildCombos.includes(I.id)});l.map(function(_){var I=_.getBBox(),B=I.centerX,j=I.centerY,et=I.width,ut=u-B,ct=f-j,pt=2*Math.sqrt(ut*ut+ct*ct);c+et-pt>.8*c?r.setItemState(_,t.activeState,!0):r.setItemState(_,t.activeState,!1)})}(0,h.each)(this.targets,function(_){t.updateCombo(_,e)}),this.onlyChangeComboSize&&this.updateParentCombos()}},updatePositions:function(e,t){var r=this;(this.enableDelegate||t)&&(0,h.each)(this.targets,function(n){r.updateCombo(n,e,t)})},onDrop:function(e){var t=this,r=e.item;if(this.currentShouldEnd=this.shouldEnd(e,r,this),this.updatePositions(e,!this.currentShouldEnd),!(!this.currentShouldEnd||!r||!this.targets||r.destroyed)){var n=this.graph,a=r.getModel();this.targets.map(function(o){var s=o.getModel();s.parentId!==a.id?(t.activeState&&n.setItemState(r,t.activeState,!1),t.onlyChangeComboSize?n.updateCombo(o):n.updateComboTree(o,a.id,!1)):n.updateCombo(r)}),this.end(r,e),this.endComparison=!0}},onNodeDrop:function(e){var t=this;if(!(!this.targets||this.targets.length===0)){var r=this.graph,n=e.item,a=n.getModel().comboId,o=a?r.findById(a):void 0;if(this.currentShouldEnd=this.shouldEnd(e,o,this),this.updatePositions(e,!this.currentShouldEnd),!!this.currentShouldEnd){var s;if(a){if(this.activeState){var u=r.findById(a);r.setItemState(u,this.activeState,!1)}this.targets.map(function(f){t.onlyChangeComboSize?r.updateCombo(f):a!==f.getID()&&(s=r.findById(a),a!==f.getModel().parentId&&r.updateComboTree(f,a,!1))})}else this.targets.map(function(f){if(t.onlyChangeComboSize)r.updateCombo(f);else{var c=f.getModel();c.comboId&&r.updateComboTree(f,void 0,!1)}});this.endComparison=!0,this.end(s,e)}}},onDragEnter:function(e){if(this.origin&&this.validationCombo(e)){var t=e.item,r=this.graph;this.activeState&&r.setItemState(t,this.activeState,!0)}},onDragLeave:function(e){if(this.origin&&this.validationCombo(e)){var t=e.item,r=this.graph;this.activeState&&r.setItemState(t,this.activeState,!1)}},onDragEnd:function(e){if(!(!this.targets||this.targets.length===0)){var t=e.item;this.currentShouldEnd&&this.updatePositions(e);var r=this.getParentCombo(t.getModel().parentId),n=this.graph;r&&this.activeState&&n.setItemState(r,this.activeState,!1),this.end(void 0,e)}},end:function(e,t){var r=this;if(this.origin){var n=this.graph;if(this.delegateShape){var a=n.get("delegateGroup");a.clear(),this.delegateShape=null}if(e&&this.activeState&&n.setItemState(e,this.activeState,!1),!e){var o=n.get("enabledStack")&&this.enableStack,s={before:{nodes:[],edges:[],combos:[].concat(this.get("beforeDragItems"))},after:{nodes:[],edges:[],combos:[]}};this.targets.map(function(u){if(!r.onlyChangeComboSize)n.updateComboTree(u,void 0,o);else{n.updateCombo(u);var f=u.getModel(),c=f.x,l=f.y,_=f.id;s.after.combos.push({x:c,y:l,id:_}),n.pushStack("update",s)}})}this.point=[],this.origin=null,this.originPoint=null,this.targets.length=0}},traverse:function(e,t,r){var n=this;if(r===void 0&&(r={}),t(e,r)!==!1&&e){var a=e.get("combos");(0,h.each)(a,function(s){n.traverse(s,t,r)});var o=e.get("nodes");(0,h.each)(o,function(s){n.traverse(s,t,r)})}},updateCombo:function(e,t,r){this.updateSingleItem(e,t,r);var n={};this.traverse(e,function(a,o){return a.destroyed?!1:(a.getEdges().forEach(function(s){return o[s.getID()]=s}),!0)},n),Object.values(n).forEach(function(a){return a.refresh()})},updateSingleItem:function(e,t,r){var n=this.origin,a=this.graph,o=e.getModel(),s=e.get("id");this.point[s]||(this.point[s]={x:o.x,y:o.y});var u=t.x-n.x+this.point[s].x,f=t.y-n.y+this.point[s].y;r&&(u+=n.x-t.x,f+=n.y-t.y),a.updateItem(e,{x:u,y:f},!1)},getParentCombo:function(e){var t=this.graph;if(e){var r=t.findById(e);if(r)return r}},updateDelegate:function(e){var t=this.graph;if(this.delegateShape){var _=e.x-this.origin.x+this.originPoint.minX,I=e.y-this.origin.y+this.originPoint.minY;this.delegateShape.attr({x:_,y:I})}else{var r=t.get("delegateGroup"),n=null;this.targets.length>1?n=Qw(this.targets):n=this.targets[0].getBBox();var a=n.x,o=n.y,s=n.width,u=n.height,f=n.minX,c=n.minY;this.originPoint={x:a,y:o,width:s,height:u,minX:f,minY:c};var l=(0,b.__assign)((0,b.__assign)({},Il.delegateStyle),this.delegateStyle);this.delegateShape=r.addShape("rect",{attrs:(0,b.__assign)({width:n.width,height:n.height,x:n.x,y:n.y},l),name:"combo-delegate-shape"}),this.delegateShape.set("capture",!1),this.delegate=this.delegateShape}},updateParentCombos:function(){var e=this,t=e.graph,r=e.targets,n={};r==null||r.forEach(function(a){var o=a.getModel().parentId;o&&(n[o]=t.findById(o))}),Object.values(n).forEach(function(a){a&&t.updateCombo(a)})}},S0="dblclick",eS=["click","dblclick"],rS={getDefaultCfg:function(){return{trigger:S0,relayout:!0}},getEvents:function(){var e,t;return eS.includes(this.trigger)?t=this.trigger:(t=S0,console.warn("Behavior collapse-expand-group \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click' \u6216 'dblclick'")),e={},e["combo:".concat(t)]="onComboClick",e},onComboClick:function(e){var t=e.item,r=this,n=r.graph,a=r.relayout;if(!(!t||t.destroyed||t.getType()!=="combo")){var o=t.getModel(),s=o.id;s&&(n.collapseExpandCombo(s),a&&n.get("layout")?n.layout():n.refreshPositions())}}},nS=sc.isPolygonsIntersect,aS=sc.pathToPoints,M0="shift",iS=["drag","shift","ctrl","alt","control"],oS=function(e,t){var r,n=e.getKeyShape();if(e.get("type")==="path")r=aS(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 nS(t,r)},sS={getDefaultCfg:function(){return{delegateStyle:{fill:"#EEF6FF",fillOpacity:.4,stroke:"#DDEEFE",lineWidth:1},onSelect:function(){},onDeselect:function(){},shouldDeselect:void 0,selectedState:"selected",trigger:M0,includeEdges:!0,selectedEdges:[],selectedNodes:[]}},getEvents:function(){return iS.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=M0,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(e){var t=this.lasso,r=e.item;r||this.trigger!=="drag"&&!this.keydown||(this.selectedNodes&&this.selectedNodes.length!==0&&this.clearStates("dragstart"),t||(t=this.createLasso()),this.dragging=!0,this.originPoint={x:e.x,y:e.y},this.points.push(this.originPoint),t.show())},onDragMove:function(e){this.dragging&&(this.trigger!=="drag"&&!this.keydown||(this.points.push({x:e.x,y:e.y}),this.updateLasso(e)))},onDragEnd:function(e){!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 e=this.points,t=[];return e.length&&(e.forEach(function(r,n){n===0?t.push(["M",r.x,r.y]):t.push(["L",r.x,r.y])}),t.push(["L",e[0].x,e[0].y])),t},clearStates:function(e){e===void 0&&(e="canvas:click");var t=this,r=t.graph,n=t.selectedState,a=t.shouldDeselect,o=r.findAllByState("node",n),s=r.findAllByState("edge",n);(!a||a({action:e,nodes:o,edges:s}))&&(o.forEach(function(u){return r.setItemState(u,n,!1)}),s.forEach(function(u){return r.setItemState(u,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 e=this,t=this,r=t.graph,n=t.shouldUpdate,a=this.points.map(function(c){return[r.getCanvasByPoint(c.x,c.y).x,r.getCanvasByPoint(c.x,c.y).y]}),o=this.selectedState,s=[],u=[];r.getNodes().forEach(function(c){if(c.isVisible()&&oS(c,a)&&n(c,"select",e)){s.push(c);var l=c.getModel();u.push(l.id),r.setItemState(c,o,!0)}});var f=[];this.includeEdges&&s.forEach(function(c){var l=c.getOutEdges();l.forEach(function(_){if(_.isVisible()){var I=_.getModel(),B=I.source,j=I.target;u.includes(B)&&u.includes(j)&&n(_,"select",e)&&(f.push(_),r.setItemState(_,e.selectedState,!0))}})}),this.selectedEdges=f,this.selectedNodes=s,this.onSelect&&this.onSelect(s,f),r.emit("nodeselectchange",{selectedItems:{nodes:s,edges:f},select:!0})},createLasso:function(){var e=this,t=e.graph.get("delegateGroup").addShape("path",{attrs:(0,b.__assign)({path:[]},e.delegateStyle),capture:!1,name:"lasso-shape"});return this.lasso=t,this.delegate=t,this.points=[],t},updateLasso:function(e){var t=this;this.lasso.attr({path:t.getLassoPath()})},onKeyDown:function(e){var t=e.key;t&&(t.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}},_0="click",uS=["click","drag"],C0=void 0,fS=["shift","ctrl","control","alt","meta",void 0],cS={getDefaultCfg:function(){return{trigger:_0,key:C0,edgeConfig:{},getEdgeConfig:void 0}},getEvents:function(){var e=this;uS.indexOf(e.trigger.toLowerCase())>-1||(e.trigger=_0,console.warn("Behavior create-edge \u7684 trigger \u53C2\u6570\u4E0D\u5408\u6CD5\uFF0C\u8BF7\u8F93\u5165 'click'\uFF0C'drag'")),e.key&&fS.indexOf(e.key.toLowerCase())===-1&&(e.trigger=C0,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 t;return e.trigger==="drag"?t={"node:dragstart":"onClick","combo:dragstart":"onClick",drag:"updateEndPoint","node:drop":"onClick","combo:drop":"onClick",dragend:"onDragEnd"}:e.trigger==="click"&&(t={"node:click":"onClick",mousemove:"updateEndPoint","edge:click":"cancelCreating","canvas:click":"cancelCreating","combo:click":"onClick"}),e.key&&(t.keydown="onKeyDown",t.keyup="onKeyUp"),t},onDragEnd:function(e){var t=this;if(!(t.key&&!t.keydown)){var r=e.item;(!r||r.getID()===t.source||r.getType()!=="node")&&t.cancelCreating({item:t.edge,x:e.x,y:e.y})}},onClick:function(e){var t=this;if(!(t.key&&!t.keydown)){var r=e.item,n=t.graph,a=r.getModel(),o=t.getEdgeConfig;if(t.addingEdge&&t.edge){if(!t.shouldEnd(e,t))return;var s=void 0;o&&(0,h.isFunction)(o)?s=o({source:t.source,target:a.id},t):s=t.edgeConfig;var u=(0,b.__assign)({target:a.id},s);if(t.source===a.id&&(u.type="loop"),n.emit("beforecreateedge",{}),n.updateItem(t.edge,u,!1),n.get("enabledStack")){var f=(0,b.__assign)((0,b.__assign)({},t.edge.getModel()),{itemType:"edge"}),c={};c.edges=[f],n.pushStack("add",{before:{},after:c})}n.emit("aftercreateedge",{edge:t.edge}),t.edge.getKeyShape().set("capture",!0),t.edge=null,t.addingEdge=!1}else{if(!t.shouldBegin(e,t))return;var s=void 0;o&&(0,h.isFunction)(o)?s=o({source:a.id,target:a.id},t):s=t.edgeConfig,t.edge=n.addItem("edge",(0,b.__assign)({source:a.id,target:a.id},s),!1),t.source=a.id,t.addingEdge=!0,t.edge.getKeyShape().set("capture",!1)}}},updateEndPoint:function(e){var t=this;if(!(t.key&&!t.keydown)){t.edge&&t.edge.destroyed&&t.cancelCreating({item:t.edge});var r={x:e.x,y:e.y};if(!t.graph.findById(t.source)){t.addingEdge=!1;return}t.addingEdge&&t.edge&&t.graph.updateItem(t.edge,{target:r},!1)}},cancelCreating:function(e){var t,r,n=this;if(!(n.key&&!n.keydown)){var a=n.graph,o=e.item;if(n.addingEdge&&(n.edge===o||!((r=(t=e.target)===null||t===void 0?void 0:t.isCanvas)===null||r===void 0)&&r.call(t))){n.edge&&!n.edge.destroyed&&a.removeItem(n.edge,!1),n.edge=null,n.addingEdge=!1;return}}},onKeyDown:function(e){var t=this,r=e.key;r&&(r.toLowerCase()===t.key.toLowerCase()?t.keydown=!0:t.keydown=!1)},onKeyUp:function(){var e=this;e.addingEdge&&e.edge&&(e.graph.removeItem(e.edge,!1),e.addingEdge=!1,e.edge=null),this.keydown=!1}},T0="ctrl",lS=["shift","ctrl","alt","control"],dS="1",hS={getDefaultCfg:function(){return{trigger:T0,combinedKey:dS,functionName:"fitView",functionParams:[]}},getEvents:function(){return lS.indexOf(this.trigger.toLowerCase())>-1||(this.trigger=T0,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(e){var t=e.key;if(t){var r=this.trigger.toLowerCase(),n=t.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 o=this.combinedKey.toLowerCase();this.triggerKeydown&&(n===o||n==="control"&&o==="ctrl"||n==="ctrl"&&o==="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}},vS=["shift","ctrl","alt","control","meta"],pS={getDefaultCfg:function(){return{direction:"both",enableOptimize:!1,zoomKey:"ctrl",scalableRange:0,allowDragOnItem:!0}},getEvents:function(){return(!this.zoomKey||vS.indexOf(this.zoomKey)===-1)&&(this.zoomKey="ctrl"),{wheel:"onWheel"}},onWheel:function(e){var t=this;if(this.allowDrag(e)){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(yn){return e["".concat(yn,"Key")]});if(a){var o=r.get("canvas"),s=o.getPointByClient(e.clientX,e.clientY),u=r.getZoom();e.wheelDelta>0?u=u+u*.05:u=u-u*.05,r.zoomTo(u,{x:s.x,y:s.y})}else{var f=e.deltaX||e.movementX,c=e.deltaY||e.movementY;!c&&navigator.userAgent.indexOf("Firefox")>-1&&(c=-e.wheelDelta*125/3);var l=this.graph.get("width"),_=this.graph.get("height"),I=this.graph.get("canvas").getCanvasBBox(),B=this.scalableRange,j=this.scalableRange;B<1&&B>-1&&(B=l*B,j=_*j);var et=I.minX,ut=I.maxX,ct=I.minY,pt=I.maxY;f>0?ut<-B?f=0:ut-f<-B&&(f=ut+B):f<0&&(et>l+B?f=0:et-f>l+B&&(f=et-(l+B))),c>0?pt<-j?c=0:pt-c<-j&&(c=pt+j):c<0&&(ct>_+j?c=0:ct-c>_+j&&(c=ct-(_+j))),this.get("direction")==="x"?c=0:this.get("direction")==="y"&&(f=0),r.translate(-f,-c)}e.preventDefault();var Mt=this.get("enableOptimize");if(Mt){var Zt=this.get("optimizeZoom"),se=this.get("optimized"),oe=r.getNodes(),_e=r.getEdges(),Ue=oe.length,Re=_e.length;if(!se){for(var qe=0;qe0?ce.set(jt,pe):ce.delete(jt))}function m(ce,jt,pe,Oe){var Se=String(jt),Fe=String(pe);if(!ce&&Se>Fe){var or=Se;Se=Fe,Fe=or}return Se+L.EDGE_KEY_DELIM+Fe+L.EDGE_KEY_DELIM+(Oe===void 0?L.DEFAULT_EDGE_NAME:Oe)}function S(ce,jt,pe,Oe){var Se=String(jt),Fe=String(pe),or={v:jt,w:pe};if(!ce&&Se>Fe){var gr=or.v;or.v=or.w,or.w=gr}return Oe!==void 0&&(or.name=Oe),or}function y(ce,jt){return m(ce,jt.v,jt.w,jt.name)}function g(ce){return typeof ce=="function"}var A=function(jt){return jt.nodes().map(function(pe){var Oe=jt.node(pe),Se=jt.parent(pe),Fe={id:pe,value:Oe,parent:Se};return Fe.value===void 0&&delete Fe.value,Fe.parent===void 0&&delete Fe.parent,Fe})},E=function(jt){return jt.edges().map(function(pe){var Oe=jt.edge(pe),Se={v:pe.v,w:pe.w,value:Oe,name:pe.name};return Se.name===void 0&&delete Se.name,Se.value===void 0&&delete Se.value,Se})},D=function(jt){var pe={options:{directed:jt.isDirected(),multigraph:jt.isMultigraph(),compound:jt.isCompound()},nodes:A(jt),edges:E(jt),value:jt.graph()};return pe.value===void 0&&delete pe.value,pe},F=function(jt){var pe=new H(jt.options);return jt.value!==void 0&&pe.setGraph(jt.value),jt.nodes.forEach(function(Oe){pe.setNode(Oe.id,Oe.value),Oe.parent&&pe.setParent(Oe.id,Oe.parent)}),jt.edges.forEach(function(Oe){pe.setEdge(Oe.v,Oe.w,Oe.value,Oe.name)}),pe};function Y(ce,jt){var pe=Object.keys(ce);if(Object.getOwnPropertySymbols){var Oe=Object.getOwnPropertySymbols(ce);jt&&(Oe=Oe.filter(function(Se){return Object.getOwnPropertyDescriptor(ce,Se).enumerable})),pe.push.apply(pe,Oe)}return pe}function b(ce){for(var jt=1;jt0&&arguments[0]!==void 0?arguments[0]:{};$(this,ce),this.directed=!0,this.multigraph=!1,this.compound=!1,this.GRAPH_NODE=L.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 jt.directed},this.isMultigraph=function(){return jt.multigraph},this.isCompound=function(){return jt.compound},this.setGraph=function(Se){return jt.label=Se,jt},this.graph=function(){return jt.label},this.setDefaultNodeLabel=function(Se){return g(Se)?jt.defaultNodeLabelFn=Se:jt.defaultNodeLabelFn=function(){return Se},jt},this.nodeCount=function(){return jt.nodeCountNum},this.node=function(Se){return jt.nodesLabelMap.get(Se)},this.nodes=function(){return Array.from(jt.nodesLabelMap.keys())},this.sources=function(){return jt.nodes().filter(function(Se){var Fe;return!(!((Fe=jt.inEdgesMap.get(Se))===null||Fe===void 0)&&Fe.size)})},this.sinks=function(){return jt.nodes().filter(function(Se){var Fe;return!(!((Fe=jt.outEdgesMap.get(Se))===null||Fe===void 0)&&Fe.size)})},this.setNodes=function(Se,Fe){return Se.map(function(or){return jt.setNode(or,Fe)}),jt},this.hasNode=function(Se){return jt.nodesLabelMap.has(Se)},this.checkCompound=function(){if(!jt.isCompound())throw new Error("Cannot construct parent-children relations in a non-compound graph")},this.parent=function(Se){if(jt.isCompound()){var Fe,or=(Fe=jt.parentMap)===null||Fe===void 0?void 0:Fe.get(Se);if(or!==jt.GRAPH_NODE)return or}},this.removeFromParentsChildList=function(Se){var Fe=jt.parentMap.get(Se);jt.childrenMap.get(Fe).delete(Se)},this.setParent=function(Se,Fe){var or,gr;jt.checkCompound();for(var Jr=Fe===void 0?jt.GRAPH_NODE:Fe,Gn=jt.parent(Jr);Gn;){if(Se===Gn)throw new Error("Setting "+Fe+" as parent of "+Se+" would create a cycle");Gn=jt.parent(Gn)}Fe&&jt.setNode(Fe),jt.setNode(Se),jt.removeFromParentsChildList(Se),(or=jt.parentMap)===null||or===void 0||or.set(Se,Jr);var pn=jt.childrenMap.get(Jr);return pn.set(Se,!0),(gr=jt.childrenMap)===null||gr===void 0||gr.set(Jr,pn),jt},this.children=function(Se){var Fe=Se===void 0?jt.GRAPH_NODE:Se;if(jt.isCompound()){var or,gr=(or=jt.childrenMap)===null||or===void 0?void 0:or.get(Fe);return gr?Array.from(gr.keys()):void 0}if(Fe===jt.GRAPH_NODE)return jt.nodes();if(Se&&jt.hasNode(Se))return[]},this.predecessors=function(Se){var Fe=jt.predecessorsMap.get(Se);return Fe?Array.from(Fe.keys()):void 0},this.successors=function(Se){var Fe=jt.successorsMap.get(Se);return Fe?Array.from(Fe.keys()):void 0},this.neighbors=function(Se){var Fe;if(jt.hasNode(Se))return Array.from(new Set((Fe=jt.predecessors(Se))===null||Fe===void 0?void 0:Fe.concat(jt.successors(Se))))},this.isLeaf=function(Se){var Fe;if(jt.isDirected()){var or;return!(!((or=jt.successors(Se))===null||or===void 0)&&or.length)}return!(!((Fe=jt.neighbors(Se))===null||Fe===void 0)&&Fe.length)},this.filterNodes=function(Se){var Fe=jt.directed,or=jt.multigraph,gr=jt.compound,Jr=new ce({directed:Fe,multigraph:or,compound:gr});if(Jr.setGraph(jt.graph()),jt.nodes().forEach(function(pn){Se(pn)&&Jr.setNode(pn,jt.node(pn))}),jt.edges().forEach(function(pn){Jr.hasNode(pn.v)&&Jr.hasNode(pn.w)&&Jr.setEdgeObj(pn,jt.edge(pn))}),gr){var Gn=function(qn){for(var ln=jt.parent(qn);ln!==void 0&&!Jr.hasNode(ln);)ln=jt.parent(ln);return ln};Jr.nodes().forEach(function(pn){Jr.setParent(pn,Gn(pn))})}return Jr},this.setDefaultEdgeLabel=function(Se){return g(Se)?jt.defaultEdgeLabelFn=Se:jt.defaultEdgeLabelFn=function(){return Se},jt},this.edgeCount=function(){return jt.edgeCountNum},this.setEdgeObj=function(Se,Fe){return jt.setEdge(Se.v,Se.w,Fe,Se.name)},this.setPath=function(Se,Fe){return Se.reduce(function(or,gr){return jt.setEdge(or,gr,Fe),gr}),jt},this.edgeFromArgs=function(Se,Fe,or){return jt.edge({v:Se,w:Fe,name:or})},this.edge=function(Se){return jt.edgesLabelsMap.get(y(jt.isDirected(),Se))},this.hasEdge=function(Se,Fe,or){return jt.edgesLabelsMap.has(y(jt.isDirected(),{v:Se,w:Fe,name:or}))},this.removeEdgeObj=function(Se){var Fe=Se.v,or=Se.w,gr=Se.name;return jt.removeEdge(Fe,or,gr)},this.edges=function(){return Array.from(jt.edgesMap.values())},this.inEdges=function(Se,Fe){var or=jt.inEdgesMap.get(Se);if(or)return Array.from(or.values()).filter(function(gr){return!Fe||gr.v===Fe})},this.outEdges=function(Se,Fe){var or=jt.outEdgesMap.get(Se);if(or)return Array.from(or.values()).filter(function(gr){return!Fe||gr.w===Fe})},this.nodeEdges=function(Se,Fe){var or;if(jt.hasNode(Se))return(or=jt.inEdges(Se,Fe))===null||or===void 0?void 0:or.concat(jt.outEdges(Se,Fe))},this.toJSON=function(){return D(jt)},this.nodeInDegree=function(Se){var Fe=jt.inEdgesMap.get(Se);return Fe?Fe.size:0},this.nodeOutDegree=function(Se){var Fe=jt.outEdgesMap.get(Se);return Fe?Fe.size:0},this.nodeDegree=function(Se){return jt.nodeInDegree(Se)+jt.nodeOutDegree(Se)},this.source=function(Se){return Se.v},this.target=function(Se){return Se.w};var Oe=b(b({},V),pe);this.compound=Oe.compound,this.directed=Oe.directed,this.multigraph=Oe.multigraph,this.compound&&(this.parentMap=new Map,this.childrenMap=new Map)}return W(ce,[{key:"setNode",value:function(pe,Oe){var Se=this.nodesLabelMap,Fe=this.defaultNodeLabelFn,or=this.isCompound,gr=this.parentMap,Jr=this.childrenMap,Gn=this.inEdgesMap,pn=this.outEdgesMap,qn=this.predecessorsMap,ln=this.successorsMap;if(Se.has(pe))return Oe!==void 0&&Se.set(pe,Oe),this;if(Se.set(pe,Oe||Fe(pe)),or()){var Vn;gr==null||gr.set(pe,this.GRAPH_NODE),Jr==null||Jr.set(pe,new Map),Jr!=null&&Jr.has(this.GRAPH_NODE)||Jr==null||Jr.set(this.GRAPH_NODE,new Map),Jr==null||(Vn=Jr.get(this.GRAPH_NODE))===null||Vn===void 0||Vn.set(pe,!0)}return[Gn,pn,qn,ln].forEach(function(ca){return ca.set(pe,new Map)}),this.nodeCountNum+=1,this}},{key:"removeNode",value:function(pe){var Oe=this;if(this.hasNode(pe)){var Se=function(Ea){Oe.removeEdge(Ea.v,Ea.w,Ea.name)},Fe=this.inEdgesMap,or=this.outEdgesMap,gr=this.predecessorsMap,Jr=this.successorsMap,Gn=this.nodesLabelMap;if(this.isCompound()){var pn,qn,ln;this.removeFromParentsChildList(pe),(pn=this.parentMap)===null||pn===void 0||pn.delete(pe),(qn=this.children(pe))===null||qn===void 0||qn.forEach(function(ba){return Oe.setParent(ba)}),(ln=this.childrenMap)===null||ln===void 0||ln.delete(pe)}var Vn=Fe.get(pe),ca=or.get(pe);Array.from(Vn.values()).forEach(function(ba){return Se(ba)}),Array.from(ca.values()).forEach(function(ba){return Se(ba)}),Gn.delete(pe),Fe.delete(pe),or.delete(pe),gr.delete(pe),Jr.delete(pe),this.nodeCountNum-=1}return this}},{key:"setEdge",value:function(pe,Oe,Se,Fe){var or,gr,Jr=S(this.isDirected(),pe,Oe,Fe),Gn=y(this.isDirected(),Jr),pn=Jr.v,qn=Jr.w;if(this.edgesLabelsMap.has(Gn))return this.edgesLabelsMap.set(Gn,Se),this;if(Fe!==void 0&&!this.isMultigraph())throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(pn),this.setNode(qn),this.edgesLabelsMap.set(Gn,Se||this.defaultEdgeLabelFn(pn,qn,Fe)),Object.freeze(Jr),this.edgesMap.set(Gn,Jr);var ln=this.predecessorsMap.get(qn),Vn=this.successorsMap.get(pn);return P(ln,pn),P(Vn,qn),(or=this.inEdgesMap.get(qn))===null||or===void 0||or.set(Gn,Jr),(gr=this.outEdgesMap.get(pn))===null||gr===void 0||gr.set(Gn,Jr),this.edgeCountNum+=1,this}},{key:"removeEdge",value:function(pe,Oe,Se){var Fe=m(this.isDirected(),pe,Oe,Se),or=this.edgesMap.get(Fe);if(or){var gr=S(this.isDirected(),pe,Oe,Se),Jr=gr.v,Gn=gr.w;this.edgesLabelsMap.delete(Fe),this.edgesMap.delete(Fe);var pn=this.predecessorsMap.get(Gn),qn=this.successorsMap.get(Jr);p(pn,Jr),p(qn,Gn),this.inEdgesMap.get(Gn).delete(Fe),this.outEdgesMap.get(Jr).delete(Fe),this.edgeCountNum-=1}return this}}]),ce}();H.fromJSON=F;function q(ce){"@babel/helpers - typeof";return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(jt){return typeof jt}:function(jt){return jt&&typeof Symbol=="function"&&jt.constructor===Symbol&&jt!==Symbol.prototype?"symbol":typeof jt},q(ce)}function tt(ce,jt){if(!(ce instanceof jt))throw new TypeError("Cannot call a class as a function")}function rt(ce,jt){for(var pe=0;pe-1&&this.eventPool[Se].splice(or,1)}}},{key:"emitEvent",value:function(Se){for(var Fe=arguments.length,or=new Array(Fe>1?Fe-1:0),gr=1;gr>1,((gr=Oe[Fe])===null||gr===void 0?void 0:gr.priority)jt.arr[Se].priority)throw new Error("New priority is greater than current priority.Key: ".concat(pe," Old: + ").concat(jt.arr[Se].priority," New: ").concat(Oe));jt.arr[Se].priority=Oe,jt.innerDecrease(Se)}}),St=function(jt,pe){var Oe=new H,Se=new Map,Fe=new Pt,or;function gr(pn){var qn=pn.v===or?pn.w:pn.v,ln=Fe.priority(qn);if(ln!==void 0){var Vn=pe(pn);Vn0;){var Gn;if(or=Fe.removeMin(),Se.has(or))Oe.setEdge(or,Se.get(or));else{if(Jr)throw new Error("Input graph is not connected: "+jt.graph());Jr=!0}(Gn=jt.nodeEdges(or))===null||Gn===void 0||Gn.forEach(gr)}return Oe},Dt=St,Qt=function(jt){var pe=new Set,Oe=[],Se=jt.nodes();return Se.forEach(function(Fe){for(var or=[],gr=[Fe];gr.length>0;){var Jr=gr.pop();if(!pe.has(Jr)){var Gn,pn;pe.add(Jr),or.push(Jr),(Gn=jt.successors(Jr))===null||Gn===void 0||Gn.forEach(function(qn){return gr.push(qn)}),(pn=jt.predecessors(Jr))===null||pn===void 0||pn.forEach(function(qn){return gr.push(qn)})}}or.length&&Oe.push(or)}),Oe},ue=Qt,ie=function ce(jt,pe,Oe,Se,Fe,or){Se.includes(pe)||(Se.push(pe),Oe||or.push(pe),Fe(pe).forEach(function(gr){return ce(jt,gr,Oe,Se,Fe,or)}),Oe&&or.push(pe))},Lt=function(jt,pe,Oe){var Se=Array.isArray(pe)?pe:[pe],Fe=function(Gn){return jt.isDirected()?jt.successors(Gn):jt.neighbors(Gn)},or=[],gr=[];return Se.forEach(function(Jr){if(jt.hasNode(Jr))ie(jt,Jr,Oe==="post",gr,Fe,or);else throw new Error("Graph does not have node: "+Jr)}),or},ne=Lt;function ve(ce,jt){return Jt(ce)||xe(ce,jt)||ae(ce,jt)||Wt()}function Wt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ae(ce,jt){if(ce){if(typeof ce=="string")return Ce(ce,jt);var pe=Object.prototype.toString.call(ce).slice(8,-1);if(pe==="Object"&&ce.constructor&&(pe=ce.constructor.name),pe==="Map"||pe==="Set")return Array.from(ce);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return Ce(ce,jt)}}function Ce(ce,jt){(jt==null||jt>ce.length)&&(jt=ce.length);for(var pe=0,Oe=new Array(jt);pe0&&(gr=or.removeMin(),Jr=Fe.get(gr),!(Jr&&Jr.distance===Number.POSITIVE_INFINITY));)Se(gr).forEach(Gn);var pn={};return Array.from(Fe.entries()).forEach(function(qn){var ln=ve(qn,2),Vn=ln[0],ca=ln[1];return pn[String(Vn)]=ca,pn}),pn},_r=Tt,Ar=function(jt,pe,Oe){var Se={};return jt.nodes().forEach(function(Fe){return Se[String(Fe)]=_r(jt,Fe,pe,Oe),Se}),Se},Or=Ar,Br=function(jt){var pe=0,Oe=[],Se=new Map,Fe=[];function or(gr){var Jr,Gn={onStack:!0,lowlink:pe,index:pe};if(Se.set(gr,Gn),pe+=1,Oe.push(gr),(Jr=jt.successors(gr))===null||Jr===void 0||Jr.forEach(function(Vn){var ca;if(Se.has(Vn)){if(!((ca=Se.get(Vn))===null||ca===void 0)&&ca.onStack){var Ea=Se.get(Vn);Gn.lowlink=Math.min(Gn.lowlink,Ea.index)}}else{or(Vn);var ba=Se.get(Vn);Gn.lowlink=Math.min(Gn.lowlink,ba.lowlink)}}),Gn.lowlink===Gn.index){var pn=[],qn;do{qn=Oe.pop();var ln=Se.get(qn);ln.onStack=!1,pn.push(qn)}while(gr!==qn);Fe.push(pn)}}return jt.nodes().forEach(function(gr){Se.has(gr)||or(gr)}),Fe},cn=Br,an=function(jt){return cn(jt).filter(function(pe){return pe.length>1||pe.length===1&&jt.hasEdge(pe[0],pe[0])})},Dn=an;function Un(ce){"@babel/helpers - typeof";return Un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(jt){return typeof jt}:function(jt){return jt&&typeof Symbol=="function"&&jt.constructor===Symbol&&jt!==Symbol.prototype?"symbol":typeof jt},Un(ce)}function Xn(ce,jt){for(var pe=0;pece.length)&&(jt=ce.length);for(var pe=0,Oe=new Array(jt);pe-1:!1};C.a=w},function(z,C,x){"use strict";var k=function(w){return typeof w=="object"&&w!==null};C.a=k},function(z,C,x){"use strict";var k=x(8),w=x(2),T=Object.values?function(L){return Object.values(L)}:function(L){var P=[];return Object(k.a)(L,function(p,m){Object(w.a)(L)&&m==="prototype"||P.push(p)}),P};C.a=T},function(z,C,x){"use strict";C.a=w;function k(T,L){for(var P in L)L.hasOwnProperty(P)&&P!=="constructor"&&L[P]!==void 0&&(T[P]=L[P])}function w(T,L,P,p){return L&&k(T,L),P&&k(T,P),p&&k(T,p),T}},function(z,C,x){var k=x(35),w=["LR","RL","TB","BT","H","V"],T=["LR","RL","H"],L=function(m){return T.indexOf(m)>-1},P=w[0];z.exports=function(p,m,S){var y=m.direction||P;if(m.isHorizontal=L(y),y&&w.indexOf(y)===-1)throw new TypeError("Invalid direction: "+y);if(y===w[0])S(p,m);else if(y===w[1])S(p,m),p.right2left();else if(y===w[2])S(p,m);else if(y===w[3])S(p,m),p.bottom2top();else if(y===w[4]||y===w[5]){var g=k(p,m),A=g.left,E=g.right;S(A,m),S(E,m),m.isHorizontal?A.right2left():A.bottom2top(),E.translate(A.x-E.x,A.y-E.y),p.x=A.x,p.y=E.y;var D=p.getBoundingBox();m.isHorizontal?D.top<0&&p.translate(0,-D.top):D.left<0&&p.translate(-D.left,0)}var F=m.fixedRoot;return F===void 0&&(F=!0),F&&p.translate(-(p.x+p.width/2+p.hgap),-(p.y+p.height/2+p.vgap)),p}},function(z,C,x){var k=x(6),w=18,T=w*2,L=w,P={getId:function(y){return y.id||y.name},getPreH:function(y){return y.preH||0},getPreV:function(y){return y.preV||0},getHGap:function(y){return y.hgap||L},getVGap:function(y){return y.vgap||L},getChildren:function(y){return y.children},getHeight:function(y){return y.height||T},getWidth:function(y){var g=y.label||" ";return y.width||g.split("").length*w}};function p(S,y){var g=this;if(g.vgap=g.hgap=0,S instanceof p)return S;g.data=S;var A=y.getHGap(S),E=y.getVGap(S);return g.preH=y.getPreH(S),g.preV=y.getPreV(S),g.width=y.getWidth(S),g.height=y.getHeight(S),g.width+=g.preH,g.height+=g.preV,g.id=y.getId(S),g.x=g.y=0,g.depth=0,g.children||(g.children=[]),g.addGap(A,E),g}k.assign(p.prototype,{isRoot:function(){return this.depth===0},isLeaf:function(){return this.children.length===0},addGap:function(y,g){var A=this;A.hgap+=y,A.vgap+=g,A.width+=2*y,A.height+=2*g},eachNode:function(y){for(var g=this,A=[g],E;E=A.shift();)y(E),A=E.children.concat(A)},DFTraverse:function(y){this.eachNode(y)},BFTraverse:function(y){for(var g=this,A=[g],E;E=A.shift();)y(E),A=A.concat(E.children)},getBoundingBox:function(){var y={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(g){y.left=Math.min(y.left,g.x),y.top=Math.min(y.top,g.y),y.width=Math.max(y.width,g.x+g.width),y.height=Math.max(y.height,g.y+g.height)}),y},translate:function(y,g){y===void 0&&(y=0),g===void 0&&(g=0),this.eachNode(function(A){A.x+=y,A.y+=g,A.x+=A.preH,A.y+=A.preV})},right2left:function(){var y=this,g=y.getBoundingBox();y.eachNode(function(A){A.x=A.x-(A.x-g.left)*2-A.width}),y.translate(g.width,0)},bottom2top:function(){var y=this,g=y.getBoundingBox();y.eachNode(function(A){A.y=A.y-(A.y-g.top)*2-A.height}),y.translate(0,g.height)}});function m(S,y,g){y===void 0&&(y={}),y=k.assign({},P,y);var A=new p(S,y),E=[A],D;if(!g&&!S.collapsed){for(;D=E.shift();)if(!D.data.collapsed){var F=y.getChildren(D.data),Y=F?F.length:0;if(D.children=new Array(Y),F&&Y)for(var b=0;b-1;)w.call(P,g,1);return P};C.a=L},function(z,C,x){"use strict";var k=x(1),w=x(24),T=function(L,P){var p=[];if(!Object(k.a)(L))return p;for(var m=-1,S=[],y=L.length;++mg[E])return 1;if(y[E]L?L:w};C.a=k},function(z,C,x){"use strict";var k=function(w,T){var L=T.toString(),P=L.indexOf(".");if(P===-1)return Math.round(w);var p=L.substr(P+1).length;return p>20&&(p=20),parseFloat(w.toFixed(p))};C.a=k},function(z,C,x){"use strict";var k=x(5),w=function(T){return Object(k.a)(T)&&T%1!==0};C.a=w},function(z,C,x){"use strict";var k=x(5),w=function(T){return Object(k.a)(T)&&T%2===0};C.a=w},function(z,C,x){"use strict";var k=x(5),w=Number.isInteger?Number.isInteger:function(T){return Object(k.a)(T)&&T%1===0};C.a=w},function(z,C,x){"use strict";var k=x(5),w=function(T){return Object(k.a)(T)&&T<0};C.a=w},function(z,C,x){"use strict";C.a=w;var k=1e-5;function w(T,L,P){return P===void 0&&(P=k),Math.abs(T-L)0};C.a=w},function(z,C,x){"use strict";var k=x(0),w=x(2);C.a=function(T,L){if(Object(k.a)(T)){for(var P,p=-1/0,m=0;mp&&(P=S,p=y)}return P}}},function(z,C,x){"use strict";var k=x(0),w=x(2);C.a=function(T,L){if(Object(k.a)(T)){for(var P,p=1/0,m=0;mw?(L&&(clearTimeout(L),L=null),S=A,m=k.apply(P,p),L||(P=p=null)):!L&&T.trailing!==!1&&(L=setTimeout(y,E)),m};return g.cancel=function(){clearTimeout(L),S=0,L=P=p=null},g}},function(z,C,x){"use strict";var k=x(1);C.a=function(w){return Object(k.a)(w)?Array.prototype.slice.call(w):[]}},function(z,C,x){"use strict";var k={};C.a=function(w){return w=w||"g",k[w]?k[w]+=1:k[w]=1,w+k[w]}},function(z,C,x){"use strict";C.a=function(){}},function(z,C,x){"use strict";C.a=function(k){return k}},function(z,C,x){"use strict";C.a=T;var k=x(7),w=x(1);function T(L){return Object(k.a)(L)?0:Object(w.a)(L)?L.length:Object.keys(L).length}},function(z,C,x){"use strict";C.a=U;var k=function(At,Z){return k=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(J,yt){J.__proto__=yt}||function(J,yt){for(var _t in yt)Object.prototype.hasOwnProperty.call(yt,_t)&&(J[_t]=yt[_t])},k(At,Z)};function w(At,Z){if(typeof Z!="function"&&Z!==null)throw new TypeError("Class extends value "+String(Z)+" is not a constructor or null");k(At,Z);function J(){this.constructor=At}At.prototype=Z===null?Object.create(Z):(J.prototype=Z.prototype,new J)}var T=function(){return T=Object.assign||function(Z){for(var J,yt=1,_t=arguments.length;yt<_t;yt++){J=arguments[yt];for(var nt in J)Object.prototype.hasOwnProperty.call(J,nt)&&(Z[nt]=J[nt])}return Z},T.apply(this,arguments)};function L(At,Z){var J={};for(var yt in At)Object.prototype.hasOwnProperty.call(At,yt)&&Z.indexOf(yt)<0&&(J[yt]=At[yt]);if(At!=null&&typeof Object.getOwnPropertySymbols=="function")for(var _t=0,yt=Object.getOwnPropertySymbols(At);_t=0;It--)(vt=At[It])&&(nt=(_t<3?vt(nt):_t>3?vt(Z,J,nt):vt(Z,J))||nt);return _t>3&&nt&&Object.defineProperty(Z,J,nt),nt}function p(At,Z){return function(J,yt){Z(J,yt,At)}}function m(At,Z,J,yt,_t,nt){function vt(Wt){if(Wt!==void 0&&typeof Wt!="function")throw new TypeError("Function expected");return Wt}for(var It=yt.kind,Pt=It==="getter"?"get":It==="setter"?"set":"value",St=!Z&&At?yt.static?At:At.prototype:null,Dt=Z||(St?Object.getOwnPropertyDescriptor(St,yt.name):{}),Qt,ue=!1,ie=J.length-1;ie>=0;ie--){var Lt={};for(var ne in yt)Lt[ne]=ne==="access"?{}:yt[ne];for(var ne in yt.access)Lt.access[ne]=yt.access[ne];Lt.addInitializer=function(Wt){if(ue)throw new TypeError("Cannot add initializers after decoration has completed");nt.push(vt(Wt||null))};var ve=(0,J[ie])(It==="accessor"?{get:Dt.get,set:Dt.set}:Dt[Pt],Lt);if(It==="accessor"){if(ve===void 0)continue;if(ve===null||typeof ve!="object")throw new TypeError("Object expected");(Qt=vt(ve.get))&&(Dt.get=Qt),(Qt=vt(ve.set))&&(Dt.set=Qt),(Qt=vt(ve.init))&&_t.push(Qt)}else(Qt=vt(ve))&&(It==="field"?_t.push(Qt):Dt[Pt]=Qt)}St&&Object.defineProperty(St,yt.name,Dt),ue=!0}function S(At,Z,J){for(var yt=arguments.length>2,_t=0;_t0&&nt[nt.length-1])&&(St[0]===6||St[0]===2)){J=0;continue}if(St[0]===3&&(!nt||St[1]>nt[0]&&St[1]=At.length&&(At=void 0),{value:At&&At[yt++],done:!At}}};throw new TypeError(Z?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(At,Z){var J=typeof Symbol=="function"&&At[Symbol.iterator];if(!J)return At;var yt=J.call(At),_t,nt=[],vt;try{for(;(Z===void 0||Z-- >0)&&!(_t=yt.next()).done;)nt.push(_t.value)}catch(It){vt={error:It}}finally{try{_t&&!_t.done&&(J=yt.return)&&J.call(yt)}finally{if(vt)throw vt.error}}return nt}function $(){for(var At=[],Z=0;Z1||It(ue,ie)})})}function It(ue,ie){try{Pt(yt[ue](ie))}catch(Lt){Qt(nt[0][3],Lt)}}function Pt(ue){ue.value instanceof V?Promise.resolve(ue.value.v).then(St,Dt):Qt(nt[0][2],ue)}function St(ue){It("next",ue)}function Dt(ue){It("throw",ue)}function Qt(ue,ie){ue(ie),nt.shift(),nt.length&&It(nt[0][0],nt[0][1])}}function q(At){var Z,J;return Z={},yt("next"),yt("throw",function(_t){throw _t}),yt("return"),Z[Symbol.iterator]=function(){return this},Z;function yt(_t,nt){Z[_t]=At[_t]?function(vt){return(J=!J)?{value:V(At[_t](vt)),done:!1}:nt?nt(vt):vt}:nt}}function tt(At){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var Z=At[Symbol.asyncIterator],J;return Z?Z.call(At):(At=typeof b=="function"?b(At):At[Symbol.iterator](),J={},yt("next"),yt("throw"),yt("return"),J[Symbol.asyncIterator]=function(){return this},J);function yt(nt){J[nt]=At[nt]&&function(vt){return new Promise(function(It,Pt){vt=At[nt](vt),_t(It,Pt,vt.done,vt.value)})}}function _t(nt,vt,It,Pt){Promise.resolve(Pt).then(function(St){nt({value:St,done:It})},vt)}}function rt(At,Z){return Object.defineProperty?Object.defineProperty(At,"raw",{value:Z}):At.raw=Z,At}var ft=Object.create?function(At,Z){Object.defineProperty(At,"default",{enumerable:!0,value:Z})}:function(At,Z){At.default=Z};function it(At){if(At&&At.__esModule)return At;var Z={};if(At!=null)for(var J in At)J!=="default"&&Object.prototype.hasOwnProperty.call(At,J)&&F(Z,At,J);return ft(Z,At),Z}function bt(At){return At&&At.__esModule?At:{default:At}}function gt(At,Z,J,yt){if(J==="a"&&!yt)throw new TypeError("Private accessor was defined without a getter");if(typeof Z=="function"?At!==Z||!yt:!Z.has(At))throw new TypeError("Cannot read private member from an object whose class did not declare it");return J==="m"?yt:J==="a"?yt.call(At):yt?yt.value:Z.get(At)}function Xt(At,Z,J,yt,_t){if(yt==="m")throw new TypeError("Private method is not writable");if(yt==="a"&&!_t)throw new TypeError("Private accessor was defined without a setter");if(typeof Z=="function"?At!==Z||!_t:!Z.has(At))throw new TypeError("Cannot write private member to an object whose class did not declare it");return yt==="a"?_t.call(At,J):_t?_t.value=J:Z.set(At,J),J}function Ct(At,Z){if(Z===null||typeof Z!="object"&&typeof Z!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof At=="function"?Z===At:At.has(Z)}},function(z,C,x){"use strict";var k=x(4),w=x(9),T=x(34);C.a=function(L,P,p,m){m===void 0&&(m="...");var S=16,y=Object(T.a)(m,p),g=Object(k.a)(L)?L:Object(w.a)(L),A=P,E=[],D,F;if(Object(T.a)(L,p)<=P)return L;for(;D=g.substr(0,S),F=Object(T.a)(D,p),!(F+y>A&&F>A);)if(E.push(D),A-=F,g=g.substr(S),!g)return E.join("");for(;D=g.substr(0,1),F=Object(T.a)(D,p),!(F+y>A);)if(E.push(D),A-=F,g=g.substr(1),!g)return E.join("");return""+E.join("")+m}},function(z,C,x){"use strict";var k=function(){function w(){this.map={}}return w.prototype.has=function(T){return this.map[T]!==void 0},w.prototype.get=function(T,L){var P=this.map[T];return P===void 0?L:P},w.prototype.set=function(T,L){this.map[T]=L},w.prototype.clear=function(){this.map={}},w.prototype.delete=function(T){delete this.map[T]},w.prototype.size=function(){return Object.keys(this.map).length},w}();C.a=k},function(z,C){function x(p,m,S,y){y===void 0&&(y=[]);var g=this;g.w=p||0,g.h=m||0,g.y=S||0,g.x=0,g.c=y||[],g.cs=y.length,g.prelim=0,g.mod=0,g.shift=0,g.change=0,g.tl=null,g.tr=null,g.el=null,g.er=null,g.msel=0,g.mser=0}x.fromNode=function(p,m){if(!p)return null;var S=[];return p.children.forEach(function(y){S.push(x.fromNode(y,m))}),m?new x(p.height,p.width,p.x,S):new x(p.width,p.height,p.y,S)};function k(p,m,S){S?p.y+=m:p.x+=m,p.children.forEach(function(y){k(y,m,S)})}function w(p,m){var S=m?p.y:p.x;return p.children.forEach(function(y){S=Math.min(w(y,m),S)}),S}function T(p,m){var S=w(p,m);k(p,-S,m)}function L(p,m,S){S?m.y=p.x:m.x=p.x,p.c.forEach(function(y,g){L(y,m.children[g],S)})}function P(p,m,S){S===void 0&&(S=0),m?(p.x=S,S+=p.width):(p.y=S,S+=p.height),p.children.forEach(function(y){P(y,m,S)})}z.exports=function(p,m){m===void 0&&(m={});var S=m.isHorizontal;function y(tt){if(tt.cs===0){g(tt);return}y(tt.c[0]);for(var rt=H(Y(tt.c[0].el),0,null),ft=1;ftft.low&&(ft=ft.nxt);var Ct=bt+it.prelim+it.w-(Xt+gt.prelim);Ct>0&&(Xt+=Ct,E(tt,rt,ft.index,Ct));var At=Y(it),Z=Y(gt);At<=Z&&(it=F(it),it!==null&&(bt+=it.mod)),At>=Z&&(gt=D(gt),gt!==null&&(Xt+=gt.mod))}!it&>?b(tt,rt,gt,Xt):it&&!gt&&h(tt,rt,it,bt)}function E(tt,rt,ft,it){tt.c[rt].mod+=it,tt.c[rt].msel+=it,tt.c[rt].mser+=it,W(tt,rt,ft,it)}function D(tt){return tt.cs===0?tt.tl:tt.c[0]}function F(tt){return tt.cs===0?tt.tr:tt.c[tt.cs-1]}function Y(tt){return tt.y+tt.h}function b(tt,rt,ft,it){var bt=tt.c[0].el;bt.tl=ft;var gt=it-ft.mod-tt.c[0].msel;bt.mod+=gt,bt.prelim-=gt,tt.c[0].el=tt.c[rt].el,tt.c[0].msel=tt.c[rt].msel}function h(tt,rt,ft,it){var bt=tt.c[rt].er;bt.tr=ft;var gt=it-ft.mod-tt.c[rt].mser;bt.mod+=gt,bt.prelim-=gt,tt.c[rt].er=tt.c[rt-1].er,tt.c[rt].mser=tt.c[rt-1].mser}function $(tt){tt.prelim=(tt.c[0].prelim+tt.c[0].mod+tt.c[tt.cs-1].mod+tt.c[tt.cs-1].prelim+tt.c[tt.cs-1].w)/2-tt.w/2}function U(tt,rt){rt+=tt.mod,tt.x=tt.prelim+rt,V(tt);for(var ft=0;ft=ft.low;)ft=ft.nxt;return{low:tt,index:rt,nxt:ft}}P(p,S);var q=x.fromNode(p,S);return y(q),U(q,0),L(q,p,S),T(p,S),p}},function(z,C,x){function k(g,A){g.prototype=Object.create(A.prototype),g.prototype.constructor=g,w(g,A)}function w(g,A){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(D,F){return D.__proto__=F,D},w(g,A)}var T=x(11),L=x(121),P=x(17),p=x(6),m=function(g){k(A,g);function A(){return g.apply(this,arguments)||this}var E=A.prototype;return E.execute=function(){var F=this;return F.rootNode.width=0,P(F.rootNode,F.options,L)},A}(T),S={};function y(g,A){return A=p.assign({},S,A),new m(g,A).execute()}z.exports=y},function(z,C,x){var k=x(6);function w(P,p){P===void 0&&(P=0),p===void 0&&(p=[]);var m=this;m.x=m.y=0,m.leftChild=m.rightChild=null,m.height=0,m.children=p}var T={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};function L(P,p,m){m?(p.x=P.x,p.y=P.y):(p.x=P.y,p.y=P.x),P.children.forEach(function(S,y){L(S,p.children[y],m)})}z.exports=function(P,p){p===void 0&&(p={}),p=k.assign({},T,p);var m=0;function S(D){if(!D)return null;D.width=0,D.depth&&D.depth>m&&(m=D.depth);var F=D.children,Y=F.length,b=new w(D.height,[]);return F.forEach(function(h,$){var U=S(h);b.children.push(U),$===0&&(b.leftChild=U),$===Y-1&&(b.rightChild=U)}),b.originNode=D,b.isLeaf=D.isLeaf(),b}function y(D){if(D.isLeaf||D.children.length===0)D.drawingDepth=m;else{var F=D.children.map(function(b){return y(b)}),Y=Math.min.apply(null,F);D.drawingDepth=Y-1}return D.drawingDepth}var g;function A(D){D.x=D.drawingDepth*p.rankSep,D.isLeaf?(D.y=0,g&&(D.y=g.y+g.height+p.nodeSep,D.originNode.parent!==g.originNode.parent&&(D.y+=p.subTreeSep)),g=D):(D.children.forEach(function(F){A(F)}),D.y=(D.leftChild.y+D.rightChild.y)/2)}var E=S(P);return y(E),A(E),L(E,P,p.isHorizontal),P}},function(z,C,x){function k(E,D){E.prototype=Object.create(D.prototype),E.prototype.constructor=E,w(E,D)}function w(E,D){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(Y,b){return Y.__proto__=b,Y},w(E,D)}var T=x(11),L=x(123),P=x(35),p=x(6),m=["LR","RL","H"],S=m[0],y=function(E){k(D,E);function D(){return E.apply(this,arguments)||this}var F=D.prototype;return F.execute=function(){var b=this,h=b.options,$=b.rootNode;h.isHorizontal=!0;var U=h.indent,W=U===void 0?20:U,V=h.dropCap,H=V===void 0?!0:V,q=h.direction,tt=q===void 0?S:q,rt=h.align;if(tt&&m.indexOf(tt)===-1)throw new TypeError("Invalid direction: "+tt);if(tt===m[0])L($,W,H,rt);else if(tt===m[1])L($,W,H,rt),$.right2left();else if(tt===m[2]){var ft=P($,h),it=ft.left,bt=ft.right;L(it,W,H,rt),it.right2left(),L(bt,W,H,rt);var gt=it.getBoundingBox();bt.translate(gt.width,0),$.x=bt.x-$.width/2}return $},D}(T),g={};function A(E,D){return D=p.assign({},g,D),new y(E,D).execute()}z.exports=A},function(z,C,x){var k=x(6);function w(T,L,P,p,m){var S=typeof P=="function"?P(T):P*T.depth;if(!p)try{if(T.id===T.parent.children[0].id){T.x+=S,T.y=L?L.y:0;return}}catch(A){}if(T.x+=S,L){if(T.y=L.y+k.getHeight(L,T,m),L.parent&&T.parent.id!==L.parent.id){var y=L.parent,g=y.y+k.getHeight(y,T,m);T.y=g>T.y?g:T.y}}else T.y=0}z.exports=function(T,L,P,p){var m=null;T.eachNode(function(S){w(S,m,L,P,p),m=S})}},function(z,C,x){function k(g,A){g.prototype=Object.create(A.prototype),g.prototype.constructor=g,w(g,A)}function w(g,A){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(D,F){return D.__proto__=F,D},w(g,A)}var T=x(11),L=x(125),P=x(17),p=x(6),m=function(g){k(A,g);function A(){return g.apply(this,arguments)||this}var E=A.prototype;return E.execute=function(){var F=this;return P(F.rootNode,F.options,L)},A}(T),S={};function y(g,A){return A=p.assign({},S,A),new m(g,A).execute()}z.exports=y},function(z,C,x){var k=x(6);function w(P,p){var m=0;return P.children.length?P.children.forEach(function(S){m+=w(S,p)}):m=P.height,P._subTreeSep=p.getSubTreeSep(P.data),P.totalHeight=Math.max(P.height,m)+2*P._subTreeSep,P.totalHeight}function T(P){var p=P.children,m=p.length;if(m){p.forEach(function(D){T(D)});var S=p[0],y=p[m-1],g=y.y-S.y+y.height,A=0;if(p.forEach(function(D){A+=D.totalHeight}),g>P.height)P.y=S.y+g/2-P.height/2;else if(p.length!==1||P.height>A){var E=P.y+(P.height-g)/2-S.y;p.forEach(function(D){D.translate(0,E)})}else P.y=(S.y+S.height/2+y.y+y.height/2)/2-P.height/2}}var L={getSubTreeSep:function(){return 0}};z.exports=function(P,p){p===void 0&&(p={}),p=k.assign({},L,p),P.parent={x:0,width:0,height:0,y:0},P.BFTraverse(function(m){m.x=m.parent.x+m.parent.width}),P.parent=null,w(P,p),P.startY=0,P.y=P.totalHeight/2-P.height/2,P.eachNode(function(m){var S=m.children,y=S.length;if(y){var g=S[0];if(g.startY=m.startY+m._subTreeSep,y===1)g.y=m.y+m.height/2-g.height/2;else{g.y=g.startY+g.totalHeight/2-g.height/2;for(var A=1;Ag?1:0}var p=function(m){x(S,m);function S(y){var g=m.call(this)||this;return g.radius=null,g.nodeSize=void 0,g.startRadius=null,g.endRadius=null,g.startAngle=0,g.endAngle=2*Math.PI,g.clockwise=!0,g.divisions=1,g.ordering=null,g.angleRatio=1,g.nodes=[],g.edges=[],g.nodeMap={},g.degrees=[],g.width=300,g.height=300,g.updateCfg(y),g}return S.prototype.getDefaultCfg=function(){return{radius:null,startRadius:null,endRadius:null,startAngle:0,endAngle:2*Math.PI,clockwise:!0,divisions:1,ordering:null,angleRatio:1}},S.prototype.execute=function(){var y,g=this,A=g.nodes,E=g.edges,D=A.length;if(D===0){g.onLayoutEnd&&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 F=g.center;if(D===1){A[0].x=F[0],A[0].y=F[1],g.onLayoutEnd&&g.onLayoutEnd();return}var Y=g.radius,b=g.startRadius,h=g.endRadius,$=g.divisions,U=g.startAngle,W=g.endAngle,V=g.angleRatio,H=g.ordering,q=g.clockwise,tt=g.nodeSpacing,rt=g.nodeSize,ft=(W-U)/D,it={};A.forEach(function(It,Pt){it[It.id]=Pt}),g.nodeMap=it;var bt=(0,w.getDegree)(A.length,it,E);if(g.degrees=bt,tt){var gt=(0,w.getFuncByUnknownType)(10,tt),Xt=(0,w.getFuncByUnknownType)(10,rt),Ct=-1/0;A.forEach(function(It){var Pt=Xt(It);Ctg.width?g.width/2:g.height/2:!b&&h?b=h:b&&!h&&(h=b);var Z=ft*V,J=[];H==="topology"?J=g.topologyOrdering():H==="topology-directed"?J=g.topologyOrdering(!0):H==="degree"?J=g.degreeOrdering():J=A;for(var yt=Math.ceil(D/$),_t=0;_t=0;Xt--)gt(Xt);return{nodes:A,edges:E,combos:D,comboEdges:F}},S.prototype.getInnerGraphs=function(y){var g=this,A=g.comboTrees,E=g.nodeSize,D=g.edges,F=g.comboPadding,Y=g.spacing,b={},h=this.innerLayout||new P.ConcentricLayout({type:"concentric",sortBy:"id"});return h.center=[0,0],h.preventOverlap=!0,h.nodeSpacing=Y,(A||[]).forEach(function($){(0,L.traverseTreeUp)($,function(U){var W,V=(F==null?void 0:F(U))||10;if((0,L.isArray)(V)&&(V=Math.max.apply(Math,V)),!((W=U.children)===null||W===void 0)&&W.length){var q=U.children.map(function(yt){if(yt.itemType==="combo")return b[yt.id];var _t=y[yt.id]||{};return k(k({},_t),yt)}),tt=q.map(function(yt){return yt.id}),rt={nodes:q,edges:D.filter(function(yt){return tt.includes(yt.source)&&tt.includes(yt.target)})},ft=1/0;q.forEach(function(yt){var _t;yt.size||(yt.size=((_t=b[yt.id])===null||_t===void 0?void 0:_t.size)||(E==null?void 0:E(yt))||[30,30]),(0,L.isNumber)(yt.size)&&(yt.size=[yt.size,yt.size]),ft>yt.size[0]&&(ft=yt.size[0]),ft>yt.size[1]&&(ft=yt.size[1])}),h.layout(rt);var it=(0,L.getLayoutBBox)(q),bt=it.minX,gt=it.minY,Xt=it.maxX,Ct=it.maxY,At={x:(Xt+bt)/2,y:(Ct+gt)/2};rt.nodes.forEach(function(yt){yt.x-=At.x,yt.y-=At.y});var Z=Math.max(Xt-bt,ft)+V*2,J=Math.max(Ct-gt,ft)+V*2;b[U.id]={id:U.id,nodes:q,size:[Z,J]}}else if(U.itemType==="combo"){var H=V?[V*2,V*2]:[30,30];b[U.id]={id:U.id,nodes:[],size:H}}return!0})}),b},S.prototype.initVals=function(){var y=this,g=y.nodeSize,A=y.spacing,E,D;if((0,L.isNumber)(A)?D=function(){return A}:(0,L.isFunction)(A)?D=A:D=function(){return 0},this.spacing=D,!g)E=function(U){var W=D(U);if(U.size){if((0,L.isArray)(U.size)){var V=U.size[0]>U.size[1]?U.size[0]:U.size[1];return(V+W)/2}if((0,L.isObject)(U.size)){var V=U.size.width>U.size.height?U.size.width:U.size.height;return(V+W)/2}return(U.size+W)/2}return 10+W/2};else if((0,L.isFunction)(g))E=function(U){var W=g(U),V=D(U);if((0,L.isArray)(U.size)){var H=U.size[0]>U.size[1]?U.size[0]:U.size[1];return(H+V)/2}return((W||10)+V)/2};else if((0,L.isArray)(g)){var F=g[0]>g[1]?g[0]:g[1],Y=F/2;E=function(U){return Y+D(U)/2}}else{var b=g/2;E=function(U){return b+D(U)/2}}this.nodeSize=E;var h=y.comboPadding,$;(0,L.isNumber)(h)?$=function(){return h}:(0,L.isArray)(h)?$=function(){return Math.max.apply(null,h)}:(0,L.isFunction)(h)?$=h:$=function(){return 0},this.comboPadding=$},S.prototype.getType=function(){return"comboCombined"},S}(T.Base);z.ComboCombinedLayout=p},366590:function(Ve,z,C){"use strict";var x=this&&this.__extends||function(){var L=function(P,p){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,S){m.__proto__=S}||function(m,S){for(var y in S)Object.prototype.hasOwnProperty.call(S,y)&&(m[y]=S[y])},L(P,p)};return function(P,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");L(P,p);function m(){this.constructor=P}P.prototype=p===null?Object.create(p):(m.prototype=p.prototype,new m)}}();Object.defineProperty(z,"__esModule",{value:!0}),z.ComboForceLayout=void 0;var k=C(762329),w=C(449784),T=function(L){x(P,L);function P(p){var m=L.call(this)||this;return m.center=[0,0],m.maxIteration=100,m.gravity=10,m.comboGravity=10,m.linkDistance=10,m.alpha=1,m.alphaMin=.001,m.alphaDecay=1-Math.pow(m.alphaMin,1/300),m.alphaTarget=0,m.velocityDecay=.6,m.edgeStrength=.6,m.nodeStrength=30,m.preventOverlap=!1,m.preventNodeOverlap=!1,m.preventComboOverlap=!1,m.collideStrength=void 0,m.nodeCollideStrength=.5,m.comboCollideStrength=.5,m.comboSpacing=20,m.comboPadding=10,m.optimizeRangeFactor=1,m.onTick=function(){},m.onLayoutEnd=function(){},m.depthAttractiveForceScale=1,m.depthRepulsiveForceScale=2,m.nodes=[],m.edges=[],m.combos=[],m.comboTrees=[],m.width=300,m.height=300,m.bias=[],m.nodeMap={},m.oriComboMap={},m.indexMap={},m.comboMap={},m.previousLayouted=!1,m.updateCfg(p),m}return P.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}},P.prototype.execute=function(){var p=this,m=p.nodes,S=p.center;if(p.comboTree={id:"comboTreeRoot",depth:-1,children:p.comboTrees},!m||m.length===0){p.onLayoutEnd&&p.onLayoutEnd();return}if(m.length===1){m[0].x=S[0],m[0].y=S[1],p.onLayoutEnd&&p.onLayoutEnd();return}p.initVals(),p.run(),p.onLayoutEnd&&p.onLayoutEnd()},P.prototype.run=function(){var p=this,m=p.nodes,S=p.previousLayouted?p.maxIteration/5:p.maxIteration;!p.width&&typeof window!="undefined"&&(p.width=window.innerWidth),!p.height&&typeof window!="undefined"&&(p.height=window.innerHeight);var y=p.center,g=p.velocityDecay,A=p.comboMap;p.previousLayouted||p.initPos(A);for(var E=function(b){var h=[];m.forEach(function($,U){h[U]={x:0,y:0}}),p.applyCalculate(h),p.applyComboCenterForce(h),m.forEach(function($,U){!(0,w.isNumber)($.x)||!(0,w.isNumber)($.y)||($.x+=h[U].x*g,$.y+=h[U].y*g)}),p.alpha+=(p.alphaTarget-p.alpha)*p.alphaDecay,p.onTick()},D=0;Dnt.size[1]?nt.size[0]:nt.size[1];return vt/2}if((0,w.isObject)(nt.size)){var vt=nt.size.width>nt.size.height?nt.size.width:nt.size.height;return vt/2}return nt.size/2}return 10};else if((0,w.isFunction)(W))H=function(nt){return W(nt)};else if((0,w.isArray)(W)){var tt=W[0]>W[1]?W[0]:W[1],rt=tt/2;H=function(nt){return rt}}else{var ft=W/2;H=function(nt){return ft}}this.nodeSize=H;var it=p.comboSpacing,bt;(0,w.isNumber)(it)?bt=function(){return it}:(0,w.isFunction)(it)?bt=it:bt=function(){return 0},this.comboSpacing=bt;var gt=p.comboPadding,Xt;(0,w.isNumber)(gt)?Xt=function(){return gt}:(0,w.isArray)(gt)?Xt=function(){return Math.max.apply(null,gt)}:(0,w.isFunction)(gt)?Xt=gt:Xt=function(){return 0},this.comboPadding=Xt;var Ct=this.linkDistance,At;Ct||(Ct=10),(0,w.isNumber)(Ct)?At=function(nt){return Ct}:At=Ct,this.linkDistance=At;var Z=this.edgeStrength,J;Z||(Z=1),(0,w.isNumber)(Z)?J=function(nt){return Z}:J=Z,this.edgeStrength=J;var yt=this.nodeStrength,_t;yt||(yt=30),(0,w.isNumber)(yt)?_t=function(nt){return yt}:_t=yt,this.nodeStrength=_t},P.prototype.initPos=function(p){var m=this,S=m.nodes;S.forEach(function(y,g){var A=y.comboId,E=p[A];A&&E?(y.x=E.cx+100/(g+1),y.y=E.cy+100/(g+1)):(y.x=100/(g+1),y.y=100/(g+1))})},P.prototype.getComboMap=function(){var p=this,m=p.nodeMap,S=p.comboTrees,y=p.oriComboMap,g={};return(S||[]).forEach(function(A){var E=[];(0,w.traverseTreeUp)(A,function(D){if(D.itemType==="node"||!y[D.id])return!0;if(g[D.id]===void 0){var F={id:D.id,name:D.id,cx:0,cy:0,count:0,depth:p.oriComboMap[D.id].depth||0,children:[]};g[D.id]=F}var Y=D.children;Y&&Y.forEach(function($){if(!g[$.id]&&!m[$.id])return!0;E.push($)});var b=g[D.id];if(b.cx=0,b.cy=0,E.length===0){b.empty=!0;var h=y[D.id];b.cx=h.x,b.cy=h.y}return E.forEach(function($){if(b.count++,$.itemType!=="node"){var U=g[$.id];(0,w.isNumber)(U.cx)&&(b.cx+=U.cx),(0,w.isNumber)(U.cy)&&(b.cy+=U.cy);return}var W=m[$.id];W&&((0,w.isNumber)(W.x)&&(b.cx+=W.x),(0,w.isNumber)(W.y)&&(b.cy+=W.y))}),b.cx/=b.count||1,b.cy/=b.count||1,b.children=E,!0})}),g},P.prototype.applyComboCenterForce=function(p){var m=this,S=m.gravity,y=m.comboGravity||S,g=this.alpha,A=m.comboTrees,E=m.indexMap,D=m.nodeMap,F=m.comboMap;(A||[]).forEach(function(Y){(0,w.traverseTreeUp)(Y,function(b){if(b.itemType==="node")return!0;var h=F[b.id];if(!h)return!0;var $=F[b.id],U=($.depth+1)/10*.5,W=$.cx,V=$.cy;return $.cx=0,$.cy=0,$.children.forEach(function(H){if(H.itemType!=="node"){var q=F[H.id];q&&(0,w.isNumber)(q.cx)&&($.cx+=q.cx),q&&(0,w.isNumber)(q.cy)&&($.cy+=q.cy);return}var tt=D[H.id],rt=tt.x-W||.005,ft=tt.y-V||.005,it=Math.sqrt(rt*rt+ft*ft),bt=E[tt.id],gt=y*g/it*U;p[bt].x-=rt*gt,p[bt].y-=ft*gt,(0,w.isNumber)(tt.x)&&($.cx+=tt.x),(0,w.isNumber)(tt.y)&&($.cy+=tt.y)}),$.cx/=$.count||1,$.cy/=$.count||1,!0})})},P.prototype.applyCalculate=function(p){var m=this,S=m.comboMap,y=m.nodes,g={};y.forEach(function(E,D){y.forEach(function(F,Y){if(!(Dq&&(b.minX=q),b.minY>tt&&(b.minY=tt),b.maxX1&&F.forEach(function(Y,b){if(Y.itemType==="node")return!1;var h=m[Y.id];h&&F.forEach(function($,U){if(b<=U||$.itemType==="node")return!1;var W=m[$.id];if(!W)return!1;var V=h.cx-W.cx||.005,H=h.cy-W.cy||.005,q=V*V+H*H,tt=h.r||1,rt=W.r||1,ft=tt+rt,it=rt*rt,bt=tt*tt;if(qg)){var Xt=m["".concat(U.id,"-").concat(rt.id)],Ct=Xt.vx,At=Xt.vy,Z=Math.log(Math.abs(rt.depth-U.depth)/10)+1||1;Z=Z<1?1:Z,rt.comboId!==U.comboId&&(Z+=1);var J=Z?Math.pow(h,Z):1,yt=A(rt)*E/bt*J;if(p[W].x+=Ct*yt,p[W].y+=At*yt,W0){var J=Math.abs(H[0][S.sortBy]-Z[S.sortBy]);S.maxLevelDiff&&J>=S.maxLevelDiff&&(H=[],V.push(H))}H.push(Z)});var q=b+(h||S.minNodeSpacing);if(!S.preventOverlap){var tt=V.length>0&&V[0].length>1,rt=Math.min(S.width,S.height)/2-q,ft=rt/(V.length+(tt?1:0));q=Math.min(q,ft)}var it=0;if(V.forEach(function(Z){var J=S.sweep;J===void 0&&(J=2*Math.PI-2*Math.PI/Z.length);var yt=Z.dTheta=J/Math.max(1,Z.length-1);if(Z.length>1&&S.preventOverlap){var _t=Math.cos(yt)-Math.cos(0),nt=Math.sin(yt)-Math.sin(0),vt=Math.sqrt(q*q/(_t*_t+nt*nt));it=Math.max(vt,it)}Z.r=it,it+=q}),S.equidistant){for(var bt=0,gt=0,Xt=0;Xt$e.x&&(It=$e.x),Pt>$e.y&&(Pt=$e.y)}),it.edges().forEach(function(xr){var $e,Tr=it.edge(xr);($e=Tr.points)===null||$e===void 0||$e.forEach(function(qr){It>qr.x&&(It=qr.x),Pt>qr.y&&(Pt=qr.y)})}),vt[0]=W[0]-It,vt[1]=W[1]-Pt}var St=$==="LR"||$==="RL";if(V){var Dt=this,Qt=Dt.focusNode,ue=Dt.ranksep,ie=Dt.getRadialPos,Lt=(0,T.isString)(Qt)?Qt:Qt==null?void 0:Qt.id,ne=Lt?(F=it.node(Lt))===null||F===void 0?void 0:F._rank:0,ve=[],Wt=St?"y":"x",ae=St?"height":"width",Ce=1/0,xe=-1/0;it.nodes().forEach(function(xr){var $e=it.node(xr);if(Y.nodeMap[xr]){var Tr=Z(Y.nodeMap[xr]);if(ne===0)ve[$e._rank]||(ve[$e._rank]={nodes:[],totalWidth:0,maxSize:-1/0}),ve[$e._rank].nodes.push(xr),ve[$e._rank].totalWidth+=Tr*2+$e[ae],ve[$e._rank].maxSizexe&&(xe=Rn)}});var Jt=ue||50,we={},Tt=(xe-Ce)/.9,Pe=[(Ce+xe-Tt)*.5,(Ce+xe+Tt)*.5],_r=function(xr,$e,Tr,qr){Tr===void 0&&(Tr=-1/0),qr===void 0&&(qr=[0,1]);var gn=Tr;return xr.forEach(function(xn){var Rn=it.node(xn);we[xn]=$e;var Mr=ie(Rn[Wt],Pe,Tt,$e,qr),dn=Mr.x,hn=Mr.y;if(Y.nodeMap[xn]){Y.nodeMap[xn].x=dn+vt[0],Y.nodeMap[xn].y=hn+vt[1],Y.nodeMap[xn]._order=Rn._order;var sn=At(Y.nodeMap[xn]);gn=gn})}:function(xr,$e,Tr){var qr=Math.max($e.x,Tr.x),gn=Math.min($e.x,Tr.x);return xr.filter(function(xn){return xn.x<=qr&&xn.x>=gn})};it.edges().forEach(function(xr){var $e,Tr=it.edge(xr),qr=ft.findIndex(function(Rn){var Mr=(0,T.getEdgeTerminal)(Rn,"source"),dn=(0,T.getEdgeTerminal)(Rn,"target");return Mr===xr.v&&dn===xr.w});if(!(qr<=-1)&&Y.edgeLabelSpace&&Y.controlPoints&&ft[qr].type!=="loop"){($e=Tr==null?void 0:Tr.points)===null||$e===void 0||$e.forEach(function(Rn){Rn.x+=vt[0],Rn.y+=vt[1]});var gn=Y.nodeMap[xr.v],xn=Y.nodeMap[xr.w];ft[qr].controlPoints=m(Tr==null?void 0:Tr.points,gn,xn,Dn,St,Un,Xn)}})}return Y.onLayoutEnd&&Y.onLayoutEnd(),{nodes:b,edges:ft}}},y.prototype.getRadialPos=function(g,A,E,D,F){F===void 0&&(F=[0,1]);var Y=(g-A[0])/E;Y=Y*(F[1]-F[0])+F[0];var b=Y*2*Math.PI;return{x:Math.cos(b)*D,y:Math.sin(b)*D}},y.prototype.getType=function(){return"dagre"},y}(L.Base);z.DagreLayout=p;var m=function(S,y,g,A,E,D,F){var Y=(S==null?void 0:S.slice(1,S.length-1))||[];if(y&&g){var b=y.x,h=y.y,$=g.x,U=g.y;if(E&&(b=y.y,h=y.x,$=g.y,U=g.x),U!==h&&b!==$){var W=A.indexOf(h),V=A[W+1];if(V){var H=Y[0],q=E?{x:(h+V)/2,y:(H==null?void 0:H.y)||$}:{x:(H==null?void 0:H.x)||$,y:(h+V)/2};(!H||D(H,q))&&Y.unshift(q)}var tt=A.indexOf(U),rt=Math.abs(tt-W);if(rt===1)Y=F(Y,y,g),Y.length||Y.push(E?{x:(h+U)/2,y:b}:{x:b,y:(h+U)/2});else if(rt>1){var ft=A[tt-1];if(ft){var it=Y[Y.length-1],bt=E?{x:(U+ft)/2,y:(it==null?void 0:it.y)||$}:{x:(it==null?void 0:it.x)||b,y:(U+ft)/2};(!it||D(it,bt))&&Y.push(bt)}}}}return Y}},627652:function(Ve,z,C){"use strict";var x=this&&this.__extends||function(){var T=function(L,P){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,m){p.__proto__=m}||function(p,m){for(var S in m)Object.prototype.hasOwnProperty.call(m,S)&&(p[S]=m[S])},T(L,P)};return function(L,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");T(L,P);function p(){this.constructor=L}L.prototype=P===null?Object.create(P):(p.prototype=P.prototype,new p)}}();Object.defineProperty(z,"__esModule",{value:!0}),z.Graph=void 0;var k=C(199905),w=function(T){x(L,T);function L(){return T!==null&&T.apply(this,arguments)||this}return L}(k.Graph);z.Graph=w},441106:function(Ve,z,C){"use strict";var x=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(z,"__esModule",{value:!0});var k=x(C(265236)),w=C(269209);z.default={layout:k.default,util:{time:w.time,notime:w.notime}}},178029:function(Ve,z,C){"use strict";var x=this&&this.__importDefault||function(P){return P&&P.__esModule?P:{default:P}};Object.defineProperty(z,"__esModule",{value:!0});var k=x(C(40773)),w=function(P){var p=function(S){return function(y){var g;return((g=S.edge(y))===null||g===void 0?void 0:g.weight)||1}},m=P.graph().acyclicer==="greedy"?(0,k.default)(P,p(P)):T(P);m==null||m.forEach(function(S){var y=P.edge(S);P.removeEdgeObj(S),y.forwardName=S.name,y.reversed=!0,P.setEdge(S.w,S.v,y,"rev-".concat(Math.random()))})},T=function(P){var p=[],m={},S={},y=function(g){var A;S[g]||(S[g]=!0,m[g]=!0,(A=P.outEdges(g))===null||A===void 0||A.forEach(function(E){m[E.w]?p.push(E):y(E.w)}),delete m[g])};return P.nodes().forEach(y),p},L=function(P){P.edges().forEach(function(p){var m=P.edge(p);if(m.reversed){P.removeEdgeObj(p);var S=m.forwardName;delete m.reversed,delete m.forwardName,P.setEdge(p.w,p.v,m,S)}})};z.default={run:w,undo:L}},111500:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0});var x=C(269209),k=function(T){var L,P=function(p){var m=T.children(p),S=T.node(p);if(m!=null&&m.length&&m.forEach(function(A){return P(A)}),S.hasOwnProperty("minRank")){S.borderLeft=[],S.borderRight=[];for(var y=S.minRank,g=S.maxRank+1;y0;--U)if($=D[U].dequeue(),$){Y=Y.concat(y(E,D,F,$,!0));break}}}return Y},y=function(E,D,F,Y,b){var h,$,U=[];return(h=E.inEdges(Y.v))===null||h===void 0||h.forEach(function(W){var V=E.edge(W),H=E.node(W.v);b&&U.push({v:W.v,w:W.w,in:0,out:0}),H.out===void 0&&(H.out=0),H.out-=V,A(D,F,H)}),($=E.outEdges(Y.v))===null||$===void 0||$.forEach(function(W){var V=E.edge(W),H=W.w,q=E.node(H);q.in===void 0&&(q.in=0),q.in-=V,A(D,F,q)}),E.removeNode(Y.v),b?U:void 0},g=function(E,D){var F=new P,Y=0,b=0;E.nodes().forEach(function(V){F.setNode(V,{v:V,in:0,out:0})}),E.edges().forEach(function(V){var H=F.edge(V)||0,q=(D==null?void 0:D(V))||1,tt=H+q;F.setEdge(V.v,V.w,tt),b=Math.max(b,F.node(V.v).out+=q),Y=Math.max(Y,F.node(V.w).in+=q)});for(var h=[],$=b+Y+3,U=0;U<$;U++)h.push(new L);var W=Y+1;return F.nodes().forEach(function(V){A(h,W,F.node(V))}),{buckets:h,zeroIdx:W,graph:F}},A=function(E,D,F){F.out?F.in?E[F.out-F.in+D].enqueue(F):E[E.length-1].enqueue(F):E[0].enqueue(F)};z.default=m},265236:function(Ve,z,C){"use strict";var x=this&&this.__assign||function(){return x=Object.assign||function(St){for(var Dt,Qt=1,ue=arguments.length;Qt0;)F%2&&(Y+=A[F+1]),F=F-1>>1,A[F]+=D.weight;E+=D.weight*Y}}),E},w=function(T,L){for(var P=0,p=1;p<(L==null?void 0:L.length);p+=1)P+=k(T,L[p-1],L[p]);return P};z.default=w},819597:function(Ve,z,C){"use strict";var x=this&&this.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(z,"__esModule",{value:!0});var k=x(C(115697)),w=x(C(632957)),T=x(C(277006)),L=x(C(680314)),P=x(C(99455)),p=C(449784),m=C(627652),S=C(269209),y=function(D,F){for(var Y=(0,S.maxRank)(D),b=[],h=[],$=1;$-1;$--)h.push($);var U=g(D,b,"inEdges"),W=g(D,h,"outEdges"),V=(0,k.default)(D);E(D,V);for(var H=Number.POSITIVE_INFINITY,q,$=0,tt=0;tt<4;++$,++tt){A($%2?U:W,$%4>=2,!1,F),V=(0,S.buildLayerMatrix)(D);var rt=(0,w.default)(D,V);rt=2,!0,F),V=(0,S.buildLayerMatrix)(D);var rt=(0,w.default)(D,V);rt=A.barycenter)&&k(A,E)}},m=function(A){return function(E){E.in.push(A),--E.indegree===0&&w.push(E)}},S=function(){var A=w.pop();P.push(A),(T=A.in.reverse())===null||T===void 0||T.forEach(function(E){return p(A)(E)}),(L=A.out)===null||L===void 0||L.forEach(function(E){return m(A)(E)})};w!=null&&w.length;)S();var y=P.filter(function(A){return!A.merged}),g=["vs","i","barycenter","weight"];return y.map(function(A){var E={};return g==null||g.forEach(function(D){A[D]!==void 0&&(E[D]=A[D])}),E})},k=function(w,T){var L,P=0,p=0;w.weight&&(P+=w.barycenter*w.weight,p+=w.weight),T.weight&&(P+=T.barycenter*T.weight,p+=T.weight),w.vs=(L=T.vs)===null||L===void 0?void 0:L.concat(w.vs),w.barycenter=P/p,w.weight=p,w.i=Math.min(T.i,w.i),T.merged=!0};z.default=C},99455:function(Ve,z,C){"use strict";var x=this&&this.__importDefault||function(m){return m&&m.__esModule?m:{default:m}};Object.defineProperty(z,"__esModule",{value:!0});var k=x(C(989921)),w=x(C(707043)),T=x(C(421498)),L=function(m,S,y,g,A,E){var D,F,Y,b,h=m.children(S),$=m.node(S),U=$?$.borderLeft:void 0,W=$?$.borderRight:void 0,V={};U&&(h=h==null?void 0:h.filter(function(it){return it!==U&&it!==W}));var H=(0,k.default)(m,h||[]);H==null||H.forEach(function(it){var bt;if(!((bt=m.children(it.v))===null||bt===void 0)&&bt.length){var gt=L(m,it.v,y,g,E);V[it.v]=gt,gt.hasOwnProperty("barycenter")&&p(it,gt)}});var q=(0,w.default)(H,y);P(q,V),(D=q.filter(function(it){return it.vs.length>0}))===null||D===void 0||D.forEach(function(it){var bt=m.node(it.vs[0]);bt&&(it.fixorder=bt.fixorder,it.order=bt.order)});var tt=(0,T.default)(q,g,A,E);if(U&&(tt.vs=[U,tt.vs,W].flat(),!((F=m.predecessors(U))===null||F===void 0)&&F.length)){var rt=m.node(((Y=m.predecessors(U))===null||Y===void 0?void 0:Y[0])||""),ft=m.node(((b=m.predecessors(W))===null||b===void 0?void 0:b[0])||"");tt.hasOwnProperty("barycenter")||(tt.barycenter=0,tt.weight=0),tt.barycenter=(tt.barycenter*tt.weight+rt.order+ft.order)/(tt.weight+2),tt.weight+=2}return tt},P=function(m,S){m==null||m.forEach(function(y){var g,A=(g=y.vs)===null||g===void 0?void 0:g.map(function(E){return S[E]?S[E].vs:E});y.vs=A.flat()})},p=function(m,S){m.barycenter!==void 0?(m.barycenter=(m.barycenter*m.weight+S.barycenter*S.weight)/(m.weight+S.weight),m.weight+=S.weight):(m.barycenter=S.barycenter,m.weight=S.weight)};z.default=L},421498:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0});var x=C(269209),k=function(L,P,p,m){var S=(0,x.partition)(L,function(b){var h=b.hasOwnProperty("fixorder")&&!isNaN(b.fixorder);return m?!h&&b.hasOwnProperty("barycenter"):h||b.hasOwnProperty("barycenter")}),y=S.lhs,g=S.rhs.sort(function(b,h){return-b.i- -h.i}),A=[],E=0,D=0,F=0;y==null||y.sort(T(!!P,!!p)),F=w(A,g,F),y==null||y.forEach(function(b){var h;F+=(h=b.vs)===null||h===void 0?void 0:h.length,A.push(b.vs),E+=b.barycenter*b.weight,D+=b.weight,F=w(A,g,F)});var Y={vs:A.flat()};return D&&(Y.barycenter=E/D,Y.weight=D),Y},w=function(L,P,p){for(var m=p,S;P.length&&(S=P[P.length-1]).i<=m;)P.pop(),L==null||L.push(S.vs),m++;return m},T=function(L,P){return function(p,m){if(p.fixorder!==void 0&&m.fixorder!==void 0)return p.fixorder-m.fixorder;if(p.barycenterm.barycenter)return 1;if(P&&p.order!==void 0&&m.order!==void 0){if(p.orderm.order)return 1}return L?m.i-p.i:p.i-m.i}};z.default=k},933562:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0});var C=function(w){var T,L={},P=0,p=function(m){var S,y=P;(S=w.children(m))===null||S===void 0||S.forEach(p),L[m]={low:y,lim:P++}};return(T=w.children())===null||T===void 0||T.forEach(p),L},x=function(w,T,L,P){var p=[],m=[],S=Math.min(T[L].low,T[P].low),y=Math.max(T[L].lim,T[P].lim),g,A;g=L;do g=w.parent(g),p.push(g);while(g&&(T[g].low>S||y>T[g].lim));for(A=g,g=P;g&&g!==A;)m.push(g),g=w.parent(g);return{lca:A,path:p.concat(m.reverse())}},k=function(w){var T,L=C(w);(T=w.graph().dummyChains)===null||T===void 0||T.forEach(function(P){var p,m,S=P,y=w.node(S),g=y.edgeObj;if(g)for(var A=x(w,L,g.v,g.w),E=A.path,D=A.lca,F=0,Y=E[F],b=!0;S!==g.w;){if(y=w.node(S),b){for(;Y!==D&&((p=w.node(Y))===null||p===void 0?void 0:p.maxRank)Xt)&&(0,z.addConflict)(V,yt,Z)}))}function q(ft){return JSON.stringify(ft.slice(1))}function tt(ft,it){var bt=q(ft);it.get(bt)||(H.apply(void 0,ft),it.set(bt,!0))}var rt=function(ft,it){var bt=-1,gt,Xt=0,Ct=new Map;return it==null||it.forEach(function(At,Z){var J;if(((J=U.node(At))===null||J===void 0?void 0:J.dummy)==="border"){var yt=U.predecessors(At)||[];yt.length&&(gt=U.node(yt[0]).order,tt([it,Xt,Z,bt,gt],Ct),Xt=Z,bt=gt)}tt([it,Xt,it.length,gt,ft.length],Ct)}),it};return W!=null&&W.length&&W.reduce(rt),V};z.findType2Conflicts=p;var m=function(U,W){var V,H;if(!((V=U.node(W))===null||V===void 0)&&V.dummy)return(H=U.predecessors(W))===null||H===void 0?void 0:H.find(function(q){return U.node(q).dummy})};z.findOtherInnerSegmentNode=m;var S=function(U,W,V){var H=W,q=V;if(H>q){var tt=H;H=q,q=tt}var rt=U[H];rt||(U[H]=rt={}),rt[q]=!0};z.addConflict=S;var y=function(U,W,V){var H=W,q=V;if(H>q){var tt=W;H=q,q=tt}return!!U[H]};z.hasConflict=y;var g=function(U,W,V,H){var q={},tt={},rt={};return W==null||W.forEach(function(ft){ft==null||ft.forEach(function(it,bt){q[it]=it,tt[it]=it,rt[it]=bt})}),W==null||W.forEach(function(ft){var it=-1;ft==null||ft.forEach(function(bt){var gt=H(bt);if(gt.length){gt=gt.sort(function(J,yt){return rt[J]-rt[yt]});for(var Xt=(gt.length-1)/2,Ct=Math.floor(Xt),At=Math.ceil(Xt);Ct<=At;++Ct){var Z=gt[Ct];tt[bt]===bt&&ittt.lim&&(rt=tt,ft=!0);var it=U.edges().filter(function(bt){return ft===h($,$.node(bt.v),rt)&&ft!==h($,$.node(bt.w),rt)});return(0,w.minBy)(it,function(bt){return(0,k.slack)(U,bt)})};z.enterEdge=D;var F=function($,U,W,V){var H=W.v,q=W.w;$.removeEdge(H,q),$.setEdge(V.v,V.w,{}),(0,z.initLowLimValues)($),(0,z.initCutValues)($,U),Y($,U)};z.exchangeEdges=F;var Y=function($,U){var W=$.nodes().find(function(H){var q;return!(!((q=U.node(H))===null||q===void 0)&&q.parent)}),V=L($,W);V=V==null?void 0:V.slice(1),V==null||V.forEach(function(H){var q=$.node(H).parent,tt=U.edgeFromArgs(H,q),rt=!1;tt||(tt=U.edgeFromArgs(q,H),rt=!0),U.node(H).rank=U.node(q).rank+(rt?tt.minlen:-tt.minlen)})},b=function($,U,W){return $.hasEdge(U,W)},h=function($,U,W){return W.low<=U.lim&&U.lim<=W.lim};z.default=p},337323:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.slack=z.longestPathWithLayer=z.longestPath=void 0;var C=function(w){var T,L={},P=function(p){var m,S=w.node(p);if(!S)return 0;if(L[p])return S.rank;L[p]=!0;var y;return(m=w.outEdges(p))===null||m===void 0||m.forEach(function(g){var A=P(g.w),E=w.edge(g).minlen,D=A-E;D&&(y===void 0||DMath.abs(q)*ft?(tt<0&&(ft=-ft),it=ft*q/tt,bt=ft):(q<0&&(rt=-rt),it=rt,bt=rt*tt/q),{x:V+it,y:H+bt}};z.intersectRect=y;var g=function(U){for(var W=[],V=(0,z.maxRank)(U)+1,H=0;HW)&&(W=q)}),W||(W=0),W};z.maxRank=F;var Y=function(U,W){var V={lhs:[],rhs:[]};return U==null||U.forEach(function(H){W(H)?V.lhs.push(H):V.rhs.push(H)}),V};z.partition=Y;var b=function(U,W){var V=Date.now();try{return W()}finally{console.log("".concat(U," time: ").concat(Date.now()-V,"ms"))}};z.time=b;var h=function(U,W){return W()};z.notime=h;var $=function(U,W){return U.reduce(function(V,H){var q=W(V),tt=W(H);return q>tt?H:V})};z.minBy=$},177057:function(Ve,z,C){"use strict";var x=this&&this.__extends||function(){var m=function(S,y){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,A){g.__proto__=A}||function(g,A){for(var E in A)Object.prototype.hasOwnProperty.call(A,E)&&(g[E]=A[E])},m(S,y)};return function(S,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");m(S,y);function g(){this.constructor=S}S.prototype=y===null?Object.create(y):(g.prototype=y.prototype,new g)}}(),k=this&&this.__assign||function(){return k=Object.assign||function(m){for(var S,y=1,g=arguments.length;yb.x&&(F=b.x),Y>b.y&&(Y=b.y)}),g.forEach(function(b){b.points.forEach(function(h){F>h.x&&(F=h.x),Y>h.y&&(Y=h.y)})}),D[0]=E[0]-F,D[1]=E[1]-Y}return D},S.prototype.updateNodePosition=function(y,g){var A=this,E=A.combos,D=A.nodes,F=A.edges,Y=A.anchorPoint,b=A.graphSettings,h=this.getBegin(y,g);y.forEach(function($){var U,W=$.x,V=$.y,H=$.id,q=$.type,tt=$.coreBox;if(q===L.HierarchyNodeType.META&&H!==L.ROOT_NAME){var rt=E.findIndex(function(Xt){return Xt.id===H}),ft=(U=b==null?void 0:b.subScene)===null||U===void 0?void 0:U.meta;E[rt].offsetX=W+h[0],E[rt].offsetY=V+h[1],E[rt].fixSize=[tt.width,tt.height],E[rt].fixCollapseSize=[tt.width,tt.height],$.expanded?E[rt].padding=[ft==null?void 0:ft.paddingTop,ft==null?void 0:ft.paddingRight,ft==null?void 0:ft.paddingBottom,ft==null?void 0:ft.paddingLeft]:E[rt].padding=[0,0,0,0]}else if(q===L.HierarchyNodeType.OP){var rt=D.findIndex(function(Ct){return Ct.id===H});if(D[rt].x=W+h[0],D[rt].y=V+h[1],Y){var it=[],bt=g.filter(function(Ct){return Ct.v===H}),gt=g.filter(function(Ct){return Ct.w===H});bt.length>0&&bt.forEach(function(Ct){var At=Ct.points[0],Z=(At.x-W)/$.width+.5,J=(At.y-V)/$.height+.5;it.push([Z,J]),Ct.baseEdgeList.forEach(function(yt){var _t=F.find(function(nt){return nt.source===yt.v&&nt.target===yt.w});_t&&(_t.sourceAnchor=it.length-1)})}),gt.length>0&>.forEach(function(Ct){var At=Ct.points[Ct.points.length-1],Z=(At.x-W)/$.width+.5,J=(At.y-V)/$.height+.5;it.push([Z,J]),Ct.baseEdgeList.forEach(function(yt){var _t=F.find(function(nt){return nt.source===yt.v&&nt.target===yt.w});_t&&(_t.targetAnchor=it.length-1)})}),D[rt].anchorPoints=it.length>0?it:D[rt].anchorPoints||[]}}})},S.prototype.updateEdgePosition=function(y,g){var A=this,E=A.combos,D=A.edges,F=A.controlPoints,Y=this.getBegin(y,g);F&&(E.forEach(function(b){b.inEdges=[],b.outEdges=[]}),D.forEach(function(b){var h,$,U,W,V=y.find(function(Xt){return Xt.id===b.source}),H=y.find(function(Xt){return Xt.id===b.target}),q=[],tt=[];if(V&&H)tt=(0,L.getEdges)(V==null?void 0:V.id,H==null?void 0:H.id,y);else if(!V||!H){var rt=A.getNodePath(b.source),ft=A.getNodePath(b.target),it=rt.reverse().slice(V?0:1).find(function(Xt){return y.find(function(Ct){return Ct.id===Xt})}),bt=ft.reverse().slice(H?0:1).find(function(Xt){return y.find(function(Ct){return Ct.id===Xt})});V=y.find(function(Xt){return Xt.id===it}),H=y.find(function(Xt){return Xt.id===bt}),tt=(0,L.getEdges)(V==null?void 0:V.id,H==null?void 0:H.id,y,{v:b.source,w:b.target})}if(q=tt.reduce(function(Xt,Ct){return w(w([],Xt,!0),Ct.points.map(function(At){return k(k({},At),{x:At.x+Y[0],y:At.y+Y[1]})}),!0)},[]),q=q.slice(1,-1),b.controlPoints=q,(H==null?void 0:H.type)===L.NodeType.META){var gt=E.findIndex(function(Xt){return Xt.id===(H==null?void 0:H.id)});if(!E[gt]||!((h=E[gt].inEdges)===null||h===void 0)&&h.some(function(Xt){return Xt.source===V.id&&Xt.target===H.id}))return;($=E[gt].inEdges)===null||$===void 0||$.push({source:V.id,target:H.id,controlPoints:q})}if((V==null?void 0:V.type)===L.NodeType.META){var gt=E.findIndex(function(Ct){return Ct.id===(V==null?void 0:V.id)});if(!E[gt]||!((U=E[gt].outEdges)===null||U===void 0)&&U.some(function(Ct){return Ct.source===V.id&&Ct.target===H.id}))return;(W=E[gt].outEdges)===null||W===void 0||W.push({source:V.id,target:H.id,controlPoints:q})}}))},S.prototype.getType=function(){return"dagreCompound"},S.prototype.getDataByOrder=function(y){return y.every(function(g){return g.layoutOrder!==void 0})||y.forEach(function(g,A){g.layoutOrder=A}),y.sort(function(g,A){return g.layoutOrder-A.layoutOrder})},S}(T.Base);z.DagreCompoundLayout=p},934015:function(Ve,z,C){"use strict";var x=this&&this.__assign||function(){return x=Object.assign||function(g){for(var A,E=1,D=arguments.length;E1){var ft=x({},tt);delete ft.size,b.push(ft)}});var h=[];D.forEach(function(tt){var rt=b.find(function(it){return it.id===tt.source}),ft=b.find(function(it){return it.id===tt.target});rt&&ft&&h.push(tt)});var $=new S.DagreLayout({type:"dagre",ranksep:A.nodeMinGap,nodesep:A.nodeMinGap}),U=$.layout({nodes:b,edges:h}).nodes;E.forEach(function(tt){var rt=(U||[]).find(function(ft){return ft.id===tt.id});tt.x=(rt==null?void 0:rt.x)||F/2,tt.y=(rt==null?void 0:rt.y)||Y/2});var W=JSON.parse(JSON.stringify(E)),V=JSON.parse(JSON.stringify(D)),H=P.forceSimulation().nodes(W).force("link",P.forceLink(V).id(function(tt){return tt.id}).distance(function(tt){var rt=h.find(function(ft){return ft.source===tt.source&&ft.target===tt.target});return rt?30:20})).force("charge",P.forceManyBody()).force("center",P.forceCenter(F/2,Y/2)).force("x",P.forceX(F/2)).force("y",P.forceY(Y/2)).alpha(.3).alphaDecay(.08).alphaMin(.001),q=new Promise(function(tt){H.on("end",function(){E.forEach(function(Ct){var At=W.find(function(Z){return Z.id===Ct.id});At&&(Ct.x=At.x,Ct.y=At.y)});var rt=Math.min.apply(Math,E.map(function(Ct){return Ct.x})),ft=Math.max.apply(Math,E.map(function(Ct){return Ct.x})),it=Math.min.apply(Math,E.map(function(Ct){return Ct.y})),bt=Math.max.apply(Math,E.map(function(Ct){return Ct.y})),gt=F/(ft-rt),Xt=Y/(bt-it);E.forEach(function(Ct){Ct.x!==void 0&><1&&(Ct.x=(Ct.x-rt)*gt),Ct.y!==void 0&&Xt<1&&(Ct.y=(Ct.y-it)*Xt)}),E.forEach(function(Ct){Ct.sizeTemp=Ct.size,Ct.size=[10,10]}),(0,m.default)(E,D),E.forEach(function(Ct){Ct.size=Ct.sizeTemp||[],delete Ct.sizeTemp}),(0,p.default)({nodes:E,edges:D},A),tt()})});return q}z.default=y},788221:function(Ve,z,C){"use strict";var x=this&&this.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(z,"__esModule",{value:!0});var k=x(C(28611));function w(T,L){if(!T.nodes||T.nodes.length===0)return T;var P=L.width,p=L.height,m=L.nodeMinGap,S=1e4,y=1e4;T.nodes.forEach(function(V){var H=V.size[0]||50,q=V.size[1]||50;S=Math.min(H,S),y=Math.min(q,y)});var g=new k.default;g.init(P,p,{CELL_H:y,CELL_W:S}),T.nodes.forEach(function(V){var H=g.occupyNearest(V);H&&(H.node={id:V.id,size:V.size},V.x=H.x,V.y=H.y,V.dx=H.dx,V.dy=H.dy)});for(var A=0;AS){for(var b=Math.ceil((E.size[0]+m)/S)-1,h=b,$=0;$-1;if(U&&!g.cells[F+$+1][Y].node)h--;else break}g.insertColumn(F,h)}if(E.size[1]+m>y){for(var b=Math.ceil((E.size[1]+m)/y)-1,h=b,$=0;$-1;if(U&&!g.cells[F][Y+$+1].node)h--;else break}g.insertRow(Y,h)}}for(var A=0;Aw;L--)for(var P=0;P=w&&(this.additionColumn[P]+=T);for(var L=0;Lw;L--)this.cells[P][L+T]=C(C({},this.cells[P][L]),{dx:P,dy:L+T,x:P*this.CELL_W,y:(L+T)*this.CELL_H}),this.cells[P][L]={dx:P,dy:L,x:P*this.CELL_W,y:L*this.CELL_H,occupied:!1,node:null};for(var L=0;L=w&&(this.additionRow[L]+=T);for(var P=0;PL?(vt=tt-Xt,nt=it-rt,It=parseFloat(vt?(vt/Math.cos(_t)).toFixed(2):nt.toFixed(2)),Pt=parseFloat(nt?(nt/Math.sin(_t)).toFixed(2):vt.toFixed(2))):0<_t&&_t<=L?(vt=bt-ft,nt=it-rt,vt>nt?It=Pt=parseFloat(vt?(vt/Math.cos(_t)).toFixed(2):nt.toFixed(2)):It=Pt=parseFloat(nt?(nt/Math.sin(_t)).toFixed(2):vt.toFixed(2))):_t<-L?(vt=tt-Xt,nt=-(gt-q),vt>nt?It=Pt=parseFloat(vt?(vt/Math.cos(_t)).toFixed(2):nt.toFixed(2)):It=Pt=parseFloat(nt?(nt/Math.sin(_t)).toFixed(2):vt.toFixed(2))):(vt=bt-ft,Math.abs(yt)>(rt-q)/2?nt=q-gt:nt=yt,vt>nt?It=Pt=parseFloat(vt?(vt/Math.cos(_t)).toFixed(2):nt.toFixed(2)):It=Pt=parseFloat(nt&&_t!==0?(nt/Math.sin(_t)).toFixed(2):vt.toFixed(2)));var St=parseFloat(_t.toFixed(2)),Dt=H;return H&&(Dt=Prt?V:W,it=tt>rt?W:V,bt=ft.x-ft.size[0]/2,gt=ft.y-ft.size[1]/2,Xt=ft.x+ft.size[0]/2,Ct=ft.y+ft.size[1]/2,At=it.x-it.size[0]/2,Z=it.y-it.size[1]/2,J=it.x+it.size[0]/2,yt=it.y+it.size[1]/2,_t=ft.x,nt=ft.y,vt=it.x,It=it.y,Pt=Xt>=At&&J>=bt&&Ct>=Z&&yt>=gt,St=0,Dt=0;if(Pt){Dt=Math.sqrt(Math.pow(vt-_t,2)+Math.pow(It-nt,2));var Qt=bt>At?bt:At,ue=gt>Z?gt:Z,ie=XtC||q.y>x)&&(V+=1e12);for(var tt=H+1;tt150,Z=Ct<30||Ct>150,J=Xt>70&&Xt<110,yt=Ct>70&&Ct<110;if(At&&!Z||Xt*Ct<0){it=!1;break}else if(J&&!yt||Xt*Ct<0){it=!1;break}else if((gt.x-W.x)*(gt.x-V.x)<0){it=!1;break}else if((gt.y-W.y)*(gt.y-V.y)<0){it=!1;break}}return it}function h(W,V){for(var H=!1,q=1,tt=S*q,rt=y*q,ft=[tt,-tt,0,0],it=[0,0,rt,-rt],bt=0;btA?(Xt=Z,H=!0):(gt.x-=ft[Ct],gt.y-=it[Ct])}}return g>A&&(g*=E),H?Y(W):0}function $(W,V){var H=0;(W.x<0||W.y<0||W.x+W.size[0]+20>C||W.y+W.size[1]+20>x)&&(H+=1e12);for(var q=0;q0&&(it++,!(it>=ft));){var bt=h(W,V);bt!==0&&(rt=bt),tt=rt-H,H=rt,tt===0?--q:q=20}return W.forEach(function(gt){gt.x=gt.x-gt.size[0]/2,gt.y=gt.y-gt.size[1]/2}),{nodes:W,edges:V}}z.default=U},589806:function(Ve,z,C){"use strict";var x=this&&this.__createBinding||(Object.create?function(p,m,S,y){y===void 0&&(y=S);var g=Object.getOwnPropertyDescriptor(m,S);(!g||("get"in g?!m.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return m[S]}}),Object.defineProperty(p,y,g)}:function(p,m,S,y){y===void 0&&(y=S),p[y]=m[S]}),k=this&&this.__setModuleDefault||(Object.create?function(p,m){Object.defineProperty(p,"default",{enumerable:!0,value:m})}:function(p,m){p.default=m}),w=this&&this.__importStar||function(p){if(p&&p.__esModule)return p;var m={};if(p!=null)for(var S in p)S!=="default"&&Object.prototype.hasOwnProperty.call(p,S)&&x(m,p,S);return k(m,p),m};Object.defineProperty(z,"__esModule",{value:!0});var T=w(C(971497)),L=C(449784);function P(){function p(Lt){return function(){return Lt}}var m=function(Lt){return Lt.cluster},S=p(1),y=p(-1),g=p(100),A=p(.1),E=[0,0],D=[],F={},Y=[],b=100,h=100,$={none:{x:0,y:0}},U=[],W,V="force",H=!0,q=.1;function tt(Lt){if(!H)return tt;W.tick(),Xt();for(var ne=0,ve=D.length,Wt=void 0,ae=Lt*q;ne-1||(U[V]=$[V])}),U}),b.ticking=!1},F.prototype.execute=function(Y){var b=this,h=b.nodes,$=b.edges;if(!b.ticking){var U=b.forceSimulation,W=b.alphaMin,V=b.alphaDecay,H=b.alpha;if(U){if(Y){if(b.clustering&&b.clusterForce&&(b.clusterForce.nodes(h),b.clusterForce.links($)),U.nodes(h),$&&b.edgeForce)b.edgeForce.links($);else if($&&!b.edgeForce){var rt=P.forceLink().id(function(gt){return gt.id}).links($);b.edgeStrength&&rt.strength(b.edgeStrength),b.linkDistance&&rt.distance(b.linkDistance),b.edgeForce=rt,U.force("link",rt)}}b.preventOverlap&&b.overlapProcess(U),U.alpha(H).restart(),this.ticking=!0}else try{var q=P.forceManyBody();if(b.nodeStrength&&q.strength(b.nodeStrength),U=P.forceSimulation().nodes(h),b.clustering){var tt=(0,p.default)();tt.centerX(b.center[0]).centerY(b.center[1]).template("force").strength(b.clusterFociStrength),$&&tt.links($),h&&tt.nodes(h),tt.forceLinkDistance(b.clusterEdgeDistance).forceLinkStrength(b.clusterEdgeStrength).forceCharge(b.clusterNodeStrength).forceNodeSize(b.clusterNodeSize),b.clusterForce=tt,U.force("group",tt)}if(U.force("center",P.forceCenter(b.center[0],b.center[1])).force("charge",q).alpha(H).alphaDecay(V).alphaMin(W),b.preventOverlap&&b.overlapProcess(U),$){var rt=P.forceLink().id(function(bt){return bt.id}).links($);b.edgeStrength&&rt.strength(b.edgeStrength),b.linkDistance&&rt.distance(b.linkDistance),b.edgeForce=rt,U.force("link",rt)}if(b.workerEnabled&&!E()&&(b.workerEnabled=!1,console.warn("workerEnabled option is only supported when running in web worker.")),!b.workerEnabled)U.on("tick",function(){b.tick()}).on("end",function(){b.ticking=!1,b.onLayoutEnd&&b.onLayoutEnd()}),b.ticking=!0;else{U.stop();for(var ft=A(U),it=1;it<=ft;it++)U.tick(),postMessage({nodes:h,currentTick:it,totalTicks:ft,type:y.LAYOUT_MESSAGE.TICK},void 0);b.ticking=!1}b.forceSimulation=U,b.ticking=!0}catch(bt){b.ticking=!1,console.warn(bt)}}},F.prototype.overlapProcess=function(Y){var b=this,h=b.nodeSize,$=b.nodeSpacing,U,W,V=b.collideStrength;if((0,m.isNumber)($)?W=function(){return $}:(0,m.isFunction)($)?W=$:W=function(){return 0},!h)U=function(rt){if(rt.size){if((0,m.isArray)(rt.size)){var ft=rt.size[0]>rt.size[1]?rt.size[0]:rt.size[1];return ft/2+W(rt)}if((0,m.isObject)(rt.size)){var ft=rt.size.width>rt.size.height?rt.size.width:rt.size.height;return ft/2+W(rt)}return rt.size/2+W(rt)}return 10+W(rt)};else if((0,m.isFunction)(h))U=function(rt){var ft=h(rt);return ft+W(rt)};else if((0,m.isArray)(h)){var H=h[0]>h[1]?h[0]:h[1],q=H/2;U=function(rt){return q+W(rt)}}else if((0,m.isNumber)(h)){var tt=h/2;U=function(rt){return tt+W(rt)}}else U=function(){return 10};Y.force("collisionForce",P.forceCollide(U).strength(V))},F.prototype.updateCfg=function(Y){var b=this;b.ticking&&(b.forceSimulation.stop(),b.ticking=!1),b.forceSimulation=null,Object.assign(b,Y)},F.prototype.destroy=function(){var Y=this;Y.ticking&&(Y.forceSimulation.stop(),Y.ticking=!1),Y.nodes=null,Y.edges=null,Y.destroyed=!0},F}(S.Base);z.ForceLayout=g;function A(D){var F=D.alphaMin(),Y=D.alphaTarget(),b=D.alpha(),h=Math.log((F-Y)/(b-Y))/Math.log(1-D.alphaDecay()),$=Math.ceil(h);return $}function E(){return typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope}},885717:function(Ve,z,C){"use strict";var x=this&&this.__createBinding||(Object.create?function(w,T,L,P){P===void 0&&(P=L);var p=Object.getOwnPropertyDescriptor(T,L);(!p||("get"in p?!T.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return T[L]}}),Object.defineProperty(w,P,p)}:function(w,T,L,P){P===void 0&&(P=L),w[P]=T[L]}),k=this&&this.__exportStar||function(w,T){for(var L in w)L!=="default"&&!Object.prototype.hasOwnProperty.call(T,L)&&x(T,w,L)};Object.defineProperty(z,"__esModule",{value:!0}),k(C(508810),z)},191019:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.forceNBody=void 0;var x=C(971829),k=.81,w=.1;function T(m,S,y,g,A){var E=y/g,D=m.map(function(Y,b){var h=S[Y.id],$=h.data,U=h.x,W=h.y,V=h.size,H=$.layout.force.nodeStrength;return{x:U,y:W,size:V,index:b,vx:0,vy:0,weight:E*H}}),F=(0,x.quadtree)(D,function(Y){return Y.x},function(Y){return Y.y}).visitAfter(L);return D.forEach(function(Y){p(Y,F)}),D.map(function(Y,b){var h=S[m[b].id],$=h.data.layout.force.mass,U=$===void 0?1:$;A[2*b]=Y.vx/U,A[2*b+1]=Y.vy/U}),A}z.forceNBody=T;function L(m){var S=0,y=0,g=0;if(m.length){for(var A=0;A<4;A++){var E=m[A];E&&E.weight&&(S+=E.weight,y+=E.x*E.weight,g+=E.y*E.weight)}m.x=y/S,m.y=g/S,m.weight=S}else{var E=m;m.x=E.data.x,m.y=E.data.y,m.weight=E.data.weight}}var P=function(m,S,y,g,A,E){var D=E.x-m.x||w,F=E.y-m.y||w,Y=g-S,b=D*D+F*F,h=Math.sqrt(b)*b;if(Y*Y*k1&&(Ct=(0,T.getAvgNodePosition)(Z))}else Ct=void 0;return{x:Ct==null?void 0:Ct.x,y:Ct==null?void 0:Ct.y}}}}if(A){$||($=this.getSameTypeLeafMap());var W=Array.from(new Set(D.map(function(ft,it){return ft[E]}))).filter(function(ft){return ft!==void 0}),V={};W.forEach(function(ft){var it=D.filter(function(bt){return bt[E]===ft}).map(function(bt){return F[bt.id]});V[ft]=(0,T.getAvgNodePosition)(it)}),h={single:function(ft){return b(ft)},leaf:function(ft){return b(ft)},others:function(ft){return b(ft)},center:function(ft,it,bt){var gt=V[ft[E]];return{x:gt==null?void 0:gt.x,y:gt==null?void 0:gt.y}}}}this.centripetalOptions=k(k({},this.centripetalOptions),h);var H=this.centripetalOptions,q=H.leaf,tt=H.single,rt=H.others;q&&typeof q!="function"&&(this.centripetalOptions.leaf=function(){return q}),tt&&typeof tt!="function"&&(this.centripetalOptions.single=function(){return tt}),rt&&typeof rt!="function"&&(this.centripetalOptions.others=function(){return rt})},S.prototype.updateCfg=function(y){y&&Object.assign(this,y)},S.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},S.prototype.execute=function(){var y=this;y.stop();var g=y.nodes,A=y.edges,E=y.defSpringLen;if(y.judgingDistance=0,!g||g.length===0){y.onLayoutEnd([]);return}!y.width&&typeof window!="undefined"&&(y.width=window.innerWidth),!y.height&&typeof window!="undefined"&&(y.height=window.innerHeight),y.center||(y.center=[y.width/2,y.height/2]);var D=y.center;if(g.length===1){g[0].x=D[0],g[0].y=D[1],y.onLayoutEnd([k({},g[0])]);return}y.degreesMap=(0,T.getDegreeMap)(g,A),y.propsGetMass?y.getMass=y.propsGetMass:y.getMass=function(W){var V=1;(0,T.isNumber)(W.mass)&&(V=W.mass);var H=y.degreesMap[W.id].all;return!H||H<5?V:H*5*V};var F=y.nodeSize,Y;if(y.preventOverlap){var b=y.nodeSpacing,h;(0,T.isNumber)(b)?h=function(){return b}:(0,T.isFunction)(b)?h=b:h=function(){return 0},F?(0,T.isArray)(F)?Y=function(W){return Math.max(F[0],F[1])+h(W)}:Y=function(W){return F+h(W)}:Y=function(W){return W.size?(0,T.isArray)(W.size)?Math.max(W.size[0],W.size[1])+h(W):(0,T.isObject)(W.size)?Math.max(W.size.width,W.size.height)+h(W):W.size+h(W):10+h(W)}}y.nodeSize=Y,y.linkDistance=P(y.linkDistance,1),y.nodeStrength=P(y.nodeStrength,1),y.edgeStrength=P(y.edgeStrength,1);var $={},U={};g.forEach(function(W,V){(0,T.isNumber)(W.x)||(W.x=Math.random()*y.width),(0,T.isNumber)(W.y)||(W.y=Math.random()*y.height);var H=y.degreesMap[W.id];$[W.id]=k(k({},W),{data:k(k({},W.data),{size:y.nodeSize(W)||30,layout:{inDegree:H.in,outDegree:H.out,degree:H.all,tDegree:H.in,sDegree:H.out,force:{mass:y.getMass(W),nodeStrength:y.nodeStrength(W,A)}}})}),U[W.id]=V}),y.nodeMap=$,y.nodeIdxMap=U,y.edgeInfos=[],A==null||A.forEach(function(W){var V=$[W.source],H=$[W.target];!V||!H?elf.edgeInfos.push({}):y.edgeInfos.push({edgeStrength:y.edgeStrength(W),linkDistance:E?E(k(k({},W),{source:V,target:H}),V,H):y.linkDistance(W,V,H)||1+(F(V)+F(V)||0)/2})}),this.getCentripetalOptions(),y.onLayoutEnd=y.onLayoutEnd||function(){},y.run()},S.prototype.run=function(){var y=this,g=y.maxIteration,A=y.nodes,E=y.edges,D=y.workerEnabled,F=y.minMovement,Y=y.animate,b=y.nodeMap,h=y.height;if(y.currentMinY=0,y.currentMaxY=h,!!A){var $=[];if(A.forEach(function(rt,ft){$[2*ft]=0,$[2*ft+1]=0}),this.defSideCoe&&typeof this.defSideCoe=="function"){var U={};E.forEach(function(rt){var ft=rt.source,it=rt.target;U[ft]=U[ft]||[],U[ft].push(rt),U[it]=U[it]||[],U[it].push(rt)}),this.relatedEdges=U}var W=g,V=!Y;if(D||V){for(var H=0,q=0;(y.judgingDistance>F||q<1)&&q=W||y.judgingDistanceY){var V=Y/W;$=V*$,U=V*U}g[2*h]=$,g[2*h+1]=U})},S.prototype.updatePosition=function(y,g){var A=this,E=A.nodes,D=A.distanceThresholdMode,F=A.nodeMap;if(!(E!=null&&E.length)){this.judgingDistance=0;return}var Y=0;D==="max"?A.judgingDistance=-1/0:D==="min"&&(A.judgingDistance=1/0);var b=1/0,h=-1/0;E.forEach(function($,U){var W=F[$.id];if((0,T.isNumber)($.fx)&&(0,T.isNumber)($.fy)){$.x=$.fx,$.y=$.fy,W.x=$.x,W.y=$.y;return}var V=y[2*U]*g,H=y[2*U+1]*g;$.x+=V,$.y+=H,W.x=$.x,W.y=$.y,$.yh&&(h=$.y);var q=Math.sqrt(V*V+H*H);switch(D){case"max":A.judgingDistanceq&&(A.judgingDistance=q);break;default:Y=Y+q;break}}),this.currentMinY=b,this.currentMaxY=h,(!D||D==="mean")&&(A.judgingDistance=Y/E.length)},S.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},S.prototype.destroy=function(){var y=this;y.stop(),y.tick=null,y.nodes=null,y.edges=null,y.destroyed=!0},S.prototype.getType=function(){return"force2"},S.prototype.getSameTypeLeafMap=function(){var y=this,g=y.nodeClusterBy,A=y.nodes,E=y.edges,D=y.nodeMap,F=y.degreesMap;if(A!=null&&A.length){var Y={};return A.forEach(function(b,h){var $=F[b.id].all;$===1&&(Y[b.id]=(0,T.getCoreNodeAndRelativeLeafNodes)("leaf",b,E,g,F,D))}),Y}},S}(w.Base);z.Force2Layout=p},19712:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0});var C=function(){function x(k){this.id=k.id||0,this.rx=k.rx,this.ry=k.ry,this.fx=0,this.fy=0,this.mass=k.mass,this.degree=k.degree,this.g=k.g||0}return x.prototype.distanceTo=function(k){var w=this.rx-k.rx,T=this.ry-k.ry;return Math.hypot(w,T)},x.prototype.setPos=function(k,w){this.rx=k,this.ry=w},x.prototype.resetForce=function(){this.fx=0,this.fy=0},x.prototype.addForce=function(k){var w=k.rx-this.rx,T=k.ry-this.ry,L=Math.hypot(w,T);L=L<1e-4?1e-4:L;var P=this.g*(this.degree+1)*(k.degree+1)/L;this.fx+=P*w/L,this.fy+=P*T/L},x.prototype.in=function(k){return k.contains(this.rx,this.ry)},x.prototype.add=function(k){var w=this.mass+k.mass,T=(this.rx*this.mass+k.rx*k.mass)/w,L=(this.ry*this.mass+k.ry*k.mass)/w,P=this.degree+k.degree,p={rx:T,ry:L,mass:w,degree:P};return new x(p)},x}();z.default=C},148564:function(Ve,z,C){"use strict";var x=this&&this.__extends||function(){var S=function(y,g){return S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,E){A.__proto__=E}||function(A,E){for(var D in E)Object.prototype.hasOwnProperty.call(E,D)&&(A[D]=E[D])},S(y,g)};return function(y,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");S(y,g);function A(){this.constructor=y}y.prototype=g===null?Object.create(g):(A.prototype=g.prototype,new A)}}(),k=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(z,"__esModule",{value:!0}),z.ForceAtlas2Layout=void 0;var w=C(762329),T=C(449784),L=k(C(19712)),P=k(C(851638)),p=k(C(762732)),m=function(S){x(y,S);function y(g){var A=S.call(this)||this;return A.center=[0,0],A.width=300,A.height=300,A.nodes=[],A.edges=[],A.kr=5,A.kg=1,A.mode="normal",A.preventOverlap=!1,A.dissuadeHubs=!1,A.barnesHut=void 0,A.maxIteration=0,A.ks=.1,A.ksmax=10,A.tao=.1,A.onLayoutEnd=function(){},A.prune=void 0,A.updateCfg(g),A}return y.prototype.getDefaultCfg=function(){return{}},y.prototype.execute=function(){var g=this,A=g.nodes,E=g.onLayoutEnd,D=g.prune,F=g.maxIteration;!g.width&&typeof window!="undefined"&&(g.width=window.innerWidth),!g.height&&typeof window!="undefined"&&(g.height=window.innerHeight);for(var Y=[],b=A.length,h=0;h250&&(g.barnesHut=!0),g.prune===void 0&&b>100&&(g.prune=!0),this.maxIteration===0&&!g.prune?(F=250,b<=200&&b>100?F=1e3:b>200&&(F=1200),this.maxIteration=F):this.maxIteration===0&&D&&(F=100,b<=200&&b>100?F=500:b>200&&(F=950),this.maxIteration=F),g.kr||(g.kr=50,b>100&&b<=500?g.kr=20:b>500&&(g.kr=1)),g.kg||(g.kg=20,b>100&&b<=500?g.kg=10:b>500&&(g.kg=1)),this.nodes=g.updateNodesByForces(Y),E()},y.prototype.updateNodesByForces=function(g){for(var A=this,E=A.edges,D=A.maxIteration,F=A.nodes,Y=E.filter(function(Ct){var At=(0,T.getEdgeTerminal)(Ct,"source"),Z=(0,T.getEdgeTerminal)(Ct,"target");return At!==Z}),b=F.length,h=Y.length,$=[],U={},W={},V=[],H=0;H0;){for(var gt=0;gtrt||!U)?ft=this.getOptRepGraForces(ft,bt,F):ft=this.getRepGraForces(tt,rt,ft,q,Y,F);var Ct=this.updatePos(ft,it,H,F);h=Ct.nodes,H=Ct.sg,tt--,b.tick&&b.tick()}return h},y.prototype.getAttrForces=function(g,A,E,D,F,Y,b,h){for(var $=this,U=$.nodes,W=$.preventOverlap,V=$.dissuadeHubs,H=$.mode,q=$.prune,tt=0;tt0&&(Ct=Xt,At=Xt),h[2*D[rt.id]]+=Ct*gt[0],h[2*D[it.id]]-=At*gt[0],h[2*D[rt.id]+1]+=Ct*gt[1],h[2*D[it.id]+1]-=At*gt[1]}}return h},y.prototype.getRepGraForces=function(g,A,E,D,F,Y){for(var b=this,h=b.nodes,$=b.preventOverlap,U=b.kr,W=b.kg,V=b.center,H=b.prune,q=h.length,tt=0;tt0&&(bt=U*(Y[tt]+1)*(Y[rt]+1)/it),E[2*tt]-=bt*ft[0],E[2*rt]+=bt*ft[0],E[2*tt+1]-=bt*ft[1],E[2*rt+1]+=bt*ft[1]}var gt=[h[tt].x-V[0],h[tt].y-V[1]],Xt=Math.hypot(gt[0],gt[1]);gt[0]=gt[0]/Xt,gt[1]=gt[1]/Xt;var Ct=W*(Y[tt]+1);E[2*tt]-=Ct*gt[0],E[2*tt+1]-=Ct*gt[1]}return E},y.prototype.getOptRepGraForces=function(g,A,E){for(var D=this,F=D.nodes,Y=D.kg,b=D.center,h=D.prune,$=F.length,U=9e10,W=-9e10,V=9e10,H=-9e10,q=0;q<$;q+=1)h&&E[q]<=1||(A[q].setPos(F[q].x,F[q].y),F[q].x>=W&&(W=F[q].x),F[q].x<=U&&(U=F[q].x),F[q].y>=H&&(H=F[q].y),F[q].y<=V&&(V=F[q].y));for(var tt=Math.max(W-U,H-V),rt={xmid:(W+U)/2,ymid:(H+V)/2,length:tt,massCenter:b,mass:$},ft=new P.default(rt),it=new p.default(ft),q=0;q<$;q+=1)h&&E[q]<=1||A[q].in(ft)&&it.insert(A[q]);for(var q=0;q<$;q+=1)if(!(h&&E[q]<=1)){A[q].resetForce(),it.updateForce(A[q]),g[2*q]-=A[q].fx,g[2*q+1]-=A[q].fy;var bt=[F[q].x-b[0],F[q].y-b[1]],gt=Math.hypot(bt[0],bt[1]);gt=gt<1e-4?1e-4:gt,bt[0]=bt[0]/gt,bt[1]=bt[1]/gt;var Xt=Y*(E[q]+1);g[2*q]-=Xt*bt[0],g[2*q+1]-=Xt*bt[1]}return g},y.prototype.updatePos=function(g,A,E,D){for(var F=this,Y=F.nodes,b=F.ks,h=F.tao,$=F.prune,U=F.ksmax,W=Y.length,V=[],H=[],q=0,tt=0,rt=0;rt1.5*Xt?1.5*Xt:E);for(var rt=0;rtZ?Z:Ct;var J=Ct*g[2*rt],yt=Ct*g[2*rt+1];Y[rt].x+=J,Y[rt].y+=yt}return{nodes:Y,sg:E}},y}(w.Base);z.ForceAtlas2Layout=m},851638:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0});var C=function(){function x(k){this.xmid=k.xmid,this.ymid=k.ymid,this.length=k.length,this.massCenter=k.massCenter||[0,0],this.mass=k.mass||1}return x.prototype.getLength=function(){return this.length},x.prototype.contains=function(k,w){var T=this.length/2;return k<=this.xmid+T&&k>=this.xmid-T&&w<=this.ymid+T&&w>=this.ymid-T},x.prototype.NW=function(){var k=this.xmid-this.length/4,w=this.ymid+this.length/4,T=this.length/2,L={xmid:k,ymid:w,length:T},P=new x(L);return P},x.prototype.NE=function(){var k=this.xmid+this.length/4,w=this.ymid+this.length/4,T=this.length/2,L={xmid:k,ymid:w,length:T},P=new x(L);return P},x.prototype.SW=function(){var k=this.xmid-this.length/4,w=this.ymid-this.length/4,T=this.length/2,L={xmid:k,ymid:w,length:T},P=new x(L);return P},x.prototype.SE=function(){var k=this.xmid+this.length/4,w=this.ymid-this.length/4,T=this.length/2,L={xmid:k,ymid:w,length:T},P=new x(L);return P},x}();z.default=C},762732:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0});var C=function(){function x(k){this.body=null,this.quad=null,this.NW=null,this.NE=null,this.SW=null,this.SE=null,this.theta=.5,k!=null&&(this.quad=k)}return x.prototype.insert=function(k){if(this.body==null){this.body=k;return}this._isExternal()?(this.quad&&(this.NW=new x(this.quad.NW()),this.NE=new x(this.quad.NE()),this.SW=new x(this.quad.SW()),this.SE=new x(this.quad.SE())),this._putBody(this.body),this._putBody(k),this.body=this.body.add(k)):(this.body=this.body.add(k),this._putBody(k))},x.prototype._putBody=function(k){this.quad&&(k.in(this.quad.NW())&&this.NW?this.NW.insert(k):k.in(this.quad.NE())&&this.NE?this.NE.insert(k):k.in(this.quad.SW())&&this.SW?this.SW.insert(k):k.in(this.quad.SE())&&this.SE&&this.SE.insert(k))},x.prototype._isExternal=function(){return this.NW==null&&this.NE==null&&this.SW==null&&this.SE==null},x.prototype.updateForce=function(k){if(!(this.body==null||k===this.body))if(this._isExternal())k.addForce(this.body);else{var w=this.quad?this.quad.getLength():0,T=this.body.distanceTo(k);w/T=A&&(($=S.onLayoutEnd)===null||$===void 0||$.call(S),window.clearInterval(S.timeInterval))},0)}return{nodes:y,edges:g}}},p.prototype.runOneStep=function(m){var S,y=this,g=y.nodes;if(g){var A=y.edges,E=y.center,D=y.gravity,F=y.speed,Y=y.clustering,b=y.height*y.width,h=Math.sqrt(b)/10,$=b/(g.length+1),U=Math.sqrt($),W=[];if(g.forEach(function(q,tt){W[tt]={x:0,y:0}}),y.applyCalculate(g,A,W,U,$),Y){for(var V in m)m[V].cx=0,m[V].cy=0,m[V].count=0;g.forEach(function(q){var tt=m[q.cluster];(0,w.isNumber)(q.x)&&(tt.cx+=q.x),(0,w.isNumber)(q.y)&&(tt.cy+=q.y),tt.count++});for(var V in m)m[V].cx/=m[V].count,m[V].cy/=m[V].count;var H=y.clusterGravity||D;g.forEach(function(q,tt){if(!(!(0,w.isNumber)(q.x)||!(0,w.isNumber)(q.y))){var rt=m[q.cluster],ft=Math.sqrt((q.x-rt.cx)*(q.x-rt.cx)+(q.y-rt.cy)*(q.y-rt.cy)),it=U*H;W[tt].x-=it*(q.x-rt.cx)/ft,W[tt].y-=it*(q.y-rt.cy)/ft}})}g.forEach(function(q,tt){if(!(!(0,w.isNumber)(q.x)||!(0,w.isNumber)(q.y))){var rt=.01*U*D;W[tt].x-=rt*(q.x-E[0]),W[tt].y-=rt*(q.y-E[1])}}),g.forEach(function(q,tt){if((0,w.isNumber)(q.fx)&&(0,w.isNumber)(q.fy)){q.x=q.fx,q.y=q.fy;return}if(!(!(0,w.isNumber)(q.x)||!(0,w.isNumber)(q.y))){var rt=Math.sqrt(W[tt].x*W[tt].x+W[tt].y*W[tt].y);if(rt>0){var ft=Math.min(h*(F/T),rt);q.x+=W[tt].x/rt*ft,q.y+=W[tt].y/rt*ft}}}),(S=y.tick)===null||S===void 0||S.call(y)}},p.prototype.applyCalculate=function(m,S,y,g,A){var E=this;E.calRepulsive(m,y,A),S&&E.calAttractive(S,y,g)},p.prototype.calRepulsive=function(m,S,y){m.forEach(function(g,A){S[A]={x:0,y:0},m.forEach(function(E,D){if(A!==D&&!(!(0,w.isNumber)(g.x)||!(0,w.isNumber)(E.x)||!(0,w.isNumber)(g.y)||!(0,w.isNumber)(E.y))){var F=g.x-E.x,Y=g.y-E.y,b=F*F+Y*Y;if(b===0){b=1;var h=A>D?1:-1;F=.01*h,Y=.01*h}var $=y/b;S[A].x+=F*$,S[A].y+=Y*$}})})},p.prototype.calAttractive=function(m,S,y){var g=this;m.forEach(function(A){var E=(0,w.getEdgeTerminal)(A,"source"),D=(0,w.getEdgeTerminal)(A,"target");if(!(!E||!D)){var F=g.nodeIdxMap[E],Y=g.nodeIdxMap[D];if(F!==Y){var b=g.nodeMap[E],h=g.nodeMap[D];if(!(!(0,w.isNumber)(h.x)||!(0,w.isNumber)(b.x)||!(0,w.isNumber)(h.y)||!(0,w.isNumber)(b.y))){var $=h.x-b.x,U=h.y-b.y,W=Math.sqrt($*$+U*U),V=W*W/y;S[Y].x-=$/W*V,S[Y].y-=U/W*V,S[F].x+=$/W*V,S[F].y+=U/W*V}}}})},p.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},p.prototype.destroy=function(){var m=this;m.stop(),m.tick=null,m.nodes=null,m.edges=null,m.destroyed=!0},p.prototype.getType=function(){return"fruchterman"},p}(k.Base);z.FruchtermanLayout=L},113653:function(Ve,z,C){"use strict";var x=this&&this.__extends||function(){var P=function(p,m){return P=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(S,y){S.__proto__=y}||function(S,y){for(var g in y)Object.prototype.hasOwnProperty.call(y,g)&&(S[g]=y[g])},P(p,m)};return function(p,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");P(p,m);function S(){this.constructor=p}p.prototype=m===null?Object.create(m):(S.prototype=m.prototype,new S)}}();Object.defineProperty(z,"__esModule",{value:!0}),z.GForceLayout=void 0;var k=C(762329),w=C(449784),T=function(P,p){var m;return P?(0,w.isNumber)(P)?m=function(S){return P}:m=P:m=function(S){return p||1},m},L=function(P){x(p,P);function p(m){var S=P.call(this)||this;return S.maxIteration=500,S.workerEnabled=!1,S.edgeStrength=200,S.nodeStrength=1e3,S.coulombDisScale=.005,S.damping=.9,S.maxSpeed=1e3,S.minMovement=.5,S.interval=.02,S.factor=1,S.linkDistance=1,S.gravity=10,S.preventOverlap=!0,S.collideStrength=1,S.tick=function(){},S.nodes=[],S.edges=[],S.width=300,S.height=300,S.nodeMap={},S.nodeIdxMap={},S.animate=!0,S.updateCfg(m),S}return p.prototype.getDefaultCfg=function(){return{maxIteration:500,gravity:10,enableTick:!0,animate:!0}},p.prototype.execute=function(){var m,S,y=this,g=y.nodes;if(y.timeInterval!==void 0&&typeof window!="undefined"&&window.clearInterval(y.timeInterval),!g||g.length===0){(m=y.onLayoutEnd)===null||m===void 0||m.call(y);return}!y.width&&typeof window!="undefined"&&(y.width=window.innerWidth),!y.height&&typeof window!="undefined"&&(y.height=window.innerHeight),y.center||(y.center=[y.width/2,y.height/2]);var A=y.center;if(g.length===1){g[0].x=A[0],g[0].y=A[1],(S=y.onLayoutEnd)===null||S===void 0||S.call(y);return}var E={},D={};g.forEach(function(U,W){(0,w.isNumber)(U.x)||(U.x=Math.random()*y.width),(0,w.isNumber)(U.y)||(U.y=Math.random()*y.height),E[U.id]=U,D[U.id]=W}),y.nodeMap=E,y.nodeIdxMap=D,y.linkDistance=T(y.linkDistance,1),y.nodeStrength=T(y.nodeStrength,1),y.edgeStrength=T(y.edgeStrength,1);var F=y.nodeSize,Y;if(y.preventOverlap){var b=y.nodeSpacing,h;(0,w.isNumber)(b)?h=function(){return b}:(0,w.isFunction)(b)?h=b:h=function(){return 0},F?(0,w.isArray)(F)?Y=function(U){return Math.max(F[0],F[1])+h(U)}:Y=function(U){return F+h(U)}:Y=function(U){return U.size?(0,w.isArray)(U.size)?Math.max(U.size[0],U.size[1])+h(U):(0,w.isObject)(U.size)?Math.max(U.size.width,U.size.height)+h(U):U.size+h(U):10+h(U)}}y.nodeSize=Y;var $=y.edges;y.degrees=(0,w.getDegree)(g.length,y.nodeIdxMap,$),y.getMass||(y.getMass=function(U){var W=U.mass||y.degrees[y.nodeIdxMap[U.id]].all||1;return W}),y.run()},p.prototype.run=function(){var m,S=this,y=S.maxIteration,g=S.nodes,A=S.workerEnabled,E=S.minMovement,D=S.animate;if(g)if(A||!D){for(var F=0;F=y&&(($=S.onLayoutEnd)===null||$===void 0||$.call(S),window.clearInterval(S.timeInterval))}},0)}},p.prototype.reachMoveThreshold=function(m,S,y){var g=0;return m.forEach(function(A,E){var D=A.x-S[E].x,F=A.y-S[E].y;g+=Math.sqrt(D*D+F*F)}),g/=m.length,g=H)){var q=$.x-V.x,tt=$.y-V.y;q===0&&tt===0&&(q=Math.random()*.01,tt=Math.random()*.01);var rt=q*q+tt*tt,ft=Math.sqrt(rt),it=(ft+.1)*E,bt=q/ft,gt=tt/ft,Xt=(b($)+b(V))*.5*A/(it*it),Ct=g?g(V):1;if(m[2*U]+=bt*Xt,m[2*U+1]+=gt*Xt,m[2*H]-=bt*Xt,m[2*H+1]-=gt*Xt,D&&(h($)+h(V))/2>ft){var At=Y*(b($)+b(V))*.5/rt;m[2*U]+=bt*At/W,m[2*U+1]+=gt*At/W,m[2*H]-=bt*At/Ct,m[2*H+1]-=gt*At/Ct}}})})},p.prototype.calAttractive=function(m,S){var y=this,g=y.nodeMap,A=y.nodeIdxMap,E=y.linkDistance,D=y.edgeStrength,F=y.nodeSize,Y=y.getMass;S.forEach(function(b,h){var $=(0,w.getEdgeTerminal)(b,"source"),U=(0,w.getEdgeTerminal)(b,"target"),W=g[$],V=g[U],H=V.x-W.x,q=V.y-W.y;H===0&&q===0&&(H=Math.random()*.01,q=Math.random()*.01);var tt=Math.sqrt(H*H+q*q),rt=H/tt,ft=q/tt,it=E(b,W,V)||1+(F(W)+F(V)||0)/2,bt=it-tt,gt=bt*D(b),Xt=A[$],Ct=A[U],At=Y?Y(W):1,Z=Y?Y(V):1;m[2*Xt]-=rt*gt/At,m[2*Xt+1]-=ft*gt/At,m[2*Ct]+=rt*gt/Z,m[2*Ct+1]+=ft*gt/Z})},p.prototype.calGravity=function(m,S){for(var y=this,g=y.center,A=y.gravity,E=y.degrees,D=S.length,F=0;FA.maxSpeed){var $=A.maxSpeed/h;Y=$*Y,b=$*b}S[2*F]=Y,S[2*F+1]=b})},p.prototype.updatePosition=function(m,S,y){y.forEach(function(g,A){if((0,w.isNumber)(g.fx)&&(0,w.isNumber)(g.fy)){g.x=g.fx,g.y=g.fy;return}var E=m[2*A]*S,D=m[2*A+1]*S;g.x+=E,g.y+=D})},p.prototype.stop=function(){this.timeInterval&&typeof window!="undefined"&&window.clearInterval(this.timeInterval)},p.prototype.destroy=function(){var m=this;m.stop(),m.tick=null,m.nodes=null,m.edges=null,m.destroyed=!0},p.prototype.getType=function(){return"gForce"},p}(k.Base);z.GForceLayout=L},687745:function(Ve,z,C){"use strict";var x=this&&this.__extends||function(){var g=function(A,E){return g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(D,F){D.__proto__=F}||function(D,F){for(var Y in F)Object.prototype.hasOwnProperty.call(F,Y)&&(D[Y]=F[Y])},g(A,E)};return function(A,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");g(A,E);function D(){this.constructor=A}A.prototype=E===null?Object.create(E):(D.prototype=E.prototype,new D)}}(),k=this&&this.__awaiter||function(g,A,E,D){function F(Y){return Y instanceof E?Y:new E(function(b){b(Y)})}return new(E||(E=Promise))(function(Y,b){function h(W){try{U(D.next(W))}catch(V){b(V)}}function $(W){try{U(D.throw(W))}catch(V){b(V)}}function U(W){W.done?Y(W.value):F(W.value).then(h,$)}U((D=D.apply(g,A||[])).next())})},w=this&&this.__generator||function(g,A){var E={label:0,sent:function(){if(Y[0]&1)throw Y[1];return Y[1]},trys:[],ops:[]},D,F,Y,b;return b={next:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(b[Symbol.iterator]=function(){return this}),b;function h(U){return function(W){return $([U,W])}}function $(U){if(D)throw new TypeError("Generator is already executing.");for(;b&&(b=0,U[0]&&(E=0)),E;)try{if(D=1,F&&(Y=U[0]&2?F.return:U[0]?F.throw||((Y=F.return)&&Y.call(F),0):F.next)&&!(Y=Y.call(F,U[1])).done)return Y;switch(F=0,Y&&(U=[U[0]&2,Y.value]),U[0]){case 0:case 1:Y=U;break;case 4:return E.label++,{value:U[1],done:!1};case 5:E.label++,F=U[1],U=[0];continue;case 7:U=E.ops.pop(),E.trys.pop();continue;default:if(Y=E.trys,!(Y=Y.length>0&&Y[Y.length-1])&&(U[0]===6||U[0]===2)){E=0;continue}if(U[0]===3&&(!Y||U[1]>Y[0]&&U[1] 0.0) { + dx += param * xDist; + dy += param * yDist; + if (xDist == 0 && yDist == 0) { + const sign = i < j ? 1 : -1; + dx += param * sign; + dy += param * sign; + } + } + } + } + return [dx, dy]; + } + calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { // + let dx = 0, dy = 0; + const vx = currentNode[0] - this.u_Center[0]; + const vy = currentNode[1] - this.u_Center[1]; + const gf = 0.01 * this.u_K * this.u_Gravity; + dx = gf * vx; + dy = gf * vy; + if (this.u_Clustering == 1) { + const clusterIdx = int(nodeAttributes[0]); + const center = this.u_ClusterCenters[clusterIdx]; + const cvx = currentNode[0] - center[0]; + const cvy = currentNode[1] - center[1]; + const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01; + const parma = this.u_K * this.u_ClusterGravity / dist; + dx += parma * cvx; + dy += parma * cvy; + } + return [dx, dy]; + } + calcAttractive(i: int, currentNode: vec4): vec2 { + let dx = 0, dy = 0; + const arr_offset = int(floor(currentNode[2] + 0.5)); + const length = int(floor(currentNode[3] + 0.5)); + const node_buffer: vec4; + for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) { + if (p >= length) break; + const arr_idx = arr_offset + p; + // when arr_idx % 4 == 0 update currentNodedx_buffer + const buf_offset = arr_idx - arr_idx / 4 * 4; + if (p == 0 || buf_offset == 0) { + node_buffer = this.u_Data[int(arr_idx / 4)]; + } + const float_j = buf_offset == 0 ? node_buffer[0] : + buf_offset == 1 ? node_buffer[1] : + buf_offset == 2 ? node_buffer[2] : + node_buffer[3]; + const nextNode = this.u_Data[int(float_j)]; + const xDist = currentNode[0] - nextNode[0]; + const yDist = currentNode[1] - nextNode[1]; + const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01; + let attractiveF = dist / this.u_K; + + if (dist > 0.0) { + dx -= xDist * attractiveF; + dy -= yDist * attractiveF; + if (xDist == 0 && yDist == 0) { + const sign = i < int(float_j) ? 1 : -1; + dx -= sign * attractiveF; + dy -= sign * attractiveF; + } + } + } + return [dx, dy]; + } + @main + compute() { + const i = globalInvocationID.x; + const currentNode = this.u_Data[i]; + let dx = 0, dy = 0; + if (i >= VERTEX_COUNT) { + this.u_Data[i] = currentNode; + return; + } + + // [gravity, fx, fy, 0] + const nodeAttributes = this.u_AttributeArray[i]; + + if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) { + // the node is fixed + this.u_Data[i] = [ + nodeAttributes[1], + nodeAttributes[2], + currentNode[2], + currentNode[3] + ]; + return; + } + + // repulsive + const repulsive = this.calcRepulsive(i, currentNode); + dx += repulsive[0]; + dy += repulsive[1]; + // attractive + const attractive = this.calcAttractive(i, currentNode); + dx += attractive[0]; + dy += attractive[1]; + // gravity + const gravity = this.calcGravity(currentNode, nodeAttributes); + dx -= gravity[0]; + dy -= gravity[1]; + // speed + dx *= this.u_Speed; + dy *= this.u_Speed; + + // move + const distLength = sqrt(dx * dx + dy * dy); + if (distLength > 0.0) { + const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength); + this.u_Data[i] = [ + currentNode[0] + dx / distLength * limitedDist, + currentNode[1] + dy / distLength * limitedDist, + currentNode[2], + currentNode[3] + ]; + } + } +} +`,z.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[]","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","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[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_Data","size":[1,1],"length":1},"needPingpong":true}}',z.clusterCode=` +import { globalInvocationID } from 'g-webgpu'; +const VERTEX_COUNT; +const CLUSTER_COUNT; +@numthreads(1, 1, 1) +class CalcCenter { + @in + u_Data: vec4[]; + @in + u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...] + @in @out + u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...] + @main + compute() { + const i = globalInvocationID.x; + const center = this.u_ClusterCenters[i]; + let sumx = 0; + let sumy = 0; + let count = 0; + for (let j = 0; j < VERTEX_COUNT; j++) { + const attributes = this.u_NodeAttributes[j]; + const clusterIdx = int(attributes[0]); + const vertex = this.u_Data[j]; + if (clusterIdx == i) { + sumx += vertex.x; + sumy += vertex.y; + count += 1; + } + } + this.u_ClusterCenters[i] = [ + sumx / count, + sumy / count, + count, + i + ]; + } +} +`,z.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[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributes","type":"vec4[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_ClusterCenters","type":"vec4[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_ClusterCenters","size":[1,1],"length":1},"needPingpong":true}}'},785194:function(Ve,z,C){"use strict";var x=this&&this.__extends||function(){var A=function(E,D){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(F,Y){F.__proto__=Y}||function(F,Y){for(var b in Y)Object.prototype.hasOwnProperty.call(Y,b)&&(F[b]=Y[b])},A(E,D)};return function(E,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");A(E,D);function F(){this.constructor=E}E.prototype=D===null?Object.create(D):(F.prototype=D.prototype,new F)}}(),k=this&&this.__awaiter||function(A,E,D,F){function Y(b){return b instanceof D?b:new D(function(h){h(b)})}return new(D||(D=Promise))(function(b,h){function $(V){try{W(F.next(V))}catch(H){h(H)}}function U(V){try{W(F.throw(V))}catch(H){h(H)}}function W(V){V.done?b(V.value):Y(V.value).then($,U)}W((F=F.apply(A,E||[])).next())})},w=this&&this.__generator||function(A,E){var D={label:0,sent:function(){if(b[0]&1)throw b[1];return b[1]},trys:[],ops:[]},F,Y,b,h;return h={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(h[Symbol.iterator]=function(){return this}),h;function $(W){return function(V){return U([W,V])}}function U(W){if(F)throw new TypeError("Generator is already executing.");for(;h&&(h=0,W[0]&&(D=0)),D;)try{if(F=1,Y&&(b=W[0]&2?Y.return:W[0]?Y.throw||((b=Y.return)&&b.call(Y),0):Y.next)&&!(b=b.call(Y,W[1])).done)return b;switch(Y=0,b&&(W=[W[0]&2,b.value]),W[0]){case 0:case 1:b=W;break;case 4:return D.label++,{value:W[1],done:!1};case 5:D.label++,Y=W[1],W=[0];continue;case 7:W=D.ops.pop(),D.trys.pop();continue;default:if(b=D.trys,!(b=b.length>0&&b[b.length-1])&&(W[0]===6||W[0]===2)){D=0;continue}if(W[0]===3&&(!b||W[1]>b[0]&&W[1]= length) break; + const arr_idx = arr_offset + 4 * p; // i \u8282\u70B9\u7684\u7B2C p \u6761\u8FB9\u5F00\u59CB\u7684\u5C0F\u683C\u5B50\u4F4D\u7F6E + const buf_offset = arr_idx - arr_idx / 4 * 4; + if (p == 0 || buf_offset == 0) { + 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 + } + + let float_j: float = node_buffer[0]; + + const nextNode = this.u_Data[int(float_j)]; + const vx = nextNode[0] - currentNode[0]; + const vy = nextNode[1] - currentNode[1]; + const dist = sqrt(vx * vx + vy * vy) + 0.01; + const direx = vx / dist; + const direy = vy / dist; + const edgeLength = node_buffer[1]; + const edgeStrength = node_buffer[2]; + const diff: float = edgeLength - dist;//edgeLength + // const param = diff * this.u_stiffness / mass; // + const param = diff * edgeStrength / mass; // + ax -= direx * param; + ay -= direy * param; + } + return [ax, ay]; + } + + @main + compute() { + const i = globalInvocationID.x; + const currentNode = this.u_Data[i]; + const movement = u_AveMovement[0]; + let ax = 0, ay = 0; + + if (i >= VERTEX_COUNT || movement.x < u_minMovement) { + this.u_Data[i] = currentNode; + return; + } + + // \u6BCF\u4E2A\u8282\u70B9\u5C5E\u6027\u5360\u4E24\u4E2A\u6570\u7EC4\u4E2D\u5404\u4E00\u683C + // [mass, degree, nodeStrength, fx] + const nodeAttributes1 = this.u_NodeAttributeArray1[i]; + // [centerX, centerY, centerGravity, fy] + const nodeAttributes2 = this.u_NodeAttributeArray2[i]; + + // repulsive + const repulsive = this.calcRepulsive(i, currentNode); + ax += repulsive[0]; + ay += repulsive[1]; + + // attractive + const attractive = this.calcAttractive(i, currentNode, nodeAttributes1); + ax += attractive[0]; + ay += attractive[1]; + + // gravity + const gravity = this.calcGravity(i, currentNode, nodeAttributes2); + ax -= gravity[0]; + ay -= gravity[1]; + + // speed + const param = this.u_interval * this.u_damping; + let vx = ax * param; + let vy = ay * param; + const vlength = sqrt(vx * vx + vy * vy) + 0.0001; + if (vlength > this.u_maxSpeed) { + const param2 = this.u_maxSpeed / vlength; + vx = param2 * vx; + vy = param2 * vy; + } + + // move + if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) { + this.u_Data[i] = [ + nodeAttributes1[3], + nodeAttributes2[3], + currentNode[2], + 0 + ]; + } else { + const distx = vx * this.u_interval; + const disty = vy * this.u_interval; + const distLength = sqrt(distx * distx + disty * disty); + this.u_Data[i] = [ + currentNode[0] + distx, + currentNode[1] + disty, + currentNode[2], + distLength + ]; + } + + // the avarage move distance + // need to share memory + + } +} +`,z.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[]","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[]","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[]","storageClass":"StorageBuffer","readonly":true,"writeonly":false,"size":[1,1]},{"name":"u_NodeAttributeArray2","type":"vec4[]","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}}',z.aveMovementCode=` +const VERTEX_COUNT; +@numthreads(1, 1, 1) +class CalcAveMovement { + @in + u_Data: vec4[]; + @in + u_iter: float; + @in @out + u_AveMovement: vec4[]; + @main + compute() { + let movement = 0; + for (let j: int = 0; j < VERTEX_COUNT; j++) { + const vertex = this.u_Data[j]; + movement += vertex[3]; + } + movement = movement / float(VERTEX_COUNT); + this.u_AveMovement[0] = [movement, 0, 0, 0]; + } +} +`,z.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[]","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[]","storageClass":"StorageBuffer","readonly":false,"writeonly":false,"size":[1,1]}],"globalDeclarations":[],"output":{"name":"u_AveMovement","size":[1,1],"length":1},"needPingpong":true}}'},694414:function(Ve,z,C){"use strict";var x=this&&this.__extends||function(){var L=function(P,p){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,S){m.__proto__=S}||function(m,S){for(var y in S)Object.prototype.hasOwnProperty.call(S,y)&&(m[y]=S[y])},L(P,p)};return function(P,p){if(typeof p!="function"&&p!==null)throw new TypeError("Class extends value "+String(p)+" is not a constructor or null");L(P,p);function m(){this.constructor=P}P.prototype=p===null?Object.create(p):(m.prototype=p.prototype,new m)}}();Object.defineProperty(z,"__esModule",{value:!0}),z.GridLayout=void 0;var k=C(449784),w=C(762329),T=function(L){x(P,L);function P(p){var m=L.call(this)||this;return m.begin=[0,0],m.preventOverlap=!0,m.preventOverlapPadding=10,m.condense=!1,m.sortBy="degree",m.nodes=[],m.edges=[],m.width=300,m.height=300,m.row=0,m.col=0,m.cellWidth=0,m.cellHeight=0,m.cellUsed={},m.id2manPos={},m.onLayoutEnd=function(){},m.updateCfg(p),m}return P.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}},P.prototype.execute=function(){var p=this,m=p.nodes,S=p.edges,y=p.begin,g=m.length;if(g===0)return p.onLayoutEnd&&p.onLayoutEnd(),{nodes:m,edges:S};if(g===1)return m[0].x=y[0],m[0].y=y[1],p.onLayoutEnd&&p.onLayoutEnd(),{nodes:m,edges:S};var A=p.sortBy,E=p.width,D=p.height,F=p.condense,Y=p.preventOverlapPadding,b=p.preventOverlap,h=p.nodeSpacing,$=p.nodeSize,U=[];m.forEach(function(At){U.push(At)});var W={};if(U.forEach(function(At,Z){W[At.id]=Z}),(A==="degree"||!(0,k.isString)(A)||U[0][A]===void 0)&&(A="degree",(0,k.isNaN)(m[0].degree))){var V=(0,k.getDegree)(U.length,W,S);U.forEach(function(At,Z){At.degree=V[Z].all})}U.sort(function(At,Z){return Z[A]-At[A]}),!E&&typeof window!="undefined"&&(E=window.innerWidth),!D&&typeof window!="undefined"&&(D=window.innerHeight);var H=p.rows,q=p.cols!=null?p.cols:p.columns;if(p.cells=g,H!=null&&q!=null?(p.rows=H,p.cols=q):H!=null&&q==null?(p.rows=H,p.cols=Math.ceil(p.cells/p.rows)):H==null&&q!=null?(p.cols=q,p.rows=Math.ceil(p.cells/p.cols)):(p.splits=Math.sqrt(p.cells*p.height/p.width),p.rows=Math.round(p.splits),p.cols=Math.round(p.width/p.height*p.splits)),p.rows=Math.max(p.rows,1),p.cols=Math.max(p.cols,1),p.cols*p.rows>p.cells){var tt=p.small(),rt=p.large();(tt-1)*rt>=p.cells?p.small(tt-1):(rt-1)*tt>=p.cells&&p.large(rt-1)}else for(;p.cols*p.rows=p.cells?p.large(rt+1):p.small(tt+1)}if(p.cellWidth=E/p.cols,p.cellHeight=D/p.rows,F&&(p.cellWidth=0,p.cellHeight=0),b||h){var ft=(0,k.getFuncByUnknownType)(10,h),it=(0,k.getFuncByUnknownType)(30,$,!1);U.forEach(function(At){(!At.x||!At.y)&&(At.x=0,At.y=0);var Z=it(At)||30,J,yt;(0,k.isArray)(Z)?(J=Z[0],yt=Z[1]):(J=Z,yt=Z);var _t=ft!==void 0?ft(At):Y,nt=J+_t,vt=yt+_t;p.cellWidth=Math.max(p.cellWidth,nt),p.cellHeight=Math.max(p.cellHeight,vt)})}p.cellUsed={},p.row=0,p.col=0,p.id2manPos={};for(var bt=0;bt=m&&(p.col=0,p.row++)},P.prototype.getPos=function(p){var m=this,S=m.begin,y=m.cellWidth,g=m.cellHeight,A,E,D=m.id2manPos[p.id];if(D)A=D.col*y+y/2+S[0],E=D.row*g+g/2+S[1];else{for(;m.used(m.row,m.col);)m.moveToNextCell();A=m.col*y+y/2+S[0],E=m.row*g+g/2+S[1],m.use(m.row,m.col),m.moveToNextCell()}p.x=A,p.y=E},P.prototype.getType=function(){return"grid"},P}(w.Base);z.GridLayout=T},702584:function(Ve,z,C){"use strict";var x=this&&this.__createBinding||(Object.create?function(V,H,q,tt){tt===void 0&&(tt=q);var rt=Object.getOwnPropertyDescriptor(H,q);(!rt||("get"in rt?!H.__esModule:rt.writable||rt.configurable))&&(rt={enumerable:!0,get:function(){return H[q]}}),Object.defineProperty(V,tt,rt)}:function(V,H,q,tt){tt===void 0&&(tt=q),V[tt]=H[q]}),k=this&&this.__exportStar||function(V,H){for(var q in V)q!=="default"&&!Object.prototype.hasOwnProperty.call(H,q)&&x(H,V,q)};Object.defineProperty(z,"__esModule",{value:!0}),z.ERLayout=z.ForceAtlas2Layout=z.ComboCombinedLayout=z.ComboForceLayout=z.GForceGPULayout=z.FruchtermanGPULayout=z.FruchtermanLayout=z.MDSLayout=z.ConcentricLayout=z.RadialLayout=z.DagreCompoundLayout=z.DagreLayout=z.CircularLayout=z.ForceLayout=z.Force2Layout=z.GForceLayout=z.RandomLayout=z.GridLayout=z.Layouts=z.Layout=void 0;var w=C(694414);Object.defineProperty(z,"GridLayout",{enumerable:!0,get:function(){return w.GridLayout}});var T=C(539711);Object.defineProperty(z,"RandomLayout",{enumerable:!0,get:function(){return T.RandomLayout}});var L=C(113653);Object.defineProperty(z,"GForceLayout",{enumerable:!0,get:function(){return L.GForceLayout}});var P=C(306740);Object.defineProperty(z,"Force2Layout",{enumerable:!0,get:function(){return P.Force2Layout}});var p=C(885717);Object.defineProperty(z,"ForceLayout",{enumerable:!0,get:function(){return p.ForceLayout}});var m=C(964885);Object.defineProperty(z,"CircularLayout",{enumerable:!0,get:function(){return m.CircularLayout}});var S=C(920171);Object.defineProperty(z,"DagreLayout",{enumerable:!0,get:function(){return S.DagreLayout}});var y=C(177057);Object.defineProperty(z,"DagreCompoundLayout",{enumerable:!0,get:function(){return y.DagreCompoundLayout}});var g=C(847944);Object.defineProperty(z,"RadialLayout",{enumerable:!0,get:function(){return g.RadialLayout}});var A=C(843281);Object.defineProperty(z,"ConcentricLayout",{enumerable:!0,get:function(){return A.ConcentricLayout}});var E=C(352899);Object.defineProperty(z,"MDSLayout",{enumerable:!0,get:function(){return E.MDSLayout}});var D=C(880374);Object.defineProperty(z,"FruchtermanLayout",{enumerable:!0,get:function(){return D.FruchtermanLayout}});var F=C(687745);Object.defineProperty(z,"FruchtermanGPULayout",{enumerable:!0,get:function(){return F.FruchtermanGPULayout}});var Y=C(785194);Object.defineProperty(z,"GForceGPULayout",{enumerable:!0,get:function(){return Y.GForceGPULayout}});var b=C(366590);Object.defineProperty(z,"ComboForceLayout",{enumerable:!0,get:function(){return b.ComboForceLayout}});var h=C(263861);Object.defineProperty(z,"ComboCombinedLayout",{enumerable:!0,get:function(){return h.ComboCombinedLayout}});var $=C(148564);Object.defineProperty(z,"ForceAtlas2Layout",{enumerable:!0,get:function(){return $.ForceAtlas2Layout}});var U=C(290441);Object.defineProperty(z,"ERLayout",{enumerable:!0,get:function(){return U.ERLayout}});var W=C(842875);Object.defineProperty(z,"Layout",{enumerable:!0,get:function(){return W.Layout}}),Object.defineProperty(z,"Layouts",{enumerable:!0,get:function(){return W.Layouts}}),k(C(932867),z)},842875:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.Layouts=z.Layout=void 0;var x=C(695326),k=C(694414),w=C(539711),T=C(306740),L=C(113653),P=C(885717),p=C(964885),m=C(920171),S=C(847944),y=C(843281),g=C(352899),A=C(880374),E=C(687745),D=C(785194),F=C(366590),Y=C(263861),b=C(148564),h=C(290441),$=C(177057),U=C(449784),W=function(){function V(H){var q=(0,x.getLayoutByName)(H.type);this.layoutInstance=new q(H)}return V.prototype.layout=function(H){return this.layoutInstance.layout(H)},V.prototype.updateCfg=function(H){this.layoutInstance.updateCfg(H)},V.prototype.init=function(H){this.correctLayers(H.nodes),this.layoutInstance.init(H)},V.prototype.correctLayers=function(H){if(H!=null&&H.length){var q=1/0,tt=[];if(H.forEach(function(ft){(0,U.isString)(ft.layer)&&(ft.layer=parseInt(ft.layer,10)),!(ft.layer===void 0||isNaN(ft.layer))&&(tt.push(ft),ft.layerY[0]?Y[0]:rt-Y[0],bt=ft-Y[1]>Y[1]?Y[1]:ft-Y[1];it===0&&(it=rt/2),bt===0&&(bt=ft/2);var gt=bt>it?it:bt,Xt=Math.max.apply(Math,tt),Ct=[];tt.forEach(function(ue,ie){E.unitRadius||(E.unitRadius=gt/Xt),Ct[ie]=ue*E.unitRadius}),E.radii=Ct;var At=E.eIdealDisMatrix();E.eIdealDistances=At;var Z=p(At);E.weights=Z;var J=new L.default({linkDistance:b,distances:At}),yt=J.layout();yt.forEach(function(ue){(0,w.isNaN)(ue[0])&&(ue[0]=Math.random()*b),(0,w.isNaN)(ue[1])&&(ue[1]=Math.random()*b)}),E.positions=yt,yt.forEach(function(ue,ie){D[ie].x=ue[0]+Y[0],D[ie].y=ue[1]+Y[1]}),yt.forEach(function(ue){ue[0]-=yt[W][0],ue[1]-=yt[W][1]}),E.run();var _t=E.preventOverlap,nt=E.nodeSize,vt,It=E.strictRadial;if(_t){var Pt=E.nodeSpacing,St;(0,w.isNumber)(Pt)?St=function(){return Pt}:(0,w.isFunction)(Pt)?St=Pt:St=function(){return 0},nt?(0,w.isArray)(nt)?vt=function(ue){var ie=nt[0]>nt[1]?nt[0]:nt[1];return ie+St(ue)}:vt=function(ue){return nt+St(ue)}:vt=function(ue){if(ue.size){if((0,w.isArray)(ue.size)){var ie=ue.size[0]>ue.size[1]?ue.size[0]:ue.size[1];return ie+St(ue)}if((0,w.isObject)(ue.size)){var ie=ue.size.width>ue.size.height?ue.size.width:ue.size.height;return ie+St(ue)}return ue.size+St(ue)}return 10+St(ue)};var Dt={nodes:D,nodeSizeFunc:vt,adjMatrix:V,positions:yt,radii:Ct,height:ft,width:rt,strictRadial:It,focusID:W,iterations:E.maxPreventOverlapIteration||200,k:yt.length/4.5},Qt=new P.default(Dt);yt=Qt.layout()}return yt.forEach(function(ue,ie){D[ie].x=ue[0]+Y[0],D[ie].y=ue[1]+Y[1]}),E.onLayoutEnd&&E.onLayoutEnd(),{nodes:D,edges:F}},A.prototype.run=function(){for(var E=this,D=E.maxIteration,F=E.positions||[],Y=E.weights||[],b=E.eIdealDistances||[],h=E.radii||[],$=0;$<=D;$++){var U=$/D;E.oneIteration(U,F,h,b,Y)}},A.prototype.oneIteration=function(E,D,F,Y,b){var h=this,$=1-E,U=h.focusIndex;D.forEach(function(W,V){var H=S(W,[0,0]),q=H===0?0:1/H;if(V!==U){var tt=0,rt=0,ft=0;D.forEach(function(bt,gt){if(V!==gt){var Xt=S(W,bt),Ct=Xt===0?0:1/Xt,At=Y[gt][V];ft+=b[V][gt],tt+=b[V][gt]*(bt[0]+At*(W[0]-bt[0])*Ct),rt+=b[V][gt]*(bt[1]+At*(W[1]-bt[1])*Ct)}});var it=F[V]===0?0:1/F[V];ft*=$,ft+=E*it*it,tt*=$,tt+=E*it*W[0]*q,W[0]=tt/ft,rt*=$,rt+=E*it*W[1]*q,W[1]=rt/ft}})},A.prototype.eIdealDisMatrix=function(){var E=this,D=E.nodes;if(!D)return[];var F=E.distances,Y=E.linkDistance,b=E.radii||[],h=E.unitRadius||50,$=[];return F&&F.forEach(function(U,W){var V=[];U.forEach(function(H,q){if(W===q)V.push(0);else if(b[W]===b[q])if(E.sortBy==="data")V.push(H*(Math.abs(W-q)*E.sortStrength)/(b[W]/h));else if(E.sortBy){var tt=D[W][E.sortBy]||0,rt=D[q][E.sortBy]||0;(0,w.isString)(tt)&&(tt=tt.charCodeAt(0)),(0,w.isString)(rt)&&(rt=rt.charCodeAt(0)),V.push(H*(Math.abs(tt-rt)*E.sortStrength)/(b[W]/h))}else V.push(H*Y/(b[W]/h));else{var ft=(Y+h)/2;V.push(H*ft)}}),$.push(V)}),$},A.prototype.handleInfinity=function(E,D,F){for(var Y=E.length,b=0;bF?E[D][Y]:F);return F},A.prototype.getType=function(){return"radial"},A}(T.Base);z.RadialLayout=y},706290:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0});var C=800,x=function(){function k(w){this.disp=[],this.positions=w.positions,this.adjMatrix=w.adjMatrix,this.focusID=w.focusID,this.radii=w.radii,this.iterations=w.iterations||10,this.height=w.height||10,this.width=w.width||10,this.speed=w.speed||100,this.gravity=w.gravity||10,this.nodeSizeFunc=w.nodeSizeFunc,this.k=w.k||5,this.strictRadial=w.strictRadial,this.nodes=w.nodes}return k.prototype.layout=function(){var w=this,T=w.positions,L=[],P=w.iterations,p=w.width/10;w.maxDisplace=p,w.disp=L;for(var m=0;mA?1:-1;E=.01*Y,D=.01*Y}if(FMath.PI/2&&($-=Math.PI/2,Y*=-1,b*=-1);var U=Math.cos($)*h;g.x=Y*U,g.y=b*U});var y=w.radii;T.forEach(function(g,A){if(A!==m){var E=Math.sqrt(L[A].x*L[A].x+L[A].y*L[A].y);if(E>0&&A!==m){var D=Math.min(S*(P/C),E);if(g[0]+=L[A].x/E*D,g[1]+=L[A].y/E*D,p){var F=g[0]-T[m][0],Y=g[1]-T[m][1],b=Math.sqrt(F*F+Y*Y);F=F/b*y[A],Y=Y/b*y[A],g[0]=T[m][0]+F,g[1]=T[m][1]+Y}}}})},k}();z.default=x},539711:function(Ve,z,C){"use strict";var x=this&&this.__extends||function(){var T=function(L,P){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,m){p.__proto__=m}||function(p,m){for(var S in m)Object.prototype.hasOwnProperty.call(m,S)&&(p[S]=m[S])},T(L,P)};return function(L,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");T(L,P);function p(){this.constructor=L}L.prototype=P===null?Object.create(P):(p.prototype=P.prototype,new p)}}();Object.defineProperty(z,"__esModule",{value:!0}),z.RandomLayout=void 0;var k=C(762329),w=function(T){x(L,T);function L(P){var p=T.call(this)||this;return p.center=[0,0],p.width=300,p.height=300,p.nodes=[],p.edges=[],p.onLayoutEnd=function(){},p.updateCfg(P),p}return L.prototype.getDefaultCfg=function(){return{center:[0,0],width:300,height:300}},L.prototype.execute=function(){var P=this,p=P.nodes,m=.9,S=P.center;return!P.width&&typeof window!="undefined"&&(P.width=window.innerWidth),!P.height&&typeof window!="undefined"&&(P.height=window.innerHeight),p&&p.forEach(function(y){y.x=(Math.random()-.5)*m*P.width+S[0],y.y=(Math.random()-.5)*m*P.height+S[1]}),P.onLayoutEnd&&P.onLayoutEnd(),{nodes:p,edges:this.edges}},L.prototype.getType=function(){return"random"},L}(k.Base);z.RandomLayout=w},932867:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0})},695326:function(Ve,z,C){"use strict";var x=this&&this.__extends||function(){var m=function(S,y){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,A){g.__proto__=A}||function(g,A){for(var E in A)Object.prototype.hasOwnProperty.call(A,E)&&(g[E]=A[E])},m(S,y)};return function(S,y){if(typeof y!="function"&&y!==null)throw new TypeError("Class extends value "+String(y)+" is not a constructor or null");m(S,y);function g(){this.constructor=S}S.prototype=y===null?Object.create(y):(g.prototype=y.prototype,new g)}}();Object.defineProperty(z,"__esModule",{value:!0}),z.getLayoutByName=z.unRegisterLayout=z.registerLayout=void 0;var k=C(762329),w=C(449784),T=new Map,L=function(m,S){if(T.get(m)&&console.warn("The layout with the name ".concat(m," exists already, it will be overridden")),(0,w.isObject)(S)){var y=function(g){x(A,g);function A(E){var D=this,F;D=g.call(this)||this;var Y=D,b={},h=Object.assign({},Y.getDefaultCfg(),((F=S.getDefaultCfg)===null||F===void 0?void 0:F.call(S))||{});return Object.assign(b,h,S,E),Object.keys(b).forEach(function($){var U=b[$];Y[$]=U}),D}return A}(k.Base);T.set(m,y)}else T.set(m,S);return T.get(m)};z.registerLayout=L;var P=function(m){T.has(m)&&T.delete(m)};z.unRegisterLayout=P;var p=function(m){return T.has(m)?T.get(m):null};z.getLayoutByName=p},185087:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.isArray=void 0,z.isArray=Array.isArray},578732:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.getFuncByUnknownType=z.getFunc=z.isFunction=void 0;var x=C(449784),k=C(330627),w=function(P){return typeof P=="function"};z.isFunction=w;var T=function(P,p,m){var S;return m?S=m:(0,k.isNumber)(P)?S=function(){return P}:S=function(){return p},S};z.getFunc=T;var L=function(P,p,m){return m===void 0&&(m=!0),!p&&p!==0?function(S){return S.size?(0,x.isArray)(S.size)?S.size[0]>S.size[1]?S.size[0]:S.size[1]:(0,x.isObject)(S.size)?S.size.width>S.size.height?S.size.width:S.size.height:S.size:P}:(0,z.isFunction)(p)?p:(0,k.isNumber)(p)?function(){return p}:(0,x.isArray)(p)?function(){if(m){var S=Math.max.apply(Math,p);return isNaN(S)?P:S}return p}:(0,x.isObject)(p)?function(){if(m){var S=Math.max(p.width,p.height);return isNaN(S)?P:S}return[p.width,p.height]}:function(){return P}};z.getFuncByUnknownType=L},248835:function(Ve,z,C){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.arrayToTextureData=z.attributesToTextureData=z.buildTextureDataWithTwoEdgeAttr=z.buildTextureData=z.proccessToFunc=void 0;var x=C(449784),k=C(280628),w=function(m,S){var y;return m?(0,x.isNumber)(m)?y=function(){return m}:y=m:y=function(){return S||1},y};z.proccessToFunc=w;var T=function(m,S){var y=[],g=[],A={},E=0;for(E=0;E$[W][H]+$[H][V]&&($[W][V]=$[W][H]+$[H][V]);return $};z.floydWarshall=p;var m=function(h,$){var U=h.nodes,W=h.edges,V=[],H={};if(!U)throw new Error("invalid nodes data!");return U&&U.forEach(function(q,tt){H[q.id]=tt;var rt=[];V.push(rt)}),W==null||W.forEach(function(q){var tt=(0,z.getEdgeTerminal)(q,"source"),rt=(0,z.getEdgeTerminal)(q,"target"),ft=H[tt],it=H[rt];ft===void 0||it===void 0||(V[ft][it]=1,$||(V[it][ft]=1))}),V};z.getAdjMatrix=m;var S=function(h,$){var U=[];return h.forEach(function(W){var V=[];W.forEach(function(H){V.push(H*$)}),U.push(V)}),U};z.scaleMatrix=S;var y=function(h,$){if(h&&h.children){for(var U=h.children.length-1;U>=0;U--)if(!y(h.children[U],$))return}return!!$(h)},g=function(h,$){typeof $=="function"&&y(h,$)};z.traverseTreeUp=g;var A=function(h){var $=1/0,U=1/0,W=-1/0,V=-1/0;return h.forEach(function(H){var q=H.size;(0,x.isArray)(q)?q.length===1&&(q=[q[0],q[0]]):(0,k.isNumber)(q)?q=[q,q]:(q===void 0||isNaN(q))&&(q=[30,30]);var tt=[q[0]/2,q[1]/2],rt=H.x-tt[0],ft=H.x+tt[0],it=H.y-tt[1],bt=H.y+tt[1];$>rt&&($=rt),U>it&&(U=it),W1?1:Number(Nt),le=lt.length-1,Ie=Math.floor(le*Vt),nr=le*Vt-Ie,fr=lt[Ie],Gr=Ie===le?fr:lt[Ie+1];return w([m(fr,Gr,nr,0),m(fr,Gr,nr,1),m(fr,Gr,nr,2)])}function y(lt){var Nt=typeof lt=="string"?lt.split("-"):lt,Vt=Nt.map(function(le){return x(le.indexOf("#")===-1?p(le):le)});return function(le){return S(Vt,le)}}var g=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,A=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,E=/[\d.]+:(#[^\s]+|[^)]+\))/gi;function D(lt){return/^[r,R,L,l]{1}[\s]*\(/.test(lt)}function F(lt){if(D(lt)){var Nt,Vt=void 0;if(lt[0]==="l"){var le=g.exec(lt),Ie=+le[1]+90;Vt=le[2],Nt="linear-gradient("+Ie+"deg, "}else if(lt[0]==="r"){Nt="radial-gradient(";var le=A.exec(lt);Vt=le[4]}var nr=Vt.match(E);return nr.forEach(function(fr,Gr){var vn=fr.split(":");Nt+=vn[1]+" "+Number(vn[0])*100+"%",Gr!==nr.length-1&&(Nt+=", ")}),Nt+=")",Nt}return lt}var Y=C(935600),b=C(631437);function h(lt,Nt,Vt){var le=[0,0,0,0,0,0,0,0,0];return Y.fromTranslation(le,Vt),Y.multiply(lt,le,Nt)}function $(lt,Nt,Vt){var le=[0,0,0,0,0,0,0,0,0];return Y.fromRotation(le,Vt),Y.multiply(lt,le,Nt)}function U(lt,Nt,Vt){var le=[0,0,0,0,0,0,0,0,0];return Y.fromScaling(le,Vt),Y.multiply(lt,le,Nt)}function W(lt,Nt,Vt){return Y.multiply(lt,Vt,Nt)}function V(lt,Nt){for(var Vt=lt?[].concat(lt):[1,0,0,0,1,0,0,0,1],le=0,Ie=Nt.length;le=0;return Vt?Ie?Math.PI*2-le:le:Ie?le:Math.PI*2-le}function tt(lt,Nt,Vt){return Vt?(lt[0]=Nt[1],lt[1]=-1*Nt[0]):(lt[0]=-1*Nt[1],lt[1]=Nt[0]),lt}function rt(lt){return lt.map(function(Nt){return Array.isArray(Nt)?[].concat(Nt):Nt})}function ft(lt,Nt){if(Nt==="off")return rt(lt);var Vt=typeof Nt=="number"&&Nt>=1?Math.pow(10,Nt):1;return lt.map(function(le){var Ie=le.slice(1).map(Number).map(function(nr){return Nt?Math.round(nr*Vt)/Vt:Math.round(nr)});return[le[0]].concat(Ie)})}function it(lt,Nt){return Nt===void 0&&(Nt="off"),ft(lt,Nt).map(function(Vt){return Vt[0]+Vt.slice(1).join(" ")}).join("")}var bt=C(197582),gt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Xt(lt,Nt,Vt){if(lt[Vt].length>7){lt[Vt].shift();for(var le=lt[Vt],Ie=Vt;le.length;)Nt[Vt]="A",lt.splice(Ie+=1,0,["C"].concat(le.splice(0,6)));lt.splice(Vt,1)}}var Ct={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function At(lt){return Array.isArray(lt)&<.every(function(Nt){var Vt=Nt[0].toLowerCase();return Ct[Vt]===Nt.length-1&&"achlmqstvz".includes(Vt)})}function Z(lt){return At(lt)&<.every(function(Nt){var Vt=Nt[0];return Vt===Vt.toUpperCase()})}function J(lt){return Z(lt)&<.every(function(Nt){var Vt=Nt[0];return"ACLMQZ".includes(Vt)})}function yt(lt){for(var Nt=lt.pathValue[lt.segmentStart],Vt=Nt.toLowerCase(),le=lt.data;le.length>=Ct[Vt]&&(Vt==="m"&&le.length>2?(lt.segments.push([Nt].concat(le.splice(0,2))),Vt="l",Nt=Nt==="m"?"l":"L"):lt.segments.push([Nt].concat(le.splice(0,Ct[Vt]))),!!Ct[Vt]););}function _t(lt){var Nt=lt.index,Vt=lt.pathValue,le=Vt.charCodeAt(Nt);if(le===48){lt.param=0,lt.index+=1;return}if(le===49){lt.param=1,lt.index+=1;return}lt.err='[path-util]: invalid Arc flag "'+Vt[Nt]+'", expecting 0 or 1 at index '+Nt}function nt(lt){return lt>=48&<<=57||lt===43||lt===45||lt===46}function vt(lt){return lt>=48&<<=57}function It(lt){var Nt=lt.max,Vt=lt.pathValue,le=lt.index,Ie=le,nr=!1,fr=!1,Gr=!1,vn=!1,mn;if(Ie>=Nt){lt.err="[path-util]: Invalid path value at index "+Ie+', "pathValue" is missing param';return}if(mn=Vt.charCodeAt(Ie),(mn===43||mn===45)&&(Ie+=1,mn=Vt.charCodeAt(Ie)),!vt(mn)&&mn!==46){lt.err="[path-util]: Invalid path value at index "+Ie+', "'+Vt[Ie]+'" is not a number';return}if(mn!==46){if(nr=mn===48,Ie+=1,mn=Vt.charCodeAt(Ie),nr&&Ie=5760&&Nt.includes(lt)}function St(lt){for(var Nt=lt.pathValue,Vt=lt.max;lt.index0;fr-=1){if(Qt(Ie)&&(fr===3||fr===4)?_t(lt):It(lt),lt.err.length)return;lt.data.push(lt.param),St(lt),lt.index=lt.max||!nt(Vt.charCodeAt(lt.index)))break}yt(lt)}var ie=function(){function lt(Nt){this.pathValue=Nt,this.segments=[],this.max=Nt.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return lt}();function Lt(lt){if(At(lt))return rt(lt);var Nt=new ie(lt);for(St(Nt);Nt.index1&&(hi=Math.sqrt(hi),Kn*=hi,Oa*=hi);var to=Kn*Kn,ko=Oa*Oa,so=(nr===fr?-1:1)*Math.sqrt(Math.abs((to*ko-to*Ai*Ai-ko*Vi*Vi)/(to*Ai*Ai+ko*Vi*Vi)));ri=so*Kn*Ai/Oa+(Hn+Ja)/2,xi=so*-Oa*Vi/Kn+(aa+Na)/2,Ga=Math.asin(((aa-xi)/Oa*Math.pow(10,9)>>0)/Math.pow(10,9)),ma=Math.asin(((Na-xi)/Oa*Math.pow(10,9)>>0)/Math.pow(10,9)),Ga=Hnma&&(Ga-=Math.PI*2),!fr&&ma>Ga&&(ma-=Math.PI*2)}var ks=ma-Ga;if(Math.abs(ks)>Ta){var Ou=ma,Ls=Ja,uu=Na;ma=Ga+Ta*(fr&&ma>Ga?1:-1),Ja=ri+Kn*Math.cos(ma),Na=xi+Oa*Math.sin(ma),ha=xe(Ja,Na,Kn,Oa,Ie,0,fr,Ls,uu,[ma,Ou,ri,xi])}ks=ma-Ga;var Ss=Math.cos(Ga),tu=Math.sin(Ga),Ff=Math.cos(ma),Qc=Math.sin(ma),ju=Math.tan(ks/4),vf=4/3*Kn*ju,Ec=4/3*Oa*ju,Vu=[Hn,aa],vu=[Hn+vf*tu,aa-Ec*Ss],zf=[Ja+vf*Qc,Na-Ec*Ff],Gf=[Ja,Na];if(vu[0]=2*Vu[0]-vu[0],vu[1]=2*Vu[1]-vu[1],mn)return vu.concat(zf,Gf,ha);ha=vu.concat(zf,Gf,ha);for(var wc=[],eu=0,ru=ha.length;eu=nr)fr={x:Vt,y:le};else{var Gr=we([lt,Nt],[Vt,le],Ie/nr),vn=Gr[0],mn=Gr[1];fr={x:vn,y:mn}}return{length:nr,point:fr,min:{x:Math.min(lt,Vt),y:Math.min(Nt,le)},max:{x:Math.max(lt,Vt),y:Math.max(Nt,le)}}}function _r(lt,Nt,Vt,le){var Ie=.5,nr=[lt,Nt],fr=[Vt,le],Gr=we(nr,fr,Ie),vn=we(fr,Gr,Ie),mn=we(Gr,vn,Ie),Hn=we(vn,mn,Ie),aa=we(mn,Hn,Ie),Kn=Pe(nr[0],nr[1],Gr[0],Gr[1],mn[0]).point,Oa=Pe(aa[0],aa[1],Hn[0],Hn[1],vn[0]).point;return[Kn.x,Kn.y,Oa.x,Oa.y,Vt,le]}function Ar(lt,Nt){var Vt=lt[0],le=lt.slice(1).map(Number),Ie=le[0],nr=le[1],fr,Gr=Nt.x1,vn=Nt.y1,mn=Nt.x,Hn=Nt.y;switch("TQ".includes(Vt)||(Nt.qx=null,Nt.qy=null),Vt){case"M":return Nt.x=Ie,Nt.y=nr,lt;case"A":return fr=[Gr,vn].concat(le),["C"].concat(xe(fr[0],fr[1],fr[2],fr[3],fr[4],fr[5],fr[6],fr[7],fr[8],fr[9]));case"Q":return Nt.qx=Ie,Nt.qy=nr,fr=[Gr,vn].concat(le),["C"].concat(Jt(fr[0],fr[1],fr[2],fr[3],fr[4],fr[5]));case"L":return["C"].concat(_r(Gr,vn,Ie,nr));case"Z":return Gr===mn&&vn===Hn?["C",Gr,vn,mn,Hn,mn,Hn]:["C"].concat(_r(Gr,vn,mn,Hn));default:}return lt}function Or(lt,Nt){if(Nt===void 0&&(Nt=!1),ae(lt)){var Vt=rt(lt);return Nt?[Vt,[]]:Vt}for(var le=Wt(lt),Ie=(0,bt.__assign)({},gt),nr=[],fr="",Gr=le.length,vn,mn,Hn=[],aa=0;aa1&&(Na*=Oa(ri),Ta*=Oa(ri));var xi=Math.pow(Na,2)*Math.pow(Ta,2)-Math.pow(Na,2)*Math.pow(ma.y,2)-Math.pow(Ta,2)*Math.pow(ma.x,2),Vi=Math.pow(Na,2)*Math.pow(ma.y,2)+Math.pow(Ta,2)*Math.pow(ma.x,2),Ai=xi/Vi;Ai=Ai<0?0:Ai;var hi=(nr!==fr?1:-1)*Oa(Ai),to={x:hi*(Na*ma.y/Ta),y:hi*(-(Ta*ma.x)/Na)},ko={x:Kn(ha)*to.x-aa(ha)*to.y+(lt+Gr)/2,y:aa(ha)*to.x+Kn(ha)*to.y+(Nt+vn)/2},so={x:(ma.x-to.x)/Na,y:(ma.y-to.y)/Ta},ks=cn({x:1,y:0},so),Ou={x:(-ma.x-to.x)/Na,y:(-ma.y-to.y)/Ta},Ls=cn(so,Ou);!fr&&Ls>0?Ls-=2*Ja:fr&&Ls<0&&(Ls+=2*Ja),Ls%=2*Ja;var uu=ks+Ls*mn,Ss=Na*Kn(uu),tu=Ta*aa(uu),Ff={x:Kn(ha)*Ss-aa(ha)*tu+ko.x,y:aa(ha)*Ss+Kn(ha)*tu+ko.y};return Ff}function Dn(lt,Nt,Vt,le,Ie,nr,fr,Gr,vn,mn,Hn){var aa,Kn=Hn.bbox,Oa=Kn===void 0?!0:Kn,Ja=Hn.length,Na=Ja===void 0?!0:Ja,Ta=Hn.sampleSize,ka=Ta===void 0?30:Ta,ha=typeof mn=="number",Ya=lt,Ga=Nt,ma=0,ri=[Ya,Ga,ma],xi=[Ya,Ga],Vi=0,Ai={x:0,y:0},hi=[{x:Ya,y:Ga}];ha&&mn<=0&&(Ai={x:Ya,y:Ga});for(var to=0;to<=ka;to+=1){if(Vi=to/ka,aa=an(lt,Nt,Vt,le,Ie,nr,fr,Gr,vn,Vi),Ya=aa.x,Ga=aa.y,Oa&&hi.push({x:Ya,y:Ga}),Na&&(ma+=Tt(xi,[Ya,Ga])),xi=[Ya,Ga],ha&&ma>=mn&&mn>ri[2]){var ko=(ma-mn)/(ma-ri[2]);Ai={x:xi[0]*(1-ko)+ri[0]*ko,y:xi[1]*(1-ko)+ri[1]*ko}}ri=[Ya,Ga,ma]}return ha&&mn>=ma&&(Ai={x:Gr,y:vn}),{length:ma,point:Ai,min:{x:Math.min.apply(null,hi.map(function(so){return so.x})),y:Math.min.apply(null,hi.map(function(so){return so.y}))},max:{x:Math.max.apply(null,hi.map(function(so){return so.x})),y:Math.max.apply(null,hi.map(function(so){return so.y}))}}}function Un(lt,Nt,Vt,le,Ie,nr,fr,Gr,vn){var mn=1-vn;return{x:Math.pow(mn,3)*lt+3*Math.pow(mn,2)*vn*Vt+3*mn*Math.pow(vn,2)*Ie+Math.pow(vn,3)*fr,y:Math.pow(mn,3)*Nt+3*Math.pow(mn,2)*vn*le+3*mn*Math.pow(vn,2)*nr+Math.pow(vn,3)*Gr}}function Xn(lt,Nt,Vt,le,Ie,nr,fr,Gr,vn,mn){var Hn,aa=mn.bbox,Kn=aa===void 0?!0:aa,Oa=mn.length,Ja=Oa===void 0?!0:Oa,Na=mn.sampleSize,Ta=Na===void 0?10:Na,ka=typeof vn=="number",ha=lt,Ya=Nt,Ga=0,ma=[ha,Ya,Ga],ri=[ha,Ya],xi=0,Vi={x:0,y:0},Ai=[{x:ha,y:Ya}];ka&&vn<=0&&(Vi={x:ha,y:Ya});for(var hi=0;hi<=Ta;hi+=1){if(xi=hi/Ta,Hn=Un(lt,Nt,Vt,le,Ie,nr,fr,Gr,xi),ha=Hn.x,Ya=Hn.y,Kn&&Ai.push({x:ha,y:Ya}),Ja&&(Ga+=Tt(ri,[ha,Ya])),ri=[ha,Ya],ka&&Ga>=vn&&vn>ma[2]){var to=(Ga-vn)/(Ga-ma[2]);Vi={x:ri[0]*(1-to)+ma[0]*to,y:ri[1]*(1-to)+ma[1]*to}}ma=[ha,Ya,Ga]}return ka&&vn>=Ga&&(Vi={x:fr,y:Gr}),{length:Ga,point:Vi,min:{x:Math.min.apply(null,Ai.map(function(ko){return ko.x})),y:Math.min.apply(null,Ai.map(function(ko){return ko.y}))},max:{x:Math.max.apply(null,Ai.map(function(ko){return ko.x})),y:Math.max.apply(null,Ai.map(function(ko){return ko.y}))}}}function xr(lt,Nt,Vt,le,Ie,nr,fr){var Gr=1-fr;return{x:Math.pow(Gr,2)*lt+2*Gr*fr*Vt+Math.pow(fr,2)*Ie,y:Math.pow(Gr,2)*Nt+2*Gr*fr*le+Math.pow(fr,2)*nr}}function $e(lt,Nt,Vt,le,Ie,nr,fr,Gr){var vn,mn=Gr.bbox,Hn=mn===void 0?!0:mn,aa=Gr.length,Kn=aa===void 0?!0:aa,Oa=Gr.sampleSize,Ja=Oa===void 0?10:Oa,Na=typeof fr=="number",Ta=lt,ka=Nt,ha=0,Ya=[Ta,ka,ha],Ga=[Ta,ka],ma=0,ri={x:0,y:0},xi=[{x:Ta,y:ka}];Na&&fr<=0&&(ri={x:Ta,y:ka});for(var Vi=0;Vi<=Ja;Vi+=1){if(ma=Vi/Ja,vn=xr(lt,Nt,Vt,le,Ie,nr,ma),Ta=vn.x,ka=vn.y,Hn&&xi.push({x:Ta,y:ka}),Kn&&(ha+=Tt(Ga,[Ta,ka])),Ga=[Ta,ka],Na&&ha>=fr&&fr>Ya[2]){var Ai=(ha-fr)/(ha-Ya[2]);ri={x:Ga[0]*(1-Ai)+Ya[0]*Ai,y:Ga[1]*(1-Ai)+Ya[1]*Ai}}Ya=[Ta,ka,ha]}return Na&&fr>=ha&&(ri={x:Ie,y:nr}),{length:ha,point:ri,min:{x:Math.min.apply(null,xi.map(function(hi){return hi.x})),y:Math.min.apply(null,xi.map(function(hi){return hi.y}))},max:{x:Math.max.apply(null,xi.map(function(hi){return hi.x})),y:Math.max.apply(null,xi.map(function(hi){return hi.y}))}}}function Tr(lt,Nt,Vt){for(var le,Ie,nr,fr,Gr,vn,mn=Wt(lt),Hn=typeof Nt=="number",aa,Kn=[],Oa,Ja=0,Na=0,Ta=0,ka=0,ha,Ya=[],Ga=[],ma=0,ri={x:0,y:0},xi=ri,Vi=ri,Ai=ri,hi=0,to=0,ko=mn.length;to=Nt&&(Ai=Vi),Ga.push(xi),Ya.push(ri),hi+=ma,vn=Oa!=="Z"?ha.slice(-2):[Ta,ka],Ja=vn[0],Na=vn[1];return Hn&&Nt>=hi&&(Ai={x:Ja,y:Na}),{length:hi,point:Ai,min:{x:Math.min.apply(null,Ya.map(function(so){return so.x})),y:Math.min.apply(null,Ya.map(function(so){return so.y}))},max:{x:Math.max.apply(null,Ga.map(function(so){return so.x})),y:Math.max.apply(null,Ga.map(function(so){return so.y}))}}}function qr(lt,Nt){if(!lt)return{x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var Vt=Tr(lt,void 0,(0,bt.__assign)((0,bt.__assign)({},Nt),{length:!1})),le=Vt.min,Ie=le.x,nr=le.y,fr=Vt.max,Gr=fr.x,vn=fr.y,mn=Gr-Ie,Hn=vn-nr;return{width:mn,height:Hn,x:Ie,y:nr,x2:Gr,y2:vn,cx:Ie+mn/2,cy:nr+Hn/2,cz:Math.max(mn,Hn)+Math.min(mn,Hn)/2}}function gn(lt,Nt){return Tr(lt,void 0,(0,bt.__assign)((0,bt.__assign)({},Nt),{bbox:!1,length:!0})).length}function xn(lt,Nt){if(!lt)return{length:0,x:0,y:0,width:0,height:0,x2:0,y2:0,cx:0,cy:0,cz:0};var Vt=Tr(lt,void 0,(0,bt.__assign)((0,bt.__assign)({},Nt),{bbox:!0,length:!0})),le=Vt.length,Ie=Vt.min,nr=Ie.x,fr=Ie.y,Gr=Vt.max,vn=Gr.x,mn=Gr.y,Hn=vn-nr,aa=mn-fr;return{length:le,width:Hn,height:aa,x:nr,y:fr,x2:vn,y2:mn,cx:nr+Hn/2,cy:fr+aa/2,cz:Math.max(Hn,aa)+Math.min(Hn,aa)/2}}function Rn(lt){var Nt=lt.length,Vt=Nt-1;return lt.map(function(le,Ie){return lt.map(function(nr,fr){var Gr=Ie+fr,vn;return fr===0||lt[Gr]&<[Gr][0]==="M"?(vn=lt[Gr],["M"].concat(vn.slice(-2))):(Gr>=Nt&&(Gr-=Vt),lt[Gr])})})}function Mr(lt,Nt){var Vt=lt.length-1,le=[],Ie=0,nr=0,fr=Rn(lt);return fr.forEach(function(Gr,vn){lt.slice(1).forEach(function(mn,Hn){nr+=Tt(lt[(vn+Hn)%Vt].slice(-2),Nt[Hn%Vt].slice(-2))}),le[vn]=nr,nr=0}),Ie=le.indexOf(Math.min.apply(null,le)),fr[Ie]}function dn(lt,Nt,Vt,le,Ie,nr,fr,Gr){return 3*((Gr-Nt)*(Vt+Ie)-(fr-lt)*(le+nr)+le*(lt-Ie)-Vt*(Nt-nr)+Gr*(Ie+lt/3)-fr*(nr+Nt/3))/20}function hn(lt){var Nt=0,Vt=0,le=0;return Or(lt).map(function(Ie){var nr;switch(Ie[0]){case"M":return Nt=Ie[1],Vt=Ie[2],0;default:var fr=Ie.slice(1),Gr=fr[0],vn=fr[1],mn=fr[2],Hn=fr[3],aa=fr[4],Kn=fr[5];return le=dn(Nt,Vt,Gr,vn,mn,Hn,aa,Kn),nr=Ie.slice(-2),Nt=nr[0],Vt=nr[1],le}}).reduce(function(Ie,nr){return Ie+nr},0)}function sn(lt){return hn(lt)>=0}function Wn(lt,Nt,Vt){return Tr(lt,Nt,(0,bt.__assign)((0,bt.__assign)({},Vt),{bbox:!1,length:!0})).point}function Mn(lt,Nt){var Vt=Lt(lt);if(typeof Vt=="string")throw TypeError(Vt);var le=Vt.slice(),Ie=gn(le),nr=le.length-1,fr=0,Gr=0,vn=Vt[0],mn=vn.slice(-2),Hn=mn[0],aa=mn[1],Kn={x:Hn,y:aa};if(nr<=0||!Nt||!Number.isFinite(Nt))return{segment:vn,index:0,length:Gr,point:Kn,lengthAtSegment:fr};if(Nt>=Ie)return le=Vt.slice(0,-1),fr=gn(le),Gr=Ie-fr,{segment:Vt[nr],index:nr,length:Gr,lengthAtSegment:fr};for(var Oa=[];nr>0;)vn=le[nr],le=le.slice(0,-1),fr=gn(le),Gr=Ie-fr,Ie=fr,Oa.push({segment:vn,index:nr,length:Gr,lengthAtSegment:fr}),nr-=1;return Oa.find(function(Ja){var Na=Ja.lengthAtSegment;return Na<=Nt})}function In(lt,Nt){for(var Vt=Lt(lt),le=Wt(Vt),Ie=gn(Vt),nr=function(ma){var ri=ma.x-Nt.x,xi=ma.y-Nt.y;return ri*ri+xi*xi},fr=8,Gr,vn=0,mn,Hn=0,aa=1/0,Kn=0;Kn<=Ie;Kn+=fr)Gr=Wn(le,Kn),vn=nr(Gr),vn.5;)Na=Hn-fr,Oa=Wn(le,Na),ka=nr(Oa),Ta=Hn+fr,Ja=Wn(le,Ta),ha=nr(Ja),Na>=0&&ka=Kn[ka],Oa[ka]-=Ja?1:0,Ja?ha.ss:[ha.s]}).flat()});return Na[0].length===Na[1].length?Na:Ht(Na[0],Na[1],aa)}var te=function(lt){return lt!==null&&typeof lt!="function"&&isFinite(lt.length)},wt=te,Me=function(lt,Nt){return wt(lt)?lt.indexOf(Nt)>-1:!1},kt=Me,qt=function(lt,Nt){if(!wt(lt))return lt;for(var Vt=[],le=0;le-1;)Vn.call(lt,nr,1);return lt},Ea=ba,Ni=Array.prototype.splice,ti=function(Nt,Vt){if(!wt(Nt))return[];for(var le=Nt?Vt.length:0,Ie=le-1;le--;){var nr=void 0,fr=Vt[le];(le===Ie||fr!==nr)&&(nr=fr,Ni.call(Nt,fr,1))}return Nt},ei=ti,wi=function(lt,Nt,Vt){if(!Ft(lt)&&!lr(lt))return lt;var le=Vt;return Le(lt,function(Ie,nr){le=Nt(le,Ie,nr)}),le},Gi=wi,Co=function(lt,Nt){var Vt=[];if(!wt(lt))return Vt;for(var le=-1,Ie=[],nr=lt.length;++lenr[Gr])return 1;if(Ie[Gr]Vt?Vt:lt},$a=si,Fa=function(lt,Nt){var Vt=Nt.toString(),le=Vt.indexOf(".");if(le===-1)return Math.round(lt);var Ie=Vt.substr(le+1).length;return Ie>20&&(Ie=20),parseFloat(lt.toFixed(Ie))},Ui=Fa,fi=function(lt){return mt(lt,"Number")},La=fi,ja=function(lt){return La(lt)&<%1!==0},za=ja,yi=function(lt){return La(lt)&<%2===0},mi=yi,ki=Number.isInteger?Number.isInteger:function(lt){return La(lt)&<%1===0},po=ki,Wi=function(lt){return La(lt)&<<0},Ao=Wi,Vo=1e-5;function os(lt,Nt,Vt){return Vt===void 0&&(Vt=Vo),Math.abs(lt-Nt)0},io=Yi,Qa=function(lt,Nt){if(Ft(lt)){for(var Vt,le=-1/0,Ie=0;Iele&&(Vt=nr,le=fr)}return Vt}},Pi=function(lt,Nt){if(Ft(lt)){for(var Vt,le=1/0,Ie=0;IeNt?(le&&(clearTimeout(le),le=null),Gr=Hn,fr=lt.apply(Ie,nr),le||(Ie=nr=null)):!le&&Vt.trailing!==!1&&(le=setTimeout(vn,aa)),fr};return mn.cancel=function(){clearTimeout(le),Gr=0,le=Ie=nr=null},mn},gc=function(lt){return wt(lt)?Array.prototype.slice.call(lt):[]},du={},lf=function(lt){return lt=lt||"g",du[lt]?du[lt]+=1:du[lt]=1,lt+du[lt]},mc=function(){},qc=function(lt){return lt};function hu(lt){return M(lt)?0:wt(lt)?lt.length:Object.keys(lt).length}var yc=function(){function lt(){this.map={}}return lt.prototype.has=function(Nt){return this.map[Nt]!==void 0},lt.prototype.get=function(Nt,Vt){var le=this.map[Nt];return le===void 0?Vt:le},lt.prototype.set=function(Nt,Vt){this.map[Nt]=Vt},lt.prototype.clear=function(){this.map={}},lt.prototype.delete=function(Nt){delete this.map[Nt]},lt.prototype.size=function(){return Object.keys(this.map).length},lt}(),ea=yc,Au=1e-6;function ui(lt){return Math.abs(lt)0!=ui(Gr[1]-Vt)>0&&ui(Nt-(Vt-fr[1])*(fr[0]-Gr[0])/(fr[1]-Gr[1])-fr[0])<0&&(le=!le)}return le}var su=function(lt,Nt,Vt){return lt>=Nt&<<=Vt};function Bf(lt,Nt,Vt,le){var Ie=.001,nr={x:Vt.x-lt.x,y:Vt.y-lt.y},fr={x:Nt.x-lt.x,y:Nt.y-lt.y},Gr={x:le.x-Vt.x,y:le.y-Vt.y},vn=fr.x*Gr.y-fr.y*Gr.x,mn=vn*vn,Hn=fr.x*fr.x+fr.y*fr.y,aa=Gr.x*Gr.x+Gr.y*Gr.y,Kn=null;if(mn>Ie*Hn*aa){var Oa=(nr.x*Gr.y-nr.y*Gr.x)/vn,Ja=(nr.x*fr.y-nr.y*fr.x)/vn;su(Oa,0,1)&&su(Ja,0,1)&&(Kn={x:lt.x+Oa*fr.x,y:lt.y+Oa*fr.y})}return Kn}function Iu(lt){for(var Nt=[],Vt=lt.length,le=0;le1){var fr=lt[0],Gr=lt[Vt-1];Nt.push({from:{x:Gr[0],y:Gr[1]},to:{x:fr[0],y:fr[1]}})}return Nt}function xc(lt,Nt){var Vt=!1;return lt.forEach(function(le){if(Bf(le.from,le.to,Nt.from,Nt.to))return Vt=!0,!1}),Vt}function hf(lt){var Nt=lt.map(function(le){return le[0]}),Vt=lt.map(function(le){return le[1]});return{minX:Math.min.apply(null,Nt),maxX:Math.max.apply(null,Nt),minY:Math.min.apply(null,Vt),maxY:Math.max.apply(null,Vt)}}function bc(lt,Nt){return!(Nt.minX>lt.maxX||Nt.maxXlt.maxY||Nt.maxY=0;return E?F?Math.PI*2-D:D:F?D:Math.PI*2-D}x=S;function y(g,A,E){return E?(g[0]=A[1],g[1]=-1*A[0]):(g[0]=-1*A[1],g[1]=A[0]),g}x=y},413810:function(Ve,z,C){"use strict";C.r(z),C.d(z,{Cache:function(){return Ho},assign:function(){return en},augment:function(){return Pn},clamp:function(){return te},clearAnimationFrame:function(){return Nr},clone:function(){return Zn},contains:function(){return T},debounce:function(){return ya},deepMix:function(){return $a},difference:function(){return m},each:function(){return h},endsWith:function(){return Un},every:function(){return xr},extend:function(){return Ui},filter:function(){return P},find:function(){return it},findIndex:function(){return gt},firstValue:function(){return Ct},fixedBase:function(){return Me},flatten:function(){return Z},flattenDeep:function(){return yt},forIn:function(){return pe},get:function(){return $i},getEllipsisText:function(){return hs},getRange:function(){return It},getType:function(){return Gi},getWrapBehavior:function(){return hn},group:function(){return Mr},groupBy:function(){return xn},groupToMap:function(){return Rn},has:function(){return Oe},hasKey:function(){return Se},hasValue:function(){return gr},head:function(){return Or},identity:function(){return yo},includes:function(){return T},indexOf:function(){return La},isArguments:function(){return eo},isArray:function(){return F},isArrayLike:function(){return k},isBoolean:function(){return lo},isDate:function(){return ni},isDecimal:function(){return Ut},isElement:function(){return sr},isEmpty:function(){return yi},isEqual:function(){return ki},isEqualWith:function(){return po},isError:function(){return ho},isEven:function(){return ot},isFinite:function(){return Po},isFunction:function(){return A},isInteger:function(){return M},isMatch:function(){return V},isNegative:function(){return X},isNil:function(){return D},isNull:function(){return no},isNumber:function(){return qt},isNumberEqual:function(){return Ft},isObject:function(){return Y},isObjectLike:function(){return q},isOdd:function(){return ee},isPlainObject:function(){return rt},isPositive:function(){return me},isPrototype:function(){return Si},isRegExp:function(){return Jo},isString:function(){return xe},isType:function(){return g},isUndefined:function(){return de},keys:function(){return U},last:function(){return Br},lowerCase:function(){return pn},lowerFirst:function(){return ln},map:function(){return Ao},mapValues:function(){return os},max:function(){return _t},maxBy:function(){return Xe},measureTextWidth:function(){return ls},memoize:function(){return di},min:function(){return nt},minBy:function(){return pr},mix:function(){return en},mod:function(){return Pr},noop:function(){return Xi},number2color:function(){return jn},omit:function(){return Qa},parseRadius:function(){return Je},pick:function(){return io},pull:function(){return ue},pullAt:function(){return ne},reduce:function(){return Wt},remove:function(){return Ce},requestAnimationFrame:function(){return Lr},set:function(){return qa},size:function(){return Es},some:function(){return Tr},sortBy:function(){return we},startsWith:function(){return an},substitute:function(){return ca},throttle:function(){return Pi},toArray:function(){return zo},toDegree:function(){return lr},toInteger:function(){return Rr},toRadian:function(){return jt},toString:function(){return Jr},union:function(){return _r},uniq:function(){return Tt},uniqueId:function(){return rs},upperCase:function(){return Ea},upperFirst:function(){return ti},values:function(){return or},valuesOfKey:function(){return Ar},wrapBehavior:function(){return Wn}});var x=function($t){return $t!==null&&typeof $t!="function"&&isFinite($t.length)},k=x,w=function($t,ye){return k($t)?$t.indexOf(ye)>-1:!1},T=w,L=function($t,ye){if(!k($t))return $t;for(var ir=[],dr=0;dr<$t.length;dr++){var Zr=$t[dr];ye(Zr,dr)&&ir.push(Zr)}return ir},P=L,p=function($t,ye){return ye===void 0&&(ye=[]),P($t,function(ir){return!T(ye,ir)})},m=p,S={}.toString,y=function($t,ye){return S.call($t)==="[object "+ye+"]"},g=y,A=function($t){return g($t,"Function")},E=function($t){return $t==null},D=E,F=function($t){return Array.isArray?Array.isArray($t):g($t,"Array")},Y=function($t){var ye=typeof $t;return $t!==null&&ye==="object"||ye==="function"};function b($t,ye){if($t){var ir;if(F($t))for(var dr=0,Zr=$t.length;dr-1;)St.call($t,Ln,1);return $t},ue=Qt,ie=Array.prototype.splice,Lt=function(ye,ir){if(!k(ye))return[];for(var dr=ye?ir.length:0,Zr=dr-1;dr--;){var Ln=void 0,Qn=ir[dr];(dr===Zr||Qn!==Ln)&&(Ln=Qn,ie.call(ye,Qn,1))}return ye},ne=Lt,ve=function($t,ye,ir){if(!F($t)&&!rt($t))return $t;var dr=ir;return h($t,function(Zr,Ln){dr=ye(dr,Zr,Ln)}),dr},Wt=ve,ae=function($t,ye){var ir=[];if(!k($t))return ir;for(var dr=-1,Zr=[],Ln=$t.length;++drLn[Sa])return 1;if(Zr[Sa]ir?ir:$t},te=Ht,wt=function($t,ye){var ir=ye.toString(),dr=ir.indexOf(".");if(dr===-1)return Math.round($t);var Zr=ir.substr(dr+1).length;return Zr>20&&(Zr=20),parseFloat($t.toFixed(Zr))},Me=wt,kt=function($t){return g($t,"Number")},qt=kt,dt=function($t){return qt($t)&&$t%1!==0},Ut=dt,Q=function($t){return qt($t)&&$t%2===0},ot=Q,R=Number.isInteger?Number.isInteger:function($t){return qt($t)&&$t%1===0},M=R,O=function($t){return qt($t)&&$t<0},X=O,mt=1e-5;function Ft($t,ye,ir){return ir===void 0&&(ir=mt),Math.abs($t-ye)0},me=Le,Xe=function($t,ye){if(F($t)){for(var ir,dr=-1/0,Zr=0;Zr<$t.length;Zr++){var Ln=$t[Zr],Qn=A(ye)?ye(Ln):Ln[ye];Qn>dr&&(ir=Ln,dr=Qn)}return ir}},pr=function($t,ye){if(F($t)){for(var ir,dr=1/0,Zr=0;Zr<$t.length;Zr++){var Ln=$t[Zr],Qn=A(ye)?ye(Ln):Ln[ye];Qnye?(dr&&(clearTimeout(dr),dr=null),Sa=Go,Qn=$t.apply(Zr,Ln),dr||(Zr=Ln=null)):!dr&&ir.trailing!==!1&&(dr=setTimeout(Ci,zs)),Qn};return Io.cancel=function(){clearTimeout(dr),Sa=0,dr=Zr=Ln=null},Io},zo=function($t){return k($t)?Array.prototype.slice.call($t):[]},qi={},rs=function($t){return $t=$t||"g",qi[$t]?qi[$t]+=1:qi[$t]=1,$t+qi[$t]},Xi=function(){},yo=function($t){return $t};function Es($t){return D($t)?0:k($t)?$t.length:Object.keys($t).length}var ds=C(197582),oo,ls=di(function($t,ye){ye===void 0&&(ye={});var ir=ye.fontSize,dr=ye.fontFamily,Zr=ye.fontWeight,Ln=ye.fontStyle,Qn=ye.fontVariant;return oo||(oo=document.createElement("canvas").getContext("2d")),oo.font=[Ln,Qn,Zr,ir+"px",dr].join(" "),oo.measureText(xe($t)?$t:"").width},function($t,ye){return ye===void 0&&(ye={}),(0,ds.__spreadArrays)([$t],or(ye)).join("")}),hs=function($t,ye,ir,dr){dr===void 0&&(dr="...");var Zr=16,Ln=ls(dr,ir),Qn=xe($t)?$t:Jr($t),Sa=ye,Ci=[],Io,Go;if(ls($t,ir)<=ye)return $t;for(;Io=Qn.substr(0,Zr),Go=ls(Io,ir),!(Go+Ln>Sa&&Go>Sa);)if(Ci.push(Io),Sa-=Go,Qn=Qn.substr(Zr),!Qn)return Ci.join("");for(;Io=Qn.substr(0,1),Go=ls(Io,ir),!(Go+Ln>Sa);)if(Ci.push(Io),Sa-=Go,Qn=Qn.substr(1),!Qn)return Ci.join("");return""+Ci.join("")+dr},Os=function(){function $t(){this.map={}}return $t.prototype.has=function(ye){return this.map[ye]!==void 0},$t.prototype.get=function(ye,ir){var dr=this.map[ye];return dr===void 0?ir:dr},$t.prototype.set=function(ye,ir){this.map[ye]=ir},$t.prototype.clear=function(){this.map={}},$t.prototype.delete=function(ye){delete this.map[ye]},$t.prototype.size=function(){return Object.keys(this.map).length},$t}(),Ho=Os},960887:function(Ve,z,C){"use strict";C.d(z,{LB:function(){return ba},g4:function(){return Tr},we:function(){return sn},pE:function(){return ft},VK:function(){return It},Cj:function(){return wi},O1:function(){return ei},Zj:function(){return eo},VT:function(){return b},Dy:function(){return h}});var x=C(667294),k=C(973935),w=C(724285);const T={display:"none"};function L(Yt){let{id:de,value:Ge}=Yt;return x.createElement("div",{id:de,style:T},Ge)}const P={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function p(Yt){let{id:de,announcement:Ge}=Yt;return x.createElement("div",{id:de,style:P,role:"status","aria-live":"assertive","aria-atomic":!0},Ge)}function m(){const[Yt,de]=(0,x.useState)("");return{announce:(0,x.useCallback)(sr=>{sr!=null&&de(sr)},[]),announcement:Yt}}const S=(0,x.createContext)(null);function y(Yt){const de=(0,x.useContext)(S);(0,x.useEffect)(()=>{if(!de)throw new Error("useDndMonitor must be used within a children of ");return de(Yt)},[Yt,de])}function g(){const[Yt]=(0,x.useState)(()=>new Set),de=(0,x.useCallback)(sr=>(Yt.add(sr),()=>Yt.delete(sr)),[Yt]);return[(0,x.useCallback)(sr=>{let{type:Lr,event:Nr}=sr;Yt.forEach(Sr=>{var en;return(en=Sr[Lr])==null?void 0:en.call(Sr,Nr)})},[Yt]),de]}const A={draggable:` + To pick up a draggable item, press the space bar. + While dragging, use the arrow keys to move the item. + Press space again to drop the item in its new position, or press escape to cancel. + `},E={onDragStart(Yt){let{active:de}=Yt;return"Picked up draggable item "+de.id+"."},onDragOver(Yt){let{active:de,over:Ge}=Yt;return Ge?"Draggable item "+de.id+" was moved over droppable area "+Ge.id+".":"Draggable item "+de.id+" is no longer over a droppable area."},onDragEnd(Yt){let{active:de,over:Ge}=Yt;return Ge?"Draggable item "+de.id+" was dropped over droppable area "+Ge.id:"Draggable item "+de.id+" was dropped."},onDragCancel(Yt){let{active:de}=Yt;return"Dragging was cancelled. Draggable item "+de.id+" was dropped."}};function D(Yt){let{announcements:de=E,container:Ge,hiddenTextDescribedById:sr,screenReaderInstructions:Lr=A}=Yt;const{announce:Nr,announcement:Sr}=m(),en=(0,w.Ld)("DndLiveRegion"),[fn,Pn]=(0,x.useState)(!1);if((0,x.useEffect)(()=>{Pn(!0)},[]),y((0,x.useMemo)(()=>({onDragStart(Zn){let{active:pa}=Zn;Nr(de.onDragStart({active:pa}))},onDragMove(Zn){let{active:pa,over:ya}=Zn;de.onDragMove&&Nr(de.onDragMove({active:pa,over:ya}))},onDragOver(Zn){let{active:pa,over:ya}=Zn;Nr(de.onDragOver({active:pa,over:ya}))},onDragEnd(Zn){let{active:pa,over:ya}=Zn;Nr(de.onDragEnd({active:pa,over:ya}))},onDragCancel(Zn){let{active:pa,over:ya}=Zn;Nr(de.onDragCancel({active:pa,over:ya}))}}),[Nr,de])),!fn)return null;const sa=x.createElement(x.Fragment,null,x.createElement(L,{id:sr,value:Lr.draggable}),x.createElement(p,{id:en,announcement:Sr}));return Ge?(0,k.createPortal)(sa,Ge):sa}var F;(function(Yt){Yt.DragStart="dragStart",Yt.DragMove="dragMove",Yt.DragEnd="dragEnd",Yt.DragCancel="dragCancel",Yt.DragOver="dragOver",Yt.RegisterDroppable="registerDroppable",Yt.SetDroppableDisabled="setDroppableDisabled",Yt.UnregisterDroppable="unregisterDroppable"})(F||(F={}));function Y(){}function b(Yt,de){return(0,x.useMemo)(()=>({sensor:Yt,options:de!=null?de:{}}),[Yt,de])}function h(){for(var Yt=arguments.length,de=new Array(Yt),Ge=0;Ge[...de].filter(sr=>sr!=null),[...de])}const $=Object.freeze({x:0,y:0});function U(Yt,de){return Math.sqrt(Math.pow(Yt.x-de.x,2)+Math.pow(Yt.y-de.y,2))}function W(Yt,de){const Ge=getEventCoordinates(Yt);if(!Ge)return"0 0";const sr={x:(Ge.x-de.left)/de.width*100,y:(Ge.y-de.top)/de.height*100};return sr.x+"% "+sr.y+"%"}function V(Yt,de){let{data:{value:Ge}}=Yt,{data:{value:sr}}=de;return Ge-sr}function H(Yt,de){let{data:{value:Ge}}=Yt,{data:{value:sr}}=de;return sr-Ge}function q(Yt){let{left:de,top:Ge,height:sr,width:Lr}=Yt;return[{x:de,y:Ge},{x:de+Lr,y:Ge},{x:de,y:Ge+sr},{x:de+Lr,y:Ge+sr}]}function tt(Yt,de){if(!Yt||Yt.length===0)return null;const[Ge]=Yt;return de?Ge[de]:Ge}function rt(Yt,de,Ge){return de===void 0&&(de=Yt.left),Ge===void 0&&(Ge=Yt.top),{x:de+Yt.width*.5,y:Ge+Yt.height*.5}}const ft=Yt=>{let{collisionRect:de,droppableRects:Ge,droppableContainers:sr}=Yt;const Lr=rt(de,de.left,de.top),Nr=[];for(const Sr of sr){const{id:en}=Sr,fn=Ge.get(en);if(fn){const Pn=U(rt(fn),Lr);Nr.push({id:en,data:{droppableContainer:Sr,value:Pn}})}}return Nr.sort(V)},it=Yt=>{let{collisionRect:de,droppableRects:Ge,droppableContainers:sr}=Yt;const Lr=q(de),Nr=[];for(const Sr of sr){const{id:en}=Sr,fn=Ge.get(en);if(fn){const Pn=q(fn),sa=Lr.reduce((pa,ya,di)=>pa+U(Pn[di],ya),0),Zn=Number((sa/4).toFixed(4));Nr.push({id:en,data:{droppableContainer:Sr,value:Zn}})}}return Nr.sort(V)};function bt(Yt,de){const Ge=Math.max(de.top,Yt.top),sr=Math.max(de.left,Yt.left),Lr=Math.min(de.left+de.width,Yt.left+Yt.width),Nr=Math.min(de.top+de.height,Yt.top+Yt.height),Sr=Lr-sr,en=Nr-Ge;if(sr{let{collisionRect:de,droppableRects:Ge,droppableContainers:sr}=Yt;const Lr=[];for(const Nr of sr){const{id:Sr}=Nr,en=Ge.get(Sr);if(en){const fn=bt(en,de);fn>0&&Lr.push({id:Sr,data:{droppableContainer:Nr,value:fn}})}}return Lr.sort(H)};function Xt(Yt,de){const{top:Ge,left:sr,bottom:Lr,right:Nr}=de;return Ge<=Yt.y&&Yt.y<=Lr&&sr<=Yt.x&&Yt.x<=Nr}const Ct=Yt=>{let{droppableContainers:de,droppableRects:Ge,pointerCoordinates:sr}=Yt;if(!sr)return[];const Lr=[];for(const Nr of de){const{id:Sr}=Nr,en=Ge.get(Sr);if(en&&Xt(sr,en)){const Pn=q(en).reduce((Zn,pa)=>Zn+U(sr,pa),0),sa=Number((Pn/4).toFixed(4));Lr.push({id:Sr,data:{droppableContainer:Nr,value:sa}})}}return Lr.sort(V)};function At(Yt,de,Ge){return mo(Da({},Yt),{scaleX:de&&Ge?de.width/Ge.width:1,scaleY:de&&Ge?de.height/Ge.height:1})}function Z(Yt,de){return Yt&&de?{x:Yt.left-de.left,y:Yt.top-de.top}:$}function J(Yt){return function(Ge){for(var sr=arguments.length,Lr=new Array(sr>1?sr-1:0),Nr=1;Nrmo(Da({},Sr),{top:Sr.top+Yt*en.y,bottom:Sr.bottom+Yt*en.y,left:Sr.left+Yt*en.x,right:Sr.right+Yt*en.x}),Da({},Ge))}}const yt=J(1);function _t(Yt){if(Yt.startsWith("matrix3d(")){const de=Yt.slice(9,-1).split(/, /);return{x:+de[12],y:+de[13],scaleX:+de[0],scaleY:+de[5]}}else if(Yt.startsWith("matrix(")){const de=Yt.slice(7,-1).split(/, /);return{x:+de[4],y:+de[5],scaleX:+de[0],scaleY:+de[3]}}return null}function nt(Yt,de,Ge){const sr=_t(de);if(!sr)return Yt;const{scaleX:Lr,scaleY:Nr,x:Sr,y:en}=sr,fn=Yt.left-Sr-(1-Lr)*parseFloat(Ge),Pn=Yt.top-en-(1-Nr)*parseFloat(Ge.slice(Ge.indexOf(" ")+1)),sa=Lr?Yt.width/Lr:Yt.width,Zn=Nr?Yt.height/Nr:Yt.height;return{width:sa,height:Zn,top:Pn,right:fn+sa,bottom:Pn+Zn,left:fn}}const vt={ignoreTransform:!1};function It(Yt,de){de===void 0&&(de=vt);let Ge=Yt.getBoundingClientRect();if(de.ignoreTransform){const{transform:Pn,transformOrigin:sa}=(0,w.Jj)(Yt).getComputedStyle(Yt);Pn&&(Ge=nt(Ge,Pn,sa))}const{top:sr,left:Lr,width:Nr,height:Sr,bottom:en,right:fn}=Ge;return{top:sr,left:Lr,width:Nr,height:Sr,bottom:en,right:fn}}function Pt(Yt){return It(Yt,{ignoreTransform:!0})}function St(Yt){const de=Yt.innerWidth,Ge=Yt.innerHeight;return{top:0,left:0,right:de,bottom:Ge,width:de,height:Ge}}function Dt(Yt,de){return de===void 0&&(de=(0,w.Jj)(Yt).getComputedStyle(Yt)),de.position==="fixed"}function Qt(Yt,de){de===void 0&&(de=(0,w.Jj)(Yt).getComputedStyle(Yt));const Ge=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(Lr=>{const Nr=de[Lr];return typeof Nr=="string"?Ge.test(Nr):!1})}function ue(Yt,de){const Ge=[];function sr(Lr){if(de!=null&&Ge.length>=de||!Lr)return Ge;if((0,w.qk)(Lr)&&Lr.scrollingElement!=null&&!Ge.includes(Lr.scrollingElement))return Ge.push(Lr.scrollingElement),Ge;if(!(0,w.Re)(Lr)||(0,w.vZ)(Lr)||Ge.includes(Lr))return Ge;const Nr=(0,w.Jj)(Yt).getComputedStyle(Lr);return Lr!==Yt&&Qt(Lr,Nr)&&Ge.push(Lr),Dt(Lr,Nr)?Ge:sr(Lr.parentNode)}return Yt?sr(Yt):Ge}function ie(Yt){const[de]=ue(Yt,1);return de!=null?de:null}function Lt(Yt){return!w.Nq||!Yt?null:(0,w.FJ)(Yt)?Yt:(0,w.UG)(Yt)?(0,w.qk)(Yt)||Yt===(0,w.r3)(Yt).scrollingElement?window:(0,w.Re)(Yt)?Yt:null:null}function ne(Yt){return(0,w.FJ)(Yt)?Yt.scrollX:Yt.scrollLeft}function ve(Yt){return(0,w.FJ)(Yt)?Yt.scrollY:Yt.scrollTop}function Wt(Yt){return{x:ne(Yt),y:ve(Yt)}}var ae;(function(Yt){Yt[Yt.Forward=1]="Forward",Yt[Yt.Backward=-1]="Backward"})(ae||(ae={}));function Ce(Yt){return!w.Nq||!Yt?!1:Yt===document.scrollingElement}function xe(Yt){const de={x:0,y:0},Ge=Ce(Yt)?{height:window.innerHeight,width:window.innerWidth}:{height:Yt.clientHeight,width:Yt.clientWidth},sr={x:Yt.scrollWidth-Ge.width,y:Yt.scrollHeight-Ge.height},Lr=Yt.scrollTop<=de.y,Nr=Yt.scrollLeft<=de.x,Sr=Yt.scrollTop>=sr.y,en=Yt.scrollLeft>=sr.x;return{isTop:Lr,isLeft:Nr,isBottom:Sr,isRight:en,maxScroll:sr,minScroll:de}}const Jt={x:.2,y:.2};function we(Yt,de,Ge,sr,Lr){let{top:Nr,left:Sr,right:en,bottom:fn}=Ge;sr===void 0&&(sr=10),Lr===void 0&&(Lr=Jt);const{isTop:Pn,isBottom:sa,isLeft:Zn,isRight:pa}=xe(Yt),ya={x:0,y:0},di={x:0,y:0},Ma={height:de.height*Lr.y,width:de.width*Lr.x};return!Pn&&Nr<=de.top+Ma.height?(ya.y=ae.Backward,di.y=sr*Math.abs((de.top+Ma.height-Nr)/Ma.height)):!sa&&fn>=de.bottom-Ma.height&&(ya.y=ae.Forward,di.y=sr*Math.abs((de.bottom-Ma.height-fn)/Ma.height)),!pa&&en>=de.right-Ma.width?(ya.x=ae.Forward,di.x=sr*Math.abs((de.right-Ma.width-en)/Ma.width)):!Zn&&Sr<=de.left+Ma.width&&(ya.x=ae.Backward,di.x=sr*Math.abs((de.left+Ma.width-Sr)/Ma.width)),{direction:ya,speed:di}}function Tt(Yt){if(Yt===document.scrollingElement){const{innerWidth:Nr,innerHeight:Sr}=window;return{top:0,left:0,right:Nr,bottom:Sr,width:Nr,height:Sr}}const{top:de,left:Ge,right:sr,bottom:Lr}=Yt.getBoundingClientRect();return{top:de,left:Ge,right:sr,bottom:Lr,width:Yt.clientWidth,height:Yt.clientHeight}}function Pe(Yt){return Yt.reduce((de,Ge)=>(0,w.IH)(de,Wt(Ge)),$)}function _r(Yt){return Yt.reduce((de,Ge)=>de+ne(Ge),0)}function Ar(Yt){return Yt.reduce((de,Ge)=>de+ve(Ge),0)}function Or(Yt,de){if(de===void 0&&(de=It),!Yt)return;const{top:Ge,left:sr,bottom:Lr,right:Nr}=de(Yt);ie(Yt)&&(Lr<=0||Nr<=0||Ge>=window.innerHeight||sr>=window.innerWidth)&&Yt.scrollIntoView({block:"center",inline:"center"})}const Br=[["x",["left","right"],_r],["y",["top","bottom"],Ar]];class cn{constructor(de,Ge){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const sr=ue(Ge),Lr=Pe(sr);this.rect=Da({},de),this.width=de.width,this.height=de.height;for(const[Nr,Sr,en]of Br)for(const fn of Sr)Object.defineProperty(this,fn,{get:()=>{const Pn=en(sr),sa=Lr[Nr]-Pn;return this.rect[fn]+sa},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class an{constructor(de){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(Ge=>{var sr;return(sr=this.target)==null?void 0:sr.removeEventListener(...Ge)})},this.target=de}add(de,Ge,sr){var Lr;(Lr=this.target)==null||Lr.addEventListener(de,Ge,sr),this.listeners.push([de,Ge,sr])}}function Dn(Yt){const{EventTarget:de}=(0,w.Jj)(Yt);return Yt instanceof de?Yt:(0,w.r3)(Yt)}function Un(Yt,de){const Ge=Math.abs(Yt.x),sr=Math.abs(Yt.y);return typeof de=="number"?Math.sqrt(Dv(Ge,2)+Dv(sr,2))>de:"x"in de&&"y"in de?Ge>de.x&&sr>de.y:"x"in de?Ge>de.x:"y"in de?sr>de.y:!1}var Xn;(function(Yt){Yt.Click="click",Yt.DragStart="dragstart",Yt.Keydown="keydown",Yt.ContextMenu="contextmenu",Yt.Resize="resize",Yt.SelectionChange="selectionchange",Yt.VisibilityChange="visibilitychange"})(Xn||(Xn={}));function xr(Yt){Yt.preventDefault()}function $e(Yt){Yt.stopPropagation()}var Tr;(function(Yt){Yt.Space="Space",Yt.Down="ArrowDown",Yt.Right="ArrowRight",Yt.Left="ArrowLeft",Yt.Up="ArrowUp",Yt.Esc="Escape",Yt.Enter="Enter"})(Tr||(Tr={}));const qr={start:[Tr.Space,Tr.Enter],cancel:[Tr.Esc],end:[Tr.Space,Tr.Enter]},gn=(Yt,de)=>{let{currentCoordinates:Ge}=de;switch(Yt.code){case Tr.Right:return mo(Da({},Ge),{x:Ge.x+25});case Tr.Left:return mo(Da({},Ge),{x:Ge.x-25});case Tr.Down:return mo(Da({},Ge),{y:Ge.y+25});case Tr.Up:return mo(Da({},Ge),{y:Ge.y-25})}};class xn{constructor(de){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=de;const{event:{target:Ge}}=de;this.props=de,this.listeners=new an((0,w.r3)(Ge)),this.windowListeners=new an((0,w.Jj)(Ge)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xn.Resize,this.handleCancel),this.windowListeners.add(Xn.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xn.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:de,onStart:Ge}=this.props,sr=de.node.current;sr&&Or(sr),Ge($)}handleKeyDown(de){if((0,w.vd)(de)){const{active:Ge,context:sr,options:Lr}=this.props,{keyboardCodes:Nr=qr,coordinateGetter:Sr=gn,scrollBehavior:en="smooth"}=Lr,{code:fn}=de;if(Nr.end.includes(fn)){this.handleEnd(de);return}if(Nr.cancel.includes(fn)){this.handleCancel(de);return}const{collisionRect:Pn}=sr.current,sa=Pn?{x:Pn.left,y:Pn.top}:$;this.referenceCoordinates||(this.referenceCoordinates=sa);const Zn=Sr(de,{active:Ge,context:sr.current,currentCoordinates:sa});if(Zn){const pa=(0,w.$X)(Zn,sa),ya={x:0,y:0},{scrollableAncestors:di}=sr.current;for(const Ma of di){const oa=de.code,{isTop:si,isRight:$a,isLeft:Fa,isBottom:Ui,maxScroll:fi,minScroll:La}=xe(Ma),ja=Tt(Ma),za={x:Math.min(oa===Tr.Right?ja.right-ja.width/2:ja.right,Math.max(oa===Tr.Right?ja.left:ja.left+ja.width/2,Zn.x)),y:Math.min(oa===Tr.Down?ja.bottom-ja.height/2:ja.bottom,Math.max(oa===Tr.Down?ja.top:ja.top+ja.height/2,Zn.y))},yi=oa===Tr.Right&&!$a||oa===Tr.Left&&!Fa,mi=oa===Tr.Down&&!Ui||oa===Tr.Up&&!si;if(yi&&za.x!==Zn.x){const ki=Ma.scrollLeft+pa.x,po=oa===Tr.Right&&ki<=fi.x||oa===Tr.Left&&ki>=La.x;if(po&&!pa.y){Ma.scrollTo({left:ki,behavior:en});return}po?ya.x=Ma.scrollLeft-ki:ya.x=oa===Tr.Right?Ma.scrollLeft-fi.x:Ma.scrollLeft-La.x,ya.x&&Ma.scrollBy({left:-ya.x,behavior:en});break}else if(mi&&za.y!==Zn.y){const ki=Ma.scrollTop+pa.y,po=oa===Tr.Down&&ki<=fi.y||oa===Tr.Up&&ki>=La.y;if(po&&!pa.x){Ma.scrollTo({top:ki,behavior:en});return}po?ya.y=Ma.scrollTop-ki:ya.y=oa===Tr.Down?Ma.scrollTop-fi.y:Ma.scrollTop-La.y,ya.y&&Ma.scrollBy({top:-ya.y,behavior:en});break}}this.handleMove(de,(0,w.IH)((0,w.$X)(Zn,this.referenceCoordinates),ya))}}}handleMove(de,Ge){const{onMove:sr}=this.props;de.preventDefault(),sr(Ge)}handleEnd(de){const{onEnd:Ge}=this.props;de.preventDefault(),this.detach(),Ge()}handleCancel(de){const{onCancel:Ge}=this.props;de.preventDefault(),this.detach(),Ge()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}xn.activators=[{eventName:"onKeyDown",handler:(Yt,de,Ge)=>{let{keyboardCodes:sr=qr,onActivation:Lr}=de,{active:Nr}=Ge;const{code:Sr}=Yt.nativeEvent;if(sr.start.includes(Sr)){const en=Nr.activatorNode.current;return en&&Yt.target!==en?!1:(Yt.preventDefault(),Lr==null||Lr({event:Yt.nativeEvent}),!0)}return!1}}];function Rn(Yt){return!!(Yt&&"distance"in Yt)}function Mr(Yt){return!!(Yt&&"delay"in Yt)}class dn{constructor(de,Ge,sr){var Lr;sr===void 0&&(sr=Dn(de.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=de,this.events=Ge;const{event:Nr}=de,{target:Sr}=Nr;this.props=de,this.events=Ge,this.document=(0,w.r3)(Sr),this.documentListeners=new an(this.document),this.listeners=new an(sr),this.windowListeners=new an((0,w.Jj)(Sr)),this.initialCoordinates=(Lr=(0,w.DC)(Nr))!=null?Lr:$,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:de,props:{options:{activationConstraint:Ge}}}=this;if(this.listeners.add(de.move.name,this.handleMove,{passive:!1}),this.listeners.add(de.end.name,this.handleEnd),this.windowListeners.add(Xn.Resize,this.handleCancel),this.windowListeners.add(Xn.DragStart,xr),this.windowListeners.add(Xn.VisibilityChange,this.handleCancel),this.windowListeners.add(Xn.ContextMenu,xr),this.documentListeners.add(Xn.Keydown,this.handleKeydown),Ge){if(Rn(Ge))return;if(Mr(Ge)){this.timeoutId=setTimeout(this.handleStart,Ge.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:de}=this,{onStart:Ge}=this.props;de&&(this.activated=!0,this.documentListeners.add(Xn.Click,$e,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xn.SelectionChange,this.removeTextSelection),Ge(de))}handleMove(de){var Ge;const{activated:sr,initialCoordinates:Lr,props:Nr}=this,{onMove:Sr,options:{activationConstraint:en}}=Nr;if(!Lr)return;const fn=(Ge=(0,w.DC)(de))!=null?Ge:$,Pn=(0,w.$X)(Lr,fn);if(!sr&&en){if(Mr(en))return Un(Pn,en.tolerance)?this.handleCancel():void 0;if(Rn(en))return en.tolerance!=null&&Un(Pn,en.tolerance)?this.handleCancel():Un(Pn,en.distance)?this.handleStart():void 0}de.cancelable&&de.preventDefault(),Sr(fn)}handleEnd(){const{onEnd:de}=this.props;this.detach(),de()}handleCancel(){const{onCancel:de}=this.props;this.detach(),de()}handleKeydown(de){de.code===Tr.Esc&&this.handleCancel()}removeTextSelection(){var de;(de=this.document.getSelection())==null||de.removeAllRanges()}}const hn={move:{name:"pointermove"},end:{name:"pointerup"}};class sn extends dn{constructor(de){const{event:Ge}=de,sr=(0,w.r3)(Ge.target);super(de,hn,sr)}}sn.activators=[{eventName:"onPointerDown",handler:(Yt,de)=>{let{nativeEvent:Ge}=Yt,{onActivation:sr}=de;return!Ge.isPrimary||Ge.button!==0?!1:(sr==null||sr({event:Ge}),!0)}}];const Wn={move:{name:"mousemove"},end:{name:"mouseup"}};var Mn;(function(Yt){Yt[Yt.RightClick=2]="RightClick"})(Mn||(Mn={}));class In extends dn{constructor(de){super(de,Wn,(0,w.r3)(de.event.target))}}In.activators=[{eventName:"onMouseDown",handler:(Yt,de)=>{let{nativeEvent:Ge}=Yt,{onActivation:sr}=de;return Ge.button===Mn.RightClick?!1:(sr==null||sr({event:Ge}),!0)}}];const jn={move:{name:"touchmove"},end:{name:"touchend"}};class at extends dn{constructor(de){super(de,jn)}static setup(){return window.addEventListener(jn.move.name,de,{capture:!1,passive:!1}),function(){window.removeEventListener(jn.move.name,de)};function de(){}}}at.activators=[{eventName:"onTouchStart",handler:(Yt,de)=>{let{nativeEvent:Ge}=Yt,{onActivation:sr}=de;const{touches:Lr}=Ge;return Lr.length>1?!1:(sr==null||sr({event:Ge}),!0)}}];var Je;(function(Yt){Yt[Yt.Pointer=0]="Pointer",Yt[Yt.DraggableRect=1]="DraggableRect"})(Je||(Je={}));var Ht;(function(Yt){Yt[Yt.TreeOrder=0]="TreeOrder",Yt[Yt.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ht||(Ht={}));function te(Yt){let{acceleration:de,activator:Ge=Je.Pointer,canScroll:sr,draggingRect:Lr,enabled:Nr,interval:Sr=5,order:en=Ht.TreeOrder,pointerCoordinates:fn,scrollableAncestors:Pn,scrollableAncestorRects:sa,delta:Zn,threshold:pa}=Yt;const ya=Me({delta:Zn,disabled:!Nr}),[di,Ma]=(0,w.Yz)(),oa=(0,x.useRef)({x:0,y:0}),si=(0,x.useRef)({x:0,y:0}),$a=(0,x.useMemo)(()=>{switch(Ge){case Je.Pointer:return fn?{top:fn.y,bottom:fn.y,left:fn.x,right:fn.x}:null;case Je.DraggableRect:return Lr}},[Ge,Lr,fn]),Fa=(0,x.useRef)(null),Ui=(0,x.useCallback)(()=>{const La=Fa.current;if(!La)return;const ja=oa.current.x*si.current.x,za=oa.current.y*si.current.y;La.scrollBy(ja,za)},[]),fi=(0,x.useMemo)(()=>en===Ht.TreeOrder?[...Pn].reverse():Pn,[en,Pn]);(0,x.useEffect)(()=>{if(!Nr||!Pn.length||!$a){Ma();return}for(const La of fi){if((sr==null?void 0:sr(La))===!1)continue;const ja=Pn.indexOf(La),za=sa[ja];if(!za)continue;const{direction:yi,speed:mi}=we(La,za,$a,de,pa);for(const ki of["x","y"])ya[ki][yi[ki]]||(mi[ki]=0,yi[ki]=0);if(mi.x>0||mi.y>0){Ma(),Fa.current=La,di(Ui,Sr),oa.current=mi,si.current=yi;return}}oa.current={x:0,y:0},si.current={x:0,y:0},Ma()},[de,Ui,sr,Ma,Nr,Sr,JSON.stringify($a),JSON.stringify(ya),di,Pn,fi,sa,JSON.stringify(pa)])}const wt={x:{[ae.Backward]:!1,[ae.Forward]:!1},y:{[ae.Backward]:!1,[ae.Forward]:!1}};function Me(Yt){let{delta:de,disabled:Ge}=Yt;const sr=(0,w.D9)(de);return(0,w.Gj)(Lr=>{if(Ge||!sr||!Lr)return wt;const Nr={x:Math.sign(de.x-sr.x),y:Math.sign(de.y-sr.y)};return{x:{[ae.Backward]:Lr.x[ae.Backward]||Nr.x===-1,[ae.Forward]:Lr.x[ae.Forward]||Nr.x===1},y:{[ae.Backward]:Lr.y[ae.Backward]||Nr.y===-1,[ae.Forward]:Lr.y[ae.Forward]||Nr.y===1}}},[Ge,de,sr])}function kt(Yt,de){const Ge=de!==null?Yt.get(de):void 0,sr=Ge?Ge.node.current:null;return(0,w.Gj)(Lr=>{var Nr;return de===null?null:(Nr=sr!=null?sr:Lr)!=null?Nr:null},[sr,de])}function qt(Yt,de){return(0,x.useMemo)(()=>Yt.reduce((Ge,sr)=>{const{sensor:Lr}=sr,Nr=Lr.activators.map(Sr=>({eventName:Sr.eventName,handler:de(Sr.handler,sr)}));return[...Ge,...Nr]},[]),[Yt,de])}var dt;(function(Yt){Yt[Yt.Always=0]="Always",Yt[Yt.BeforeDragging=1]="BeforeDragging",Yt[Yt.WhileDragging=2]="WhileDragging"})(dt||(dt={}));var Ut;(function(Yt){Yt.Optimized="optimized"})(Ut||(Ut={}));const Q=new Map;function ot(Yt,de){let{dragging:Ge,dependencies:sr,config:Lr}=de;const[Nr,Sr]=(0,x.useState)(null),{frequency:en,measure:fn,strategy:Pn}=Lr,sa=(0,x.useRef)(Yt),Zn=oa(),pa=(0,w.Ey)(Zn),ya=(0,x.useCallback)(function(si){si===void 0&&(si=[]),!pa.current&&Sr($a=>$a===null?si:$a.concat(si.filter(Fa=>!$a.includes(Fa))))},[pa]),di=(0,x.useRef)(null),Ma=(0,w.Gj)(si=>{if(Zn&&!Ge)return Q;if(!si||si===Q||sa.current!==Yt||Nr!=null){const $a=new Map;for(let Fa of Yt){if(!Fa)continue;if(Nr&&Nr.length>0&&!Nr.includes(Fa.id)&&Fa.rect.current){$a.set(Fa.id,Fa.rect.current);continue}const Ui=Fa.node.current,fi=Ui?new cn(fn(Ui),Ui):null;Fa.rect.current=fi,fi&&$a.set(Fa.id,fi)}return $a}return si},[Yt,Nr,Ge,Zn,fn]);return(0,x.useEffect)(()=>{sa.current=Yt},[Yt]),(0,x.useEffect)(()=>{Zn||ya()},[Ge,Zn]),(0,x.useEffect)(()=>{Nr&&Nr.length>0&&Sr(null)},[JSON.stringify(Nr)]),(0,x.useEffect)(()=>{Zn||typeof en!="number"||di.current!==null||(di.current=setTimeout(()=>{ya(),di.current=null},en))},[en,Zn,ya,...sr]),{droppableRects:Ma,measureDroppableContainers:ya,measuringScheduled:Nr!=null};function oa(){switch(Pn){case dt.Always:return!1;case dt.BeforeDragging:return Ge;default:return!Ge}}}function R(Yt,de){return(0,w.Gj)(Ge=>Yt?Ge||(typeof de=="function"?de(Yt):Yt):null,[de,Yt])}function M(Yt,de){return R(Yt,de)}function O(Yt){let{callback:de,disabled:Ge}=Yt;const sr=(0,w.zX)(de),Lr=(0,x.useMemo)(()=>{if(Ge||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;const{MutationObserver:Nr}=window;return new Nr(sr)},[sr,Ge]);return(0,x.useEffect)(()=>()=>Lr==null?void 0:Lr.disconnect(),[Lr]),Lr}function X(Yt){let{callback:de,disabled:Ge}=Yt;const sr=(0,w.zX)(de),Lr=(0,x.useMemo)(()=>{if(Ge||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;const{ResizeObserver:Nr}=window;return new Nr(sr)},[Ge]);return(0,x.useEffect)(()=>()=>Lr==null?void 0:Lr.disconnect(),[Lr]),Lr}function mt(Yt){return new cn(It(Yt),Yt)}function Ft(Yt,de,Ge){de===void 0&&(de=mt);const[sr,Lr]=(0,x.useReducer)(en,null),Nr=O({callback(fn){if(Yt)for(const Pn of fn){const{type:sa,target:Zn}=Pn;if(sa==="childList"&&Zn instanceof HTMLElement&&Zn.contains(Yt)){Lr();break}}}}),Sr=X({callback:Lr});return(0,w.LI)(()=>{Lr(),Yt?(Sr==null||Sr.observe(Yt),Nr==null||Nr.observe(document.body,{childList:!0,subtree:!0})):(Sr==null||Sr.disconnect(),Nr==null||Nr.disconnect())},[Yt]),sr;function en(fn){if(!Yt)return null;if(Yt.isConnected===!1){var Pn;return(Pn=fn!=null?fn:Ge)!=null?Pn:null}const sa=de(Yt);return JSON.stringify(fn)===JSON.stringify(sa)?fn:sa}}function Bt(Yt){const de=R(Yt);return Z(Yt,de)}const ee=[];function Le(Yt){const de=(0,x.useRef)(Yt),Ge=(0,w.Gj)(sr=>Yt?sr&&sr!==ee&&Yt&&de.current&&Yt.parentNode===de.current.parentNode?sr:ue(Yt):ee,[Yt]);return(0,x.useEffect)(()=>{de.current=Yt},[Yt]),Ge}function me(Yt){const[de,Ge]=(0,x.useState)(null),sr=(0,x.useRef)(Yt),Lr=(0,x.useCallback)(Nr=>{const Sr=Lt(Nr.target);Sr&&Ge(en=>en?(en.set(Sr,Wt(Sr)),new Map(en)):null)},[]);return(0,x.useEffect)(()=>{const Nr=sr.current;if(Yt!==Nr){Sr(Nr);const en=Yt.map(fn=>{const Pn=Lt(fn);return Pn?(Pn.addEventListener("scroll",Lr,{passive:!0}),[Pn,Wt(Pn)]):null}).filter(fn=>fn!=null);Ge(en.length?new Map(en):null),sr.current=Yt}return()=>{Sr(Yt),Sr(Nr)};function Sr(en){en.forEach(fn=>{const Pn=Lt(fn);Pn==null||Pn.removeEventListener("scroll",Lr)})}},[Lr,Yt]),(0,x.useMemo)(()=>Yt.length?de?Array.from(de.values()).reduce((Nr,Sr)=>(0,w.IH)(Nr,Sr),$):Pe(Yt):$,[Yt,de])}function Xe(Yt,de){de===void 0&&(de=[]);const Ge=(0,x.useRef)(null);return(0,x.useEffect)(()=>{Ge.current=null},de),(0,x.useEffect)(()=>{const sr=Yt!==$;sr&&!Ge.current&&(Ge.current=Yt),!sr&&Ge.current&&(Ge.current=null)},[Yt]),Ge.current?(0,w.$X)(Yt,Ge.current):$}function pr(Yt){(0,x.useEffect)(()=>{if(!w.Nq)return;const de=Yt.map(Ge=>{let{sensor:sr}=Ge;return sr.setup==null?void 0:sr.setup()});return()=>{for(const Ge of de)Ge==null||Ge()}},Yt.map(de=>{let{sensor:Ge}=de;return Ge}))}function Ze(Yt,de){return(0,x.useMemo)(()=>Yt.reduce((Ge,sr)=>{let{eventName:Lr,handler:Nr}=sr;return Ge[Lr]=Sr=>{Nr(Sr,de)},Ge},{}),[Yt,de])}function Pr(Yt){return(0,x.useMemo)(()=>Yt?St(Yt):null,[Yt])}const un=[];function Ke(Yt,de){de===void 0&&(de=It);const[Ge]=Yt,sr=Pr(Ge?(0,w.Jj)(Ge):null),[Lr,Nr]=(0,x.useReducer)(en,un),Sr=X({callback:Nr});return Yt.length>0&&Lr===un&&Nr(),(0,w.LI)(()=>{Yt.length?Yt.forEach(fn=>Sr==null?void 0:Sr.observe(fn)):(Sr==null||Sr.disconnect(),Nr())},[Yt]),Lr;function en(){return Yt.length?Yt.map(fn=>Ce(fn)?sr:new cn(de(fn),fn)):un}}function lr(Yt){if(!Yt)return null;if(Yt.children.length>1)return Yt;const de=Yt.children[0];return(0,w.Re)(de)?de:Yt}function Rr(Yt){let{measure:de}=Yt;const[Ge,sr]=(0,x.useState)(null),Lr=(0,x.useCallback)(Pn=>{for(const{target:sa}of Pn)if((0,w.Re)(sa)){sr(Zn=>{const pa=de(sa);return Zn?mo(Da({},Zn),{width:pa.width,height:pa.height}):pa});break}},[de]),Nr=X({callback:Lr}),Sr=(0,x.useCallback)(Pn=>{const sa=lr(Pn);Nr==null||Nr.disconnect(),sa&&(Nr==null||Nr.observe(sa)),sr(sa?de(sa):null)},[de,Nr]),[en,fn]=(0,w.wm)(Sr);return(0,x.useMemo)(()=>({nodeRef:en,rect:Ge,setRef:fn}),[Ge,en,fn])}const Dr=[{sensor:sn,options:{}},{sensor:xn,options:{}}],ce={current:{}},jt={draggable:{measure:Pt},droppable:{measure:Pt,strategy:dt.WhileDragging,frequency:Ut.Optimized},dragOverlay:{measure:It}};class pe extends Map{get(de){var Ge;return de!=null&&(Ge=super.get(de))!=null?Ge:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(de=>{let{disabled:Ge}=de;return!Ge})}getNodeFor(de){var Ge,sr;return(Ge=(sr=this.get(de))==null?void 0:sr.node.current)!=null?Ge:void 0}}const Oe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new pe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Y},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:jt,measureDroppableContainers:Y,windowRect:null,measuringScheduled:!1},Se={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Y,draggableNodes:new Map,over:null,measureDroppableContainers:Y},Fe=(0,x.createContext)(Se),or=(0,x.createContext)(Oe);function gr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new pe}}}function Jr(Yt,de){switch(de.type){case F.DragStart:return mo(Da({},Yt),{draggable:mo(Da({},Yt.draggable),{initialCoordinates:de.initialCoordinates,active:de.active})});case F.DragMove:return Yt.draggable.active?mo(Da({},Yt),{draggable:mo(Da({},Yt.draggable),{translate:{x:de.coordinates.x-Yt.draggable.initialCoordinates.x,y:de.coordinates.y-Yt.draggable.initialCoordinates.y}})}):Yt;case F.DragEnd:case F.DragCancel:return mo(Da({},Yt),{draggable:mo(Da({},Yt.draggable),{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case F.RegisterDroppable:{const{element:Ge}=de,{id:sr}=Ge,Lr=new pe(Yt.droppable.containers);return Lr.set(sr,Ge),mo(Da({},Yt),{droppable:mo(Da({},Yt.droppable),{containers:Lr})})}case F.SetDroppableDisabled:{const{id:Ge,key:sr,disabled:Lr}=de,Nr=Yt.droppable.containers.get(Ge);if(!Nr||sr!==Nr.key)return Yt;const Sr=new pe(Yt.droppable.containers);return Sr.set(Ge,mo(Da({},Nr),{disabled:Lr})),mo(Da({},Yt),{droppable:mo(Da({},Yt.droppable),{containers:Sr})})}case F.UnregisterDroppable:{const{id:Ge,key:sr}=de,Lr=Yt.droppable.containers.get(Ge);if(!Lr||sr!==Lr.key)return Yt;const Nr=new pe(Yt.droppable.containers);return Nr.delete(Ge),mo(Da({},Yt),{droppable:mo(Da({},Yt.droppable),{containers:Nr})})}default:return Yt}}function Gn(Yt){let{disabled:de}=Yt;const{active:Ge,activatorEvent:sr,draggableNodes:Lr}=(0,x.useContext)(Fe),Nr=(0,w.D9)(sr),Sr=(0,w.D9)(Ge==null?void 0:Ge.id);return(0,x.useEffect)(()=>{if(!de&&!sr&&Nr&&Sr!=null){if(!(0,w.vd)(Nr)||document.activeElement===Nr.target)return;const en=Lr.get(Sr);if(!en)return;const{activatorNode:fn,node:Pn}=en;if(!fn.current&&!Pn.current)return;requestAnimationFrame(()=>{for(const sa of[fn.current,Pn.current]){if(!sa)continue;const Zn=(0,w.so)(sa);if(Zn){Zn.focus();break}}})}},[sr,de,Lr,Sr,Nr]),null}function pn(Yt,de){let Lr=de,{transform:Ge}=Lr,sr=Ah(Lr,["transform"]);return Yt!=null&&Yt.length?Yt.reduce((Nr,Sr)=>Sr(Da({transform:Nr},sr)),Ge):Ge}function qn(Yt){return(0,x.useMemo)(()=>({draggable:Da(Da({},jt.draggable),Yt==null?void 0:Yt.draggable),droppable:Da(Da({},jt.droppable),Yt==null?void 0:Yt.droppable),dragOverlay:Da(Da({},jt.dragOverlay),Yt==null?void 0:Yt.dragOverlay)}),[Yt==null?void 0:Yt.draggable,Yt==null?void 0:Yt.droppable,Yt==null?void 0:Yt.dragOverlay])}function ln(Yt){let{activeNode:de,measure:Ge,initialRect:sr,config:Lr=!0}=Yt;const Nr=(0,x.useRef)(!1),{x:Sr,y:en}=typeof Lr=="boolean"?{x:Lr,y:Lr}:Lr;(0,w.LI)(()=>{if(!Sr&&!en||!de){Nr.current=!1;return}if(Nr.current||!sr)return;const Pn=de==null?void 0:de.node.current;if(!Pn||Pn.isConnected===!1)return;const sa=Ge(Pn),Zn=Z(sa,sr);if(Sr||(Zn.x=0),en||(Zn.y=0),Nr.current=!0,Math.abs(Zn.x)>0||Math.abs(Zn.y)>0){const pa=ie(Pn);pa&&pa.scrollBy({top:Zn.y,left:Zn.x})}},[de,Sr,en,sr,Ge])}const Vn=(0,x.createContext)(mo(Da({},$),{scaleX:1,scaleY:1}));var ca;(function(Yt){Yt[Yt.Uninitialized=0]="Uninitialized",Yt[Yt.Initializing=1]="Initializing",Yt[Yt.Initialized=2]="Initialized"})(ca||(ca={}));const ba=(0,x.memo)(function(de){var Ge,sr,Lr,Nr;let Cu=de,{id:Sr,accessibility:en,autoScroll:fn=!0,children:Pn,sensors:sa=Dr,collisionDetection:Zn=gt,measuring:pa,modifiers:ya}=Cu,di=Ah(Cu,["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"]);const Ma=(0,x.useReducer)(Jr,void 0,gr),[oa,si]=Ma,[$a,Fa]=g(),[Ui,fi]=(0,x.useState)(ca.Uninitialized),La=Ui===ca.Initialized,{draggable:{active:ja,nodes:za,translate:yi},droppable:{containers:mi}}=oa,ki=ja?za.get(ja):null,po=(0,x.useRef)({initial:null,translated:null}),Wi=(0,x.useMemo)(()=>{var Uo;return ja!=null?{id:ja,data:(Uo=ki==null?void 0:ki.data)!=null?Uo:ce,rect:po}:null},[ja,ki]),Ao=(0,x.useRef)(null),[Vo,os]=(0,x.useState)(null),[$i,qa]=(0,x.useState)(null),Yi=(0,w.Ey)(di,Object.values(di)),io=(0,w.Ld)("DndDescribedBy",Sr),Qa=(0,x.useMemo)(()=>mi.getEnabled(),[mi]),Pi=qn(pa),{droppableRects:zo,measureDroppableContainers:qi,measuringScheduled:rs}=ot(Qa,{dragging:La,dependencies:[yi.x,yi.y],config:Pi.droppable}),Xi=kt(za,ja),yo=(0,x.useMemo)(()=>$i?(0,w.DC)($i):null,[$i]),Es=_u(),ds=M(Xi,Pi.draggable.measure);ln({activeNode:ja?za.get(ja):null,config:Es.layoutShiftCompensation,initialRect:ds,measure:Pi.draggable.measure});const oo=Ft(Xi,Pi.draggable.measure,ds),ls=Ft(Xi?Xi.parentElement:null),hs=(0,x.useRef)({activatorEvent:null,active:null,activeNode:Xi,collisionRect:null,collisions:null,droppableRects:zo,draggableNodes:za,draggingNode:null,draggingNodeRect:null,droppableContainers:mi,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Os=mi.getNodeFor((Ge=hs.current.over)==null?void 0:Ge.id),Ho=Rr({measure:Pi.dragOverlay.measure}),$t=(sr=Ho.nodeRef.current)!=null?sr:Xi,ye=La?(Lr=Ho.rect)!=null?Lr:oo:null,ir=!!(Ho.nodeRef.current&&Ho.rect),dr=Bt(ir?null:oo),Zr=Pr($t?(0,w.Jj)($t):null),Ln=Le(La?Os!=null?Os:Xi:null),Qn=Ke(Ln),Sa=pn(ya,{transform:{x:yi.x-dr.x,y:yi.y-dr.y,scaleX:1,scaleY:1},activatorEvent:$i,active:Wi,activeNodeRect:oo,containerNodeRect:ls,draggingNodeRect:ye,over:hs.current.over,overlayNodeRect:Ho.rect,scrollableAncestors:Ln,scrollableAncestorRects:Qn,windowRect:Zr}),Ci=yo?(0,w.IH)(yo,yi):null,Io=me(Ln),Go=Xe(Io),zs=Xe(Io,[oo]),Ds=(0,w.IH)(Sa,Go),ji=ye?yt(ye,Sa):null,xo=Wi&&ji?Zn({active:Wi,collisionRect:ji,droppableRects:zo,droppableContainers:Qa,pointerCoordinates:Ci}):null,Gs=tt(xo,"id"),[vs,qs]=(0,x.useState)(null),Qs=ir?Sa:(0,w.IH)(Sa,zs),Js=At(Qs,(Nr=vs==null?void 0:vs.rect)!=null?Nr:null,oo),Vs=(0,x.useCallback)((Uo,bo)=>{let{sensor:ss,options:d}=bo;if(Ao.current==null)return;const G=za.get(Ao.current);if(!G)return;const Et=Uo.nativeEvent,Gt=new ss({active:Ao.current,activeNode:G,event:Et,options:d,context:hs,onStart(he){const ge=Ao.current;if(ge==null)return;const De=za.get(ge);if(!De)return;const{onDragStart:ze}=Yi.current,He={active:{id:ge,data:De.data,rect:po}};(0,k.unstable_batchedUpdates)(()=>{ze==null||ze(He),fi(ca.Initializing),si({type:F.DragStart,initialCoordinates:he,active:ge}),$a({type:"onDragStart",event:He})})},onMove(he){si({type:F.DragMove,coordinates:he})},onEnd:re(F.DragEnd),onCancel:re(F.DragCancel)});(0,k.unstable_batchedUpdates)(()=>{os(Gt),qa(Uo.nativeEvent)});function re(he){return function(){return z0(this,null,function*(){const{active:De,collisions:ze,over:He,scrollAdjustedTranslate:ur}=hs.current;let Ur=null;if(De&&ur){const{cancelDrop:Xr}=Yi.current;Ur={activatorEvent:Et,active:De,collisions:ze,delta:ur,over:He},he===F.DragEnd&&typeof Xr=="function"&&(yield Promise.resolve(Xr(Ur)))&&(he=F.DragCancel)}Ao.current=null,(0,k.unstable_batchedUpdates)(()=>{si({type:he}),fi(ca.Uninitialized),qs(null),os(null),qa(null);const Xr=he===F.DragEnd?"onDragEnd":"onDragCancel";if(Ur){const Wr=Yi.current[Xr];Wr==null||Wr(Ur),$a({type:Xr,event:Ur})}})})}}},[za]),Rs=(0,x.useCallback)((Uo,bo)=>(ss,d)=>{const G=ss.nativeEvent,Et=za.get(d);if(Ao.current!==null||!Et||G.dndKit||G.defaultPrevented)return;const Gt={active:Et};Uo(ss,bo.options,Gt)===!0&&(G.dndKit={capturedBy:bo.sensor},Ao.current=d,Vs(ss,bo))},[za,Vs]),Us=qt(sa,Rs);pr(sa),(0,w.LI)(()=>{oo&&Ui===ca.Initializing&&fi(ca.Initialized)},[oo,Ui]),(0,x.useEffect)(()=>{const{onDragMove:Uo}=Yi.current,{active:bo,activatorEvent:ss,collisions:d,over:G}=hs.current;if(!bo||!ss)return;const Et={active:bo,activatorEvent:ss,collisions:d,delta:{x:Ds.x,y:Ds.y},over:G};(0,k.unstable_batchedUpdates)(()=>{Uo==null||Uo(Et),$a({type:"onDragMove",event:Et})})},[Ds.x,Ds.y]),(0,x.useEffect)(()=>{const{active:Uo,activatorEvent:bo,collisions:ss,droppableContainers:d,scrollAdjustedTranslate:G}=hs.current;if(!Uo||Ao.current==null||!bo||!G)return;const{onDragOver:Et}=Yi.current,Gt=d.get(Gs),re=Gt&&Gt.rect.current?{id:Gt.id,rect:Gt.rect.current,data:Gt.data,disabled:Gt.disabled}:null,he={active:Uo,activatorEvent:bo,collisions:ss,delta:{x:G.x,y:G.y},over:re};(0,k.unstable_batchedUpdates)(()=>{qs(re),Et==null||Et(he),$a({type:"onDragOver",event:he})})},[Gs]),(0,w.LI)(()=>{hs.current={activatorEvent:$i,active:Wi,activeNode:Xi,collisionRect:ji,collisions:xo,droppableRects:zo,draggableNodes:za,draggingNode:$t,draggingNodeRect:ye,droppableContainers:mi,over:vs,scrollableAncestors:Ln,scrollAdjustedTranslate:Ds},po.current={initial:ye,translated:ji}},[Wi,Xi,xo,ji,za,$t,ye,zo,mi,vs,Ln,Ds]),te(mo(Da({},Es),{delta:yi,draggingRect:ji,pointerCoordinates:Ci,scrollableAncestors:Ln,scrollableAncestorRects:Qn}));const ws=(0,x.useMemo)(()=>({active:Wi,activeNode:Xi,activeNodeRect:oo,activatorEvent:$i,collisions:xo,containerNodeRect:ls,dragOverlay:Ho,draggableNodes:za,droppableContainers:mi,droppableRects:zo,over:vs,measureDroppableContainers:qi,scrollableAncestors:Ln,scrollableAncestorRects:Qn,measuringConfiguration:Pi,measuringScheduled:rs,windowRect:Zr}),[Wi,Xi,oo,$i,xo,ls,Ho,za,mi,zo,vs,qi,Ln,Qn,Pi,rs,Zr]),ns=(0,x.useMemo)(()=>({activatorEvent:$i,activators:Us,active:Wi,activeNodeRect:oo,ariaDescribedById:{draggable:io},dispatch:si,draggableNodes:za,over:vs,measureDroppableContainers:qi}),[$i,Us,Wi,oo,si,io,za,vs,qi]);return x.createElement(S.Provider,{value:Fa},x.createElement(Fe.Provider,{value:ns},x.createElement(or.Provider,{value:ws},x.createElement(Vn.Provider,{value:Js},Pn)),x.createElement(Gn,{disabled:(en==null?void 0:en.restoreFocus)===!1})),x.createElement(D,mo(Da({},en),{hiddenTextDescribedById:io})));function _u(){const Uo=(Vo==null?void 0:Vo.autoScrollEnabled)===!1,bo=typeof fn=="object"?fn.enabled===!1:fn===!1,ss=La&&!Uo&&!bo;return typeof fn=="object"?mo(Da({},fn),{enabled:ss}):{enabled:ss}}}),Ea=(0,x.createContext)(null),Ni="button",ti="Droppable";function ei(Yt){let{id:de,data:Ge,disabled:sr=!1,attributes:Lr}=Yt;const Nr=(0,w.Ld)(ti),{activators:Sr,activatorEvent:en,active:fn,activeNodeRect:Pn,ariaDescribedById:sa,draggableNodes:Zn,over:pa}=(0,x.useContext)(Fe),{role:ya=Ni,roleDescription:di="draggable",tabIndex:Ma=0}=Lr!=null?Lr:{},oa=(fn==null?void 0:fn.id)===de,si=(0,x.useContext)(oa?Vn:Ea),[$a,Fa]=(0,w.wm)(),[Ui,fi]=(0,w.wm)(),La=Ze(Sr,de),ja=(0,w.Ey)(Ge);(0,w.LI)(()=>(Zn.set(de,{id:de,key:Nr,node:$a,activatorNode:Ui,data:ja}),()=>{const yi=Zn.get(de);yi&&yi.key===Nr&&Zn.delete(de)}),[Zn,de]);const za=(0,x.useMemo)(()=>({role:ya,tabIndex:Ma,"aria-disabled":sr,"aria-pressed":oa&&ya===Ni?!0:void 0,"aria-roledescription":di,"aria-describedby":sa.draggable}),[sr,ya,Ma,oa,di,sa.draggable]);return{active:fn,activatorEvent:en,activeNodeRect:Pn,attributes:za,isDragging:oa,listeners:sr?void 0:La,node:$a,over:pa,setNodeRef:Fa,setActivatorNodeRef:fi,transform:si}}function wi(){return(0,x.useContext)(or)}const Gi="Droppable",Co={timeout:25};function eo(Yt){let{data:de,disabled:Ge=!1,id:sr,resizeObserverConfig:Lr}=Yt;const Nr=(0,w.Ld)(Gi),{active:Sr,dispatch:en,over:fn,measureDroppableContainers:Pn}=(0,x.useContext)(Fe),sa=(0,x.useRef)({disabled:Ge}),Zn=(0,x.useRef)(!1),pa=(0,x.useRef)(null),ya=(0,x.useRef)(null),{disabled:di,updateMeasurementsFor:Ma,timeout:oa}=Da(Da({},Co),Lr),si=(0,w.Ey)(Ma!=null?Ma:sr),$a=(0,x.useCallback)(()=>{if(!Zn.current){Zn.current=!0;return}ya.current!=null&&clearTimeout(ya.current),ya.current=setTimeout(()=>{Pn(Array.isArray(si.current)?si.current:[si.current]),ya.current=null},oa)},[oa]),Fa=X({callback:$a,disabled:di||!Sr}),Ui=(0,x.useCallback)((za,yi)=>{Fa&&(yi&&(Fa.unobserve(yi),Zn.current=!1),za&&Fa.observe(za))},[Fa]),[fi,La]=(0,w.wm)(Ui),ja=(0,w.Ey)(de);return(0,x.useEffect)(()=>{!Fa||!fi.current||(Fa.disconnect(),Zn.current=!1,Fa.observe(fi.current))},[fi,Fa]),(0,w.LI)(()=>(en({type:F.RegisterDroppable,element:{id:sr,key:Nr,disabled:Ge,node:fi,rect:pa,data:ja}}),()=>en({type:F.UnregisterDroppable,key:Nr,id:sr})),[sr]),(0,x.useEffect)(()=>{Ge!==sa.current.disabled&&(en({type:F.SetDroppableDisabled,id:sr,key:Nr,disabled:Ge}),sa.current.disabled=Ge)},[sr,Nr,Ge,en]),{active:Sr,rect:pa,isOver:(fn==null?void 0:fn.id)===sr,node:fi,over:fn,setNodeRef:La}}function ga(Yt){let{animation:de,children:Ge}=Yt;const[sr,Lr]=useState(null),[Nr,Sr]=useState(null),en=usePrevious(Ge);return!Ge&&!sr&&en&&Lr(en),useIsomorphicLayoutEffect(()=>{if(!Nr)return;const fn=sr==null?void 0:sr.key,Pn=sr==null?void 0:sr.props.id;if(fn==null||Pn==null){Lr(null);return}Promise.resolve(de(Pn,Nr)).then(()=>{Lr(null)})},[de,sr,Nr]),React.createElement(React.Fragment,null,Ge,sr?cloneElement(sr,{ref:Sr}):null)}const lo={x:0,y:0,scaleX:1,scaleY:1};function To(Yt){let{children:de}=Yt;return React.createElement(Fe.Provider,{value:Se},React.createElement(Vn.Provider,{value:lo},de))}const ni={position:"fixed",touchAction:"none"},Ri=Yt=>isKeyboardEvent(Yt)?"transform 250ms ease":void 0,ho=null,no={duration:250,easing:"ease",keyframes:Yt=>{let{transform:{initial:de,final:Ge}}=Yt;return[{transform:w.ux.Transform.toString(de)},{transform:w.ux.Transform.toString(Ge)}]},sideEffects:(Yt=>de=>{let{active:Ge,dragOverlay:sr}=de;const Lr={},{styles:Nr,className:Sr}=Yt;if(Nr!=null&&Nr.active)for(const[en,fn]of Object.entries(Nr.active))fn!==void 0&&(Lr[en]=Ge.node.style.getPropertyValue(en),Ge.node.style.setProperty(en,fn));if(Nr!=null&&Nr.dragOverlay)for(const[en,fn]of Object.entries(Nr.dragOverlay))fn!==void 0&&sr.node.style.setProperty(en,fn);return Sr!=null&&Sr.active&&Ge.node.classList.add(Sr.active),Sr!=null&&Sr.dragOverlay&&sr.node.classList.add(Sr.dragOverlay),function(){for(const[fn,Pn]of Object.entries(Lr))Ge.node.style.setProperty(fn,Pn);Sr!=null&&Sr.active&&Ge.node.classList.remove(Sr.active)}})({styles:{active:{opacity:"0"}}})};function es(Yt){let{config:de,draggableNodes:Ge,droppableContainers:sr,measuringConfiguration:Lr}=Yt;return useEvent((Nr,Sr)=>{if(de===null)return;const en=Ge.get(Nr);if(!en)return;const fn=en.node.current;if(!fn)return;const Pn=lr(Sr);if(!Pn)return;const{transform:sa}=getWindow(Sr).getComputedStyle(Sr),Zn=_t(sa);if(!Zn)return;const pa=typeof de=="function"?de:vo(de);return Or(fn,Lr.draggable.measure),pa({active:{id:Nr,data:en.data,node:fn,rect:Lr.draggable.measure(fn)},draggableNodes:Ge,dragOverlay:{node:Sr,rect:Lr.dragOverlay.measure(Pn)},droppableContainers:sr,measuringConfiguration:Lr,transform:Zn})})}function vo(Yt){const{duration:de,easing:Ge,sideEffects:sr,keyframes:Lr}=Da(Da({},no),Yt);return Nr=>{let $a=Nr,{active:Sr,dragOverlay:en,transform:fn}=$a,Pn=Ah($a,["active","dragOverlay","transform"]);if(!de)return;const sa={x:en.rect.left-Sr.rect.left,y:en.rect.top-Sr.rect.top},Zn={scaleX:fn.scaleX!==1?Sr.rect.width*fn.scaleX/en.rect.width:1,scaleY:fn.scaleY!==1?Sr.rect.height*fn.scaleY/en.rect.height:1},pa=Da({x:fn.x-sa.x,y:fn.y-sa.y},Zn),ya=Lr(mo(Da({},Pn),{active:Sr,dragOverlay:en,transform:{initial:fn,final:pa}})),[di]=ya,Ma=ya[ya.length-1];if(JSON.stringify(di)===JSON.stringify(Ma))return;const oa=sr==null?void 0:sr(Da({active:Sr,dragOverlay:en},Pn)),si=en.node.animate(ya,{duration:de,easing:Ge,fill:"forwards"});return new Promise(Fa=>{si.onfinish=()=>{oa==null||oa(),Fa()}})}}let Si=0;function ao(Yt){return useMemo(()=>{if(Yt!=null)return Si++,Si},[Yt])}const Jo=null},332339:function(Ve,z,C){"use strict";C.d(z,{DL:function(){return p}});var x=C(724285);function k(y){return g=>{let{transform:A}=g;return mo(Da({},A),{x:Math.ceil(A.x/y)*y,y:Math.ceil(A.y/y)*y})}}const w=y=>{let{transform:g}=y;return mo(Da({},g),{y:0})};function T(y,g,A){const E=Da({},y);return g.top+y.y<=A.top?E.y=A.top-g.top:g.bottom+y.y>=A.top+A.height&&(E.y=A.top+A.height-g.bottom),g.left+y.x<=A.left?E.x=A.left-g.left:g.right+y.x>=A.left+A.width&&(E.x=A.left+A.width-g.right),E}const L=y=>{let{containerNodeRect:g,draggingNodeRect:A,transform:E}=y;return!A||!g?E:T(E,A,g)},P=y=>{let{draggingNodeRect:g,transform:A,scrollableAncestorRects:E}=y;const D=E[0];return!g||!D?A:T(A,g,D)},p=y=>{let{transform:g}=y;return mo(Da({},g),{x:0})},m=y=>{let{transform:g,draggingNodeRect:A,windowRect:E}=y;return!A||!E?g:T(g,A,E)},S=y=>{let{activatorEvent:g,draggingNodeRect:A,transform:E}=y;if(A&&g){const D=getEventCoordinates(g);if(!D)return E;const F=D.x-A.left,Y=D.y-A.top;return mo(Da({},E),{x:E.x+F-A.width/2,y:E.y+Y-A.height/2})}return E}},245587:function(Ve,z,C){"use strict";C.d(z,{Fo:function(){return U},PG:function(){return g},Rp:function(){return T},nB:function(){return it},qw:function(){return Y}});var x=C(667294),k=C(960887),w=C(724285);function T(J,yt,_t){const nt=J.slice();return nt.splice(_t<0?nt.length+_t:_t,0,nt.splice(yt,1)[0]),nt}function L(J,yt,_t){const nt=J.slice();return nt[yt]=J[_t],nt[_t]=J[yt],nt}function P(J,yt){return J.reduce((_t,nt,vt)=>{const It=yt.get(nt);return It&&(_t[vt]=It),_t},Array(J.length))}function p(J){return J!==null&&J>=0}function m(J,yt){if(J===yt)return!0;if(J.length!==yt.length)return!1;for(let _t=0;_t{var yt;let{rects:_t,activeNodeRect:nt,activeIndex:vt,overIndex:It,index:Pt}=J;const St=(yt=_t[vt])!=null?yt:nt;if(!St)return null;const Dt=A(_t,Pt,vt);if(Pt===vt){const Qt=_t[It];return Qt?Da({x:vtvt&&Pt<=It?Da({x:-St.width-Dt,y:0},y):Pt=It?Da({x:St.width+Dt,y:0},y):Da({x:0,y:0},y)};function A(J,yt,_t){const nt=J[yt],vt=J[yt-1],It=J[yt+1];return!nt||!vt&&!It?0:_t{let{rects:yt,activeIndex:_t,overIndex:nt,index:vt}=J;const It=T(yt,nt,_t),Pt=yt[vt],St=It[vt];return!St||!Pt?null:{x:St.left-Pt.left,y:St.top-Pt.top,scaleX:St.width/Pt.width,scaleY:St.height/Pt.height}},D=J=>{let{activeIndex:yt,index:_t,rects:nt,overIndex:vt}=J,It,Pt;return _t===yt&&(It=nt[_t],Pt=nt[vt]),_t===vt&&(It=nt[_t],Pt=nt[yt]),!Pt||!It?null:{x:Pt.left-It.left,y:Pt.top-It.top,scaleX:Pt.width/It.width,scaleY:Pt.height/It.height}},F={scaleX:1,scaleY:1},Y=J=>{var yt;let{activeIndex:_t,activeNodeRect:nt,index:vt,rects:It,overIndex:Pt}=J;const St=(yt=It[_t])!=null?yt:nt;if(!St)return null;if(vt===_t){const Qt=It[Pt];return Qt?Da({x:0,y:_t_t&&vt<=Pt?Da({x:0,y:-St.height-Dt},F):vt<_t&&vt>=Pt?Da({x:0,y:St.height+Dt},F):Da({x:0,y:0},F)};function b(J,yt,_t){const nt=J[yt],vt=J[yt-1],It=J[yt+1];return nt?_tnt.map(Pe=>typeof Pe=="object"&&"id"in Pe?Pe.id:Pe),[nt]),ve=Pt!=null,Wt=Pt?ne.indexOf(Pt.id):-1,ae=Qt?ne.indexOf(Qt.id):-1,Ce=(0,x.useRef)(ne),xe=!m(ne,Ce.current),Jt=ae!==-1&&Wt===-1||xe,we=S(It);(0,w.LI)(()=>{xe&&ve&&ue(ne)},[xe,ne,ve,ue]),(0,x.useEffect)(()=>{Ce.current=ne},[ne]);const Tt=(0,x.useMemo)(()=>({activeIndex:Wt,containerId:ie,disabled:we,disableTransforms:Jt,items:ne,overIndex:ae,useDragOverlay:Lt,sortedRects:P(ne,Dt),strategy:vt}),[Wt,ie,we.draggable,we.droppable,Jt,ne,ae,Dt,Lt,vt]);return x.createElement($.Provider,{value:Tt},yt)}const W=J=>{let{id:yt,items:_t,activeIndex:nt,overIndex:vt}=J;return T(_t,nt,vt).indexOf(yt)},V=J=>{let{containerId:yt,isSorting:_t,wasDragging:nt,index:vt,items:It,newIndex:Pt,previousItems:St,previousContainerId:Dt,transition:Qt}=J;return!Qt||!nt||St!==It&&vt===Pt?!1:_t?!0:Pt!==vt&&yt===Dt},H={duration:200,easing:"ease"},q="transform",tt=w.ux.Transition.toString({property:q,duration:0,easing:"linear"}),rt={roleDescription:"sortable"};function ft(J){let{disabled:yt,index:_t,node:nt,rect:vt}=J;const[It,Pt]=(0,x.useState)(null),St=(0,x.useRef)(_t);return(0,w.LI)(()=>{if(!yt&&_t!==St.current&&nt.current){const Dt=vt.current;if(Dt){const Qt=(0,k.VK)(nt.current,{ignoreTransform:!0}),ue={x:Dt.left-Qt.left,y:Dt.top-Qt.top,scaleX:Dt.width/Qt.width,scaleY:Dt.height/Qt.height};(ue.x||ue.y)&&Pt(ue)}}_t!==St.current&&(St.current=_t)},[yt,_t,nt,vt]),(0,x.useEffect)(()=>{It&&Pt(null)},[It]),It}function it(J){let{animateLayoutChanges:yt=V,attributes:_t,disabled:nt,data:vt,getNewIndex:It=W,id:Pt,strategy:St,resizeObserverConfig:Dt,transition:Qt=H}=J;const{items:ue,containerId:ie,activeIndex:Lt,disabled:ne,disableTransforms:ve,sortedRects:Wt,overIndex:ae,useDragOverlay:Ce,strategy:xe}=(0,x.useContext)($),Jt=bt(nt,ne),we=ue.indexOf(Pt),Tt=(0,x.useMemo)(()=>Da({sortable:{containerId:ie,index:we,items:ue}},vt),[ie,vt,we,ue]),Pe=(0,x.useMemo)(()=>ue.slice(ue.indexOf(Pt)),[ue,Pt]),{rect:_r,node:Ar,isOver:Or,setNodeRef:Br}=(0,k.Zj)({id:Pt,data:Tt,disabled:Jt.droppable,resizeObserverConfig:Da({updateMeasurementsFor:Pe},Dt)}),{active:cn,activatorEvent:an,activeNodeRect:Dn,attributes:Un,setNodeRef:Xn,listeners:xr,isDragging:$e,over:Tr,setActivatorNodeRef:qr,transform:gn}=(0,k.O1)({id:Pt,data:Tt,attributes:Da(Da({},rt),_t),disabled:Jt.draggable}),xn=(0,w.HB)(Br,Xn),Rn=!!cn,Mr=Rn&&!ve&&p(Lt)&&p(ae),dn=!Ce&&$e,hn=dn&&Mr?gn:null,sn=St!=null?St:xe,Wn=Mr?hn!=null?hn:sn({rects:Wt,activeNodeRect:Dn,activeIndex:Lt,overIndex:ae,index:we}):null,Mn=p(Lt)&&p(ae)?It({id:Pt,items:ue,activeIndex:Lt,overIndex:ae}):we,In=cn==null?void 0:cn.id,jn=(0,x.useRef)({activeId:In,items:ue,newIndex:Mn,containerId:ie}),at=ue!==jn.current.items,Je=yt({active:cn,containerId:ie,isDragging:$e,isSorting:Rn,id:Pt,index:we,items:ue,newIndex:jn.current.newIndex,previousItems:jn.current.items,previousContainerId:jn.current.containerId,transition:Qt,wasDragging:jn.current.activeId!=null}),Ht=ft({disabled:!Je,index:we,node:Ar,rect:_r});return(0,x.useEffect)(()=>{Rn&&jn.current.newIndex!==Mn&&(jn.current.newIndex=Mn),ie!==jn.current.containerId&&(jn.current.containerId=ie),ue!==jn.current.items&&(jn.current.items=ue)},[Rn,Mn,ie,ue]),(0,x.useEffect)(()=>{if(In===jn.current.activeId)return;if(In&&!jn.current.activeId){jn.current.activeId=In;return}const wt=setTimeout(()=>{jn.current.activeId=In},50);return()=>clearTimeout(wt)},[In]),{active:cn,activeIndex:Lt,attributes:Un,data:Tt,rect:_r,index:we,newIndex:Mn,items:ue,isOver:Or,isSorting:Rn,isDragging:$e,listeners:xr,node:Ar,overIndex:ae,over:Tr,setNodeRef:xn,setActivatorNodeRef:qr,setDroppableNodeRef:Br,setDraggableNodeRef:Xn,transform:Ht!=null?Ht:Wn,transition:te()};function te(){if(Ht||at&&jn.current.newIndex===we)return tt;if(!(dn&&!(0,w.vd)(an)||!Qt)&&(Rn||Je))return w.ux.Transition.toString(mo(Da({},Qt),{property:q}))}}function bt(J,yt){var _t,nt;return typeof J=="boolean"?{draggable:J,droppable:!1}:{draggable:(_t=J==null?void 0:J.draggable)!=null?_t:yt.draggable,droppable:(nt=J==null?void 0:J.droppable)!=null?nt:yt.droppable}}function gt(J){if(!J)return!1;const yt=J.data.current;return!!(yt&&"sortable"in yt&&typeof yt.sortable=="object"&&"containerId"in yt.sortable&&"items"in yt.sortable&&"index"in yt.sortable)}const Xt=[k.g4.Down,k.g4.Right,k.g4.Up,k.g4.Left],Ct=(J,yt)=>{let{context:{active:_t,collisionRect:nt,droppableRects:vt,droppableContainers:It,over:Pt,scrollableAncestors:St}}=yt;if(Xt.includes(J.code)){if(J.preventDefault(),!_t||!nt)return;const Dt=[];It.getEnabled().forEach(ie=>{if(!ie||ie!=null&&ie.disabled)return;const Lt=vt.get(ie.id);if(Lt)switch(J.code){case KeyboardCode.Down:nt.topLt.top&&Dt.push(ie);break;case KeyboardCode.Left:nt.left>Lt.left&&Dt.push(ie);break;case KeyboardCode.Right:nt.left1&&(ue=Qt[1].id),ue!=null){const ie=It.get(_t.id),Lt=It.get(ue),ne=Lt?vt.get(Lt.id):null,ve=Lt==null?void 0:Lt.node.current;if(ve&&ne&&ie&&Lt){const ae=getScrollableAncestors(ve).some((Pe,_r)=>St[_r]!==Pe),Ce=At(ie,Lt),xe=Z(ie,Lt),Jt=ae||!Ce?{x:0,y:0}:{x:xe?nt.width-ne.width:0,y:xe?nt.height-ne.height:0},we={x:ne.left,y:ne.top};return Jt.x&&Jt.y?we:subtract(we,Jt)}}}};function At(J,yt){return!gt(J)||!gt(yt)?!1:J.data.current.sortable.containerId===yt.data.current.sortable.containerId}function Z(J,yt){return!gt(J)||!gt(yt)||!At(J,yt)?!1:J.data.current.sortable.indexAt=>{Xt.forEach(Z=>Z(At))},Xt)}const w=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function T(gt){const Xt=Object.prototype.toString.call(gt);return Xt==="[object Window]"||Xt==="[object global]"}function L(gt){return"nodeType"in gt}function P(gt){var Xt,Ct;return gt?T(gt)?gt:L(gt)&&(Xt=(Ct=gt.ownerDocument)==null?void 0:Ct.defaultView)!=null?Xt:window:window}function p(gt){const{Document:Xt}=P(gt);return gt instanceof Xt}function m(gt){return T(gt)?!1:gt instanceof P(gt).HTMLElement}function S(gt){return gt instanceof P(gt).SVGElement}function y(gt){return gt?T(gt)?gt.document:L(gt)?p(gt)?gt:m(gt)?gt.ownerDocument:document:document:document}const g=w?x.useLayoutEffect:x.useEffect;function A(gt){const Xt=(0,x.useRef)(gt);return g(()=>{Xt.current=gt}),(0,x.useCallback)(function(){for(var Ct=arguments.length,At=new Array(Ct),Z=0;Z{gt.current=setInterval(At,Z)},[]),Ct=(0,x.useCallback)(()=>{gt.current!==null&&(clearInterval(gt.current),gt.current=null)},[]);return[Xt,Ct]}function D(gt,Xt){Xt===void 0&&(Xt=[gt]);const Ct=(0,x.useRef)(gt);return g(()=>{Ct.current!==gt&&(Ct.current=gt)},Xt),Ct}function F(gt,Xt){const Ct=(0,x.useRef)();return(0,x.useMemo)(()=>{const At=gt(Ct.current);return Ct.current=At,At},[...Xt])}function Y(gt){const Xt=A(gt),Ct=(0,x.useRef)(null),At=(0,x.useCallback)(Z=>{Z!==Ct.current&&(Xt==null||Xt(Z,Ct.current)),Ct.current=Z},[]);return[Ct,At]}function b(gt){const Xt=(0,x.useRef)();return(0,x.useEffect)(()=>{Xt.current=gt},[gt]),Xt.current}let h={};function $(gt,Xt){return(0,x.useMemo)(()=>{if(Xt)return Xt;const Ct=h[gt]==null?0:h[gt]+1;return h[gt]=Ct,gt+"-"+Ct},[gt,Xt])}function U(gt){return function(Xt){for(var Ct=arguments.length,At=new Array(Ct>1?Ct-1:0),Z=1;Z{const _t=Object.entries(yt);for(const[nt,vt]of _t){const It=J[nt];It!=null&&(J[nt]=It+gt*vt)}return J},Da({},Xt))}}const W=U(1),V=U(-1);function H(gt){return"clientX"in gt&&"clientY"in gt}function q(gt){if(!gt)return!1;const{KeyboardEvent:Xt}=P(gt.target);return Xt&> instanceof Xt}function tt(gt){if(!gt)return!1;const{TouchEvent:Xt}=P(gt.target);return Xt&> instanceof Xt}function rt(gt){if(tt(gt)){if(gt.touches&>.touches.length){const{clientX:Xt,clientY:Ct}=gt.touches[0];return{x:Xt,y:Ct}}else if(gt.changedTouches&>.changedTouches.length){const{clientX:Xt,clientY:Ct}=gt.changedTouches[0];return{x:Xt,y:Ct}}}return H(gt)?{x:gt.clientX,y:gt.clientY}:null}const ft=Object.freeze({Translate:{toString(gt){if(!gt)return;const{x:Xt,y:Ct}=gt;return"translate3d("+(Xt?Math.round(Xt):0)+"px, "+(Ct?Math.round(Ct):0)+"px, 0)"}},Scale:{toString(gt){if(!gt)return;const{scaleX:Xt,scaleY:Ct}=gt;return"scaleX("+Xt+") scaleY("+Ct+")"}},Transform:{toString(gt){if(gt)return[ft.Translate.toString(gt),ft.Scale.toString(gt)].join(" ")}},Transition:{toString(gt){let{property:Xt,duration:Ct,easing:At}=gt;return Xt+" "+Ct+"ms "+At}}}),it="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function bt(gt){return gt.matches(it)?gt:gt.querySelector(it)}},971497:function(Ve,z,C){"use strict";C.r(z),C.d(z,{forceCenter:function(){return x},forceCollide:function(){return p},forceLink:function(){return A},forceManyBody:function(){return gt},forceRadial:function(){return Xt},forceSimulation:function(){return bt},forceX:function(){return Ct},forceY:function(){return At}});function x(Z,J){var yt,_t=1;Z==null&&(Z=0),J==null&&(J=0);function nt(){var vt,It=yt.length,Pt,St=0,Dt=0;for(vt=0;vtie.index){var Br=Lt-_r.x-_r.vx,cn=ne-_r.y-_r.vy,an=Br*Br+cn*cn;anLt+Or||Ttne+Or||PeDt.r&&(Dt.r=Dt[Qt].r)}function St(){if(J){var Dt,Qt=J.length,ue;for(yt=new Array(Qt),Dt=0;Dt=0&&(_t=yt.slice(nt+1),yt=yt.slice(0,nt)),yt&&!J.hasOwnProperty(yt))throw new Error("unknown type: "+yt);return{type:yt,name:_t}})}F.prototype=D.prototype={constructor:F,on:function(J,yt){var _t=this._,nt=Y(J+"",_t),vt,It=-1,Pt=nt.length;if(arguments.length<2){for(;++It0)for(var _t=new Array(vt),nt=0,vt,It;nt1?(ae==null?Pt.delete(Wt):Pt.set(Wt,ne(ae)),J):Pt.get(Wt)},find:function(Wt,ae,Ce){var xe=0,Jt=Z.length,we,Tt,Pe,_r,Ar;for(Ce==null?Ce=1/0:Ce*=Ce,xe=0;xe1?(Dt.on(Wt,ae),J):Dt.on(Wt)}}}function gt(){var Z,J,yt,_t,nt=w(-30),vt,It=1,Pt=1/0,St=.81;function Dt(Lt){var ne,ve=Z.length,Wt=(0,k.Z)(Z,tt,rt).visitAfter(ue);for(_t=Lt,ne=0;ne=Pt)return;(Lt.data!==J||Lt.next)&&(ae===0&&(ae=T(yt),Jt+=ae*ae),Ce===0&&(Ce=T(yt),Jt+=Ce*Ce),Jt1&&arguments[1]!==void 0?arguments[1]:{};if(!D(Q))throw new TypeError("input must be an array");if(Q.length===0)throw new TypeError("input must not be empty");var R=ot.fromIndex,M=R===void 0?0:R,O=ot.toIndex,X=O===void 0?Q.length:O;if(M<0||M>=Q.length||!Number.isInteger(M))throw new Error("fromIndex must be a positive integer smaller than length");if(X<=M||X>Q.length||!Number.isInteger(X))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var mt=Q[M],Ft=M+1;Ftmt&&(mt=Q[Ft]);return mt}function Y(Q){var ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!D(Q))throw new TypeError("input must be an array");if(Q.length===0)throw new TypeError("input must not be empty");var R=ot.fromIndex,M=R===void 0?0:R,O=ot.toIndex,X=O===void 0?Q.length:O;if(M<0||M>=Q.length||!Number.isInteger(M))throw new Error("fromIndex must be a positive integer smaller than length");if(X<=M||X>Q.length||!Number.isInteger(X))throw new Error("toIndex must be an integer greater than fromIndex and at most equal to length");for(var mt=Q[M],Ft=M+1;Ft1&&arguments[1]!==void 0?arguments[1]:{};if(D(Q)){if(Q.length===0)throw new TypeError("input must not be empty")}else throw new TypeError("input must be an array");var R;if(ot.output!==void 0){if(!D(ot.output))throw new TypeError("output option must be an array if specified");R=ot.output}else R=new Array(Q.length);var M=Y(Q),O=F(Q);if(M===O)throw new RangeError("minimum and maximum input values are equal. Cannot rescale a constant array");var X=ot.min,mt=X===void 0?ot.autoMinMax?M:0:X,Ft=ot.max,Bt=Ft===void 0?ot.autoMinMax?O:1:Ft;if(mt>=Bt)throw new RangeError("min option must be smaller than max option");for(var ee=(Bt-mt)/(O-M),Le=0;Le1&&arguments[1]!==void 0?arguments[1]:{},R=ot.maxRows,M=R===void 0?15:R,O=ot.maxColumns,X=O===void 0?10:O,mt=ot.maxNumSize,Ft=mt===void 0?8:mt,Bt=ot.padMinus,ee=Bt===void 0?"auto":Bt;return"".concat(Q.constructor.name,` { +`).concat(h,`[ +`).concat($).concat(V(Q,M,X,Ft,ee),` +`).concat(h,`] +`).concat(h,"rows: ").concat(Q.rows,` +`).concat(h,"columns: ").concat(Q.columns,` +}`)}function V(Q,ot,R,M,O){var X=Q.rows,mt=Q.columns,Ft=Math.min(X,ot),Bt=Math.min(mt,R),ee=[];if(O==="auto"){O=!1;t:for(var Le=0;Le=0&&R?" ".concat(q(Q,ot-1)):q(Q,ot)).padEnd(ot)}function q(Q,ot){var R=Q.toString();if(R.length<=ot)return R;var M=Q.toFixed(ot);if(M.length>ot&&(M=Q.toFixed(Math.max(0,ot-(M.length-ot)))),M.length<=ot&&!M.startsWith("0.000")&&!M.startsWith("-0.000"))return M;var O=Q.toExponential(ot);return O.length>ot&&(O=Q.toExponential(Math.max(0,ot-(O.length-ot)))),O.slice(0)}function tt(Q,ot){Q.prototype.add=function(M){return typeof M=="number"?this.addS(M):this.addM(M)},Q.prototype.addS=function(M){for(var O=0;O>M);return this},Q.prototype.signPropagatingRightShiftM=function(M){if(M=ot.checkMatrix(M),this.rows!==M.rows||this.columns!==M.columns)throw new RangeError("Matrices dimensions must be equal");for(var O=0;O>M.get(O,X));return this},Q.signPropagatingRightShift=function(M,O){var X=new ot(M);return X.signPropagatingRightShift(O)},Q.prototype.rightShift=function(M){return typeof M=="number"?this.rightShiftS(M):this.rightShiftM(M)},Q.prototype.rightShiftS=function(M){for(var O=0;O>>M);return this},Q.prototype.rightShiftM=function(M){if(M=ot.checkMatrix(M),this.rows!==M.rows||this.columns!==M.columns)throw new RangeError("Matrices dimensions must be equal");for(var O=0;O>>M.get(O,X));return this},Q.rightShift=function(M,O){var X=new ot(M);return X.rightShift(O)},Q.prototype.zeroFillRightShift=Q.prototype.rightShift,Q.prototype.zeroFillRightShiftS=Q.prototype.rightShiftS,Q.prototype.zeroFillRightShiftM=Q.prototype.rightShiftM,Q.zeroFillRightShift=Q.rightShift,Q.prototype.not=function(){for(var M=0;MM)throw new RangeError("Row index out of range")}function ft(Q,ot,R){var M=R?Q.columns:Q.columns-1;if(ot<0||ot>M)throw new RangeError("Column index out of range")}function it(Q,ot){if(ot.to1DArray&&(ot=ot.to1DArray()),ot.length!==Q.columns)throw new RangeError("vector size must be the same as the number of columns");return ot}function bt(Q,ot){if(ot.to1DArray&&(ot=ot.to1DArray()),ot.length!==Q.rows)throw new RangeError("vector size must be the same as the number of rows");return ot}function gt(Q,ot){if(!D(ot))throw new TypeError("row indices must be an array");for(var R=0;R=Q.rows)throw new RangeError("row indices are out of range")}function Xt(Q,ot){if(!D(ot))throw new TypeError("column indices must be an array");for(var R=0;R=Q.columns)throw new RangeError("column indices are out of range")}function Ct(Q,ot,R,M,O){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(Z("startRow",ot),Z("endRow",R),Z("startColumn",M),Z("endColumn",O),ot>R||M>O||ot<0||ot>=Q.rows||R<0||R>=Q.rows||M<0||M>=Q.columns||O<0||O>=Q.columns)throw new RangeError("Submatrix indices are out of range")}function At(Q){for(var ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,R=[],M=0;MO?(mt=!0,O=M):(X=!1,mt=!0);R++}return X}},{key:"isReducedEchelonForm",value:function(){for(var R=0,M=0,O=-1,X=!0,mt=!1;RO?(mt=!0,O=M):(X=!1,mt=!0);for(var Ft=M+1;FtR.get(X,O)&&(X=mt);if(R.get(X,O)===0)O++;else{R.swapRows(M,X);for(var Ft=R.get(M,O),Bt=O;Bt=0;)if(R.maxRow(X)===0)X--;else{for(var mt=0,Ft=!1;mt0&&arguments[0]!==void 0?arguments[0]:{};if(m()(R)!=="object")throw new TypeError("options must be an object");var M=R.rows,O=M===void 0?1:M,X=R.columns,mt=X===void 0?1:X;if(!Number.isInteger(O)||O<=0)throw new TypeError("rows must be a positive integer");if(!Number.isInteger(mt)||mt<=0)throw new TypeError("columns must be a positive integer");for(var Ft=new Pe(this.rows*O,this.columns*mt),Bt=0;BtM[O]&&(M[O]=this.get(O,X));return M}case"column":{for(var mt=new Array(this.columns).fill(Number.NEGATIVE_INFINITY),Ft=0;Ftmt[Bt]&&(mt[Bt]=this.get(Ft,Bt));return mt}case void 0:{for(var ee=this.get(0,0),Le=0;Leee&&(ee=this.get(Le,me));return ee}default:throw new Error("invalid option: ".concat(R))}}},{key:"maxIndex",value:function(){J(this);for(var R=this.get(0,0),M=[0,0],O=0;OR&&(R=this.get(O,X),M[0]=O,M[1]=X);return M}},{key:"min",value:function(R){if(this.isEmpty())return NaN;switch(R){case"row":{for(var M=new Array(this.rows).fill(Number.POSITIVE_INFINITY),O=0;OM&&(M=this.get(R,O));return M}},{key:"maxRowIndex",value:function(R){rt(this,R),J(this);for(var M=this.get(R,0),O=[R,0],X=1;XM&&(M=this.get(R,X),O[1]=X);return O}},{key:"minRow",value:function(R){if(rt(this,R),this.isEmpty())return NaN;for(var M=this.get(R,0),O=1;OM&&(M=this.get(O,R));return M}},{key:"maxColumnIndex",value:function(R){ft(this,R),J(this);for(var M=this.get(0,R),O=[0,R],X=1;XM&&(M=this.get(X,R),O[0]=X);return O}},{key:"minColumn",value:function(R){if(ft(this,R),this.isEmpty())return NaN;for(var M=this.get(0,R),O=1;O0&&arguments[0]!==void 0?arguments[0]:"frobenius",M=0;if(R==="max")return this.max();if(R==="frobenius"){for(var O=0;O0&&arguments[0]!==void 0?arguments[0]:{};if(m()(R)!=="object")throw new TypeError("options must be an object");var M=R.min,O=M===void 0?0:M,X=R.max,mt=X===void 0?1:X;if(!Number.isFinite(O))throw new TypeError("min must be a number");if(!Number.isFinite(mt))throw new TypeError("max must be a number");if(O>=mt)throw new RangeError("min must be smaller than max");for(var Ft=new Pe(this.rows,this.columns),Bt=0;Bt0&&b(ee,{min:O,max:mt,output:ee}),Ft.setRow(Bt,ee)}return Ft}},{key:"scaleColumns",value:function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(m()(R)!=="object")throw new TypeError("options must be an object");var M=R.min,O=M===void 0?0:M,X=R.max,mt=X===void 0?1:X;if(!Number.isFinite(O))throw new TypeError("min must be a number");if(!Number.isFinite(mt))throw new TypeError("max must be a number");if(O>=mt)throw new RangeError("min must be smaller than max");for(var Ft=new Pe(this.rows,this.columns),Bt=0;Bt0&&arguments[0]!==void 0?arguments[0]:we,M=0;M0&&arguments[0]!==void 0?arguments[0]:we,M=0;MO||M<0||M>=this.columns||O<0||O>=this.columns)throw new RangeError("Argument out of range");for(var X=new Pe(R.length,O-M+1),mt=0;mt=this.rows)throw new RangeError("Row index out of range: ".concat(R[mt]));X.set(mt,Ft-M,this.get(R[mt],Ft))}return X}},{key:"subMatrixColumn",value:function(R,M,O){if(M===void 0&&(M=0),O===void 0&&(O=this.rows-1),M>O||M<0||M>=this.rows||O<0||O>=this.rows)throw new RangeError("Argument out of range");for(var X=new Pe(O-M+1,R.length),mt=0;mt=this.columns)throw new RangeError("Column index out of range: ".concat(R[mt]));X.set(Ft-M,mt,this.get(Ft,R[mt]))}return X}},{key:"setSubMatrix",value:function(R,M,O){if(R=Pe.checkMatrix(R),R.isEmpty())return this;var X=M+R.rows-1,mt=O+R.columns-1;Ct(this,M,X,O,mt);for(var Ft=0;Ft1&&arguments[1]!==void 0?arguments[1]:{};if(m()(R)==="object"&&(M=R,R=void 0),m()(M)!=="object")throw new TypeError("options must be an object");var O=M,X=O.unbiased,mt=X===void 0?!0:X,Ft=O.mean,Bt=Ft===void 0?this.mean(R):Ft;if(typeof mt!="boolean")throw new TypeError("unbiased must be a boolean");switch(R){case"row":{if(!D(Bt))throw new TypeError("mean must be an array");return St(this,mt,Bt)}case"column":{if(!D(Bt))throw new TypeError("mean must be an array");return Dt(this,mt,Bt)}case void 0:{if(typeof Bt!="number")throw new TypeError("mean must be a number");return Qt(this,mt,Bt)}default:throw new Error("invalid option: ".concat(R))}}},{key:"standardDeviation",value:function(R,M){m()(R)==="object"&&(M=R,R=void 0);var O=this.variance(R,M);if(R===void 0)return Math.sqrt(O);for(var X=0;X1&&arguments[1]!==void 0?arguments[1]:{};if(m()(R)==="object"&&(M=R,R=void 0),m()(M)!=="object")throw new TypeError("options must be an object");var O=M,X=O.center,mt=X===void 0?this.mean(R):X;switch(R){case"row":{if(!D(mt))throw new TypeError("center must be an array");return ue(this,mt),this}case"column":{if(!D(mt))throw new TypeError("center must be an array");return ie(this,mt),this}case void 0:{if(typeof mt!="number")throw new TypeError("center must be a number");return Lt(this,mt),this}default:throw new Error("invalid option: ".concat(R))}}},{key:"scale",value:function(R){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m()(R)==="object"&&(M=R,R=void 0),m()(M)!=="object")throw new TypeError("options must be an object");var O=M.scale;switch(R){case"row":{if(O===void 0)O=ne(this);else if(!D(O))throw new TypeError("scale must be an array");return ve(this,O),this}case"column":{if(O===void 0)O=Wt(this);else if(!D(O))throw new TypeError("scale must be an array");return ae(this,O),this}case void 0:{if(O===void 0)O=Ce(this);else if(typeof O!="number")throw new TypeError("scale must be a number");return xe(this,O),this}default:throw new Error("invalid option: ".concat(R))}}},{key:"toString",value:function(R){return W(this,R)}}],[{key:"from1DArray",value:function(R,M,O){var X=R*M;if(X!==O.length)throw new RangeError("data length does not match given dimensions");for(var mt=new Pe(R,M),Ft=0;Ft2&&arguments[2]!==void 0?arguments[2]:{};if(m()(O)!=="object")throw new TypeError("options must be an object");for(var X=O.random,mt=X===void 0?Math.random:X,Ft=new Pe(R,M),Bt=0;Bt2&&arguments[2]!==void 0?arguments[2]:{};if(m()(O)!=="object")throw new TypeError("options must be an object");var X=O.min,mt=X===void 0?0:X,Ft=O.max,Bt=Ft===void 0?1e3:Ft,ee=O.random,Le=ee===void 0?Math.random:ee;if(!Number.isInteger(mt))throw new TypeError("min must be an integer");if(!Number.isInteger(Bt))throw new TypeError("max must be an integer");if(mt>=Bt)throw new RangeError("min must be smaller than max");for(var me=Bt-mt,Xe=new Pe(R,M),pr=0;pr=0)if(X.data=[],Number.isInteger(O)&&O>=0)for(var mt=0;mt1&&arguments[1]!==void 0?arguments[1]:{};y()(this,R);var mt=X.rows,Ft=mt===void 0?1:mt;if(M.length%Ft!==0)throw new Error("the data length is not divisible by the number of rows");return O=ot.call(this),O.rows=Ft,O.columns=M.length/Ft,O.data=M,O}return A()(R,[{key:"set",value:function(O,X,mt){var Ft=this._calculateIndex(O,X);return this.data[Ft]=mt,this}},{key:"get",value:function(O,X){var mt=this._calculateIndex(O,X);return this.data[mt]}},{key:"_calculateIndex",value:function(O,X){return O*this.columns+X}}]),R}(Jt),Tr=function(Q){T()(R,Q);var ot=P()(R);function R(M){var O;return y()(this,R),O=ot.call(this),O.data=M,O.rows=M.length,O.columns=M[0].length,O}return A()(R,[{key:"set",value:function(O,X,mt){return this.data[O][X]=mt,this}},{key:"get",value:function(O,X){return this.data[O][X]}}]),R}(Jt);function qr(Q,ot){if(D(Q))return Q[0]&&D(Q[0])?new Tr(Q):new $e(Q,ot);throw new Error("the argument is not an array")}var gn=function(){function Q(ot){y()(this,Q),ot=Tr.checkMatrix(ot);var R=ot.clone(),M=R.rows,O=R.columns,X=new Float64Array(M),mt=1,Ft,Bt,ee,Le,me,Xe,pr,Ze,Pr;for(Ft=0;FtMath.abs(Ze[Le])&&(Le=Ft);if(Le!==Bt){for(ee=0;ee=0;Le--){for(ee=0;eeFt?X.set(mt,Ft,R.get(mt,Ft)):mt===Ft?X.set(mt,Ft,1):X.set(mt,Ft,0);return X}},{key:"upperTriangularMatrix",get:function(){for(var R=this.LU,M=R.rows,O=R.columns,X=new Pe(M,O),mt=0;mtMath.abs(ot)?(R=ot/Q,Math.abs(Q)*Math.sqrt(1+R*R)):ot!==0?(R=Q/ot,Math.abs(ot)*Math.sqrt(1+R*R)):0}var Rn=function(){function Q(ot){y()(this,Q),ot=Tr.checkMatrix(ot);var R=ot.clone(),M=ot.rows,O=ot.columns,X=new Float64Array(O),mt,Ft,Bt,ee;for(Bt=0;Bt=0;Le--){for(ee=0;ee=0;Bt--){for(mt=0;mt1&&arguments[1]!==void 0?arguments[1]:{};if(y()(this,Q),ot=Tr.checkMatrix(ot),ot.isEmpty())throw new Error("Matrix must be non-empty");var M=ot.rows,O=ot.columns,X=R.computeLeftSingularVectors,mt=X===void 0?!0:X,Ft=R.computeRightSingularVectors,Bt=Ft===void 0?!0:Ft,ee=R.autoTranspose,Le=ee===void 0?!1:ee,me=!!mt,Xe=!!Bt,pr=!1,Ze;if(M=0;ni--)if(lr[ni]!==0){for(var Ri=ni+1;Ri=0;Si--){if(Si0;){var Sr=void 0,en=void 0;for(Sr=ga-2;Sr>=-1&&Sr!==-1;Sr--){var fn=Number.MIN_VALUE+Nr*Math.abs(lr[Sr]+Math.abs(lr[Sr+1]));if(Math.abs(ce[Sr])<=fn||Number.isNaN(ce[Sr])){ce[Sr]=0;break}}if(Sr===ga-2)en=4;else{var Pn=void 0;for(Pn=ga-1;Pn>=Sr&&Pn!==Sr;Pn--){var sa=(Pn!==ga?Math.abs(ce[Pn]):0)+(Pn!==Sr+1?Math.abs(ce[Pn-1]):0);if(Math.abs(lr[Pn])<=Nr*sa){lr[Pn]=0;break}}Pn===Sr?en=3:Pn===ga-1?en=1:(en=2,Sr=Pn)}switch(Sr++,en){case 1:{var Zn=ce[ga-2];ce[ga-2]=0;for(var pa=ga-2;pa>=Sr;pa--){var ya=xn(lr[pa],Zn),di=lr[pa]/ya,Ma=Zn/ya;if(lr[pa]=ya,pa!==Sr&&(Zn=-Ma*ce[pa-1],ce[pa-1]=di*ce[pa-1]),Xe)for(var oa=0;oa=lr[Sr+1]);){var rs=lr[Sr];if(lr[Sr]=lr[Sr+1],lr[Sr+1]=rs,Xe&&SrM&&mt.set(Ft,Bt,R.get(Ft,Bt)/this.s[Bt]);for(var ee=this.U,Le=ee.rows,me=ee.columns,Xe=new Pe(O,Le),pr=0;prR&&M++;return M}},{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 Pe.diag(this.s)}}]),Q}();function dn(Q){var ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Q=Tr.checkMatrix(Q),ot?new Mr(Q).inverse():hn(Q,Pe.eye(Q.rows))}function hn(Q,ot){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Q=Tr.checkMatrix(Q),ot=Tr.checkMatrix(ot),R?new Mr(Q).solve(ot):Q.isSquare()?new gn(Q).solve(ot):new Rn(Q).solve(ot)}function sn(Q){if(Q=Pe.checkMatrix(Q),Q.isSquare()){if(Q.columns===0)return 1;var ot,R,M,O;if(Q.columns===2)return ot=Q.get(0,0),R=Q.get(0,1),M=Q.get(1,0),O=Q.get(1,1),ot*O-R*M;if(Q.columns===3){var X,mt,Ft;return X=new Un(Q,[1,2],[1,2]),mt=new Un(Q,[1,2],[0,2]),Ft=new Un(Q,[1,2],[0,1]),ot=Q.get(0,0),R=Q.get(0,1),M=Q.get(0,2),ot*sn(X)-R*sn(mt)+M*sn(Ft)}else return new gn(Q).determinant}else throw Error("determinant can only be calculated for a square matrix")}function Wn(Q,ot){for(var R=[],M=0;M3&&arguments[3]!==void 0?arguments[3]:1e-9,O=arguments.length>4&&arguments[4]!==void 0?arguments[4]:1e-9;if(Q>O)return new Array(ot.rows+1).fill(0);for(var X=ot.addRow(R,[0]),mt=0;mt1&&arguments[1]!==void 0?arguments[1]:{},R=ot.thresholdValue,M=R===void 0?1e-9:R,O=ot.thresholdError,X=O===void 0?1e-9:O;Q=Pe.checkMatrix(Q);for(var mt=Q.rows,Ft=new Pe(mt,mt),Bt=0;Bt1&&arguments[1]!==void 0?arguments[1]:Number.EPSILON;if(Q=Pe.checkMatrix(Q),Q.isEmpty())return Q.transpose();for(var R=new Mr(Q,{autoTranspose:!0}),M=R.leftSingularVectors,O=R.rightSingularVectors,X=R.diagonal,mt=0;mtot?X[mt]=1/X[mt]:X[mt]=0;return O.mmul(Pe.diag(X).mmul(M.transpose()))}function at(Q){var ot=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Q=new Pe(Q);var M=!1;if(m()(ot)==="object"&&!Pe.isMatrix(ot)&&!D(ot)?(R=ot,ot=Q,M=!0):ot=new Pe(ot),Q.rows!==ot.rows)throw new TypeError("Both matrices must have the same number of rows");var O=R,X=O.center,mt=X===void 0?!0:X;mt&&(Q=Q.center("column"),M||(ot=ot.center("column")));for(var Ft=Q.transpose().mmul(ot),Bt=0;Bt1&&arguments[1]!==void 0?arguments[1]:Q,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Q=new Pe(Q);var M=!1;if(m()(ot)==="object"&&!Pe.isMatrix(ot)&&!D(ot)?(R=ot,ot=Q,M=!0):ot=new Pe(ot),Q.rows!==ot.rows)throw new TypeError("Both matrices must have the same number of rows");var O=R,X=O.center,mt=X===void 0?!0:X,Ft=O.scale,Bt=Ft===void 0?!0:Ft;mt&&(Q.center("column"),M||ot.center("column")),Bt&&(Q.scale("column"),M||ot.scale("column"));for(var ee=Q.standardDeviation("column",{unbiased:!0}),Le=M?ee:ot.standardDeviation("column",{unbiased:!0}),me=Q.transpose().mmul(ot),Xe=0;Xe1&&arguments[1]!==void 0?arguments[1]:{};y()(this,Q);var M=R.assumeSymmetric,O=M===void 0?!1:M;if(ot=Tr.checkMatrix(ot),!ot.isSquare())throw new Error("Matrix is not a square matrix");if(ot.isEmpty())throw new Error("Matrix must be non-empty");var X=ot.columns,mt=new Pe(X,X),Ft=new Float64Array(X),Bt=new Float64Array(X),ee=ot,Le,me,Xe=!1;if(O?Xe=!0:Xe=ot.isSymmetric(),Xe){for(Le=0;Le0?X.set(mt,mt+1,M[mt]):M[mt]<0&&X.set(mt,mt-1,M[mt])}return X}}]),Q}();function te(Q,ot,R,M){var O,X,mt,Ft,Bt,ee,Le,me;for(Bt=0;Bt0;Ft--){for(me=0,mt=0,ee=0;ee0&&(X=-X),ot[Ft]=me*X,mt=mt-O*X,R[Ft-1]=O-X,Bt=0;Btee){Dr=0;do{for(Dr=Dr+1,O=R[ee],me=(R[ee+1]-O)/(2*ot[ee]),Xe=xn(me,1),me<0&&(Xe=-Xe),R[ee]=ot[ee]/(me+Xe),R[ee+1]=ot[ee]*(me+Xe),pr=R[ee+1],X=O-R[ee],mt=ee+2;mt=ee;mt--)for(un=Pr,Pr=Ze,Rr=lr,O=Ze*ot[mt],X=Ze*me,Xe=xn(me,ot[mt]),ot[mt+1]=lr*Xe,lr=ot[mt]/Xe,Ze=me/Xe,me=Ze*R[mt]-lr*O,R[mt+1]=X+lr*(Ze*O+lr*R[mt]),Bt=0;Btpe*jt)}R[ee]=R[ee]+ce,ot[ee]=0}for(mt=0;mt=me;ee--)R[ee]=ot.get(ee,me-1)/Xe,Bt+=R[ee]*R[ee];for(Ft=Math.sqrt(Bt),R[me]>0&&(Ft=-Ft),Bt=Bt-R[me]*Ft,R[me]=R[me]-Ft,Le=me;Le=me;ee--)mt+=R[ee]*ot.get(ee,Le);for(mt=mt/Bt,ee=me;ee<=X;ee++)ot.set(ee,Le,ot.get(ee,Le)-mt*R[ee])}for(ee=0;ee<=X;ee++){for(mt=0,Le=X;Le>=me;Le--)mt+=R[Le]*ot.get(ee,Le);for(mt=mt/Bt,Le=me;Le<=X;Le++)ot.set(ee,Le,ot.get(ee,Le)-mt*R[Le])}R[me]=Xe*R[me],ot.set(me,me-1,Xe*Ft)}}for(ee=0;ee=O+1;me--)if(ot.get(me,me-1)!==0){for(ee=me+1;ee<=X;ee++)R[ee]=ot.get(ee,me-1);for(Le=me;Le<=X;Le++){for(Ft=0,ee=me;ee<=X;ee++)Ft+=R[ee]*M.get(ee,Le);for(Ft=Ft/R[me]/ot.get(me,me-1),ee=me;ee<=X;ee++)M.set(ee,Le,M.get(ee,Le)+Ft*R[ee])}}}function kt(Q,ot,R,M,O){var X=Q-1,mt=0,Ft=Q-1,Bt=Number.EPSILON,ee=0,Le=0,me=0,Xe=0,pr=0,Ze=0,Pr=0,un=0,Ke,lr,Rr,Dr,ce,jt,pe,Oe,Se,Fe,or,gr,Jr,Gn,pn;for(Ke=0;KeFt)&&(R[Ke]=O.get(Ke,Ke),ot[Ke]=0),lr=Math.max(Ke-1,0);lr=mt;){for(Dr=X;Dr>mt&&(Ze=Math.abs(O.get(Dr-1,Dr-1))+Math.abs(O.get(Dr,Dr)),Ze===0&&(Ze=Le),!(Math.abs(O.get(Dr,Dr-1))=0){for(Pr=me>=0?me+Pr:me-Pr,R[X-1]=Oe+Pr,R[X]=R[X-1],Pr!==0&&(R[X]=Oe-pe/Pr),ot[X-1]=0,ot[X]=0,Oe=O.get(X,X-1),Ze=Math.abs(Oe)+Math.abs(Pr),me=Oe/Ze,Xe=Pr/Ze,pr=Math.sqrt(me*me+Xe*Xe),me=me/pr,Xe=Xe/pr,lr=X-1;lr0)){for(Ze=Math.sqrt(Ze),Se=Dr&&(Pr=O.get(ce,ce),pr=Oe-Pr,Ze=Se-Pr,me=(pr*Ze-pe)/O.get(ce+1,ce)+O.get(ce,ce+1),Xe=O.get(ce+1,ce+1)-Pr-pr-Ze,pr=O.get(ce+2,ce+1),Ze=Math.abs(me)+Math.abs(Xe)+Math.abs(pr),me=me/Ze,Xe=Xe/Ze,pr=pr/Ze,!(ce===Dr||Math.abs(O.get(ce,ce-1))*(Math.abs(Xe)+Math.abs(pr))ce+2&&O.set(Ke,Ke-3,0);for(Rr=ce;Rr<=X-1&&(Gn=Rr!==X-1,Rr!==ce&&(me=O.get(Rr,Rr-1),Xe=O.get(Rr+1,Rr-1),pr=Gn?O.get(Rr+2,Rr-1):0,Oe=Math.abs(me)+Math.abs(Xe)+Math.abs(pr),Oe!==0&&(me=me/Oe,Xe=Xe/Oe,pr=pr/Oe)),Oe!==0);Rr++)if(Ze=Math.sqrt(me*me+Xe*Xe+pr*pr),me<0&&(Ze=-Ze),Ze!==0){for(Rr!==ce?O.set(Rr,Rr-1,-Ze*Oe):Dr!==ce&&O.set(Rr,Rr-1,-O.get(Rr,Rr-1)),me=me+Ze,Oe=me/Ze,Se=Xe/Ze,Pr=pr/Ze,Xe=Xe/me,pr=pr/me,lr=Rr;lr=0;X--)if(me=R[X],Xe=ot[X],Xe===0)for(Dr=X,O.set(X,X,1),Ke=X-1;Ke>=0;Ke--){for(pe=O.get(Ke,Ke)-me,pr=0,lr=Dr;lr<=X;lr++)pr=pr+O.get(Ke,lr)*O.get(lr,X);if(ot[Ke]<0)Pr=pe,Ze=pr;else if(Dr=Ke,ot[Ke]===0?O.set(Ke,X,pe!==0?-pr/pe:-pr/(Bt*Le)):(Oe=O.get(Ke,Ke+1),Se=O.get(Ke+1,Ke),Xe=(R[Ke]-me)*(R[Ke]-me)+ot[Ke]*ot[Ke],jt=(Oe*Ze-Pr*pr)/Xe,O.set(Ke,X,jt),O.set(Ke+1,X,Math.abs(Oe)>Math.abs(Pr)?(-pr-pe*jt)/Oe:(-Ze-Se*jt)/Pr)),jt=Math.abs(O.get(Ke,X)),Bt*jt*jt>1)for(lr=Ke;lr<=X;lr++)O.set(lr,X,O.get(lr,X)/jt)}else if(Xe<0)for(Dr=X-1,Math.abs(O.get(X,X-1))>Math.abs(O.get(X-1,X))?(O.set(X-1,X-1,Xe/O.get(X,X-1)),O.set(X-1,X,-(O.get(X,X)-me)/O.get(X,X-1))):(pn=qt(0,-O.get(X-1,X),O.get(X-1,X-1)-me,Xe),O.set(X-1,X-1,pn[0]),O.set(X-1,X,pn[1])),O.set(X,X-1,0),O.set(X,X,1),Ke=X-2;Ke>=0;Ke--){for(Fe=0,or=0,lr=Dr;lr<=X;lr++)Fe=Fe+O.get(Ke,lr)*O.get(lr,X-1),or=or+O.get(Ke,lr)*O.get(lr,X);if(pe=O.get(Ke,Ke)-me,ot[Ke]<0)Pr=pe,pr=Fe,Ze=or;else if(Dr=Ke,ot[Ke]===0?(pn=qt(-Fe,-or,pe,Xe),O.set(Ke,X-1,pn[0]),O.set(Ke,X,pn[1])):(Oe=O.get(Ke,Ke+1),Se=O.get(Ke+1,Ke),gr=(R[Ke]-me)*(R[Ke]-me)+ot[Ke]*ot[Ke]-Xe*Xe,Jr=(R[Ke]-me)*2*Xe,gr===0&&Jr===0&&(gr=Bt*Le*(Math.abs(pe)+Math.abs(Xe)+Math.abs(Oe)+Math.abs(Se)+Math.abs(Pr))),pn=qt(Oe*pr-Pr*Fe+Xe*or,Oe*Ze-Pr*or-Xe*Fe,gr,Jr),O.set(Ke,X-1,pn[0]),O.set(Ke,X,pn[1]),Math.abs(Oe)>Math.abs(Pr)+Math.abs(Xe)?(O.set(Ke+1,X-1,(-Fe-pe*O.get(Ke,X-1)+Xe*O.get(Ke,X))/Oe),O.set(Ke+1,X,(-or-pe*O.get(Ke,X)-Xe*O.get(Ke,X-1))/Oe)):(pn=qt(-pr-Se*O.get(Ke,X-1),-Ze-Se*O.get(Ke,X),Pr,Xe),O.set(Ke+1,X-1,pn[0]),O.set(Ke+1,X,pn[1]))),jt=Math.max(Math.abs(O.get(Ke,X-1)),Math.abs(O.get(Ke,X))),Bt*jt*jt>1)for(lr=Ke;lr<=X;lr++)O.set(lr,X-1,O.get(lr,X-1)/jt),O.set(lr,X,O.get(lr,X)/jt)}for(Ke=0;KeFt)for(lr=Ke;lr=mt;lr--)for(Ke=mt;Ke<=Ft;Ke++){for(Pr=0,Rr=mt;Rr<=Math.min(lr,Ft);Rr++)Pr=Pr+M.get(Ke,Rr)*O.get(Rr,lr);M.set(Ke,lr,Pr)}}}function qt(Q,ot,R,M){var O,X;return Math.abs(R)>Math.abs(M)?(O=M/R,X=R+O*M,[(Q+O*ot)/X,(ot-O*Q)/X]):(O=R/M,X=M+O*R,[(O*Q+ot)/X,(O*ot-Q)/X])}var dt=function(){function Q(ot){if(y()(this,Q),ot=Tr.checkMatrix(ot),!ot.isSymmetric())throw new Error("Matrix is not symmetric");var R=ot,M=R.rows,O=new Pe(M,M),X=!0,mt,Ft,Bt;for(Ft=0;Ft0,O.set(Ft,Ft,Math.sqrt(Math.max(ee,0))),Bt=Ft+1;Bt=0;ee--)for(Bt=0;Bt1&&arguments[1]!==void 0?arguments[1]:{};y()(this,Q),ot=Tr.checkMatrix(ot);var M=R.Y,O=R.scaleScores,X=O===void 0?!1:O,mt=R.maxIterations,Ft=mt===void 0?1e3:mt,Bt=R.terminationCriteria,ee=Bt===void 0?1e-10:Bt,Le;if(M){if(D(M)&&typeof M[0]=="number"?M=Pe.columnVector(M):M=Tr.checkMatrix(M),M.rows!==ot.rows)throw new Error("Y should have the same number of rows as X");Le=M.getColumnVector(0)}else Le=ot.getColumnVector(0);for(var me=1,Xe,pr,Ze,Pr,un=0;unee;un++)Ze=ot.transpose().mmul(Le).div(Le.transpose().mmul(Le).get(0,0)),Ze=Ze.div(Ze.norm()),Xe=ot.mmul(Ze).div(Ze.transpose().mmul(Ze).get(0,0)),un>0&&(me=Xe.clone().sub(Pr).pow(2).sum()),Pr=Xe.clone(),M?(pr=M.transpose().mmul(Xe).div(Xe.transpose().mmul(Xe).get(0,0)),pr=pr.div(pr.norm()),Le=M.mmul(pr).div(pr.transpose().mmul(pr).get(0,0))):Le=Xe;if(M){var Ke=ot.transpose().mmul(Xe).div(Xe.transpose().mmul(Xe).get(0,0));Ke=Ke.div(Ke.norm());var lr=ot.clone().sub(Xe.clone().mmul(Ke.transpose())),Rr=Le.transpose().mmul(Xe).div(Xe.transpose().mmul(Xe).get(0,0)),Dr=M.clone().sub(Xe.clone().mulS(Rr.get(0,0)).mmul(pr.transpose()));this.t=Xe,this.p=Ke.transpose(),this.w=Ze.transpose(),this.q=pr,this.u=Le,this.s=Xe.transpose().mmul(Xe),this.xResidual=lr,this.yResidual=Dr,this.betas=Rr}else this.w=Ze.transpose(),this.s=Xe.transpose().mmul(Xe).sqrt(),X?this.t=Xe.clone().div(this.s.get(0,0)):this.t=Xe,this.xResidual=ot.sub(Xe.mmul(Ze.transpose()))})},988824:function(Ve,z,C){"use strict";C.d(z,{Z:function(){return Me}});var x=C(197582),k=C(785893),w=C(667294),T=C(513669),L=C(98651),P=C(82538);const p=(kt,qt)=>{const dt=A(kt),Ut=A(qt),Q=dt.pop(),ot=Ut.pop(),R=b(dt,Ut);return R!==0?R:Q&&ot?b(Q.split("."),ot.split(".")):Q||ot?Q?-1:1:0},m=kt=>typeof kt=="string"&&/^[v\d]/.test(kt)&&g.test(kt),S=(kt,qt,dt)=>{U(dt);const Ut=p(kt,qt);return h[dt].includes(Ut)},y=(kt,qt)=>{if(qt.includes("||"))return qt.split("||").some(Xe=>y(kt,Xe));if(qt.includes(" "))return qt.trim().replace(/\s{2,}/g," ").split(" ").every(Xe=>y(kt,Xe));const dt=qt.match(/^([<>=~^]+)/),Ut=dt?dt[1]:"=";if(Ut!=="^"&&Ut!=="~")return S(kt,qt,Ut);const[Q,ot,R,,M]=A(kt),[O,X,mt,,Ft]=A(qt),Bt=[Q,ot,R],ee=[O,X!=null?X:"x",mt!=null?mt:"x"];if(Ft&&(!M||b(Bt,ee)!==0||b(M.split("."),Ft.split("."))===-1))return!1;const Le=ee.findIndex(Xe=>Xe!=="0")+1,me=Ut==="~"?2:Le>1?Le:1;return!(b(Bt.slice(0,me),ee.slice(0,me))!==0||b(Bt.slice(me),ee.slice(me))===-1)},g=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,A=kt=>{if(typeof kt!="string")throw new TypeError("Invalid argument expected string");const qt=kt.match(g);if(!qt)throw new Error(`Invalid argument not valid semver ('${kt}' received)`);return qt.shift(),qt},E=kt=>kt==="*"||kt==="x"||kt==="X",D=kt=>{const qt=parseInt(kt,10);return isNaN(qt)?kt:qt},F=(kt,qt)=>typeof kt!=typeof qt?[String(kt),String(qt)]:[kt,qt],Y=(kt,qt)=>{if(E(kt)||E(qt))return 0;const[dt,Ut]=F(D(kt),D(qt));return dt>Ut?1:dt{for(let dt=0;dt":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},$=Object.keys(h),U=kt=>{if(typeof kt!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof kt}`);if($.indexOf(kt)===-1)throw new Error(`Invalid operator, expected one of ${$.join("|")}`)};var W=function(kt,qt){return W=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(dt,Ut){dt.__proto__=Ut}||function(dt,Ut){for(var Q in Ut)Object.prototype.hasOwnProperty.call(Ut,Q)&&(dt[Q]=Ut[Q])},W(kt,qt)};function V(kt,qt){W(kt,qt);function dt(){this.constructor=kt}kt.prototype=qt===null?Object.create(qt):(dt.prototype=qt.prototype,new dt)}var H=function(){return H=Object.assign||function(qt){for(var dt,Ut=1,Q=arguments.length;Ut=0;M--)(R=kt[M])&&(ot=(Q<3?R(ot):Q>3?R(qt,dt,ot):R(qt,dt))||ot);return Q>3&&ot&&Object.defineProperty(qt,dt,ot),ot}function rt(kt,qt){return function(dt,Ut){qt(dt,Ut,kt)}}function ft(kt,qt){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(kt,qt)}function it(kt,qt,dt,Ut){function Q(ot){return ot instanceof dt?ot:new dt(function(R){R(ot)})}return new(dt||(dt=Promise))(function(ot,R){function M(mt){try{X(Ut.next(mt))}catch(Ft){R(Ft)}}function O(mt){try{X(Ut.throw(mt))}catch(Ft){R(Ft)}}function X(mt){mt.done?ot(mt.value):Q(mt.value).then(M,O)}X((Ut=Ut.apply(kt,qt||[])).next())})}function bt(kt,qt){var dt={label:0,sent:function(){if(ot[0]&1)throw ot[1];return ot[1]},trys:[],ops:[]},Ut,Q,ot,R;return R={next:M(0),throw:M(1),return:M(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function M(X){return function(mt){return O([X,mt])}}function O(X){if(Ut)throw new TypeError("Generator is already executing.");for(;dt;)try{if(Ut=1,Q&&(ot=X[0]&2?Q.return:X[0]?Q.throw||((ot=Q.return)&&ot.call(Q),0):Q.next)&&!(ot=ot.call(Q,X[1])).done)return ot;switch(Q=0,ot&&(X=[X[0]&2,ot.value]),X[0]){case 0:case 1:ot=X;break;case 4:return dt.label++,{value:X[1],done:!1};case 5:dt.label++,Q=X[1],X=[0];continue;case 7:X=dt.ops.pop(),dt.trys.pop();continue;default:if(ot=dt.trys,!(ot=ot.length>0&&ot[ot.length-1])&&(X[0]===6||X[0]===2)){dt=0;continue}if(X[0]===3&&(!ot||X[1]>ot[0]&&X[1]=kt.length&&(kt=void 0),{value:kt&&kt[Ut++],done:!kt}}};throw new TypeError(qt?"Object is not iterable.":"Symbol.iterator is not defined.")}function At(kt,qt){var dt=typeof Symbol=="function"&&kt[Symbol.iterator];if(!dt)return kt;var Ut=dt.call(kt),Q,ot=[],R;try{for(;(qt===void 0||qt-- >0)&&!(Q=Ut.next()).done;)ot.push(Q.value)}catch(M){R={error:M}}finally{try{Q&&!Q.done&&(dt=Ut.return)&&dt.call(Ut)}finally{if(R)throw R.error}}return ot}function Z(){for(var kt=[],qt=0;qt1||M(Bt,ee)})})}function M(Bt,ee){try{O(Ut[Bt](ee))}catch(Le){Ft(ot[0][3],Le)}}function O(Bt){Bt.value instanceof yt?Promise.resolve(Bt.value.v).then(X,mt):Ft(ot[0][2],Bt)}function X(Bt){M("next",Bt)}function mt(Bt){M("throw",Bt)}function Ft(Bt,ee){Bt(ee),ot.shift(),ot.length&&M(ot[0][0],ot[0][1])}}function nt(kt){var qt,dt;return qt={},Ut("next"),Ut("throw",function(Q){throw Q}),Ut("return"),qt[Symbol.iterator]=function(){return this},qt;function Ut(Q,ot){qt[Q]=kt[Q]?function(R){return(dt=!dt)?{value:yt(kt[Q](R)),done:Q==="return"}:ot?ot(R):R}:ot}}function vt(kt){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var qt=kt[Symbol.asyncIterator],dt;return qt?qt.call(kt):(kt=typeof Ct=="function"?Ct(kt):kt[Symbol.iterator](),dt={},Ut("next"),Ut("throw"),Ut("return"),dt[Symbol.asyncIterator]=function(){return this},dt);function Ut(ot){dt[ot]=kt[ot]&&function(R){return new Promise(function(M,O){R=kt[ot](R),Q(M,O,R.done,R.value)})}}function Q(ot,R,M,O){Promise.resolve(O).then(function(X){ot({value:X,done:M})},R)}}function It(kt,qt){return Object.defineProperty?Object.defineProperty(kt,"raw",{value:qt}):kt.raw=qt,kt}var Pt=Object.create?function(kt,qt){Object.defineProperty(kt,"default",{enumerable:!0,value:qt})}:function(kt,qt){kt.default=qt};function St(kt){if(kt&&kt.__esModule)return kt;var qt={};if(kt!=null)for(var dt in kt)dt!=="default"&&Object.prototype.hasOwnProperty.call(kt,dt)&>(qt,kt,dt);return Pt(qt,kt),qt}function Dt(kt){return kt&&kt.__esModule?kt:{default:kt}}function Qt(kt,qt){if(!qt.has(kt))throw new TypeError("attempted to get private field on non-instance");return qt.get(kt)}function ue(kt,qt,dt){if(!qt.has(kt))throw new TypeError("attempted to set private field on non-instance");return qt.set(kt,dt),dt}var ie=C(252796),Lt=C.n(ie);function ne(kt,qt,dt,Ut,Q,ot){ot===void 0&&(ot=0);var R=cn(kt,qt,ot),M=R.width,O=R.height,X=Math.min(M,dt),mt=Math.min(O,Ut);return X>mt*Q?{width:mt*Q,height:mt}:{width:X,height:X/Q}}function ve(kt){return kt.width>kt.height?kt.width/kt.naturalWidth:kt.height/kt.naturalHeight}function Wt(kt,qt,dt,Ut,Q){Q===void 0&&(Q=0);var ot=cn(qt.width,qt.height,Q),R=ot.width,M=ot.height;return{x:ae(kt.x,R,dt.width,Ut),y:ae(kt.y,M,dt.height,Ut)}}function ae(kt,qt,dt,Ut){var Q=qt*Ut/2-dt/2;return an(kt,-Q,Q)}function Ce(kt,qt){return Math.sqrt(Math.pow(kt.y-qt.y,2)+Math.pow(kt.x-qt.x,2))}function xe(kt,qt){return Math.atan2(qt.y-kt.y,qt.x-kt.x)*180/Math.PI}function Jt(kt,qt,dt,Ut,Q,ot,R){ot===void 0&&(ot=0),R===void 0&&(R=!0);var M=R?we:Tt,O=cn(qt.width,qt.height,ot),X=cn(qt.naturalWidth,qt.naturalHeight,ot),mt={x:M(100,((O.width-dt.width/Q)/2-kt.x/Q)/O.width*100),y:M(100,((O.height-dt.height/Q)/2-kt.y/Q)/O.height*100),width:M(100,dt.width/O.width*100/Q),height:M(100,dt.height/O.height*100/Q)},Ft=Math.round(M(X.width,mt.width*X.width/100)),Bt=Math.round(M(X.height,mt.height*X.height/100)),ee=X.width>=X.height*Ut,Le=ee?{width:Math.round(Bt*Ut),height:Bt}:{width:Ft,height:Math.round(Ft/Ut)},me=H(H({},Le),{x:Math.round(M(X.width-Le.width,mt.x*X.width/100)),y:Math.round(M(X.height-Le.height,mt.y*X.height/100))});return{croppedAreaPercentages:mt,croppedAreaPixels:me}}function we(kt,qt){return Math.min(kt,Math.max(0,qt))}function Tt(kt,qt){return qt}function Pe(kt,qt,dt,Ut,Q,ot){var R=cn(qt.width,qt.height,dt),M=an(Ut.width/R.width*(100/kt.width),Q,ot),O={x:M*R.width/2-Ut.width/2-R.width*M*(kt.x/100),y:M*R.height/2-Ut.height/2-R.height*M*(kt.y/100)};return{crop:O,zoom:M}}function _r(kt,qt,dt){var Ut=ve(qt);return dt.height>dt.width?dt.height/(kt.height*Ut):dt.width/(kt.width*Ut)}function Ar(kt,qt,dt,Ut,Q,ot){dt===void 0&&(dt=0);var R=cn(qt.naturalWidth,qt.naturalHeight,dt),M=an(_r(kt,qt,Ut),Q,ot),O=Ut.height>Ut.width?Ut.height/kt.height:Ut.width/kt.width,X={x:((R.width-kt.width)/2-kt.x)*O,y:((R.height-kt.height)/2-kt.y)*O};return{crop:X,zoom:M}}function Or(kt,qt){return{x:(qt.x+kt.x)/2,y:(qt.y+kt.y)/2}}function Br(kt){return kt*Math.PI/180}function cn(kt,qt,dt){var Ut=Br(dt);return{width:Math.abs(Math.cos(Ut)*kt)+Math.abs(Math.sin(Ut)*qt),height:Math.abs(Math.sin(Ut)*kt)+Math.abs(Math.cos(Ut)*qt)}}function an(kt,qt,dt){return Math.min(Math.max(kt,qt),dt)}function Dn(){for(var kt=[],qt=0;qt0}).join(" ").trim()}var Un=`.reactEasyCrop_Container { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + overflow: hidden; + user-select: none; + touch-action: none; + cursor: move; + display: flex; + justify-content: center; + align-items: center; +} + +.reactEasyCrop_Image, +.reactEasyCrop_Video { + will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */ +} + +.reactEasyCrop_Contain { + max-width: 100%; + max-height: 100%; + margin: auto; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; +} +.reactEasyCrop_Cover_Horizontal { + width: 100%; + height: auto; +} +.reactEasyCrop_Cover_Vertical { + width: auto; + height: 100%; +} + +.reactEasyCrop_CropArea { + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + border: 1px solid rgba(255, 255, 255, 0.5); + box-sizing: border-box; + box-shadow: 0 0 0 9999em; + color: rgba(0, 0, 0, 0.5); + overflow: hidden; +} + +.reactEasyCrop_CropAreaRound { + border-radius: 50%; +} + +.reactEasyCrop_CropAreaGrid::before { + content: ' '; + box-sizing: border-box; + position: absolute; + border: 1px solid rgba(255, 255, 255, 0.5); + top: 0; + bottom: 0; + left: 33.33%; + right: 33.33%; + border-top: 0; + border-bottom: 0; +} + +.reactEasyCrop_CropAreaGrid::after { + content: ' '; + box-sizing: border-box; + position: absolute; + border: 1px solid rgba(255, 255, 255, 0.5); + top: 33.33%; + bottom: 33.33%; + left: 0; + right: 0; + border-left: 0; + border-right: 0; +} +`,Xn=1,xr=3,$e=function(kt){V(qt,kt);function qt(){var dt=kt!==null&&kt.apply(this,arguments)||this;return dt.imageRef=w.createRef(),dt.videoRef=w.createRef(),dt.containerRef=null,dt.styleRef=null,dt.containerRect=null,dt.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},dt.dragStartPosition={x:0,y:0},dt.dragStartCrop={x:0,y:0},dt.gestureZoomStart=0,dt.gestureRotationStart=0,dt.isTouching=!1,dt.lastPinchDistance=0,dt.lastPinchRotation=0,dt.rafDragTimeout=null,dt.rafPinchTimeout=null,dt.wheelTimer=null,dt.currentDoc=typeof document!="undefined"?document:null,dt.currentWindow=typeof window!="undefined"?window:null,dt.resizeObserver=null,dt.state={cropSize:null,hasWheelJustStarted:!1},dt.initResizeObserver=function(){if(!(typeof window.ResizeObserver=="undefined"||!dt.containerRef)){var Ut=!0;dt.resizeObserver=new window.ResizeObserver(function(Q){if(Ut){Ut=!1;return}dt.computeSizes()}),dt.resizeObserver.observe(dt.containerRef)}},dt.preventZoomSafari=function(Ut){return Ut.preventDefault()},dt.cleanEvents=function(){dt.currentDoc&&(dt.currentDoc.removeEventListener("mousemove",dt.onMouseMove),dt.currentDoc.removeEventListener("mouseup",dt.onDragStopped),dt.currentDoc.removeEventListener("touchmove",dt.onTouchMove),dt.currentDoc.removeEventListener("touchend",dt.onDragStopped),dt.currentDoc.removeEventListener("gesturemove",dt.onGestureMove),dt.currentDoc.removeEventListener("gestureend",dt.onGestureEnd))},dt.clearScrollEvent=function(){dt.containerRef&&dt.containerRef.removeEventListener("wheel",dt.onWheel),dt.wheelTimer&&clearTimeout(dt.wheelTimer)},dt.onMediaLoad=function(){var Ut=dt.computeSizes();Ut&&(dt.emitCropData(),dt.setInitialCrop(Ut)),dt.props.onMediaLoaded&&dt.props.onMediaLoaded(dt.mediaSize)},dt.setInitialCrop=function(Ut){if(dt.props.initialCroppedAreaPercentages){var Q=Pe(dt.props.initialCroppedAreaPercentages,dt.mediaSize,dt.props.rotation,Ut,dt.props.minZoom,dt.props.maxZoom),ot=Q.crop,R=Q.zoom;dt.props.onCropChange(ot),dt.props.onZoomChange&&dt.props.onZoomChange(R)}else if(dt.props.initialCroppedAreaPixels){var M=Ar(dt.props.initialCroppedAreaPixels,dt.mediaSize,dt.props.rotation,Ut,dt.props.minZoom,dt.props.maxZoom),ot=M.crop,R=M.zoom;dt.props.onCropChange(ot),dt.props.onZoomChange&&dt.props.onZoomChange(R)}},dt.computeSizes=function(){var Ut,Q,ot,R,M,O,X=dt.imageRef.current||dt.videoRef.current;if(X&&dt.containerRef){dt.containerRect=dt.containerRef.getBoundingClientRect();var mt=dt.containerRect.width/dt.containerRect.height,Ft=((Ut=dt.imageRef.current)===null||Ut===void 0?void 0:Ut.naturalWidth)||((Q=dt.videoRef.current)===null||Q===void 0?void 0:Q.videoWidth)||0,Bt=((ot=dt.imageRef.current)===null||ot===void 0?void 0:ot.naturalHeight)||((R=dt.videoRef.current)===null||R===void 0?void 0:R.videoHeight)||0,ee=X.offsetWidthLe?{width:dt.containerRect.height*Le,height:dt.containerRect.height}:{width:dt.containerRect.width,height:dt.containerRect.width/Le};break;case"horizontal-cover":me={width:dt.containerRect.width,height:dt.containerRect.width/Le};break;case"vertical-cover":me={width:dt.containerRect.height*Le,height:dt.containerRect.height};break;case"auto-cover":me=Ft>Bt?{width:dt.containerRect.width,height:dt.containerRect.width/Le}:{width:dt.containerRect.height*Le,height:dt.containerRect.height};break}else me={width:X.offsetWidth,height:X.offsetHeight};dt.mediaSize=H(H({},me),{naturalWidth:Ft,naturalHeight:Bt}),dt.props.setMediaSize&&dt.props.setMediaSize(dt.mediaSize);var Xe=dt.props.cropSize?dt.props.cropSize:ne(dt.mediaSize.width,dt.mediaSize.height,dt.containerRect.width,dt.containerRect.height,dt.props.aspect,dt.props.rotation);return(((M=dt.state.cropSize)===null||M===void 0?void 0:M.height)!==Xe.height||((O=dt.state.cropSize)===null||O===void 0?void 0:O.width)!==Xe.width)&&dt.props.onCropSizeChange&&dt.props.onCropSizeChange(Xe),dt.setState({cropSize:Xe},dt.recomputeCropPosition),dt.props.setCropSize&&dt.props.setCropSize(Xe),Xe}},dt.onMouseDown=function(Ut){dt.currentDoc&&(Ut.preventDefault(),dt.currentDoc.addEventListener("mousemove",dt.onMouseMove),dt.currentDoc.addEventListener("mouseup",dt.onDragStopped),dt.onDragStart(qt.getMousePoint(Ut)))},dt.onMouseMove=function(Ut){return dt.onDrag(qt.getMousePoint(Ut))},dt.onTouchStart=function(Ut){dt.currentDoc&&(dt.isTouching=!0,!(dt.props.onTouchRequest&&!dt.props.onTouchRequest(Ut))&&(dt.currentDoc.addEventListener("touchmove",dt.onTouchMove,{passive:!1}),dt.currentDoc.addEventListener("touchend",dt.onDragStopped),Ut.touches.length===2?dt.onPinchStart(Ut):Ut.touches.length===1&&dt.onDragStart(qt.getTouchPoint(Ut.touches[0]))))},dt.onTouchMove=function(Ut){Ut.preventDefault(),Ut.touches.length===2?dt.onPinchMove(Ut):Ut.touches.length===1&&dt.onDrag(qt.getTouchPoint(Ut.touches[0]))},dt.onGestureStart=function(Ut){dt.currentDoc&&(Ut.preventDefault(),dt.currentDoc.addEventListener("gesturechange",dt.onGestureMove),dt.currentDoc.addEventListener("gestureend",dt.onGestureEnd),dt.gestureZoomStart=dt.props.zoom,dt.gestureRotationStart=dt.props.rotation)},dt.onGestureMove=function(Ut){if(Ut.preventDefault(),!dt.isTouching){var Q=qt.getMousePoint(Ut),ot=dt.gestureZoomStart-1+Ut.scale;if(dt.setNewZoom(ot,Q,{shouldUpdatePosition:!0}),dt.props.onRotationChange){var R=dt.gestureRotationStart+Ut.rotation;dt.props.onRotationChange(R)}}},dt.onGestureEnd=function(Ut){dt.cleanEvents()},dt.onDragStart=function(Ut){var Q,ot,R=Ut.x,M=Ut.y;dt.dragStartPosition={x:R,y:M},dt.dragStartCrop=H({},dt.props.crop),(ot=(Q=dt.props).onInteractionStart)===null||ot===void 0||ot.call(Q)},dt.onDrag=function(Ut){var Q=Ut.x,ot=Ut.y;dt.currentWindow&&(dt.rafDragTimeout&&dt.currentWindow.cancelAnimationFrame(dt.rafDragTimeout),dt.rafDragTimeout=dt.currentWindow.requestAnimationFrame(function(){if(dt.state.cropSize&&!(Q===void 0||ot===void 0)){var R=Q-dt.dragStartPosition.x,M=ot-dt.dragStartPosition.y,O={x:dt.dragStartCrop.x+R,y:dt.dragStartCrop.y+M},X=dt.props.restrictPosition?Wt(O,dt.mediaSize,dt.state.cropSize,dt.props.zoom,dt.props.rotation):O;dt.props.onCropChange(X)}}))},dt.onDragStopped=function(){var Ut,Q;dt.isTouching=!1,dt.cleanEvents(),dt.emitCropData(),(Q=(Ut=dt.props).onInteractionEnd)===null||Q===void 0||Q.call(Ut)},dt.onWheel=function(Ut){if(dt.currentWindow&&!(dt.props.onWheelRequest&&!dt.props.onWheelRequest(Ut))){Ut.preventDefault();var Q=qt.getMousePoint(Ut),ot=Lt()(Ut).pixelY,R=dt.props.zoom-ot*dt.props.zoomSpeed/200;dt.setNewZoom(R,Q,{shouldUpdatePosition:!0}),dt.state.hasWheelJustStarted||dt.setState({hasWheelJustStarted:!0},function(){var M,O;return(O=(M=dt.props).onInteractionStart)===null||O===void 0?void 0:O.call(M)}),dt.wheelTimer&&clearTimeout(dt.wheelTimer),dt.wheelTimer=dt.currentWindow.setTimeout(function(){return dt.setState({hasWheelJustStarted:!1},function(){var M,O;return(O=(M=dt.props).onInteractionEnd)===null||O===void 0?void 0:O.call(M)})},250)}},dt.getPointOnContainer=function(Ut){var Q=Ut.x,ot=Ut.y;if(!dt.containerRect)throw new Error("The Cropper is not mounted");return{x:dt.containerRect.width/2-(Q-dt.containerRect.left),y:dt.containerRect.height/2-(ot-dt.containerRect.top)}},dt.getPointOnMedia=function(Ut){var Q=Ut.x,ot=Ut.y,R=dt.props,M=R.crop,O=R.zoom;return{x:(Q+M.x)/O,y:(ot+M.y)/O}},dt.setNewZoom=function(Ut,Q,ot){var R=ot===void 0?{}:ot,M=R.shouldUpdatePosition,O=M===void 0?!0:M;if(!(!dt.state.cropSize||!dt.props.onZoomChange)){var X=an(Ut,dt.props.minZoom,dt.props.maxZoom);if(O){var mt=dt.getPointOnContainer(Q),Ft=dt.getPointOnMedia(mt),Bt={x:Ft.x*X-mt.x,y:Ft.y*X-mt.y},ee=dt.props.restrictPosition?Wt(Bt,dt.mediaSize,dt.state.cropSize,X,dt.props.rotation):Bt;dt.props.onCropChange(ee)}dt.props.onZoomChange(X)}},dt.getCropData=function(){if(!dt.state.cropSize)return null;var Ut=dt.props.restrictPosition?Wt(dt.props.crop,dt.mediaSize,dt.state.cropSize,dt.props.zoom,dt.props.rotation):dt.props.crop;return Jt(Ut,dt.mediaSize,dt.state.cropSize,dt.getAspect(),dt.props.zoom,dt.props.rotation,dt.props.restrictPosition)},dt.emitCropData=function(){var Ut=dt.getCropData();if(Ut){var Q=Ut.croppedAreaPercentages,ot=Ut.croppedAreaPixels;dt.props.onCropComplete&&dt.props.onCropComplete(Q,ot),dt.props.onCropAreaChange&&dt.props.onCropAreaChange(Q,ot)}},dt.emitCropAreaChange=function(){var Ut=dt.getCropData();if(Ut){var Q=Ut.croppedAreaPercentages,ot=Ut.croppedAreaPixels;dt.props.onCropAreaChange&&dt.props.onCropAreaChange(Q,ot)}},dt.recomputeCropPosition=function(){if(dt.state.cropSize){var Ut=dt.props.restrictPosition?Wt(dt.props.crop,dt.mediaSize,dt.state.cropSize,dt.props.zoom,dt.props.rotation):dt.props.crop;dt.props.onCropChange(Ut),dt.emitCropData()}},dt}return qt.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver=="undefined"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=Un,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},qt.prototype.componentWillUnmount=function(){var dt,Ut;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver=="undefined"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(dt=this.resizeObserver)===null||dt===void 0||dt.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((Ut=this.styleRef.parentNode)===null||Ut===void 0||Ut.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},qt.prototype.componentDidUpdate=function(dt){var Ut,Q,ot,R,M,O,X,mt,Ft;dt.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):dt.aspect!==this.props.aspect?this.computeSizes():dt.zoom!==this.props.zoom?this.recomputeCropPosition():((Ut=dt.cropSize)===null||Ut===void 0?void 0:Ut.height)!==((Q=this.props.cropSize)===null||Q===void 0?void 0:Q.height)||((ot=dt.cropSize)===null||ot===void 0?void 0:ot.width)!==((R=this.props.cropSize)===null||R===void 0?void 0:R.width)?this.computeSizes():(((M=dt.crop)===null||M===void 0?void 0:M.x)!==((O=this.props.crop)===null||O===void 0?void 0:O.x)||((X=dt.crop)===null||X===void 0?void 0:X.y)!==((mt=this.props.crop)===null||mt===void 0?void 0:mt.y))&&this.emitCropAreaChange(),dt.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),dt.video!==this.props.video&&((Ft=this.videoRef.current)===null||Ft===void 0||Ft.load())},qt.prototype.getAspect=function(){var dt=this.props,Ut=dt.cropSize,Q=dt.aspect;return Ut?Ut.width/Ut.height:Q},qt.prototype.onPinchStart=function(dt){var Ut=qt.getTouchPoint(dt.touches[0]),Q=qt.getTouchPoint(dt.touches[1]);this.lastPinchDistance=Ce(Ut,Q),this.lastPinchRotation=xe(Ut,Q),this.onDragStart(Or(Ut,Q))},qt.prototype.onPinchMove=function(dt){var Ut=this;if(!(!this.currentDoc||!this.currentWindow)){var Q=qt.getTouchPoint(dt.touches[0]),ot=qt.getTouchPoint(dt.touches[1]),R=Or(Q,ot);this.onDrag(R),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var M=Ce(Q,ot),O=Ut.props.zoom*(M/Ut.lastPinchDistance);Ut.setNewZoom(O,R,{shouldUpdatePosition:!1}),Ut.lastPinchDistance=M;var X=xe(Q,ot),mt=Ut.props.rotation+(X-Ut.lastPinchRotation);Ut.props.onRotationChange&&Ut.props.onRotationChange(mt),Ut.lastPinchRotation=X})}},qt.prototype.render=function(){var dt=this,Ut=this.props,Q=Ut.image,ot=Ut.video,R=Ut.mediaProps,M=Ut.transform,O=Ut.crop,X=O.x,mt=O.y,Ft=Ut.rotation,Bt=Ut.zoom,ee=Ut.cropShape,Le=Ut.showGrid,me=Ut.style,Xe=me.containerStyle,pr=me.cropAreaStyle,Ze=me.mediaStyle,Pr=Ut.classes,un=Pr.containerClassName,Ke=Pr.cropAreaClassName,lr=Pr.mediaClassName,Rr=Ut.objectFit;return w.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(ce){return dt.containerRef=ce},"data-testid":"container",style:Xe,className:Dn("reactEasyCrop_Container",un)},Q?w.createElement("img",H({alt:"",className:Dn("reactEasyCrop_Image",Rr==="contain"&&"reactEasyCrop_Contain",Rr==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",Rr==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",Rr==="auto-cover"&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),lr)},R,{src:Q,ref:this.imageRef,style:H(H({},Ze),{transform:M||"translate(".concat(X,"px, ").concat(mt,"px) rotate(").concat(Ft,"deg) scale(").concat(Bt,")")}),onLoad:this.onMediaLoad})):ot&&w.createElement("video",H({autoPlay:!0,loop:!0,muted:!0,className:Dn("reactEasyCrop_Video",Rr==="contain"&&"reactEasyCrop_Contain",Rr==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",Rr==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",Rr==="auto-cover"&&(this.mediaSize.naturalWidth>this.mediaSize.naturalHeight?"reactEasyCrop_Cover_Horizontal":"reactEasyCrop_Cover_Vertical"),lr)},R,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:H(H({},Ze),{transform:M||"translate(".concat(X,"px, ").concat(mt,"px) rotate(").concat(Ft,"deg) scale(").concat(Bt,")")}),controls:!1}),(Array.isArray(ot)?ot:[{src:ot}]).map(function(Dr){return w.createElement("source",H({key:Dr.src},Dr))})),this.state.cropSize&&w.createElement("div",{style:H(H({},pr),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Dn("reactEasyCrop_CropArea",ee==="round"&&"reactEasyCrop_CropAreaRound",Le&&"reactEasyCrop_CropAreaGrid",Ke)}))},qt.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:xr,minZoom:Xn,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},qt.getMousePoint=function(dt){return{x:Number(dt.clientX),y:Number(dt.clientY)}},qt.getTouchPoint=function(dt){return{x:Number(dt.clientX),y:Number(dt.clientY)}},qt}(w.Component),Tr=C(905303),qr=C(591607);const gn="img-crop",xn=1,Rn=.1,Mr=0,dn=-180,hn=180,sn=1,Wn=.5,Mn=2,In=.01,jn=(0,w.forwardRef)((kt,qt)=>{const{cropperRef:dt,zoomSlider:Ut,rotationSlider:Q,aspectSlider:ot,showReset:R,resetBtnText:M,modalImage:O,aspect:X,minZoom:mt,maxZoom:Ft,cropShape:Bt,showGrid:ee,cropperProps:Le}=kt,[me,Xe]=(0,w.useState)(xn),[pr,Ze]=(0,w.useState)(Mr),[Pr,un]=(0,w.useState)(X),Ke=me!==xn||pr!==Mr||Pr!==X,lr=()=>{Xe(xn),Ze(Mr),un(X)},[Rr,Dr]=(0,w.useState)({x:0,y:0}),ce=(0,w.useRef)({width:0,height:0,x:0,y:0}),jt=(0,w.useCallback)((Fe,or)=>{ce.current=or},[]);(0,w.useImperativeHandle)(qt,()=>({rotation:pr,cropPixelsRef:ce,onReset:lr}));const pe="[display:flex] [align-items:center] [width:60%] [margin-inline:auto]",Oe="[display:flex] [align-items:center] [justify-content:center] [height:32px] [width:32px] [background:transparent] [border:0] [font-family:inherit] [font-size:18px] [cursor:pointer] disabled:[opacity:20%] disabled:[cursor:default]",Se="[flex:1]";return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)($e,Object.assign({},Le,{ref:dt,image:O,crop:Rr,zoom:me,rotation:pr,aspect:Pr,minZoom:mt,maxZoom:Ft,zoomWithScroll:Ut,cropShape:Bt,showGrid:ee,onCropChange:Dr,onZoomChange:Xe,onRotationChange:Ze,onCropComplete:jt,classes:{containerClassName:`${gn}-container ![position:relative] [width:100%] [height:40vh] [&~section:first-of-type]:[margin-top:16px] [&~section:last-of-type]:[margin-bottom:16px]`,mediaClassName:`${gn}-media`}})),Ut&&(0,k.jsxs)("section",Object.assign({className:`${gn}-control ${gn}-control-zoom ${pe}`},{children:[(0,k.jsx)("button",Object.assign({className:Oe,onClick:()=>Xe(me-Rn),disabled:me-RnXe(me+Rn),disabled:me+Rn>Ft},{children:"\uFF0B"}))]})),Q&&(0,k.jsxs)("section",Object.assign({className:`${gn}-control ${gn}-control-rotation ${pe}`},{children:[(0,k.jsx)("button",Object.assign({className:`${Oe} [font-size:16px]`,onClick:()=>Ze(pr-sn),disabled:pr===dn},{children:"\u21BA"})),(0,k.jsx)(qr.Z,{className:Se,min:dn,max:hn,step:sn,value:pr,onChange:Ze}),(0,k.jsx)("button",Object.assign({className:`${Oe} [font-size:16px]`,onClick:()=>Ze(pr+sn),disabled:pr===hn},{children:"\u21BB"}))]})),ot&&(0,k.jsxs)("section",Object.assign({className:`${gn}-control ${gn}-control-aspect ${pe}`},{children:[(0,k.jsx)("button",Object.assign({className:Oe,onClick:()=>un(Pr-In),disabled:Pr-Inun(Pr+In),disabled:Pr+In>Mn},{children:"\u2194\uFE0F"}))]})),R&&(Ut||Q||ot)&&(0,k.jsx)(Tr.ZP,Object.assign({className:"[bottom:20px] [position:absolute]",style:Ke?{}:{opacity:.3,pointerEvents:"none"},onClick:lr},{children:M}))]})});var at=(0,w.memo)(jn);function Je(kt,qt){qt===void 0&&(qt={});var dt=qt.insertAt;if(!(!kt||typeof document=="undefined")){var Ut=document.head||document.getElementsByTagName("head")[0],Q=document.createElement("style");Q.type="text/css",dt==="top"&&Ut.firstChild?Ut.insertBefore(Q,Ut.firstChild):Ut.appendChild(Q),Q.styleSheet?Q.styleSheet.cssText=kt:Q.appendChild(document.createTextNode(kt))}}var Ht=".container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.visible{visibility:visible}.grid{display:grid}.\\!\\[position\\:relative\\]{position:relative!important}.\\[align-items\\:center\\]{align-items:center}.\\[background\\:transparent\\]{background:transparent}.\\[border\\:0\\]{border:0}.\\[bottom\\:20px\\]{bottom:20px}.\\[cursor\\:pointer\\]{cursor:pointer}.\\[display\\:flex\\]{display:flex}.\\[flex\\:1\\]{flex:1}.\\[font-family\\:inherit\\]{font-family:inherit}.\\[font-size\\:16px\\]{font-size:16px}.\\[font-size\\:18px\\]{font-size:18px}.\\[height\\:32px\\]{height:32px}.\\[height\\:40vh\\]{height:40vh}.\\[justify-content\\:center\\]{justify-content:center}.\\[margin-inline\\:auto\\]{margin-inline:auto}.\\[position\\:absolute\\]{position:absolute}.\\[width\\:100\\%\\]{width:100%}.\\[width\\:32px\\]{width:32px}.\\[width\\:60\\%\\]{width:60%}.disabled\\:\\[cursor\\:default\\]:disabled{cursor:default}.disabled\\:\\[opacity\\:20\\%\\]:disabled{opacity:20%}.\\[\\&\\~section\\:first-of-type\\]\\:\\[margin-top\\:16px\\]~section:first-of-type{margin-top:16px}.\\[\\&\\~section\\:last-of-type\\]\\:\\[margin-bottom\\:16px\\]~section:last-of-type{margin-bottom:16px}";Je(Ht);const te=p(T.version,"4.23.0")===-1?"visible":"open",wt=(kt,qt,dt)=>qt in kt?(console.error(`\`${qt}\` is deprecated, please use \`${dt}\` instead`),kt[qt]):kt[dt],Me=(0,w.forwardRef)((kt,qt)=>{const{quality:dt=.4,fillColor:Ut="white",zoomSlider:Q=!0,rotationSlider:ot=!1,aspectSlider:R=!1,showReset:M=!1,resetText:O,aspect:X=1,minZoom:mt=1,maxZoom:Ft=3,cropShape:Bt="rect",showGrid:ee=!1,cropperProps:Le,modalClassName:me,modalTitle:Xe,modalWidth:pr,modalOk:Ze,modalCancel:Pr,onModalOk:un,onModalCancel:Ke,modalProps:lr,beforeCrop:Rr,children:Dr}=kt,ce=wt(kt,"zoom","zoomSlider")||!0,jt=wt(kt,"rotate","rotationSlider")||!1,pe=wt(kt,"shape","cropShape")||"rect",Oe=wt(kt,"grid","showGrid")||!1;"onUploadFail"in kt&&console.error("`onUploadFail` is removed, because the only way it is called, is when the file is rejected by beforeUpload"),wt(kt,"modalMaskTransitionName","modalProps.maskTransitionName"),wt(kt,"modalTransitionName","modalProps.transitionName");const Se=(0,w.useRef)({});Se.current.onModalOk=un,Se.current.onModalCancel=Ke,Se.current.beforeCrop=Rr;const Fe=(0,w.useRef)(null),or=(0,w.useCallback)(ti=>{var ei;const wi=document.createElement("canvas"),Gi=wi.getContext("2d"),eo=(((ei=ti==null?void 0:ti.getRootNode)===null||ei===void 0?void 0:ei.call(ti))||document).querySelector(`.${gn}-media`),{width:ga,height:lo,x:To,y:ni}=Fe.current.cropPixelsRef.current;if(jt&&Fe.current.rotation!==Mr){const{naturalWidth:Ri,naturalHeight:ho}=eo,Po=Fe.current.rotation*(Math.PI/180),ro=Math.abs(Math.sin(Po)),no=Math.abs(Math.cos(Po)),es=Ri*no+ho*ro,vo=ho*no+Ri*ro;wi.width=es,wi.height=vo,Gi.fillStyle=Ut,Gi.fillRect(0,0,es,vo);const Si=es/2,ao=vo/2;Gi.translate(Si,ao),Gi.rotate(Po),Gi.translate(-Si,-ao);const Jo=(es-Ri)/2,Yt=(vo-ho)/2;Gi.drawImage(eo,0,0,Ri,ho,Jo,Yt,Ri,ho);const de=Gi.getImageData(0,0,es,vo);wi.width=ga,wi.height=lo,Gi.putImageData(de,-To,-ni)}else wi.width=ga,wi.height=lo,Gi.fillStyle=Ut,Gi.fillRect(0,0,ga,lo),Gi.drawImage(eo,To,ni,ga,lo,0,0,ga,lo);return wi},[Ut,jt]),[gr,Jr]=(0,w.useState)(""),Gn=(0,w.useRef)(),pn=(0,w.useRef)(),qn=(0,w.useMemo)(()=>{const ti=Array.isArray(Dr)?Dr[0]:Dr,ei=ti.props,{beforeUpload:wi,accept:Gi}=ei,Co=(0,x.__rest)(ei,["beforeUpload","accept"]),eo=(ga,lo)=>new Promise(To=>(0,x.__awaiter)(void 0,void 0,void 0,function*(){if(typeof Se.current.beforeCrop=="function")try{const Ri=yield Se.current.beforeCrop(ga,lo);if(Ri!==!0)return To(Ri)}catch(Ri){return To(Ri)}const ni=new FileReader;ni.addEventListener("load",()=>{typeof ni.result=="string"&&Jr(ni.result)}),ni.readAsDataURL(ga),Gn.current=()=>{var Ri,ho;Jr(""),Fe.current.onReset(),To(P.Z.LIST_IGNORE),(ho=(Ri=Se.current).onModalCancel)===null||ho===void 0||ho.call(Ri)},pn.current=Ri=>(0,x.__awaiter)(void 0,void 0,void 0,function*(){Jr(""),Fe.current.onReset();const ho=or(Ri.target),{type:Po,name:ro,uid:no}=ga;ho.toBlob(es=>(0,x.__awaiter)(void 0,void 0,void 0,function*(){var vo,Si,ao,Jo,Yt,de;const Ge=new File([es],ro,{type:Po});if(Object.assign(Ge,{uid:no}),typeof wi!="function"){To(Ge),(Si=(vo=Se.current).onModalOk)===null||Si===void 0||Si.call(vo,Ge);return}try{const sr=yield wi(Ge,[Ge]),Lr=sr===!0?Ge:sr;To(Lr),(Jo=(ao=Se.current).onModalOk)===null||Jo===void 0||Jo.call(ao,Lr)}catch(sr){To(sr),(de=(Yt=Se.current).onModalOk)===null||de===void 0||de.call(Yt,sr)}}),Po,dt)})}));return Object.assign(Object.assign({},ti),{props:Object.assign(Object.assign({},Co),{accept:Gi||"image/*",beforeUpload:eo})})},[Dr,or,dt]),ln=(0,w.useMemo)(()=>{const ti={};return pr!==void 0&&(ti.width=pr),Ze!==void 0&&(ti.okText=Ze),Pr!==void 0&&(ti.cancelText=Pr),ti},[Pr,Ze,pr]),Vn=`${gn}-modal${me?` ${me}`:""}`,ba=(typeof window=="undefined"?"":window.navigator.language)==="zh-CN",Ea=Xe||(ba?"\u7F16\u8F91\u56FE\u7247":"Edit image"),Ni=O||(ba?"\u91CD\u7F6E":"Reset");return(0,k.jsxs)(k.Fragment,{children:[qn,gr&&(0,k.jsx)(L.Z,Object.assign({},lr,ln,{[te]:!0},{title:Ea,onCancel:Gn.current,onOk:pn.current,wrapClassName:Vn,maskClosable:!1,destroyOnClose:!0},{children:(0,k.jsx)(at,{ref:Fe,cropperRef:qt,zoomSlider:ce,rotationSlider:jt,aspectSlider:R,showReset:M,resetBtnText:Ni,modalImage:gr,aspect:X,minZoom:mt,maxZoom:Ft,cropShape:pe,showGrid:Oe,cropperProps:Le})}))]})})},386010:function(Ve,z,C){"use strict";C.r(z),C.d(z,{clsx:function(){return k}});function x(w){var T,L,P="";if(typeof w=="string"||typeof w=="number")P+=w;else if(typeof w=="object")if(Array.isArray(w))for(T=0;Tp.endVal;p.frameVal=y?p.endVal:p.frameVal,p.frameVal=Number(p.frameVal.toFixed(p.options.decimalPlaces)),p.printValue(p.frameVal),S1?p.options.decimal+D[1]:"",p.options.useGrouping){A="";for(var F=3,Y=0,b=0,h=y.length;bwindow.scrollY&&T.paused?(T.paused=!1,setTimeout(function(){return T.start()},T.options.scrollSpyDelay),T.options.scrollSpyOnce&&(T.once=!0)):(window.scrollY>m||p>L)&&!T.paused&&T.reset()}},w.prototype.determineDirectionAndSmartEasing=function(){var T=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>T;var L=T-this.startVal;if(Math.abs(L)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=T;var P=this.countDown?1:-1;this.endVal=T+P*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=T,this.finalEndVal=null;this.finalEndVal!==null?this.useEasing=!1:this.useEasing=this.options.useEasing},w.prototype.start=function(T){this.error||(T&&(this.options.onCompleteCallback=T),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},w.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},w.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},w.prototype.update=function(T){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(T),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,this.finalEndVal==null&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},w.prototype.printValue=function(T){var L;if(this.el){var P=this.formattingFn(T);!((L=this.options.plugin)===null||L===void 0)&&L.render?this.options.plugin.render(this.el,P):this.el.tagName==="INPUT"?this.el.value=P:this.el.tagName==="text"||this.el.tagName==="tspan"?this.el.textContent=P:this.el.innerHTML=P}},w.prototype.ensureNumber=function(T){return typeof T=="number"&&!isNaN(T)},w.prototype.validateValue=function(T){var L=Number(T);return this.ensureNumber(L)?L:(this.error="[CountUp] invalid start or end value: ".concat(T),null)},w.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},w}()},971829:function(Ve,z,C){"use strict";C.r(z),C.d(z,{quadtree:function(){return x.Z}});var x=C(547148)},547148:function(Ve,z,C){"use strict";C.d(z,{Z:function(){return $}});function x(H){const q=+this._x.call(null,H),tt=+this._y.call(null,H);return k(this.cover(q,tt),q,tt,H)}function k(H,q,tt,rt){if(isNaN(q)||isNaN(tt))return H;var ft,it=H._root,bt={data:rt},gt=H._x0,Xt=H._y0,Ct=H._x1,At=H._y1,Z,J,yt,_t,nt,vt,It,Pt;if(!it)return H._root=bt,H;for(;it.length;)if((nt=q>=(Z=(gt+Ct)/2))?gt=Z:Ct=Z,(vt=tt>=(J=(Xt+At)/2))?Xt=J:At=J,ft=it,!(it=it[It=vt<<1|nt]))return ft[It]=bt,H;if(yt=+H._x.call(null,it.data),_t=+H._y.call(null,it.data),q===yt&&tt===_t)return bt.next=it,ft?ft[It]=bt:H._root=bt,H;do ft=ft?ft[It]=new Array(4):H._root=new Array(4),(nt=q>=(Z=(gt+Ct)/2))?gt=Z:Ct=Z,(vt=tt>=(J=(Xt+At)/2))?Xt=J:At=J;while((It=vt<<1|nt)===(Pt=(_t>=J)<<1|yt>=Z));return ft[Pt]=it,ft[It]=bt,H}function w(H){var q,tt,rt=H.length,ft,it,bt=new Array(rt),gt=new Array(rt),Xt=1/0,Ct=1/0,At=-1/0,Z=-1/0;for(tt=0;ttAt&&(At=ft),itZ&&(Z=it));if(Xt>At||Ct>Z)return this;for(this.cover(Xt,Ct).cover(At,Z),tt=0;ttH||H>=ft||rt>q||q>=it;)switch(Ct=(qAt||(gt=_t.y0)>Z||(Xt=_t.x1)=It)<<1|H>=vt)&&(_t=J[J.length-1],J[J.length-1]=J[J.length-1-nt],J[J.length-1-nt]=_t)}else{var Pt=H-+this._x.call(null,yt.data),St=q-+this._y.call(null,yt.data),Dt=Pt*Pt+St*St;if(Dt=(J=(bt+Xt)/2))?bt=J:Xt=J,(nt=Z>=(yt=(gt+Ct)/2))?gt=yt:Ct=yt,q=tt,!(tt=tt[vt=nt<<1|_t]))return this;if(!tt.length)break;(q[vt+1&3]||q[vt+2&3]||q[vt+3&3])&&(rt=q,It=vt)}for(;tt.data!==H;)if(ft=tt,!(tt=tt.next))return this;return(it=tt.next)&&delete tt.next,ft?(it?ft.next=it:delete ft.next,this):q?(it?q[vt]=it:delete q[vt],(tt=q[0]||q[1]||q[2]||q[3])&&tt===(q[3]||q[2]||q[1]||q[0])&&!tt.length&&(rt?rt[It]=tt:this._root=tt),this):(this._root=it,this)}function y(H){for(var q=0,tt=H.length;q=0&&W._call.call(null,V),W=W._next;--x}function b(){m=(p=y.now())+S,x=k=0;try{Y()}finally{x=0,$(),m=0}}function h(){var W=y.now(),V=W-p;V>T&&(S-=V,p=W)}function $(){for(var W,V=L,H,q=1/0;V;)V._call?(q>V._time&&(q=V._time),W=V,V=V._next):(H=V._next,V._next=null,V=W?W._next=H:L=H);P=W,U(q)}function U(W){if(!x){k&&(k=clearTimeout(k));var V=W-m;V>24?(W<1/0&&(k=setTimeout(b,W-y.now()-S)),w&&(w=clearInterval(w))):(w||(p=y.now(),w=setInterval(h,T)),x=1,g(b))}}},631969:function(Ve,z,C){"use strict";C.r(z),C.d(z,{BRIDGE_GRAPH_NAME:function(){return L},GraphType:function(){return m},HierarchyNodeType:function(){return S},InclusionType:function(){return p},LAYOUT_CONFIG:function(){return x},NodeType:function(){return P},ROOT_NAME:function(){return T},buildGraph:function(){return jr},flatGraph:function(){return bn},getEdges:function(){return _n},mergeConfig:function(){return k}});const x={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 k(v={},N=x){var K,st,ht,xt;const Ot=JSON.parse(JSON.stringify(N)),zt=((K=v==null?void 0:v.graph)===null||K===void 0?void 0:K.meta)||{},Kt=((st=v==null?void 0:v.subScene)===null||st===void 0?void 0:st.meta)||{},fe=((ht=v==null?void 0:v.nodeSize)===null||ht===void 0?void 0:ht.meta)||{},Te=((xt=v==null?void 0:v.nodeSize)===null||xt===void 0?void 0:xt.node)||{},be=Ot.nodeSize.bridge;return{graph:{meta:Object.assign(Ot.graph.meta,zt)},subScene:{meta:Object.assign(Ot.subScene.meta,Kt)},nodeSize:{meta:Object.assign(Ot.nodeSize.meta,fe),node:Object.assign(Ot.nodeSize.node,Te),bridge:be}}}function w(v){return`\u25EC${v}\u25EC`}const T=w("ROOT"),L=w("BRIDGE_GRAPH");var P,p,m,S;(function(v){v[v.META=0]="META",v[v.NODE=1]="NODE",v[v.BRIDGE=2]="BRIDGE"})(P||(P={})),function(v){v[v.INCLUDE=0]="INCLUDE",v[v.EXCLUDE=1]="EXCLUDE",v[v.UNSPECIFIED=2]="UNSPECIFIED"}(p||(p={})),function(v){v[v.META=0]="META",v[v.CORE=1]="CORE",v[v.BRIDGE=2]="BRIDGE"}(m||(m={})),function(v){v[v.META=0]="META",v[v.OP=1]="OP",v[v.SERIES=2]="SERIES"}(S||(S={}));var y=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof C.g!="undefined"?C.g:typeof self!="undefined"?self:{};function g(v,N){return v(N={exports:{}},N.exports),N.exports}var A=function(){this.__data__=[],this.size=0},E=function(v,N){return v===N||v!=v&&N!=N},D=function(v,N){for(var K=v.length;K--;)if(E(v[K][0],N))return K;return-1},F=Array.prototype.splice,Y=function(v){var N=this.__data__,K=D(N,v);return!(K<0)&&(K==N.length-1?N.pop():F.call(N,K,1),--this.size,!0)},b=function(v){var N=this.__data__,K=D(N,v);return K<0?void 0:N[K][1]},h=function(v){return D(this.__data__,v)>-1},$=function(v,N){var K=this.__data__,st=D(K,v);return st<0?(++this.size,K.push([v,N])):K[st][1]=N,this};function U(v){var N=-1,K=v==null?0:v.length;for(this.clear();++N-1&&v%1==0&&v-1&&v%1==0&&v<=9007199254740991},mt={};mt["[object Float32Array]"]=mt["[object Float64Array]"]=mt["[object Int8Array]"]=mt["[object Int16Array]"]=mt["[object Int32Array]"]=mt["[object Uint8Array]"]=mt["[object Uint8ClampedArray]"]=mt["[object Uint16Array]"]=mt["[object Uint32Array]"]=!0,mt["[object Arguments]"]=mt["[object Array]"]=mt["[object ArrayBuffer]"]=mt["[object Boolean]"]=mt["[object DataView]"]=mt["[object Date]"]=mt["[object Error]"]=mt["[object Function]"]=mt["[object Map]"]=mt["[object Number]"]=mt["[object Object]"]=mt["[object RegExp]"]=mt["[object Set]"]=mt["[object String]"]=mt["[object WeakMap]"]=!1;var Ft=function(v){return wt(v)&&X(v.length)&&!!mt[nt(v)]},Bt=function(v){return function(N){return v(N)}},ee=g(function(v,N){var K=N&&!N.nodeType&&N,st=K&&v&&!v.nodeType&&v,ht=st&&st.exports===K&&rt.process,xt=function(){try{var Ot=st&&st.require&&st.require("util").types;return Ot||ht&&ht.binding&&ht.binding("util")}catch(zt){}}();v.exports=xt}),Le=ee&&ee.isTypedArray,me=Le?Bt(Le):Ft,Xe=Object.prototype.hasOwnProperty,pr=function(v,N){var K=Q(v),st=!K&&Ut(v),ht=!K&&!st&&R(v),xt=!K&&!st&&!ht&&me(v),Ot=K||st||ht||xt,zt=Ot?te(v.length,String):[],Kt=zt.length;for(var fe in v)!N&&!Xe.call(v,fe)||Ot&&(fe=="length"||ht&&(fe=="offset"||fe=="parent")||xt&&(fe=="buffer"||fe=="byteLength"||fe=="byteOffset")||O(fe,Kt))||zt.push(fe);return zt},Ze=Object.prototype,Pr=function(v){var N=v&&v.constructor;return v===(typeof N=="function"&&N.prototype||Ze)},un=function(v,N){return function(K){return v(N(K))}},Ke=un(Object.keys,Object),lr=Object.prototype.hasOwnProperty,Rr=function(v){if(!Pr(v))return Ke(v);var N=[];for(var K in Object(v))lr.call(v,K)&&K!="constructor"&&N.push(K);return N},Dr=function(v){return v!=null&&X(v.length)&&!Pt(v)},ce=function(v){return Dr(v)?pr(v):Rr(v)},jt=function(v,N){return v&&Ht(N,ce(N),v)},pe=function(v){var N=[];if(v!=null)for(var K in Object(v))N.push(K);return N},Oe=Object.prototype.hasOwnProperty,Se=function(v){if(!vt(v))return pe(v);var N=Pr(v),K=[];for(var st in v)(st!="constructor"||!N&&Oe.call(v,st))&&K.push(st);return K},Fe=function(v){return Dr(v)?pr(v,!0):Se(v)},or=function(v,N){return v&&Ht(N,Fe(N),v)},gr=g(function(v,N){var K=N&&!N.nodeType&&N,st=K&&v&&!v.nodeType&&v,ht=st&&st.exports===K?it.Buffer:void 0,xt=ht?ht.allocUnsafe:void 0;v.exports=function(Ot,zt){if(zt)return Ot.slice();var Kt=Ot.length,fe=xt?xt(Kt):new Ot.constructor(Kt);return Ot.copy(fe),fe}}),Jr=function(v,N){var K=-1,st=v.length;for(N||(N=Array(st));++Kzt))return!1;var fe=xt.get(v),Te=xt.get(N);if(fe&&Te)return fe==N&&Te==v;var be=-1,We=!0,cr=2&K?new Vo:void 0;for(xt.set(v,N),xt.set(N,v);++be0&&st(Kt)?K>1?v(Kt,K-1,st,ht,xt):ba(xt,Kt):ht||(xt[xt.length]=Kt)}return xt},No=function(v,N,K){switch(K.length){case 0:return v.call(N);case 1:return v.call(N,K[0]);case 2:return v.call(N,K[0],K[1]);case 3:return v.call(N,K[0],K[1],K[2])}return v.apply(N,K)},Ro=Math.max,ci=function(v,N,K){return N=Ro(N===void 0?v.length-1:N,0),function(){for(var st=arguments,ht=-1,xt=Ro(st.length-N,0),Ot=Array(xt);++ht0){if(++N>=800)return arguments[0]}else N=0;return v.apply(void 0,arguments)}}(Bi),ps=function(v,N){return Zs(ci(v,N,ja),v+"")},Tu=function(v,N,K,st){for(var ht=v.length,xt=K+(st?1:-1);st?xt--:++xt-1},Rf=function(v,N,K){for(var st=-1,ht=v==null?0:v.length;++st=200){var fe=N?null:gc(v);if(fe)return io(fe);Ot=!1,ht=$i,Kt=new Vo}else Kt=N?[]:zt;t:for(;++stxt){var Ot=ht;ht=xt,xt=Ot}return ht+""+xt+""+(ea.isUndefined(st)?"\0":st)}function Bf(v,N,K,st){var ht=""+N,xt=""+K;if(!v&&ht>xt){var Ot=ht;ht=xt,xt=Ot}var zt={v:ht,w:xt};return st&&(zt.name=st),zt}function Iu(v,N){return su(v,N.v,N.w,N.name)}ui.prototype._nodeCount=0,ui.prototype._edgeCount=0,ui.prototype.isDirected=function(){return this._isDirected},ui.prototype.isMultigraph=function(){return this._isMultigraph},ui.prototype.isCompound=function(){return this._isCompound},ui.prototype.setGraph=function(v){return this._label=v,this},ui.prototype.graph=function(){return this._label},ui.prototype.setDefaultNodeLabel=function(v){return ea.isFunction(v)||(v=ea.constant(v)),this._defaultNodeLabelFn=v,this},ui.prototype.nodeCount=function(){return this._nodeCount},ui.prototype.nodes=function(){return ea.keys(this._nodes)},ui.prototype.sources=function(){var v=this;return ea.filter(this.nodes(),function(N){return ea.isEmpty(v._in[N])})},ui.prototype.sinks=function(){var v=this;return ea.filter(this.nodes(),function(N){return ea.isEmpty(v._out[N])})},ui.prototype.setNodes=function(v,N){var K=arguments,st=this;return ea.each(v,function(ht){K.length>1?st.setNode(ht,N):st.setNode(ht)}),this},ui.prototype.setNode=function(v,N){return ea.has(this._nodes,v)?(arguments.length>1&&(this._nodes[v]=N),this):(this._nodes[v]=arguments.length>1?N:this._defaultNodeLabelFn(v),this._isCompound&&(this._parent[v]="\0",this._children[v]={},this._children["\0"][v]=!0),this._in[v]={},this._preds[v]={},this._out[v]={},this._sucs[v]={},++this._nodeCount,this)},ui.prototype.node=function(v){return this._nodes[v]},ui.prototype.hasNode=function(v){return ea.has(this._nodes,v)},ui.prototype.removeNode=function(v){var N=this;if(ea.has(this._nodes,v)){var K=function(st){N.removeEdge(N._edgeObjs[st])};delete this._nodes[v],this._isCompound&&(this._removeFromParentsChildList(v),delete this._parent[v],ea.each(this.children(v),function(st){N.setParent(st)}),delete this._children[v]),ea.each(ea.keys(this._in[v]),K),delete this._in[v],delete this._preds[v],ea.each(ea.keys(this._out[v]),K),delete this._out[v],delete this._sucs[v],--this._nodeCount}return this},ui.prototype.setParent=function(v,N){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(ea.isUndefined(N))N="\0";else{for(var K=N+="";!ea.isUndefined(K);K=this.parent(K))if(K===v)throw new Error("Setting "+N+" as parent of "+v+" would create a cycle");this.setNode(N)}return this.setNode(v),this._removeFromParentsChildList(v),this._parent[v]=N,this._children[N][v]=!0,this},ui.prototype._removeFromParentsChildList=function(v){delete this._children[this._parent[v]][v]},ui.prototype.parent=function(v){if(this._isCompound){var N=this._parent[v];if(N!=="\0")return N}},ui.prototype.children=function(v){if(ea.isUndefined(v)&&(v="\0"),this._isCompound){var N=this._children[v];if(N)return ea.keys(N)}else{if(v==="\0")return this.nodes();if(this.hasNode(v))return[]}},ui.prototype.predecessors=function(v){var N=this._preds[v];if(N)return ea.keys(N)},ui.prototype.successors=function(v){var N=this._sucs[v];if(N)return ea.keys(N)},ui.prototype.neighbors=function(v){var N=this.predecessors(v);if(N)return ea.union(N,this.successors(v))},ui.prototype.isLeaf=function(v){return(this.isDirected()?this.successors(v):this.neighbors(v)).length===0},ui.prototype.filterNodes=function(v){var N=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});N.setGraph(this.graph());var K=this;ea.each(this._nodes,function(xt,Ot){v(Ot)&&N.setNode(Ot,xt)}),ea.each(this._edgeObjs,function(xt){N.hasNode(xt.v)&&N.hasNode(xt.w)&&N.setEdge(xt,K.edge(xt))});var st={};function ht(xt){var Ot=K.parent(xt);return Ot===void 0||N.hasNode(Ot)?(st[xt]=Ot,Ot):Ot in st?st[Ot]:ht(Ot)}return this._isCompound&&ea.each(N.nodes(),function(xt){N.setParent(xt,ht(xt))}),N},ui.prototype.setDefaultEdgeLabel=function(v){return ea.isFunction(v)||(v=ea.constant(v)),this._defaultEdgeLabelFn=v,this},ui.prototype.edgeCount=function(){return this._edgeCount},ui.prototype.edges=function(){return ea.values(this._edgeObjs)},ui.prototype.setPath=function(v,N){var K=this,st=arguments;return ea.reduce(v,function(ht,xt){return st.length>1?K.setEdge(ht,xt,N):K.setEdge(ht,xt),xt}),this},ui.prototype.setEdge=function(){var v,N,K,st,ht=!1,xt=arguments[0];typeof xt=="object"&&xt!==null&&"v"in xt?(v=xt.v,N=xt.w,K=xt.name,arguments.length===2&&(st=arguments[1],ht=!0)):(v=xt,N=arguments[1],K=arguments[3],arguments.length>2&&(st=arguments[2],ht=!0)),v=""+v,N=""+N,ea.isUndefined(K)||(K=""+K);var Ot=su(this._isDirected,v,N,K);if(ea.has(this._edgeLabels,Ot))return ht&&(this._edgeLabels[Ot]=st),this;if(!ea.isUndefined(K)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(v),this.setNode(N),this._edgeLabels[Ot]=ht?st:this._defaultEdgeLabelFn(v,N,K);var zt=Bf(this._isDirected,v,N,K);return v=zt.v,N=zt.w,Object.freeze(zt),this._edgeObjs[Ot]=zt,df(this._preds[N],v),df(this._sucs[v],N),this._in[N][Ot]=zt,this._out[v][Ot]=zt,this._edgeCount++,this},ui.prototype.edge=function(v,N,K){var st=arguments.length===1?Iu(this._isDirected,arguments[0]):su(this._isDirected,v,N,K);return this._edgeLabels[st]},ui.prototype.hasEdge=function(v,N,K){var st=arguments.length===1?Iu(this._isDirected,arguments[0]):su(this._isDirected,v,N,K);return ea.has(this._edgeLabels,st)},ui.prototype.removeEdge=function(v,N,K){var st=arguments.length===1?Iu(this._isDirected,arguments[0]):su(this._isDirected,v,N,K),ht=this._edgeObjs[st];return ht&&(v=ht.v,N=ht.w,delete this._edgeLabels[st],delete this._edgeObjs[st],Xu(this._preds[N],v),Xu(this._sucs[v],N),delete this._in[N][st],delete this._out[v][st],this._edgeCount--),this},ui.prototype.inEdges=function(v,N){var K=this._in[v];if(K){var st=ea.values(K);return N?ea.filter(st,function(ht){return ht.v===N}):st}},ui.prototype.outEdges=function(v,N){var K=this._out[v];if(K){var st=ea.values(K);return N?ea.filter(st,function(ht){return ht.w===N}):st}},ui.prototype.nodeEdges=function(v,N){var K=this.inEdges(v,N);if(K)return K.concat(this.outEdges(v,N))};var xc={Graph:Au,version:"2.1.8"},hf={write:function(v){var N={options:{directed:v.isDirected(),multigraph:v.isMultigraph(),compound:v.isCompound()},nodes:bc(v),edges:Ws(v)};return ea.isUndefined(v.graph())||(N.value=ea.clone(v.graph())),N},read:function(v){var N=new Au(v.options).setGraph(v.value);return ea.each(v.nodes,function(K){N.setNode(K.v,K.value),K.parent&&N.setParent(K.v,K.parent)}),ea.each(v.edges,function(K){N.setEdge({v:K.v,w:K.w,name:K.name},K.value)}),N}};function bc(v){return ea.map(v.nodes(),function(N){var K=v.node(N),st=v.parent(N),ht={v:N};return ea.isUndefined(K)||(ht.value=K),ea.isUndefined(st)||(ht.parent=st),ht})}function Ws(v){return ea.map(v.edges(),function(N){var K=v.edge(N),st={v:N.v,w:N.w};return ea.isUndefined(N.name)||(st.name=N.name),ea.isUndefined(K)||(st.value=K),st})}var lt=function(v){var N,K={},st=[];function ht(xt){ea.has(K,xt)||(K[xt]=!0,N.push(xt),ea.each(v.successors(xt),ht),ea.each(v.predecessors(xt),ht))}return ea.each(v.nodes(),function(xt){N=[],ht(xt),N.length&&st.push(N)}),st},Nt=Vt;function Vt(){this._arr=[],this._keyIndices={}}Vt.prototype.size=function(){return this._arr.length},Vt.prototype.keys=function(){return this._arr.map(function(v){return v.key})},Vt.prototype.has=function(v){return ea.has(this._keyIndices,v)},Vt.prototype.priority=function(v){var N=this._keyIndices[v];if(N!==void 0)return this._arr[N].priority},Vt.prototype.min=function(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key},Vt.prototype.add=function(v,N){var K=this._keyIndices;if(v=String(v),!ea.has(K,v)){var st=this._arr,ht=st.length;return K[v]=ht,st.push({key:v,priority:N}),this._decrease(ht),!0}return!1},Vt.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var v=this._arr.pop();return delete this._keyIndices[v.key],this._heapify(0),v.key},Vt.prototype.decrease=function(v,N){var K=this._keyIndices[v];if(N>this._arr[K].priority)throw new Error("New priority is greater than current priority. Key: "+v+" Old: "+this._arr[K].priority+" New: "+N);this._arr[K].priority=N,this._decrease(K)},Vt.prototype._heapify=function(v){var N=this._arr,K=2*v,st=K+1,ht=v;K>1].priority0&&(Kt=be.removeMin(),(fe=Te[Kt]).distance!==Number.POSITIVE_INFINITY);)zt(Kt).forEach(We);return Te}(v,String(N),K||Ie,st||function(ht){return v.outEdges(ht)})},Ie=ea.constant(1),nr=function(v,N,K){return ea.transform(v.nodes(),function(st,ht){st[ht]=le(v,ht,N,K)},{})},fr=function(v){var N=0,K=[],st={},ht=[];function xt(Ot){var zt=st[Ot]={onStack:!0,lowlink:N,index:N++};if(K.push(Ot),v.successors(Ot).forEach(function(Te){ea.has(st,Te)?st[Te].onStack&&(zt.lowlink=Math.min(zt.lowlink,st[Te].index)):(xt(Te),zt.lowlink=Math.min(zt.lowlink,st[Te].lowlink))}),zt.lowlink===zt.index){var Kt,fe=[];do Kt=K.pop(),st[Kt].onStack=!1,fe.push(Kt);while(Ot!==Kt);ht.push(fe)}}return v.nodes().forEach(function(Ot){ea.has(st,Ot)||xt(Ot)}),ht},Gr=function(v){return ea.filter(fr(v),function(N){return N.length>1||N.length===1&&v.hasEdge(N[0],N[0])})},vn=function(v,N,K){return function(st,ht,xt){var Ot={},zt=st.nodes();return zt.forEach(function(Kt){Ot[Kt]={},Ot[Kt][Kt]={distance:0},zt.forEach(function(fe){Kt!==fe&&(Ot[Kt][fe]={distance:Number.POSITIVE_INFINITY})}),xt(Kt).forEach(function(fe){var Te=fe.v===Kt?fe.w:fe.v,be=ht(fe);Ot[Kt][Te]={distance:be,predecessor:Kt}})}),zt.forEach(function(Kt){var fe=Ot[Kt];zt.forEach(function(Te){var be=Ot[Te];zt.forEach(function(We){var cr=be[Kt],Vr=fe[We],mr=be[We],wr=cr.distance+Vr.distance;wr0;){if(K=xt.removeMin(),ea.has(ht,K))st.setEdge(K,ht[K]);else{if(zt)throw new Error("Input graph is not connected: "+v);zt=!0}v.nodeEdges(K).forEach(Ot)}return st},tarjan:fr,topsort:Hn},version:xc.version};try{Na=Ta}catch(v){}Na||(Na=window.graphlib);var ka=Na,ha=function(v){return si(v,5)},Ya=function(v,N,K){if(!vt(K))return!1;var st=typeof N;return!!(st=="number"?Dr(K)&&O(N,K.length):st=="string"&&N in K)&&E(K[N],v)},Ga=Object.prototype,ma=Ga.hasOwnProperty,ri=ps(function(v,N){v=Object(v);var K=-1,st=N.length,ht=st>2?N[2]:void 0;for(ht&&Ya(N[0],N[1],ht)&&(st=1);++K-1?ht[xt?N[Ot]:Ot]:void 0}},Vi=/^\s+|\s+$/g,Ai=/^[-+]0x[0-9a-f]+$/i,hi=/^0b[01]+$/i,to=/^0o[0-7]+$/i,ko=parseInt,so=function(v){if(typeof v=="number")return v;if(Ho(v))return NaN;if(vt(v)){var N=typeof v.valueOf=="function"?v.valueOf():v;v=vt(N)?N+"":N}if(typeof v!="string")return v===0?v:+v;v=v.replace(Vi,"");var K=hi.test(v);return K||to.test(v)?ko(v.slice(2),K?2:8):Ai.test(v)?NaN:+v},ks=function(v){return v?(v=so(v))===1/0||v===-1/0?17976931348623157e292*(v<0?-1:1):v==v?v:0:v===0?v:0},Ou=function(v){var N=ks(v),K=N%1;return N==N?K?N-K:N:0},Ls=Math.max,uu=xi(function(v,N,K){var st=v==null?0:v.length;if(!st)return-1;var ht=K==null?0:Ou(K);return ht<0&&(ht=Ls(st+ht,0)),Tu(v,ns(N),ht)}),Ss=function(v){return v!=null&&v.length?So(v,1):[]},tu=function(v,N){return v==null?v:Ui(v,za(N),Fe)},Ff=function(v){var N=v==null?0:v.length;return N?v[N-1]:void 0},Qc=function(v,N){var K={};return N=ns(N),fi(v,function(st,ht,xt){jn(K,ht,N(st,ht,xt))}),K},ju=function(v,N,K){for(var st=-1,ht=v.length;++stN},Ec=function(v){return v&&v.length?ju(v,ja,vf):void 0},Vu=function(v,N,K){(K!==void 0&&!E(v[N],K)||K===void 0&&!(N in v))&&jn(v,N,K)},vu=Function.prototype,zf=Object.prototype,Gf=vu.toString,wc=zf.hasOwnProperty,eu=Gf.call(Object),ru=function(v){if(!wt(v)||nt(v)!="[object Object]")return!1;var N=Ea(v);if(N===null)return!0;var K=wc.call(N,"constructor")&&N.constructor;return typeof K=="function"&&K instanceof K&&Gf.call(K)==eu},Sc=function(v,N){if((N!=="constructor"||typeof v[N]!="function")&&N!="__proto__")return v[N]},Hu=function(v){return Ht(v,Fe(v))},cd=function(v,N,K,st,ht,xt,Ot){var zt=Sc(v,K),Kt=Sc(N,K),fe=Ot.get(Kt);if(fe)Vu(v,K,fe);else{var Te=xt?xt(zt,Kt,K+"",v,N,Ot):void 0,be=Te===void 0;if(be){var We=Q(Kt),cr=!We&&R(Kt),Vr=!We&&!cr&&me(Kt);Te=Kt,We||cr||Vr?Q(zt)?Te=zt:lf(zt)?Te=Jr(zt):cr?(be=!1,Te=gr(Kt,!0)):Vr?(be=!1,Te=Nr(Kt,!0)):Te=[]:ru(Kt)||Ut(Kt)?(Te=zt,Ut(zt)?Te=Hu(zt):vt(zt)&&!Pt(zt)||(Te=Pn(Kt))):be=!1}be&&(Ot.set(Kt,Te),ht(Te,Kt,st,xt,Ot),Ot.delete(Kt)),Vu(v,K,Te)}},pu=function v(N,K,st,ht,xt){N!==K&&Ui(K,function(Ot,zt){if(xt||(xt=new Wn),vt(Ot))cd(N,K,zt,st,v,ht,xt);else{var Kt=ht?ht(Sc(N,zt),Ot,zt+"",N,K,xt):void 0;Kt===void 0&&(Kt=Ot),Vu(N,zt,Kt)}},Fe)},us=function(v){return ps(function(N,K){var st=-1,ht=K.length,xt=ht>1?K[ht-1]:void 0,Ot=ht>2?K[2]:void 0;for(xt=v.length>3&&typeof xt=="function"?(ht--,xt):void 0,Ot&&Ya(K[0],K[1],Ot)&&(xt=ht<3?void 0:xt,ht=1),N=Object(N);++stN||xt&&Ot&&Kt&&!zt&&!fe||st&&Ot&&Kt||!K&&Kt||!ht)return 1;if(!st&&!xt&&!fe&&v=zt?Kt:Kt*(K[st]=="desc"?-1:1)}return v.index-N.index},al=function(v,N,K){N=N.length?Ci(N,function(xt){return Q(xt)?function(Ot){return Gs(Ot,xt.length===1?xt[0]:xt)}:xt}):[ja];var st=-1;N=Ci(N,Bt(ns));var ht=Et(v,function(xt,Ot,zt){return{criteria:Ci(N,function(Kt){return Kt(xt)}),index:++st,value:xt}});return Cc(ht,function(xt,Ot){return Bl(xt,Ot,K)})},Wf=ps(function(v,N){if(v==null)return[];var K=N.length;return K>1&&Ya(v,N[0],N[1])?N=[]:K>2&&Ya(N[0],N[1],N[2])&&(N=[N[0]]),al(v,So(N,1),[])}),il=0,Fl=function(v){var N=++il;return Ds(v)+N},ld=function(v,N,K){for(var st=-1,ht=v.length,xt=N.length,Ot={};++st0;--be)if(zt=xt[be].dequeue()){Kt=Kt.concat(jf(ht,xt,Ot,zt,!0));break}}}return Kt}(K.graph,K.buckets,K.zeroIdx);return tr.flatten(tr.map(st,function(ht){return v.outEdges(ht.v,ht.w)}),!0)},fl=tr.constant(1);function jf(v,N,K,st,ht){var xt=ht?[]:void 0;return tr.forEach(v.inEdges(st.v),function(Ot){var zt=v.edge(Ot),Kt=v.node(Ot.v);ht&&xt.push({v:Ot.v,w:Ot.w}),Kt.out-=zt,gf(N,K,Kt)}),tr.forEach(v.outEdges(st.v),function(Ot){var zt=v.edge(Ot),Kt=Ot.w,fe=v.node(Kt);fe.in-=zt,gf(N,K,fe)}),v.removeNode(st.v),xt}function gf(v,N,K){K.out?K.in?v[K.out-K.in+N].enqueue(K):v[v.length-1].enqueue(K):v[0].enqueue(K)}var cl={run:function(v){var N=v.graph().acyclicer==="greedy"?zl(v,function(K){return function(st){return K.edge(st).weight}}(v)):function(K){var st=[],ht={},xt={};function Ot(zt){tr.has(xt,zt)||(xt[zt]=!0,ht[zt]=!0,tr.forEach(K.outEdges(zt),function(Kt){tr.has(ht,Kt.w)?st.push(Kt):Ot(Kt.w)}),delete ht[zt])}return tr.forEach(K.nodes(),Ot),st}(v);tr.forEach(N,function(K){var st=v.edge(K);v.removeEdge(K),st.forwardName=K.name,st.reversed=!0,v.setEdge(K.w,K.v,st,tr.uniqueId("rev"))})},undo:function(v){tr.forEach(v.edges(),function(N){var K=v.edge(N);if(K.reversed){v.removeEdge(N);var st=K.forwardName;delete K.reversed,delete K.forwardName,v.setEdge(N.w,N.v,K,st)}})}},mf=ka.Graph,Zo={addDummyNode:yf,simplify:function(v){var N=new mf().setGraph(v.graph());return tr.forEach(v.nodes(),function(K){N.setNode(K,v.node(K))}),tr.forEach(v.edges(),function(K){var st=N.edge(K.v,K.w)||{weight:0,minlen:1},ht=v.edge(K);N.setEdge(K.v,K.w,{weight:st.weight+ht.weight,minlen:Math.max(st.minlen,ht.minlen)})}),N},asNonCompoundGraph:function(v){var N=new mf({multigraph:v.isMultigraph()}).setGraph(v.graph());return tr.forEach(v.nodes(),function(K){v.children(K).length||N.setNode(K,v.node(K))}),tr.forEach(v.edges(),function(K){N.setEdge(K,v.edge(K))}),N},successorWeights:function(v){var N=tr.map(v.nodes(),function(K){var st={};return tr.forEach(v.outEdges(K),function(ht){st[ht.w]=(st[ht.w]||0)+v.edge(ht).weight}),st});return tr.zipObject(v.nodes(),N)},predecessorWeights:function(v){var N=tr.map(v.nodes(),function(K){var st={};return tr.forEach(v.inEdges(K),function(ht){st[ht.v]=(st[ht.v]||0)+v.edge(ht).weight}),st});return tr.zipObject(v.nodes(),N)},intersectRect:function(v,N){var K,st,ht=v.x,xt=v.y,Ot=N.x-ht,zt=N.y-xt,Kt=v.width/2,fe=v.height/2;if(!Ot&&!zt)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(zt)*Kt>Math.abs(Ot)*fe?(zt<0&&(fe=-fe),K=fe*Ot/zt,st=fe):(Ot<0&&(Kt=-Kt),K=Kt,st=Kt*zt/Ot),{x:ht+K,y:xt+st}},buildLayerMatrix:function(v){var N=tr.map(tr.range(ll(v)+1),function(){return[]});return tr.forEach(v.nodes(),function(K){var st=v.node(K),ht=st.rank;tr.isUndefined(ht)||(N[ht][st.order]=K)}),N},normalizeRanks:function(v){var N=tr.min(tr.map(v.nodes(),function(K){return v.node(K).rank}));tr.forEach(v.nodes(),function(K){var st=v.node(K);tr.has(st,"rank")&&(st.rank-=N)})},removeEmptyRanks:function(v){var N=tr.min(tr.map(v.nodes(),function(xt){return v.node(xt).rank})),K=[];tr.forEach(v.nodes(),function(xt){var Ot=v.node(xt).rank-N;K[Ot]||(K[Ot]=[]),K[Ot].push(xt)});var st=0,ht=v.graph().nodeRankFactor;tr.forEach(K,function(xt,Ot){tr.isUndefined(xt)&&Ot%ht!=0?--st:st&&tr.forEach(xt,function(zt){v.node(zt).rank+=st})})},addBorderNode:function(v,N,K,st){var ht={width:0,height:0};return arguments.length>=4&&(ht.rank=K,ht.order=st),yf(v,"border",ht,N)},maxRank:ll,partition:function(v,N){var K={lhs:[],rhs:[]};return tr.forEach(v,function(st){N(st)?K.lhs.push(st):K.rhs.push(st)}),K},time:function(v,N){var K=tr.now();try{return N()}finally{console.log(v+" time: "+(tr.now()-K)+"ms")}},notime:function(v,N){return N()}};function yf(v,N,K,st){var ht;do ht=tr.uniqueId(st);while(v.hasNode(ht));return K.dummy=N,v.setNode(ht,K),ht}function ll(v){return tr.max(tr.map(v.nodes(),function(N){var K=v.node(N).rank;if(!tr.isUndefined(K))return K}))}var Vf={run:function(v){v.graph().dummyChains=[],tr.forEach(v.edges(),function(N){(function(K,st){var ht,xt,Ot,zt=st.v,Kt=K.node(zt).rank,fe=st.w,Te=K.node(fe).rank,be=st.name,We=K.edge(st),cr=We.labelRank;if(Te!==Kt+1){for(K.removeEdge(st),Ot=0,++Kt;KtOt.lim&&(zt=Ot,Kt=!0);var fe=tr.filter(N.edges(),function(Te){return Kt===Gl(v,v.node(Te.v),zt)&&Kt!==Gl(v,v.node(Te.w),zt)});return tr.minBy(fe,function(Te){return bf(N,Te)})}function Ju(v,N,K,st){var ht=K.v,xt=K.w;v.removeEdge(ht,xt),v.setEdge(st.v,st.w,{}),nu(v),dl(v,N),function(Ot,zt){var Kt=tr.find(Ot.nodes(),function(Te){return!zt.node(Te).parent}),fe=Hf(Ot,Kt);fe=fe.slice(1),tr.forEach(fe,function(Te){var be=Ot.node(Te).parent,We=zt.edge(Te,be),cr=!1;We||(We=zt.edge(be,Te),cr=!0),zt.node(Te).rank=zt.node(be).rank+(cr?We.minlen:-We.minlen)})}(v,N)}function Gl(v,N,K){return K.low<=N.lim&&N.lim<=K.lim}Ks.initLowLimValues=nu,Ks.initCutValues=dl,Ks.calcCutValue=hl,Ks.leaveEdge=pl,Ks.enterEdge=gl,Ks.exchangeEdges=Ju;var ml=Ys,yl=function(v){switch(v.graph().ranker){case"network-simplex":Wl(v);break;case"tight-tree":(function(N){ml(N),Ku(N)})(v);break;case"longest-path":Ul(v);break;default:Wl(v)}},Ul=ml;function Wl(v){Qu(v)}var dd=function(v){var N=function(K){var st={},ht=0;function xt(Ot){var zt=ht;tr.forEach(K.children(Ot),xt),st[Ot]={low:zt,lim:ht++}}return tr.forEach(K.children(),xt),st}(v);tr.forEach(v.graph().dummyChains,function(K){for(var st=v.node(K),ht=st.edgeObj,xt=function(be,We,cr,Vr){var mr,wr,Er=[],Sn=[],Yn=Math.min(We[cr].low,We[Vr].low),Nn=Math.max(We[cr].lim,We[Vr].lim);mr=cr;do mr=be.parent(mr),Er.push(mr);while(mr&&(We[mr].low>Yn||Nn>We[mr].lim));for(wr=mr,mr=Vr;(mr=be.parent(mr))!==wr;)Sn.push(mr);return{path:Er.concat(Sn.reverse()),lca:wr}}(v,N,ht.v,ht.w),Ot=xt.path,zt=xt.lca,Kt=0,fe=Ot[Kt],Te=!0;K!==ht.w;){if(st=v.node(K),Te){for(;(fe=Ot[Kt])!==zt&&v.node(fe).maxRank0;)Te%2&&(be+=zt[Te+1]),zt[Te=Te-1>>1]+=fe.weight;Kt+=fe.weight*be})),Kt}var Nc=function(v,N){return tr.map(N,function(K){var st=v.inEdges(K);if(st.length){var ht=tr.reduce(st,function(xt,Ot){var zt=v.edge(Ot),Kt=v.node(Ot.v);return{sum:xt.sum+zt.weight*Kt.order,weight:xt.weight+zt.weight}},{sum:0,weight:0});return{v:K,barycenter:ht.sum/ht.weight,weight:ht.weight}}return{v:K}})},xu=function(v,N){var K={};return tr.forEach(v,function(st,ht){var xt=K[st.v]={indegree:0,in:[],out:[],vs:[st.v],i:ht};tr.isUndefined(st.barycenter)||(xt.barycenter=st.barycenter,xt.weight=st.weight)}),tr.forEach(N.edges(),function(st){var ht=K[st.v],xt=K[st.w];tr.isUndefined(ht)||tr.isUndefined(xt)||(xt.indegree++,ht.out.push(K[st.w]))}),function(st){var ht=[];function xt(Kt){return function(fe){fe.merged||(tr.isUndefined(fe.barycenter)||tr.isUndefined(Kt.barycenter)||fe.barycenter>=Kt.barycenter)&&function(Te,be){var We=0,cr=0;Te.weight&&(We+=Te.barycenter*Te.weight,cr+=Te.weight),be.weight&&(We+=be.barycenter*be.weight,cr+=be.weight),Te.vs=be.vs.concat(Te.vs),Te.barycenter=We/cr,Te.weight=cr,Te.i=Math.min(be.i,Te.i),be.merged=!0}(Kt,fe)}}function Ot(Kt){return function(fe){fe.in.push(Kt),--fe.indegree==0&&st.push(fe)}}for(;st.length;){var zt=st.pop();ht.push(zt),tr.forEach(zt.in.reverse(),xt(zt)),tr.forEach(zt.out,Ot(zt))}return tr.map(tr.filter(ht,function(Kt){return!Kt.merged}),function(Kt){return tr.pick(Kt,["vs","i","barycenter","weight"])})}(tr.filter(K,function(st){return!st.indegree}))},wf=function(v,N){var K=Zo.partition(v,function(be){return tr.has(be,"barycenter")}),st=K.lhs,ht=tr.sortBy(K.rhs,function(be){return-be.i}),xt=[],Ot=0,zt=0,Kt=0;st.sort((fe=!!N,function(be,We){return be.barycenterWe.barycenter?1:fe?We.i-be.i:be.i-We.i})),Kt=ef(xt,ht,Kt),tr.forEach(st,function(be){Kt+=be.vs.length,xt.push(be.vs),Ot+=be.barycenter*be.weight,zt+=be.weight,Kt=ef(xt,ht,Kt)});var fe,Te={vs:tr.flatten(xt,!0)};return zt&&(Te.barycenter=Ot/zt,Te.weight=zt),Te};function ef(v,N,K){for(var st;N.length&&(st=tr.last(N)).i<=K;)N.pop(),v.push(st.vs),K++;return K}var xl=function v(N,K,st,ht){var xt=N.children(K),Ot=N.node(K),zt=Ot?Ot.borderLeft:void 0,Kt=Ot?Ot.borderRight:void 0,fe={};zt&&(xt=tr.filter(xt,function(mr){return mr!==zt&&mr!==Kt}));var Te=Nc(N,xt);tr.forEach(Te,function(mr){if(N.children(mr.v).length){var wr=v(N,mr.v,st,ht);fe[mr.v]=wr,tr.has(wr,"barycenter")&&(Er=mr,Sn=wr,tr.isUndefined(Er.barycenter)?(Er.barycenter=Sn.barycenter,Er.weight=Sn.weight):(Er.barycenter=(Er.barycenter*Er.weight+Sn.barycenter*Sn.weight)/(Er.weight+Sn.weight),Er.weight+=Sn.weight))}var Er,Sn});var be=xu(Te,st);(function(mr,wr){tr.forEach(mr,function(Er){Er.vs=tr.flatten(Er.vs.map(function(Sn){return wr[Sn]?wr[Sn].vs:Sn}),!0)})})(be,fe);var We=wf(be,ht);if(zt&&(We.vs=tr.flatten([zt,We.vs,Kt],!0),N.predecessors(zt).length)){var cr=N.node(N.predecessors(zt)[0]),Vr=N.node(N.predecessors(Kt)[0]);tr.has(We,"barycenter")||(We.barycenter=0,We.weight=0),We.barycenter=(We.barycenter*We.weight+cr.order+Vr.order)/(We.weight+2),We.weight+=2}return We},$f=ka.Graph,Rc=function(v,N,K){var st=function(xt){for(var Ot;xt.hasNode(Ot=tr.uniqueId("_root")););return Ot}(v),ht=new $f({compound:!0}).setGraph({root:st}).setDefaultNodeLabel(function(xt){return v.node(xt)});return tr.forEach(v.nodes(),function(xt){var Ot=v.node(xt),zt=v.parent(xt);(Ot.rank===N||Ot.minRank<=N&&N<=Ot.maxRank)&&(ht.setNode(xt),ht.setParent(xt,zt||st),tr.forEach(v[K](xt),function(Kt){var fe=Kt.v===xt?Kt.w:Kt.v,Te=ht.edge(fe,xt),be=tr.isUndefined(Te)?0:Te.weight;ht.setEdge(fe,xt,{weight:v.edge(Kt).weight+be})}),tr.has(Ot,"minRank")&&ht.setNode(xt,{borderLeft:Ot.borderLeft[N],borderRight:Ot.borderRight[N]}))}),ht},qf=function(v,N,K){var st,ht={};tr.forEach(K,function(xt){for(var Ot,zt,Kt=v.parent(xt);Kt;){if((Ot=v.parent(Kt))?(zt=ht[Ot],ht[Ot]=Kt):(zt=st,st=Kt),zt&&zt!==Kt)return void N.setEdge(zt,Kt);Kt=Ot}})},Qf=ka.Graph,kc=function(v){var N=Zo.maxRank(v),K=Sf(v,tr.range(1,N+1),"inEdges"),st=Sf(v,tr.range(N-1,-1,-1),"outEdges"),ht=Ef(v);rf(v,ht);for(var xt,Ot=Number.POSITIVE_INFINITY,zt=0,Kt=0;Kt<4;++zt,++Kt){Jf(zt%2?K:st,zt%4>=2),ht=Zo.buildLayerMatrix(v);var fe=Lc(v,ht);feKt)&&Bc(K,be,fe)})})}return tr.reduce(N,function(ht,xt){var Ot,zt=-1,Kt=0;return tr.forEach(xt,function(fe,Te){if(v.node(fe).dummy==="border"){var be=v.predecessors(fe);be.length&&(Ot=v.node(be[0]).order,st(xt,Kt,Te,zt,Ot),Kt=Te,zt=Ot)}st(xt,Kt,xt.length,Ot,ht.length)}),xt}),K}function Bc(v,N,K){if(N>K){var st=N;N=K,K=st}var ht=v[N];ht||(v[N]=ht={}),ht[K]=!0}function $l(v,N,K){if(N>K){var st=N;N=K,K=st}return tr.has(v[N],K)}function vd(v,N,K,st){var ht={},xt={},Ot={};return tr.forEach(N,function(zt){tr.forEach(zt,function(Kt,fe){ht[Kt]=Kt,xt[Kt]=Kt,Ot[Kt]=fe})}),tr.forEach(N,function(zt){var Kt=-1;tr.forEach(zt,function(fe){var Te=st(fe);if(Te.length)for(var be=((Te=tr.sortBy(Te,function(mr){return Ot[mr]})).length-1)/2,We=Math.floor(be),cr=Math.ceil(be);We<=cr;++We){var Vr=Te[We];xt[fe]===fe&&Ktnew cs(K)).forEach(K=>{N.nodes[K.name]=K,K.inputs.forEach(st=>{(function(ht,xt,Ot){Ot.name!==xt.name&&ht.edges.push(Object.assign(Object.assign({},Ot.attr),{v:Ot.name,w:xt.name}))})(N,K,st)})}),N}class md{constructor(N,K={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=p.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=P.META,this.path=[],this.name=N,this.metaGraph=rc(N,m.META,K)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map(N=>this.metaGraph.node(N))}leaves(){let N,K=[],st=[this];for(;st.length;){let ht=st.shift();ht.isGroupNode?(N=ht.metaGraph,N.nodes().forEach(xt=>st.push(N.node(xt)))):K.push(ht.name)}return K}}class Nu{constructor(N,K){this.v=N,this.w=K,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(N,K){this.baseEdgeList.push(N)}}function _l(v,N={}){return new md(v,N)}function Gc(v,N){return new Nu(v,N)}function rc(v,N,K){const st=K||{},ht=new Gd.Graph(st);return ht.setGraph({name:v,rankdir:st.rankdir,type:N,align:st.align}),ht}class Uc{constructor(N={}){this.graphOptions=N,this.index={},this.graphOptions.compound=!0,this.root=_l(T,this.graphOptions),this.index[T]=this.root}getNodeMap(){return this.index}node(N){return this.index[N]}setNode(N,K){this.index[N]=K}getBridgeGraph(N){const K=this.index[N];if(!K)throw Error("Could not find node in hierarchy: "+N);if(!("metaGraph"in K))return null;const st=K;if(st.bridgeGraph)return st.bridgeGraph;const ht=rc(L,m.BRIDGE,this.graphOptions);if(st.bridgeGraph=ht,!K.parentNode||!("metaGraph"in K.parentNode))return ht;const xt=K.parentNode;return[xt.metaGraph,this.getBridgeGraph(xt.name)].forEach(Ot=>{Ot.edges().filter(zt=>zt.v===N||zt.w===N).forEach(zt=>{const Kt=zt.w===N;Ot.edge(zt).baseEdgeList.forEach(fe=>{const[Te,be]=Kt?[fe.w,zt.v]:[fe.v,zt.w],We=this.getChildName(N,Te),cr={v:Kt?be:We,w:Kt?We:be};let Vr=ht.edge(cr);Vr||(Vr=Gc(cr.v,cr.w),Vr.inbound=Kt,ht.setEdge(cr.v,cr.w,Vr)),Vr.addBaseEdge(fe,this)})})}),ht}getChildName(N,K){let st=this.index[K];for(;st;){if(st.parentNode&&st.parentNode.name===N)return st.name;st=st.parentNode}throw Error("Could not find immediate child for descendant: "+K)}getPredecessors(N){const K=this.index[N];if(!K)throw Error("Could not find node with name: "+N);return this.getOneWayEdges(K,!0)}getSuccessors(N){const K=this.index[N];if(!K)throw Error("Could not find node with name: "+N);return this.getOneWayEdges(K,!1)}getOneWayEdges(N,K){const st=[];if(!N.parentNode||!N.parentNode.isGroupNode)return st;const ht=N.parentNode,xt=ht.metaGraph,Ot=this.getBridgeGraph(ht.name);return Eu(xt,N,K,st),Eu(Ot,N,K,st),st}}function nd(v,N){const{rankDirection:K,align:st}=N,ht=new Uc({rankdir:K,align:st});return function(xt,Ot){Object.keys(Ot.nodes).forEach(zt=>{const Kt=Ot.nodes[zt],fe=Kt.path;let Te=xt.root;Te.depth=Math.max(fe.length,Te.depth);for(let be=0;be{let cr=0;for(;be;)We[cr++]=be.name,be=be.parentNode;return cr-1};Ot.edges.forEach(be=>{Kt=[],fe=[];let We=Te(Ot.nodes[be.v],Kt),cr=Te(Ot.nodes[be.w],fe);for(;Kt[We]===fe[cr];)if(We--,cr--,We<0||cr<0)throw Error("No difference found between ancestor paths.");const Vr=zt[Kt[We+1]],mr=Kt[We],wr=fe[cr];let Er=Vr.metaGraph.edge(mr,wr);Er||(Er=Gc(mr,wr),Vr.metaGraph.setEdge(mr,wr,Er)),Er.addBaseEdge(be,xt)})}(ht,v),ht}function Eu(v,N,K,st){(K?v.inEdges(N.name):v.outEdges(N.name)).forEach(ht=>{const xt=v.edge(ht);st.push(xt)})}class Cl{constructor(N){this.hierarchy=N,this.index={},this.hasSubHierarchy={},this.root=new Ae(this.hierarchy.root,this.hierarchy.graphOptions),this.index[N.root.name]=this.root,this.buildSubHierarchy(N.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(N){if(N in this.hasSubHierarchy)return;this.hasSubHierarchy[N]=!0;const K=this.index[N];if(K.node.type!==P.META)return;const st=K,ht=st.node.metaGraph,xt=st.coreGraph;ht.nodes().forEach(Te=>{const be=this.getOrCreateRenderNodeByName(Te);xt.setNode(Te,be)}),ht.edges().forEach(Te=>{const be=ht.edge(Te),We=new Rt(be);xt.setEdge(Te.v,Te.w,We)});const Ot=st.node.parentNode;if(!Ot)return;const zt=this.getRenderNodeByName(Ot.name),Kt=(Te,...be)=>be.concat([Te?"IN":"OUT"]).join("~~"),fe=this.hierarchy.getBridgeGraph(N);fe.edges().forEach(Te=>{const be=fe.edge(Te),We=!!ht.node(Te.w),[cr,Vr]=We?[Te.w,Te.v]:[Te.v,Te.w],mr=la=>{const ua=We?{v:la,w:N}:{v:N,w:la};return zt.coreGraph.edge(ua)};let wr=mr(Vr);wr||(wr=mr(Kt(We,Vr,Ot.name)));const Er=Kt(We,N),Sn=Kt(We,Vr,N);let Yn=xt.node(Sn);if(!Yn){let la=xt.node(Er);if(!la){const wa={name:Er,type:P.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:p.UNSPECIFIED,inbound:We,attr:{}};la=new Mf(wa),this.index[Er]=la,xt.setNode(Er,la)}const ua={name:Sn,type:P.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:p.UNSPECIFIED,inbound:We,attr:{}};Yn=new Mf(ua),this.index[Sn]=Yn,xt.setNode(Sn,Yn),xt.setParent(Sn,Er),la.node.cardinality++}const Nn=new Rt(be);Nn.adjoiningMetaEdge=wr,We?xt.setEdge(Sn,cr,Nn):xt.setEdge(cr,Sn,Nn)})}getOrCreateRenderNodeByName(N){if(!N)return null;if(N in this.index)return this.index[N];const K=this.getNodeByName(N);return K?(this.index[N]=K.isGroupNode?new Ae(K,this.hierarchy.graphOptions):new Mf(K),this.index[N]):null}getRenderNodeByName(N){return this.index[N]}getNodeByName(N){return this.hierarchy.node(N)}}class Mf{constructor(N){this.node=N,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=N.width||0,this.height=N.height||0,this.displayName=N.name,this.attr=N.attr}}class Rt{constructor(N){this.metaEdge=N,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class Ae extends Mf{constructor(N,K){super(N);const st=N.metaGraph.graph();K.compound=!0,this.coreGraph=rc(st.name,m.CORE,K)}}function je(v,N){v.node.isGroupNode&&function(K,st){const ht=k(st);K.coreGraph.nodes().map(xt=>K.coreGraph.node(xt)).forEach(xt=>{var Ot,zt,Kt,fe,Te,be;const{height:We,width:cr}=xt;switch(xt.node.type){case P.NODE:Object.assign(xt,ht.nodeSize.node),xt.height=We||ht.nodeSize.node.height,xt.width=cr||ht.nodeSize.node.width;break;case P.BRIDGE:Object.assign(xt,ht.nodeSize.bridge);break;case P.META:xt.expanded?je(xt,st):(Object.assign(xt,ht.nodeSize.meta),xt.height=ht.nodeSize.meta.height,xt.width=ht.nodeSize.meta.width);break;default:throw Error("Unrecognized node type: "+xt.node.type)}if(!xt.expanded){const Vr=xt.attr;(function(mr,wr=!1){if(mr.coreBox.width=mr.width,mr.coreBox.height=mr.height,!wr){const Er=`${mr.displayName}`.length,Sn=3;mr.width=Math.max(mr.coreBox.width,Er*Sn)}})(xt,st&&(xt.node.type===0&&!!(!((zt=(Ot=st==null?void 0:st.nodeSize)===null||Ot===void 0?void 0:Ot.meta)===null||zt===void 0)&&zt.width)||xt.node.type===1&&(!!(!((fe=(Kt=st==null?void 0:st.nodeSize)===null||Kt===void 0?void 0:Kt.node)===null||fe===void 0)&&fe.width)||!!Vr.width)||xt.node.type===2&&!!(!((be=(Te=st==null?void 0:st.nodeSize)===null||Te===void 0?void 0:Te.bridge)===null||be===void 0)&&be.width)))}})}(v,N),v.node.type===P.META&&function(K,st){const ht=k(st),xt=ht.subScene.meta;Object.assign(K,xt);const{nodeSep:Ot,rankSep:zt,edgeSep:Kt,align:fe}=ht.graph.meta,Te={nodesep:Ot,ranksep:zt,edgesep:Kt,align:fe};Object.assign(K.coreBox,function(cr,Vr){const{ranksep:mr,nodesep:wr,edgesep:Er,align:Sn}=Vr;Object.assign(cr.graph(),{ranksep:mr,nodesep:wr,edgesep:Er,align:Sn});const Yn=[];if(cr.nodes().forEach(Ba=>{cr.node(Ba).node.type!==P.BRIDGE&&Yn.push(Ba)}),!Yn.length)return{width:0,height:0};zc(cr);let Nn=1/0,la=1/0,ua=-1/0,wa=-1/0;return Yn.forEach(Ba=>{const Ia=cr.node(Ba),uo=.5*Ia.width,Ua=Ia.x-uo,Do=Ia.x+uo;Nn=Uaua?Do:ua;const Hi=.5*Ia.height,li=Ia.y-Hi,Fo=Ia.y+Hi;la=liwa?Fo:wa}),cr.edges().forEach(Ba=>{const Ia=cr.edge(Ba),uo=cr.node(Ia.metaEdge.v),Ua=cr.node(Ia.metaEdge.w);if(Ia.points.length===3&&function(li){let Fo=zr(li[0],li[1]);for(let fo=1;fo1)return!1;Fo=as}return!0}(Ia.points)){if(uo!=null){const li=uo.expanded?uo.x:rn(uo);Ia.points[0].x=li}if(Ua!=null){const li=Ua.expanded?Ua.x:rn(Ua);Ia.points[2].x=li}Ia.points=[Ia.points[0],Ia.points[1]]}const Do=Ia.points[Ia.points.length-2];Ua!=null&&(Ia.points[Ia.points.length-1]=Fr(Do,Ua));const Hi=Ia.points[1];uo!=null&&(Ia.points[0]=Fr(Hi,uo)),Ia.points.forEach(li=>{Nn=li.xua?li.x:ua,la=li.ywa?li.y:wa})}),cr.nodes().forEach(Ba=>{const Ia=cr.node(Ba);Ia.x-=Nn,Ia.y-=la}),cr.edges().forEach(Ba=>{cr.edge(Ba).points.forEach(Ia=>{Ia.x-=Nn,Ia.y-=la})}),{width:ua-Nn,height:wa-la}}(K.coreGraph,Te));let be=0;K.coreGraph.nodeCount()>0&&be++;const We=be<=1?0:be;K.coreBox.width+=We+We,K.coreBox.height=xt.labelHeight+K.coreBox.height,K.width=K.coreBox.width+xt.paddingLeft+xt.paddingRight,K.height=K.paddingTop+K.coreBox.height+K.paddingBottom}(v,N)}function zr(v,N){const K=N.x-v.x,st=N.y-v.y;return 180*Math.atan(st/K)/Math.PI}function rn(v){return v.expanded?v.x:v.x-v.width/2+0+v.coreBox.width/2}function Fr(v,N){const K=N.expanded?N.x:rn(N),st=N.y,ht=v.x-K,xt=v.y-st;let Ot,zt,Kt=N.expanded?N.width:N.coreBox.width,fe=N.expanded?N.height:N.coreBox.height;return Math.abs(xt)*Kt/2>Math.abs(ht)*fe/2?(xt<0&&(fe=-fe),Ot=xt===0?0:fe/2*ht/xt,zt=fe/2):(ht<0&&(Kt=-Kt),Ot=Kt/2,zt=ht===0?0:Kt/2*xt/ht),{x:K+Ot,y:st+zt}}function jr(v,N,K){var st,ht,xt,Ot;const zt=v.nodes.filter((be,We,cr)=>cr.findIndex(Vr=>Vr.id===be.id)!==We).map(be=>be.id);if(zt.length)throw new Error(`Duplicated ids found: ${zt.join(", ")}`);const Kt=function(be){const We={nodes:[]},cr=be.compound,Vr=Object.keys(cr||{}),mr=new Map,wr=(Sn,Yn=[])=>{if(mr.has(Sn))return mr.get(Sn);for(let Nn=0;Nnbe.edges.filter(Yn=>Yn.w===Sn).map(Yn=>({name:Yn.v}));return be.nodes.forEach(Sn=>{const Yn=Sn.id,Nn=[...wr(Yn),Yn];let la=Er(Yn);We.nodes.push({name:Yn,path:Nn,inputs:la,width:Sn.width,height:Sn.height,attr:Object.assign({},Sn)})}),We}(v),fe=function(be,We){const cr=(mr,wr)=>{for(let Er of wr.values())if(Er.includes(mr))return!0;return!1},Vr=(mr,wr=[])=>{if(Object.keys(mr).length===0)return[...new Set(wr)];const Er=new Map(Object.keys(mr).map(Yn=>[Yn,mr[Yn]])),Sn={};for(let[Yn,Nn]of Er)cr(Yn,Er)?Sn[Yn]=Nn:wr=wr.concat(Yn,Nn);return Vr(Sn,wr)};return Vr(be).filter(mr=>We.includes(mr))}(v.compound||{},(N==null?void 0:N.expanded)||[]),Te=function(be,We){return function(cr){return new Cl(cr)}(nd(rd(be),We))}(Kt,{rankDirection:((ht=(st=K==null?void 0:K.graph)===null||st===void 0?void 0:st.meta)===null||ht===void 0?void 0:ht.rankDir)||(N==null?void 0:N.rankDirection)||x.graph.meta.rankDir,align:((Ot=(xt=K==null?void 0:K.graph)===null||xt===void 0?void 0:xt.meta)===null||Ot===void 0?void 0:Ot.align)||x.graph.meta.align});return function(be,We){We.forEach(cr=>{const Vr=be.getRenderInfoNodes().find(Er=>Er.displayName===cr);let mr=Vr&&Vr.node&&Vr.node.name||"";const wr=be.getRenderNodeByName(mr);if(!wr)throw new Error(`No nodes found: ${mr}`);wr.expanded=!0,be.buildSubHierarchy(mr)})}(Te,fe),je(Te.root,K),Cn(Te.root)}function bn(v,N=!1){const K=JSON.parse(JSON.stringify(v)),st={nodes:[K],edges:[...K.edges]};return K.nodes.forEach(function ht(xt){(xt.type===0||xt.type===1)&&st.nodes.push(xt),xt.type===0&&(st.edges=st.edges.concat(xt.edges)),Array.isArray(xt.nodes)&&xt.nodes.forEach(ht)}),N&&st.nodes.forEach(ht=>{const xt=st.nodes.find(Ot=>Ot.id===ht.parentNodeName);if(xt){const Ot=xt.x-xt.width/2+xt.paddingLeft,zt=xt.y-xt.height/2+xt.labelHeight+xt.paddingTop;xt.id!==T&&(ht.x+=Ot,ht.y+=zt),ht.type===0&&ht.edges.forEach(Kt=>{Kt.points.forEach(fe=>{fe.x+=ht.x-ht.width/2+ht.paddingLeft,fe.y+=ht.y-ht.height/2+ht.labelHeight+ht.paddingTop})})}}),st}function _n(v,N,K,st){var ht,xt;let Ot=[];const zt=((ht=K.find(be=>be.id===v))===null||ht===void 0?void 0:ht.path)||[],Kt=((xt=K.find(be=>be.id===N))===null||xt===void 0?void 0:xt.path)||[],fe=[T,...zt].slice(0,zt.length).reverse(),Te=[T,...Kt].slice(0,Kt.length);return fe.forEach(be=>{const We=K.find(cr=>cr.id===be);Ot=Ot.concat(We.edges.filter(cr=>cr.baseEdgeList.some(Vr=>Vr.v===((st==null?void 0:st.v)||v)&&Vr.w===((st==null?void 0:st.w)||N))))}),Te.filter(be=>!fe.includes(be)).forEach(be=>{const We=K.find(cr=>cr.id===be);Ot=Ot.concat(We.edges.filter(cr=>cr.baseEdgeList.some(Vr=>Vr.v===((st==null?void 0:st.v)||v)&&Vr.w===((st==null?void 0:st.w)||N))))}),Ot}function Cn(v){const N=v.coreGraph.nodes().map(st=>v.coreGraph.node(st));return Object.assign(Object.assign({},wn(v)),{expanded:v.expanded,nodes:v.expanded?(K=N,K.map(st=>st.node.type===P.META?Cn(st):wn(st))):[],edges:v.expanded?Bn(v):[]});var K}function wn(v){return{id:v.node.name,name:v.node.name,type:v.node.type,cardinality:v.node.cardinality,attr:v.attr,parentNodeName:v.node.parentNode?v.node.parentNode.name:null,coreBox:Object.assign({},v.coreBox),x:v.x,y:v.y,width:v.width,height:v.height,radius:v.radius,labelHeight:v.labelHeight,labelOffset:v.labelOffset,outboxWidth:v.outboxWidth,paddingLeft:v.paddingLeft,paddingTop:v.paddingTop,paddingRight:v.paddingRight,paddingBottom:v.paddingBottom,path:v.node.path}}function Bn(v){return v.coreGraph.edges().map(N=>({renderInfoEdge:v.coreGraph.edge(N),edge:N})).filter(({renderInfoEdge:N})=>N.metaEdge).map(({edge:N,renderInfoEdge:K})=>{const st=function(ht,xt){const Ot=xt.points.map(zt=>Object.assign({},zt));if(xt.adjoiningMetaEdge){const zt=xt.adjoiningMetaEdge.points,Kt=xt.metaEdge.inbound,fe=Kt?zt[zt.length-1]:zt[0],Te=Ot[Kt?0:Ot.length-1],be=ht.x-ht.width/2,We=ht.y-ht.height/2,cr=fe.x-be,Vr=fe.y-We,mr=-ht.paddingLeft,wr=-(ht.paddingTop+ht.labelHeight);Te.x=cr+mr,Te.y=Vr+wr}return Ot}(v,K);return{adjoiningEdge:K.adjoiningMetaEdge?{w:K.adjoiningMetaEdge.metaEdge.w,v:K.adjoiningMetaEdge.metaEdge.v}:null,inbound:K.metaEdge.inbound,w:N.w,v:N.v,points:st,weight:K.weight,baseEdgeList:K.metaEdge.baseEdgeList,parentNodeName:v.node.name}})}},533852:function(Ve,z,C){(function(x,k){Ve.exports=k(C(727484))})(this,function(x){"use strict";function k(L){return L&&typeof L=="object"&&"default"in L?L:{default:L}}var w=k(x),T={name:"zh-cn",weekdays:"\u661F\u671F\u65E5_\u661F\u671F\u4E00_\u661F\u671F\u4E8C_\u661F\u671F\u4E09_\u661F\u671F\u56DB_\u661F\u671F\u4E94_\u661F\u671F\u516D".split("_"),weekdaysShort:"\u5468\u65E5_\u5468\u4E00_\u5468\u4E8C_\u5468\u4E09_\u5468\u56DB_\u5468\u4E94_\u5468\u516D".split("_"),weekdaysMin:"\u65E5_\u4E00_\u4E8C_\u4E09_\u56DB_\u4E94_\u516D".split("_"),months:"\u4E00\u6708_\u4E8C\u6708_\u4E09\u6708_\u56DB\u6708_\u4E94\u6708_\u516D\u6708_\u4E03\u6708_\u516B\u6708_\u4E5D\u6708_\u5341\u6708_\u5341\u4E00\u6708_\u5341\u4E8C\u6708".split("_"),monthsShort:"1\u6708_2\u6708_3\u6708_4\u6708_5\u6708_6\u6708_7\u6708_8\u6708_9\u6708_10\u6708_11\u6708_12\u6708".split("_"),ordinal:function(L,P){return P==="W"?L+"\u5468":L+"\u65E5"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY\u5E74M\u6708D\u65E5",LLL:"YYYY\u5E74M\u6708D\u65E5Ah\u70B9mm\u5206",LLLL:"YYYY\u5E74M\u6708D\u65E5ddddAh\u70B9mm\u5206",l:"YYYY/M/D",ll:"YYYY\u5E74M\u6708D\u65E5",lll:"YYYY\u5E74M\u6708D\u65E5 HH:mm",llll:"YYYY\u5E74M\u6708D\u65E5dddd HH:mm"},relativeTime:{future:"%s\u5185",past:"%s\u524D",s:"\u51E0\u79D2",m:"1 \u5206\u949F",mm:"%d \u5206\u949F",h:"1 \u5C0F\u65F6",hh:"%d \u5C0F\u65F6",d:"1 \u5929",dd:"%d \u5929",M:"1 \u4E2A\u6708",MM:"%d \u4E2A\u6708",y:"1 \u5E74",yy:"%d \u5E74"},meridiem:function(L,P){var p=100*L+P;return p<600?"\u51CC\u6668":p<900?"\u65E9\u4E0A":p<1100?"\u4E0A\u5348":p<1300?"\u4E2D\u5348":p<1800?"\u4E0B\u5348":"\u665A\u4E0A"}};return w.default.locale(T,null,!0),T})},414144:function(Ve,z){var C,x,k;(function(w,T){if(!0)x=[z,Ve],C=T,k=typeof C=="function"?C.apply(z,x):C,k!==void 0&&(Ve.exports=k);else var L})(this,function(w,T){"use strict";var L={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function P(){return"jsonp_"+Date.now()+"_"+Math.ceil(Math.random()*1e5)}function p(y){try{delete window[y]}catch(g){window[y]=void 0}}function m(y){var g=document.getElementById(y);g&&document.getElementsByTagName("head")[0].removeChild(g)}function S(y){var g=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],A=y,E=g.timeout||L.timeout,D=g.jsonpCallback||L.jsonpCallback,F=void 0;return new Promise(function(Y,b){var h=g.jsonpCallbackFunction||P(),$=D+"_"+h;window[h]=function(W){Y({ok:!0,json:function(){return Promise.resolve(W)}}),F&&clearTimeout(F),m($),p(h)},A+=A.indexOf("?")===-1?"?":"&";var U=document.createElement("script");U.setAttribute("src",""+A+D+"="+h),g.charset&&U.setAttribute("charset",g.charset),g.nonce&&U.setAttribute("nonce",g.nonce),g.referrerPolicy&&U.setAttribute("referrerPolicy",g.referrerPolicy),g.crossorigin&&U.setAttribute("crossorigin","true"),U.id=$,document.getElementsByTagName("head")[0].appendChild(U),F=setTimeout(function(){b(new Error("JSONP request to "+y+" timed out")),p(h),m($),window[h]=function(){p(h)}},E),U.onerror=function(){b(new Error("JSONP request to "+y+" failed")),p(h),m($),F&&clearTimeout(F)}})}T.exports=S})},73633:function(Ve,z,C){"use strict";C.r(z),C.d(z,{ARRAY_TYPE:function(){return k},EPSILON:function(){return x},RANDOM:function(){return w},equals:function(){return p},setMatrixArrayType:function(){return T},toRadian:function(){return P}});var x=1e-6,k=typeof Float32Array!="undefined"?Float32Array:Array,w=Math.random;function T(m){k=m}var L=Math.PI/180;function P(m){return m*L}function p(m,S){return Math.abs(m-S)<=x*Math.max(1,Math.abs(m),Math.abs(S))}Math.hypot||(Math.hypot=function(){for(var m=0,S=arguments.length;S--;)m+=arguments[S]*arguments[S];return Math.sqrt(m)})},858204:function(Ve,z,C){"use strict";C.r(z),C.d(z,{glMatrix:function(){return p},mat2:function(){return x},mat2d:function(){return k},mat3:function(){return Ar},mat4:function(){return w},quat:function(){return L},quat2:function(){return P},vec2:function(){return ss},vec3:function(){return Rr},vec4:function(){return T}});var x={};C.r(x),C.d(x,{LDU:function(){return tt},add:function(){return rt},adjoint:function(){return Y},clone:function(){return S},copy:function(){return y},create:function(){return m},determinant:function(){return b},equals:function(){return bt},exactEquals:function(){return it},frob:function(){return q},fromRotation:function(){return W},fromScaling:function(){return V},fromValues:function(){return A},identity:function(){return g},invert:function(){return F},mul:function(){return Ct},multiply:function(){return h},multiplyScalar:function(){return gt},multiplyScalarAndAdd:function(){return Xt},rotate:function(){return $},scale:function(){return U},set:function(){return E},str:function(){return H},sub:function(){return At},subtract:function(){return ft},transpose:function(){return D}});var k={};C.r(k),C.d(k,{add:function(){return ae},clone:function(){return J},copy:function(){return yt},create:function(){return Z},determinant:function(){return Pt},equals:function(){return Tt},exactEquals:function(){return we},frob:function(){return Wt},fromRotation:function(){return ie},fromScaling:function(){return Lt},fromTranslation:function(){return ne},fromValues:function(){return nt},identity:function(){return _t},invert:function(){return It},mul:function(){return Pe},multiply:function(){return St},multiplyScalar:function(){return xe},multiplyScalarAndAdd:function(){return Jt},rotate:function(){return Dt},scale:function(){return Qt},set:function(){return vt},str:function(){return ve},sub:function(){return _r},subtract:function(){return Ce},translate:function(){return ue}});var w={};C.r(w),C.d(w,{add:function(){return me},adjoint:function(){return $e},clone:function(){return Br},copy:function(){return cn},create:function(){return Or},determinant:function(){return Tr},equals:function(){return un},exactEquals:function(){return Pr},frob:function(){return Le},fromQuat:function(){return dt},fromQuat2:function(){return Ht},fromRotation:function(){return Mn},fromRotationTranslation:function(){return Je},fromRotationTranslationScale:function(){return kt},fromRotationTranslationScaleOrigin:function(){return qt},fromScaling:function(){return Wn},fromTranslation:function(){return sn},fromValues:function(){return an},fromXRotation:function(){return In},fromYRotation:function(){return jn},fromZRotation:function(){return at},frustum:function(){return Ut},getRotation:function(){return Me},getScaling:function(){return wt},getTranslation:function(){return te},identity:function(){return Un},invert:function(){return xr},lookAt:function(){return Ft},mul:function(){return Ke},multiply:function(){return qr},multiplyScalar:function(){return pr},multiplyScalarAndAdd:function(){return Ze},ortho:function(){return X},orthoNO:function(){return O},orthoZO:function(){return mt},perspective:function(){return ot},perspectiveFromFieldOfView:function(){return M},perspectiveNO:function(){return Q},perspectiveZO:function(){return R},rotate:function(){return Rn},rotateX:function(){return Mr},rotateY:function(){return dn},rotateZ:function(){return hn},scale:function(){return xn},set:function(){return Dn},str:function(){return ee},sub:function(){return lr},subtract:function(){return Xe},targetTo:function(){return Bt},translate:function(){return gn},transpose:function(){return Xn}});var T={};C.r(T),C.d(T,{add:function(){return Se},ceil:function(){return Jr},clone:function(){return ce},copy:function(){return pe},create:function(){return Dr},cross:function(){return eo},dist:function(){return Si},distance:function(){return ba},div:function(){return vo},divide:function(){return gr},dot:function(){return Co},equals:function(){return ro},exactEquals:function(){return Po},floor:function(){return Gn},forEach:function(){return de},fromValues:function(){return jt},inverse:function(){return wi},len:function(){return Jo},length:function(){return Ni},lerp:function(){return ga},max:function(){return qn},min:function(){return pn},mul:function(){return es},multiply:function(){return or},negate:function(){return ei},normalize:function(){return Gi},random:function(){return lo},round:function(){return ln},scale:function(){return Vn},scaleAndAdd:function(){return ca},set:function(){return Oe},sqrDist:function(){return ao},sqrLen:function(){return Yt},squaredDistance:function(){return Ea},squaredLength:function(){return ti},str:function(){return ho},sub:function(){return no},subtract:function(){return Fe},transformMat4:function(){return To},transformQuat:function(){return ni},zero:function(){return Ri}});var L={};C.r(L),C.d(L,{add:function(){return mi},calculateW:function(){return Zn},clone:function(){return La},conjugate:function(){return $a},copy:function(){return za},create:function(){return Ge},dot:function(){return Wi},equals:function(){return Qa},exactEquals:function(){return io},exp:function(){return pa},fromEuler:function(){return Ui},fromMat3:function(){return Fa},fromValues:function(){return ja},getAngle:function(){return Sr},getAxisAngle:function(){return Nr},identity:function(){return sr},invert:function(){return si},len:function(){return os},length:function(){return Vo},lerp:function(){return Ao},ln:function(){return ya},mul:function(){return ki},multiply:function(){return en},normalize:function(){return Yi},pow:function(){return di},random:function(){return oa},rotateX:function(){return fn},rotateY:function(){return Pn},rotateZ:function(){return sa},rotationTo:function(){return Pi},scale:function(){return po},set:function(){return yi},setAxes:function(){return qi},setAxisAngle:function(){return Lr},slerp:function(){return Ma},sqlerp:function(){return zo},sqrLen:function(){return qa},squaredLength:function(){return $i},str:function(){return fi}});var P={};C.r(P),C.d(P,{add:function(){return ji},clone:function(){return Xi},conjugate:function(){return Vs},copy:function(){return Os},create:function(){return rs},dot:function(){return qs},equals:function(){return bo},exactEquals:function(){return Uo},fromMat4:function(){return hs},fromRotation:function(){return ls},fromRotationTranslation:function(){return ds},fromRotationTranslationValues:function(){return Es},fromTranslation:function(){return oo},fromValues:function(){return yo},getDual:function(){return ir},getReal:function(){return ye},getTranslation:function(){return Ln},identity:function(){return Ho},invert:function(){return Js},len:function(){return Us},length:function(){return Rs},lerp:function(){return Qs},mul:function(){return Gs},multiply:function(){return xo},normalize:function(){return _u},rotateAroundAxis:function(){return Ds},rotateByQuatAppend:function(){return Go},rotateByQuatPrepend:function(){return zs},rotateX:function(){return Sa},rotateY:function(){return Ci},rotateZ:function(){return Io},scale:function(){return vs},set:function(){return $t},setDual:function(){return Zr},setReal:function(){return dr},sqrLen:function(){return ns},squaredLength:function(){return ws},str:function(){return Cu},translate:function(){return Qn}});var p=C(73633);function m(){var d=new p.ARRAY_TYPE(4);return p.ARRAY_TYPE!=Float32Array&&(d[1]=0,d[2]=0),d[0]=1,d[3]=1,d}function S(d){var G=new p.ARRAY_TYPE(4);return G[0]=d[0],G[1]=d[1],G[2]=d[2],G[3]=d[3],G}function y(d,G){return d[0]=G[0],d[1]=G[1],d[2]=G[2],d[3]=G[3],d}function g(d){return d[0]=1,d[1]=0,d[2]=0,d[3]=1,d}function A(d,G,Et,Gt){var re=new p.ARRAY_TYPE(4);return re[0]=d,re[1]=G,re[2]=Et,re[3]=Gt,re}function E(d,G,Et,Gt,re){return d[0]=G,d[1]=Et,d[2]=Gt,d[3]=re,d}function D(d,G){if(d===G){var Et=G[1];d[1]=G[2],d[2]=Et}else d[0]=G[0],d[1]=G[2],d[2]=G[1],d[3]=G[3];return d}function F(d,G){var Et=G[0],Gt=G[1],re=G[2],he=G[3],ge=Et*he-re*Gt;return ge?(ge=1/ge,d[0]=he*ge,d[1]=-Gt*ge,d[2]=-re*ge,d[3]=Et*ge,d):null}function Y(d,G){var Et=G[0];return d[0]=G[3],d[1]=-G[1],d[2]=-G[2],d[3]=Et,d}function b(d){return d[0]*d[3]-d[2]*d[1]}function h(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=Et[0],ze=Et[1],He=Et[2],ur=Et[3];return d[0]=Gt*De+he*ze,d[1]=re*De+ge*ze,d[2]=Gt*He+he*ur,d[3]=re*He+ge*ur,d}function $(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=Math.sin(Et),ze=Math.cos(Et);return d[0]=Gt*ze+he*De,d[1]=re*ze+ge*De,d[2]=Gt*-De+he*ze,d[3]=re*-De+ge*ze,d}function U(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=Et[0],ze=Et[1];return d[0]=Gt*De,d[1]=re*De,d[2]=he*ze,d[3]=ge*ze,d}function W(d,G){var Et=Math.sin(G),Gt=Math.cos(G);return d[0]=Gt,d[1]=Et,d[2]=-Et,d[3]=Gt,d}function V(d,G){return d[0]=G[0],d[1]=0,d[2]=0,d[3]=G[1],d}function H(d){return"mat2("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+")"}function q(d){return Math.hypot(d[0],d[1],d[2],d[3])}function tt(d,G,Et,Gt){return d[2]=Gt[2]/Gt[0],Et[0]=Gt[0],Et[1]=Gt[1],Et[3]=Gt[3]-d[2]*Et[1],[d,G,Et]}function rt(d,G,Et){return d[0]=G[0]+Et[0],d[1]=G[1]+Et[1],d[2]=G[2]+Et[2],d[3]=G[3]+Et[3],d}function ft(d,G,Et){return d[0]=G[0]-Et[0],d[1]=G[1]-Et[1],d[2]=G[2]-Et[2],d[3]=G[3]-Et[3],d}function it(d,G){return d[0]===G[0]&&d[1]===G[1]&&d[2]===G[2]&&d[3]===G[3]}function bt(d,G){var Et=d[0],Gt=d[1],re=d[2],he=d[3],ge=G[0],De=G[1],ze=G[2],He=G[3];return Math.abs(Et-ge)<=p.EPSILON*Math.max(1,Math.abs(Et),Math.abs(ge))&&Math.abs(Gt-De)<=p.EPSILON*Math.max(1,Math.abs(Gt),Math.abs(De))&&Math.abs(re-ze)<=p.EPSILON*Math.max(1,Math.abs(re),Math.abs(ze))&&Math.abs(he-He)<=p.EPSILON*Math.max(1,Math.abs(he),Math.abs(He))}function gt(d,G,Et){return d[0]=G[0]*Et,d[1]=G[1]*Et,d[2]=G[2]*Et,d[3]=G[3]*Et,d}function Xt(d,G,Et,Gt){return d[0]=G[0]+Et[0]*Gt,d[1]=G[1]+Et[1]*Gt,d[2]=G[2]+Et[2]*Gt,d[3]=G[3]+Et[3]*Gt,d}var Ct=h,At=ft;function Z(){var d=new p.ARRAY_TYPE(6);return p.ARRAY_TYPE!=Float32Array&&(d[1]=0,d[2]=0,d[4]=0,d[5]=0),d[0]=1,d[3]=1,d}function J(d){var G=new p.ARRAY_TYPE(6);return G[0]=d[0],G[1]=d[1],G[2]=d[2],G[3]=d[3],G[4]=d[4],G[5]=d[5],G}function yt(d,G){return d[0]=G[0],d[1]=G[1],d[2]=G[2],d[3]=G[3],d[4]=G[4],d[5]=G[5],d}function _t(d){return d[0]=1,d[1]=0,d[2]=0,d[3]=1,d[4]=0,d[5]=0,d}function nt(d,G,Et,Gt,re,he){var ge=new p.ARRAY_TYPE(6);return ge[0]=d,ge[1]=G,ge[2]=Et,ge[3]=Gt,ge[4]=re,ge[5]=he,ge}function vt(d,G,Et,Gt,re,he,ge){return d[0]=G,d[1]=Et,d[2]=Gt,d[3]=re,d[4]=he,d[5]=ge,d}function It(d,G){var Et=G[0],Gt=G[1],re=G[2],he=G[3],ge=G[4],De=G[5],ze=Et*he-Gt*re;return ze?(ze=1/ze,d[0]=he*ze,d[1]=-Gt*ze,d[2]=-re*ze,d[3]=Et*ze,d[4]=(re*De-he*ge)*ze,d[5]=(Gt*ge-Et*De)*ze,d):null}function Pt(d){return d[0]*d[3]-d[1]*d[2]}function St(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=G[4],ze=G[5],He=Et[0],ur=Et[1],Ur=Et[2],Xr=Et[3],Wr=Et[4],Tn=Et[5];return d[0]=Gt*He+he*ur,d[1]=re*He+ge*ur,d[2]=Gt*Ur+he*Xr,d[3]=re*Ur+ge*Xr,d[4]=Gt*Wr+he*Tn+De,d[5]=re*Wr+ge*Tn+ze,d}function Dt(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=G[4],ze=G[5],He=Math.sin(Et),ur=Math.cos(Et);return d[0]=Gt*ur+he*He,d[1]=re*ur+ge*He,d[2]=Gt*-He+he*ur,d[3]=re*-He+ge*ur,d[4]=De,d[5]=ze,d}function Qt(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=G[4],ze=G[5],He=Et[0],ur=Et[1];return d[0]=Gt*He,d[1]=re*He,d[2]=he*ur,d[3]=ge*ur,d[4]=De,d[5]=ze,d}function ue(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=G[4],ze=G[5],He=Et[0],ur=Et[1];return d[0]=Gt,d[1]=re,d[2]=he,d[3]=ge,d[4]=Gt*He+he*ur+De,d[5]=re*He+ge*ur+ze,d}function ie(d,G){var Et=Math.sin(G),Gt=Math.cos(G);return d[0]=Gt,d[1]=Et,d[2]=-Et,d[3]=Gt,d[4]=0,d[5]=0,d}function Lt(d,G){return d[0]=G[0],d[1]=0,d[2]=0,d[3]=G[1],d[4]=0,d[5]=0,d}function ne(d,G){return d[0]=1,d[1]=0,d[2]=0,d[3]=1,d[4]=G[0],d[5]=G[1],d}function ve(d){return"mat2d("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+")"}function Wt(d){return Math.hypot(d[0],d[1],d[2],d[3],d[4],d[5],1)}function ae(d,G,Et){return d[0]=G[0]+Et[0],d[1]=G[1]+Et[1],d[2]=G[2]+Et[2],d[3]=G[3]+Et[3],d[4]=G[4]+Et[4],d[5]=G[5]+Et[5],d}function Ce(d,G,Et){return d[0]=G[0]-Et[0],d[1]=G[1]-Et[1],d[2]=G[2]-Et[2],d[3]=G[3]-Et[3],d[4]=G[4]-Et[4],d[5]=G[5]-Et[5],d}function xe(d,G,Et){return d[0]=G[0]*Et,d[1]=G[1]*Et,d[2]=G[2]*Et,d[3]=G[3]*Et,d[4]=G[4]*Et,d[5]=G[5]*Et,d}function Jt(d,G,Et,Gt){return d[0]=G[0]+Et[0]*Gt,d[1]=G[1]+Et[1]*Gt,d[2]=G[2]+Et[2]*Gt,d[3]=G[3]+Et[3]*Gt,d[4]=G[4]+Et[4]*Gt,d[5]=G[5]+Et[5]*Gt,d}function we(d,G){return d[0]===G[0]&&d[1]===G[1]&&d[2]===G[2]&&d[3]===G[3]&&d[4]===G[4]&&d[5]===G[5]}function Tt(d,G){var Et=d[0],Gt=d[1],re=d[2],he=d[3],ge=d[4],De=d[5],ze=G[0],He=G[1],ur=G[2],Ur=G[3],Xr=G[4],Wr=G[5];return Math.abs(Et-ze)<=p.EPSILON*Math.max(1,Math.abs(Et),Math.abs(ze))&&Math.abs(Gt-He)<=p.EPSILON*Math.max(1,Math.abs(Gt),Math.abs(He))&&Math.abs(re-ur)<=p.EPSILON*Math.max(1,Math.abs(re),Math.abs(ur))&&Math.abs(he-Ur)<=p.EPSILON*Math.max(1,Math.abs(he),Math.abs(Ur))&&Math.abs(ge-Xr)<=p.EPSILON*Math.max(1,Math.abs(ge),Math.abs(Xr))&&Math.abs(De-Wr)<=p.EPSILON*Math.max(1,Math.abs(De),Math.abs(Wr))}var Pe=St,_r=Ce,Ar=C(935600);function Or(){var d=new p.ARRAY_TYPE(16);return p.ARRAY_TYPE!=Float32Array&&(d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[11]=0,d[12]=0,d[13]=0,d[14]=0),d[0]=1,d[5]=1,d[10]=1,d[15]=1,d}function Br(d){var G=new p.ARRAY_TYPE(16);return G[0]=d[0],G[1]=d[1],G[2]=d[2],G[3]=d[3],G[4]=d[4],G[5]=d[5],G[6]=d[6],G[7]=d[7],G[8]=d[8],G[9]=d[9],G[10]=d[10],G[11]=d[11],G[12]=d[12],G[13]=d[13],G[14]=d[14],G[15]=d[15],G}function cn(d,G){return d[0]=G[0],d[1]=G[1],d[2]=G[2],d[3]=G[3],d[4]=G[4],d[5]=G[5],d[6]=G[6],d[7]=G[7],d[8]=G[8],d[9]=G[9],d[10]=G[10],d[11]=G[11],d[12]=G[12],d[13]=G[13],d[14]=G[14],d[15]=G[15],d}function an(d,G,Et,Gt,re,he,ge,De,ze,He,ur,Ur,Xr,Wr,Tn,On){var Qr=new p.ARRAY_TYPE(16);return Qr[0]=d,Qr[1]=G,Qr[2]=Et,Qr[3]=Gt,Qr[4]=re,Qr[5]=he,Qr[6]=ge,Qr[7]=De,Qr[8]=ze,Qr[9]=He,Qr[10]=ur,Qr[11]=Ur,Qr[12]=Xr,Qr[13]=Wr,Qr[14]=Tn,Qr[15]=On,Qr}function Dn(d,G,Et,Gt,re,he,ge,De,ze,He,ur,Ur,Xr,Wr,Tn,On,Qr){return d[0]=G,d[1]=Et,d[2]=Gt,d[3]=re,d[4]=he,d[5]=ge,d[6]=De,d[7]=ze,d[8]=He,d[9]=ur,d[10]=Ur,d[11]=Xr,d[12]=Wr,d[13]=Tn,d[14]=On,d[15]=Qr,d}function Un(d){return d[0]=1,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=1,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=1,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}function Xn(d,G){if(d===G){var Et=G[1],Gt=G[2],re=G[3],he=G[6],ge=G[7],De=G[11];d[1]=G[4],d[2]=G[8],d[3]=G[12],d[4]=Et,d[6]=G[9],d[7]=G[13],d[8]=Gt,d[9]=he,d[11]=G[14],d[12]=re,d[13]=ge,d[14]=De}else d[0]=G[0],d[1]=G[4],d[2]=G[8],d[3]=G[12],d[4]=G[1],d[5]=G[5],d[6]=G[9],d[7]=G[13],d[8]=G[2],d[9]=G[6],d[10]=G[10],d[11]=G[14],d[12]=G[3],d[13]=G[7],d[14]=G[11],d[15]=G[15];return d}function xr(d,G){var Et=G[0],Gt=G[1],re=G[2],he=G[3],ge=G[4],De=G[5],ze=G[6],He=G[7],ur=G[8],Ur=G[9],Xr=G[10],Wr=G[11],Tn=G[12],On=G[13],Qr=G[14],ra=G[15],Ha=Et*De-Gt*ge,Va=Et*ze-re*ge,Ra=Et*He-he*ge,_a=Gt*ze-re*De,Pa=Gt*He-he*De,Oo=re*He-he*ze,Eo=ur*On-Ur*Tn,go=ur*Qr-Xr*Tn,wo=ur*ra-Wr*Tn,So=Ur*Qr-Xr*On,No=Ur*ra-Wr*On,Ro=Xr*ra-Wr*Qr,ci=Ha*Ro-Va*No+Ra*So+_a*wo-Pa*go+Oo*Eo;return ci?(ci=1/ci,d[0]=(De*Ro-ze*No+He*So)*ci,d[1]=(re*No-Gt*Ro-he*So)*ci,d[2]=(On*Oo-Qr*Pa+ra*_a)*ci,d[3]=(Xr*Pa-Ur*Oo-Wr*_a)*ci,d[4]=(ze*wo-ge*Ro-He*go)*ci,d[5]=(Et*Ro-re*wo+he*go)*ci,d[6]=(Qr*Ra-Tn*Oo-ra*Va)*ci,d[7]=(ur*Oo-Xr*Ra+Wr*Va)*ci,d[8]=(ge*No-De*wo+He*Eo)*ci,d[9]=(Gt*wo-Et*No-he*Eo)*ci,d[10]=(Tn*Pa-On*Ra+ra*Ha)*ci,d[11]=(Ur*Ra-ur*Pa-Wr*Ha)*ci,d[12]=(De*go-ge*So-ze*Eo)*ci,d[13]=(Et*So-Gt*go+re*Eo)*ci,d[14]=(On*Va-Tn*_a-Qr*Ha)*ci,d[15]=(ur*_a-Ur*Va+Xr*Ha)*ci,d):null}function $e(d,G){var Et=G[0],Gt=G[1],re=G[2],he=G[3],ge=G[4],De=G[5],ze=G[6],He=G[7],ur=G[8],Ur=G[9],Xr=G[10],Wr=G[11],Tn=G[12],On=G[13],Qr=G[14],ra=G[15];return d[0]=De*(Xr*ra-Wr*Qr)-Ur*(ze*ra-He*Qr)+On*(ze*Wr-He*Xr),d[1]=-(Gt*(Xr*ra-Wr*Qr)-Ur*(re*ra-he*Qr)+On*(re*Wr-he*Xr)),d[2]=Gt*(ze*ra-He*Qr)-De*(re*ra-he*Qr)+On*(re*He-he*ze),d[3]=-(Gt*(ze*Wr-He*Xr)-De*(re*Wr-he*Xr)+Ur*(re*He-he*ze)),d[4]=-(ge*(Xr*ra-Wr*Qr)-ur*(ze*ra-He*Qr)+Tn*(ze*Wr-He*Xr)),d[5]=Et*(Xr*ra-Wr*Qr)-ur*(re*ra-he*Qr)+Tn*(re*Wr-he*Xr),d[6]=-(Et*(ze*ra-He*Qr)-ge*(re*ra-he*Qr)+Tn*(re*He-he*ze)),d[7]=Et*(ze*Wr-He*Xr)-ge*(re*Wr-he*Xr)+ur*(re*He-he*ze),d[8]=ge*(Ur*ra-Wr*On)-ur*(De*ra-He*On)+Tn*(De*Wr-He*Ur),d[9]=-(Et*(Ur*ra-Wr*On)-ur*(Gt*ra-he*On)+Tn*(Gt*Wr-he*Ur)),d[10]=Et*(De*ra-He*On)-ge*(Gt*ra-he*On)+Tn*(Gt*He-he*De),d[11]=-(Et*(De*Wr-He*Ur)-ge*(Gt*Wr-he*Ur)+ur*(Gt*He-he*De)),d[12]=-(ge*(Ur*Qr-Xr*On)-ur*(De*Qr-ze*On)+Tn*(De*Xr-ze*Ur)),d[13]=Et*(Ur*Qr-Xr*On)-ur*(Gt*Qr-re*On)+Tn*(Gt*Xr-re*Ur),d[14]=-(Et*(De*Qr-ze*On)-ge*(Gt*Qr-re*On)+Tn*(Gt*ze-re*De)),d[15]=Et*(De*Xr-ze*Ur)-ge*(Gt*Xr-re*Ur)+ur*(Gt*ze-re*De),d}function Tr(d){var G=d[0],Et=d[1],Gt=d[2],re=d[3],he=d[4],ge=d[5],De=d[6],ze=d[7],He=d[8],ur=d[9],Ur=d[10],Xr=d[11],Wr=d[12],Tn=d[13],On=d[14],Qr=d[15],ra=G*ge-Et*he,Ha=G*De-Gt*he,Va=G*ze-re*he,Ra=Et*De-Gt*ge,_a=Et*ze-re*ge,Pa=Gt*ze-re*De,Oo=He*Tn-ur*Wr,Eo=He*On-Ur*Wr,go=He*Qr-Xr*Wr,wo=ur*On-Ur*Tn,So=ur*Qr-Xr*Tn,No=Ur*Qr-Xr*On;return ra*No-Ha*So+Va*wo+Ra*go-_a*Eo+Pa*Oo}function qr(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=G[4],ze=G[5],He=G[6],ur=G[7],Ur=G[8],Xr=G[9],Wr=G[10],Tn=G[11],On=G[12],Qr=G[13],ra=G[14],Ha=G[15],Va=Et[0],Ra=Et[1],_a=Et[2],Pa=Et[3];return d[0]=Va*Gt+Ra*De+_a*Ur+Pa*On,d[1]=Va*re+Ra*ze+_a*Xr+Pa*Qr,d[2]=Va*he+Ra*He+_a*Wr+Pa*ra,d[3]=Va*ge+Ra*ur+_a*Tn+Pa*Ha,Va=Et[4],Ra=Et[5],_a=Et[6],Pa=Et[7],d[4]=Va*Gt+Ra*De+_a*Ur+Pa*On,d[5]=Va*re+Ra*ze+_a*Xr+Pa*Qr,d[6]=Va*he+Ra*He+_a*Wr+Pa*ra,d[7]=Va*ge+Ra*ur+_a*Tn+Pa*Ha,Va=Et[8],Ra=Et[9],_a=Et[10],Pa=Et[11],d[8]=Va*Gt+Ra*De+_a*Ur+Pa*On,d[9]=Va*re+Ra*ze+_a*Xr+Pa*Qr,d[10]=Va*he+Ra*He+_a*Wr+Pa*ra,d[11]=Va*ge+Ra*ur+_a*Tn+Pa*Ha,Va=Et[12],Ra=Et[13],_a=Et[14],Pa=Et[15],d[12]=Va*Gt+Ra*De+_a*Ur+Pa*On,d[13]=Va*re+Ra*ze+_a*Xr+Pa*Qr,d[14]=Va*he+Ra*He+_a*Wr+Pa*ra,d[15]=Va*ge+Ra*ur+_a*Tn+Pa*Ha,d}function gn(d,G,Et){var Gt=Et[0],re=Et[1],he=Et[2],ge,De,ze,He,ur,Ur,Xr,Wr,Tn,On,Qr,ra;return G===d?(d[12]=G[0]*Gt+G[4]*re+G[8]*he+G[12],d[13]=G[1]*Gt+G[5]*re+G[9]*he+G[13],d[14]=G[2]*Gt+G[6]*re+G[10]*he+G[14],d[15]=G[3]*Gt+G[7]*re+G[11]*he+G[15]):(ge=G[0],De=G[1],ze=G[2],He=G[3],ur=G[4],Ur=G[5],Xr=G[6],Wr=G[7],Tn=G[8],On=G[9],Qr=G[10],ra=G[11],d[0]=ge,d[1]=De,d[2]=ze,d[3]=He,d[4]=ur,d[5]=Ur,d[6]=Xr,d[7]=Wr,d[8]=Tn,d[9]=On,d[10]=Qr,d[11]=ra,d[12]=ge*Gt+ur*re+Tn*he+G[12],d[13]=De*Gt+Ur*re+On*he+G[13],d[14]=ze*Gt+Xr*re+Qr*he+G[14],d[15]=He*Gt+Wr*re+ra*he+G[15]),d}function xn(d,G,Et){var Gt=Et[0],re=Et[1],he=Et[2];return d[0]=G[0]*Gt,d[1]=G[1]*Gt,d[2]=G[2]*Gt,d[3]=G[3]*Gt,d[4]=G[4]*re,d[5]=G[5]*re,d[6]=G[6]*re,d[7]=G[7]*re,d[8]=G[8]*he,d[9]=G[9]*he,d[10]=G[10]*he,d[11]=G[11]*he,d[12]=G[12],d[13]=G[13],d[14]=G[14],d[15]=G[15],d}function Rn(d,G,Et,Gt){var re=Gt[0],he=Gt[1],ge=Gt[2],De=Math.hypot(re,he,ge),ze,He,ur,Ur,Xr,Wr,Tn,On,Qr,ra,Ha,Va,Ra,_a,Pa,Oo,Eo,go,wo,So,No,Ro,ci,Bi;return De0?(Et[0]=(De*ge+ur*Gt+ze*he-He*re)*2/Ur,Et[1]=(ze*ge+ur*re+He*Gt-De*he)*2/Ur,Et[2]=(He*ge+ur*he+De*re-ze*Gt)*2/Ur):(Et[0]=(De*ge+ur*Gt+ze*he-He*re)*2,Et[1]=(ze*ge+ur*re+He*Gt-De*he)*2,Et[2]=(He*ge+ur*he+De*re-ze*Gt)*2),Je(d,G,Et),d}function te(d,G){return d[0]=G[12],d[1]=G[13],d[2]=G[14],d}function wt(d,G){var Et=G[0],Gt=G[1],re=G[2],he=G[4],ge=G[5],De=G[6],ze=G[8],He=G[9],ur=G[10];return d[0]=Math.hypot(Et,Gt,re),d[1]=Math.hypot(he,ge,De),d[2]=Math.hypot(ze,He,ur),d}function Me(d,G){var Et=new p.ARRAY_TYPE(3);wt(Et,G);var Gt=1/Et[0],re=1/Et[1],he=1/Et[2],ge=G[0]*Gt,De=G[1]*re,ze=G[2]*he,He=G[4]*Gt,ur=G[5]*re,Ur=G[6]*he,Xr=G[8]*Gt,Wr=G[9]*re,Tn=G[10]*he,On=ge+ur+Tn,Qr=0;return On>0?(Qr=Math.sqrt(On+1)*2,d[3]=.25*Qr,d[0]=(Ur-Wr)/Qr,d[1]=(Xr-ze)/Qr,d[2]=(De-He)/Qr):ge>ur&&ge>Tn?(Qr=Math.sqrt(1+ge-ur-Tn)*2,d[3]=(Ur-Wr)/Qr,d[0]=.25*Qr,d[1]=(De+He)/Qr,d[2]=(Xr+ze)/Qr):ur>Tn?(Qr=Math.sqrt(1+ur-ge-Tn)*2,d[3]=(Xr-ze)/Qr,d[0]=(De+He)/Qr,d[1]=.25*Qr,d[2]=(Ur+Wr)/Qr):(Qr=Math.sqrt(1+Tn-ge-ur)*2,d[3]=(De-He)/Qr,d[0]=(Xr+ze)/Qr,d[1]=(Ur+Wr)/Qr,d[2]=.25*Qr),d}function kt(d,G,Et,Gt){var re=G[0],he=G[1],ge=G[2],De=G[3],ze=re+re,He=he+he,ur=ge+ge,Ur=re*ze,Xr=re*He,Wr=re*ur,Tn=he*He,On=he*ur,Qr=ge*ur,ra=De*ze,Ha=De*He,Va=De*ur,Ra=Gt[0],_a=Gt[1],Pa=Gt[2];return d[0]=(1-(Tn+Qr))*Ra,d[1]=(Xr+Va)*Ra,d[2]=(Wr-Ha)*Ra,d[3]=0,d[4]=(Xr-Va)*_a,d[5]=(1-(Ur+Qr))*_a,d[6]=(On+ra)*_a,d[7]=0,d[8]=(Wr+Ha)*Pa,d[9]=(On-ra)*Pa,d[10]=(1-(Ur+Tn))*Pa,d[11]=0,d[12]=Et[0],d[13]=Et[1],d[14]=Et[2],d[15]=1,d}function qt(d,G,Et,Gt,re){var he=G[0],ge=G[1],De=G[2],ze=G[3],He=he+he,ur=ge+ge,Ur=De+De,Xr=he*He,Wr=he*ur,Tn=he*Ur,On=ge*ur,Qr=ge*Ur,ra=De*Ur,Ha=ze*He,Va=ze*ur,Ra=ze*Ur,_a=Gt[0],Pa=Gt[1],Oo=Gt[2],Eo=re[0],go=re[1],wo=re[2],So=(1-(On+ra))*_a,No=(Wr+Ra)*_a,Ro=(Tn-Va)*_a,ci=(Wr-Ra)*Pa,Bi=(1-(Xr+ra))*Pa,Hs=(Qr+Ha)*Pa,Zs=(Tn+Va)*Oo,ps=(Qr-Ha)*Oo,Tu=(1-(Xr+On))*Oo;return d[0]=So,d[1]=No,d[2]=Ro,d[3]=0,d[4]=ci,d[5]=Bi,d[6]=Hs,d[7]=0,d[8]=Zs,d[9]=ps,d[10]=Tu,d[11]=0,d[12]=Et[0]+Eo-(So*Eo+ci*go+Zs*wo),d[13]=Et[1]+go-(No*Eo+Bi*go+ps*wo),d[14]=Et[2]+wo-(Ro*Eo+Hs*go+Tu*wo),d[15]=1,d}function dt(d,G){var Et=G[0],Gt=G[1],re=G[2],he=G[3],ge=Et+Et,De=Gt+Gt,ze=re+re,He=Et*ge,ur=Gt*ge,Ur=Gt*De,Xr=re*ge,Wr=re*De,Tn=re*ze,On=he*ge,Qr=he*De,ra=he*ze;return d[0]=1-Ur-Tn,d[1]=ur+ra,d[2]=Xr-Qr,d[3]=0,d[4]=ur-ra,d[5]=1-He-Tn,d[6]=Wr+On,d[7]=0,d[8]=Xr+Qr,d[9]=Wr-On,d[10]=1-He-Ur,d[11]=0,d[12]=0,d[13]=0,d[14]=0,d[15]=1,d}function Ut(d,G,Et,Gt,re,he,ge){var De=1/(Et-G),ze=1/(re-Gt),He=1/(he-ge);return d[0]=he*2*De,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=he*2*ze,d[6]=0,d[7]=0,d[8]=(Et+G)*De,d[9]=(re+Gt)*ze,d[10]=(ge+he)*He,d[11]=-1,d[12]=0,d[13]=0,d[14]=ge*he*2*He,d[15]=0,d}function Q(d,G,Et,Gt,re){var he=1/Math.tan(G/2),ge;return d[0]=he/Et,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=he,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[11]=-1,d[12]=0,d[13]=0,d[15]=0,re!=null&&re!==1/0?(ge=1/(Gt-re),d[10]=(re+Gt)*ge,d[14]=2*re*Gt*ge):(d[10]=-1,d[14]=-2*Gt),d}var ot=Q;function R(d,G,Et,Gt,re){var he=1/Math.tan(G/2),ge;return d[0]=he/Et,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=he,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[11]=-1,d[12]=0,d[13]=0,d[15]=0,re!=null&&re!==1/0?(ge=1/(Gt-re),d[10]=re*ge,d[14]=re*Gt*ge):(d[10]=-1,d[14]=-Gt),d}function M(d,G,Et,Gt){var re=Math.tan(G.upDegrees*Math.PI/180),he=Math.tan(G.downDegrees*Math.PI/180),ge=Math.tan(G.leftDegrees*Math.PI/180),De=Math.tan(G.rightDegrees*Math.PI/180),ze=2/(ge+De),He=2/(re+he);return d[0]=ze,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=He,d[6]=0,d[7]=0,d[8]=-((ge-De)*ze*.5),d[9]=(re-he)*He*.5,d[10]=Gt/(Et-Gt),d[11]=-1,d[12]=0,d[13]=0,d[14]=Gt*Et/(Et-Gt),d[15]=0,d}function O(d,G,Et,Gt,re,he,ge){var De=1/(G-Et),ze=1/(Gt-re),He=1/(he-ge);return d[0]=-2*De,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=-2*ze,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=2*He,d[11]=0,d[12]=(G+Et)*De,d[13]=(re+Gt)*ze,d[14]=(ge+he)*He,d[15]=1,d}var X=O;function mt(d,G,Et,Gt,re,he,ge){var De=1/(G-Et),ze=1/(Gt-re),He=1/(he-ge);return d[0]=-2*De,d[1]=0,d[2]=0,d[3]=0,d[4]=0,d[5]=-2*ze,d[6]=0,d[7]=0,d[8]=0,d[9]=0,d[10]=He,d[11]=0,d[12]=(G+Et)*De,d[13]=(re+Gt)*ze,d[14]=he*He,d[15]=1,d}function Ft(d,G,Et,Gt){var re,he,ge,De,ze,He,ur,Ur,Xr,Wr,Tn=G[0],On=G[1],Qr=G[2],ra=Gt[0],Ha=Gt[1],Va=Gt[2],Ra=Et[0],_a=Et[1],Pa=Et[2];return Math.abs(Tn-Ra)0&&(Wr=1/Math.sqrt(Wr),ur*=Wr,Ur*=Wr,Xr*=Wr);var Tn=ze*Xr-He*Ur,On=He*ur-De*Xr,Qr=De*Ur-ze*ur;return Wr=Tn*Tn+On*On+Qr*Qr,Wr>0&&(Wr=1/Math.sqrt(Wr),Tn*=Wr,On*=Wr,Qr*=Wr),d[0]=Tn,d[1]=On,d[2]=Qr,d[3]=0,d[4]=Ur*Qr-Xr*On,d[5]=Xr*Tn-ur*Qr,d[6]=ur*On-Ur*Tn,d[7]=0,d[8]=ur,d[9]=Ur,d[10]=Xr,d[11]=0,d[12]=re,d[13]=he,d[14]=ge,d[15]=1,d}function ee(d){return"mat4("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+", "+d[6]+", "+d[7]+", "+d[8]+", "+d[9]+", "+d[10]+", "+d[11]+", "+d[12]+", "+d[13]+", "+d[14]+", "+d[15]+")"}function Le(d){return Math.hypot(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],d[9],d[10],d[11],d[12],d[13],d[14],d[15])}function me(d,G,Et){return d[0]=G[0]+Et[0],d[1]=G[1]+Et[1],d[2]=G[2]+Et[2],d[3]=G[3]+Et[3],d[4]=G[4]+Et[4],d[5]=G[5]+Et[5],d[6]=G[6]+Et[6],d[7]=G[7]+Et[7],d[8]=G[8]+Et[8],d[9]=G[9]+Et[9],d[10]=G[10]+Et[10],d[11]=G[11]+Et[11],d[12]=G[12]+Et[12],d[13]=G[13]+Et[13],d[14]=G[14]+Et[14],d[15]=G[15]+Et[15],d}function Xe(d,G,Et){return d[0]=G[0]-Et[0],d[1]=G[1]-Et[1],d[2]=G[2]-Et[2],d[3]=G[3]-Et[3],d[4]=G[4]-Et[4],d[5]=G[5]-Et[5],d[6]=G[6]-Et[6],d[7]=G[7]-Et[7],d[8]=G[8]-Et[8],d[9]=G[9]-Et[9],d[10]=G[10]-Et[10],d[11]=G[11]-Et[11],d[12]=G[12]-Et[12],d[13]=G[13]-Et[13],d[14]=G[14]-Et[14],d[15]=G[15]-Et[15],d}function pr(d,G,Et){return d[0]=G[0]*Et,d[1]=G[1]*Et,d[2]=G[2]*Et,d[3]=G[3]*Et,d[4]=G[4]*Et,d[5]=G[5]*Et,d[6]=G[6]*Et,d[7]=G[7]*Et,d[8]=G[8]*Et,d[9]=G[9]*Et,d[10]=G[10]*Et,d[11]=G[11]*Et,d[12]=G[12]*Et,d[13]=G[13]*Et,d[14]=G[14]*Et,d[15]=G[15]*Et,d}function Ze(d,G,Et,Gt){return d[0]=G[0]+Et[0]*Gt,d[1]=G[1]+Et[1]*Gt,d[2]=G[2]+Et[2]*Gt,d[3]=G[3]+Et[3]*Gt,d[4]=G[4]+Et[4]*Gt,d[5]=G[5]+Et[5]*Gt,d[6]=G[6]+Et[6]*Gt,d[7]=G[7]+Et[7]*Gt,d[8]=G[8]+Et[8]*Gt,d[9]=G[9]+Et[9]*Gt,d[10]=G[10]+Et[10]*Gt,d[11]=G[11]+Et[11]*Gt,d[12]=G[12]+Et[12]*Gt,d[13]=G[13]+Et[13]*Gt,d[14]=G[14]+Et[14]*Gt,d[15]=G[15]+Et[15]*Gt,d}function Pr(d,G){return d[0]===G[0]&&d[1]===G[1]&&d[2]===G[2]&&d[3]===G[3]&&d[4]===G[4]&&d[5]===G[5]&&d[6]===G[6]&&d[7]===G[7]&&d[8]===G[8]&&d[9]===G[9]&&d[10]===G[10]&&d[11]===G[11]&&d[12]===G[12]&&d[13]===G[13]&&d[14]===G[14]&&d[15]===G[15]}function un(d,G){var Et=d[0],Gt=d[1],re=d[2],he=d[3],ge=d[4],De=d[5],ze=d[6],He=d[7],ur=d[8],Ur=d[9],Xr=d[10],Wr=d[11],Tn=d[12],On=d[13],Qr=d[14],ra=d[15],Ha=G[0],Va=G[1],Ra=G[2],_a=G[3],Pa=G[4],Oo=G[5],Eo=G[6],go=G[7],wo=G[8],So=G[9],No=G[10],Ro=G[11],ci=G[12],Bi=G[13],Hs=G[14],Zs=G[15];return Math.abs(Et-Ha)<=p.EPSILON*Math.max(1,Math.abs(Et),Math.abs(Ha))&&Math.abs(Gt-Va)<=p.EPSILON*Math.max(1,Math.abs(Gt),Math.abs(Va))&&Math.abs(re-Ra)<=p.EPSILON*Math.max(1,Math.abs(re),Math.abs(Ra))&&Math.abs(he-_a)<=p.EPSILON*Math.max(1,Math.abs(he),Math.abs(_a))&&Math.abs(ge-Pa)<=p.EPSILON*Math.max(1,Math.abs(ge),Math.abs(Pa))&&Math.abs(De-Oo)<=p.EPSILON*Math.max(1,Math.abs(De),Math.abs(Oo))&&Math.abs(ze-Eo)<=p.EPSILON*Math.max(1,Math.abs(ze),Math.abs(Eo))&&Math.abs(He-go)<=p.EPSILON*Math.max(1,Math.abs(He),Math.abs(go))&&Math.abs(ur-wo)<=p.EPSILON*Math.max(1,Math.abs(ur),Math.abs(wo))&&Math.abs(Ur-So)<=p.EPSILON*Math.max(1,Math.abs(Ur),Math.abs(So))&&Math.abs(Xr-No)<=p.EPSILON*Math.max(1,Math.abs(Xr),Math.abs(No))&&Math.abs(Wr-Ro)<=p.EPSILON*Math.max(1,Math.abs(Wr),Math.abs(Ro))&&Math.abs(Tn-ci)<=p.EPSILON*Math.max(1,Math.abs(Tn),Math.abs(ci))&&Math.abs(On-Bi)<=p.EPSILON*Math.max(1,Math.abs(On),Math.abs(Bi))&&Math.abs(Qr-Hs)<=p.EPSILON*Math.max(1,Math.abs(Qr),Math.abs(Hs))&&Math.abs(ra-Zs)<=p.EPSILON*Math.max(1,Math.abs(ra),Math.abs(Zs))}var Ke=qr,lr=Xe,Rr=C(277160);function Dr(){var d=new p.ARRAY_TYPE(4);return p.ARRAY_TYPE!=Float32Array&&(d[0]=0,d[1]=0,d[2]=0,d[3]=0),d}function ce(d){var G=new p.ARRAY_TYPE(4);return G[0]=d[0],G[1]=d[1],G[2]=d[2],G[3]=d[3],G}function jt(d,G,Et,Gt){var re=new p.ARRAY_TYPE(4);return re[0]=d,re[1]=G,re[2]=Et,re[3]=Gt,re}function pe(d,G){return d[0]=G[0],d[1]=G[1],d[2]=G[2],d[3]=G[3],d}function Oe(d,G,Et,Gt,re){return d[0]=G,d[1]=Et,d[2]=Gt,d[3]=re,d}function Se(d,G,Et){return d[0]=G[0]+Et[0],d[1]=G[1]+Et[1],d[2]=G[2]+Et[2],d[3]=G[3]+Et[3],d}function Fe(d,G,Et){return d[0]=G[0]-Et[0],d[1]=G[1]-Et[1],d[2]=G[2]-Et[2],d[3]=G[3]-Et[3],d}function or(d,G,Et){return d[0]=G[0]*Et[0],d[1]=G[1]*Et[1],d[2]=G[2]*Et[2],d[3]=G[3]*Et[3],d}function gr(d,G,Et){return d[0]=G[0]/Et[0],d[1]=G[1]/Et[1],d[2]=G[2]/Et[2],d[3]=G[3]/Et[3],d}function Jr(d,G){return d[0]=Math.ceil(G[0]),d[1]=Math.ceil(G[1]),d[2]=Math.ceil(G[2]),d[3]=Math.ceil(G[3]),d}function Gn(d,G){return d[0]=Math.floor(G[0]),d[1]=Math.floor(G[1]),d[2]=Math.floor(G[2]),d[3]=Math.floor(G[3]),d}function pn(d,G,Et){return d[0]=Math.min(G[0],Et[0]),d[1]=Math.min(G[1],Et[1]),d[2]=Math.min(G[2],Et[2]),d[3]=Math.min(G[3],Et[3]),d}function qn(d,G,Et){return d[0]=Math.max(G[0],Et[0]),d[1]=Math.max(G[1],Et[1]),d[2]=Math.max(G[2],Et[2]),d[3]=Math.max(G[3],Et[3]),d}function ln(d,G){return d[0]=Math.round(G[0]),d[1]=Math.round(G[1]),d[2]=Math.round(G[2]),d[3]=Math.round(G[3]),d}function Vn(d,G,Et){return d[0]=G[0]*Et,d[1]=G[1]*Et,d[2]=G[2]*Et,d[3]=G[3]*Et,d}function ca(d,G,Et,Gt){return d[0]=G[0]+Et[0]*Gt,d[1]=G[1]+Et[1]*Gt,d[2]=G[2]+Et[2]*Gt,d[3]=G[3]+Et[3]*Gt,d}function ba(d,G){var Et=G[0]-d[0],Gt=G[1]-d[1],re=G[2]-d[2],he=G[3]-d[3];return Math.hypot(Et,Gt,re,he)}function Ea(d,G){var Et=G[0]-d[0],Gt=G[1]-d[1],re=G[2]-d[2],he=G[3]-d[3];return Et*Et+Gt*Gt+re*re+he*he}function Ni(d){var G=d[0],Et=d[1],Gt=d[2],re=d[3];return Math.hypot(G,Et,Gt,re)}function ti(d){var G=d[0],Et=d[1],Gt=d[2],re=d[3];return G*G+Et*Et+Gt*Gt+re*re}function ei(d,G){return d[0]=-G[0],d[1]=-G[1],d[2]=-G[2],d[3]=-G[3],d}function wi(d,G){return d[0]=1/G[0],d[1]=1/G[1],d[2]=1/G[2],d[3]=1/G[3],d}function Gi(d,G){var Et=G[0],Gt=G[1],re=G[2],he=G[3],ge=Et*Et+Gt*Gt+re*re+he*he;return ge>0&&(ge=1/Math.sqrt(ge)),d[0]=Et*ge,d[1]=Gt*ge,d[2]=re*ge,d[3]=he*ge,d}function Co(d,G){return d[0]*G[0]+d[1]*G[1]+d[2]*G[2]+d[3]*G[3]}function eo(d,G,Et,Gt){var re=Et[0]*Gt[1]-Et[1]*Gt[0],he=Et[0]*Gt[2]-Et[2]*Gt[0],ge=Et[0]*Gt[3]-Et[3]*Gt[0],De=Et[1]*Gt[2]-Et[2]*Gt[1],ze=Et[1]*Gt[3]-Et[3]*Gt[1],He=Et[2]*Gt[3]-Et[3]*Gt[2],ur=G[0],Ur=G[1],Xr=G[2],Wr=G[3];return d[0]=Ur*He-Xr*ze+Wr*De,d[1]=-(ur*He)+Xr*ge-Wr*he,d[2]=ur*ze-Ur*ge+Wr*re,d[3]=-(ur*De)+Ur*he-Xr*re,d}function ga(d,G,Et,Gt){var re=G[0],he=G[1],ge=G[2],De=G[3];return d[0]=re+Gt*(Et[0]-re),d[1]=he+Gt*(Et[1]-he),d[2]=ge+Gt*(Et[2]-ge),d[3]=De+Gt*(Et[3]-De),d}function lo(d,G){G=G||1;var Et,Gt,re,he,ge,De;do Et=p.RANDOM()*2-1,Gt=p.RANDOM()*2-1,ge=Et*Et+Gt*Gt;while(ge>=1);do re=p.RANDOM()*2-1,he=p.RANDOM()*2-1,De=re*re+he*he;while(De>=1);var ze=Math.sqrt((1-ge)/De);return d[0]=G*Et,d[1]=G*Gt,d[2]=G*re*ze,d[3]=G*he*ze,d}function To(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3];return d[0]=Et[0]*Gt+Et[4]*re+Et[8]*he+Et[12]*ge,d[1]=Et[1]*Gt+Et[5]*re+Et[9]*he+Et[13]*ge,d[2]=Et[2]*Gt+Et[6]*re+Et[10]*he+Et[14]*ge,d[3]=Et[3]*Gt+Et[7]*re+Et[11]*he+Et[15]*ge,d}function ni(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=Et[0],De=Et[1],ze=Et[2],He=Et[3],ur=He*Gt+De*he-ze*re,Ur=He*re+ze*Gt-ge*he,Xr=He*he+ge*re-De*Gt,Wr=-ge*Gt-De*re-ze*he;return d[0]=ur*He+Wr*-ge+Ur*-ze-Xr*-De,d[1]=Ur*He+Wr*-De+Xr*-ge-ur*-ze,d[2]=Xr*He+Wr*-ze+ur*-De-Ur*-ge,d[3]=G[3],d}function Ri(d){return d[0]=0,d[1]=0,d[2]=0,d[3]=0,d}function ho(d){return"vec4("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+")"}function Po(d,G){return d[0]===G[0]&&d[1]===G[1]&&d[2]===G[2]&&d[3]===G[3]}function ro(d,G){var Et=d[0],Gt=d[1],re=d[2],he=d[3],ge=G[0],De=G[1],ze=G[2],He=G[3];return Math.abs(Et-ge)<=p.EPSILON*Math.max(1,Math.abs(Et),Math.abs(ge))&&Math.abs(Gt-De)<=p.EPSILON*Math.max(1,Math.abs(Gt),Math.abs(De))&&Math.abs(re-ze)<=p.EPSILON*Math.max(1,Math.abs(re),Math.abs(ze))&&Math.abs(he-He)<=p.EPSILON*Math.max(1,Math.abs(he),Math.abs(He))}var no=Fe,es=or,vo=gr,Si=ba,ao=Ea,Jo=Ni,Yt=ti,de=function(){var d=Dr();return function(G,Et,Gt,re,he,ge){var De,ze;for(Et||(Et=4),Gt||(Gt=0),re?ze=Math.min(re*Et+Gt,G.length):ze=G.length,De=Gt;Dep.EPSILON?(d[0]=G[0]/Gt,d[1]=G[1]/Gt,d[2]=G[2]/Gt):(d[0]=1,d[1]=0,d[2]=0),Et}function Sr(d,G){var Et=Wi(d,G);return Math.acos(2*Et*Et-1)}function en(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=Et[0],ze=Et[1],He=Et[2],ur=Et[3];return d[0]=Gt*ur+ge*De+re*He-he*ze,d[1]=re*ur+ge*ze+he*De-Gt*He,d[2]=he*ur+ge*He+Gt*ze-re*De,d[3]=ge*ur-Gt*De-re*ze-he*He,d}function fn(d,G,Et){Et*=.5;var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=Math.sin(Et),ze=Math.cos(Et);return d[0]=Gt*ze+ge*De,d[1]=re*ze+he*De,d[2]=he*ze-re*De,d[3]=ge*ze-Gt*De,d}function Pn(d,G,Et){Et*=.5;var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=Math.sin(Et),ze=Math.cos(Et);return d[0]=Gt*ze-he*De,d[1]=re*ze+ge*De,d[2]=he*ze+Gt*De,d[3]=ge*ze-re*De,d}function sa(d,G,Et){Et*=.5;var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=Math.sin(Et),ze=Math.cos(Et);return d[0]=Gt*ze+re*De,d[1]=re*ze-Gt*De,d[2]=he*ze+ge*De,d[3]=ge*ze-he*De,d}function Zn(d,G){var Et=G[0],Gt=G[1],re=G[2];return d[0]=Et,d[1]=Gt,d[2]=re,d[3]=Math.sqrt(Math.abs(1-Et*Et-Gt*Gt-re*re)),d}function pa(d,G){var Et=G[0],Gt=G[1],re=G[2],he=G[3],ge=Math.sqrt(Et*Et+Gt*Gt+re*re),De=Math.exp(he),ze=ge>0?De*Math.sin(ge)/ge:0;return d[0]=Et*ze,d[1]=Gt*ze,d[2]=re*ze,d[3]=De*Math.cos(ge),d}function ya(d,G){var Et=G[0],Gt=G[1],re=G[2],he=G[3],ge=Math.sqrt(Et*Et+Gt*Gt+re*re),De=ge>0?Math.atan2(ge,he)/ge:0;return d[0]=Et*De,d[1]=Gt*De,d[2]=re*De,d[3]=.5*Math.log(Et*Et+Gt*Gt+re*re+he*he),d}function di(d,G,Et){return ya(d,G),po(d,d,Et),pa(d,d),d}function Ma(d,G,Et,Gt){var re=G[0],he=G[1],ge=G[2],De=G[3],ze=Et[0],He=Et[1],ur=Et[2],Ur=Et[3],Xr,Wr,Tn,On,Qr;return Wr=re*ze+he*He+ge*ur+De*Ur,Wr<0&&(Wr=-Wr,ze=-ze,He=-He,ur=-ur,Ur=-Ur),1-Wr>p.EPSILON?(Xr=Math.acos(Wr),Tn=Math.sin(Xr),On=Math.sin((1-Gt)*Xr)/Tn,Qr=Math.sin(Gt*Xr)/Tn):(On=1-Gt,Qr=Gt),d[0]=On*re+Qr*ze,d[1]=On*he+Qr*He,d[2]=On*ge+Qr*ur,d[3]=On*De+Qr*Ur,d}function oa(d){var G=p.RANDOM(),Et=p.RANDOM(),Gt=p.RANDOM(),re=Math.sqrt(1-G),he=Math.sqrt(G);return d[0]=re*Math.sin(2*Math.PI*Et),d[1]=re*Math.cos(2*Math.PI*Et),d[2]=he*Math.sin(2*Math.PI*Gt),d[3]=he*Math.cos(2*Math.PI*Gt),d}function si(d,G){var Et=G[0],Gt=G[1],re=G[2],he=G[3],ge=Et*Et+Gt*Gt+re*re+he*he,De=ge?1/ge:0;return d[0]=-Et*De,d[1]=-Gt*De,d[2]=-re*De,d[3]=he*De,d}function $a(d,G){return d[0]=-G[0],d[1]=-G[1],d[2]=-G[2],d[3]=G[3],d}function Fa(d,G){var Et=G[0]+G[4]+G[8],Gt;if(Et>0)Gt=Math.sqrt(Et+1),d[3]=.5*Gt,Gt=.5/Gt,d[0]=(G[5]-G[7])*Gt,d[1]=(G[6]-G[2])*Gt,d[2]=(G[1]-G[3])*Gt;else{var re=0;G[4]>G[0]&&(re=1),G[8]>G[re*3+re]&&(re=2);var he=(re+1)%3,ge=(re+2)%3;Gt=Math.sqrt(G[re*3+re]-G[he*3+he]-G[ge*3+ge]+1),d[re]=.5*Gt,Gt=.5/Gt,d[3]=(G[he*3+ge]-G[ge*3+he])*Gt,d[he]=(G[he*3+re]+G[re*3+he])*Gt,d[ge]=(G[ge*3+re]+G[re*3+ge])*Gt}return d}function Ui(d,G,Et,Gt){var re=.5*Math.PI/180;G*=re,Et*=re,Gt*=re;var he=Math.sin(G),ge=Math.cos(G),De=Math.sin(Et),ze=Math.cos(Et),He=Math.sin(Gt),ur=Math.cos(Gt);return d[0]=he*ze*ur-ge*De*He,d[1]=ge*De*ur+he*ze*He,d[2]=ge*ze*He-he*De*ur,d[3]=ge*ze*ur+he*De*He,d}function fi(d){return"quat("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+")"}var La=ce,ja=jt,za=pe,yi=Oe,mi=Se,ki=en,po=Vn,Wi=Co,Ao=ga,Vo=Ni,os=Vo,$i=ti,qa=$i,Yi=Gi,io=Po,Qa=ro,Pi=function(){var d=Rr.create(),G=Rr.fromValues(1,0,0),Et=Rr.fromValues(0,1,0);return function(Gt,re,he){var ge=Rr.dot(re,he);return ge<-.999999?(Rr.cross(d,G,re),Rr.len(d)<1e-6&&Rr.cross(d,Et,re),Rr.normalize(d,d),Lr(Gt,d,Math.PI),Gt):ge>.999999?(Gt[0]=0,Gt[1]=0,Gt[2]=0,Gt[3]=1,Gt):(Rr.cross(d,re,he),Gt[0]=d[0],Gt[1]=d[1],Gt[2]=d[2],Gt[3]=1+ge,Yi(Gt,Gt))}}(),zo=function(){var d=Ge(),G=Ge();return function(Et,Gt,re,he,ge,De){return Ma(d,Gt,ge,De),Ma(G,re,he,De),Ma(Et,d,G,2*De*(1-De)),Et}}(),qi=function(){var d=Ar.create();return function(G,Et,Gt,re){return d[0]=Gt[0],d[3]=Gt[1],d[6]=Gt[2],d[1]=re[0],d[4]=re[1],d[7]=re[2],d[2]=-Et[0],d[5]=-Et[1],d[8]=-Et[2],Yi(G,Fa(G,d))}}();function rs(){var d=new p.ARRAY_TYPE(8);return p.ARRAY_TYPE!=Float32Array&&(d[0]=0,d[1]=0,d[2]=0,d[4]=0,d[5]=0,d[6]=0,d[7]=0),d[3]=1,d}function Xi(d){var G=new p.ARRAY_TYPE(8);return G[0]=d[0],G[1]=d[1],G[2]=d[2],G[3]=d[3],G[4]=d[4],G[5]=d[5],G[6]=d[6],G[7]=d[7],G}function yo(d,G,Et,Gt,re,he,ge,De){var ze=new p.ARRAY_TYPE(8);return ze[0]=d,ze[1]=G,ze[2]=Et,ze[3]=Gt,ze[4]=re,ze[5]=he,ze[6]=ge,ze[7]=De,ze}function Es(d,G,Et,Gt,re,he,ge){var De=new p.ARRAY_TYPE(8);De[0]=d,De[1]=G,De[2]=Et,De[3]=Gt;var ze=re*.5,He=he*.5,ur=ge*.5;return De[4]=ze*Gt+He*Et-ur*G,De[5]=He*Gt+ur*d-ze*Et,De[6]=ur*Gt+ze*G-He*d,De[7]=-ze*d-He*G-ur*Et,De}function ds(d,G,Et){var Gt=Et[0]*.5,re=Et[1]*.5,he=Et[2]*.5,ge=G[0],De=G[1],ze=G[2],He=G[3];return d[0]=ge,d[1]=De,d[2]=ze,d[3]=He,d[4]=Gt*He+re*ze-he*De,d[5]=re*He+he*ge-Gt*ze,d[6]=he*He+Gt*De-re*ge,d[7]=-Gt*ge-re*De-he*ze,d}function oo(d,G){return d[0]=0,d[1]=0,d[2]=0,d[3]=1,d[4]=G[0]*.5,d[5]=G[1]*.5,d[6]=G[2]*.5,d[7]=0,d}function ls(d,G){return d[0]=G[0],d[1]=G[1],d[2]=G[2],d[3]=G[3],d[4]=0,d[5]=0,d[6]=0,d[7]=0,d}function hs(d,G){var Et=Ge();Me(Et,G);var Gt=new p.ARRAY_TYPE(3);return te(Gt,G),ds(d,Et,Gt),d}function Os(d,G){return d[0]=G[0],d[1]=G[1],d[2]=G[2],d[3]=G[3],d[4]=G[4],d[5]=G[5],d[6]=G[6],d[7]=G[7],d}function Ho(d){return d[0]=0,d[1]=0,d[2]=0,d[3]=1,d[4]=0,d[5]=0,d[6]=0,d[7]=0,d}function $t(d,G,Et,Gt,re,he,ge,De,ze){return d[0]=G,d[1]=Et,d[2]=Gt,d[3]=re,d[4]=he,d[5]=ge,d[6]=De,d[7]=ze,d}var ye=za;function ir(d,G){return d[0]=G[4],d[1]=G[5],d[2]=G[6],d[3]=G[7],d}var dr=za;function Zr(d,G){return d[4]=G[0],d[5]=G[1],d[6]=G[2],d[7]=G[3],d}function Ln(d,G){var Et=G[4],Gt=G[5],re=G[6],he=G[7],ge=-G[0],De=-G[1],ze=-G[2],He=G[3];return d[0]=(Et*He+he*ge+Gt*ze-re*De)*2,d[1]=(Gt*He+he*De+re*ge-Et*ze)*2,d[2]=(re*He+he*ze+Et*De-Gt*ge)*2,d}function Qn(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=Et[0]*.5,ze=Et[1]*.5,He=Et[2]*.5,ur=G[4],Ur=G[5],Xr=G[6],Wr=G[7];return d[0]=Gt,d[1]=re,d[2]=he,d[3]=ge,d[4]=ge*De+re*He-he*ze+ur,d[5]=ge*ze+he*De-Gt*He+Ur,d[6]=ge*He+Gt*ze-re*De+Xr,d[7]=-Gt*De-re*ze-he*He+Wr,d}function Sa(d,G,Et){var Gt=-G[0],re=-G[1],he=-G[2],ge=G[3],De=G[4],ze=G[5],He=G[6],ur=G[7],Ur=De*ge+ur*Gt+ze*he-He*re,Xr=ze*ge+ur*re+He*Gt-De*he,Wr=He*ge+ur*he+De*re-ze*Gt,Tn=ur*ge-De*Gt-ze*re-He*he;return fn(d,G,Et),Gt=d[0],re=d[1],he=d[2],ge=d[3],d[4]=Ur*ge+Tn*Gt+Xr*he-Wr*re,d[5]=Xr*ge+Tn*re+Wr*Gt-Ur*he,d[6]=Wr*ge+Tn*he+Ur*re-Xr*Gt,d[7]=Tn*ge-Ur*Gt-Xr*re-Wr*he,d}function Ci(d,G,Et){var Gt=-G[0],re=-G[1],he=-G[2],ge=G[3],De=G[4],ze=G[5],He=G[6],ur=G[7],Ur=De*ge+ur*Gt+ze*he-He*re,Xr=ze*ge+ur*re+He*Gt-De*he,Wr=He*ge+ur*he+De*re-ze*Gt,Tn=ur*ge-De*Gt-ze*re-He*he;return Pn(d,G,Et),Gt=d[0],re=d[1],he=d[2],ge=d[3],d[4]=Ur*ge+Tn*Gt+Xr*he-Wr*re,d[5]=Xr*ge+Tn*re+Wr*Gt-Ur*he,d[6]=Wr*ge+Tn*he+Ur*re-Xr*Gt,d[7]=Tn*ge-Ur*Gt-Xr*re-Wr*he,d}function Io(d,G,Et){var Gt=-G[0],re=-G[1],he=-G[2],ge=G[3],De=G[4],ze=G[5],He=G[6],ur=G[7],Ur=De*ge+ur*Gt+ze*he-He*re,Xr=ze*ge+ur*re+He*Gt-De*he,Wr=He*ge+ur*he+De*re-ze*Gt,Tn=ur*ge-De*Gt-ze*re-He*he;return sa(d,G,Et),Gt=d[0],re=d[1],he=d[2],ge=d[3],d[4]=Ur*ge+Tn*Gt+Xr*he-Wr*re,d[5]=Xr*ge+Tn*re+Wr*Gt-Ur*he,d[6]=Wr*ge+Tn*he+Ur*re-Xr*Gt,d[7]=Tn*ge-Ur*Gt-Xr*re-Wr*he,d}function Go(d,G,Et){var Gt=Et[0],re=Et[1],he=Et[2],ge=Et[3],De=G[0],ze=G[1],He=G[2],ur=G[3];return d[0]=De*ge+ur*Gt+ze*he-He*re,d[1]=ze*ge+ur*re+He*Gt-De*he,d[2]=He*ge+ur*he+De*re-ze*Gt,d[3]=ur*ge-De*Gt-ze*re-He*he,De=G[4],ze=G[5],He=G[6],ur=G[7],d[4]=De*ge+ur*Gt+ze*he-He*re,d[5]=ze*ge+ur*re+He*Gt-De*he,d[6]=He*ge+ur*he+De*re-ze*Gt,d[7]=ur*ge-De*Gt-ze*re-He*he,d}function zs(d,G,Et){var Gt=G[0],re=G[1],he=G[2],ge=G[3],De=Et[0],ze=Et[1],He=Et[2],ur=Et[3];return d[0]=Gt*ur+ge*De+re*He-he*ze,d[1]=re*ur+ge*ze+he*De-Gt*He,d[2]=he*ur+ge*He+Gt*ze-re*De,d[3]=ge*ur-Gt*De-re*ze-he*He,De=Et[4],ze=Et[5],He=Et[6],ur=Et[7],d[4]=Gt*ur+ge*De+re*He-he*ze,d[5]=re*ur+ge*ze+he*De-Gt*He,d[6]=he*ur+ge*He+Gt*ze-re*De,d[7]=ge*ur-Gt*De-re*ze-he*He,d}function Ds(d,G,Et,Gt){if(Math.abs(Gt)0){Et=Math.sqrt(Et);var Gt=G[0]/Et,re=G[1]/Et,he=G[2]/Et,ge=G[3]/Et,De=G[4],ze=G[5],He=G[6],ur=G[7],Ur=Gt*De+re*ze+he*He+ge*ur;d[0]=Gt,d[1]=re,d[2]=he,d[3]=ge,d[4]=(De-Gt*Ur)/Et,d[5]=(ze-re*Ur)/Et,d[6]=(He-he*Ur)/Et,d[7]=(ur-ge*Ur)/Et}return d}function Cu(d){return"quat2("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+", "+d[6]+", "+d[7]+")"}function Uo(d,G){return d[0]===G[0]&&d[1]===G[1]&&d[2]===G[2]&&d[3]===G[3]&&d[4]===G[4]&&d[5]===G[5]&&d[6]===G[6]&&d[7]===G[7]}function bo(d,G){var Et=d[0],Gt=d[1],re=d[2],he=d[3],ge=d[4],De=d[5],ze=d[6],He=d[7],ur=G[0],Ur=G[1],Xr=G[2],Wr=G[3],Tn=G[4],On=G[5],Qr=G[6],ra=G[7];return Math.abs(Et-ur)<=p.EPSILON*Math.max(1,Math.abs(Et),Math.abs(ur))&&Math.abs(Gt-Ur)<=p.EPSILON*Math.max(1,Math.abs(Gt),Math.abs(Ur))&&Math.abs(re-Xr)<=p.EPSILON*Math.max(1,Math.abs(re),Math.abs(Xr))&&Math.abs(he-Wr)<=p.EPSILON*Math.max(1,Math.abs(he),Math.abs(Wr))&&Math.abs(ge-Tn)<=p.EPSILON*Math.max(1,Math.abs(ge),Math.abs(Tn))&&Math.abs(De-On)<=p.EPSILON*Math.max(1,Math.abs(De),Math.abs(On))&&Math.abs(ze-Qr)<=p.EPSILON*Math.max(1,Math.abs(ze),Math.abs(Qr))&&Math.abs(He-ra)<=p.EPSILON*Math.max(1,Math.abs(He),Math.abs(ra))}var ss=C(631437)},935600:function(Ve,z,C){"use strict";C.r(z),C.d(z,{add:function(){return rt},adjoint:function(){return g},clone:function(){return T},copy:function(){return L},create:function(){return k},determinant:function(){return A},equals:function(){return Xt},exactEquals:function(){return gt},frob:function(){return tt},fromMat2d:function(){return U},fromMat4:function(){return w},fromQuat:function(){return W},fromRotation:function(){return h},fromScaling:function(){return $},fromTranslation:function(){return b},fromValues:function(){return P},identity:function(){return m},invert:function(){return y},mul:function(){return Ct},multiply:function(){return E},multiplyScalar:function(){return it},multiplyScalarAndAdd:function(){return bt},normalFromMat4:function(){return V},projection:function(){return H},rotate:function(){return F},scale:function(){return Y},set:function(){return p},str:function(){return q},sub:function(){return At},subtract:function(){return ft},translate:function(){return D},transpose:function(){return S}});var x=C(73633);function k(){var Z=new x.ARRAY_TYPE(9);return x.ARRAY_TYPE!=Float32Array&&(Z[1]=0,Z[2]=0,Z[3]=0,Z[5]=0,Z[6]=0,Z[7]=0),Z[0]=1,Z[4]=1,Z[8]=1,Z}function w(Z,J){return Z[0]=J[0],Z[1]=J[1],Z[2]=J[2],Z[3]=J[4],Z[4]=J[5],Z[5]=J[6],Z[6]=J[8],Z[7]=J[9],Z[8]=J[10],Z}function T(Z){var J=new x.ARRAY_TYPE(9);return J[0]=Z[0],J[1]=Z[1],J[2]=Z[2],J[3]=Z[3],J[4]=Z[4],J[5]=Z[5],J[6]=Z[6],J[7]=Z[7],J[8]=Z[8],J}function L(Z,J){return Z[0]=J[0],Z[1]=J[1],Z[2]=J[2],Z[3]=J[3],Z[4]=J[4],Z[5]=J[5],Z[6]=J[6],Z[7]=J[7],Z[8]=J[8],Z}function P(Z,J,yt,_t,nt,vt,It,Pt,St){var Dt=new x.ARRAY_TYPE(9);return Dt[0]=Z,Dt[1]=J,Dt[2]=yt,Dt[3]=_t,Dt[4]=nt,Dt[5]=vt,Dt[6]=It,Dt[7]=Pt,Dt[8]=St,Dt}function p(Z,J,yt,_t,nt,vt,It,Pt,St,Dt){return Z[0]=J,Z[1]=yt,Z[2]=_t,Z[3]=nt,Z[4]=vt,Z[5]=It,Z[6]=Pt,Z[7]=St,Z[8]=Dt,Z}function m(Z){return Z[0]=1,Z[1]=0,Z[2]=0,Z[3]=0,Z[4]=1,Z[5]=0,Z[6]=0,Z[7]=0,Z[8]=1,Z}function S(Z,J){if(Z===J){var yt=J[1],_t=J[2],nt=J[5];Z[1]=J[3],Z[2]=J[6],Z[3]=yt,Z[5]=J[7],Z[6]=_t,Z[7]=nt}else Z[0]=J[0],Z[1]=J[3],Z[2]=J[6],Z[3]=J[1],Z[4]=J[4],Z[5]=J[7],Z[6]=J[2],Z[7]=J[5],Z[8]=J[8];return Z}function y(Z,J){var yt=J[0],_t=J[1],nt=J[2],vt=J[3],It=J[4],Pt=J[5],St=J[6],Dt=J[7],Qt=J[8],ue=Qt*It-Pt*Dt,ie=-Qt*vt+Pt*St,Lt=Dt*vt-It*St,ne=yt*ue+_t*ie+nt*Lt;return ne?(ne=1/ne,Z[0]=ue*ne,Z[1]=(-Qt*_t+nt*Dt)*ne,Z[2]=(Pt*_t-nt*It)*ne,Z[3]=ie*ne,Z[4]=(Qt*yt-nt*St)*ne,Z[5]=(-Pt*yt+nt*vt)*ne,Z[6]=Lt*ne,Z[7]=(-Dt*yt+_t*St)*ne,Z[8]=(It*yt-_t*vt)*ne,Z):null}function g(Z,J){var yt=J[0],_t=J[1],nt=J[2],vt=J[3],It=J[4],Pt=J[5],St=J[6],Dt=J[7],Qt=J[8];return Z[0]=It*Qt-Pt*Dt,Z[1]=nt*Dt-_t*Qt,Z[2]=_t*Pt-nt*It,Z[3]=Pt*St-vt*Qt,Z[4]=yt*Qt-nt*St,Z[5]=nt*vt-yt*Pt,Z[6]=vt*Dt-It*St,Z[7]=_t*St-yt*Dt,Z[8]=yt*It-_t*vt,Z}function A(Z){var J=Z[0],yt=Z[1],_t=Z[2],nt=Z[3],vt=Z[4],It=Z[5],Pt=Z[6],St=Z[7],Dt=Z[8];return J*(Dt*vt-It*St)+yt*(-Dt*nt+It*Pt)+_t*(St*nt-vt*Pt)}function E(Z,J,yt){var _t=J[0],nt=J[1],vt=J[2],It=J[3],Pt=J[4],St=J[5],Dt=J[6],Qt=J[7],ue=J[8],ie=yt[0],Lt=yt[1],ne=yt[2],ve=yt[3],Wt=yt[4],ae=yt[5],Ce=yt[6],xe=yt[7],Jt=yt[8];return Z[0]=ie*_t+Lt*It+ne*Dt,Z[1]=ie*nt+Lt*Pt+ne*Qt,Z[2]=ie*vt+Lt*St+ne*ue,Z[3]=ve*_t+Wt*It+ae*Dt,Z[4]=ve*nt+Wt*Pt+ae*Qt,Z[5]=ve*vt+Wt*St+ae*ue,Z[6]=Ce*_t+xe*It+Jt*Dt,Z[7]=Ce*nt+xe*Pt+Jt*Qt,Z[8]=Ce*vt+xe*St+Jt*ue,Z}function D(Z,J,yt){var _t=J[0],nt=J[1],vt=J[2],It=J[3],Pt=J[4],St=J[5],Dt=J[6],Qt=J[7],ue=J[8],ie=yt[0],Lt=yt[1];return Z[0]=_t,Z[1]=nt,Z[2]=vt,Z[3]=It,Z[4]=Pt,Z[5]=St,Z[6]=ie*_t+Lt*It+Dt,Z[7]=ie*nt+Lt*Pt+Qt,Z[8]=ie*vt+Lt*St+ue,Z}function F(Z,J,yt){var _t=J[0],nt=J[1],vt=J[2],It=J[3],Pt=J[4],St=J[5],Dt=J[6],Qt=J[7],ue=J[8],ie=Math.sin(yt),Lt=Math.cos(yt);return Z[0]=Lt*_t+ie*It,Z[1]=Lt*nt+ie*Pt,Z[2]=Lt*vt+ie*St,Z[3]=Lt*It-ie*_t,Z[4]=Lt*Pt-ie*nt,Z[5]=Lt*St-ie*vt,Z[6]=Dt,Z[7]=Qt,Z[8]=ue,Z}function Y(Z,J,yt){var _t=yt[0],nt=yt[1];return Z[0]=_t*J[0],Z[1]=_t*J[1],Z[2]=_t*J[2],Z[3]=nt*J[3],Z[4]=nt*J[4],Z[5]=nt*J[5],Z[6]=J[6],Z[7]=J[7],Z[8]=J[8],Z}function b(Z,J){return Z[0]=1,Z[1]=0,Z[2]=0,Z[3]=0,Z[4]=1,Z[5]=0,Z[6]=J[0],Z[7]=J[1],Z[8]=1,Z}function h(Z,J){var yt=Math.sin(J),_t=Math.cos(J);return Z[0]=_t,Z[1]=yt,Z[2]=0,Z[3]=-yt,Z[4]=_t,Z[5]=0,Z[6]=0,Z[7]=0,Z[8]=1,Z}function $(Z,J){return Z[0]=J[0],Z[1]=0,Z[2]=0,Z[3]=0,Z[4]=J[1],Z[5]=0,Z[6]=0,Z[7]=0,Z[8]=1,Z}function U(Z,J){return Z[0]=J[0],Z[1]=J[1],Z[2]=0,Z[3]=J[2],Z[4]=J[3],Z[5]=0,Z[6]=J[4],Z[7]=J[5],Z[8]=1,Z}function W(Z,J){var yt=J[0],_t=J[1],nt=J[2],vt=J[3],It=yt+yt,Pt=_t+_t,St=nt+nt,Dt=yt*It,Qt=_t*It,ue=_t*Pt,ie=nt*It,Lt=nt*Pt,ne=nt*St,ve=vt*It,Wt=vt*Pt,ae=vt*St;return Z[0]=1-ue-ne,Z[3]=Qt-ae,Z[6]=ie+Wt,Z[1]=Qt+ae,Z[4]=1-Dt-ne,Z[7]=Lt-ve,Z[2]=ie-Wt,Z[5]=Lt+ve,Z[8]=1-Dt-ue,Z}function V(Z,J){var yt=J[0],_t=J[1],nt=J[2],vt=J[3],It=J[4],Pt=J[5],St=J[6],Dt=J[7],Qt=J[8],ue=J[9],ie=J[10],Lt=J[11],ne=J[12],ve=J[13],Wt=J[14],ae=J[15],Ce=yt*Pt-_t*It,xe=yt*St-nt*It,Jt=yt*Dt-vt*It,we=_t*St-nt*Pt,Tt=_t*Dt-vt*Pt,Pe=nt*Dt-vt*St,_r=Qt*ve-ue*ne,Ar=Qt*Wt-ie*ne,Or=Qt*ae-Lt*ne,Br=ue*Wt-ie*ve,cn=ue*ae-Lt*ve,an=ie*ae-Lt*Wt,Dn=Ce*an-xe*cn+Jt*Br+we*Or-Tt*Ar+Pe*_r;return Dn?(Dn=1/Dn,Z[0]=(Pt*an-St*cn+Dt*Br)*Dn,Z[1]=(St*Or-It*an-Dt*Ar)*Dn,Z[2]=(It*cn-Pt*Or+Dt*_r)*Dn,Z[3]=(nt*cn-_t*an-vt*Br)*Dn,Z[4]=(yt*an-nt*Or+vt*Ar)*Dn,Z[5]=(_t*Or-yt*cn-vt*_r)*Dn,Z[6]=(ve*Pe-Wt*Tt+ae*we)*Dn,Z[7]=(Wt*Jt-ne*Pe-ae*xe)*Dn,Z[8]=(ne*Tt-ve*Jt+ae*Ce)*Dn,Z):null}function H(Z,J,yt){return Z[0]=2/J,Z[1]=0,Z[2]=0,Z[3]=0,Z[4]=-2/yt,Z[5]=0,Z[6]=-1,Z[7]=1,Z[8]=1,Z}function q(Z){return"mat3("+Z[0]+", "+Z[1]+", "+Z[2]+", "+Z[3]+", "+Z[4]+", "+Z[5]+", "+Z[6]+", "+Z[7]+", "+Z[8]+")"}function tt(Z){return Math.hypot(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5],Z[6],Z[7],Z[8])}function rt(Z,J,yt){return Z[0]=J[0]+yt[0],Z[1]=J[1]+yt[1],Z[2]=J[2]+yt[2],Z[3]=J[3]+yt[3],Z[4]=J[4]+yt[4],Z[5]=J[5]+yt[5],Z[6]=J[6]+yt[6],Z[7]=J[7]+yt[7],Z[8]=J[8]+yt[8],Z}function ft(Z,J,yt){return Z[0]=J[0]-yt[0],Z[1]=J[1]-yt[1],Z[2]=J[2]-yt[2],Z[3]=J[3]-yt[3],Z[4]=J[4]-yt[4],Z[5]=J[5]-yt[5],Z[6]=J[6]-yt[6],Z[7]=J[7]-yt[7],Z[8]=J[8]-yt[8],Z}function it(Z,J,yt){return Z[0]=J[0]*yt,Z[1]=J[1]*yt,Z[2]=J[2]*yt,Z[3]=J[3]*yt,Z[4]=J[4]*yt,Z[5]=J[5]*yt,Z[6]=J[6]*yt,Z[7]=J[7]*yt,Z[8]=J[8]*yt,Z}function bt(Z,J,yt,_t){return Z[0]=J[0]+yt[0]*_t,Z[1]=J[1]+yt[1]*_t,Z[2]=J[2]+yt[2]*_t,Z[3]=J[3]+yt[3]*_t,Z[4]=J[4]+yt[4]*_t,Z[5]=J[5]+yt[5]*_t,Z[6]=J[6]+yt[6]*_t,Z[7]=J[7]+yt[7]*_t,Z[8]=J[8]+yt[8]*_t,Z}function gt(Z,J){return Z[0]===J[0]&&Z[1]===J[1]&&Z[2]===J[2]&&Z[3]===J[3]&&Z[4]===J[4]&&Z[5]===J[5]&&Z[6]===J[6]&&Z[7]===J[7]&&Z[8]===J[8]}function Xt(Z,J){var yt=Z[0],_t=Z[1],nt=Z[2],vt=Z[3],It=Z[4],Pt=Z[5],St=Z[6],Dt=Z[7],Qt=Z[8],ue=J[0],ie=J[1],Lt=J[2],ne=J[3],ve=J[4],Wt=J[5],ae=J[6],Ce=J[7],xe=J[8];return Math.abs(yt-ue)<=x.EPSILON*Math.max(1,Math.abs(yt),Math.abs(ue))&&Math.abs(_t-ie)<=x.EPSILON*Math.max(1,Math.abs(_t),Math.abs(ie))&&Math.abs(nt-Lt)<=x.EPSILON*Math.max(1,Math.abs(nt),Math.abs(Lt))&&Math.abs(vt-ne)<=x.EPSILON*Math.max(1,Math.abs(vt),Math.abs(ne))&&Math.abs(It-ve)<=x.EPSILON*Math.max(1,Math.abs(It),Math.abs(ve))&&Math.abs(Pt-Wt)<=x.EPSILON*Math.max(1,Math.abs(Pt),Math.abs(Wt))&&Math.abs(St-ae)<=x.EPSILON*Math.max(1,Math.abs(St),Math.abs(ae))&&Math.abs(Dt-Ce)<=x.EPSILON*Math.max(1,Math.abs(Dt),Math.abs(Ce))&&Math.abs(Qt-xe)<=x.EPSILON*Math.max(1,Math.abs(Qt),Math.abs(xe))}var Ct=E,At=ft},631437:function(Ve,z,C){"use strict";C.r(z),C.d(z,{add:function(){return p},angle:function(){return Z},ceil:function(){return g},clone:function(){return w},copy:function(){return L},create:function(){return k},cross:function(){return rt},dist:function(){return Dt},distance:function(){return h},div:function(){return St},divide:function(){return y},dot:function(){return tt},equals:function(){return nt},exactEquals:function(){return _t},floor:function(){return A},forEach:function(){return ie},fromValues:function(){return T},inverse:function(){return H},len:function(){return vt},length:function(){return U},lerp:function(){return ft},max:function(){return D},min:function(){return E},mul:function(){return Pt},multiply:function(){return S},negate:function(){return V},normalize:function(){return q},random:function(){return it},rotate:function(){return At},round:function(){return F},scale:function(){return Y},scaleAndAdd:function(){return b},set:function(){return P},sqrDist:function(){return Qt},sqrLen:function(){return ue},squaredDistance:function(){return $},squaredLength:function(){return W},str:function(){return yt},sub:function(){return It},subtract:function(){return m},transformMat2:function(){return bt},transformMat2d:function(){return gt},transformMat3:function(){return Xt},transformMat4:function(){return Ct},zero:function(){return J}});var x=C(73633);function k(){var Lt=new x.ARRAY_TYPE(2);return x.ARRAY_TYPE!=Float32Array&&(Lt[0]=0,Lt[1]=0),Lt}function w(Lt){var ne=new x.ARRAY_TYPE(2);return ne[0]=Lt[0],ne[1]=Lt[1],ne}function T(Lt,ne){var ve=new x.ARRAY_TYPE(2);return ve[0]=Lt,ve[1]=ne,ve}function L(Lt,ne){return Lt[0]=ne[0],Lt[1]=ne[1],Lt}function P(Lt,ne,ve){return Lt[0]=ne,Lt[1]=ve,Lt}function p(Lt,ne,ve){return Lt[0]=ne[0]+ve[0],Lt[1]=ne[1]+ve[1],Lt}function m(Lt,ne,ve){return Lt[0]=ne[0]-ve[0],Lt[1]=ne[1]-ve[1],Lt}function S(Lt,ne,ve){return Lt[0]=ne[0]*ve[0],Lt[1]=ne[1]*ve[1],Lt}function y(Lt,ne,ve){return Lt[0]=ne[0]/ve[0],Lt[1]=ne[1]/ve[1],Lt}function g(Lt,ne){return Lt[0]=Math.ceil(ne[0]),Lt[1]=Math.ceil(ne[1]),Lt}function A(Lt,ne){return Lt[0]=Math.floor(ne[0]),Lt[1]=Math.floor(ne[1]),Lt}function E(Lt,ne,ve){return Lt[0]=Math.min(ne[0],ve[0]),Lt[1]=Math.min(ne[1],ve[1]),Lt}function D(Lt,ne,ve){return Lt[0]=Math.max(ne[0],ve[0]),Lt[1]=Math.max(ne[1],ve[1]),Lt}function F(Lt,ne){return Lt[0]=Math.round(ne[0]),Lt[1]=Math.round(ne[1]),Lt}function Y(Lt,ne,ve){return Lt[0]=ne[0]*ve,Lt[1]=ne[1]*ve,Lt}function b(Lt,ne,ve,Wt){return Lt[0]=ne[0]+ve[0]*Wt,Lt[1]=ne[1]+ve[1]*Wt,Lt}function h(Lt,ne){var ve=ne[0]-Lt[0],Wt=ne[1]-Lt[1];return Math.hypot(ve,Wt)}function $(Lt,ne){var ve=ne[0]-Lt[0],Wt=ne[1]-Lt[1];return ve*ve+Wt*Wt}function U(Lt){var ne=Lt[0],ve=Lt[1];return Math.hypot(ne,ve)}function W(Lt){var ne=Lt[0],ve=Lt[1];return ne*ne+ve*ve}function V(Lt,ne){return Lt[0]=-ne[0],Lt[1]=-ne[1],Lt}function H(Lt,ne){return Lt[0]=1/ne[0],Lt[1]=1/ne[1],Lt}function q(Lt,ne){var ve=ne[0],Wt=ne[1],ae=ve*ve+Wt*Wt;return ae>0&&(ae=1/Math.sqrt(ae)),Lt[0]=ne[0]*ae,Lt[1]=ne[1]*ae,Lt}function tt(Lt,ne){return Lt[0]*ne[0]+Lt[1]*ne[1]}function rt(Lt,ne,ve){var Wt=ne[0]*ve[1]-ne[1]*ve[0];return Lt[0]=Lt[1]=0,Lt[2]=Wt,Lt}function ft(Lt,ne,ve,Wt){var ae=ne[0],Ce=ne[1];return Lt[0]=ae+Wt*(ve[0]-ae),Lt[1]=Ce+Wt*(ve[1]-Ce),Lt}function it(Lt,ne){ne=ne||1;var ve=x.RANDOM()*2*Math.PI;return Lt[0]=Math.cos(ve)*ne,Lt[1]=Math.sin(ve)*ne,Lt}function bt(Lt,ne,ve){var Wt=ne[0],ae=ne[1];return Lt[0]=ve[0]*Wt+ve[2]*ae,Lt[1]=ve[1]*Wt+ve[3]*ae,Lt}function gt(Lt,ne,ve){var Wt=ne[0],ae=ne[1];return Lt[0]=ve[0]*Wt+ve[2]*ae+ve[4],Lt[1]=ve[1]*Wt+ve[3]*ae+ve[5],Lt}function Xt(Lt,ne,ve){var Wt=ne[0],ae=ne[1];return Lt[0]=ve[0]*Wt+ve[3]*ae+ve[6],Lt[1]=ve[1]*Wt+ve[4]*ae+ve[7],Lt}function Ct(Lt,ne,ve){var Wt=ne[0],ae=ne[1];return Lt[0]=ve[0]*Wt+ve[4]*ae+ve[12],Lt[1]=ve[1]*Wt+ve[5]*ae+ve[13],Lt}function At(Lt,ne,ve,Wt){var ae=ne[0]-ve[0],Ce=ne[1]-ve[1],xe=Math.sin(Wt),Jt=Math.cos(Wt);return Lt[0]=ae*Jt-Ce*xe+ve[0],Lt[1]=ae*xe+Ce*Jt+ve[1],Lt}function Z(Lt,ne){var ve=Lt[0],Wt=Lt[1],ae=ne[0],Ce=ne[1],xe=Math.sqrt(ve*ve+Wt*Wt)*Math.sqrt(ae*ae+Ce*Ce),Jt=xe&&(ve*ae+Wt*Ce)/xe;return Math.acos(Math.min(Math.max(Jt,-1),1))}function J(Lt){return Lt[0]=0,Lt[1]=0,Lt}function yt(Lt){return"vec2("+Lt[0]+", "+Lt[1]+")"}function _t(Lt,ne){return Lt[0]===ne[0]&&Lt[1]===ne[1]}function nt(Lt,ne){var ve=Lt[0],Wt=Lt[1],ae=ne[0],Ce=ne[1];return Math.abs(ve-ae)<=x.EPSILON*Math.max(1,Math.abs(ve),Math.abs(ae))&&Math.abs(Wt-Ce)<=x.EPSILON*Math.max(1,Math.abs(Wt),Math.abs(Ce))}var vt=U,It=m,Pt=S,St=y,Dt=h,Qt=$,ue=W,ie=function(){var Lt=k();return function(ne,ve,Wt,ae,Ce,xe){var Jt,we;for(ve||(ve=2),Wt||(Wt=0),ae?we=Math.min(ae*ve+Wt,ne.length):we=ne.length,Jt=Wt;Jt0&&(we=1/Math.sqrt(we)),Wt[0]=ae[0]*we,Wt[1]=ae[1]*we,Wt[2]=ae[2]*we,Wt}function tt(Wt,ae){return Wt[0]*ae[0]+Wt[1]*ae[1]+Wt[2]*ae[2]}function rt(Wt,ae,Ce){var xe=ae[0],Jt=ae[1],we=ae[2],Tt=Ce[0],Pe=Ce[1],_r=Ce[2];return Wt[0]=Jt*_r-we*Pe,Wt[1]=we*Tt-xe*_r,Wt[2]=xe*Pe-Jt*Tt,Wt}function ft(Wt,ae,Ce,xe){var Jt=ae[0],we=ae[1],Tt=ae[2];return Wt[0]=Jt+xe*(Ce[0]-Jt),Wt[1]=we+xe*(Ce[1]-we),Wt[2]=Tt+xe*(Ce[2]-Tt),Wt}function it(Wt,ae,Ce,xe,Jt,we){var Tt=we*we,Pe=Tt*(2*we-3)+1,_r=Tt*(we-2)+we,Ar=Tt*(we-1),Or=Tt*(3-2*we);return Wt[0]=ae[0]*Pe+Ce[0]*_r+xe[0]*Ar+Jt[0]*Or,Wt[1]=ae[1]*Pe+Ce[1]*_r+xe[1]*Ar+Jt[1]*Or,Wt[2]=ae[2]*Pe+Ce[2]*_r+xe[2]*Ar+Jt[2]*Or,Wt}function bt(Wt,ae,Ce,xe,Jt,we){var Tt=1-we,Pe=Tt*Tt,_r=we*we,Ar=Pe*Tt,Or=3*we*Pe,Br=3*_r*Tt,cn=_r*we;return Wt[0]=ae[0]*Ar+Ce[0]*Or+xe[0]*Br+Jt[0]*cn,Wt[1]=ae[1]*Ar+Ce[1]*Or+xe[1]*Br+Jt[1]*cn,Wt[2]=ae[2]*Ar+Ce[2]*Or+xe[2]*Br+Jt[2]*cn,Wt}function gt(Wt,ae){ae=ae||1;var Ce=x.RANDOM()*2*Math.PI,xe=x.RANDOM()*2-1,Jt=Math.sqrt(1-xe*xe)*ae;return Wt[0]=Math.cos(Ce)*Jt,Wt[1]=Math.sin(Ce)*Jt,Wt[2]=xe*ae,Wt}function Xt(Wt,ae,Ce){var xe=ae[0],Jt=ae[1],we=ae[2],Tt=Ce[3]*xe+Ce[7]*Jt+Ce[11]*we+Ce[15];return Tt=Tt||1,Wt[0]=(Ce[0]*xe+Ce[4]*Jt+Ce[8]*we+Ce[12])/Tt,Wt[1]=(Ce[1]*xe+Ce[5]*Jt+Ce[9]*we+Ce[13])/Tt,Wt[2]=(Ce[2]*xe+Ce[6]*Jt+Ce[10]*we+Ce[14])/Tt,Wt}function Ct(Wt,ae,Ce){var xe=ae[0],Jt=ae[1],we=ae[2];return Wt[0]=xe*Ce[0]+Jt*Ce[3]+we*Ce[6],Wt[1]=xe*Ce[1]+Jt*Ce[4]+we*Ce[7],Wt[2]=xe*Ce[2]+Jt*Ce[5]+we*Ce[8],Wt}function At(Wt,ae,Ce){var xe=Ce[0],Jt=Ce[1],we=Ce[2],Tt=Ce[3],Pe=ae[0],_r=ae[1],Ar=ae[2],Or=Jt*Ar-we*_r,Br=we*Pe-xe*Ar,cn=xe*_r-Jt*Pe,an=Jt*cn-we*Br,Dn=we*Or-xe*cn,Un=xe*Br-Jt*Or,Xn=Tt*2;return Or*=Xn,Br*=Xn,cn*=Xn,an*=2,Dn*=2,Un*=2,Wt[0]=Pe+Or+an,Wt[1]=_r+Br+Dn,Wt[2]=Ar+cn+Un,Wt}function Z(Wt,ae,Ce,xe){var Jt=[],we=[];return Jt[0]=ae[0]-Ce[0],Jt[1]=ae[1]-Ce[1],Jt[2]=ae[2]-Ce[2],we[0]=Jt[0],we[1]=Jt[1]*Math.cos(xe)-Jt[2]*Math.sin(xe),we[2]=Jt[1]*Math.sin(xe)+Jt[2]*Math.cos(xe),Wt[0]=we[0]+Ce[0],Wt[1]=we[1]+Ce[1],Wt[2]=we[2]+Ce[2],Wt}function J(Wt,ae,Ce,xe){var Jt=[],we=[];return Jt[0]=ae[0]-Ce[0],Jt[1]=ae[1]-Ce[1],Jt[2]=ae[2]-Ce[2],we[0]=Jt[2]*Math.sin(xe)+Jt[0]*Math.cos(xe),we[1]=Jt[1],we[2]=Jt[2]*Math.cos(xe)-Jt[0]*Math.sin(xe),Wt[0]=we[0]+Ce[0],Wt[1]=we[1]+Ce[1],Wt[2]=we[2]+Ce[2],Wt}function yt(Wt,ae,Ce,xe){var Jt=[],we=[];return Jt[0]=ae[0]-Ce[0],Jt[1]=ae[1]-Ce[1],Jt[2]=ae[2]-Ce[2],we[0]=Jt[0]*Math.cos(xe)-Jt[1]*Math.sin(xe),we[1]=Jt[0]*Math.sin(xe)+Jt[1]*Math.cos(xe),we[2]=Jt[2],Wt[0]=we[0]+Ce[0],Wt[1]=we[1]+Ce[1],Wt[2]=we[2]+Ce[2],Wt}function _t(Wt,ae){var Ce=Wt[0],xe=Wt[1],Jt=Wt[2],we=ae[0],Tt=ae[1],Pe=ae[2],_r=Math.sqrt(Ce*Ce+xe*xe+Jt*Jt),Ar=Math.sqrt(we*we+Tt*Tt+Pe*Pe),Or=_r*Ar,Br=Or&&tt(Wt,ae)/Or;return Math.acos(Math.min(Math.max(Br,-1),1))}function nt(Wt){return Wt[0]=0,Wt[1]=0,Wt[2]=0,Wt}function vt(Wt){return"vec3("+Wt[0]+", "+Wt[1]+", "+Wt[2]+")"}function It(Wt,ae){return Wt[0]===ae[0]&&Wt[1]===ae[1]&&Wt[2]===ae[2]}function Pt(Wt,ae){var Ce=Wt[0],xe=Wt[1],Jt=Wt[2],we=ae[0],Tt=ae[1],Pe=ae[2];return Math.abs(Ce-we)<=x.EPSILON*Math.max(1,Math.abs(Ce),Math.abs(we))&&Math.abs(xe-Tt)<=x.EPSILON*Math.max(1,Math.abs(xe),Math.abs(Tt))&&Math.abs(Jt-Pe)<=x.EPSILON*Math.max(1,Math.abs(Jt),Math.abs(Pe))}var St=S,Dt=y,Qt=g,ue=$,ie=U,Lt=T,ne=W,ve=function(){var Wt=k();return function(ae,Ce,xe,Jt,we,Tt){var Pe,_r;for(Ce||(Ce=3),xe||(xe=0),Jt?_r=Math.min(Jt*Ce+xe,ae.length):_r=ae.length,Pe=xe;Pe<_r;Pe+=Ce)Wt[0]=ae[Pe],Wt[1]=ae[Pe+1],Wt[2]=ae[Pe+2],we(Wt,Wt,Tt),ae[Pe]=Wt[0],ae[Pe+1]=Wt[1],ae[Pe+2]=Wt[2];return ae}}()},738186:function(Ve){var z=[],C=[],x="insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).";function k(T,L){if(L=L||{},T===void 0)throw new Error(x);var P=L.prepend===!0?"prepend":"append",p=L.container!==void 0?L.container:document.querySelector("head"),m=z.indexOf(p);m===-1&&(m=z.push(p)-1,C[m]={});var S;return C[m]!==void 0&&C[m][P]!==void 0?S=C[m][P]:(S=C[m][P]=w(),P==="prepend"?p.insertBefore(S,p.childNodes[0]):p.appendChild(S)),T.charCodeAt(0)===65279&&(T=T.substr(1,T.length)),S.styleSheet?S.styleSheet.cssText+=T:S.textContent+=T,S}function w(){var T=document.createElement("style");return T.setAttribute("type","text/css"),T}Ve.exports=k,Ve.exports.insertCss=k},896874:function(Ve){function z(C,x,k){switch(k.length){case 0:return C.call(x);case 1:return C.call(x,k[0]);case 2:return C.call(x,k[0],k[1]);case 3:return C.call(x,k[0],k[1],k[2])}return C.apply(x,k)}Ve.exports=z},829932:function(Ve){function z(C,x){for(var k=-1,w=C==null?0:C.length,T=Array(w);++k=p&&(D=P,F=!1,y=new x(y));t:for(;++E0){if(++T>=z)return arguments[0]}else T=0;return w.apply(void 0,arguments)}}Ve.exports=k},575703:function(Ve){function z(C){return function(){return C}}Ve.exports=z},291966:function(Ve,z,C){var x=C(920731),k=C(121078),w=C(105976),T=C(229246),L=w(function(P,p){return T(P)?x(P,k(p,1,T,!0)):[]});Ve.exports=L},406557:function(Ve){function z(C){return C}Ve.exports=z},498612:function(Ve,z,C){var x=C(623560),k=C(541780);function w(T){return T!=null&&k(T.length)&&!x(T)}Ve.exports=w},229246:function(Ve,z,C){var x=C(498612),k=C(637005);function w(T){return k(T)&&x(T)}Ve.exports=w},541780:function(Ve){var z=9007199254740991;function C(x){return typeof x=="number"&&x>-1&&x%1==0&&x<=z}Ve.exports=C},281763:function(Ve,z,C){var x=C(644239),k=C(637005),w="[object Number]";function T(L){return typeof L=="number"||k(L)&&x(L)==w}Ve.exports=T},968630:function(Ve,z,C){var x=C(644239),k=C(385924),w=C(637005),T="[object Object]",L=Function.prototype,P=Object.prototype,p=L.toString,m=P.hasOwnProperty,S=p.call(Object);function y(g){if(!w(g)||x(g)!=T)return!1;var A=k(g);if(A===null)return!0;var E=m.call(A,"constructor")&&A.constructor;return typeof E=="function"&&E instanceof E&&p.call(E)==S}Ve.exports=y},936719:function(Ve,z,C){var x=C(238749),k=C(307518),w=C(531167),T=w&&w.isTypedArray,L=T?k(T):x;Ve.exports=L},252796:function(Ve,z,C){Ve.exports=C(410643)},913264:function(Ve){"use strict";var z=!!(typeof window!="undefined"&&window.document&&window.document.createElement),C={canUseDOM:z,canUseWorkers:typeof Worker!="undefined",canUseEventListeners:z&&!!(window.addEventListener||window.attachEvent),canUseViewport:z&&!!window.screen,isInWorker:!z};Ve.exports=C},784518:function(Ve){var z=!1,C,x,k,w,T,L,P,p,m,S,y,g,A,E,D;function F(){if(!z){z=!0;var b=navigator.userAgent,h=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(b),$=/(Mac OS X)|(Windows)|(Linux)/.exec(b);if(g=/\b(iPhone|iP[ao]d)/.exec(b),A=/\b(iP[ao]d)/.exec(b),S=/Android/i.exec(b),E=/FBAN\/\w+;/i.exec(b),D=/Mobile/i.exec(b),y=!!/Win64/.exec(b),h){C=h[1]?parseFloat(h[1]):h[5]?parseFloat(h[5]):NaN,C&&document&&document.documentMode&&(C=document.documentMode);var U=/(?:Trident\/(\d+.\d+))/.exec(b);L=U?parseFloat(U[1])+4:C,x=h[2]?parseFloat(h[2]):NaN,k=h[3]?parseFloat(h[3]):NaN,w=h[4]?parseFloat(h[4]):NaN,w?(h=/(?:Chrome\/(\d+\.\d+))/.exec(b),T=h&&h[1]?parseFloat(h[1]):NaN):T=NaN}else C=x=k=T=w=NaN;if($){if($[1]){var W=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(b);P=W?parseFloat(W[1].replace("_",".")):!0}else P=!1;p=!!$[2],m=!!$[3]}else P=p=m=!1}}var Y={ie:function(){return F()||C},ieCompatibilityMode:function(){return F()||L>C},ie64:function(){return Y.ie()&&y},firefox:function(){return F()||x},opera:function(){return F()||k},webkit:function(){return F()||w},safari:function(){return Y.webkit()},chrome:function(){return F()||T},windows:function(){return F()||p},osx:function(){return F()||P},linux:function(){return F()||m},iphone:function(){return F()||g},mobile:function(){return F()||g||A||S||D},nativeApp:function(){return F()||E},android:function(){return F()||S},ipad:function(){return F()||A}};Ve.exports=Y},396534:function(Ve,z,C){"use strict";var x=C(913264),k;x.canUseDOM&&(k=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);function w(T,L){if(!x.canUseDOM||L&&!("addEventListener"in document))return!1;var P="on"+T,p=P in document;if(!p){var m=document.createElement("div");m.setAttribute(P,"return;"),p=typeof m[P]=="function"}return!p&&k&&T==="wheel"&&(p=document.implementation.hasFeature("Events.wheel","3.0")),p}Ve.exports=w},410643:function(Ve,z,C){"use strict";var x=C(784518),k=C(396534),w=10,T=40,L=800;function P(p){var m=0,S=0,y=0,g=0;return"detail"in p&&(S=p.detail),"wheelDelta"in p&&(S=-p.wheelDelta/120),"wheelDeltaY"in p&&(S=-p.wheelDeltaY/120),"wheelDeltaX"in p&&(m=-p.wheelDeltaX/120),"axis"in p&&p.axis===p.HORIZONTAL_AXIS&&(m=S,S=0),y=m*w,g=S*w,"deltaY"in p&&(g=p.deltaY),"deltaX"in p&&(y=p.deltaX),(y||g)&&p.deltaMode&&(p.deltaMode==1?(y*=T,g*=T):(y*=L,g*=L)),y&&!m&&(m=y<1?-1:1),g&&!S&&(S=g<1?-1:1),{spinX:m,spinY:S,pixelX:y,pixelY:g}}P.getEventType=function(){return x.firefox()?"DOMMouseScroll":k("wheel")?"wheel":"mousewheel"},Ve.exports=P},75:function(Ve,z,C){var x=C(734155);(function(){var k,w,T,L,P,p;typeof performance!="undefined"&&performance!==null&&performance.now?Ve.exports=function(){return performance.now()}:typeof x!="undefined"&&x!==null&&x.hrtime?(Ve.exports=function(){return(k()-P)/1e6},w=x.hrtime,k=function(){var m;return m=w(),m[0]*1e9+m[1]},L=k(),p=x.uptime()*1e9,P=L-p):Date.now?(Ve.exports=function(){return Date.now()-T},T=Date.now()):(Ve.exports=function(){return new Date().getTime()-T},T=new Date().getTime())}).call(this)},654087:function(Ve,z,C){for(var x=C(75),k=typeof window=="undefined"?C.g:window,w=["moz","webkit"],T="AnimationFrame",L=k["request"+T],P=k["cancel"+T]||k["cancelRequest"+T],p=0;!L&&p3&&arguments[3]!==void 0?arguments[3]:"",qt=arguments.length>4?arguments[4]:void 0;return kt==="+="||kt==="-="?te+wt*Me+(qt||0):(wt-te)*Me+te+(qt||0)},yt=function(te){if(!te)return{};var wt=typeof window!="undefined"&&document.defaultView?document.defaultView.getComputedStyle(te):{};return wt},_t={margin:1,padding:1,borderWidth:1,borderRadius:1};function nt(Ht){var te=Ht.target,wt=Ht.computedStyle,Me=Ht.style,kt=Ht.value,qt=Ht.startUnit,dt=Ht.endUnit,Ut=Ht.fixed,Q=Ht.isOriginWidth,ot=Ht.useCurrentTarget;if(q)return kt;var R=/(?:Left|Right|Width|X)/i.test(Me)||Q;R=Me==="padding"||Me==="marign"?!0:R;var M=Me.indexOf("border")!==-1||Me.indexOf("translate")!==-1||Me==="transformOrigin"||ot?te:te.parentNode||document.body;M=Ut?document.body:M;var O,X,mt;switch(qt){case"%":O=parseFloat(kt)/100*(R?M.clientWidth:M.clientHeight);break;case"vw":O=parseFloat(kt)*document.body.clientWidth/100;break;case"vh":O=parseFloat(kt)*document.body.clientHeight/100;break;case"em":wt?O=parseFloat(kt)*parseFloat(wt.fontSize):(mt="em",O=parseFloat(kt));break;case"rem":{wt?(X=window.getComputedStyle(document.getElementsByTagName("html")[0]),O=parseFloat(kt)*parseFloat(X.fontSize)):(mt="rem",O=parseFloat(kt));break}default:O=parseFloat(kt);break}switch(dt){case"%":O=O?O*100/(R?M.clientWidth:M.clientHeight):0;break;case"vw":O=parseFloat(kt)/document.body.clientWidth*100;break;case"vh":O=parseFloat(kt)/document.body.clientHeight*100;break;case"em":wt?O=parseFloat(kt)/parseFloat(wt.fontSize):(mt="em",O=parseFloat(kt));break;case"rem":{wt?(X=X||window.getComputedStyle(document.getElementsByTagName("html")[0]),O=parseFloat(kt)/parseFloat(X.fontSize)):(mt="rem",O=parseFloat(kt));break}default:break}return mt&&console.warn("Warning: Element is not 'DOM, can not use '".concat(mt,"', automatically convert to animation units.")),O}function vt(Ht){if(typeof Ht=="string")return Ht;var te=Ht.perspective,wt=Ht.rotate,Me=Ht.rotateX,kt=Ht.rotateY,qt=Ht.scaleX,dt=Ht.scaleY,Ut=Ht.scaleZ,Q=Ht.skewX,ot=Ht.skewY,R=typeof Ht.translateX=="string"?Ht.translateX:"".concat(Ht.translateX,"px"),M=typeof Ht.translateY=="string"?Ht.translateY:"".concat(Ht.translateY,"px"),O=typeof Ht.translateZ=="string"?Ht.translateZ:"".concat(Ht.translateZ,"px"),X=Q||ot?"skew(".concat(Q,"deg,").concat(ot,"deg)"):"",mt=wt?"rotate(".concat(wt,"deg)"):"",Ft=qt!==1||dt!==1||Ut!==1?"scale3d(".concat(qt,",").concat(dt,",").concat(Ut,")"):"",Bt=Me?"rotateX(".concat(Me,"deg)"):"",ee=kt?"rotateY(".concat(kt,"deg)"):"",Le=te?"perspective(".concat(te,"px)"):"",me=Ft||mt||Bt||ee||X?"":"translate(0px, 0px)",Xe=Ht.translateZ?"translate3d(".concat(R,",").concat(M,",").concat(O,")"):(Ht.translateX||Ht.translateY)&&"translate(".concat(R,",").concat(M,")")||me;return"".concat(Le," ").concat(Xe," ").concat(Ft," ").concat(mt," ").concat(Bt," ").concat(ee," ").concat(X).trim()}var It={brightness:1,saturate:1,contrast:1,grayScale:0,hueRotate:"0deg",sepia:0,invert:0},Pt=(0,$.Z)(function Ht(){var te=this;(0,h.Z)(this,Ht),this.push=function(wt){gt(wt).forEach(function(Me){te[Me.className]=Me})},this.register=this.push}),St=new Pt,Dt=/%|vw|vh|em|rem/i,Qt=(0,$.Z)(function Ht(te){var wt=this;(0,h.Z)(this,Ht),this.props=void 0,this.computedStyle=void 0,this.root=void 0,this.index=void 0,this.targetIndex=void 0,this.tweenVars={},this.transformName=void 0,this.filterName=void 0,this.target=void 0,this.start={},this.startAt={},this.propsData={data:{},type:{},unit:{},count:{},splitStr:{},isTransform:{}},this.setDefaultData=function(){var Me=wt.props;for(var kt in Me){var qt=Me[kt],dt=qt.split&&qt.split(/\s+|,/).length>1||kt.match(/color|fill|stroke/i)||kt.match(/shadow/i),Ut=(kt==="background"||kt==="backgroundImage")&&qt.match(/[a-z|-]+\(([\s\S]*?)\)/gi);if(Ut){wt.propsData.data[kt]={value:qt,plugin:St.GradientsPlugin};continue}if(dt){wt.propsData.data[kt]={value:qt,plugin:St.ArrayPlugin};continue}var Q=(0,U.Lo)(kt),ot=wt.getTweenData(Q,Me[kt]);wt.propsData.data[Q]=ot.data[Q],wt.propsData.type[Q]=ot.type[Q],wt.propsData.unit[Q]=ot.unit[Q],wt.propsData.count[Q]=ot.count[Q],wt.propsData.isTransform[Q]=(0,U.dt)(Q)==="transform",ot.splitStr[Q]&&(wt.propsData.splitStr[Q]=ot.splitStr[Q])}},this.getTweenData=function(Me,kt){var qt={data:{},isTransform:{},type:{},unit:{},count:{},splitStr:{}},dt=kt;qt.data[Me]=dt;var Ut=typeof qt.data[Me]=="string";qt.unit[Me]=Ut?qt.data[Me].replace(/[^a-z|%]/g,""):"",qt.count[Me]=Ut?qt.data[Me].replace(/[^+|=|-]/g,""):"";var Q=Ut?parseFloat(qt.data[Me].replace(/[a-z|%|=]/g,"")):qt.data[Me];return qt.data[Me]=!Q&&Q!==0?qt.data[Me]:Q,qt},this.setStartAtValue=function(Me,kt){return(0,x.Z)(kt)==="object"?Z(Me,kt):Me},this.getAnimStart=function(){var Me=wt.target,kt=wt.root,qt=wt.targetIndex,dt=wt.propsData,Ut=wt.startAt,Q=wt.start,ot=wt.tweenVars,R={};for(var M in Ut)R[(0,U.Lo)(M)]=Ut[M];wt.computedStyle=wt.computedStyle||yt(Me),ot.style=ot.style||{};var O,X;for(var mt in dt.data){var Ft,Bt=dt.data[mt];if(Bt.plugin){var ee=new Bt.plugin(Bt.value,mt);ee.target=Me,ee.root=kt,ee.parent=parent,ee.index=wt.index,ee.targetIndex=qt,ee.tweenVars=ot,ee.startAt=wt.startAt,ee.computedStyle=wt.computedStyle,Bt.plugin=ee,Q[mt]=ee.getAnimStart();continue}var Le=(0,U.dt)(mt),me=Le==="transform"?wt.transformName:Le;me=Le==="filter"?wt.filterName:me;var Xe=ot.style[me],pr=Xe!=null?Xe:wt.computedStyle[Le],Ze=(Ft=R[mt])!==null&&Ft!==void 0?Ft:pr,Pr=dt.unit[mt],un="";if(Le==="transform"){O=O||(Ze===Xe?(0,k.Z)({},Xe):(0,U.Ck)(wt.computedStyle[wt.transformName]));var Ke=O[mt];if(R&&mt in R){var lr,Rr;Ke=wt.setStartAtValue((lr=(Rr=R[mt].vars)!==null&&Rr!==void 0?Rr:Xe==null?void 0:Xe[mt])!==null&&lr!==void 0?lr:Ke,R[mt]),un=R[mt].unit,mt==="scale"?(O.scaleX=Ke,O.scaleY=Ke):O[mt]=Ke}un!==Pr&&(Ke=nt({target:Me,computedStyle:wt.computedStyle,style:Le,value:Ke,startUnit:un,endUnit:Pr}),mt==="scale"?(O.scaleX=Ke,O.scaleY=Ke):O[mt]=Ke),Q[wt.transformName]=O}else if(Le==="filter"){var Dr=U._T.filterConvert[mt]||mt;X=X||(Ze===Xe?(0,k.Z)({},Xe):(0,U.GX)(pr)||{}),X[Dr]=X[Dr]||It[Dr];var ce=X[Dr];if(R&&mt in R){var jt;ce=wt.setStartAtValue((jt=R[mt].vars)!==null&&jt!==void 0?jt:ce,R[mt]),un=R[mt].unit,X[Dr]=ce}if(Pr!==un){var pe;X[Dr]=nt({target:Me,computedStyle:wt.computedStyle,style:Le,value:ce,startUnit:un,endUnit:Pr,fixed:((pe=wt.computedStyle)===null||pe===void 0?void 0:pe.position)==="fixed"})}Q[wt.filterName]=X}else{var Oe;if(Ze=(Oe=R[mt])!==null&&Oe!==void 0?Oe:pr,(!Ze||Ze==="none"||Ze==="auto")&&(Ze=""),Pr=dt.unit[Le],un=(0,x.Z)(Ze)==="object"?Ze.unit:"".concat(Ze).replace(/[^a-z|%]/g,""),Ze=wt.setStartAtValue(pr,R[mt]),Pr!==un){var Se;Ze=nt({target:Me,computedStyle:wt.computedStyle,style:Le,value:parseFloat(Ze),startUnit:un,endUnit:Pr,fixed:((Se=wt.computedStyle)===null||Se===void 0?void 0:Se.position)==="fixed"})}var Fe=parseFloat(Ze);Q[Le]=isNaN(Fe)?At(Le):Fe}}return Q},this.render=function(Me){var kt=wt.propsData,qt=wt.start,dt=wt.tweenVars,Ut=dt.style||{};qt[wt.transformName]&&!Ut[wt.transformName]&&(Ut[wt.transformName]=(0,k.Z)({},qt[wt.transformName])),qt[wt.filterName]&&!Ut[wt.filterName]&&(Ut[wt.filterName]=(0,k.Z)({},qt[wt.filterName]));var Q=Ut[wt.transformName],ot=Ut[wt.filterName],R=kt.data,M=kt.unit,O=kt.count,X=kt.isTransform;for(var mt in R){var Ft=R[mt];if(Ft.plugin){Ut[mt]=Ft.plugin.render(Me);continue}var Bt=X[mt],ee=Bt?qt[wt.transformName][mt]:qt[mt],Le=M[mt],me=O[mt];if(Bt){if(mt==="scale"){var Xe=qt[wt.transformName].scaleX,pr=qt[wt.transformName].scaleY;me.charAt(1)==="="?(Q.scaleX=Xe+Ft*Me,Q.scaleY=pr+Ft*Me):(Q.scaleX=(Ft-Xe)*Me+Xe,Q.scaleY=(Ft-pr)*Me+pr)}else Q[mt]=J(parseFloat(ee),Ft,Me,me,Le);Q.text=vt(Ut[wt.transformName])}else if(U._T.filter.indexOf(mt)>=0){var Ze=U._T.filterConvert[mt]||mt;ee=parseFloat(qt[wt.filterName][Ze])||0,ot[Ze]=J(ee,Ft,Me,me,Le),ot.text="";for(var Pr in ot)Pr!=="text"&&(ot.text="".concat(ot.text," ").concat(Pr,"(").concat(ot[Pr],")").trim())}else{var un=(0,U.YJ)(mt,0);un=typeof un=="number"?0:un.replace(/[^a-z|%]/g,""),Le=Le||un,typeof Ft=="string"?Ut[mt]=Ft:Ut[mt]=J(ee,Ft,Me,me,Le)}}return Ut},this.props=te,this.transformName=(0,U.Yf)("transform"),this.filterName=(0,U.Yf)("filter")||"filter",this.setDefaultData()});Qt.key="style",Qt.className="style";var ue=Qt,ie=C(497326),Lt=C(360136),ne=C(973568),ve=(0,$.Z)(function Ht(te,wt){(0,h.Z)(this,Ht),this.value=void 0,this.key=void 0,this.root=void 0,this.index=void 0,this.style={},this.start={},this.startAt={},this.target=void 0,this.value=te,this.key=wt});ve.className=void 0,ve.key=void 0;var Wt=function(Ht){(0,Lt.Z)(wt,Ht);var te=(0,ne.Z)(wt);function wt(Me,kt){var qt;(0,h.Z)(this,wt),qt=te.call(this,Me,kt),qt.value=void 0,qt.key=void 0,qt.start=[],qt.tweenVars={},qt.vars={},qt.computedStyle=void 0,qt.propsData={data:[],unit:[],count:[]},qt.setDefaultData=function(Q,ot){var R=(0,ie.Z)(qt),M=R.propsData,O=R.value,X=(0,E.Z)(O);if(Q==="color"){var mt;X[3]=(mt=X[3])!==null&&mt!==void 0?mt:1}M.type=Q,M.data=X.map(function(Ft){return!parseFloat(Ft)&&parseFloat(Ft)!==0?Ft:parseFloat(Ft)}),M.unit=X.map(function(Ft){return Ft.toString().replace(/[^a-z|%]/g,"")}),M.count=X.map(function(Ft){return Ft.toString().replace(/[^+|=|-]/g,"")}),ot&&(M.splitStr=ot)},qt.convertToMarksArray=function(Q,ot,R,M){var O=(R||"").toString().replace(/[^a-z|%]/g,""),X=typeof M=="number"?Q[M]:void 0;return O===X?parseFloat(R):!parseFloat(R)&&parseFloat(R)!==0?R:nt({target:qt.target,computedStyle:qt.computedStyle,style:ot,value:R,startUnit:O,endUnit:X,isOriginWidth:ot==="transformOrigin"&&!M})},qt.getAnimStart=function(){var Q,ot,R,M,O=(0,ie.Z)(qt),X=O.startAt,mt=O.target,Ft=O.key,Bt=O.propsData,ee=O.computedStyle,Le=O.tweenVars,me=(Q=(ot=(R=X==null?void 0:X[Ft])!==null&&R!==void 0?R:ee?(M=Le.style)===null||M===void 0?void 0:M[Ft]:Le[Ft])!==null&&ot!==void 0?ot:(ee||mt)[Ft])!==null&&Q!==void 0?Q:"",Xe=Bt.data.indexOf("inset"),pr;if(Xe!==-1&&!me.match("inset")&&Bt.type==="shadow"&&(pr=me,me=""),(!me||me==="none"||me==="auto")&&(me=""),me=Bt.type==="shadow"?(0,U.hy)(me,Ft):me,me=Bt.type==="color"?(0,U.lu)(me):me,me=Bt.type==="string"?me.split(/[\s|,]/):me,_t[Ft]){var Ze,Pr,un,Ke;me[1]=(Ze=me[1])!==null&&Ze!==void 0?Ze:me[0],me[2]=(Pr=me[2])!==null&&Pr!==void 0?Pr:me[0],me[3]=(un=(Ke=me[3])!==null&&Ke!==void 0?Ke:me[1])!==null&&un!==void 0?un:me[0]}var lr=Bt.unit,Rr=me.map(function(Dr,ce){return parseFloat(Dr).toString()==="NaN"?Dr:qt.convertToMarksArray(lr,Ft,Dr,ce)});return qt.start=Rr.concat(Xe>=0?"inset":[]),qt.start.oldShadow=pr,qt.start},qt.render=function(Q){var ot=(0,ie.Z)(qt),R=ot.start,M=ot.propsData,O=M.type,X=M.splitStr,mt=M.data,Ft=M.count,Bt=M.unit,ee=mt.map(function(Ze,Pr){return typeof Ze=="string"?Ze:J(R[Pr],Ze,Q,Ft[Pr],Bt[Pr])});switch(O){case"string":ee=ee.join(X);break;case"color":ee=(0,U.Lq)(ee);break;case"shadow":{var Le=ee.indexOf("inset")>=0,me=Le?ee.filter(function(Ze){return Ze!=="inset"}):ee,Xe=me.slice(0,me.length-4).map(function(Ze){return typeof Ze=="number"?"".concat(Ze,"px"):Ze}),pr=(0,U.Lq)(me.slice(me.length-4,me.length));ee="".concat(R.oldShadow?"".concat(R.oldShadow,","):"").concat(Xe.join(" ")," ").concat(pr," ").concat(Le?"inset":"").trim();break}default:break}return ee},qt.value=Me,qt.key=kt;var dt="",Ut="";return typeof Me=="string"&&(kt.match(H)?(qt.value=(0,U.hy)(Me,kt),dt="shadow"):kt.match(/color|fill|stroke/i)||Me.match(V)?(qt.value=(0,U.lu)(Me),dt="color"):(Ut=Me.replace(/[^\s|,]/g,"").replace(/\s+/g," "),qt.value=Me.split(/[\s|,]/),dt="string")),qt.setDefaultData(dt,Ut),qt}return(0,$.Z)(wt)}(ve);Wt.className="ArrayPlugin";var ae=Wt,Ce={linear:{"to top":"0deg","to top right":"45deg","to right top":"45deg","to right":"90deg","to right bottom":"135deg","to bottom right":"135deg","to bottom":"180deg","to bottom left":"225deg","to left bottom":"225deg","to left":"270deg","to left top":"315deg","to top left":"315deg"},radial:{center:"50% 50%",top:"50% 0%","top right":"100% 0%","right top":"100% 0%",right:"100% 50%","right bottom":"100% 100%","bottom right":"100% 100%",bottom:"50% 100%","bottom left":"0% 100%","left bottom":"0% 100%",left:"0% 50%","left top":"0% 0%","top left":"0% 0%"}},xe=["closest-side","closest-corner","farthest-side","farthest-corner"],Jt=function(te,wt,Me){console.warn("Warning: The gradient ".concat(te,"(").concat(wt," => ").concat(Me,") is different, which has been automatically converted to animation gradient ").concat(te,"(").concat(Me,")."))},we=function(te){return te==="url"||te.indexOf("image")>=0||te==="paint"||te==="cross-fade"||te==="element"},Tt=function(Ht){(0,Lt.Z)(wt,Ht);var te=(0,ne.Z)(wt);function wt(Me){var kt;return(0,h.Z)(this,wt),kt=te.call(this,Me,"backgroundImage"),kt.value=void 0,kt.tweenVars={},kt.vars=[],kt.computedStyle=void 0,kt.defaultStartVars=[],kt.getPosition=function(qt){return qt.map(function(dt){return{data:parseFloat(dt),unit:dt.replace(/[^a-z|%]/g,"")}})},kt.getAngle=function(qt,dt){var Ut=qt.replace(/-|gradient|repeating]/g,""),Q,ot,R,M;switch(Ut){case"linear":{R=kt.getPosition((Ce.linear[dt]||dt||Ce.linear["to bottom"]).split(" "));break}case"radial":{var O=dt.split(" ");Q=O.find(function(ee){return xe.indexOf(ee)>=0})||xe[3],ot=O.find(function(ee){return ee==="circle"||ee==="ellipse"})||"ellipse";var X=new RegExp("".concat(Q,"|").concat(ot,"|at"),"g"),mt=dt.replace(X,"").trim();M=kt.getPosition((Ce.radial[mt]||mt||Ce.radial.center).split(" "));break}case"conic":{var Ft=dt.split("at").map(function(ee){return ee.trim()}),Bt=(Ft[0]||"").split(" ");ot=Bt[0]||"from",R=kt.getPosition([Bt[1]||"0deg"]),M=kt.getPosition((Ce.radial[Ft[1]]||Ft[1]||Ce.radial.center).split(" "));break}default:break}return{extent:Q,shape:ot,angle:R,position:M}},kt.valueToIValue=function(qt){if(!qt)return[];var dt=qt.replace(/\),\s+?(url|radial|conic|linear|repeating|image|element|cross|paint)/,")#,#$1").split("#,#");return dt.map(function(Ut){var Q=Ut.replace(/([a-z|-]+)\((.*)\)/,"$1").trim();if(Q==="url")return{type:Q,values:Ut};var ot=Ut.replace(/([a-z|-]+)\((.*)\)/,"$2").replace(/#([0-9a-f]{6}|[0-9a-f]{3})|(rgb[a]?|hsl)+\(\d+\,[\s+]?\d+[\%]?\,[\s+]?\d+[\%]?(\,\d+)?\)/gi,function(X){return X.replace(/\s+/g,"")}).replace(/\,([a-z|#|\s+])/g,"#,#$1").split("#,#").map(function(X){return X.trim()}),R=ot[0].match(V)?"":ot[0];R&&ot.splice(0,1);var M=kt.getAngle(Q,R),O=ot.map(function(X){var mt=X.trim().split(/\s+/),Ft,Bt=(mt[0].match(V),mt[0]);return Bt&&(mt.splice(0,1),Ft=(0,U.lu)(Bt)),{color:Ft,positions:mt.map(function(ee){return{data:parseFloat(ee),unit:ee.toString().replace(/[^a-z|%]/g,"")}})}});return{type:Q,angle:M,values:O}})},kt.getAnimStart=function(){var qt,dt=(0,ie.Z)(kt),Ut=dt.startAt,Q=dt.key,ot=dt.computedStyle,R=dt.target,M=dt.vars,O=dt.tweenVars,X=(0,k.Z)({},Ut),mt=(qt=O[Q])!==null&&qt!==void 0?qt:(ot||R)[Q];(!mt||mt==="none"||mt==="auto")&&(mt=""),X[Q]=X[Q]||mt,X[Q]=X[Q]?kt.valueToIValue(X[Q]):kt.defaultStartVars;var Ft=Math.max(M.length,X[Q].length),Bt=(Ft===X[Q].length?X[Q]:M).map(function(ee,Le){var me,Xe,pr=X[Q][Le]||kt.defaultStartVars[Le],Ze=M[Le]||pr;if((!pr||pr.type!==Ze.type)&&(pr.type!==Ze.type&&Jt("type",pr.type,Ze.type),pr=kt.defaultStartVars[Le]),we(Ze.type)||typeof Ze.values=="string"||typeof pr.values=="string")return(0,k.Z)({},Ze);if(((me=Ze.angle)===null||me===void 0?void 0:me.extent)!==((Xe=pr.angle)===null||Xe===void 0?void 0:Xe.extent)){var Pr,un;Jt("extent keyword",(Pr=pr.angle)===null||Pr===void 0?void 0:Pr.extent,(un=Ze.angle)===null||un===void 0?void 0:un.extent)}var Ke=Math.max(pr.values.length,Ze.values.length),lr=Ke===pr.values.length?pr.values:Ze.values;return pr.values=lr.map(function(Rr,Dr){var ce=pr.values[Dr],jt=Ze.values[Dr]||ce;return(0,k.Z)((0,k.Z)({},ce),{},{positions:(jt||ce).positions.map(function(pe,Oe){var Se=ce?ce.positions[Oe]||ce.positions[ce.positions.length-1]:jt.positions[jt.positions.length-1],Fe=pe||Se;return!Se&&ce&&pr.values.length&&(Se={data:100/(pr.values.length-1)*Dr,unit:"%"}),Fe.unit!==Se.unit&&Jt("units",Se.unit,Fe.unit),{data:Se.data,unit:Fe.unit}})})}),pr});return kt.start=Bt,kt.start},kt.render=function(qt){var dt="",Ut=Math.max(kt.vars.length,kt.start.length);return(Ut===kt.vars.length?kt.vars:kt.start).forEach(function(Q,ot){var R=kt.start[ot],M=kt.vars[ot]||R;if(we(M.type)||typeof M.values=="string"||!M.angle){dt+="".concat(dt?",":""," ").concat(M.values).trim();return}var O=Math.max(R.values.length,M.values.length),X=(O===R.values.length?R.values:M.values).map(function(Le,me){var Xe=R.values[me],pr=M.values[me];pr||(pr=Xe);var Ze=Xe.color,Pr=Xe.positions;!Ze&&pr.color&&(Ze=(0,E.Z)(pr.color)),Pr||(Pr=pr.positions.map(function(lr){return(0,k.Z)({},lr)}));var un=pr.color?pr.color.map(function(lr,Rr){return J(Ze[Rr],lr,qt)}):pr.color,Ke=pr.positions.map(function(lr,Rr){return"".concat(J(Pr[Rr].data,lr.data,qt)).concat(lr.unit)}).join(" ");return"".concat(un?(0,U.Lq)(un):un||""," ").concat(Ke).trim()}),mt=M.angle,Ft=mt.angle&&mt.angle.map(function(Le,me){return"".concat(J(R.angle.angle[me].data,Le.data,qt)).concat(Le.unit)}).join(" "),Bt=mt.position&&mt.position.map(function(Le,me){return"".concat(J(R.angle.position[me].data,Le.data,qt)).concat(Le.unit)}).join(" "),ee="".concat(mt.extent||""," ").concat(mt.shape||""," ").concat(Ft||""," ").concat(Bt?"at ".concat(Bt):"").trim();dt+="".concat(dt?",":""," ").concat(M.type,"(").concat(ee?"".concat(ee,","):"").concat(X.join(","),")").trim()}),dt},kt.value=Me,kt.vars=kt.valueToIValue(Me),kt.defaultStartVars=kt.vars.map(function(qt){return we(qt.type)||typeof qt.values=="string"?(0,k.Z)({},qt):(0,k.Z)((0,k.Z)({},qt),{},{values:qt.values.map(function(dt){var Ut;return dt.color&&typeof dt.color!="string"?(Ut=(0,E.Z)(dt.color),Ut[3]=0):Ut=dt.color,{color:Ut,positions:(0,E.Z)(dt.positions)}})})}),kt}return(0,$.Z)(wt)}(ve);Tt.className="GradientsPlugin";var Pe=C(654087),_r=C.n(Pe),Ar=function(){function Ht(){var te=this;(0,h.Z)(this,Ht),this.lagThreshold=150,this.adjustedLag=33,this.emptyTime=0,this.elapsed=0,this.frameFPS=1e3/240,this.startTime=0,this.prevTime=0,this.useTimeout=!1,this.lastUpdate=this.startTime,this.nextTime=this.frameFPS,this.req=void 0,this.id=-1,this.tweenId=0,this.tickFn=[],this.state="sleep",this.time=0,this.frame=0,this.removeReq=function(wt){return te.useTimeout?clearTimeout(wt):(0,Pe.cancel)(wt)},this.tick=function(){var wt=te.tickFn;te.startTime||(te.startTime=tt()-te.frameFPS,te.lastUpdate=te.startTime),te.elapsed=tt()-te.lastUpdate,te.elapsed>te.lagThreshold&&(te.startTime+=te.elapsed-te.adjustedLag),te.lastUpdate+=te.elapsed,te.time=te.lastUpdate-te.startTime;var Me=te.time-te.nextTime;if(Me>0){te.frame++,te.nextTime+=Me+(Me>=te.frameFPS?4:te.frameFPS-Me);for(var kt=te.time-te.prevTime,qt=0;qt=te.emptyTime)){te.emptyTime=0,te.sleep();return}te.req&&(te.id=te.req(te.tick))},this.wake=function(){te.id&&te.sleep(),te.req=te.useTimeout?function(wt){return setTimeout(wt,te.frameFPS)}:_r(),te.tick(),te.state="wake"},this.sleep=function(){te.removeReq(te.id),te.id=-1,te.req=void 0,te.state="sleep"},this.add=function(wt){var Me="TweenOneTicker_".concat(te.tweenId);return te.tweenId+=1,te.tickFn.findIndex(function(kt){return kt.key===Me})===-1&&te.tickFn.push({key:Me,fn:wt}),te.emptyTime=0,te.req||te.wake(),Me},this.clear=function(wt){te.tickFn=te.tickFn.filter(function(Me){return Me.key!==wt&&Me.fn!==wt})},this.timeout=function(wt,Me){if(typeof wt!="function")return console.warn("not function");var kt=te.time,qt=te.add(function(){var dt=te.time-kt;dt>=(Me||0)&&(te.clear(qt),wt())});return qt},this.interval=function(wt,Me){if(typeof wt!="function")return console.warn("not function"),null;var kt=te.time;return te.add(function(){var qt=te.time-kt;qt>=(Me||0)&&(kt=te.time,wt())})}}return(0,$.Z)(Ht,[{key:"fps",value:function(wt,Me){this.frameFPS=1e3/(wt||240),this.nextTime=this.time+this.frameFPS,this.useTimeout=typeof Me=="undefined"?this.useTimeout:Me,this.useTimeout&&(this.req=function(kt){return setTimeout(kt,wt)})}}]),Ht}(),Or=new Ar,Br=Or,cn=function(){function Ht(){var te=this;(0,h.Z)(this,Ht),this.children=[],this.autoSleep=200,this.tickerKey=void 0,this.startTime=void 0,this.addChild=function(wt){te.children.indexOf(wt)===-1?(te.children.push(wt),te.updateTickerState()):te.start()},this.removeChild=function(wt){te.children=te.children.filter(function(Me){return Me!==wt}),te.updateTickerState()},this.kill=function(wt){te.children=te.children.filter(function(Me){var kt=Me.root.targets,qt=kt.map(function(Ut,Q){if(wt.indexOf(Ut)===-1)return Ut;delete Ut._tweenOneVars});Me.root.targets=qt;var dt=!!qt.filter(function(Ut){return Ut}).length;return dt||Me.kill(),dt}),te.updateTickerState()},this.killAll=function(wt){wt&&(te.children.forEach(function(Me){Me==null||Me.root.targets.forEach(function(kt){kt&&delete kt._tweenOneVars})}),te.children=[]),Br.clear(te.tickerKey),te.tickerKey=void 0},this.getTotalTime=function(){for(var wt=0,Me=0;Me0)})?te.killAll(!te.children.length):te.start()},this.start=function(){te.tickerKey||(te.tickerKey=Br.add(te.render))},this.render=function(wt){for(var Me=wt.time,kt=wt.elapsed,qt=kt===void 0?0:kt,dt=te.children,Ut=dt.length,Q=0;QR&&Me=Ft})[0]||Me.getPointAtLength(mt*kt);return 1-Bt.y/qt}};var Xn=Un(),xr=function(){function Ht(te){var wt=this;(0,h.Z)(this,Ht),this.item=void 0,this.vars={},this.start=void 0,this.parent=void 0,this.root=void 0,this.startAt={},this.mode=void 0,this.appearTo=0,this.props={},this.index=void 0,this.register=void 0,this.reverseStart=void 0,this.repeatNum=0,this.prevMoment=void 0,this.easing=void 0,this.changeValueToVars=function(dt,Ut,Q){var ot=(Array.isArray(Ut)||dt.match(/color|fill|stroke|.*shadow/i)&&typeof Ut=="string"||typeof Ut=="string"&&Ut.split(/[\s|,]/).length>1)&&!(dt in St);if(dt in St||ot)return Q?Ut:{value:Ut,plugins:[],array:ot};var R=parseFloat(Ut.toString().replace(/=/g,"")),M=Ut.toString().replace(/[^a-z|%]/g,""),O=Ut.toString().charAt(1)==="="?Ut.toString().replace(/[^\+\=|\-\=]/gi,""):"";return{vars:R,unit:M,count:O}},this.setEase=function(dt){if(typeof dt=="function"){wt.easing=dt;return}else if(dt.match(/,/g)){wt.easing=Xn.path(dt);return}wt.easing=Xn[dt]},this.getTotalTime=function(){var dt=wt.props,Ut=dt.duration,Q=Ut===void 0?450:Ut,ot=dt.delay,R=ot===void 0?0:ot,M=dt.repeat,O=M===void 0?0:M,X=dt.repeatDelay,mt=X===void 0?0:X;return O===-1?Number.MAX_VALUE:R+Q*(O+1)+mt*O},this.getEaseToRatio=function(dt,Ut){var Q=wt.props.ease,ot=Q===void 0?"":Q;return(dt===0||dt===1)&&!(typeof ot=="function"||ot.match(/,/g))?dt:wt.easing(Ut?1-dt:dt,Ut?1:0,Ut?0:1,1)},this.setRatioToVars=function(dt){for(var Ut=wt.vars,Q=wt.root,ot=0;otQ?Q:Ut,Ut},this.render=function(dt){var Ut=dt.moment,Q=dt.fps,ot=Q===void 0?0:Q,R=dt.silence,M=dt.render,O=wt.parent,X=wt.root,mt=wt.props,Ft=Xt(X.targets),Bt=O.onChange,ee=mt.repeat,Le=ee===void 0?0:ee,me=mt.type,Xe=me===void 0?"to":me,pr=mt.duration,Ze=pr===void 0?450:pr,Pr=mt.delay,un=Pr===void 0?0:Pr,Ke=mt.repeatDelay,lr=Ke===void 0?0:Ke,Rr=mt.yoyo;Le=Le===-1?Number.MAX_VALUE:Le;var Dr=Ut-un,ce=Math.floor(Dr/(Ze+lr))||0;ce=ce>Le?Le:ce,ce=ce<0?0:ce,Dr=Dr-(Ze+lr)*ce;var jt=!!(Rr&&ce%2),pe=Xe==="from",Oe=jt&&pe?!1:jt||pe;Dr=Oe?Ze-Dr:Dr;var Se=pe?0:un,Fe=Oe?1:0;if(!wt.register&&Ut>=Se&&(wt.onRegisterAnimate(),(Oe&&Dr<=0||!Oe&&Dr>=Ze&&Ze)&&(wt.prevMoment=Ut,Fe=Oe?0:1),wt.setRatioToVars(Fe),Bt({index:wt.index,vars:X.vars})),wt.register&&Ut>un-ot&&Ut=wt.totalTime&&wt.mode!=="onComplete"&&wt.prevMoment!==void 0||wt.prevMoment===void 0&&Ut>=wt.totalTime&&Ze?(Fe=Oe?0:1,wt.mode="onComplete",wt.props.onComplete&&wt.props.onComplete({mode:wt.mode,index:wt.index,moment:Dr,ratio:Fe,targets:Ft,vars:Xt(X.vars)})):wt.prevMoment===void 0||Ut<=0&&Ut>-ot&&wt.mode!=="onStart"&&wt.prevMoment>Ut?(wt.mode="onStart",wt.props.onStart&&wt.props.onStart({mode:wt.mode,index:wt.index,moment:Dr,ratio:Fe,targets:Ft,vars:Xt(X.vars)})):(Fe=Dr&&Ze?Dr/Ze:0,wt.mode="onUpdate",wt.props.onUpdate&&wt.props.onUpdate({mode:wt.mode,index:wt.index,moment:Dr,ratio:Fe,targets:Ft,vars:Xt(X.vars)})),Le&&ce!==wt.repeatNum&&Ut&&wt.mode==="onUpdate"&&(wt.mode="onRepeat",wt.props.onRepeat&&wt.props.onRepeat({mode:wt.mode,index:wt.index,moment:Dr,ratio:Fe,targets:Ft,vars:Xt(wt.root.vars)})),wt.setRatioToVars(wt.getEaseToRatio(Fe,pe)),Le&&(wt.repeatNum=ce);var or={mode:wt.mode,moment:Dr,repeat:ce,ratio:Fe,targets:X.targets,vars:X.vars,index:wt.index};R&&(or.silence=R),M&&(or.render=M),Bt(or),wt.prevMoment=Ut}},this.item=te,this.startAt=(0,k.Z)({},te.startAt),Object.keys(this.startAt).forEach(function(dt){wt.startAt[dt]=wt.changeValueToVars(dt,wt.startAt[dt],!0)});var Me={};for(var kt in te){var qt=te[kt];kt in ft?Me[kt]=qt:this.vars[kt]=this.changeValueToVars(kt,qt)}this.props=(0,k.Z)((0,k.Z)({},ft),Me),this.setEase(this.props.ease)}return(0,$.Z)(Ht,[{key:"totalTime",get:function(){return this.getTotalTime()}}]),Ht}(),$e=(0,$.Z)(function Ht(te){var wt=this;(0,h.Z)(this,Ht),this.props=void 0,this.id=void 0,this.children=[],this.totalTime=0,this.totalTimeRegion=0,this.childTotalTime=0,this.childRegionTotalTime=0,this.prevMoment=void 0,this.progressTime=0,this.progressMoment=-1,this.startMoment=0,this.startTime=0,this.repeatNum=0,this.mode="onTimelineStart",this.pausedState=void 0,this.reverseState=void 0,this.root=void 0,this.parent=void 0,this.regionStartTime=0,this.regionEndTime=void 0,this.onChangeChild=void 0,this.onChangeTimeline=void 0,this.init=function(){for(var dt=wt.props,Ut=dt.reverse,Q=dt.animation,ot=dt.moment,R=gt(Q),M=0;Mwt.childTotalTime&&(wt.childTotalTime=Q,wt.childRegionTotalTime=Q)}else wt.childTotalTime+=Ut.totalTime,wt.childRegionTotalTime+=Ut.totalTime}wt.regionStartTime&&(wt.childRegionTotalTime-=wt.regionStartTime),wt.regionEndTime&&(wt.childRegionTotalTime=wt.regionEndTime-wt.regionStartTime);var ot=wt.props,R=ot.repeat,M=R===void 0?0:R,O=ot.repeatDelay,X=O===void 0?0:O,mt=ot.delay;wt.totalTime=M===-1?Number.MAX_VALUE:mt+wt.childTotalTime*(M+1)+X*M,wt.totalTimeRegion=M===-1?Number.MAX_VALUE:mt+wt.childRegionTotalTime*(M+1)+X*M},this.setStartTimeOrMoment=function(dt){wt.startTime=Br.time,wt.startMoment=dt||wt.progressMoment},this.reRenderCall=function(){wt.render({time:wt.startTime,elapsed:Br.elapsed||Br.frameFPS})},this.play=function(dt){if(dt){var Q;(Q=wt.parent)===null||Q===void 0||Q.updateTickerState()}else{var Ut;(Ut=wt.parent)===null||Ut===void 0||Ut.addChild(wt)}},this.paused=function(){var dt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;wt.pausedState=dt,wt.setStartTimeOrMoment(),wt.play(dt)},this.reverse=function(dt){wt.reverseState=dt,wt.setStartTimeOrMoment(),wt.play(wt.pausedState)},this.goto=function(dt,Ut){var Q=dt-wt.regionStartTime;wt.startTime=Br.time,wt.startMoment=Q>wt.totalTime?wt.totalTime:Q,wt.progressMoment=wt.startMoment,wt.progressTime=Q,wt.play(wt.pausedState),wt.reRenderCall(),!!Ut!==wt.pausedState&&wt.paused(Ut)},this.kill=function(dt){if(typeof dt=="number")wt.paused(),delete wt.children[dt],wt.setTotalTime(),wt.paused(!1);else{var Ut;wt.children=[],(Ut=wt.parent)===null||Ut===void 0||Ut.removeChild(wt)}},this.onChange=function(dt){dt.timelineMoment=wt.progressMoment,wt.onChangeChild(dt)},this.render=function(dt){var Ut=dt.time,Q=dt.elapsed,ot=Q||Br.frameFPS||0,R=wt.totalTime,M=wt.totalTimeRegion,O=wt.childTotalTime,X=wt.childRegionTotalTime,mt=wt.children,Ft=wt.props,Bt=wt.startTime,ee=wt.reverseState,Le=wt.pausedState,me=wt.startMoment,Xe=wt.onChangeTimeline,pr=wt.parent,Ze=wt.root,Pr=wt.prevMoment,un=wt.regionStartTime,Ke=Ft.repeatDelay,lr=Ke===void 0?0:Ke,Rr=Ft.yoyo,Dr=Ft.delay,ce=Ft.repeat,jt=ce===void 0?0:ce;jt=jt===-1?Number.MAX_VALUE:jt;var pe=Ut-Bt-Dr,Oe=ee?me-pe:pe+me;if(!(Oe<-ot)){var Se=Oe<0?0:Oe;Se=Se>R?R:Se,Se=meM?me:Se;var Fe=jt?Math.floor(Se/(X+lr)):0;Fe=jt&&Fe>jt?jt:Fe;var or=Se-(X+lr)*Fe,gr=!!(Rr&&Fe%2);or=gr?X-or:or,or=un+or;var Jr=ee?!gr:gr;if(wt.mode="onTimelineUpdate",typeof Pr!="number"&&(wt.mode="onTimelineStart"),Se>=M-Dr&&typeof Pr=="number"&&(wt.mode="onTimelineComplete"),Fe!==wt.repeatNum&&(wt.mode="onTimelineRepeat",Se>O*Fe&&Se=0;Jr?Gn++:Gn--){var pn=mt[Gn];Jr||(pn.prevMoment=void 0),pn.render({moment:Jr?pn.totalTime:0,fps:ot})}Xe({moment:Se,totalTime:R,repeat:Fe,mode:wt.mode,targets:Ze.targets}),wt.mode="onTimelineUpdate"}jt&&(wt.repeatNum=Fe),wt.progressMoment=Se,wt.prevMoment=Se,wt.progressTime=pe;for(var qn=0;qn=ln.appearTo-ot&&orVn+ot&&!gr&&ln.totalTime||typeof ln.mode=="undefined"&&!ln.totalTime)&&(ln.render({moment:ln.totalTime,fps:ot}),ln.prevMoment=void 0),orVn&&ln.mode==="onComplete"&&!gr)return;ba=or>Vn?Vn:or,ln.render({moment:ba-ln.appearTo,fps:ot}),Vn||(ln.render({moment:ln.totalTime,fps:ot,render:!0}),ln.prevMoment=void 0)}}Xe({moment:Se,totalTime:R,repeat:Fe,mode:wt.mode,targets:Ze.targets}),(Le||M&&Oe+Dr>=M&&!ee||ee&&Oe+Dr<=0||!mt.length)&&(pr==null||pr.removeChild(wt))}},this.props=te;var Me=this.props,kt=Me.paused,qt=Me.reverse;this.reverseState=qt,this.pausedState=kt,this.regionStartTime=te.regionStartTime||0,this.regionEndTime=te.regionEndTime});St.push(ae),St.push(Tt),St.push(ue);var Tr=0,qr=new an,gn=function(){function Ht(te,wt){var Me=this;(0,h.Z)(this,Ht),this.targets=void 0,this.props=void 0,this.timeline=void 0,this.animate=void 0,this.$reverse=!1,this.vars=[],this.initTime=void 0,this.attr=void 0,this.init=function(){var kt=(0,b.Z)(Y().mark(function qt(dt){var Ut;return Y().wrap(function(ot){for(;;)switch(ot.prev=ot.next){case 0:Ut=bt(dt),Me.targets[0].tagName&&!Me.attr&&(Ut.animation=gt(Ut.animation).map(function(R){var M={style:{}};for(var O in R)O in St||O in ft?M[O]=R[O]:M.style[O]=R[O];return Object.keys(M.style).length||delete M.style,R.duration&&(R.duration=Math.round(R.duration)),R.delay&&(R.delay=Math.round(R.delay)),R.appearTo&&(R.appearTo=Math.round(R.appearTo)),R.repeatDelay&&(R.repeatDelay=Math.round(R.repeatDelay)),M})),Me.animate=new $e(Ut),Me.animate.id="TweenOne_".concat(Tr),Tr++,Me.animate.startTime=Me.initTime,Me.animate.onChangeChild=Me.onChange,Me.animate.onChangeTimeline=Me.onChangeTimeline,Me.animate.root=Me,Me.animate.parent=Me.timeline,Me.animate.init();case 11:case"end":return ot.stop()}},qt)}));return function(qt){return kt.apply(this,arguments)}}(),this.renderToDom=function(){for(var kt=0;ktObject.keys(dt).length?qt:dt,Q=Object.keys(qt).length>Object.keys(dt).length?dt:qt;Object.keys(Ut).forEach(function(ot){wt&&(ot in Q||(wt=!1),(0,x.Z)(Ut[ot])==="object"&&(0,x.Z)(Q[ot])==="object"?wt=sn(Ut[ot],Q[ot]):typeof Ut[ot]=="function"&&typeof Q[ot]=="function"?Ut[ot].toString().replace(/\s+/g,"")!==Q[ot].toString().replace(/\s+/g,"")&&(wt=!1):Ut[ot]!==Q[ot]&&(wt=!1))})};return Array.isArray(Ht)&&Array.isArray(te)?Ht.forEach(function(kt,qt){Me(kt,te[qt])}):Me(Ht,te),wt}var Wn=["component","componentProps","animation","attr","paused","reverse","repeat","repeatDelay","yoyo","moment","onChange","onChangeTimeline","resetStyle","killPrevAnim"],Mn=L.forwardRef(function(Ht,te){var wt=Ht.component,Me=wt===void 0?"div":wt,kt=Ht.componentProps,qt=Ht.animation,dt=Ht.attr,Ut=Ht.paused,Q=Ht.reverse,ot=Ht.repeat,R=Ht.repeatDelay,M=Ht.yoyo,O=Ht.moment,X=Ht.onChange,mt=Ht.onChangeTimeline,Ft=Ht.resetStyle,Bt=Ht.killPrevAnim,ee=Bt===void 0?!0:Bt,Le=(0,T.Z)(Ht,Wn),me=Le||{},Xe=me.children,pr=me.className,Ze=me.style,Pr=Ze===void 0?{}:Ze,un=(0,L.useRef)(),Ke=(0,L.useRef)(),lr=(0,L.useRef)(),Rr=function(Jr,Gn){var pn=lr.current;if(pn){if(Jr==="moment"){typeof Gn=="number"&&pn.goto(Gn,Ut);return}pn[Jr]=!!Gn}};A(function(){Rr("paused",Ut)},[Ut]),A(function(){Rr("moment",O)},[O]),A(function(){Rr("reverse",Q)},[Q]),A(function(){if(!un.current)return console.warn("Warning: TweenOne domRef is error.");if(!sn(qt,Ke.current)){var gr=dn(un.current).map(function(pn){return pn instanceof Element||!(pn instanceof L.Component)?pn:(0,D.findDOMNode)(pn)}).filter(function(pn,qn){return pn instanceof Element?pn:(console.warn("Warning: TweenOne tag[".concat(qn,"] is not dom.")),!1)});if(lr.current&&ee&&lr.current.kill(),Ft&&lr.current){var Jr=Me?Pr:(0,k.Z)((0,k.Z)({},Pr),Xe.props.style),Gn=Object.keys(Jr).map(function(pn){return"".concat((0,U.Rs)(pn),":").concat((0,U.YJ)(pn,Jr[pn]))}).join(";");gr.forEach(function(pn){pn.setAttribute("style",Gn),delete pn._tweenOneVars})}lr.current=qt&&Mr(gr,{animation:qt,attr:dt,yoyo:M,moment:O,repeat:ot,reverse:Q,paused:Ut,repeatDelay:R,onChange:X,onChangeTimeline:mt}),Ke.current=qt}},[qt]),(0,L.useEffect)(function(){return function(){lr.current&&lr.current.kill&&lr.current.kill()}},[]);var Dr=function(Jr){un.current=Jr,te&&"current"in te?te.current=Jr:typeof te=="function"&&te(Jr)};if(!Me&&Xe&&typeof Xe!="string"&&typeof Xe!="boolean"&&typeof Xe!="number"){var ce=Xe.props,jt=ce||{},pe=jt.style,Oe=jt.className,Se=Oe===void 0?"":Oe,Fe=(0,k.Z)((0,k.Z)({},pe),Pr),or=pr?"".concat(pr," ").concat(Se).trim():Se;return L.cloneElement(Xe,{style:Fe,ref:Dr,className:(0,E.Z)(new Set(or.split(/\s+/))).join(" ").trim()||void 0})}return Me?(0,L.createElement)(Me,(0,k.Z)((0,k.Z)({ref:Dr},Le),kt)):(console.warn("Warning: component is null, children must be ReactElement."),Xe)});Mn.isTweenOne=!0,Mn.displayName="TweenOne";var In=Mn,jn=["component","componentProps","leave","enter","appear","resetStyle","animatingClassName","onEnd","exclusive"],at=L.forwardRef(function(Ht,te){var wt=Ht.component,Me=wt===void 0?"div":wt,kt=Ht.componentProps,qt=kt===void 0?{}:kt,dt=Ht.leave,Ut=dt===void 0?{x:-50,opacity:0}:dt,Q=Ht.enter,ot=Q===void 0?{x:50,opacity:0,type:"from"}:Q,R=Ht.appear,M=R===void 0?!0:R,O=Ht.resetStyle,X=O===void 0?!0:O,mt=Ht.animatingClassName,Ft=mt===void 0?["tween-one-entering","tween-one-leaving"]:mt,Bt=Ht.onEnd,ee=Bt===void 0?function(){}:Bt,Le=Ht.exclusive,me=Le===void 0?!1:Le,Xe=(0,T.Z)(Ht,jn),pr=(0,L.useRef)([]),Ze=(0,L.useRef)([]),Pr=(0,L.useRef)({}),un=(0,L.useRef)(!1),Ke=(0,L.useRef)([]),lr=(0,L.useRef)({}),Rr=P(y(Ht)),Dr=(0,L.useRef)(Rr),ce=(0,L.useState)(Rr),jt=(0,w.Z)(ce,2),pe=jt[0],Oe=jt[1],Se=function(ln){var Vn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ca=ln.key;return Pr.current[ca]=L.createElement(In,(0,k.Z)((0,k.Z)({},Vn),{},{key:ca,component:null}),ln),Pr.current[ca]},Fe=function(ln,Vn){var ca=ln.replace(Ft[Vn?1:0],"").trim();return ca.indexOf(Ft[Vn?0:1])===-1&&(ca="".concat(ca," ").concat(Ft[Vn?0:1]).trim()),ca},or=function(ln,Vn){var ca=m(Vn,ln);return pr.current=[],Ze.current=[],ln.forEach(function(ba){if(ba){var Ea=ba.key,Ni=p(Vn,Ea);Ea&&Pr.current[Ea]&&(Pr.current[Ea]=L.cloneElement(Pr.current[Ea],{},ba)),!Ni&&Ea&&pr.current.push(Ea)}}),Vn.forEach(function(ba){if(ba){var Ea=ba.key,Ni=p(ln,Ea);!Ni&&Ea&&(Ze.current.push(Ea),delete Pr.current[Ea])}}),ca},gr=function(){if(!Object.keys(lr.current).length&&Ke.current.length){var ln=or(Ke.current[Ke.current.length-1],Dr.current);Oe(ln),Ke.current=[]}},Jr=function(ln,Vn,ca){var ba=ca.targets,Ea=(0,x.Z)(ba.className)==="object"&&"baseVal"in ba.className,Ni=Vn==="enter"||Vn==="appear";if(ln&&ca.mode==="onTimelineComplete"){if(delete lr.current[ln],Ea?ba.className.baseVal=ba.className.baseVal.replace(Ft[Ni?0:1],"").trim():ba.className=ba.className.replace(Ft[Ni?0:1],"").trim(),Ni)pr.current.splice(pr.current.indexOf(ln),1),pr.current.length||gr();else if(Vn==="leave"&&(Ze.current.splice(Ze.current.indexOf(ln),1),Dr.current=Dr.current.filter(function(ei){return ln!==ei.key}),!Ze.current.length)){var ti=Dr.current.map(function(ei){return ei.key});Object.keys(Pr.current).forEach(function(ei){ti.indexOf(ei)===-1&&delete Pr.current[ei]}),Oe(Dr.current)}ee({key:ln,type:Vn,target:ca.targets})}},Gn=function(ln,Vn,ca){var ba=ca==="leave"?Ut:ot;if(ca==="appear"){var Ea=S(M,ln.key,Vn);ba=Ea&&ot||null}var Ni=S(ba,ln.key,Vn),ti=function(Co){Jr(ln.key,ca,Co)},ei=ca==="appear"&&!M?ln.props.className:Fe(ln.props.className||"",ca==="enter"||ca==="appear")||void 0,wi={key:ln.key,animation:Ni,onChangeTimeline:ti,resetStyle:X,className:ei};return(ln.key&&pr.current.concat(Ze.current).indexOf(ln.key)>=0||!un.current&&ba)&&ln.key&&!Pr.current[ln.key]&&(lr.current[ln.key]=ca),Se(ln,wi)};A(function(){if(un.current){var qn=P(Ht.children).filter(function(Vn){return Vn}),ln=P(Dr.current);Object.keys(lr.current).length&&!me?Ke.current.push(qn):Oe(or(qn,ln))}},[Ht.children]),A(function(){gr()}),(0,L.useEffect)(function(){un.current=!0},[]),Dr.current=pe;var pn=pe.map(function(qn,ln){if(!qn||!qn.key)return qn;var Vn=qn.key;return Ze.current.indexOf(Vn)>=0?Gn(qn,Ze.current.indexOf(Vn),"leave"):(pr.current.indexOf(Vn)>=0||lr.current[Vn]&&Ze.current.indexOf(Vn)===-1)&&!(lr.current[Vn]==="enter"&&Pr.current[Vn])?Gn(qn,pr.current.indexOf(Vn),"enter"):un.current?Pr.current[Vn]:Gn(qn,ln,"appear")});return g?Me?(0,L.createElement)(Me,(0,k.Z)((0,k.Z)((0,k.Z)({},Xe),qt),{},{ref:te}),Ht.children):L.createElement(L.Fragment,null,Ht.children):Me?(0,L.createElement)(Me,(0,k.Z)((0,k.Z)((0,k.Z)({},Xe),qt),{},{ref:te}),pn):pn[0]?(0,L.cloneElement)(pn[0],{ref:te}):null});at.displayName="TweenOneGroup",at.isTweenOneGroup=!0;var Je=at},217857:function(Ve,z,C){"use strict";var x;x={value:!0};var k=C(667294),w=C(308273);function T(rt,ft){var it=rt==null?null:typeof Symbol!="undefined"&&rt[Symbol.iterator]||rt["@@iterator"];if(it!=null){var bt,gt,Xt,Ct,At=[],Z=!0,J=!1;try{if(Xt=(it=it.call(rt)).next,ft===0){if(Object(it)!==it)return;Z=!1}else for(;!(Z=(bt=Xt.call(it)).done)&&(At.push(bt.value),At.length!==ft);Z=!0);}catch(yt){J=!0,gt=yt}finally{try{if(!Z&&it.return!=null&&(Ct=it.return(),Object(Ct)!==Ct))return}finally{if(J)throw gt}}return At}}function L(rt,ft){var it=Object.keys(rt);if(Object.getOwnPropertySymbols){var bt=Object.getOwnPropertySymbols(rt);ft&&(bt=bt.filter(function(gt){return Object.getOwnPropertyDescriptor(rt,gt).enumerable})),it.push.apply(it,bt)}return it}function P(rt){for(var ft=1;ft=0)&&(it[gt]=rt[gt]);return it}function y(rt,ft){if(rt==null)return{};var it=S(rt,ft),bt,gt;if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(rt);for(gt=0;gt=0)&&Object.prototype.propertyIsEnumerable.call(rt,bt)&&(it[bt]=rt[bt])}return it}function g(rt,ft){return A(rt)||T(rt,ft)||E(rt,ft)||F()}function A(rt){if(Array.isArray(rt))return rt}function E(rt,ft){if(rt){if(typeof rt=="string")return D(rt,ft);var it=Object.prototype.toString.call(rt).slice(8,-1);if(it==="Object"&&rt.constructor&&(it=rt.constructor.name),it==="Map"||it==="Set")return Array.from(rt);if(it==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(it))return D(rt,ft)}}function D(rt,ft){(ft==null||ft>rt.length)&&(ft=rt.length);for(var it=0,bt=new Array(ft);it0?Pt.current=setTimeout(ae,At*1e3):ae(),J==null||J({pauseResume:ie,reset:Lt,update:ne})}),ie=$(function(){Qt().pauseResume(),yt==null||yt({reset:Lt,start:ve,update:ne})}),Lt=$(function(){Qt().el&&(Pt.current&&clearTimeout(Pt.current),Qt().reset(),_t==null||_t({pauseResume:ie,start:ve,update:ne}))}),ne=$(function(ae){Qt().update(ae),nt==null||nt({pauseResume:ie,reset:Lt,start:ve})}),ve=$(function(){Lt(),ue()}),Wt=$(function(ae){Xt&&(ae&&Lt(),ue())});return k.useEffect(function(){St.current?Ct&&Wt(!0):(St.current=!0,Wt())},[Ct,St,Wt,At,ft.start,ft.suffix,ft.prefix,ft.duration,ft.separator,ft.decimals,ft.decimal,ft.formattingFn]),k.useEffect(function(){return function(){Lt()}},[Lt]),{start:ve,pauseResume:ie,reset:Lt,update:ne,getCountUp:Qt}},q=["className","redraw","containerProps","children","style"],tt=function(ft){var it=ft.className,bt=ft.redraw,gt=ft.containerProps,Xt=ft.children,Ct=ft.style,At=y(ft,q),Z=k.useRef(null),J=k.useRef(!1),yt=H(P(P({},At),{},{ref:Z,startOnMount:typeof Xt!="function"||ft.delay===0,enableReinitialize:!1})),_t=yt.start,nt=yt.reset,vt=yt.update,It=yt.pauseResume,Pt=yt.getCountUp,St=$(function(){_t()}),Dt=$(function(ie){ft.preserveValue||nt(),vt(ie)}),Qt=$(function(){if(typeof ft.children=="function"&&!(Z.current instanceof Element)){console.error(`Couldn't find attached element to hook the CountUp instance into! Try to attach "containerRef" from the render prop to a an Element, eg. .`);return}Pt()});k.useEffect(function(){Qt()},[Qt]),k.useEffect(function(){J.current&&Dt(ft.end)},[ft.end,Dt]);var ue=bt&&ft;return k.useEffect(function(){bt&&J.current&&St()},[St,bt,ue]),k.useEffect(function(){!bt&&J.current&&St()},[St,bt,ft.start,ft.suffix,ft.prefix,ft.duration,ft.separator,ft.decimals,ft.decimal,ft.className,ft.formattingFn]),k.useEffect(function(){J.current=!0},[]),typeof Xt=="function"?Xt({countUpRef:Z,start:_t,reset:nt,update:vt,pauseResume:It,getCountUp:Pt}):k.createElement("span",m({className:it,ref:Z,style:Ct},gt),typeof ft.start!="undefined"?Pt().formattingFn(ft.start):"")};z.ZP=tt,x=H},175668:function(Ve,z,C){"use strict";function x(nt){"@babel/helpers - typeof";return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(vt){return typeof vt}:function(vt){return vt&&typeof Symbol=="function"&&vt.constructor===Symbol&&vt!==Symbol.prototype?"symbol":typeof vt},x(nt)}Object.defineProperty(z,"__esModule",{value:!0}),Object.defineProperty(z,"DraggableCore",{enumerable:!0,get:function(){return S.default}}),z.default=void 0;var k=D(C(667294)),w=A(C(45697)),T=A(C(973935)),L=A(C(386010)),P=C(381825),p=C(102849),m=C(909280),S=A(C(180783)),y=A(C(955904)),g=["axis","bounds","children","defaultPosition","defaultClassName","defaultClassNameDragging","defaultClassNameDragged","position","positionOffset","scale"];function A(nt){return nt&&nt.__esModule?nt:{default:nt}}function E(nt){if(typeof WeakMap!="function")return null;var vt=new WeakMap,It=new WeakMap;return(E=function(St){return St?It:vt})(nt)}function D(nt,vt){if(!vt&&nt&&nt.__esModule)return nt;if(nt===null||x(nt)!=="object"&&typeof nt!="function")return{default:nt};var It=E(vt);if(It&&It.has(nt))return It.get(nt);var Pt={},St=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Dt in nt)if(Dt!=="default"&&Object.prototype.hasOwnProperty.call(nt,Dt)){var Qt=St?Object.getOwnPropertyDescriptor(nt,Dt):null;Qt&&(Qt.get||Qt.set)?Object.defineProperty(Pt,Dt,Qt):Pt[Dt]=nt[Dt]}return Pt.default=nt,It&&It.set(nt,Pt),Pt}function F(){return F=Object.assign||function(nt){for(var vt=1;vt=0)&&Object.prototype.propertyIsEnumerable.call(nt,Pt)&&(It[Pt]=nt[Pt])}return It}function b(nt,vt){if(nt==null)return{};var It={},Pt=Object.keys(nt),St,Dt;for(Dt=0;Dt=0)&&(It[St]=nt[St]);return It}function h(nt,vt){var It=Object.keys(nt);if(Object.getOwnPropertySymbols){var Pt=Object.getOwnPropertySymbols(nt);vt&&(Pt=Pt.filter(function(St){return Object.getOwnPropertyDescriptor(nt,St).enumerable})),It.push.apply(It,Pt)}return It}function $(nt){for(var vt=1;vtnt.length)&&(vt=nt.length);for(var It=0,Pt=new Array(vt);It, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."),St}return it(It,[{key:"componentDidMount",value:function(){typeof window.SVGElement!="undefined"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}},{key:"componentWillUnmount",value:function(){this.setState({dragging:!1})}},{key:"findDOMNode",value:function(){var St,Dt,Qt;return(St=(Dt=this.props)===null||Dt===void 0||(Qt=Dt.nodeRef)===null||Qt===void 0?void 0:Qt.current)!==null&&St!==void 0?St:T.default.findDOMNode(this)}},{key:"render",value:function(){var St,Dt=this.props,Qt=Dt.axis,ue=Dt.bounds,ie=Dt.children,Lt=Dt.defaultPosition,ne=Dt.defaultClassName,ve=Dt.defaultClassNameDragging,Wt=Dt.defaultClassNameDragged,ae=Dt.position,Ce=Dt.positionOffset,xe=Dt.scale,Jt=Y(Dt,g),we={},Tt=null,Pe=!!ae,_r=!Pe||this.state.dragging,Ar=ae||Lt,Or={x:(0,p.canDragX)(this)&&_r?this.state.x:Ar.x,y:(0,p.canDragY)(this)&&_r?this.state.y:Ar.y};this.state.isElementSVG?Tt=(0,P.createSVGTransform)(Or,Ce):we=(0,P.createCSSTransform)(Or,Ce);var Br=(0,L.default)(ie.props.className||"",ne,(St={},yt(St,ve,this.state.dragging),yt(St,Wt,this.state.dragged),St));return k.createElement(S.default,F({},Jt,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),k.cloneElement(k.Children.only(ie),{className:Br,style:$($({},ie.props.style),we),transform:Tt}))}}],[{key:"getDerivedStateFromProps",value:function(St,Dt){var Qt=St.position,ue=Dt.prevPropsPosition;return Qt&&(!ue||Qt.x!==ue.x||Qt.y!==ue.y)?((0,y.default)("Draggable: getDerivedStateFromProps %j",{position:Qt,prevPropsPosition:ue}),{x:Qt.x,y:Qt.y,prevPropsPosition:$({},Qt)}):null}}]),It}(k.Component);z.default=_t,yt(_t,"displayName","Draggable"),yt(_t,"propTypes",$($({},S.default.propTypes),{},{axis:w.default.oneOf(["both","x","y","none"]),bounds:w.default.oneOfType([w.default.shape({left:w.default.number,right:w.default.number,top:w.default.number,bottom:w.default.number}),w.default.string,w.default.oneOf([!1])]),defaultClassName:w.default.string,defaultClassNameDragging:w.default.string,defaultClassNameDragged:w.default.string,defaultPosition:w.default.shape({x:w.default.number,y:w.default.number}),positionOffset:w.default.shape({x:w.default.oneOfType([w.default.number,w.default.string]),y:w.default.oneOfType([w.default.number,w.default.string])}),position:w.default.shape({x:w.default.number,y:w.default.number}),className:m.dontSetMe,style:m.dontSetMe,transform:m.dontSetMe})),yt(_t,"defaultProps",$($({},S.default.defaultProps),{},{axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1}))},180783:function(Ve,z,C){"use strict";function x(Ct){"@babel/helpers - typeof";return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(At){return typeof At}:function(At){return At&&typeof Symbol=="function"&&At.constructor===Symbol&&At!==Symbol.prototype?"symbol":typeof At},x(Ct)}Object.defineProperty(z,"__esModule",{value:!0}),z.default=void 0;var k=g(C(667294)),w=S(C(45697)),T=S(C(973935)),L=C(381825),P=C(102849),p=C(909280),m=S(C(955904));function S(Ct){return Ct&&Ct.__esModule?Ct:{default:Ct}}function y(Ct){if(typeof WeakMap!="function")return null;var At=new WeakMap,Z=new WeakMap;return(y=function(yt){return yt?Z:At})(Ct)}function g(Ct,At){if(!At&&Ct&&Ct.__esModule)return Ct;if(Ct===null||x(Ct)!=="object"&&typeof Ct!="function")return{default:Ct};var Z=y(At);if(Z&&Z.has(Ct))return Z.get(Ct);var J={},yt=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var _t in Ct)if(_t!=="default"&&Object.prototype.hasOwnProperty.call(Ct,_t)){var nt=yt?Object.getOwnPropertyDescriptor(Ct,_t):null;nt&&(nt.get||nt.set)?Object.defineProperty(J,_t,nt):J[_t]=Ct[_t]}return J.default=Ct,Z&&Z.set(Ct,J),J}function A(Ct,At){return b(Ct)||Y(Ct,At)||D(Ct,At)||E()}function E(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D(Ct,At){if(Ct){if(typeof Ct=="string")return F(Ct,At);var Z=Object.prototype.toString.call(Ct).slice(8,-1);if(Z==="Object"&&Ct.constructor&&(Z=Ct.constructor.name),Z==="Map"||Z==="Set")return Array.from(Ct);if(Z==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z))return F(Ct,At)}}function F(Ct,At){(At==null||At>Ct.length)&&(At=Ct.length);for(var Z=0,J=new Array(At);Z not mounted on DragStart!");var Pt=It.ownerDocument;if(!(J.props.disabled||!(vt.target instanceof Pt.defaultView.Node)||J.props.handle&&!(0,L.matchesSelectorAndParentsTo)(vt.target,J.props.handle,It)||J.props.cancel&&(0,L.matchesSelectorAndParentsTo)(vt.target,J.props.cancel,It))){vt.type==="touchstart"&&vt.preventDefault();var St=(0,L.getTouchIdentifier)(vt);J.setState({touchIdentifier:St});var Dt=(0,P.getControlPosition)(vt,St,tt(J));if(Dt!=null){var Qt=Dt.x,ue=Dt.y,ie=(0,P.createCoreData)(tt(J),Qt,ue);(0,m.default)("DraggableCore: handleDragStart: %j",ie),(0,m.default)("calling",J.props.onStart);var Lt=J.props.onStart(vt,ie);Lt===!1||J.mounted===!1||(J.props.enableUserSelectHack&&(0,L.addUserSelectStyles)(Pt),J.setState({dragging:!0,lastX:Qt,lastY:ue}),(0,L.addEvent)(Pt,gt.move,J.handleDrag),(0,L.addEvent)(Pt,gt.stop,J.handleDragStop))}}}),it(tt(J),"handleDrag",function(vt){var It=(0,P.getControlPosition)(vt,J.state.touchIdentifier,tt(J));if(It!=null){var Pt=It.x,St=It.y;if(Array.isArray(J.props.grid)){var Dt=Pt-J.state.lastX,Qt=St-J.state.lastY,ue=(0,P.snapToGrid)(J.props.grid,Dt,Qt),ie=A(ue,2);if(Dt=ie[0],Qt=ie[1],!Dt&&!Qt)return;Pt=J.state.lastX+Dt,St=J.state.lastY+Qt}var Lt=(0,P.createCoreData)(tt(J),Pt,St);(0,m.default)("DraggableCore: handleDrag: %j",Lt);var ne=J.props.onDrag(vt,Lt);if(ne===!1||J.mounted===!1){try{J.handleDragStop(new MouseEvent("mouseup"))}catch(Wt){var ve=document.createEvent("MouseEvents");ve.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),J.handleDragStop(ve)}return}J.setState({lastX:Pt,lastY:St})}}),it(tt(J),"handleDragStop",function(vt){if(J.state.dragging){var It=(0,P.getControlPosition)(vt,J.state.touchIdentifier,tt(J));if(It!=null){var Pt=It.x,St=It.y;if(Array.isArray(J.props.grid)){var Dt=Pt-J.state.lastX||0,Qt=St-J.state.lastY||0,ue=(0,P.snapToGrid)(J.props.grid,Dt,Qt),ie=A(ue,2);Dt=ie[0],Qt=ie[1],Pt=J.state.lastX+Dt,St=J.state.lastY+Qt}var Lt=(0,P.createCoreData)(tt(J),Pt,St),ne=J.props.onStop(vt,Lt);if(ne===!1||J.mounted===!1)return!1;var ve=J.findDOMNode();ve&&J.props.enableUserSelectHack&&(0,L.removeUserSelectStyles)(ve.ownerDocument),(0,m.default)("DraggableCore: handleDragStop: %j",Lt),J.setState({dragging:!1,lastX:NaN,lastY:NaN}),ve&&((0,m.default)("DraggableCore: Removing handlers"),(0,L.removeEvent)(ve.ownerDocument,gt.move,J.handleDrag),(0,L.removeEvent)(ve.ownerDocument,gt.stop,J.handleDragStop))}}}),it(tt(J),"onMouseDown",function(vt){return gt=bt.mouse,J.handleDragStart(vt)}),it(tt(J),"onMouseUp",function(vt){return gt=bt.mouse,J.handleDragStop(vt)}),it(tt(J),"onTouchStart",function(vt){return gt=bt.touch,J.handleDragStart(vt)}),it(tt(J),"onTouchEnd",function(vt){return gt=bt.touch,J.handleDragStop(vt)}),J}return U(Z,[{key:"componentDidMount",value:function(){this.mounted=!0;var yt=this.findDOMNode();yt&&(0,L.addEvent)(yt,bt.touch.start,this.onTouchStart,{passive:!1})}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var yt=this.findDOMNode();if(yt){var _t=yt.ownerDocument;(0,L.removeEvent)(_t,bt.mouse.move,this.handleDrag),(0,L.removeEvent)(_t,bt.touch.move,this.handleDrag),(0,L.removeEvent)(_t,bt.mouse.stop,this.handleDragStop),(0,L.removeEvent)(_t,bt.touch.stop,this.handleDragStop),(0,L.removeEvent)(yt,bt.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,L.removeUserSelectStyles)(_t)}}},{key:"findDOMNode",value:function(){var yt,_t,nt;return(yt=this.props)!==null&&yt!==void 0&&yt.nodeRef?(_t=this.props)===null||_t===void 0||(nt=_t.nodeRef)===null||nt===void 0?void 0:nt.current:T.default.findDOMNode(this)}},{key:"render",value:function(){return k.cloneElement(k.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}]),Z}(k.Component);z.default=Xt,it(Xt,"displayName","DraggableCore"),it(Xt,"propTypes",{allowAnyClick:w.default.bool,disabled:w.default.bool,enableUserSelectHack:w.default.bool,offsetParent:function(At,Z){if(At[Z]&&At[Z].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:w.default.arrayOf(w.default.number),handle:w.default.string,cancel:w.default.string,nodeRef:w.default.object,onStart:w.default.func,onDrag:w.default.func,onStop:w.default.func,onMouseDown:w.default.func,scale:w.default.number,className:p.dontSetMe,style:p.dontSetMe,transform:p.dontSetMe}),it(Xt,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},861193:function(Ve,z,C){"use strict";var x=C(175668),k=x.default,w=x.DraggableCore;Ve.exports=k,Ve.exports.default=k,Ve.exports.DraggableCore=w},381825:function(Ve,z,C){"use strict";function x(it){"@babel/helpers - typeof";return x=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(bt){return typeof bt}:function(bt){return bt&&typeof Symbol=="function"&&bt.constructor===Symbol&&bt!==Symbol.prototype?"symbol":typeof bt},x(it)}Object.defineProperty(z,"__esModule",{value:!0}),z.addClassName=rt,z.addEvent=A,z.addUserSelectStyles=q,z.createCSSTransform=$,z.createSVGTransform=U,z.getTouch=V,z.getTouchIdentifier=H,z.getTranslation=W,z.innerHeight=Y,z.innerWidth=b,z.matchesSelector=y,z.matchesSelectorAndParentsTo=g,z.offsetXYFromParent=h,z.outerHeight=D,z.outerWidth=F,z.removeClassName=ft,z.removeEvent=E,z.removeUserSelectStyles=tt;var k=C(909280),w=L(C(138650));function T(it){if(typeof WeakMap!="function")return null;var bt=new WeakMap,gt=new WeakMap;return(T=function(Ct){return Ct?gt:bt})(it)}function L(it,bt){if(!bt&&it&&it.__esModule)return it;if(it===null||x(it)!=="object"&&typeof it!="function")return{default:it};var gt=T(bt);if(gt&>.has(it))return gt.get(it);var Xt={},Ct=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var At in it)if(At!=="default"&&Object.prototype.hasOwnProperty.call(it,At)){var Z=Ct?Object.getOwnPropertyDescriptor(it,At):null;Z&&(Z.get||Z.set)?Object.defineProperty(Xt,At,Z):Xt[At]=it[At]}return Xt.default=it,gt&>.set(it,Xt),Xt}function P(it,bt){var gt=Object.keys(it);if(Object.getOwnPropertySymbols){var Xt=Object.getOwnPropertySymbols(it);bt&&(Xt=Xt.filter(function(Ct){return Object.getOwnPropertyDescriptor(it,Ct).enumerable})),gt.push.apply(gt,Xt)}return gt}function p(it){for(var bt=1;bt0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window=="undefined")return"";var S=(P=window.document)===null||P===void 0||(p=P.documentElement)===null||p===void 0?void 0:p.style;if(!S||m in S)return"";for(var y=0;y: Unmounted during event!");return E}},909280:function(Ve,z){"use strict";Object.defineProperty(z,"__esModule",{value:!0}),z.dontSetMe=T,z.findInArray=C,z.int=w,z.isFunction=x,z.isNum=k;function C(L,P){for(var p=0,m=L.length;p
    ',a=vt(),v&&v.c(),C(t,"class","jse-props svelte-1wlxti1"),C(o,"data-type","selectable-value"),C(o,"class","jse-footer svelte-1wlxti1"),C(i,"class","jse-footer-outer svelte-1wlxti1"),C(i,"style",e[18])},m:function(p,m){ot(p,t,m),c&&c.m(t,null),F(t,n);for(var g=0;g]',a=vt(),g&&g.c(),C(t,"class","jse-items svelte-1wlxti1"),C(o,"data-type","selectable-value"),C(o,"class","jse-footer svelte-1wlxti1"),C(i,"class","jse-footer-outer svelte-1wlxti1"),C(i,"style",e[18])},m:function(y,b){ot(y,t,b),f&&f.m(t,null),F(t,n);for(var w=0;w=Ct.start&&Bt<=Ct.end});if(!K)return null;var $t=K.start,Kt=K.end;M6($t,Math.min(v.length,Kt),function(Ct){return gt(String(Ct))})}else Object.keys(v).forEach(gt);return ut}(j,u||js);if(M("dragSelectionStart",{selection:j,items:D}),D){var B=Wu(j),k=D.findIndex(function(U){return rn(U.path,B)}),H=f0({json:x.getJson(),documentState:x.getDocumentState(),deltaY:0,items:D}).offset;n(11,A={initialTarget:S.target,initialClientY:S.clientY,initialContentTop:I(),selectionStartIndex:k,selectionItemsCount:C_(j).length,items:D,offset:H,didMoveItems:!1}),Pr.dragging=!0,document.addEventListener("mousemove",P,!0),document.addEventListener("mouseup",_)}else M("Cannot drag the current selection (probably spread over multiple sections)")}else R(S)}},function(S){Pr.selecting||Pr.dragging||(S.stopPropagation(),Ls(S.target,"data-type","selectable-value")?n(10,E=cp):Ls(S.target,"data-type","insert-selection-area-inside")?n(10,E=da):Ls(S.target,"data-type","insert-selection-area-after")&&n(10,E=Vc),clearTimeout(N))},function(S){S.stopPropagation(),N=setTimeout(function(){return n(10,E=void 0)})},function(S){S.shiftKey||(S.stopPropagation(),S.preventDefault(),x.onSelect(Ja(p)))},function(S){S.shiftKey||(S.stopPropagation(),S.preventDefault(),x.onSelect(Sa(p)))},function(S){x.onSelect(Ja(p)),x.onContextMenu(S)},function(S){x.onSelect(Sa(p)),x.onContextMenu(S)},R,h,d]}var h0=function(e){Ot(n,he);var t=Mt(n);function n(r){var i;return X(this,n),de(ce(i=t.call(this)),r,bK,yK,Be,{value:0,path:1,expandedMap:2,enforceStringMap:3,visibleSectionsMap:4,validationErrorsMap:5,searchResultItemsMap:6,selection:7,context:8,onDragSelectionStart:33},YJ,[-1,-1]),i}return tt(n)}(),wK=h0,xK={prefix:"fas",iconName:"jsoneditor-expand",icon:[512,512,[],"","M 0,448 V 512 h 512 v -64 z M 0,0 V 64 H 512 V 0 Z M 256,96 128,224 h 256 z M 256,416 384,288 H 128 Z"]},kK={prefix:"fas",iconName:"jsoneditor-collapse",icon:[512,512,[],"","m 0,224 v 64 h 512 v -64 z M 256,192 384,64 H 128 Z M 256,320 128,448 h 256 z"]},d0={prefix:"fas",iconName:"jsoneditor-format",icon:[512,512,[],"","M 0,32 v 64 h 416 v -64 z M 160,160 v 64 h 352 v -64 z M 160,288 v 64 h 288 v -64 z M 0,416 v 64 h 320 v -64 z"]},jK={prefix:"fas",iconName:"jsoneditor-compact",icon:[512,512,[],"","M 0,32 v 64 h 512 v -64 z M 0,160 v 64 h 512 v -64 z M 0,288 v 64 h 352 v -64 z"]};function SK(e){var t,n;return t=new Gh({props:{items:e[0]}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:function(r,i){var o={};1&ke(i,1)[0]&&(o.items=r[0]),t.$set(o)},i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function CK(e,t,n){var r,i,o,a,s,u,c,l=t.json,f=t.selection,h=t.readOnly,d=t.showSearch,v=d!==void 0&&d,p=t.historyState,m=t.onExpandAll,g=t.onCollapseAll,y=t.onUndo,b=t.onRedo,w=t.onSort,j=t.onTransform,x=t.onContextMenu,R=t.onCopy,M=t.onRenderMenu;function E(){n(1,v=!v)}return e.$$set=function(N){"json"in N&&n(2,l=N.json),"selection"in N&&n(3,f=N.selection),"readOnly"in N&&n(4,h=N.readOnly),"showSearch"in N&&n(1,v=N.showSearch),"historyState"in N&&n(5,p=N.historyState),"onExpandAll"in N&&n(6,m=N.onExpandAll),"onCollapseAll"in N&&n(7,g=N.onCollapseAll),"onUndo"in N&&n(8,y=N.onUndo),"onRedo"in N&&n(9,b=N.onRedo),"onSort"in N&&n(10,w=N.onSort),"onTransform"in N&&n(11,j=N.onTransform),"onContextMenu"in N&&n(12,x=N.onContextMenu),"onCopy"in N&&n(13,R=N.onCopy),"onRenderMenu"in N&&n(14,M=N.onRenderMenu)},e.$$.update=function(){4&e.$$.dirty&&n(20,r=l!==void 0),e.$$.dirty,1048584&e.$$.dirty&&n(19,i=r&&(yn(f)||yr(f)||Ge(f))),68&e.$$.dirty&&n(15,a={type:"button",icon:xK,title:"Expand all",className:"jse-expand-all",onClick:m,disabled:!Jn(l)}),132&e.$$.dirty&&n(16,s={type:"button",icon:kK,title:"Collapse all",className:"jse-collapse-all",onClick:g,disabled:!Jn(l)}),4&e.$$.dirty&&n(17,u={type:"button",icon:Gg,title:"Search (Ctrl+F)",className:"jse-search",onClick:E,disabled:l===void 0}),769844&e.$$.dirty&&n(18,c=h?[a,s,{type:"separator"},{type:"button",icon:Ya,title:"Copy (Ctrl+C)",className:"jse-copy",onClick:R,disabled:!i},{type:"separator"},u,{type:"space"}]:[a,s,{type:"separator"},{type:"button",icon:Lh,title:"Sort",className:"jse-sort",onClick:w,disabled:h||l===void 0},{type:"button",icon:Nh,title:"Transform contents (filter, sort, project)",className:"jse-transform",onClick:j,disabled:h||l===void 0},u,{type:"button",icon:U_,title:up,className:"jse-contextmenu",onClick:x},{type:"separator"},{type:"button",icon:Kg,title:"Undo (Ctrl+Z)",className:"jse-undo",onClick:y,disabled:!p.canUndo},{type:"button",icon:Jg,title:"Redo (Ctrl+Shift+Z)",className:"jse-redo",onClick:b,disabled:!p.canRedo},{type:"space"}]),278528&e.$$.dirty&&n(0,o=M(c)||c)},[o,v,l,f,h,p,m,g,y,b,w,j,x,R,M,a,s,u,c,i,r]}var $K=function(e){Ot(n,he);var t=Mt(n);function n(r){var i;return X(this,n),de(ce(i=t.call(this)),r,CK,SK,Be,{json:2,selection:3,readOnly:4,showSearch:1,historyState:5,onExpandAll:6,onCollapseAll:7,onUndo:8,onRedo:9,onSort:10,onTransform:11,onContextMenu:12,onCopy:13,onRenderMenu:14}),i}return tt(n)}();function _K(e){Ae(e,"svelte-1q2qkk2",'@charset "UTF-8";.jse-welcome.svelte-1q2qkk2.svelte-1q2qkk2{flex:1;overflow:auto;font-family:var(--jse-font-family);font-size:var(--jse-font-size);display:flex;flex-direction:column;align-items:center;border-left:var(--jse-main-border);border-right:var(--jse-main-border)}.jse-welcome.svelte-1q2qkk2.svelte-1q2qkk2:last-child{border-bottom:var(--jse-main-border)}.jse-welcome.svelte-1q2qkk2 .jse-space.jse-before.svelte-1q2qkk2{flex:1}.jse-welcome.svelte-1q2qkk2 .jse-space.jse-after.svelte-1q2qkk2{flex:2}.jse-welcome.svelte-1q2qkk2 .jse-contents.svelte-1q2qkk2{margin:2em var(--jse-padding) 0;color:var(--jse-panel-color-readonly)}.jse-welcome.svelte-1q2qkk2 .jse-contents ul.svelte-1q2qkk2{list-style:"\u25CF";list-style-position:outside;padding-left:20px}.jse-welcome.svelte-1q2qkk2 .jse-contents ul li.svelte-1q2qkk2{padding-left:10px}.jse-welcome.svelte-1q2qkk2 .jse-contents ul li span.jse-bold.svelte-1q2qkk2{font-family:var(--jse-font-family-mono);font-weight:bold}')}function uE(e){var t;return{c:function(){(t=G("ul")).innerHTML=`
  • Click inside the editor
  • +
  • Paste clipboard data using Ctrl+V
  • +
  • Create a new object by typing {
  • +
  • Create a new array by typing [
  • `,C(t,"class","svelte-1q2qkk2")},m:function(n,r){ot(n,t,r)},d:function(n){n&&it(t)}}}function OK(e){var t,n,r,i,o,a,s,u=!e[0]&&uE();return{c:function(){t=G("div"),n=G("div"),r=vt(),i=G("div"),o=Jt(`Empty document + `),u&&u.c(),a=vt(),s=G("div"),C(n,"class","jse-space jse-before svelte-1q2qkk2"),C(i,"class","jse-contents svelte-1q2qkk2"),C(s,"class","jse-space jse-after svelte-1q2qkk2"),C(t,"class","jse-welcome svelte-1q2qkk2")},m:function(c,l){ot(c,t,l),F(t,n),F(t,r),F(t,i),F(i,o),u&&u.m(i,null),F(t,a),F(t,s)},p:function(c,l){ke(l,1)[0],c[0]?u&&(u.d(1),u=null):u||((u=uE()).c(),u.m(i,null))},i:It,o:It,d:function(c){c&&it(t),u&&u.d()}}}function MK(e,t,n){var r=t.readOnly;return e.$$set=function(i){"readOnly"in i&&n(0,r=i.readOnly)},[r]}var EK=function(e){Ot(n,he);var t=Mt(n);function n(r){var i;return X(this,n),de(ce(i=t.call(this)),r,MK,OK,Be,{readOnly:0},_K),i}return tt(n)}(),cE={exports:{}},lE=function(e,t){var n,r,i=1,o=0,a=0,s=String.alphabet;function u(c,l,f){if(f){for(n=l;(f=u(c,n))<76&&f>65;)++n;return+c.slice(l-1,n)}return(f=s&&s.indexOf(c.charAt(l)))>-1?f+76:(f=c.charCodeAt(l)||0)<45||f>127?f:f<46?65:f<48?f-1:f<58?f+18:f<65?f-11:f<91?f+11:f<97?f-37:f<123?f+5:f-63}if((e+="")!=(t+="")){for(;i;)if(r=u(e,o++),i=u(t,a++),r<76&&i<76&&r>66&&i>66&&(r=u(e,o,o),i=u(t,a,o=n),a=n),r!=i)return r1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(An(se(e,t))){if(n===void 0)throw new Error("Cannot sort: no property selected by which to sort the array");return function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1,u=function(l,f){return function(h,d){var v=se(h,l),p=se(d,l);return v===void 0?f:p===void 0?-f:typeof v!="string"&&typeof p!="string"?v>p?f:v1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,s=se(i,o),u=Object.keys(s),c=u.slice();c.sort(function(v,p){return a*v0(v,p)});for(var l=[],f=0;f_l&&vE();return{c:function(){t=G("div");for(var f=0;f_l?l?l.p(f,d):((l=vE()).c(),l.m(t,null)):l&&(l.d(1),l=null)},i:It,o:It,d:function(f){f&&it(t);for(var h=0;h0&&(s("scrollTo ",m),o.scrollTo({left:m,behavior:"smooth"}))}})},[u,f,h,r,o,a,d,i,function(m){s("get items for path",m);var g=se(u,m);if(Array.isArray(g))return fg(0,g.length).map(String);if(In(g)){var y=Object.keys(g).slice(0);return y.sort(v0),y}return[]},function(m){return Ni(u,m)},v,function(){n(6,d=!d)},p,function(m){p(),v(m)},c,l,function(m){He[m?"unshift":"push"](function(){n(5,a=m)})},function(m){He[m?"unshift":"push"](function(){n(4,o=m)})}]}var KK=function(e){Ot(n,he);var t=Mt(n);function n(r){var i;return X(this,n),de(ce(i=t.call(this)),r,JK,UK,Be,{json:0,documentState:14,onSelect:15,onError:1,pathParser:2},WK),i}return tt(n)}();function GK(e){Ae(e,"svelte-3lbrbf",".jse-search-box.svelte-3lbrbf.svelte-3lbrbf{border:var(--jse-panel-border);border-radius:3px;font-family:var(--jse-font-family);font-size:var(--jse-font-size);background:var(--jse-panel-background);color:var(--jse-panel-color-readonly);box-shadow:var(--jse-controls-box-shadow);display:inline-block;width:400px;max-width:100%;overflow:auto}.jse-search-box.svelte-3lbrbf .jse-search-form.svelte-3lbrbf{display:flex;align-items:stretch}.jse-search-box.svelte-3lbrbf .jse-search-form button.svelte-3lbrbf,.jse-search-box.svelte-3lbrbf .jse-search-form input.svelte-3lbrbf{font-family:inherit;font-size:inherit}.jse-search-box.svelte-3lbrbf .jse-search-form button.svelte-3lbrbf{display:block;text-align:center;border:none;padding:0 5px;margin:0;cursor:pointer;color:var(--jse-panel-button-color);background:var(--jse-panel-button-background)}.jse-search-box.svelte-3lbrbf .jse-search-form button.svelte-3lbrbf:hover{color:var(--jse-panel-button-color-highlight);background:var(--jse-panel-button-background-highlight)}.jse-search-box.svelte-3lbrbf .jse-search-form input.svelte-3lbrbf{color:var(--jse-panel-color);border:var(--jse-input-border);border-radius:3px;background:var(--jse-input-background);height:28px;padding:0 5px;margin:0;flex:1;width:0;min-width:50px;outline:none}.jse-search-box.svelte-3lbrbf .jse-search-form .jse-replace-toggle.svelte-3lbrbf{padding:var(--jse-padding) calc(0.5 * var(--jse-padding));min-width:20px;background:var(--jse-panel-button-background-highlight)}.jse-search-box.svelte-3lbrbf .jse-search-form .jse-search-contents.svelte-3lbrbf{flex:1;display:flex;flex-direction:column;padding:calc(0.5 * var(--jse-padding));gap:calc(0.5 * var(--jse-padding))}.jse-search-box.svelte-3lbrbf .jse-search-form .jse-search-contents .jse-search-section.svelte-3lbrbf{flex:1;display:flex;align-items:center;position:relative;padding-left:32px}.jse-search-box.svelte-3lbrbf .jse-search-form .jse-search-contents .jse-search-section .jse-search-icon.svelte-3lbrbf{color:inherit;cursor:inherit;background:inherit;position:absolute;top:calc(0.5 * var(--jse-padding));left:calc(0.5 * var(--jse-padding))}.jse-search-box.svelte-3lbrbf .jse-search-form .jse-search-contents .jse-search-section label.jse-search-input-label.svelte-3lbrbf{flex:1;display:flex}.jse-search-box.svelte-3lbrbf .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.svelte-3lbrbf{color:inherit;font-size:80%;visibility:hidden;padding:0 5px;min-width:36px;text-align:center}.jse-search-box.svelte-3lbrbf .jse-search-form .jse-search-contents .jse-search-section .jse-search-count.jse-visible.svelte-3lbrbf{visibility:visible}.jse-search-box.svelte-3lbrbf .jse-search-form .jse-search-contents .jse-replace-section.svelte-3lbrbf{padding-left:32px;flex:1;display:flex}.jse-search-box.svelte-3lbrbf .jse-search-form .jse-search-contents .jse-replace-section button.svelte-3lbrbf{width:auto}")}function jE(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,v,p,m,g,y,b,w,j,x,R,M,E,N,A,L,W=(e[3]!==-1?"".concat(e[3]+1,"/"):"")+"",O=!e[4]&&SE(e),I=[YK,QK],q=[];function P(S,$){return S[2]?0:1}s=P(e),u=q[s]=I[s](e),y=new on({props:{data:eH}}),j=new on({props:{data:Kq}}),M=new on({props:{data:Zu}});var _=e[0]&&!e[4]&&CE(e);return{c:function(){t=G("div"),n=G("form"),O&&O.c(),r=vt(),i=G("div"),o=G("div"),a=G("div"),u.c(),c=vt(),l=G("label"),f=G("input"),h=vt(),d=G("div"),v=Jt(W),p=Jt(e[10]),m=vt(),g=G("button"),jt(y.$$.fragment),b=vt(),w=G("button"),jt(j.$$.fragment),x=vt(),R=G("button"),jt(M.$$.fragment),E=vt(),_&&_.c(),C(a,"class","jse-search-icon svelte-3lbrbf"),C(f,"class","jse-search-input svelte-3lbrbf"),C(f,"title","Enter text to search"),C(f,"type","text"),C(f,"placeholder","Find"),C(l,"class","jse-search-input-label svelte-3lbrbf"),C(l,"about","jse-search input"),C(d,"class","jse-search-count svelte-3lbrbf"),At(d,"jse-visible",e[8]!==""),C(g,"type","button"),C(g,"class","jse-search-next svelte-3lbrbf"),C(g,"title","Go to next search result (Enter)"),C(w,"type","button"),C(w,"class","jse-search-previous svelte-3lbrbf"),C(w,"title","Go to previous search result (Shift+Enter)"),C(R,"type","button"),C(R,"class","jse-search-clear svelte-3lbrbf"),C(R,"title","Close search box (Esc)"),C(o,"class","jse-search-section svelte-3lbrbf"),C(i,"class","jse-search-contents svelte-3lbrbf"),C(n,"class","jse-search-form svelte-3lbrbf"),C(t,"class","jse-search-box svelte-3lbrbf")},m:function(S,$){ot(S,t,$),F(t,n),O&&O.m(n,null),F(n,r),F(n,i),F(i,o),F(o,a),q[s].m(a,null),F(o,c),F(o,l),F(l,f),Ta(f,e[8]),F(o,h),F(o,d),F(d,v),F(d,p),F(o,m),F(o,g),xt(y,g,null),F(o,b),F(o,w),xt(j,w,null),F(o,x),F(o,R),xt(M,R,null),F(i,E),_&&_.m(i,null),N=!0,A||(L=[Nt(f,"input",e[21]),Nr(XK.call(null,f)),Nt(g,"click",e[22]),Nt(w,"click",e[23]),Nt(R,"click",e[24]),Nt(n,"submit",e[12]),Nt(n,"keydown",e[13])],A=!0)},p:function(S,$){S[4]?O&&(Dt(),z(O,1,1,function(){O=null}),Lt()):O?(O.p(S,$),16&$&&T(O,1)):((O=SE(S)).c(),T(O,1),O.m(n,r));var D=s;(s=P(S))===D?q[s].p(S,$):(Dt(),z(q[D],1,1,function(){q[D]=null}),Lt(),(u=q[s])?u.p(S,$):(u=q[s]=I[s](S)).c(),T(u,1),u.m(a,null)),256&$&&f.value!==S[8]&&Ta(f,S[8]),(!N||8&$)&&W!==(W=(S[3]!==-1?"".concat(S[3]+1,"/"):"")+"")&&be(v,W),(!N||1024&$)&&be(p,S[10]),(!N||256&$)&&At(d,"jse-visible",S[8]!==""),S[0]&&!S[4]?_?_.p(S,$):((_=CE(S)).c(),_.m(i,null)):_&&(_.d(1),_=null)},i:function(S){N||(T(O),T(u),T(y.$$.fragment,S),T(j.$$.fragment,S),T(M.$$.fragment,S),N=!0)},o:function(S){z(O),z(u),z(y.$$.fragment,S),z(j.$$.fragment,S),z(M.$$.fragment,S),N=!1},d:function(S){S&&it(t),O&&O.d(),q[s].d(),kt(y),kt(j),kt(M),_&&_.d(),A=!1,Mn(L)}}}function SE(e){var t,n,r,i,o;return n=new on({props:{data:e[0]?qi:Ga}}),{c:function(){t=G("button"),jt(n.$$.fragment),C(t,"type","button"),C(t,"class","jse-replace-toggle svelte-3lbrbf"),C(t,"title","Toggle visibility of replace options (Ctrl+H)")},m:function(a,s){ot(a,t,s),xt(n,t,null),r=!0,i||(o=Nt(t,"click",e[11]),i=!0)},p:function(a,s){var u={};1&s&&(u.data=a[0]?qi:Ga),n.$set(u)},i:function(a){r||(T(n.$$.fragment,a),r=!0)},o:function(a){z(n.$$.fragment,a),r=!1},d:function(a){a&&it(t),kt(n),i=!1,o()}}}function QK(e){var t,n;return t=new on({props:{data:Gg}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:It,i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function YK(e){var t,n;return t=new on({props:{data:Hq,spin:!0}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:It,i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function CE(e){var t,n,r,i,o,a,s,u;return{c:function(){t=G("div"),n=G("input"),r=vt(),(i=G("button")).textContent="Replace",o=vt(),(a=G("button")).textContent="All",C(n,"class","jse-replace-input svelte-3lbrbf"),C(n,"title","Enter replacement text"),C(n,"type","text"),C(n,"placeholder","Replace"),C(i,"type","button"),C(i,"title","Replace current occurrence (Ctrl+Enter)"),C(i,"class","svelte-3lbrbf"),C(a,"type","button"),C(a,"title","Replace all occurrences"),C(a,"class","svelte-3lbrbf"),C(t,"class","jse-replace-section svelte-3lbrbf")},m:function(c,l){ot(c,t,l),F(t,n),Ta(n,e[9]),F(t,r),F(t,i),F(t,o),F(t,a),s||(u=[Nt(n,"input",e[25]),Nt(i,"click",e[14]),Nt(a,"click",e[15])],s=!0)},p:function(c,l){512&l&&n.value!==c[9]&&Ta(n,c[9])},d:function(c){c&&it(t),s=!1,Mn(u)}}}function ZK(e){var t,n,r=e[1]&&jE(e);return{c:function(){r&&r.c(),t=vn()},m:function(i,o){r&&r.m(i,o),ot(i,t,o),n=!0},p:function(i,o){var a=ke(o,1)[0];i[1]?r?(r.p(i,a),2&a&&T(r,1)):((r=jE(i)).c(),T(r,1),r.m(t.parentNode,t)):r&&(Dt(),z(r,1,1,function(){r=null}),Lt())},i:function(i){n||(T(r),n=!0)},o:function(i){z(r),n=!1},d:function(i){r&&r.d(i),i&&it(t)}}}function XK(e){e.select()}function tG(e,t,n){var r,i,o=t.show,a=o!==void 0&&o,s=t.searching,u=t.resultCount,c=u===void 0?0:u,l=t.activeIndex,f=l===void 0?0:l,h=t.showReplace,d=h!==void 0&&h,v=t.readOnly,p=v!==void 0&&v,m=t.onChange,g=m===void 0?Dn:m,y=t.onPrevious,b=y===void 0?Dn:y,w=t.onNext,j=w===void 0?Dn:w,x=t.onReplace,R=x===void 0?Dn:x,M=t.onReplaceAll,E=M===void 0?Dn:M,N=t.onClose,A=N===void 0?Dn:N,L="",W="",O="";function I(){n(0,d=!d&&!p)}function q(){p||R(L,O)}return e.$$set=function(P){"show"in P&&n(1,a=P.show),"searching"in P&&n(2,s=P.searching),"resultCount"in P&&n(16,c=P.resultCount),"activeIndex"in P&&n(3,f=P.activeIndex),"showReplace"in P&&n(0,d=P.showReplace),"readOnly"in P&&n(4,p=P.readOnly),"onChange"in P&&n(17,g=P.onChange),"onPrevious"in P&&n(5,b=P.onPrevious),"onNext"in P&&n(6,j=P.onNext),"onReplace"in P&&n(18,R=P.onReplace),"onReplaceAll"in P&&n(19,E=P.onReplaceAll),"onClose"in P&&n(7,A=P.onClose)},e.$$.update=function(){65536&e.$$.dirty&&n(10,r=c>=h3?"".concat(999,"+"):String(c)),131072&e.$$.dirty&&n(20,i=Eu(g,300)),1048832&e.$$.dirty&&i(L),2&e.$$.dirty&&a&&L!==""&&g(L)},[d,a,s,f,p,b,j,A,L,O,r,I,function(P){P.preventDefault(),L!==W?(W=L,i.cancel(),g(L)):j()},function(P){P.stopPropagation();var _=Ha(P);_==="Enter"&&(P.preventDefault(),j()),_==="Shift+Enter"&&(P.preventDefault(),b()),_==="Ctrl+Enter"&&(P.preventDefault(),d?q():j()),_==="Ctrl+H"&&(P.preventDefault(),I()),_==="Escape"&&(P.preventDefault(),A())},q,function(){p||E(L,O)},c,g,R,E,i,function(){L=this.value,n(8,L)},function(){return j()},function(){return b()},function(){return A()},function(){O=this.value,n(9,O)}]}var eG=function(e){Ot(n,he);var t=Mt(n);function n(r){var i;return X(this,n),de(ce(i=t.call(this)),r,tG,ZK,Be,{show:1,searching:2,resultCount:16,activeIndex:3,showReplace:0,readOnly:4,onChange:17,onPrevious:5,onNext:6,onReplace:18,onReplaceAll:19,onClose:7},GK),i}return tt(n)}(),$E=Number.isNaN||function(e){return typeof e=="number"&&e!=e};function nG(e,t){if(e.length!==t.length)return!1;for(var n=0;n2&&arguments[2]!==void 0?arguments[2]:1/0,r={};Array.isArray(e)&&function(o,a,s){if(o.length1?(o.length-1)/(a-1):o.length,c=0;c5&&arguments[5]!==void 0?arguments[5]:80,a=An(n)?n.length:0,s=function(g,y){var b=Object.values(g);if(Ue(b))return y;var w=function(x,R){return x+R},j=b.reduce(w);return j/b.length}(r,i),u=e-o,c=t+2*o,l=function(g){return r[g]||i},f=0,h=0;h0&&(h-=l(--f));for(var d=f,v=0;v0?s-1:void 0,h=f!==void 0?un(Hs({rowIndex:f,columnIndex:u},r),!1):void 0;return Zr("remove row new selection",{rowIndex:s,newRowIndex:f,newSelection:h}),{state:dt(dt({},l),{},{selection:h})}})}}function Yh(e){var t=e.insertType,n=e.selectInside,r=e.refJsonEditor,i=e.json,o=e.documentState,a=e.readOnly,s=e.parser,u=e.onPatch,c=e.onReplaceJson;if(!a&&o.selection){var l=function(p,m,g){if(g==="object")return{};if(g==="array")return[];if(g==="structure"&&p!==void 0){var y=se(p,m?y_(m):[]);if(Array.isArray(y)&&!Ue(y)){var b=Ar(y);return Jn(b)?ym(b,function(w){return Array.isArray(w)?[]:In(w)?void 0:""}):""}}return""}(i,o.selection,t);if(i!==void 0){var f=s.stringify(l),h=E_(i,o.selection,f,s);Zr("onInsert",{insertType:t,operations:h,newValue:l,data:f});var d=le(h.filter(function(p){return p.op==="add"||p.op==="replace"}));u(h,function(p,m){if(d){var g=uo(p,d.path);if(Jn(l))return{state:dt(dt({},Vi(p,m,g,gl)),{},{selection:n?Ja(g):m.selection})};if(l===""){var y=Ue(g)?null:se(p,Ze(g));return{state:Rg(p,dt(dt({},o),{},{selection:In(y)?Wi(g,!0):un(g,!0)}),g)}}}}),Zr("after patch"),d&&l===""&&Zh(function(){return $h(r,"",!0)})}else{Zr("onInsert",{insertType:t,newValue:l});var v=[];c(l,function(p,m){return{state:dt(dt({},Ua(p,m,v)),{},{selection:un(v,!0)})}})}}}function TE(e){return b0.apply(this,arguments)}function b0(){return b0=Ee(Ft().mark(function e(t){var n,r,i,o,a,s,u,c,l,f,h,d;return Ft().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(n=t.char,r=t.selectInside,i=t.refJsonEditor,o=t.json,a=t.documentState,s=t.readOnly,u=t.parser,c=t.onPatch,l=t.onReplaceJson,f=t.onSelect,!s&&a.selection){v.next=3;break}return v.abrupt("return");case 3:if(!yr(a.selection)){v.next=8;break}return h=!a.selection.edit,f(dt(dt({},a.selection),{},{edit:!0})),Zh(function(){return $h(i,n,h)}),v.abrupt("return");case 8:if(n!=="{"){v.next=12;break}Yh({insertType:"object",selectInside:r,refJsonEditor:i,json:o,documentState:a,readOnly:s,parser:u,onPatch:c,onReplaceJson:l}),v.next=23;break;case 12:if(n!=="["){v.next=16;break}Yh({insertType:"array",selectInside:r,refJsonEditor:i,json:o,documentState:a,readOnly:s,parser:u,onPatch:c,onReplaceJson:l}),v.next=23;break;case 16:if(!Ge(a.selection)||o===void 0){v.next=20;break}Jn(se(o,a.selection.focusPath))||(d=!a.selection.edit,f(dt(dt({},a.selection),{},{edit:!0})),Zh(function(){return $h(i,n,d)})),v.next=23;break;case 20:return Zr("onInsertValueWithCharacter",{char:n}),v.next=23,hG({char:n,refJsonEditor:i,json:o,documentState:a,readOnly:s,parser:u,onPatch:c,onReplaceJson:l});case 23:case"end":return v.stop()}},e)})),b0.apply(this,arguments)}function hG(e){return w0.apply(this,arguments)}function w0(){return w0=Ee(Ft().mark(function e(t){var n,r,i,o,a,s,u,c,l;return Ft().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(n=t.char,r=t.refJsonEditor,i=t.json,o=t.documentState,a=t.readOnly,s=t.parser,u=t.onPatch,c=t.onReplaceJson,!a&&o.selection){f.next=3;break}return f.abrupt("return");case 3:Yh({insertType:"value",selectInside:!1,refJsonEditor:r,json:i,documentState:o,readOnly:a,parser:s,onPatch:u,onReplaceJson:c}),l=!Ka(o.selection),Zh(function(){return $h(r,n,l)});case 6:case"end":return f.stop()}},e)})),w0.apply(this,arguments)}function Zh(e){setTimeout(function(){return setTimeout(e)})}function dG(e){Ae(e,"svelte-1ch6ow4",".jse-json-preview.svelte-1ch6ow4{flex:1;color:var(--jse-panel-color-readonly);overflow:auto;white-space:pre-wrap;padding:2px;border-left:var(--jse-main-border);border-right:var(--jse-main-border);border-bottom:var(--jse-main-border)}")}function vG(e){var t,n,r=Uo(Ch({text:e[0],json:e[1]},e[2],e[3]),Sf)+"";return{c:function(){t=G("div"),n=Jt(r),C(t,"class","jse-json-preview svelte-1ch6ow4")},m:function(i,o){ot(i,t,o),F(t,n)},p:function(i,o){15&ke(o,1)[0]&&r!==(r=Uo(Ch({text:i[0],json:i[1]},i[2],i[3]),Sf)+"")&&be(n,r)},i:It,o:It,d:function(i){i&&it(t)}}}function pG(e,t,n){var r=t.text,i=t.json,o=t.indentation,a=t.parser;return e.$$set=function(s){"text"in s&&n(0,r=s.text),"json"in s&&n(1,i=s.json),"indentation"in s&&n(2,o=s.indentation),"parser"in s&&n(3,a=s.parser)},[r,i,o,a]}var RE=function(e){Ot(n,he);var t=Mt(n);function n(r){var i;return X(this,n),de(ce(i=t.call(this)),r,pG,vG,Sr,{text:0,json:1,indentation:2,parser:3},dG),i}return tt(n)}(),mG=Zv.window;function gG(e){Ae(e,"svelte-1n5yill",".jse-tree-mode.svelte-1n5yill.svelte-1n5yill{flex:1;display:flex;flex-direction:column;position:relative;background:var(--jse-background-color);min-width:0;min-height:0;font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);color:var(--jse-text-color);line-height:var(--jse-line-height)}.jse-tree-mode.svelte-1n5yill .jse-hidden-input-label .jse-hidden-input.svelte-1n5yill{position:fixed;top:-10px;left:-10px;width:1px;height:1px;padding:0;border:0;outline:none}.jse-tree-mode.svelte-1n5yill .jse-search-box-container.svelte-1n5yill{position:relative;height:0;top:var(--jse-padding);margin-right:calc(var(--jse-padding) + 20px);margin-left:var(--jse-padding);text-align:right;z-index:3}.jse-tree-mode.no-main-menu.svelte-1n5yill.svelte-1n5yill{border-top:var(--jse-main-border)}.jse-tree-mode.svelte-1n5yill .jse-contents.svelte-1n5yill{border-left:var(--jse-main-border);border-right:var(--jse-main-border);flex:1;overflow:auto;position:relative;padding:2px;display:flex;flex-direction:column}.jse-tree-mode.svelte-1n5yill .jse-contents.svelte-1n5yill:last-child{border-bottom:var(--jse-main-border)}.jse-tree-mode.svelte-1n5yill .jse-contents .jse-loading-space.svelte-1n5yill{flex:1}.jse-tree-mode.svelte-1n5yill .jse-contents .jse-loading.svelte-1n5yill{flex:2;text-align:center;color:var(--jse-panel-color-readonly);box-sizing:border-box;font-family:var(--jse-font-family);font-size:var(--jse-font-size)}")}function NE(e){var t,n,r;function i(a){e[75](a)}var o={json:e[11],selection:e[17].selection,readOnly:e[0],historyState:e[23],onExpandAll:e[40],onCollapseAll:e[41],onUndo:e[36],onRedo:e[37],onSort:e[38],onTransform:e[39],onContextMenu:e[45],onCopy:e[34],onRenderMenu:e[7]};return e[20]!==void 0&&(o.showSearch=e[20]),t=new $K({props:o}),He.push(function(){return no(t,"showSearch",i)}),{c:function(){jt(t.$$.fragment)},m:function(a,s){xt(t,a,s),r=!0},p:function(a,s){var u={};2048&s[0]&&(u.json=a[11]),131072&s[0]&&(u.selection=a[17].selection),1&s[0]&&(u.readOnly=a[0]),8388608&s[0]&&(u.historyState=a[23]),128&s[0]&&(u.onRenderMenu=a[7]),!n&&1048576&s[0]&&(n=!0,u.showSearch=a[20],eo(function(){return n=!1})),t.$set(u)},i:function(a){r||(T(t.$$.fragment,a),r=!0)},o:function(a){z(t.$$.fragment,a),r=!1},d:function(a){kt(t,a)}}}function IE(e){var t,n;return t=new KK({props:{json:e[11],documentState:e[17],onSelect:e[49],onError:e[6],pathParser:e[4]}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:function(r,i){var o={};2048&i[0]&&(o.json=r[11]),131072&i[0]&&(o.documentState=r[17]),64&i[0]&&(o.onError=r[6]),16&i[0]&&(o.pathParser=r[4]),t.$set(o)},i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function yG(e){var t;return{c:function(){(t=G("div")).innerHTML=`
    +
    loading...
    `,C(t,"class","jse-contents svelte-1n5yill")},m:function(n,r){ot(n,t,r)},p:It,i:It,o:It,d:function(n){n&&it(t)}}}function bG(e){var t,n,r,i,o,a,s,u,c,l=[xG,wG],f=[];function h(d,v){return d[11]===void 0?0:1}return i=h(e),o=f[i]=l[i](e),{c:function(){t=G("label"),n=G("input"),r=vt(),o.c(),a=vn(),C(n,"type","text"),n.readOnly="readonly",C(n,"tabindex","-1"),C(n,"class","jse-hidden-input svelte-1n5yill"),C(t,"class","jse-hidden-input-label")},m:function(d,v){ot(d,t,v),F(t,n),e[76](n),ot(d,r,v),f[i].m(d,v),ot(d,a,v),s=!0,u||(c=Nt(n,"paste",e[35]),u=!0)},p:function(d,v){var p=i;(i=h(d))===p?f[i].p(d,v):(Dt(),z(f[p],1,1,function(){f[p]=null}),Lt(),(o=f[i])?o.p(d,v):(o=f[i]=l[i](d)).c(),T(o,1),o.m(a.parentNode,a))},i:function(d){s||(T(o),s=!0)},o:function(d){z(o),s=!1},d:function(d){d&&it(t),e[76](null),d&&it(r),f[i].d(d),d&&it(a),u=!1,c()}}}function wG(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,v;a=new eG({props:{show:e[20],resultCount:((t=e[18])===null||t===void 0||(n=t.items)===null||n===void 0?void 0:n.length)||0,activeIndex:((r=e[18])===null||r===void 0?void 0:r.activeIndex)||0,showReplace:e[21],searching:e[22],readOnly:e[0],onChange:e[27],onNext:e[28],onPrevious:e[29],onReplace:e[30],onReplaceAll:e[31],onClose:e[32]}}),c=new wK({props:{value:e[11],path:[],expandedMap:e[17].expandedMap,enforceStringMap:e[17].enforceStringMap,visibleSectionsMap:e[17].visibleSectionsMap,validationErrorsMap:e[25],searchResultItemsMap:(i=e[18])===null||i===void 0?void 0:i.itemsMap,selection:e[17].selection,context:e[14],onDragSelectionStart:Dn}});var p=e[19]&&DE(e),m=e[24]&&LE(e);return d=new a0({props:{validationErrors:e[13],selectError:e[33]}}),{c:function(){o=G("div"),jt(a.$$.fragment),s=vt(),u=G("div"),jt(c.$$.fragment),l=vt(),p&&p.c(),f=vt(),m&&m.c(),h=vt(),jt(d.$$.fragment),C(o,"class","jse-search-box-container svelte-1n5yill"),C(u,"class","jse-contents svelte-1n5yill"),C(u,"data-jsoneditor-scrollable-contents",!0)},m:function(g,y){ot(g,o,y),xt(a,o,null),ot(g,s,y),ot(g,u,y),xt(c,u,null),e[77](u),ot(g,l,y),p&&p.m(g,y),ot(g,f,y),m&&m.m(g,y),ot(g,h,y),xt(d,g,y),v=!0},p:function(g,y){var b,w,j,x,R={};1048576&y[0]&&(R.show=g[20]),262144&y[0]&&(R.resultCount=((b=g[18])===null||b===void 0||(w=b.items)===null||w===void 0?void 0:w.length)||0),262144&y[0]&&(R.activeIndex=((j=g[18])===null||j===void 0?void 0:j.activeIndex)||0),2097152&y[0]&&(R.showReplace=g[21]),4194304&y[0]&&(R.searching=g[22]),1&y[0]&&(R.readOnly=g[0]),a.$set(R);var M={};2048&y[0]&&(M.value=g[11]),131072&y[0]&&(M.expandedMap=g[17].expandedMap),131072&y[0]&&(M.enforceStringMap=g[17].enforceStringMap),131072&y[0]&&(M.visibleSectionsMap=g[17].visibleSectionsMap),33554432&y[0]&&(M.validationErrorsMap=g[25]),262144&y[0]&&(M.searchResultItemsMap=(x=g[18])===null||x===void 0?void 0:x.itemsMap),131072&y[0]&&(M.selection=g[17].selection),16384&y[0]&&(M.context=g[14]),c.$set(M),g[19]?p?(p.p(g,y),524288&y[0]&&T(p,1)):((p=DE(g)).c(),T(p,1),p.m(f.parentNode,f)):p&&(Dt(),z(p,1,1,function(){p=null}),Lt()),g[24]?m?(m.p(g,y),16777216&y[0]&&T(m,1)):((m=LE(g)).c(),T(m,1),m.m(h.parentNode,h)):m&&(Dt(),z(m,1,1,function(){m=null}),Lt());var E={};8192&y[0]&&(E.validationErrors=g[13]),d.$set(E)},i:function(g){v||(T(a.$$.fragment,g),T(c.$$.fragment,g),T(p),T(m),T(d.$$.fragment,g),v=!0)},o:function(g){z(a.$$.fragment,g),z(c.$$.fragment,g),z(p),z(m),z(d.$$.fragment,g),v=!1},d:function(g){g&&it(o),kt(a),g&&it(s),g&&it(u),kt(c),e[77](null),g&&it(l),p&&p.d(g),g&&it(f),m&&m.d(g),g&&it(h),kt(d,g)}}}function xG(e){var t,n,r,i,o=[jG,kG],a=[];function s(u,c){return u[12]===""||u[12]===void 0?0:1}return t=s(e),n=a[t]=o[t](e),{c:function(){n.c(),r=vn()},m:function(u,c){a[t].m(u,c),ot(u,r,c),i=!0},p:function(u,c){var l=t;(t=s(u))===l?a[t].p(u,c):(Dt(),z(a[l],1,1,function(){a[l]=null}),Lt(),(n=a[t])?n.p(u,c):(n=a[t]=o[t](u)).c(),T(n,1),n.m(r.parentNode,r))},i:function(u){i||(T(n),i=!0)},o:function(u){z(n),i=!1},d:function(u){a[t].d(u),u&&it(r)}}}function DE(e){var t,n;return t=new po({props:{type:"info",message:"You pasted a JSON ".concat(Array.isArray(e[19].contents)?"array":"object"," as text"),actions:[{icon:Ih,text:"Paste as JSON instead",onMouseDown:e[46]},{text:"Leave as is",onClick:e[47]}],onClose:e[78]}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:function(r,i){var o={};524288&i[0]&&(o.message="You pasted a JSON ".concat(Array.isArray(r[19].contents)?"array":"object"," as text")),t.$set(o)},i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function LE(e){var t,n;return t=new po({props:{type:"success",message:"The loaded JSON document was invalid but is successfully repaired.",actions:e[0]?[]:[{icon:xl,text:"Ok",onClick:e[8]},{icon:Qa,text:"Repair manually instead",onClick:e[48]}],onClose:e[9]}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:function(r,i){var o={};1&i[0]&&(o.actions=r[0]?[]:[{icon:xl,text:"Ok",onClick:r[8]},{icon:Qa,text:"Repair manually instead",onClick:r[48]}]),t.$set(o)},i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function kG(e){var t,n,r,i;return t=new po({props:{type:"error",message:"The loaded JSON document is invalid and could not be repaired automatically.",actions:e[0]?[]:[{icon:Qa,text:"Repair manually",onClick:e[48]}]}}),r=new RE({props:{text:e[12],json:e[11],indentation:e[5],parser:e[3]}}),{c:function(){jt(t.$$.fragment),n=vt(),jt(r.$$.fragment)},m:function(o,a){xt(t,o,a),ot(o,n,a),xt(r,o,a),i=!0},p:function(o,a){var s={};1&a[0]&&(s.actions=o[0]?[]:[{icon:Qa,text:"Repair manually",onClick:o[48]}]),t.$set(s);var u={};4096&a[0]&&(u.text=o[12]),2048&a[0]&&(u.json=o[11]),32&a[0]&&(u.indentation=o[5]),8&a[0]&&(u.parser=o[3]),r.$set(u)},i:function(o){i||(T(t.$$.fragment,o),T(r.$$.fragment,o),i=!0)},o:function(o){z(t.$$.fragment,o),z(r.$$.fragment,o),i=!1},d:function(o){kt(t,o),o&&it(n),kt(r,o)}}}function jG(e){var t,n;return t=new EK({props:{readOnly:e[0]}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:function(r,i){var o={};1&i[0]&&(o.readOnly=r[0]),t.$set(o)},i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function SG(e){var t,n,r,i,o,a,s,u,c=e[1]&&NE(e),l=e[2]&&IE(e),f=[bG,yG],h=[];return i=function(d,v){return d[26]?1:0}(e),o=h[i]=f[i](e),{c:function(){t=G("div"),c&&c.c(),n=vt(),l&&l.c(),r=vt(),o.c(),C(t,"class","jse-tree-mode svelte-1n5yill"),At(t,"no-main-menu",!e[1])},m:function(d,v){ot(d,t,v),c&&c.m(t,null),F(t,n),l&&l.m(t,null),F(t,r),h[i].m(t,null),e[79](t),a=!0,s||(u=[Nt(mG,"mousedown",e[50]),Nt(t,"keydown",e[42]),Nt(t,"mousedown",e[43]),Nt(t,"contextmenu",e[44])],s=!0)},p:function(d,v){d[1]?c?(c.p(d,v),2&v[0]&&T(c,1)):((c=NE(d)).c(),T(c,1),c.m(t,n)):c&&(Dt(),z(c,1,1,function(){c=null}),Lt()),d[2]?l?(l.p(d,v),4&v[0]&&T(l,1)):((l=IE(d)).c(),T(l,1),l.m(t,r)):l&&(Dt(),z(l,1,1,function(){l=null}),Lt()),o.p(d,v),(!a||2&v[0])&&At(t,"no-main-menu",!d[1])},i:function(d){a||(T(c),T(l),T(o),a=!0)},o:function(d){z(c),z(l),z(o),a=!1},d:function(d){d&&it(t),c&&c.d(),l&&l.d(),h[i].d(),e[79](null),s=!1,Mn(u)}}}function CG(e,t,n){var r,i=Dr("jsoneditor:TreeMode"),o=typeof window=="undefined";i("isSSR:",o);var a,s,u,c,l,f=Ir("simple-modal").open,h=qa(),d=qa(),v=Ir("absolute-popup"),p=v.openAbsolutePopup,m=v.closeAbsolutePopup,g=!1,y=qO(),b=t.readOnly,w=t.externalContent,j=t.mainMenuBar,x=t.navigationBar,R=t.escapeControlCharacters,M=t.escapeUnicodeCharacters,E=t.parser,N=t.parseMemoizeOne,A=t.validator,L=t.validationParser,W=t.pathParser,O=t.indentation,I=t.onError,q=t.onChange,P=t.onChangeMode,_=t.onRenderValue,S=t.onRenderMenu,$=t.onClassName,D=t.onFocus,B=t.onBlur,k=t.onSortModal,H=t.onTransformModal,U=t.onJSONEditorModal,st=!1;o0({onMount:Ti,onDestroy:xi,getWindow:function(){return Bu(u)},hasFocus:function(){return st&&document.hasFocus()||_h(u)},onFocus:function(){g=!0,D&&D()},onBlur:function(){g=!1,B&&B()}});var ut=void 0;function gt(Y){i("updateSelection",Y);var mt=typeof Y=="function"?Y(K.selection):Y;rn(mt,K.selection)||n(17,K=dt(dt({},K),{},{selection:mt}))}var St,Pt,pt,Bt=!1,K=Eh(),$t=!1,Kt=!1,Ct=!1,V="";function Q(Y){return ft.apply(this,arguments)}function ft(){return ft=Ee(Ft().mark(function Y(mt){return Ft().wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:return i("search text updated",mt),n(74,V=mt),Rt.next=4,pr();case 4:return Rt.next=6,$e();case 6:case"end":return Rt.stop()}},Y)})),ft.apply(this,arguments)}function wt(){return(wt=Ee(Ft().mark(function Y(){return Ft().wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return n(18,St=St?wq(St):void 0),mt.next=3,$e();case 3:case"end":return mt.stop()}},Y)}))).apply(this,arguments)}function _t(){return(_t=Ee(Ft().mark(function Y(){return Ft().wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return n(18,St=St?xq(St):void 0),mt.next=3,$e();case 3:case"end":return mt.stop()}},Y)}))).apply(this,arguments)}function Ut(){return(Ut=Ee(Ft().mark(function Y(mt,Rt){var Wt,qt,Yt,ve,Me;return Ft().wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:if(qt=(Wt=St)===null||Wt===void 0?void 0:Wt.activeItem,i("handleReplace",{replacementText:Rt,activeItem:qt}),qt){_e.next=4;break}return _e.abrupt("return");case 4:return Yt=kq(c,K,Rt,qt,E),ve=Yt.operations,Me=Yt.newSelection,xe(ve,function(Fn,jr){return{state:dt(dt({},jr),{},{selection:Me})}}),_e.next=8,pr();case 8:return _e.next=10,$e();case 10:case"end":return _e.stop()}},Y)}))).apply(this,arguments)}function zt(){return zt=Ee(Ft().mark(function Y(mt,Rt){var Wt,qt,Yt;return Ft().wrap(function(ve){for(;;)switch(ve.prev=ve.next){case 0:return i("handleReplaceAll",{text:mt,replacementText:Rt}),Wt=jq(c,K,mt,Rt,E),qt=Wt.operations,Yt=Wt.newSelection,xe(qt,function(Me,_e){return{state:dt(dt({},_e),{},{selection:Yt})}}),ve.next=5,pr();case 5:return ve.next=7,$e();case 7:case"end":return ve.stop()}},Y)})),zt.apply(this,arguments)}function $e(){return qe.apply(this,arguments)}function qe(){return(qe=Ee(Ft().mark(function Y(){var mt,Rt,Wt;return Ft().wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:if(Rt=(mt=St)===null||mt===void 0?void 0:mt.activeItem,i("focusActiveSearchResult",St),!Rt){qt.next=9;break}return Wt=Rt.path,n(17,K=dt(dt({},Rg(c,K,Wt)),{},{selection:void 0})),qt.next=7,pr();case 7:return qt.next=9,oe(Wt);case 9:case"end":return qt.stop()}},Y)}))).apply(this,arguments)}var De=HO({onChange:function(Y){n(23,re=Y)}}),re=De.getState(),Ne,Xe,Bn=vg(function(Y,mt){if(Y==="")return i("clearing search result"),void(St!==void 0&&n(18,St=void 0));n(22,Ct=!0),setTimeout(function(){i("searching...",Y);var Rt=R_(Y,mt,h3);n(18,St=function(Wt,qt,Yt){var ve=Yt!=null&&Yt.activeItem?D_(Yt.activeItem):void 0,Me=qt.findIndex(function(sr){return rn(ve,D_(sr))}),_e=Me!==-1?Me:(Yt==null?void 0:Yt.activeIndex)!==void 0&&(Yt==null?void 0:Yt.activeIndex)0?0:-1,Fn=qt.map(function(sr,Vn){return dt(dt({},sr),{},{active:Vn===_e})}),jr=Fn[_e];return{items:Fn,itemsMap:Pu(Fn,function(sr){return Qt(sr.path)}),activeItem:jr,activeIndex:_e}}(0,Rt,St)),n(22,Ct=!1)})},300),ue=!1,_n=[],Qe=Ol(UO);function gn(Y,mt,Rt,Wt){tc(function(){var qt;try{qt=Qe(Y,mt,Rt,Wt)}catch(Yt){qt=[{path:[],message:"Failed to validate: "+Yt.message,severity:No.warning}]}rn(qt,_n)||(i("validationErrors changed:",qt),n(13,_n=qt))},function(qt){return i("validationErrors updated in ".concat(qt," ms"))})}function ln(){return i("validate"),ut?{parseError:ut,isRepairable:!1}:(gn(c,A,E,L),Ue(_n)?null:{validationErrors:_n})}function ir(){return c}function or(){return K}function ar(Y){Y.json!==void 0&&function(mt){if(mt!==void 0){var Rt=!rn(c,mt);if(i("update external json",{isChanged:Rt,currentlyText:c===void 0}),!!Rt){var Wt={json:c,text:l},qt=K,Yt=c,ve=l,Me=ue;n(11,c=mt),zn(c),n(12,l=void 0),n(24,ue=!1),ut=void 0,an(c),bt({previousJson:Yt,previousState:qt,previousText:ve,previousTextIsRepaired:Me}),me(Wt,null)}}}(Y.json),Y.text!==void 0&&function(mt){if(!(mt===void 0||w.json!==void 0)){var Rt=mt!==l;if(i("update external text",{isChanged:Rt}),!!Rt){var Wt={json:c,text:l},qt=c,Yt=K,ve=l,Me=ue;try{n(11,c=N(mt)),zn(c),n(12,l=mt),n(24,ue=!1),ut=void 0}catch(_e){try{n(11,c=N(Io(mt))),zn(c),n(12,l=mt),n(24,ue=!0),ut=void 0,an(c)}catch(Fn){n(11,c=void 0),n(12,l=w.text),n(24,ue=!1),ut=l!==void 0&&l!==""?Du(l,_e.message||_e.toString()):void 0}}an(c),bt({previousJson:qt,previousState:Yt,previousText:ve,previousTextIsRepaired:Me}),me(Wt,null)}}}(Y.text)}function zn(Y){Bt||(Bt=!0,n(17,K=Vi(Y,K,[],function(mt){return D6({json:mt},d3)?Jo:gl}(Y))))}function an(Y){K.selection!==void 0&&(K.selection&&Ni(Y,K.selection.anchorPath)&&Ni(Y,K.selection.focusPath)||(i("clearing selection: path does not exist anymore",K.selection),n(17,K=dt(dt({},K),{},{selection:qu(Y,K)}))))}function bt(Y){var mt=Y.previousJson,Rt=Y.previousState,Wt=Y.previousText,qt=Y.previousTextIsRepaired;mt===void 0&&Wt===void 0||(c!==void 0?mt!==void 0?De.add({undo:{patch:[{op:"replace",path:"",value:mt}],state:Yr(Rt),json:void 0,text:Wt,textIsRepaired:qt},redo:{patch:[{op:"replace",path:"",value:c}],state:Yr(K),json:void 0,text:l,textIsRepaired:ue}}):De.add({undo:{patch:void 0,json:void 0,text:Wt,state:Yr(Rt),textIsRepaired:qt},redo:{patch:void 0,json:c,state:Yr(K),text:l,textIsRepaired:ue}}):mt!==void 0&&De.add({undo:{patch:void 0,json:mt,state:Yr(Rt),text:Wt,textIsRepaired:qt},redo:{patch:void 0,json:void 0,text:l,textIsRepaired:ue,state:Yr(K)}}))}function ie(Y,mt){if(i("patch",Y,mt),c===void 0)throw new Error("Cannot apply patch: no JSON");var Rt={json:c,text:l},Wt=c,qt=K,Yt=l,ve=ue,Me=P_(c,Y),_e=h_(c,K,Y),Fn=Hu(c,Y),jr=function(la,Mo){return Mo!==void 0||!(arguments.length>2&&arguments[2]!==void 0)||arguments[2]?dt(dt({},la),{},{selection:Mo}):la}(_e.documentState,Fn,!1);i("patch updatedSelection",Fn);var sr=typeof mt=="function"?mt(_e.json,jr):void 0;n(11,c=sr&&sr.json!==void 0?sr.json:_e.json);var Vn=sr&&sr.state!==void 0?sr.state:jr;n(17,K=Vn),n(12,l=void 0),n(24,ue=!1),n(19,pt=void 0),ut=void 0,an(c),De.add({undo:{patch:Me,json:void 0,text:Yt,state:Yr(qt),textIsRepaired:ve},redo:{patch:Y,json:void 0,state:Yr(Vn),text:l,textIsRepaired:ue}});var li={json:c,previousJson:Wt,undo:Me,redo:Y};return me(Rt,li),li}function Le(){!b&&K.selection&>(Wi(K.selection.focusPath,!0))}function yt(){if(!b&&K.selection){var Y=K.selection.focusPath,mt=se(c,Y);Jn(mt)?function(Rt,Wt){i("openJSONEditorModal",{path:Rt,value:Wt}),st=!0,U({content:{json:Wt},path:Rt,onPatch:Xe.onPatch,onClose:function(){st=!1,br()}})}(Y,mt):gt(un(Y,!0))}}function Zt(){if(!b&&Ge(K.selection)){var Y=K.selection.focusPath,mt=Qt(Y),Rt=se(c,Y),Wt=!ja(Rt,K.enforceStringMap,mt,E),qt=Wt?String(Rt):gu(String(Rt),E);i("handleToggleEnforceString",{enforceString:Wt,value:Rt,updatedValue:qt}),xe([{op:"replace",path:mt,value:qt}],function(Yt,ve){return{state:f_(ve,mt,Wt)}})}}function Gt(){return fe.apply(this,arguments)}function fe(){return fe=Ee(Ft().mark(function Y(){var mt,Rt=arguments;return Ft().wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:return mt=!(Rt.length>0&&Rt[0]!==void 0)||Rt[0],Wt.next=3,ME({json:c,documentState:K,indentation:mt?O:void 0,readOnly:b,parser:E,onPatch:xe});case 3:case"end":return Wt.stop()}},Y)})),fe.apply(this,arguments)}function Nn(){return tn.apply(this,arguments)}function tn(){return tn=Ee(Ft().mark(function Y(){var mt,Rt=arguments;return Ft().wrap(function(Wt){for(;;)switch(Wt.prev=Wt.next){case 0:if(mt=!(Rt.length>0&&Rt[0]!==void 0)||Rt[0],c!==void 0){Wt.next=3;break}return Wt.abrupt("return");case 3:return Wt.next=5,EE({json:c,documentState:K,indentation:mt?O:void 0,parser:E});case 5:case"end":return Wt.stop()}},Y)})),tn.apply(this,arguments)}function Tr(){f(nM,{},dt(dt({},Ss),{},{styleWindow:{width:"450px"}}),{onClose:function(){return br()}})}function Z(Y,mt){f(dM,{text:Y,onParse:Sh,onRepair:R6,onApply:mt},dt(dt({},Ss),{},{styleWindow:{width:"600px",height:"500px"},styleContent:{padding:0,height:"100%"}}),{onClose:function(){return br()}})}function ct(){PE({json:c,text:l,documentState:K,keepSelection:!1,readOnly:b,onChange:q,onPatch:xe})}function lt(){!b&&c!==void 0&&K.selection&&Ju(K.selection)&&!Ue(K.selection.focusPath)&&(i("duplicate",{selection:K.selection}),xe(M_(c,C_(K.selection))))}function rt(){if(!b&&K.selection&&(yn(K.selection)||Ge(K.selection))&&!Ue(K.selection.focusPath)){i("extract",{selection:K.selection});var Y=function(mt,Rt){if(Ge(Rt))return[{op:"move",from:Qt(Rt.focusPath),path:""}];if(!yn(Rt))throw new Error("Cannot create extract operations: parent must be an Object or Array");var Wt=se(mt,Ze(Rt.focusPath));if(An(Wt))return[{op:"replace",path:"",value:Rt.paths.map(function(Yt){var ve=Cr(le(Yt));return Wt[ve]})}];if(nr(Wt)){var qt={};return Rt.paths.forEach(function(Yt){var ve=String(le(Yt));qt[ve]=Wt[ve]}),[{op:"replace",path:"",value:qt}]}throw new Error("Cannot extract: unsupported type of selection "+JSON.stringify(Rt))}(c,K.selection);xe(Y,function(mt,Rt){if(Jn(mt))return{state:Ua(mt,Rt,[])}})}}function Tt(Y){c!==void 0&&Yh({insertType:Y,selectInside:!0,refJsonEditor:u,json:c,documentState:K,readOnly:b,parser:E,onPatch:xe,onReplaceJson:wn})}function te(Y){yr(K.selection)&>(un(K.selection.focusPath,!1)),Tt(Y)}function ye(Y){if(!b&&K.selection)if(Bs(K.selection))try{var mt=K.selection.anchorPath,Rt=se(c,mt),Wt=function(Yt,ve,Me){if(ve==="array"){if(Array.isArray(Yt))return Yt;if(In(Yt))return A6(Yt);if(typeof Yt=="string")try{var _e=Me.parse(Yt);if(Array.isArray(_e))return _e;if(In(_e))return A6(_e)}catch(jr){return[Yt]}return[Yt]}if(ve==="object"){if(Array.isArray(Yt))return E6(Yt);if(In(Yt))return Yt;if(typeof Yt=="string")try{var Fn=Me.parse(Yt);if(In(Fn))return Fn;if(Array.isArray(Fn))return E6(Fn)}catch(jr){return{value:Yt}}return{value:Yt}}if(ve==="value")return Jn(Yt)?Me.stringify(Yt):Yt;throw new Error("Cannot convert ".concat(Np(Yt,Me)," to ").concat(ve))}(Rt,Y,E);if(Wt===Rt)return;var qt=[{op:"replace",path:Qt(mt),value:Wt}];i("handleConvert",{selection:K.selection,path:mt,type:Y,operations:qt}),xe(qt,function(Yt,ve){return{state:Ua(Yt,ve,K.selection.focusPath)}})}catch(Yt){I(Yt)}else I(new Error("Cannot convert current selection to ".concat(Y)))}function en(){var Y=w_(c,K,!1),mt=Ze(K.selection.focusPath);!Ue(Y.focusPath)&&rn(mt,Ze(Y.focusPath))?gt(Sa(Y.focusPath)):gt(Ja(mt)),i("insert before",{selection:K.selection,selectionBefore:Y,parentPath:mt}),pr().then(Pi)}function ze(){var Y=yn(K.selection)?le(K.selection.paths):K.selection.focusPath;i("insert after",Y),gt(Sa(Y)),pr().then(Pi)}function bn(Y){return On.apply(this,arguments)}function On(){return(On=Ee(Ft().mark(function Y(mt){return Ft().wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:return Rt.next=2,TE({char:mt,selectInside:!0,refJsonEditor:u,json:c,documentState:K,readOnly:b,parser:E,onPatch:xe,onReplaceJson:wn,onSelect:gt});case 2:case"end":return Rt.stop()}},Y)}))).apply(this,arguments)}function Re(){if(!b&&De.getState().canUndo){var Y=De.undo();if(Y){var mt={json:c,text:l};n(11,c=Y.undo.patch?so(c,Y.undo.patch):Y.undo.json),n(17,K=Y.undo.state),n(12,l=Y.undo.text),n(24,ue=Y.undo.textIsRepaired),ut=void 0,i("undo",{item:Y,json:c,documentState:K}),me(mt,{json:c,previousJson:mt.json,redo:Y.undo.patch,undo:Y.redo.patch}),br(),K.selection&&oe(K.selection.focusPath,!1)}}}function dn(){if(!b&&De.getState().canRedo){var Y=De.redo();if(Y){var mt={json:c,text:l};n(11,c=Y.redo.patch?so(c,Y.redo.patch):Y.redo.json),n(17,K=Y.redo.state),n(12,l=Y.redo.text),n(24,ue=Y.redo.textIsRepaired),ut=void 0,i("redo",{item:Y,json:c,documentState:K}),me(mt,{json:c,previousJson:mt.json,redo:Y.redo.patch,undo:Y.undo.patch}),br(),K.selection&&oe(K.selection.focusPath,!1)}}}function nt(Y){var mt;b||c===void 0||(st=!0,k({id:h,json:c,rootPath:Y,onSort:(mt=Ee(Ft().mark(function Rt(Wt){var qt;return Ft().wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:qt=Wt.operations,i("onSort",Y,qt),xe(qt,function(ve,Me){return{state:dt(dt({},Ua(ve,Me,Y)),{},{selection:un(Y,!1)})}});case 3:case"end":return Yt.stop()}},Rt)})),function(Rt){return mt.apply(this,arguments)}),onClose:function(){st=!1,br()}}))}function Et(){K.selection&&nt(j_(c,K.selection))}function Vt(Y){if(c!==void 0){var mt=Y.id,Rt=Y.onTransform,Wt=Y.onClose,qt=Y.rootPath||[];st=!0,H({id:mt||d,json:c,rootPath:qt,onTransform:function(Yt){Rt?Rt({operations:Yt,json:c,transformedJson:so(c,Yt)}):(i("onTransform",qt,Yt),xe(Yt,function(ve,Me){return{state:dt(dt({},Ua(ve,Me,qt)),{},{selection:un(qt,!1)})}}))},onClose:function(){st=!1,br(),Wt&&Wt()}})}}function ne(){K.selection&&Vt({rootPath:j_(c,K.selection)})}function oe(Y){return Ie.apply(this,arguments)}function Ie(){return Ie=Ee(Ft().mark(function Y(mt){var Rt,Wt,qt,Yt,ve,Me=arguments;return Ft().wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:return Rt=!(Me.length>1&&Me[1]!==void 0)||Me[1],n(17,K=Rg(c,K,mt)),_e.next=4,pr();case 4:if(!(Wt=Ye(mt))){_e.next=16;break}if(i("scrollTo",{path:mt,elem:Wt,refContents:a}),qt=a.getBoundingClientRect(),Yt=Wt.getBoundingClientRect(),Rt){_e.next=12;break}if(!(Yt.bottom>qt.top&&Yt.topRt.bottom-20&&y(mt,{container:a,offset:-(Rt.height-qt-20),duration:0})}}function me(Y,mt){(Y.json!==void 0||(Y==null?void 0:Y.text)!==void 0)&&(l!==void 0?q({text:l,json:void 0},Y,{contentErrors:ln(),patchResult:mt}):c!==void 0&&q({text:void 0,json:c},Y,{contentErrors:ln(),patchResult:mt}))}function xe(Y,mt){if(!b)return i("handlePatch",Y,mt),ie(Y,mt)}function wn(Y,mt){var Rt=K,Wt=c,qt=l,Yt={json:c,text:l},ve=ue,Me=Vi(c,K,[],Jo),_e=typeof mt=="function"?mt(Y,Me):void 0;n(11,c=_e&&_e.json!==void 0?_e.json:Y),n(17,K=_e&&_e.state!==void 0?_e.state:Me),n(12,l=void 0),n(24,ue=!1),ut=void 0,an(c),bt({previousJson:Wt,previousState:Rt,previousText:qt,previousTextIsRepaired:ve}),me(Yt,null)}function xn(Y,mt){i("handleChangeText");var Rt=K,Wt=c,qt=l,Yt={json:c,text:l},ve=ue;try{n(11,c=N(Y)),n(17,K=Vi(c,K,[],Jo)),n(12,l=void 0),n(24,ue=!1),ut=void 0}catch(_e){try{n(11,c=N(Io(Y))),n(17,K=Vi(c,K,[],Jo)),n(12,l=Y),n(24,ue=!0),ut=void 0}catch(Fn){n(11,c=void 0),n(17,K=Eh({json:c,expand:Jo})),n(12,l=Y),n(24,ue=!1),ut=l!==""?Du(l,_e.message||_e.toString()):void 0}}if(typeof mt=="function"){var Me=mt(c,K);n(11,c=Me&&Me.json?Me.json:c),n(17,K=Me&&Me.state?Me.state:K)}an(c),bt({previousJson:Wt,previousState:Rt,previousText:qt,previousTextIsRepaired:ve}),me(Yt,null)}function kr(Y,mt){var Rt=arguments.length>2&&arguments[2]!==void 0&&arguments[2];i("expand",{path:Y,expanded:mt,recursive:Rt}),n(17,K=mt?Rt?Vi(c,K,Y,gl):function(Wt,qt){return dt(dt({},Wt),{},{expandedMap:dt(dt({},Wt.expandedMap),{},fi({},Qt(qt),!0))})}(K,Y):l_(K,Y)),K.selection&&!mt&&function(Wt,qt){return Uu(Wt.focusPath,qt)&&(Wt.focusPath.length>qt.length||_r(Wt))}(K.selection,Y)&>(void 0),setTimeout(function(){_h(u)||br()})}function Zi(Y){i("openFind",{findAndReplace:Y}),n(20,$t=!1),n(21,Kt=!1),pr().then(function(){n(20,$t=!0),n(21,Kt=Y)})}function su(Y,mt){i("handleExpandSection",Y,mt);var Rt=Qt(Y);n(17,K=function(Wt,qt,Yt,ve){return dt(dt({},qt),{},{visibleSectionsMap:dt(dt({},qt.visibleSectionsMap),{},fi({},Yt,c_(Ah(qt,Yt).concat(ve))))})}(0,K,Rt,mt))}function Ea(Y){i("pasted json as text",Y),n(19,pt=Y)}function ci(Y){var mt=Y.anchor,Rt=Y.left,Wt=Y.top,qt=Y.width,Yt=Y.height,ve=Y.offsetTop,Me=Y.offsetLeft,_e=Y.showTip;st=!0;var Fn=p(_J,{json:c,documentState:K,parser:E,showTip:_e,onEditKey:Le,onEditValue:yt,onToggleEnforceString:Zt,onCut:Gt,onCopy:Nn,onPaste:Tr,onRemove:ct,onDuplicate:lt,onExtract:rt,onInsertBefore:en,onInsert:te,onConvert:ye,onInsertAfter:ze,onSort:Et,onTransform:ne,onCloseContextMenu:function(){m(Fn),br()}},{left:Rt,top:Wt,offsetTop:ve,offsetLeft:Me,width:qt,height:Yt,anchor:mt,closeOnOuterClick:!0,onClose:function(){st=!1,br()}})}function Pi(Y){if(!b&&!Ka(K.selection)){if(Y&&(Y.stopPropagation(),Y.preventDefault()),Y&&Y.type==="contextmenu"&&Y.target!==s)ci({left:Y.clientX,top:Y.clientY,width:pa,height:va,showTip:!1});else{var mt,Rt=(mt=a)===null||mt===void 0?void 0:mt.querySelector(".jse-context-menu-pointer.jse-selected");if(Rt)ci({anchor:Rt,offsetTop:2,width:pa,height:va,showTip:!1});else{var Wt,qt=(Wt=a)===null||Wt===void 0?void 0:Wt.getBoundingClientRect();qt&&ci({top:qt.top+2,left:qt.left+2,width:pa,height:va,showTip:!1})}}return!1}}function Aa(){return(Aa=Ee(Ft().mark(function Y(){var mt,Rt,Wt;return Ft().wrap(function(qt){for(;;)switch(qt.prev=qt.next){case 0:return i("apply pasted json",pt),Rt=(mt=pt).path,Wt=mt.contents,gt(un(Rt,!1)),qt.next=5,pr();case 5:xe([{op:"replace",path:Qt(Rt),value:Wt}],function(Yt,ve){return{state:Ua(Yt,ve,Rt)}});case 7:case"end":return qt.stop()}},Y)}))).apply(this,arguments)}function br(){i("focus"),s&&(s.focus(),s.select())}function _o(Y){return function(mt,Rt,Wt){var qt=Ze(Wt),Yt=[le(Wt)],ve=se(mt,qt),Me=ve?zg(ve,Rt,Yt):void 0;return Me?un(qt.concat(Me),!1):Sa(Wt)}(c,K,Y)}function Oo(Y){r&&r.onDrag(Y)}function Jv(){r&&r.onDragEnd()}return e.$$set=function(Y){"readOnly"in Y&&n(0,b=Y.readOnly),"externalContent"in Y&&n(51,w=Y.externalContent),"mainMenuBar"in Y&&n(1,j=Y.mainMenuBar),"navigationBar"in Y&&n(2,x=Y.navigationBar),"escapeControlCharacters"in Y&&n(52,R=Y.escapeControlCharacters),"escapeUnicodeCharacters"in Y&&n(53,M=Y.escapeUnicodeCharacters),"parser"in Y&&n(3,E=Y.parser),"parseMemoizeOne"in Y&&n(54,N=Y.parseMemoizeOne),"validator"in Y&&n(55,A=Y.validator),"validationParser"in Y&&n(56,L=Y.validationParser),"pathParser"in Y&&n(4,W=Y.pathParser),"indentation"in Y&&n(5,O=Y.indentation),"onError"in Y&&n(6,I=Y.onError),"onChange"in Y&&n(57,q=Y.onChange),"onChangeMode"in Y&&n(58,P=Y.onChangeMode),"onRenderValue"in Y&&n(59,_=Y.onRenderValue),"onRenderMenu"in Y&&n(7,S=Y.onRenderMenu),"onClassName"in Y&&n(60,$=Y.onClassName),"onFocus"in Y&&n(61,D=Y.onFocus),"onBlur"in Y&&n(62,B=Y.onBlur),"onSortModal"in Y&&n(63,k=Y.onSortModal),"onTransformModal"in Y&&n(64,H=Y.onTransformModal),"onJSONEditorModal"in Y&&n(65,U=Y.onJSONEditorModal)},e.$$.update=function(){6291456&e.$$.dirty[1]&&n(73,Pt=$g({escapeControlCharacters:R,escapeUnicodeCharacters:M})),1048576&e.$$.dirty[1]&&ar(w),2048&e.$$.dirty[0]|4096&e.$$.dirty[2]&&Bn(V,c),e.$$.dirty[0],2056&e.$$.dirty[0]|50331648&e.$$.dirty[1]&&gn(c,A,E,L),8192&e.$$.dirty[0]&&n(25,Ne=function(Y){var mt={};return Y.forEach(function(Rt){mt[Qt(Rt.path)]=Rt}),Y.forEach(function(Rt){for(var Wt=Rt.path;Wt.length>0;){var qt=Qt(Wt=Ze(Wt));qt in mt||(mt[qt]={isChildError:!0,path:Wt,message:"Contains invalid data",severity:No.warning})}}),mt}(_n)),1024&e.$$.dirty[0]&&(r=a?function(Y){var mt,Rt;function Wt(Me){return Me<20?XN:Me<50?tI:eI}function qt(){if(Y){var Me=(mt||0)*(f3/1e3);Y.scrollTop+=Me}}function Yt(Me){Rt&&Me===mt||(ve(),i0("startAutoScroll",Me),mt=Me,Rt=setInterval(qt,f3))}function ve(){Rt&&(i0("stopAutoScroll"),clearInterval(Rt),Rt=void 0,mt=void 0)}return i0("createAutoScrollHandler",Y),{onDrag:function(Me){if(Y){var _e=Me.clientY,Fn=Y.getBoundingClientRect(),jr=Fn.top,sr=Fn.bottom;_esr?Yt(Wt(_e-sr)):ve()}},onDragEnd:function(){ve()}}}(a):void 0),9&e.$$.dirty[0]|805306368&e.$$.dirty[1]|2048&e.$$.dirty[2]&&n(14,Xe={readOnly:b,parser:E,normalization:Pt,getJson:ir,getDocumentState:or,findElement:Ye,findNextInside:_o,focus:br,onPatch:xe,onInsert:Tt,onExpand:kr,onSelect:gt,onFind:Zi,onExpandSection:su,onPasteJson:Ea,onRenderValue:_,onContextMenu:ci,onClassName:$||function(){},onDrag:Oo,onDragEnd:Jv}),16384&e.$$.dirty[0]&&i("context changed",Xe)},[b,j,x,E,W,O,I,S,function(){return ue&&c!==void 0&&wn(c),{json:c,text:l}},br,a,c,l,_n,Xe,s,u,K,St,pt,$t,Kt,Ct,re,ue,Ne,o,Q,function(){return wt.apply(this,arguments)},function(){return _t.apply(this,arguments)},function(Y,mt){return Ut.apply(this,arguments)},function(Y,mt){return zt.apply(this,arguments)},function(){n(20,$t=!1),n(21,Kt=!1),Q(""),br()},function(Y){i("select validation error",Y),gt(un(Y.path,!1)),oe(Y.path)},Nn,function(Y){Y.preventDefault(),AE({clipboardText:Y.clipboardData.getData("text/plain"),json:c,documentState:K,readOnly:b,parser:E,onPatch:xe,onChangeText:xn,openRepairModal:Z})},Re,dn,function(){nt([])},function(){Vt({rootPath:[]})},function(){kr([],!0,!0)},function(){kr([],!1,!0)},function(Y){var mt=Ha(Y),Rt=Y.shiftKey;if(i("keydown",{combo:mt,key:Y.key}),mt==="Ctrl+X"&&(Y.preventDefault(),Gt(!0)),mt==="Ctrl+Shift+X"&&(Y.preventDefault(),Gt(!1)),mt==="Ctrl+C"&&(Y.preventDefault(),Nn(!0)),mt==="Ctrl+Shift+C"&&(Y.preventDefault(),Nn(!1)),mt==="Ctrl+D"&&(Y.preventDefault(),lt()),mt!=="Delete"&&mt!=="Backspace"||(Y.preventDefault(),ct()),mt==="Insert"&&(Y.preventDefault(),Tt("structure")),mt==="Ctrl+A"&&(Y.preventDefault(),gt(un([],!1))),mt==="Ctrl+Q"&&Pi(Y),mt==="ArrowUp"||mt==="Shift+ArrowUp"){Y.preventDefault();var Wt=K.selection?w_(c,K,Rt,!0)||K.selection:qu(c,K);gt(Wt),pe(Wt.focusPath)}if(mt==="ArrowDown"||mt==="Shift+ArrowDown"){Y.preventDefault();var qt=K.selection?function(Vn,li){var la=arguments.length>2&&arguments[2]!==void 0&&arguments[2],Mo=arguments.length>3&&arguments[3]!==void 0&&arguments[3],kn=li.selection;if(!kn)return null;var wi=!Mo&&yn(kn)?le(kn.paths):kn.focusPath,Xi=zg(Vn,li,wi),Eo=Xi,Ao=Xi;if(Xi===null||Eo==null||Ao==null)return null;if(la){var ws=zg(Vn,Jn(se(Vn,wi))?l_(li,wi):li,wi);return ws===null?null:fo(kn)?wr(Vn,ws,ws):_r(kn)?wr(Vn,Eo,Ao):wr(Vn,kn.anchorPath,ws)}if(yr(kn)){var ht=se(Vn,Ze(Xi));return Array.isArray(ht)?un(Ao,!1):Wi(Ao,!1)}return Ge(kn)?un(Ao,!1):_r(kn)?wr(Vn,Eo,Ao):wr(Vn,Xi,Xi)}(c,K,Rt,!0)||K.selection:qu(c,K);gt(qt),pe(qt.focusPath)}if(mt==="ArrowLeft"||mt==="Shift+ArrowLeft"){Y.preventDefault();var Yt=K.selection?function(Vn,li){var la=arguments.length>2&&arguments[2]!==void 0&&arguments[2],Mo=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],kn=li.selection;if(!kn)return null;var wi=x_(Vn,li,Mo),Xi=wi.caret,Eo=wi.previous;if(la)return yn(kn)?null:wr(Vn,kn.anchorPath,kn.focusPath);if(Xi&&Eo)return Fg(Eo);var Ao=se(Vn,Ze(kn.focusPath));return Ge(kn)&&Array.isArray(Ao)?wr(Vn,kn.focusPath,kn.focusPath):yn(kn)&&!Array.isArray(Ao)?Wi(kn.focusPath,!1):null}(c,K,Rt,!b)||K.selection:qu(c,K);gt(Yt),pe(Yt.focusPath)}if(mt==="ArrowRight"||mt==="Shift+ArrowRight"){Y.preventDefault();var ve=K.selection&&c!==void 0?function(Vn,li){var la=arguments.length>2&&arguments[2]!==void 0&&arguments[2],Mo=!(arguments.length>3&&arguments[3]!==void 0)||arguments[3],kn=li.selection;if(!kn)return null;var wi=x_(Vn,li,Mo),Xi=wi.caret,Eo=wi.next;return la?yn(kn)?null:wr(Vn,kn.anchorPath,kn.focusPath):Xi&&Eo?Fg(Eo):yn(kn)?un(kn.focusPath,!1):null}(c,K,Rt,!b)||K.selection:qu(c,K);gt(ve),pe(ve.focusPath)}if(mt==="Enter"&&K.selection){if(!b&&yn(K.selection)&&K.selection.paths.length===1){var Me=K.selection.focusPath,_e=se(c,Ze(Me));Array.isArray(_e)&>(un(Me,!1))}!b&&yr(K.selection)&&(Y.preventDefault(),gt(dt(dt({},K.selection),{},{edit:!0}))),Ge(K.selection)&&(Y.preventDefault(),Jn(se(c,K.selection.focusPath))?kr(K.selection.focusPath,!0):b||gt(dt(dt({},K.selection),{},{edit:!0})))}if(mt.replace(/^Shift\+/,"").length===1&&K.selection)return Y.preventDefault(),void bn(Y.key);if(mt==="Enter"&&(fo(K.selection)||_r(K.selection)))return Y.preventDefault(),void bn("");if(mt==="Ctrl+Enter"&&Ge(K.selection)){var Fn=se(c,K.selection.focusPath);Rf(Fn)&&window.open(String(Fn),"_blank")}if(mt==="Escape"&&K.selection&&(Y.preventDefault(),gt(void 0)),mt==="Ctrl+F"&&(Y.preventDefault(),Zi(!1)),mt==="Ctrl+H"&&(Y.preventDefault(),Zi(!0)),mt==="Ctrl+Z"){Y.preventDefault();var jr=document.activeElement;jr&&jr.blur&&jr.focus?(jr.blur(),setTimeout(function(){Re(),setTimeout(function(){return jr.select()})})):Re()}if(mt==="Ctrl+Shift+Z"){Y.preventDefault();var sr=document.activeElement;sr&&sr.blur&&sr.focus?(sr.blur(),setTimeout(function(){dn(),setTimeout(function(){return sr.select()})})):dn()}},function(Y){i("handleMouseDown",Y),setTimeout(function(){setTimeout(function(){g||U6(Y.target,"BUTTON")||(br(),K.selection||c!==void 0||l!==""&&l!==void 0||(i("createDefaultSelection"),n(17,K=dt(dt({},K),{},{selection:wr(c||{},[],[])}))))})})},Pi,function(Y){b||ci({anchor:K6(Y.target,"BUTTON"),offsetTop:0,width:pa,height:va,showTip:!0})},function(){return Aa.apply(this,arguments)},function(){i("clear pasted json"),n(19,pt=void 0)},function(){P(Lr.text)},function(Y){gt(Y),br(),oe(Y.focusPath)},function(Y){var mt=!fl(Y.target,function(Rt){return Rt===u});mt&&Ka(K.selection)&&(i("click outside the editor, stop edit mode"),gt(function(Rt){return yr(Rt)||Ge(Rt)?dt(dt({},Rt),{},{edit:!1}):Rt}),g&&s&&(s.focus(),s.blur()),pr().then(function(){setTimeout(function(){s&&s.blur()})}))},w,R,M,N,A,L,q,P,_,$,D,B,k,H,U,function(){var Y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gl;i("expand");var mt=dt(dt({},K),{},{expandedMap:{},visibleSectionsMap:{}});n(17,K=Vi(c,mt,[],Y))},ln,ir,ie,Vt,oe,Ye,Pt,V,function(Y){n(20,$t=Y)},function(Y){He[Y?"unshift":"push"](function(){n(15,s=Y)})},function(Y){He[Y?"unshift":"push"](function(){n(10,a=Y)})},function(){setTimeout(br)},function(Y){He[Y?"unshift":"push"](function(){n(16,u=Y)})}]}var x0=function(e){Ot(n,he);var t=Mt(n);function n(r){var i;return X(this,n),de(ce(i=t.call(this)),r,CG,SG,Be,{readOnly:0,externalContent:51,mainMenuBar:1,navigationBar:2,escapeControlCharacters:52,escapeUnicodeCharacters:53,parser:3,parseMemoizeOne:54,validator:55,validationParser:56,pathParser:4,indentation:5,onError:6,onChange:57,onChangeMode:58,onRenderValue:59,onRenderMenu:7,onClassName:60,onFocus:61,onBlur:62,onSortModal:63,onTransformModal:64,onJSONEditorModal:65,expand:66,validate:67,getJson:68,patch:69,acceptAutoRepair:8,openTransformModal:70,scrollTo:71,findElement:72,focus:9},gG,[-1,-1,-1,-1,-1]),i}return tt(n,[{key:"expand",get:function(){return this.$$.ctx[66]}},{key:"validate",get:function(){return this.$$.ctx[67]}},{key:"getJson",get:function(){return this.$$.ctx[68]}},{key:"patch",get:function(){return this.$$.ctx[69]}},{key:"acceptAutoRepair",get:function(){return this.$$.ctx[8]}},{key:"openTransformModal",get:function(){return this.$$.ctx[70]}},{key:"scrollTo",get:function(){return this.$$.ctx[71]}},{key:"findElement",get:function(){return this.$$.ctx[72]}},{key:"focus",get:function(){return this.$$.ctx[9]}}]),n}();function $G(e){Ae(e,"svelte-107mggt",".jse-modal.svelte-107mggt.svelte-107mggt{--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px;flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family);font-size:var(--jse-font-size);line-height:normal;background:var(--jse-modal-background);color:var(--jse-text-color)}.jse-modal.svelte-107mggt .jse-modal-contents.svelte-107mggt{padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-107mggt .jse-modal-contents .jse-actions.svelte-107mggt{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding)}.jse-modal.svelte-107mggt .jse-modal-contents .jse-actions button.jse-primary.svelte-107mggt{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;background:var(--jse-button-primary-background);color:var(--jse-button-primary-color);padding:var(--jse-padding) calc(2 * var(--jse-padding));border-radius:3px}.jse-modal.svelte-107mggt .jse-modal-contents .jse-actions button.jse-primary.svelte-107mggt:hover{background:var(--jse-button-primary-background-highlight)}.jse-modal.svelte-107mggt .jse-modal-contents .jse-actions button.jse-primary.svelte-107mggt:disabled{background:var(--jse-button-primary-background-disabled)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-modal-overlay-background)}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;height:auto;min-height:500px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-content{flex:1;display:flex;max-height:calc(100vh - 6rem);padding:0}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents.svelte-107mggt{flex:1;display:flex;flex-direction:column;color:inherit;min-height:0;padding:0}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents.svelte-107mggt{flex:1;display:flex;gap:calc(2 * var(--jse-padding));min-height:0;box-sizing:border-box;padding:0 calc(2 * var(--jse-padding)) var(--jse-padding)}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-query-contents.svelte-107mggt{flex:1;display:flex;flex-direction:column}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-107mggt p{margin:var(--jse-padding) 0}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-107mggt p:first-child{margin-top:0}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-107mggt p:last-child{margin-bottom:0}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-query-contents .jse-description.svelte-107mggt code{background:var(--jse-modal-code-background);font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono)}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-query-contents textarea.jse-query.svelte-107mggt{flex:1;outline:none;resize:vertical}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-data-contents.svelte-107mggt{flex:1;display:flex;flex-direction:column;gap:calc(2 * var(--jse-padding))}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-data-contents .jse-original-data.svelte-107mggt{flex:1;display:flex;flex-direction:column;min-height:0;box-sizing:border-box}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-data-contents .jse-original-data.jse-hide.svelte-107mggt{flex:none}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-data-contents .jse-preview-data.svelte-107mggt{flex:1;display:flex;flex-direction:column;min-height:0;box-sizing:border-box}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-data-contents.jse-hide-original-data.svelte-107mggt{flex-direction:column;gap:0;margin-bottom:0}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-actions.svelte-107mggt{padding:var(--jse-padding) calc(2 * var(--jse-padding)) calc(2 * var(--jse-padding))}@media screen and (max-width: 1200px){.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents.svelte-107mggt{flex-direction:column;overflow:auto}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-query-contents textarea.jse-query.svelte-107mggt{min-height:150px;flex:none}.jse-modal.jse-transform.svelte-107mggt .jse-modal-contents .jse-main-contents .jse-data-contents.svelte-107mggt .jse-tree-mode{height:300px;flex:none}}.jse-modal.jse-transform.svelte-107mggt .jse-label.svelte-107mggt{font-weight:bold;display:block;box-sizing:border-box}.jse-modal.jse-transform.svelte-107mggt .jse-label .jse-label-inner.svelte-107mggt{margin-top:calc(2 * var(--jse-padding));margin-bottom:calc(0.5 * var(--jse-padding));box-sizing:border-box}.jse-modal.jse-transform.svelte-107mggt .jse-label .jse-label-inner button.svelte-107mggt{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;font-weight:bold;padding:0}.jse-modal.jse-transform.svelte-107mggt .jse-tree-mode{flex:1;background:var(--jse-input-background-readonly);box-shadow:none;box-sizing:border-box;--jse-main-border:var(--jse-input-border)}.jse-modal.jse-transform.svelte-107mggt input.svelte-107mggt,.jse-modal.jse-transform.svelte-107mggt textarea.svelte-107mggt{border:var(--jse-input-border);outline:none;box-sizing:border-box;padding:calc(0.5 * var(--jse-padding));font-family:var(--jse-font-family-mono);font-size:var(--jse-font-size-mono);color:inherit;background:var(--jse-input-background)}.jse-modal.jse-transform.svelte-107mggt input.svelte-107mggt:focus,.jse-modal.jse-transform.svelte-107mggt textarea.svelte-107mggt:focus{border:var(--jse-input-border-focus)}.jse-modal.jse-transform.svelte-107mggt input.svelte-107mggt:read-only,.jse-modal.jse-transform.svelte-107mggt textarea.svelte-107mggt:read-only{background:var(--jse-input-background-readonly)}.jse-modal.jse-transform.svelte-107mggt .jse-preview.jse-error.svelte-107mggt{flex:1;background:var(--jse-input-background-readonly);border:var(--jse-input-border);color:var(--jse-error-color);padding:calc(0.5 * var(--jse-padding))}.jse-modal.jse-transform.svelte-107mggt a{color:var(--jse-a-color)}.jse-modal.jse-transform.svelte-107mggt a:hover{color:var(--jse-a-color-highlight)}")}function BE(e){var t,n,r,i,o,a=[OG,_G],s=[];function u(c,l){return 16384&l[0]&&(t=null),t==null&&(t=!!Array.isArray(c[14])),t?0:1}return n=u(e,[-1,-1]),r=s[n]=a[n](e),{c:function(){r.c(),i=vn()},m:function(c,l){s[n].m(c,l),ot(c,i,l),o=!0},p:function(c,l){var f=n;(n=u(c,l))===f?s[n].p(c,l):(Dt(),z(s[f],1,1,function(){s[f]=null}),Lt(),(r=s[n])?r.p(c,l):(r=s[n]=a[n](c)).c(),T(r,1),r.m(i.parentNode,i))},i:function(c){o||(T(r),o=!0)},o:function(c){z(r),o=!1},d:function(c){s[n].d(c),c&&it(i)}}}function _G(e){var t;return{c:function(){t=Jt("(Only available for arrays, not for objects)")},m:function(n,r){ot(n,t,r)},p:It,i:It,o:It,d:function(n){n&&it(t)}}}function OG(e){var t,n;return t=new tU({props:{queryOptions:e[12],json:e[14],onChange:e[22]}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:function(r,i){var o={};4096&i[0]&&(o.queryOptions=r[12]),16384&i[0]&&(o.json=r[14]),t.$set(o)},i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function zE(e){var t,n;return t=new x0({props:{externalContent:e[19],readOnly:!0,mainMenuBar:!1,navigationBar:!1,indentation:e[2],escapeControlCharacters:e[3],escapeUnicodeCharacters:e[4],parser:e[5],parseMemoizeOne:e[6],onRenderValue:e[10],onRenderMenu:Dn,onError:console.error,onChange:Dn,onChangeMode:Dn,onFocus:Dn,onBlur:Dn,onSortModal:Dn,onTransformModal:Dn,onJSONEditorModal:Dn,onClassName:e[11],validator:null,validationParser:e[7],pathParser:e[8]}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:function(r,i){var o={};524288&i[0]&&(o.externalContent=r[19]),4&i[0]&&(o.indentation=r[2]),8&i[0]&&(o.escapeControlCharacters=r[3]),16&i[0]&&(o.escapeUnicodeCharacters=r[4]),32&i[0]&&(o.parser=r[5]),64&i[0]&&(o.parseMemoizeOne=r[6]),1024&i[0]&&(o.onRenderValue=r[10]),2048&i[0]&&(o.onClassName=r[11]),128&i[0]&&(o.validationParser=r[7]),256&i[0]&&(o.pathParser=r[8]),t.$set(o)},i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function MG(e){var t,n;return{c:function(){t=G("div"),n=Jt(e[17]),C(t,"class","jse-preview jse-error svelte-107mggt")},m:function(r,i){ot(r,t,i),F(t,n)},p:function(r,i){131072&i[0]&&be(n,r[17])},i:It,o:It,d:function(r){r&&it(t)}}}function EG(e){var t,n;return t=new x0({props:{externalContent:e[18],readOnly:!0,mainMenuBar:!1,navigationBar:!1,indentation:e[2],escapeControlCharacters:e[3],escapeUnicodeCharacters:e[4],parser:e[5],parseMemoizeOne:e[6],onRenderValue:e[10],onRenderMenu:Dn,onError:console.error,onChange:Dn,onChangeMode:Dn,onFocus:Dn,onBlur:Dn,onSortModal:Dn,onTransformModal:Dn,onJSONEditorModal:Dn,onClassName:e[11],validator:null,validationParser:e[7],pathParser:e[8]}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:function(r,i){var o={};262144&i[0]&&(o.externalContent=r[18]),4&i[0]&&(o.indentation=r[2]),8&i[0]&&(o.escapeControlCharacters=r[3]),16&i[0]&&(o.escapeUnicodeCharacters=r[4]),32&i[0]&&(o.parser=r[5]),64&i[0]&&(o.parseMemoizeOne=r[6]),1024&i[0]&&(o.onRenderValue=r[10]),2048&i[0]&&(o.onClassName=r[11]),128&i[0]&&(o.validationParser=r[7]),256&i[0]&&(o.pathParser=r[8]),t.$set(o)},i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function AG(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,v,p,m,g,y,b,w,j,x,R,M,E,N,A,L,W,O,I,q,P,_,S,$,D,B,k,H,U,st,ut,gt,St,Pt,pt,Bt=e[21](e[0]).description+"";t=new lU({props:{queryLanguages:e[9],queryLanguageId:e[0],onChangeQueryLanguage:e[27]}}),y=new on({props:{data:e[15]?qi:Ga}});var K=e[15]&&BE(e);I=new on({props:{data:e[16]?qi:Ga}});var $t=e[16]&&zE(e),Kt=[EG,MG],Ct=[];function V(Q,ft){return Q[17]?1:0}return B=V(e),k=Ct[B]=Kt[B](e),{c:function(){jt(t.$$.fragment),n=vt(),r=G("div"),i=G("div"),o=G("div"),(a=G("div")).innerHTML='
    Language
    ',s=vt(),u=G("div"),c=vt(),(l=G("div")).innerHTML='
    Path
    ',f=vt(),h=G("input"),v=vt(),p=G("div"),m=G("div"),g=G("button"),jt(y.$$.fragment),b=Jt(` + Wizard`),w=vt(),K&&K.c(),j=vt(),(x=G("div")).innerHTML='
    Query
    ',R=vt(),M=G("textarea"),E=vt(),N=G("div"),A=G("div"),L=G("div"),W=G("div"),O=G("button"),jt(I.$$.fragment),q=Jt(` + Original`),P=vt(),$t&&$t.c(),_=vt(),S=G("div"),($=G("div")).innerHTML='
    Preview
    ',D=vt(),k.c(),H=vt(),U=G("div"),st=G("button"),ut=Jt("Transform"),C(a,"class","jse-label svelte-107mggt"),C(u,"class","jse-description svelte-107mggt"),C(l,"class","jse-label svelte-107mggt"),C(h,"class","jse-path svelte-107mggt"),C(h,"type","text"),h.readOnly=!0,C(h,"title","Selected path"),h.value=d=Ue(e[1])?"(whole document)":pi(e[1]),C(g,"type","button"),C(g,"class","svelte-107mggt"),C(m,"class","jse-label-inner svelte-107mggt"),C(p,"class","jse-label svelte-107mggt"),C(x,"class","jse-label svelte-107mggt"),C(M,"class","jse-query svelte-107mggt"),C(M,"spellcheck","false"),M.value=e[13],C(o,"class","jse-query-contents svelte-107mggt"),C(O,"type","button"),C(O,"class","svelte-107mggt"),C(W,"class","jse-label-inner svelte-107mggt"),C(L,"class","jse-label svelte-107mggt"),C(A,"class","jse-original-data svelte-107mggt"),At(A,"jse-hide",!e[16]),C($,"class","jse-label svelte-107mggt"),C(S,"class","jse-preview-data svelte-107mggt"),C(N,"class","jse-data-contents svelte-107mggt"),At(N,"jse-hide-original-data",!e[16]),C(i,"class","jse-main-contents svelte-107mggt"),C(st,"type","button"),C(st,"class","jse-primary svelte-107mggt"),st.disabled=gt=!!e[17],C(U,"class","jse-actions svelte-107mggt"),C(r,"class","jse-modal-contents svelte-107mggt")},m:function(Q,ft){xt(t,Q,ft),ot(Q,n,ft),ot(Q,r,ft),F(r,i),F(i,o),F(o,a),F(o,s),F(o,u),u.innerHTML=Bt,F(o,c),F(o,l),F(o,f),F(o,h),F(o,v),F(o,p),F(p,m),F(m,g),xt(y,g,null),F(g,b),F(o,w),K&&K.m(o,null),F(o,j),F(o,x),F(o,R),F(o,M),F(i,E),F(i,N),F(N,A),F(A,L),F(L,W),F(W,O),xt(I,O,null),F(O,q),F(A,P),$t&&$t.m(A,null),F(N,_),F(N,S),F(S,$),F(S,D),Ct[B].m(S,null),F(r,H),F(r,U),F(U,st),F(st,ut),St=!0,Pt||(pt=[Nt(g,"click",e[25]),Nt(M,"input",e[23]),Nt(O,"click",e[26]),Nt(st,"click",e[24]),Nr(TG.call(null,st))],Pt=!0)},p:function(Q,ft){var wt={};512&ft[0]&&(wt.queryLanguages=Q[9]),1&ft[0]&&(wt.queryLanguageId=Q[0]),t.$set(wt),(!St||1&ft[0])&&Bt!==(Bt=Q[21](Q[0]).description+"")&&(u.innerHTML=Bt),(!St||2&ft[0]&&d!==(d=Ue(Q[1])?"(whole document)":pi(Q[1]))&&h.value!==d)&&(h.value=d);var _t={};32768&ft[0]&&(_t.data=Q[15]?qi:Ga),y.$set(_t),Q[15]?K?(K.p(Q,ft),32768&ft[0]&&T(K,1)):((K=BE(Q)).c(),T(K,1),K.m(o,j)):K&&(Dt(),z(K,1,1,function(){K=null}),Lt()),(!St||8192&ft[0])&&(M.value=Q[13]);var Ut={};65536&ft[0]&&(Ut.data=Q[16]?qi:Ga),I.$set(Ut),Q[16]?$t?($t.p(Q,ft),65536&ft[0]&&T($t,1)):(($t=zE(Q)).c(),T($t,1),$t.m(A,null)):$t&&(Dt(),z($t,1,1,function(){$t=null}),Lt()),(!St||65536&ft[0])&&At(A,"jse-hide",!Q[16]);var zt=B;(B=V(Q))===zt?Ct[B].p(Q,ft):(Dt(),z(Ct[zt],1,1,function(){Ct[zt]=null}),Lt(),(k=Ct[B])?k.p(Q,ft):(k=Ct[B]=Kt[B](Q)).c(),T(k,1),k.m(S,null)),(!St||65536&ft[0])&&At(N,"jse-hide-original-data",!Q[16]),(!St||131072&ft[0]&>!==(gt=!!Q[17]))&&(st.disabled=gt)},i:function(Q){St||(T(t.$$.fragment,Q),T(y.$$.fragment,Q),T(K),T(I.$$.fragment,Q),T($t),T(k),St=!0)},o:function(Q){z(t.$$.fragment,Q),z(y.$$.fragment,Q),z(K),z(I.$$.fragment,Q),z($t),z(k),St=!1},d:function(Q){kt(t,Q),Q&&it(n),Q&&it(r),kt(y),K&&K.d(),kt(I),$t&&$t.d(),Ct[B].d(),Pt=!1,Mn(pt)}}}function PG(e){var t,n,r,i,o;return n=new t_({props:{$$slots:{default:[AG]},$$scope:{ctx:e}}}),{c:function(){t=G("div"),jt(n.$$.fragment),C(t,"class","jse-modal jse-transform svelte-107mggt")},m:function(a,s){ot(a,t,s),xt(n,t,null),r=!0,i||(o=Nr(Qh.call(null,t,e[20])),i=!0)},p:function(a,s){var u={};1048575&s[0]|256&s[1]&&(u.$$scope={dirty:s,ctx:a}),n.$set(u)},i:function(a){r||(T(n.$$.fragment,a),r=!0)},o:function(a){z(n.$$.fragment,a),r=!1},d:function(a){a&&it(t),kt(n),i=!1,o()}}}function TG(e){e.focus()}function RG(e,t,n){var r,i,o=Dr("jsoneditor:TransformModal"),a=t.id,s=a===void 0?"transform-modal-"+Wc():a,u=t.json,c=t.rootPath,l=c===void 0?[]:c,f=t.indentation,h=t.escapeControlCharacters,d=t.escapeUnicodeCharacters,v=t.parser,p=t.parseMemoizeOne,m=t.validationParser,g=t.pathParser,y=t.queryLanguages,b=t.queryLanguageId,w=t.onChangeQueryLanguage,j=t.onRenderValue,x=t.onClassName,R=t.onTransform,M=Ir("simple-modal").close,E="".concat(s,":").concat(Qt(l)),N=ho[E]||{},A=ho.showWizard!==!1,L=ho.showOriginal!==!1,W=N.queryOptions||{},O=b===N.queryLanguageId&&N.query?N.query:_(b).createQuery(u,N.queryOptions||{}),I=N.isManual||!1,q=void 0,P={text:""};function _($){return y.find(function(D){return D.id===$})||y[0]}var S=Eu(function($,D){try{o("previewTransform",{query:D});var B=_(b).executeQuery($,D,v);n(18,P={json:B}),n(17,q=void 0)}catch(k){n(18,P={text:""}),n(17,q=k.toString())}},300);return e.$$set=function($){"id"in $&&n(28,s=$.id),"json"in $&&n(29,u=$.json),"rootPath"in $&&n(1,l=$.rootPath),"indentation"in $&&n(2,f=$.indentation),"escapeControlCharacters"in $&&n(3,h=$.escapeControlCharacters),"escapeUnicodeCharacters"in $&&n(4,d=$.escapeUnicodeCharacters),"parser"in $&&n(5,v=$.parser),"parseMemoizeOne"in $&&n(6,p=$.parseMemoizeOne),"validationParser"in $&&n(7,m=$.validationParser),"pathParser"in $&&n(8,g=$.pathParser),"queryLanguages"in $&&n(9,y=$.queryLanguages),"queryLanguageId"in $&&n(0,b=$.queryLanguageId),"onChangeQueryLanguage"in $&&n(30,w=$.onChangeQueryLanguage),"onRenderValue"in $&&n(10,j=$.onRenderValue),"onClassName"in $&&n(11,x=$.onClassName),"onTransform"in $&&n(31,R=$.onTransform)},e.$$.update=function(){536870914&e.$$.dirty[0]&&n(14,r=se(u,l)),16384&e.$$.dirty[0]&&n(19,i={json:r}),24576&e.$$.dirty[0]&&S(r,O),12289&e.$$.dirty[0]|6&e.$$.dirty[1]&&(n(32,ho[E]={queryOptions:W,query:O,queryLanguageId:b,isManual:I},ho),o("store state in memory",E,ho[E]))},[b,l,f,h,d,v,p,m,g,y,j,x,W,O,r,A,L,q,P,i,M,_,function($){n(12,W=$),n(13,O=_(b).createQuery(u,$)),n(33,I=!1),o("updateQueryByWizard",{queryOptions:W,query:O,isManual:I})},function($){n(13,O=$.target.value),n(33,I=!0),o("handleChangeQuery",{query:O,isManual:I})},function(){try{o("handleTransform",{query:O});var $=_(b).executeQuery(r,O,v);R([{op:"replace",path:Qt(l),value:$}]),M()}catch(D){console.error(D),n(18,P={text:""}),n(17,q=D.toString())}},function(){n(15,A=!A),n(32,ho.showWizard=A,ho)},function(){n(16,L=!L),n(32,ho.showOriginal=L,ho)},function($){o("handleChangeQueryLanguage",$),n(0,b=$),w($);var D=_(b);n(13,O=D.createQuery(u,W)),n(33,I=!1)},s,u,w,R,ho,I]}var NG=function(e){Ot(n,he);var t=Mt(n);function n(r){var i;return X(this,n),de(ce(i=t.call(this)),r,RG,PG,Be,{id:28,json:29,rootPath:1,indentation:2,escapeControlCharacters:3,escapeUnicodeCharacters:4,parser:5,parseMemoizeOne:6,validationParser:7,pathParser:8,queryLanguages:9,queryLanguageId:0,onChangeQueryLanguage:30,onRenderValue:10,onClassName:11,onTransform:31},$G,[-1,-1]),i}return tt(n)}(),es={};function IG(e){Ae(e,"svelte-1y818v2",".jse-modal.svelte-1y818v2.svelte-1y818v2{--height:36px;--multi-item-height:28px;--multi-item-margin:2px;--multi-item-padding:2px 8px;--multi-item-border-radius:6px;--indicator-top:8px;flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;font-family:var(--jse-font-family);font-size:var(--jse-font-size);line-height:normal;background:var(--jse-modal-background);color:var(--jse-text-color)}.jse-modal.svelte-1y818v2 .jse-modal-contents.svelte-1y818v2{padding:20px;overflow:auto;min-width:0;min-height:0}.jse-modal.svelte-1y818v2 .jse-modal-contents .jse-actions.svelte-1y818v2{display:flex;flex-direction:row;justify-content:flex-end;padding-top:var(--jse-padding)}.jse-modal.svelte-1y818v2 .jse-modal-contents .jse-actions button.jse-primary.svelte-1y818v2{border:none;background:transparent;color:inherit;cursor:pointer;font-family:var(--jse-font-family);font-size:var(--jse-font-size);padding:5px;margin:0;background:var(--jse-button-primary-background);color:var(--jse-button-primary-color);padding:var(--jse-padding) calc(2 * var(--jse-padding));border-radius:3px}.jse-modal.svelte-1y818v2 .jse-modal-contents .jse-actions button.jse-primary.svelte-1y818v2:hover{background:var(--jse-button-primary-background-highlight)}.jse-modal.svelte-1y818v2 .jse-modal-contents .jse-actions button.jse-primary.svelte-1y818v2:disabled{background:var(--jse-button-primary-background-disabled)}.bg.jse-modal-bg{width:100%;height:100%;top:0;left:0;background:var(--jse-modal-overlay-background)}.bg.jse-modal-bg .jse-modal-window-wrap{margin:0}.bg.jse-modal-bg .jse-modal-window{max-width:90%;margin:4rem auto 2rem auto;border-radius:2px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-sort{width:400px}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-transform{width:1200px;height:1200px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-window.jse-modal-window-jsoneditor{width:800px;height:auto;min-height:500px;max-height:80%;display:flex}.bg.jse-modal-bg .jse-modal-content{flex:1;display:flex;max-height:calc(100vh - 6rem);padding:0}.jse-modal.jse-sort.svelte-1y818v2 table.svelte-1y818v2{width:100%;border-collapse:collapse;border-spacing:0}.jse-modal.jse-sort.svelte-1y818v2 table th.svelte-1y818v2,.jse-modal.jse-sort.svelte-1y818v2 table td.svelte-1y818v2{text-align:left;vertical-align:middle;font-weight:normal;padding-bottom:var(--jse-padding)}.jse-modal.jse-sort.svelte-1y818v2 table th input.jse-path.svelte-1y818v2,.jse-modal.jse-sort.svelte-1y818v2 table td input.jse-path.svelte-1y818v2{width:100%;box-sizing:border-box;padding:6px 16px;border:var(--jse-input-border);border-radius:var(--jse-input-radius);font-family:inherit;font-size:inherit;background:inherit;color:inherit;outline:none}.jse-modal.jse-sort.svelte-1y818v2 table th input.jse-path.svelte-1y818v2:read-only,.jse-modal.jse-sort.svelte-1y818v2 table td input.jse-path.svelte-1y818v2:read-only{background:var(--jse-input-background-readonly)}.jse-modal.jse-sort.svelte-1y818v2 table th.svelte-1y818v2 .svelte-select input,.jse-modal.jse-sort.svelte-1y818v2 table td.svelte-1y818v2 .svelte-select input{box-sizing:border-box}.jse-modal.jse-sort.svelte-1y818v2 .jse-space.svelte-1y818v2{height:200px}.jse-modal.jse-sort.svelte-1y818v2 .jse-space .jse-error.svelte-1y818v2{color:var(--jse-error-color)}")}function FE(e){var t,n,r,i,o,a,s;function u(l){e[14](l)}var c={showChevron:!0,items:e[3]};return e[1]!==void 0&&(c.value=e[1]),o=new qs({props:c}),He.push(function(){return no(o,"value",u)}),{c:function(){t=G("tr"),(n=G("th")).textContent="Property",r=vt(),i=G("td"),jt(o.$$.fragment),C(n,"class","svelte-1y818v2"),C(i,"class","svelte-1y818v2")},m:function(l,f){ot(l,t,f),F(t,n),F(t,r),F(t,i),xt(o,i,null),s=!0},p:function(l,f){var h={};8&f&&(h.items=l[3]),!a&&2&f&&(a=!0,h.value=l[1],eo(function(){return a=!1})),o.$set(h)},i:function(l){s||(T(o.$$.fragment,l),s=!0)},o:function(l){z(o.$$.fragment,l),s=!1},d:function(l){l&&it(t),kt(o)}}}function VE(e){var t,n;return{c:function(){t=G("div"),n=Jt(e[5]),C(t,"class","jse-error svelte-1y818v2")},m:function(r,i){ot(r,t,i),F(t,n)},p:function(r,i){32&i&&be(n,r[5])},d:function(r){r&&it(t)}}}function DG(e){var t,n,r,i,o,a,s,u,c,l,f,h,d,v,p,m,g,y,b,w,j,x,R,M,E,N,A,L,W,O,I,q;n=new s0({props:{title:e[4]?"Sort array items":"Sort object keys"}});var P=e[4]&&(e[3].length>1||e[1]===void 0)&&FE(e);function _(D){e[15](D)}var S={showChevron:!0,clearable:!1,items:e[7]};e[2]!==void 0&&(S.value=e[2]),j=new qs({props:S}),He.push(function(){return no(j,"value",_)});var $=e[5]&&VE(e);return{c:function(){t=G("div"),jt(n.$$.fragment),r=vt(),i=G("div"),o=G("table"),(a=G("colgroup")).innerHTML=` + `,s=vt(),u=G("tbody"),c=G("tr"),(l=G("th")).textContent="Path",f=vt(),h=G("td"),d=G("input"),p=vt(),P&&P.c(),m=vt(),g=G("tr"),(y=G("th")).textContent="Direction",b=vt(),w=G("td"),jt(j.$$.fragment),R=vt(),M=G("div"),$&&$.c(),E=vt(),N=G("div"),A=G("button"),L=Jt("Sort"),C(l,"class","svelte-1y818v2"),C(d,"class","jse-path svelte-1y818v2"),C(d,"type","text"),d.readOnly=!0,C(d,"title","Selected path"),d.value=v=Ue(e[0])?"(whole document)":pi(e[0]),C(h,"class","svelte-1y818v2"),C(y,"class","svelte-1y818v2"),C(w,"class","svelte-1y818v2"),C(o,"class","svelte-1y818v2"),C(M,"class","jse-space svelte-1y818v2"),C(A,"type","button"),C(A,"class","jse-primary svelte-1y818v2"),A.disabled=W=!!e[4]&&!e[1],C(N,"class","jse-actions svelte-1y818v2"),C(i,"class","jse-modal-contents svelte-1y818v2"),C(t,"class","jse-modal jse-sort svelte-1y818v2")},m:function(D,B){ot(D,t,B),xt(n,t,null),F(t,r),F(t,i),F(i,o),F(o,a),F(o,s),F(o,u),F(u,c),F(c,l),F(c,f),F(c,h),F(h,d),F(u,p),P&&P.m(u,null),F(u,m),F(u,g),F(g,y),F(g,b),F(g,w),xt(j,w,null),F(i,R),F(i,M),$&&$.m(M,null),F(i,E),F(i,N),F(N,A),F(A,L),O=!0,I||(q=[Nt(A,"click",e[8]),Nr(LG.call(null,A)),Nr(Qh.call(null,t,e[6]))],I=!0)},p:function(D,B){var k=ke(B,1)[0],H={};16&k&&(H.title=D[4]?"Sort array items":"Sort object keys"),n.$set(H),(!O||1&k&&v!==(v=Ue(D[0])?"(whole document)":pi(D[0]))&&d.value!==v)&&(d.value=v),D[4]&&(D[3].length>1||D[1]===void 0)?P?(P.p(D,k),26&k&&T(P,1)):((P=FE(D)).c(),T(P,1),P.m(u,m)):P&&(Dt(),z(P,1,1,function(){P=null}),Lt());var U={};!x&&4&k&&(x=!0,U.value=D[2],eo(function(){return x=!1})),j.$set(U),D[5]?$?$.p(D,k):(($=VE(D)).c(),$.m(M,null)):$&&($.d(1),$=null),(!O||18&k&&W!==(W=!!D[4]&&!D[1]))&&(A.disabled=W)},i:function(D){O||(T(n.$$.fragment,D),T(P),T(j.$$.fragment,D),O=!0)},o:function(D){z(n.$$.fragment,D),z(P),z(j.$$.fragment,D),O=!1},d:function(D){D&&it(t),kt(n),P&&P.d(),kt(j),$&&$.d(),I=!1,Mn(q)}}}function LG(e){e.focus()}function BG(e,t,n){var r,i,o,a=Dr("jsoneditor:SortModal"),s=t.id,u=t.json,c=t.rootPath,l=t.onSort,f=Ir("simple-modal").close,h="".concat(s,":").concat(Qt(c)),d=se(u,c),v={value:1,label:"ascending"},p=[v,{value:-1,label:"descending"}],m=es[h]&&es[h].selectedProperty||void 0,g=es[h]&&es[h].selectedDirection||v,y=void 0;return e.$$set=function(b){"id"in b&&n(9,s=b.id),"json"in b&&n(10,u=b.json),"rootPath"in b&&n(0,c=b.rootPath),"onSort"in b&&n(11,l=b.onSort)},e.$$.update=function(){16&e.$$.dirty&&n(13,i=r&&d!==void 0?kg(d):void 0),8192&e.$$.dirty&&n(3,o=i?i.map(hl):void 0),10&e.$$.dirty&&m===void 0&&o&&o.length===1&&n(1,m=o[0]),4102&e.$$.dirty&&(n(12,es[h]={selectedProperty:m,selectedDirection:g},es),a("store state in memory",h,es[h]))},n(4,r=Array.isArray(d)),[c,m,g,o,r,y,f,p,function(){try{var b,w;n(5,y=void 0);var j=(b=m)===null||b===void 0?void 0:b.value,x=(w=g)===null||w===void 0?void 0:w.value,R=fE(u,c,j,x);l({operations:R,rootPath:c,itemPath:j,direction:x}),f()}catch(M){n(5,y=M.toString())}},s,u,l,es,i,function(b){n(1,m=b),n(3,o),n(13,i),n(4,r)},function(b){n(2,g=b)}]}var zG=function(e){Ot(n,he);var t=Mt(n);function n(r){var i;return X(this,n),de(ce(i=t.call(this)),r,BG,DG,Be,{id:9,json:10,rootPath:0,onSort:11},IG),i}return tt(n)}();function Zo(){}function Xh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e3;if(e<.9*t)return e.toFixed()+" B";var n=e/t;if(n<.9*t)return n.toFixed(1)+" KB";var r=n/t;if(r<.9*t)return r.toFixed(1)+" MB";var i=r/t;return i<.9*t?i.toFixed(1)+" GB":(i/t).toFixed(1)+" TB"}function FG(e){var t,n;return t=new Gh({props:{items:e[0]}}),{c:function(){jt(t.$$.fragment)},m:function(r,i){xt(t,r,i),n=!0},p:function(r,i){var o={};1&ke(i,1)[0]&&(o.items=r[0]),t.$set(o)},i:function(r){n||(T(t.$$.fragment,r),n=!0)},o:function(r){z(t.$$.fragment,r),n=!1},d:function(r){kt(t,r)}}}function VG(e,t,n){var r,i,o=t.readOnly,a=o!==void 0&&o,s=t.onFormat,u=t.onCompact,c=t.onSort,l=t.onTransform,f=t.onToggleSearch,h=t.onUndo,d=t.onRedo,v=t.canUndo,p=t.canRedo,m=t.canFormat,g=t.canCompact,y=t.canSort,b=t.canTransform,w=t.onRenderMenu,j={type:"button",icon:Gg,title:"Search (Ctrl+F)",className:"jse-search",onClick:f};return e.$$set=function(x){"readOnly"in x&&n(1,a=x.readOnly),"onFormat"in x&&n(2,s=x.onFormat),"onCompact"in x&&n(3,u=x.onCompact),"onSort"in x&&n(4,c=x.onSort),"onTransform"in x&&n(5,l=x.onTransform),"onToggleSearch"in x&&n(6,f=x.onToggleSearch),"onUndo"in x&&n(7,h=x.onUndo),"onRedo"in x&&n(8,d=x.onRedo),"canUndo"in x&&n(9,v=x.canUndo),"canRedo"in x&&n(10,p=x.canRedo),"canFormat"in x&&n(11,m=x.canFormat),"canCompact"in x&&n(12,g=x.canCompact),"canSort"in x&&n(13,y=x.canSort),"canTransform"in x&&n(14,b=x.canTransform),"onRenderMenu"in x&&n(15,w=x.onRenderMenu)},e.$$.update=function(){32702&e.$$.dirty&&n(16,i=a?[j,{type:"space"}]:[{type:"button",icon:d0,title:"Format JSON: add proper indentation and new lines (Ctrl+I)",className:"jse-format",onClick:s,disabled:a||!m},{type:"button",icon:jK,title:"Compact JSON: remove all white spacing and new lines (Ctrl+Shift+I)",className:"jse-compact",onClick:u,disabled:a||!g},{type:"separator"},{type:"button",icon:Lh,title:"Sort",className:"jse-sort",onClick:c,disabled:a||!y},{type:"button",icon:Nh,title:"Transform contents (filter, sort, project)",className:"jse-transform",onClick:l,disabled:a||!b},j,{type:"separator"},{type:"button",icon:Kg,title:"Undo (Ctrl+Z)",className:"jse-undo",onClick:h,disabled:!v},{type:"button",icon:Jg,title:"Redo (Ctrl+Shift+Z)",className:"jse-redo",onClick:d,disabled:!p},{type:"space"}]),98304&e.$$.dirty&&n(0,r=w(i)||i)},[r,a,s,u,c,l,f,h,d,v,p,m,g,y,b,w,i]}var WG=function(e){Ot(n,he);var t=Mt(n);function n(r){var i;return X(this,n),de(ce(i=t.call(this)),r,VG,FG,Be,{readOnly:1,onFormat:2,onCompact:3,onSort:4,onTransform:5,onToggleSearch:6,onUndo:7,onRedo:8,canUndo:9,canRedo:10,canFormat:11,canCompact:12,canSort:13,canTransform:14,onRenderMenu:15}),i}return tt(n)}(),Tn=function(){function e(){X(this,e)}return tt(e,[{key:"lineAt",value:function(t){if(t<0||t>this.length)throw new RangeError("Invalid position ".concat(t," in document of length ").concat(this.length));return this.lineInner(t,!1,1,0)}},{key:"line",value:function(t){if(t<1||t>this.lines)throw new RangeError("Invalid line number ".concat(t," in ").concat(this.lines,"-line document"));return this.lineInner(t,!0,1,0)}},{key:"replace",value:function(t,n,r){var i=[];return this.decompose(0,t,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),td.from(i,this.length-(n-t)+r.length)}},{key:"append",value:function(t){return this.replace(this.length,this.length,t)}},{key:"slice",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.length,r=[];return this.decompose(t,n,r,0),td.from(r,n-t)}},{key:"eq",value:function(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;for(var n=this.scanIdentical(t,1),r=this.length-this.scanIdentical(t,-1),i=new El(this),o=new El(t),a=n,s=n;;){if(i.next(a),o.next(a),a=0,i.lineBreak!=o.lineBreak||i.done!=o.done||i.value!=o.value)return!1;if(s+=i.value.length,i.done||s>=r)return!0}}},{key:"iter",value:function(){return new El(this,arguments.length>0&&arguments[0]!==void 0?arguments[0]:1)}},{key:"iterRange",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.length;return new qE(this,t,n)}},{key:"iterLines",value:function(t,n){var r;if(t==null)r=this.iter();else{n==null&&(n=this.lines+1);var i=this.line(t).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new HE(r)}},{key:"toString",value:function(){return this.sliceString(0)}},{key:"toJSON",value:function(){var t=[];return this.flatten(t),t}}],[{key:"of",value:function(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length!=1||t[0]?t.length<=32?new mo(t):td.from(mo.split(t,[])):e.empty}}]),e}(),mo=function(e){Ot(n,Tn);var t=Mt(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(a){var s,u=-1,c=at(a);try{for(c.s();!(s=c.n()).done;)u+=s.value.length+1}catch(l){c.e(l)}finally{c.f()}return u}(r);return X(this,n),(i=t.call(this)).text=r,i.length=o,i}return tt(n,[{key:"lines",get:function(){return this.text.length}},{key:"children",get:function(){return null}},{key:"lineInner",value:function(r,i,o,a){for(var s=0;;s++){var u=this.text[s],c=a+u.length;if((i?o:c)>=r)return new qG(a,c,o,u);a=c+1,o++}}},{key:"decompose",value:function(r,i,o,a){var s=r<=0&&i>=this.length?this:new n(WE(this.text,r,i),Math.min(i,this.length)-Math.max(0,r));if(1&a){var u=o.pop(),c=ed(s.text,u.text.slice(),0,s.length);if(c.length<=32)o.push(new n(c,u.length+s.length));else{var l=c.length>>1;o.push(new n(c.slice(0,l)),new n(c.slice(l)))}}else o.push(s)}},{key:"replace",value:function(r,i,o){if(!(o instanceof n))return fn(Ke(n.prototype),"replace",this).call(this,r,i,o);var a=ed(this.text,ed(o.text,WE(this.text,0,r)),i),s=this.length+o.length-(i-r);return a.length<=32?new n(a,s):td.from(n.split(a,[]),s)}},{key:"sliceString",value:function(r){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.length,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:` +`,a="",s=0,u=0;s<=i&&ur&&u&&(a+=o),rs&&(a+=c.slice(Math.max(0,r-s),i-s)),s=l+1}return a}},{key:"flatten",value:function(r){var i,o=at(this.text);try{for(o.s();!(i=o.n()).done;){var a=i.value;r.push(a)}}catch(s){o.e(s)}finally{o.f()}}},{key:"scanIdentical",value:function(){return 0}}],[{key:"split",value:function(r,i){var o,a=[],s=-1,u=at(r);try{for(u.s();!(o=u.n()).done;){var c=o.value;a.push(c),s+=c.length+1,a.length==32&&(i.push(new n(a,s)),a=[],s=-1)}}catch(l){u.e(l)}finally{u.f()}return s>-1&&i.push(new n(a,s)),i}}]),n}(),td=function(e){Ot(n,Tn);var t=Mt(n);function n(r,i){var o;X(this,n),(o=t.call(this)).children=r,o.length=i,o.lines=0;var a,s=at(r);try{for(s.s();!(a=s.n()).done;){var u=a.value;o.lines+=u.lines}}catch(c){s.e(c)}finally{s.f()}return o}return tt(n,[{key:"lineInner",value:function(r,i,o,a){for(var s=0;;s++){var u=this.children[s],c=a+u.length,l=o+u.lines-1;if((i?l:c)>=r)return u.lineInner(r,i,o,a);a=c+1,o=l+1}}},{key:"decompose",value:function(r,i,o,a){for(var s=0,u=0;u<=i&&s=u){var f=a&((u<=r?1:0)|(l>=i?2:0));u>=r&&l<=i&&!f?o.push(c):c.decompose(r-u,i-u,o,f)}u=l+1}}},{key:"replace",value:function(r,i,o){if(o.lines=s&&i<=c){var l=u.replace(r-s,i-s,o),f=this.lines-u.lines+l.lines;if(l.lines>4&&l.lines>f>>6){var h=this.children.slice();return h[a]=l,new n(h,this.length-(i-r)+o.length)}return fn(Ke(n.prototype),"replace",this).call(this,s,c,l)}s=c+1}return fn(Ke(n.prototype),"replace",this).call(this,r,i,o)}},{key:"sliceString",value:function(r){for(var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.length,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:` +`,a="",s=0,u=0;sr&&s&&(a+=o),ru&&(a+=c.sliceString(r-u,i-u,o)),u=l+1}return a}},{key:"flatten",value:function(r){var i,o=at(this.children);try{for(o.s();!(i=o.n()).done;)i.value.flatten(r)}catch(a){o.e(a)}finally{o.f()}}},{key:"scanIdentical",value:function(r,i){if(!(r instanceof n))return 0;for(var o=0,a=ke(i>0?[0,0,this.children.length,r.children.length]:[this.children.length-1,r.children.length-1,-1,-1],4),s=a[0],u=a[1],c=a[2],l=a[3];;s+=i,u+=i){if(s==c||u==l)return o;var f=this.children[s],h=r.children[u];if(f!=h)return o+f.scanIdentical(h,i);o+=f.length+1}}}],[{key:"from",value:function(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.reduce(function(x,R){return x+R.length+1},-1),a=0,s=at(r);try{for(s.s();!(i=s.n()).done;)a+=i.value.lines}catch(x){s.e(x)}finally{s.f()}if(a<32){var u,c=[],l=at(r);try{for(l.s();!(u=l.n()).done;)u.value.flatten(c)}catch(x){l.e(x)}finally{l.f()}return new mo(c,o)}var f=Math.max(32,a>>5),h=f<<1,d=f>>1,v=[],p=0,m=-1,g=[];function y(x){var R;if(x.lines>h&&x instanceof n){var M,E=at(x.children);try{for(E.s();!(M=E.n()).done;)y(M.value)}catch(N){E.e(N)}finally{E.f()}}else x.lines>d&&(p>d||!p)?(b(),v.push(x)):x instanceof mo&&p&&(R=g[g.length-1])instanceof mo&&x.lines+R.lines<=32?(p+=x.lines,m+=x.length+1,g[g.length-1]=new mo(R.text.concat(x.text),R.length+1+x.length)):(p+x.lines>f&&b(),p+=x.lines,m+=x.length+1,g.push(x))}function b(){p!=0&&(v.push(g.length==1?g[0]:n.from(g,m)),m=-1,p=g.length=0)}var w,j=at(r);try{for(j.s();!(w=j.n()).done;)y(w.value)}catch(x){j.e(x)}finally{j.f()}return b(),v.length==1?v[0]:new n(v,o)}}]),n}();function ed(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1e9,i=0,o=0,a=!0;o=n&&(u>r&&(s=s.slice(0,r-i)),i1&&arguments[1]!==void 0?arguments[1]:1;X(this,e),this.dir=n,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[n>0?1:(t instanceof mo?t.text.length:t.children.length)<<1]}return tt(e,[{key:"nextInner",value:function(t,n){for(this.done=this.lineBreak=!1;;){var r=this.nodes.length-1,i=this.nodes[r],o=this.offsets[r],a=o>>1,s=i instanceof mo?i.text.length:i.children.length;if(a==(n>0?s:0)){if(r==0)return this.done=!0,this.value="",this;n>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&o)==(n>0?0:1)){if(this.offsets[r]+=n,t==0)return this.lineBreak=!0,this.value=` +`,this;t--}else if(i instanceof mo){var u=i.text[a+(n<0?-1:0)];if(this.offsets[r]+=n,u.length>Math.max(0,t))return this.value=t==0?u:n>0?u.slice(t):u.slice(0,u.length-t),this;t-=u.length}else{var c=i.children[a+(n<0?-1:0)];t>c.length?(t-=c.length,this.offsets[r]+=n):(n<0&&this.offsets[r]--,this.nodes.push(c),this.offsets.push(n>0?1:(c instanceof mo?c.text.length:c.children.length)<<1))}}}},{key:"next",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}]),e}(),qE=function(){function e(t,n,r){X(this,e),this.value="",this.done=!1,this.cursor=new El(t,n>r?-1:1),this.pos=n>r?t.length:0,this.from=Math.min(n,r),this.to=Math.max(n,r)}return tt(e,[{key:"nextInner",value:function(t,n){if(n<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,n<0?this.pos-this.to:this.from-this.pos);var r=n<0?this.pos-this.from:this.to-this.pos;t>r&&(t=r),r-=t;var i=this.cursor.next(t).value;return this.pos+=(i.length+t)*n,this.value=i.length<=r?i:n<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}},{key:"next",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}},{key:"lineBreak",get:function(){return this.cursor.lineBreak&&this.value!=""}}]),e}(),HE=function(){function e(t){X(this,e),this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}return tt(e,[{key:"next",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=this.inner.next(t),r=n.done,i=n.lineBreak,o=n.value;return r?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}},{key:"lineBreak",get:function(){return!1}}]),e}();typeof Symbol!="undefined"&&(Tn.prototype[Symbol.iterator]=function(){return this.iter()},El.prototype[Symbol.iterator]=qE.prototype[Symbol.iterator]=HE.prototype[Symbol.iterator]=function(){return this});for(var qG=function(){function e(t,n,r,i){X(this,e),this.from=t,this.to=n,this.number=r,this.text=i}return tt(e,[{key:"length",get:function(){return this.to-this.from}}]),e}(),ac="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(function(e){return e?parseInt(e,36):1}),nd=1;nde)return ac[t-1]<=e;return!1}function UE(e){return e>=127462&&e<=127487}var JE=8205;function si(e,t){return(!(arguments.length>2&&arguments[2]!==void 0)||arguments[2]?KE:UG)(e,t,!(arguments.length>3&&arguments[3]!==void 0)||arguments[3])}function KE(e,t,n){if(t==e.length)return t;t&&GE(e.charCodeAt(t))&&QE(e.charCodeAt(t-1))&&t--;var r=Vr(e,t);for(t+=_i(r);t=0&&UE(Vr(e,a));)o++,a-=2;if(o%2==0)break;t+=2}}return t}function UG(e,t,n){for(;t>0;){var r=KE(e,t-2,n);if(r=56320&&e<57344}function QE(e){return e>=55296&&e<56320}function Vr(e,t){var n=e.charCodeAt(t);if(!QE(n)||t+1==e.length)return n;var r=e.charCodeAt(t+1);return GE(r)?r-56320+(n-55296<<10)+65536:n}function k0(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function _i(e){return e<65536?1:2}var j0=/\r\n?|\n/,ui=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(ui||(ui={})),sc=function(){function e(t){X(this,e),this.sections=t}return tt(e,[{key:"length",get:function(){for(var t=0,n=0;n1&&arguments[1]!==void 0&&arguments[1])}},{key:"invertedDesc",get:function(){for(var t=[],n=0;n1&&arguments[1]!==void 0&&arguments[1];return t.empty?this:C0(this,t,n)}},{key:"mapPos",value:function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ui.Simple,i=0,o=0,a=0;at)return o+(t-i);o+=s}else{if(r!=ui.Simple&&c>=t&&(r==ui.TrackDel&&it||r==ui.TrackBefore&&it))return null;if(c>t||c==t&&n<0&&!s)return t==i||n<0?o:o+u;o+=u}i=c}if(t>i)throw new RangeError("Position ".concat(t," is out of range for changeset of length ").concat(i));return o}},{key:"touchesRange",value:function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,r=0,i=0;r=0&&i<=n&&o>=t)return!(in)||"cover";i=o}return!1}},{key:"toString",value:function(){for(var t="",n=0;n=0?":"+i:"")}return t}},{key:"toJSON",value:function(){return this.sections}}],[{key:"fromJSON",value:function(t){if(!Array.isArray(t)||t.length%2||t.some(function(n){return typeof n!="number"}))throw new RangeError("Invalid JSON representation of ChangeDesc");return new e(t)}},{key:"create",value:function(t){return new e(t)}}]),e}(),go=function(e){Ot(n,sc);var t=Mt(n);function n(r,i){var o;return X(this,n),(o=t.call(this,r)).inserted=i,o}return tt(n,[{key:"apply",value:function(r){if(this.length!=r.length)throw new RangeError("Applying change set to a document with the wrong length");return S0(this,function(i,o,a,s,u){return r=r.replace(a,a+(o-i),u)},!1),r}},{key:"mapDesc",value:function(r){return C0(this,r,arguments.length>1&&arguments[1]!==void 0&&arguments[1],!0)}},{key:"invert",value:function(r){for(var i=this.sections.slice(),o=[],a=0,s=0;a=0){i[a]=c,i[a+1]=u;for(var l=a>>1;o.length1&&arguments[1]!==void 0&&arguments[1];return r.empty?this:C0(this,r,i,!0)}},{key:"iterChanges",value:function(r){S0(this,r,arguments.length>1&&arguments[1]!==void 0&&arguments[1])}},{key:"desc",get:function(){return sc.create(this.sections)}},{key:"filter",value:function(r){var i=[],o=[],a=[],s=new Al(this);t:for(var u=0,c=0;;){for(var l=u==r.length?1e9:r[u++];c0&&ns(o,i,s.text),s.forward(f),c+=f}for(var d=r[u++];c>1].toJSON()))}return r}}],[{key:"of",value:function(r,i,o){var a=[],s=[],u=0,c=null;function l(){if(arguments.length>0&&arguments[0]!==void 0&&arguments[0]||a.length){ug||p<0||g>i)throw new RangeError("Invalid change range ".concat(p," to ").concat(g," (in doc of length ").concat(i,")"));var b=y?typeof y=="string"?Tn.of(y.split(o||j0)):y:Tn.empty,w=b.length;if(p==g&&w==0)return;pu&&Xr(a,p-u,-1),Xr(a,g-p,w),ns(s,a,b),u=g}}(r),l(!c),c}},{key:"empty",value:function(r){return new n(r?[r,-1]:[],[])}},{key:"fromJSON",value:function(r){if(!Array.isArray(r))throw new RangeError("Invalid JSON representation of ChangeSet");for(var i=[],o=[],a=0;a3&&arguments[3]!==void 0&&arguments[3];if(!(t==0&&n<=0)){var i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:t==0&&e[i]==0?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}}function ns(e,t,n){if(n.length!=0){var r=t.length-2>>1;if(r>1])),!(n||a==e.sections.length||e.sections[a+1]<0);)s=e.sections[a++],u=e.sections[a++];t(i,c,o,l,f),i=c,o=l}}}function C0(e,t,n){for(var r=[],i=arguments.length>3&&arguments[3]!==void 0&&arguments[3]?[]:null,o=new Al(e),a=new Al(t),s=-1;;)if(o.ins==-1&&a.ins==-1){var u=Math.min(o.len,a.len);Xr(r,u,-1),o.forward(u),a.forward(u)}else if(a.ins>=0&&(o.ins<0||s==o.i||o.off==0&&(a.len=0&&s=0)){if(o.done&&a.done)return i?go.createSet(r,i):sc.create(r);throw new Error("Mismatched change set lengths")}for(var f=0,h=o.len;h;)if(a.ins==-1){var d=Math.min(h,a.len);f+=d,h-=d,a.forward(d)}else{if(!(a.ins==0&&a.len2&&arguments[2]!==void 0&&arguments[2]?[]:null,i=new Al(e),o=new Al(t),a=!1;;){if(i.done&&o.done)return r?go.createSet(n,r):sc.create(n);if(i.ins==0)Xr(n,i.len,0,a),i.next();else if(o.len!=0||o.done){if(i.done||o.done)throw new Error("Mismatched change set lengths");var s=Math.min(i.len2,o.len),u=n.length;if(i.ins==-1){var c=o.ins==-1?-1:o.off?0:o.ins;Xr(n,s,c,a),r&&c&&ns(r,n,o.text)}else o.ins==-1?(Xr(n,i.off?0:i.len,s,a),r&&ns(r,n,i.textBit(s))):(Xr(n,i.off?0:i.len,o.off?0:o.ins,a),r&&!o.off&&ns(r,n,o.text));a=(i.ins>s||o.ins>=0&&o.len>s)&&(a||n.length>u),i.forward2(s),o.forward(s)}else Xr(n,0,o.ins,a),r&&ns(r,n,o.text),o.next()}}var Al=function(){function e(t){X(this,e),this.set=t,this.i=0,this.next()}return tt(e,[{key:"next",value:function(){var t=this.set.sections;this.i>1;return n>=t.length?Tn.empty:t[n]}},{key:"textBit",value:function(t){var n=this.set.inserted,r=this.i-2>>1;return r>=n.length&&!t?Tn.empty:n[r].slice(this.off,t==null?void 0:this.off+t)}},{key:"forward",value:function(t){t==this.len?this.next():(this.len-=t,this.off+=t)}},{key:"forward2",value:function(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}]),e}(),rd=function(){function e(t,n,r){X(this,e),this.from=t,this.to=n,this.flags=r}return tt(e,[{key:"anchor",get:function(){return 16&this.flags?this.to:this.from}},{key:"head",get:function(){return 16&this.flags?this.from:this.to}},{key:"empty",get:function(){return this.from==this.to}},{key:"assoc",get:function(){return 4&this.flags?-1:8&this.flags?1:0}},{key:"bidiLevel",get:function(){var t=3&this.flags;return t==3?null:t}},{key:"goalColumn",get:function(){var t=this.flags>>5;return t==33554431?void 0:t}},{key:"map",value:function(t){var n,r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;return this.empty?n=r=t.mapPos(this.from,i):(n=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new e(n,r,this.flags)}},{key:"extend",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;if(t<=this.anchor&&n>=this.anchor)return Ht.range(t,n);var r=Math.abs(t-this.anchor)>Math.abs(n-this.anchor)?t:n;return Ht.range(this.anchor,r)}},{key:"eq",value:function(t){return this.anchor==t.anchor&&this.head==t.head}},{key:"toJSON",value:function(){return{anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Ht.range(t.anchor,t.head)}},{key:"create",value:function(t,n,r){return new e(t,n,r)}}]),e}(),Ht=function(){function e(t,n){X(this,e),this.ranges=t,this.mainIndex=n}return tt(e,[{key:"map",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1;return t.empty?this:e.create(this.ranges.map(function(r){return r.map(t,n)}),this.mainIndex)}},{key:"eq",value:function(t){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(var n=0;n1&&arguments[1]!==void 0)||arguments[1];return e.create([t].concat(this.ranges),n?0:this.mainIndex+1)}},{key:"replaceRange",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.mainIndex,r=this.ranges.slice();return r[n]=t,e.create(r,this.mainIndex)}},{key:"toJSON",value:function(){return{ranges:this.ranges.map(function(t){return t.toJSON()}),main:this.mainIndex}}}],[{key:"fromJSON",value:function(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new e(t.ranges.map(function(n){return rd.fromJSON(n)}),t.main)}},{key:"single",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t;return new e([e.range(t,n)],0)}},{key:"create",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(t.length==0)throw new RangeError("A selection needs at least one range");for(var r=0,i=0;i1&&arguments[1]!==void 0?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0;return rd.create(t,t,(n==0?0:n<0?4:8)|(r==null?3:Math.min(2,r))|(i!=null?i:33554431)<<5)}},{key:"range",value:function(t,n,r,i){var o=(r!=null?r:33554431)<<5|(i==null?3:Math.min(2,i));return nt?4:0)|o)}},{key:"normalized",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=t[n];t.sort(function(c,l){return c.from-l.from}),n=t.indexOf(r);for(var i=1;io.head?e.range(u,s):e.range(s,u))}}return new e(t,n)}}]),e}();function ZE(e,t){var n,r=at(e.ranges);try{for(r.s();!(n=r.n()).done;)if(n.value.to>t)throw new RangeError("Selection points outside of document")}catch(i){r.e(i)}finally{r.f()}}var $0=0,Se=function(){function e(t,n,r,i,o){X(this,e),this.combine=t,this.compareInput=n,this.compare=r,this.isStatic=i,this.id=$0++,this.default=t([]),this.extensions=typeof o=="function"?o(this):o}return tt(e,[{key:"of",value:function(t){return new id([],this,0,t)}},{key:"compute",value:function(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new id(t,this,1,n)}},{key:"computeN",value:function(t,n){if(this.isStatic)throw new Error("Can't compute a static facet");return new id(t,this,2,n)}},{key:"from",value:function(t,n){return n||(n=function(r){return r}),this.compute([t],function(r){return n(r.field(t))})}}],[{key:"define",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new e(t.combine||function(n){return n},t.compareInput||function(n,r){return n===r},t.compare||(t.combine?function(n,r){return n===r}:_0),!!t.static,t.enables)}}]),e}();function _0(e,t){return e==t||e.length==t.length&&e.every(function(n,r){return n===t[r]})}var id=function(){function e(t,n,r,i){X(this,e),this.dependencies=t,this.facet=n,this.type=r,this.value=i,this.id=$0++}return tt(e,[{key:"dynamicSlot",value:function(t){var n,r,i=this,o=this.value,a=this.facet.compareInput,s=this.id,u=t[s]>>1,c=this.type==2,l=!1,f=!1,h=[],d=at(this.dependencies);try{for(d.s();!(r=d.n()).done;){var v=r.value;v=="doc"?l=!0:v=="selection"?f=!0:!(1&((n=t[v.id])!==null&&n!==void 0?n:1))&&h.push(t[v.id])}}catch(p){d.e(p)}finally{d.f()}return{create:function(p){return p.values[u]=o(p),1},update:function(p,m){if(l&&m.docChanged||f&&(m.docChanged||m.selection)||O0(p,h)){var g=o(p);if(c?!XE(g,p.values[u],a):!a(g,p.values[u]))return p.values[u]=g,1}return 0},reconfigure:function(p,m){var g,y=m.config.address[s];if(y!=null){var b=od(m,y);if(i.dependencies.every(function(w){return w instanceof Se?m.facet(w)===p.facet(w):!(w instanceof Wr)||m.field(w,!1)==p.field(w,!1)})||(c?XE(g=o(p),b,a):a(g=o(p),b)))return p.values[u]=b,0}else g=o(p);return p.values[u]=g,1}}}}]),e}();function XE(e,t,n){if(e.length!=t.length)return!1;for(var r=0;r>1;return{create:function(i){return i.values[r]=n.create(i),1},update:function(i,o){var a=i.values[r],s=n.updateF(a,o);return n.compareF(a,s)?0:(i.values[r]=s,1)},reconfigure:function(i,o){return o.config.address[n.id]!=null?(i.values[r]=o.field(n),0):(i.values[r]=n.create(i),1)}}}},{key:"init",value:function(t){return[this,tA.of({field:this,create:t})]}},{key:"extension",get:function(){return this}}],[{key:"define",value:function(t){var n=new e($0++,t.create,t.update,t.compare||function(r,i){return r===i},t);return t.provide&&(n.provides=t.provide(n)),n}}]),e}(),JG=4,KG=3,M0=2,GG=1;function Pl(e){return function(t){return new eA(t,e)}}var uc={highest:Pl(0),high:Pl(GG),default:Pl(M0),low:Pl(KG),lowest:Pl(JG)},eA=tt(function e(t,n){X(this,e),this.inner=t,this.prec=n}),Us=function(){function e(){X(this,e)}return tt(e,[{key:"of",value:function(t){return new E0(this,t)}},{key:"reconfigure",value:function(t){return e.reconfigure.of({compartment:this,extension:t})}},{key:"get",value:function(t){return t.config.compartments.get(this)}}]),e}(),E0=tt(function e(t,n){X(this,e),this.compartment=t,this.inner=n}),nA=function(){function e(t,n,r,i,o,a){for(X(this,e),this.base=t,this.compartments=n,this.dynamicSlots=r,this.address=i,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length>1]}}],[{key:"resolve",value:function(t,n,r){var i,o=[],a=Object.create(null),s=new Map,u=at(function(w,j,x){var R=[[],[],[],[],[]],M=new Map;function E(N,A){var L=M.get(N);if(L!=null){if(L<=A)return;var W=R[L].indexOf(N);W>-1&&R[L].splice(W,1),N instanceof E0&&x.delete(N.compartment)}if(M.set(N,A),Array.isArray(N)){var O,I=at(N);try{for(I.s();!(O=I.n()).done;)E(O.value,A)}catch(_){I.e(_)}finally{I.f()}}else if(N instanceof E0){if(x.has(N.compartment))throw new RangeError("Duplicate use of compartment in extensions");var q=j.get(N.compartment)||N.inner;x.set(N.compartment,q),E(q,A)}else if(N instanceof eA)E(N.inner,N.prec);else if(N instanceof Wr)R[A].push(N),N.provides&&E(N.provides,A);else if(N instanceof id)R[A].push(N),N.facet.extensions&&E(N.facet.extensions,M0);else{var P=N.extension;if(!P)throw new Error("Unrecognized extension value in extension set (".concat(N,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));E(P,A)}}return E(w,M0),R.reduce(function(N,A){return N.concat(A)})}(t,n,s));try{for(u.s();!(i=u.n()).done;){var c=i.value;c instanceof Wr?o.push(c):(a[c.facet.id]||(a[c.facet.id]=[])).push(c)}}catch(w){u.e(w)}finally{u.f()}for(var l=Object.create(null),f=[],h=[],d=function(){var w=p[v];l[w.id]=h.length<<1,h.push(function(j){return w.slot(j)})},v=0,p=o;v>1;function S($){for(var D=[],B=0;B>1,r=e.status[n];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;var i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function od(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}var rA=Se.define(),iA=Se.define({combine:function(e){return e.some(function(t){return t})},static:!0}),oA=Se.define({combine:function(e){return e.length?e[0]:void 0},static:!0}),aA=Se.define(),sA=Se.define(),uA=Se.define(),cA=Se.define({combine:function(e){return!!e.length&&e[0]}}),rs=function(){function e(t,n){X(this,e),this.type=t,this.value=n}return tt(e,null,[{key:"define",value:function(){return new QG}}]),e}(),QG=function(){function e(){X(this,e)}return tt(e,[{key:"of",value:function(t){return new rs(this,t)}}]),e}(),YG=function(){function e(t){X(this,e),this.map=t}return tt(e,[{key:"of",value:function(t){return new cn(this,t)}}]),e}(),cn=function(){function e(t,n){X(this,e),this.type=t,this.value=n}return tt(e,[{key:"map",value:function(t){var n=this.type.map(this.value,t);return n===void 0?void 0:n==this.value?this:new e(this.type,n)}},{key:"is",value:function(t){return this.type==t}}],[{key:"define",value:function(){return new YG((arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).map||function(t){return t})}},{key:"mapEffects",value:function(t,n){if(!t.length)return t;var r,i=[],o=at(t);try{for(o.s();!(r=o.n()).done;){var a=r.value.map(n);a&&i.push(a)}}catch(s){o.e(s)}finally{o.f()}return i}}]),e}();cn.reconfigure=cn.define(),cn.appendConfig=cn.define();var mi=function(){function e(t,n,r,i,o,a){X(this,e),this.startState=t,this.changes=n,this.selection=r,this.effects=i,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,r&&ZE(r,n.newLength),o.some(function(s){return s.type==e.time})||(this.annotations=o.concat(e.time.of(Date.now())))}return tt(e,[{key:"newDoc",get:function(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}},{key:"newSelection",get:function(){return this.selection||this.startState.selection.map(this.changes)}},{key:"state",get:function(){return this._state||this.startState.applyTransaction(this),this._state}},{key:"annotation",value:function(t){var n,r=at(this.annotations);try{for(r.s();!(n=r.n()).done;){var i=n.value;if(i.type==t)return i.value}}catch(o){r.e(o)}finally{r.f()}}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"reconfigured",get:function(){return this.startState.config!=this.state.config}},{key:"isUserEvent",value:function(t){var n=this.annotation(e.userEvent);return!(!n||!(n==t||n.length>t.length&&n.slice(0,t.length)==t&&n[t.length]=="."))}}],[{key:"create",value:function(t,n,r,i,o,a){return new e(t,n,r,i,o,a)}}]),e}();function ZG(e,t){for(var n=[],r=0,i=0;;){var o=void 0,a=void 0;if(r=e[r]))o=e[r++],a=e[r++];else{if(!(i=0;f--){var h=c[f](s);h&&Object.keys(h).length&&(l=lA(l,A0(u,h,s.changes.newLength),!0))}return l==s?s:mi.create(u,s.changes,s.selection,l.effects,l.annotations,l.scrollIntoView)}(n?function(s){var u,c=s.startState,l=!0,f=at(c.facet(aA));try{for(f.s();!(u=f.n()).done;){var h=(0,u.value)(s);if(h===!1){l=!1;break}Array.isArray(h)&&(l=l===!0?h:ZG(l,h))}}catch(b){f.e(b)}finally{f.f()}if(l!==!0){var d,v;if(l===!1)v=s.changes.invertedDesc,d=go.empty(c.doc.length);else{var p=s.changes.filter(l);d=p.changes,v=p.filtered.mapDesc(p.changes).invertedDesc}s=mi.create(c,d,s.selection&&s.selection.map(v),cn.mapEffects(s.effects,v),s.annotations,s.scrollIntoView)}for(var m=c.facet(sA),g=m.length-1;g>=0;g--){var y=m[g](s);s=y instanceof mi?y:Array.isArray(y)&&y.length==1&&y[0]instanceof mi?y[0]:fA(c,cc(y),!1)}return s}(a):a)}mi.time=rs.define(),mi.userEvent=rs.define(),mi.addToHistory=rs.define(),mi.remote=rs.define();var XG=[];function cc(e){return e==null?XG:Array.isArray(e)?e:[e]}var P0,lr=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(lr||(lr={})),tQ=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{P0=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}function eQ(e){return function(t){if(!/\S/.test(t))return lr.Space;if(function(r){if(P0)return P0.test(r);for(var i=0;i"\x80"&&(o.toUpperCase()!=o.toLowerCase()||tQ.test(o)))return!0}return!1}(t))return lr.Word;for(var n=0;n-1)return lr.Word;return lr.Other}}var Hn=function(){function e(t,n,r,i,o,a){X(this,e),this.config=t,this.doc=n,this.selection=r,this.values=i,this.status=t.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(var s=0;s1&&arguments[1]!==void 0)||arguments[1],r=this.config.address[t.id];if(r!=null)return Tl(this,r),od(this,r);if(n)throw new RangeError("Field is not present in this state")}},{key:"update",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r0&&arguments[0]!==void 0?arguments[0]:[];return t instanceof go?t:go.of(t,this.doc.length,this.facet(e.lineSeparator))}},{key:"toText",value:function(t){return Tn.of(t.split(this.facet(e.lineSeparator)||j0))}},{key:"sliceDoc",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.doc.length;return this.doc.sliceString(t,n,this.lineBreak)}},{key:"facet",value:function(t){var n=this.config.address[t.id];return n==null?t.default:(Tl(this,n),od(this,n))}},{key:"toJSON",value:function(t){var n={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(var r in t){var i=t[r];i instanceof Wr&&this.config.address[i.id]!=null&&(n[r]=i.spec.toJSON(this.field(t[r]),this))}return n}},{key:"tabSize",get:function(){return this.facet(e.tabSize)}},{key:"lineBreak",get:function(){return this.facet(e.lineSeparator)||` +`}},{key:"readOnly",get:function(){return this.facet(cA)}},{key:"phrase",value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;ir.length?u:r[l-1]})),t}},{key:"languageDataAt",value:function(t,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1,o=[],a=at(this.facet(rA));try{for(a.s();!(r=a.n()).done;){var s,u=at((0,r.value)(this,n,i));try{for(u.s();!(s=u.n()).done;){var c=s.value;Object.prototype.hasOwnProperty.call(c,t)&&o.push(c[t])}}catch(l){u.e(l)}finally{u.f()}}}catch(l){a.e(l)}finally{a.f()}return o}},{key:"charCategorizer",value:function(t){return eQ(this.languageDataAt("wordChars",t).join(""))}},{key:"wordAt",value:function(t){for(var n=this.doc.lineAt(t),r=n.text,i=n.from,o=n.length,a=this.charCategorizer(t),s=t-i,u=t-i;s>0;){var c=si(r,s,!1);if(a(r.slice(c,s))!=lr.Word)break;s=c}for(;u1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");var i=[];if(r){var o=function(){if(Object.prototype.hasOwnProperty.call(t,a)){var s=r[a],u=t[a];i.push(s.init(function(c){return s.spec.fromJSON(u,c)}))}};for(var a in r)o()}return e.create({doc:t.doc,selection:Ht.fromJSON(t.selection),extensions:n.extensions?i.concat([n.extensions]):i})}},{key:"create",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=nA.resolve(t.extensions||[],new Map),r=t.doc instanceof Tn?t.doc:Tn.of((t.doc||"").split(n.staticFacet(e.lineSeparator)||j0)),i=t.selection?t.selection instanceof Ht?t.selection:Ht.single(t.selection.anchor,t.selection.head):Ht.single(0);return ZE(i,r.length),n.staticFacet(iA)||(i=i.asSingle()),new e(n,r,i,n.dynamicSlots.map(function(){return null}),function(o,a){return a.create(o)},null)}}]),e}();function Ui(e,t){var n,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i={},o=at(e);try{for(o.s();!(n=o.n()).done;)for(var a=n.value,s=0,u=Object.keys(a);s1&&arguments[1]!==void 0?arguments[1]:t;return T0.create(t,n,this)}}]),e}();Js.prototype.startSide=Js.prototype.endSide=0,Js.prototype.point=!1,Js.prototype.mapMode=ui.TrackDel;var T0=function(){function e(t,n,r){X(this,e),this.from=t,this.to=n,this.value=r}return tt(e,null,[{key:"create",value:function(t,n,r){return new e(t,n,r)}}]),e}();function R0(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var nQ=function(){function e(t,n,r,i){X(this,e),this.from=t,this.to=n,this.value=r,this.maxPoint=i}return tt(e,[{key:"length",get:function(){return this.to[this.to.length-1]}},{key:"findIndex",value:function(t,n,r){for(var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=r?this.to:this.from,a=i,s=o.length;;){if(a==s)return a;var u=a+s>>1,c=o[u]-t||(r?this.value[u].endSide:this.value[u].startSide)-n;if(u==a)return c>=0?a:s;c>=0?s=u:a=u+1}}},{key:"between",value:function(t,n,r,i){for(var o=this.findIndex(n,-1e9,!0),a=this.findIndex(r,1e9,!1,o);o(d=n.mapPos(f,c.endSide))||h==d&&c.startSide>0&&c.endSide<=0)continue;(d-h||c.endSide-c.startSide)<0||(a<0&&(a=h),c.point&&(s=Math.max(s,d-h)),r.push(c),i.push(h-a),o.push(d-a))}return{mapped:r.length?new e(i,o,r,s):null,pos:a}}}]),e}(),Qn=function(){function e(t,n,r,i){X(this,e),this.chunkPos=t,this.chunk=n,this.nextLayer=r,this.maxPoint=i}return tt(e,[{key:"length",get:function(){var t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}},{key:"size",get:function(){if(this.isEmpty)return 0;var t,n=this.nextLayer.size,r=at(this.chunk);try{for(r.s();!(t=r.n()).done;)n+=t.value.value.length}catch(i){r.e(i)}finally{r.f()}return n}},{key:"chunkEnd",value:function(t){return this.chunkPos[t]+this.chunk[t].length}},{key:"update",value:function(t){var n=t.add,r=n===void 0?[]:n,i=t.sort,o=i!==void 0&&i,a=t.filterFrom,s=a===void 0?0:a,u=t.filterTo,c=u===void 0?this.length:u,l=t.filter;if(r.length==0&&!l)return this;if(o&&(r=r.slice().sort(R0)),this.isEmpty)return r.length?e.of(r):this;for(var f=new dA(this,null,-1).goto(0),h=0,d=[],v=new Ks;f.value||h=0){var p=r[h++];v.addInner(p.from,p.to,p.value)||d.push(p)}else f.rangeIndex==1&&f.chunkIndexthis.chunkEnd(f.chunkIndex)||cf.to||c=o&&t<=o+a.length&&a.between(o,t-o,n-o,r)===!1)return}this.nextLayer.between(t,n,r)}}},{key:"iter",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return N0.from([this]).goto(t)}},{key:"isEmpty",get:function(){return this.nextLayer==this}}],[{key:"create",value:function(t,n,r,i){return new e(t,n,r,i)}},{key:"iter",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return N0.from(t).goto(n)}},{key:"compare",value:function(t,n,r,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1,a=t.filter(function(f){return f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o}),s=n.filter(function(f){return f.maxPoint>0||!f.isEmpty&&f.maxPoint>=o}),u=hA(a,s,r),c=new Rl(a,u,o),l=new Rl(s,u,o);r.iterGaps(function(f,h,d){return vA(c,f,l,h,d,i)}),r.empty&&r.length==0&&vA(c,0,l,0,0,i)}},{key:"eq",value:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3?arguments[3]:void 0;i==null&&(i=999999999);var o=t.filter(function(l){return!l.isEmpty&&n.indexOf(l)<0}),a=n.filter(function(l){return!l.isEmpty&&t.indexOf(l)<0});if(o.length!=a.length)return!1;if(!o.length)return!0;for(var s=hA(o,a),u=new Rl(o,s,0).goto(r),c=new Rl(a,s,0).goto(r);;){if(u.to!=c.to||!D0(u.active,c.active)||u.point&&(!c.point||!u.point.eq(c.point)))return!1;if(u.to>i)return!0;u.next(),c.next()}}},{key:"spans",value:function(t,n,r,i){for(var o=new Rl(t,null,arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1).goto(n),a=n,s=o.openStart;;){var u=Math.min(o.to,r);if(o.point){var c=o.activeForPoint(o.to),l=o.pointFroma&&(i.span(a,u,o.active,s),s=o.openEnd(u));if(o.to>r)return s+(o.point&&o.to>r?1:0);a=o.to,o.next()}}},{key:"of",value:function(t){var n,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1],i=new Ks,o=at(t instanceof T0?[t]:r?function(s){if(s.length>1)for(var u=s[0],c=1;c0)return s.slice().sort(R0);u=l}return s}(t):t);try{for(o.s();!(n=o.n()).done;){var a=n.value;i.add(a.from,a.to,a.value)}}catch(s){o.e(s)}finally{o.f()}return i.finish()}}]),e}();Qn.empty=new Qn([],[],null,-1),Qn.empty.nextLayer=Qn.empty;var Ks=function(){function e(){X(this,e),this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}return tt(e,[{key:"finishChunk",value:function(t){this.chunks.push(new nQ(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}},{key:"add",value:function(t,n,r){this.addInner(t,n,r)||(this.nextLayer||(this.nextLayer=new e)).add(t,n,r)}},{key:"addInner",value:function(t,n,r){var i=t-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(t-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(n-this.chunkStart),this.last=r,this.lastFrom=t,this.lastTo=n,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,n-t)),!0)}},{key:"addChunk",value:function(t,n){if((t-this.lastTo||n.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,n.maxPoint),this.chunks.push(n),this.chunkPos.push(t);var r=n.value.length-1;return this.last=n.value[r],this.lastFrom=n.from[r]+t,this.lastTo=n.to[r]+t,!0}},{key:"finish",value:function(){return this.finishInner(Qn.empty)}},{key:"finishInner",value:function(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;var n=Qn.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,n}}]),e}();function hA(e,t,n){var r,i=new Map,o=at(e);try{for(o.s();!(r=o.n()).done;)for(var a=r.value,s=0;s3&&arguments[3]!==void 0?arguments[3]:0;X(this,e),this.layer=t,this.skip=n,this.minPoint=r,this.rank=i}return tt(e,[{key:"startSide",get:function(){return this.value?this.value.startSide:0}},{key:"endSide",get:function(){return this.value?this.value.endSide:0}},{key:"goto",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1e9;return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,n,!1),this}},{key:"gotoInner",value:function(t,n,r){for(;this.chunkIndex=this.minPoint)break}}},{key:"setRangeIndex",value:function(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex1&&arguments[1]!==void 0?arguments[1]:-1e9,i=at(this.heap);try{for(i.s();!(n=i.n()).done;)n.value.goto(t,r)}catch(a){i.e(a)}finally{i.f()}for(var o=this.heap.length>>1;o>=0;o--)I0(this.heap,o);return this.next(),this}},{key:"forward",value:function(t,n){var r,i=at(this.heap);try{for(i.s();!(r=i.n()).done;)r.value.forward(t,n)}catch(a){i.e(a)}finally{i.f()}for(var o=this.heap.length>>1;o>=0;o--)I0(this.heap,o);(this.to-t||this.value.endSide-n)<0&&this.next()}},{key:"next",value:function(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{var t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),I0(this.heap,0)}}}],[{key:"from",value:function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:-1,i=[],o=0;o=r&&i.push(new dA(a,n,r,o));return i.length==1?i[0]:new e(i)}}]),e}();function I0(e,t){for(var n=e[t];;){var r=1+(t<<1);if(r>=e.length)break;var i=e[r];if(r+1=0&&(i=e[r+1],r++),n.compare(i)<0)break;e[r]=n,e[t]=i,t=r}}var Rl=function(){function e(t,n,r){X(this,e),this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=N0.from(t,n,r)}return tt(e,[{key:"goto",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1e9;return this.cursor.goto(t,n),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=n,this.openStart=-1,this.next(),this}},{key:"forward",value:function(t,n){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-n)<0;)this.removeActive(this.minActive);this.cursor.forward(t,n)}},{key:"removeActive",value:function(t){ad(this.active,t),ad(this.activeTo,t),ad(this.activeRank,t),this.minActive=pA(this.active,this.activeTo)}},{key:"addActive",value:function(t){for(var n=0,r=this.cursor,i=r.value,o=r.to,a=r.rank;n-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>t){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&ad(r,i)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}var o=this.cursor.value;if(o.point){if(!(n&&this.cursor.to==this.to&&this.cursor.from=0&&r[a]=0&&!(this.activeRank[r]t||this.activeTo[r]==t&&this.active[r].endSide>=this.point.endSide)&&n.push(this.active[r]);return n.reverse()}},{key:"openEnd",value:function(t){for(var n=0,r=this.activeTo.length-1;r>=0&&this.activeTo[r]>t;r--)n++;return n}}]),e}();function vA(e,t,n,r,i,o){e.goto(t),n.goto(r);for(var a=r+i,s=r,u=r-t;;){var c=e.to+u-n.to||e.endSide-n.endSide,l=c<0?e.to+u:n.to,f=Math.min(l,a);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&D0(e.activeForPoint(e.to),n.activeForPoint(n.to))||o.comparePoint(s,f,e.point,n.point):f>s&&!D0(e.active,n.active)&&o.compareRange(s,f,e.active,n.active),l>a)break;s=l,c<=0&&e.next(),c>=0&&n.next()}}function D0(e,t){if(e.length!=t.length)return!1;for(var n=0;n=t;r--)e[r+1]=e[r];e[t]=n}function pA(e,t){for(var n=-1,r=1e9,i=0;i2&&arguments[2]!==void 0?arguments[2]:e.length,r=0,i=0;i=t)return i;if(i==e.length)break;o+=e.charCodeAt(i)==9?n-o%n:1,i=si(e,i)}return r===!0?-1:e.length}for(var mA=typeof Symbol=="undefined"?"__\u037C":Symbol.for("\u037C"),B0=typeof Symbol=="undefined"?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),gA=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:{},is=function(){function e(t,n){X(this,e),this.rules=[];var r=(n||{}).finish;function i(s){return/^@/.test(s)?[s]:s.split(/,\s*/)}function o(s,u,c,l){var f=[],h=/^@(\w+)\b/.exec(s[0]),d=h&&h[1]=="keyframes";if(h&&u==null)return c.push(s[0]+";");for(var v in u){var p=u[v];if(/&/.test(v))o(v.split(/,\s*/).map(function(m){return s.map(function(g){return m.replace(/&/,g)})}).reduce(function(m,g){return m.concat(g)}),p,c);else if(p&&ee(p)=="object"){if(!h)throw new RangeError("The value of a property ("+v+") should be a primitive value.");o(i(v),p,f,d)}else p!=null&&f.push(v.replace(/_.*/,"").replace(/[A-Z]/g,function(m){return"-"+m.toLowerCase()})+": "+p+";")}(f.length||d)&&c.push((!r||h||l?s:s.map(r)).join(", ")+" {"+f.join(" ")+"}")}for(var a in t)o(i(a),t[a],this.rules)}return tt(e,[{key:"getRules",value:function(){return this.rules.join(` +`)}}],[{key:"newName",value:function(){var t=gA[mA]||1;return gA[mA]=t+1,"\u037C"+t.toString(36)}},{key:"mount",value:function(t,n){(t[B0]||new rQ(t)).mount(Array.isArray(n)?n:[n])}}]),e}(),ud=null,rQ=function(){function e(t){if(X(this,e),!t.head&&t.adoptedStyleSheets&&typeof CSSStyleSheet!="undefined"){if(ud)return t.adoptedStyleSheets=[ud.sheet].concat(t.adoptedStyleSheets),t[B0]=ud;this.sheet=new CSSStyleSheet,t.adoptedStyleSheets=[this.sheet].concat(t.adoptedStyleSheets),ud=this}else{this.styleTag=(t.ownerDocument||t).createElement("style");var n=t.head||t;n.insertBefore(this.styleTag,n.firstChild)}this.modules=[],t[B0]=this}return tt(e,[{key:"mount",value:function(t){for(var n=this.sheet,r=0,i=0,o=0;o-1&&(this.modules.splice(s,1),i--,s=-1),s==-1){if(this.modules.splice(i++,0,a),n)for(var u=0;u",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},yA=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent),iQ=typeof navigator!="undefined"&&/Mac/.test(navigator.platform),oQ=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),aQ=iQ||yA&&+yA[1]<57,qr=0;qr<10;qr++)os[48+qr]=os[96+qr]=String(qr);for(qr=1;qr<=24;qr++)os[qr+111]="F"+qr;for(qr=65;qr<=90;qr++)os[qr]=String.fromCharCode(qr+32),Il[qr]=String.fromCharCode(qr);for(var z0 in os)Il.hasOwnProperty(z0)||(Il[z0]=os[z0]);function cd(e){return(e.nodeType==11?e.getSelection?e:e.ownerDocument:e).getSelection()}function lc(e,t){return!!t&&(e==t||e.contains(t.nodeType!=1?t.parentNode:t))}function ld(e,t){if(!t.anchorNode)return!1;try{return lc(e,t.anchorNode)}catch(n){return!1}}function Dl(e){return e.nodeType==3?hc(e,0,e.nodeValue.length).getClientRects():e.nodeType==1?e.getClientRects():[]}function fd(e,t,n,r){return!!n&&(bA(e,t,n,r,-1)||bA(e,t,n,r,1))}function hd(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function bA(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:as(e))){if(e.nodeName=="DIV")return!1;var o=e.parentNode;if(!o||o.nodeType!=1)return!1;t=hd(e)+(i<0?0:1),e=o}else{if(e.nodeType!=1||(e=e.childNodes[t+(i<0?-1:0)]).nodeType==1&&e.contentEditable=="false")return!1;t=i<0?as(e):0}}}function as(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function F0(e,t){var n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function sQ(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}var wA,uQ=function(){function e(){X(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return tt(e,[{key:"eq",value:function(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}},{key:"setRange",value:function(t){var n=t.anchorNode,r=t.focusNode;this.set(n,Math.min(t.anchorOffset,n?as(n):0),r,Math.min(t.focusOffset,r?as(r):0))}},{key:"set",value:function(t,n,r,i){this.anchorNode=t,this.anchorOffset=n,this.focusNode=r,this.focusOffset=i}}]),e}(),fc=null;function xA(e){if(e.setActive)return e.setActive();if(fc)return e.focus(fc);for(var t=[],n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(fc==null?{get preventScroll(){return fc={preventScroll:!0},!0}}:void 0),!fc){fc=!1;for(var r=0;r2&&arguments[2]!==void 0?arguments[2]:t,r=wA||(wA=document.createRange());return r.setEnd(e,n),r.setStart(e,t),r}function dc(e,t,n){var r={key:t,code:t,keyCode:n,which:n,cancelable:!0},i=new KeyboardEvent("keydown",r);i.synthetic=!0,e.dispatchEvent(i);var o=new KeyboardEvent("keyup",r);return o.synthetic=!0,e.dispatchEvent(o),i.defaultPrevented||o.defaultPrevented}function kA(e){for(;e.attributes.length;)e.removeAttributeNode(e.attributes[0])}var gi=function(){function e(t,n){var r=!(arguments.length>2&&arguments[2]!==void 0)||arguments[2];X(this,e),this.node=t,this.offset=n,this.precise=r}return tt(e,null,[{key:"before",value:function(t,n){return new e(t.parentNode,hd(t),n)}},{key:"after",value:function(t,n){return new e(t.parentNode,hd(t)+1,n)}}]),e}(),V0=[],fr=function(){function e(){X(this,e),this.parent=null,this.dom=null,this.dirty=2}return tt(e,[{key:"overrideDOMText",get:function(){return null}},{key:"posAtStart",get:function(){return this.parent?this.parent.posBefore(this):0}},{key:"posAtEnd",get:function(){return this.posAtStart+this.length}},{key:"posBefore",value:function(t){var n,r=this.posAtStart,i=at(this.children);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o==t)return r;r+=o.length+o.breakAfter}}catch(a){i.e(a)}finally{i.f()}throw new RangeError("Invalid child in posBefore")}},{key:"posAfter",value:function(t){return this.posBefore(t)+t.length}},{key:"sync",value:function(t,n){if(2&this.dirty){var r,i,o=this.dom,a=null,s=at(this.children);try{for(s.s();!(i=s.n()).done;){var u=i.value;if(u.dirty){if(!u.dom&&(r=a?a.nextSibling:o.firstChild)){var c=e.get(r);(!c||!c.parent&&c.canReuseDOM(u))&&u.reuseDOM(r)}u.sync(t,n),u.dirty=0}if(r=a?a.nextSibling:o.firstChild,n&&!n.written&&n.node==o&&r!=u.dom&&(n.written=!0),u.dom.parentNode==o)for(;r&&r!=u.dom;)r=jA(r);else o.insertBefore(u.dom,r);a=u.dom}}catch(d){s.e(d)}finally{s.f()}for((r=a?a.nextSibling:o.firstChild)&&n&&n.node==o&&(n.written=!0);r;)r=jA(r)}else if(1&this.dirty){var l,f=at(this.children);try{for(f.s();!(l=f.n()).done;){var h=l.value;h.dirty&&(h.sync(t,n),h.dirty=0)}}catch(d){f.e(d)}finally{f.f()}}}},{key:"reuseDOM",value:function(t){}},{key:"localPosFromDOM",value:function(t,n){var r;if(t==this.dom)r=this.dom.childNodes[n];else{for(var i=as(t)==0?0:n==0?-1:1;;){var o=t.parentNode;if(o==this.dom)break;i==0&&o.firstChild!=o.lastChild&&(i=t==o.firstChild?-1:1),t=o}r=i<0?t:t.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!e.get(r);)r=r.nextSibling;if(!r)return this.length;for(var a=0,s=0;;a++){var u=this.children[a];if(u.dom==r)return s;s+=u.length+u.breakAfter}}},{key:"domBoundsAround",value:function(t,n){for(var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=-1,o=-1,a=-1,s=-1,u=0,c=r,l=r;un)return f.domBoundsAround(t,n,c);if(h>=t&&i==-1&&(i=u,o=c),c>n&&f.dom.parentNode==this.dom){a=u,s=l;break}l=h,c=h+f.breakAfter}return{from:o,to:s<0?r+this.length:s,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:a=0?this.children[a].dom:null}}},{key:"markDirty",value:function(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this.dirty|=2,this.markParentsDirty(t)}},{key:"markParentsDirty",value:function(t){for(var n=this.parent;n;n=n.parent){if(t&&(n.dirty|=2),1&n.dirty)return;n.dirty|=1,t=!1}}},{key:"setParent",value:function(t){this.parent!=t&&(this.parent=t,this.dirty&&this.markParentsDirty(!0))}},{key:"setDOM",value:function(t){this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this}},{key:"rootView",get:function(){for(var t=this;;){var n=t.parent;if(!n)return t;t=n}}},{key:"replaceChildren",value:function(t,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:V0;this.markDirty();for(var o=t;o0&&arguments[0]!==void 0?arguments[0]:this.length;return new SA(this.children,t,this.children.length)}},{key:"childPos",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return this.childCursor().findPos(t,n)}},{key:"toString",value:function(){var t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+(t=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}},{key:"isEditable",get:function(){return!0}},{key:"isWidget",get:function(){return!1}},{key:"isHidden",get:function(){return!1}},{key:"merge",value:function(t,n,r,i,o,a){return!1}},{key:"become",value:function(t){return!1}},{key:"canReuseDOM",value:function(t){return t.constructor==this.constructor}},{key:"getSide",value:function(){return 0}},{key:"destroy",value:function(){this.parent=null}}],[{key:"get",value:function(t){return t.cmView}}]),e}();function jA(e){var t=e.nextSibling;return e.parentNode.removeChild(e),t}fr.prototype.breakAfter=0;var SA=function(){function e(t,n,r){X(this,e),this.children=t,this.pos=n,this.i=r,this.off=0}return tt(e,[{key:"findPos",value:function(t){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;;){if(t>this.pos||t==this.pos&&(n>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;var r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}]),e}();function CA(e,t,n,r,i,o,a,s,u){var c=e.children,l=c.length?c[t]:null,f=o.length?o[o.length-1]:null,h=f?f.breakAfter:a;if(!(t==r&&l&&!a&&!h&&o.length<2&&l.merge(n,i,o.length?f:null,n==0,s,u))){if(r0&&(!a&&o.length&&l.merge(n,l.length,o[0],!1,s,0)?l.breakAfter=o.shift().breakAfter:(n2),Ce={mac:AA||/Mac/.test(Oi.platform),windows:/Win/.test(Oi.platform),linux:/Linux|X11/.test(Oi.platform),ie:dd,ie_version:_A?W0.documentMode||6:H0?+H0[1]:q0?+q0[1]:0,gecko:OA,gecko_version:OA?+(/Firefox\/(\d+)/.exec(Oi.userAgent)||[0,0])[1]:0,chrome:!!U0,chrome_version:U0?+U0[1]:0,ios:AA,android:/Android\b/.test(Oi.userAgent),webkit:MA,safari:EA,webkit_version:MA?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:W0.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"},vd=function(e){Ot(n,fr);var t=Mt(n);function n(r){var i;return X(this,n),(i=t.call(this)).text=r,i}return tt(n,[{key:"length",get:function(){return this.text.length}},{key:"createDOM",value:function(r){this.setDOM(r||document.createTextNode(this.text))}},{key:"sync",value:function(r,i){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(i&&i.node==this.dom&&(i.written=!0),this.dom.nodeValue=this.text)}},{key:"reuseDOM",value:function(r){r.nodeType==3&&this.createDOM(r)}},{key:"merge",value:function(r,i,o){return(!o||o instanceof n&&!(this.length-(i-r)+o.length>256))&&(this.text=this.text.slice(0,r)+(o?o.text:"")+this.text.slice(i),this.markDirty(),!0)}},{key:"split",value:function(r){var i=new n(this.text.slice(r));return this.text=this.text.slice(0,r),this.markDirty(),i}},{key:"localPosFromDOM",value:function(r,i){return r==this.dom?i:i?this.text.length:0}},{key:"domAtPos",value:function(r){return new gi(this.dom,r)}},{key:"domBoundsAround",value:function(r,i,o){return{from:o,to:o+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}},{key:"coordsAt",value:function(r,i){return J0(this.dom,r,i)}}]),n}(),vc=function(e){Ot(n,fr);var t=Mt(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;X(this,n),(i=t.call(this)).mark=r,i.children=o,i.length=a;var s,u=at(o);try{for(u.s();!(s=u.n()).done;)s.value.setParent(ce(i))}catch(c){u.e(c)}finally{u.f()}return i}return tt(n,[{key:"setAttrs",value:function(r){if(kA(r),this.mark.class&&(r.className=this.mark.class),this.mark.attrs)for(var i in this.mark.attrs)r.setAttribute(i,this.mark.attrs[i]);return r}},{key:"reuseDOM",value:function(r){r.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(r),this.dirty|=6)}},{key:"sync",value:function(r,i){this.dom?4&this.dirty&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),fn(Ke(n.prototype),"sync",this).call(this,r,i)}},{key:"merge",value:function(r,i,o,a,s,u){return(!o||!(!(o instanceof n&&o.mark.eq(this.mark))||r&&s<=0||ir&&o.push(a=r&&(s=u),a=f,u++}}catch(d){c.e(d)}finally{c.f()}var h=this.length-r;return this.length=r,s>-1&&(this.children.length=s,this.markDirty()),new n(this.mark,o,h)}},{key:"domAtPos",value:function(r){return IA(this,r)}},{key:"coordsAt",value:function(r,i){return LA(this,r,i)}}]),n}();function J0(e,t,n){var r=e.nodeValue.length;t>r&&(t=r);var i=t,o=t,a=0;t==0&&n<0||t==r&&n>=0?Ce.chrome||Ce.gecko||(t?(i--,a=1):o=0)?0:s.length-1];return Ce.safari&&!a&&u.width==0&&(u=Array.prototype.find.call(s,function(c){return c.width})||u),a?F0(u,a<0):u||null}var K0=function(e){Ot(n,fr);var t=Mt(n);function n(r,i,o){var a;return X(this,n),(a=t.call(this)).widget=r,a.length=i,a.side=o,a.prevWidget=null,a}return tt(n,[{key:"split",value:function(r){var i=n.create(this.widget,this.length-r,this.side);return this.length-=r,i}},{key:"sync",value:function(r){this.dom&&this.widget.updateDOM(this.dom,r)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(r)),this.dom.contentEditable="false")}},{key:"getSide",value:function(){return this.side}},{key:"merge",value:function(r,i,o,a,s,u){return!(o&&(!(o instanceof n&&this.widget.compare(o.widget))||r>0&&s<=0||i0)?gi.before(this.dom):gi.after(this.dom,r==this.length)}},{key:"domBoundsAround",value:function(){return null}},{key:"coordsAt",value:function(r,i){var o=this.widget.coordsAt(this.dom,r,i);if(o)return o;var a=this.dom.getClientRects(),s=null;if(!a.length)return null;for(var u=this.side?this.side<0:r>0,c=u?a.length-1:0;s=a[c],!(r>0?c==0:c==a.length-1||s.top0?gi.before(this.dom):gi.after(this.dom)}},{key:"localPosFromDOM",value:function(){return 0}},{key:"domBoundsAround",value:function(){return null}},{key:"coordsAt",value:function(r){return this.dom.getBoundingClientRect()}},{key:"overrideDOMText",get:function(){return Tn.empty}},{key:"isHidden",get:function(){return!0}}]),n}();function IA(e,t){for(var n=e.dom,r=e.children,i=0,o=0;io&&t0;u--){var c=r[u-1];if(c.dom.parentNode==n)return c.domAtPos(c.length)}for(var l=i;l0&&t instanceof vc&&i.length&&(r=i[i.length-1])instanceof vc&&r.mark.eq(t.mark)?DA(r,t.children[0],n-1):(i.push(t),t.setParent(e)),e.length+=t.length}function LA(e,t,n){var r=null,i=-1,o=null,a=-1;(function u(c,l){for(var f=0,h=0;f=l&&(d.children.length?u(d,l-h):(!o||o.isHidden&&n>0)&&(v>l||h==v&&d.getSide()>0)?(o=d,a=l-h):(h-1}}],[{key:"mark",value:function(r){return new BA(r)}},{key:"widget",value:function(r){var i=Math.max(-1e4,Math.min(1e4,r.side||0)),o=!!r.block;return new pc(r,i+=o?i>0?3e8:-4e8:i>0?1e8:-1e8,i,o,r.widget||null,!1)}},{key:"replace",value:function(r){var i,o,a=!!r.block;if(r.isBlockGap)i=-5e8,o=4e8;else{var s=zA(r,a);i=(s.start?a?-3e8:-1:5e8)-1,o=1+(s.end?a?2e8:1:-6e8)}return new pc(r,i,o,a,r.widget||null,!0)}},{key:"line",value:function(r){return new t1(r)}},{key:"set",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return Qn.of(r,i)}}]),n}();Te.none=Qn.empty;var BA=function(e){Ot(n,Te);var t=Mt(n);function n(r){var i;X(this,n);var o=zA(r),a=o.start,s=o.end;return(i=t.call(this,a?-1:5e8,s?1:-6e8,null,r)).tagName=r.tagName||"span",i.class=r.class||"",i.attrs=r.attributes||null,i}return tt(n,[{key:"eq",value:function(r){return this==r||r instanceof n&&this.tagName==r.tagName&&this.class==r.class&&Z0(this.attrs,r.attrs)}},{key:"range",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r;if(r>=i)throw new RangeError("Mark decorations may not be empty");return fn(Ke(n.prototype),"range",this).call(this,r,i)}}]),n}();BA.prototype.point=!1;var t1=function(e){Ot(n,Te);var t=Mt(n);function n(r){return X(this,n),t.call(this,-2e8,-2e8,null,r)}return tt(n,[{key:"eq",value:function(r){return r instanceof n&&this.spec.class==r.spec.class&&Z0(this.spec.attributes,r.spec.attributes)}},{key:"range",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r;if(i!=r)throw new RangeError("Line decoration ranges must be zero-length");return fn(Ke(n.prototype),"range",this).call(this,r,i)}}]),n}();t1.prototype.mapMode=ui.TrackBefore,t1.prototype.point=!0;var pc=function(e){Ot(n,Te);var t=Mt(n);function n(r,i,o,a,s,u){var c;return X(this,n),(c=t.call(this,i,o,s,r)).block=a,c.isReplace=u,c.mapMode=a?i<=0?ui.TrackBefore:ui.TrackAfter:ui.TrackDel,c}return tt(n,[{key:"type",get:function(){return this.startSide=5||this.widget.lineBreaks>0)}},{key:"eq",value:function(r){return r instanceof n&&function(i,o){return i==o||!!(i&&o&&i.compare(o))}(this.widget,r.widget)&&this.block==r.block&&this.startSide==r.startSide&&this.endSide==r.endSide}},{key:"range",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r;if(this.isReplace&&(r>i||r==i&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&i!=r)throw new RangeError("Widget decorations can only have zero-length ranges");return fn(Ke(n.prototype),"range",this).call(this,r,i)}}]),n}();function zA(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1],n=e.inclusiveStart,r=e.inclusiveEnd;return n==null&&(n=e.inclusive),r==null&&(r=e.inclusive),{start:n!=null?n:t,end:r!=null?r:t}}function e1(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=n.length-1;i>=0&&n[i]+r>=e?n[i]=Math.max(n[i],t):n.push(e,t)}pc.prototype.point=!0;var Xo=function(e){Ot(n,fr);var t=Mt(n);function n(){var r;return X(this,n),(r=t.apply(this,arguments)).children=[],r.length=0,r.prevAttrs=void 0,r.attrs=null,r.breakAfter=0,r}return tt(n,[{key:"merge",value:function(r,i,o,a,s,u){if(o){if(!(o instanceof n))return!1;this.dom||o.transferDOM(this)}return a&&this.setDeco(o?o.attrs:null),$A(this,r,i,o?o.children:[],s,u),!0}},{key:"split",value:function(r){var i=new n;if(i.breakAfter=this.breakAfter,this.length==0)return i;var o=this.childPos(r),a=o.i,s=o.off;s&&(i.append(this.children[a].split(s),0),this.children[a].merge(s,this.children[a].length,null,!1,0,0),a++);for(var u=a;u0&&this.children[a-1].length==0;)this.children[--a].destroy();return this.children.length=a,this.markDirty(),this.length=r,i}},{key:"transferDOM",value:function(r){this.dom&&(this.markDirty(),r.setDOM(this.dom),r.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}},{key:"setDeco",value:function(r){Z0(this.attrs,r)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=r)}},{key:"append",value:function(r,i){DA(this,r,i)}},{key:"addLineDeco",value:function(r){var i=r.spec.attributes,o=r.spec.class;i&&(this.attrs=Y0(i,this.attrs||{})),o&&(this.attrs=Y0({class:o},this.attrs||{}))}},{key:"domAtPos",value:function(r){return IA(this,r)}},{key:"reuseDOM",value:function(r){r.nodeName=="DIV"&&(this.setDOM(r),this.dirty|=6)}},{key:"sync",value:function(r,i){var o;this.dom?4&this.dirty&&(kA(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(X0(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),fn(Ke(n.prototype),"sync",this).call(this,r,i);for(var a=this.dom.lastChild;a&&fr.get(a)instanceof vc;)a=a.lastChild;if(!(a&&this.length&&(a.nodeName=="BR"||((o=fr.get(a))===null||o===void 0?void 0:o.isEditable)!=0||Ce.ios&&this.children.some(function(u){return u instanceof vd})))){var s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}},{key:"measureTextSize",value:function(){if(this.children.length==0||this.length>20)return null;var r,i,o=0,a=at(this.children);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(!(s instanceof vd)||/[^ -~]/.test(s.text))return null;var u=Dl(s.dom);if(u.length!=1)return null;o+=u[0].width,r=u[0].height}}catch(c){a.e(c)}finally{a.f()}return o?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:o/this.length,textHeight:r}:null}},{key:"coordsAt",value:function(r,i){var o=LA(this,r,i);if(!this.children.length&&o&&this.parent){var a=this.parent.view.viewState.heightOracle,s=o.bottom-o.top;if(Math.abs(s-a.lineHeight)<2&&a.textHeight=i){if(s instanceof n)return s;if(u>i)break}a=u+s.breakAfter}return null}}]),n}(),n1=function(e){Ot(n,fr);var t=Mt(n);function n(r,i,o){var a;return X(this,n),(a=t.call(this)).widget=r,a.length=i,a.type=o,a.breakAfter=0,a.prevWidget=null,a}return tt(n,[{key:"merge",value:function(r,i,o,a,s,u){return!(o&&(!(o instanceof n&&this.widget.compare(o.widget))||r>0&&s<=0||i0&&arguments[0]!==void 0?arguments[0]:this.bufferMarks;this.pendingBuffer&&(this.curLine.append(pd(new Q0(-1),t),t.length),this.pendingBuffer=0)}},{key:"addBlockWidget",value:function(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}},{key:"finish",value:function(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,this.posCovered()||this.getLine()}},{key:"buildText",value:function(t,n,r){for(;t>0;){if(this.textOff==this.text.length){var i=this.cursor.next(this.skip),o=i.value,a=i.lineBreak,s=i.done;if(this.skip=0,s)throw new Error("Ran out of text content when drawing inline views");if(a){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,t--;continue}this.text=o,this.textOff=0}var u=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(n.slice(n.length-r)),this.getLine().append(pd(new vd(this.text.slice(this.textOff,this.textOff+u)),n),r),this.atCursorPos=!0,this.textOff+=u,t-=u,r=0}}},{key:"span",value:function(t,n,r,i){this.buildText(n-t,r,i),this.pos=n,this.openStart<0&&(this.openStart=i)}},{key:"point",value:function(t,n,r,i,o,a){if(this.disallowBlockEffectsFor[a]&&r instanceof pc){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(n>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}var s=n-t;if(r instanceof pc)if(r.block){var u=r.type;u!=hr.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new n1(r.widget||new FA("div"),s,u))}else{var c=K0.create(r.widget||new FA("span"),s,s?0:r.startSide),l=this.atCursorPos&&!c.isEditable&&o<=i.length&&(t0),f=!c.isEditable&&(ti.length||r.startSide<=0),h=this.getLine();this.pendingBuffer!=2||l||c.isEditable||(this.pendingBuffer=0),this.flushBuffer(i),l&&(h.append(pd(new Q0(1),i),o),o=i.length+Math.max(0,o-i.length)),h.append(pd(c,i),o),this.atCursorPos=f,this.pendingBuffer=f?ti.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);s&&(this.textOff+s<=this.text.length?this.textOff+=s:(this.skip+=s-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=n),this.openStart<0&&(this.openStart=o)}}],[{key:"build",value:function(t,n,r,i,o){var a=new e(t,n,r,o);return a.openEnd=Qn.spans(i,n,r,a),a.openStart<0&&(a.openStart=a.openEnd),a.finish(a.openEnd),a}}]),e}();function pd(e,t){var n,r=at(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;e=new vc(i,[e],e.length)}}catch(o){r.e(o)}finally{r.f()}return e}var FA=function(e){Ot(n,ss);var t=Mt(n);function n(r){var i;return X(this,n),(i=t.call(this)).tag=r,i}return tt(n,[{key:"eq",value:function(r){return r.tag==this.tag}},{key:"toDOM",value:function(){return document.createElement(this.tag)}},{key:"updateDOM",value:function(r){return r.nodeName.toLowerCase()==this.tag}},{key:"isHidden",get:function(){return!0}}]),n}(),VA=Se.define(),WA=Se.define(),qA=Se.define(),HA=Se.define(),r1=Se.define(),UA=Se.define(),JA=Se.define(),KA=Se.define({combine:function(e){return e.some(function(t){return t})}}),GA=Se.define({combine:function(e){return e.some(function(t){return t})}}),QA=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"nearest",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"nearest",i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:5,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:5;X(this,e),this.range=t,this.y=n,this.x=r,this.yMargin=i,this.xMargin=o}return tt(e,[{key:"map",value:function(t){return t.empty?this:new e(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin)}}]),e}(),YA=cn.define({map:function(e,t){return e.map(t)}});function Mi(e,t,n){var r=e.facet(HA);r.length?r[0](t):window.onerror?window.onerror(String(t),n,void 0,void 0,t):n?console.error(n+":",t):console.error(t)}var md=Se.define({combine:function(e){return!e.length||e[0]}}),lQ=0,Ll=Se.define(),zr=function(){function e(t,n,r,i){X(this,e),this.id=t,this.create=n,this.domEventHandlers=r,this.extension=i(this)}return tt(e,null,[{key:"define",value:function(t,n){var r=n||{},i=r.eventHandlers,o=r.provide,a=r.decorations;return new e(lQ++,t,i,function(s){var u=[Ll.of(s)];return a&&u.push(Bl.of(function(c){var l=c.plugin(s);return l?a(l):Te.none})),o&&u.push(o(s)),u})}},{key:"fromClass",value:function(t,n){return e.define(function(r){return new t(r)},n)}}]),e}(),i1=function(){function e(t){X(this,e),this.spec=t,this.mustUpdate=null,this.value=null}return tt(e,[{key:"update",value:function(t){if(this.value){if(this.mustUpdate){var n=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(n)}catch(r){if(Mi(n.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(i){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(r){Mi(t.state,r,"CodeMirror plugin crashed"),this.deactivate()}return this}},{key:"destroy",value:function(t){var n;if(!((n=this.value)===null||n===void 0)&&n.destroy)try{this.value.destroy()}catch(r){Mi(t.state,r,"CodeMirror plugin crashed")}}},{key:"deactivate",value:function(){this.spec=this.value=null}}]),e}(),ZA=Se.define(),o1=Se.define(),Bl=Se.define(),a1=Se.define(),XA=Se.define();function t7(e){var t,n=0,r=0,i=0,o=0,a=at(e.state.facet(XA));try{for(a.s();!(t=a.n()).done;){var s=(0,t.value)(e);s&&(s.left!=null&&(n=Math.max(n,s.left)),s.right!=null&&(r=Math.max(r,s.right)),s.top!=null&&(i=Math.max(i,s.top)),s.bottom!=null&&(o=Math.max(o,s.bottom)))}}catch(u){a.e(u)}finally{a.f()}return{left:n,right:r,top:i,bottom:o}}var zl=Se.define(),mc=function(){function e(t,n,r,i){X(this,e),this.fromA=t,this.toA=n,this.fromB=r,this.toB=i}return tt(e,[{key:"join",value:function(t){return new e(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}},{key:"addToSet",value:function(t){for(var n=t.length,r=this;n>0;n--){var i=t[n-1];if(!(i.fromA>r.toA)){if(i.toAl)break;o+=2}if(!u)return r;new e(u.fromA,u.toA,u.fromB,u.toB).addToSet(r),a=u.toA,s=u.toB}}}]),e}(),e7=function(){function e(t,n,r){X(this,e),this.view=t,this.state=n,this.transactions=r,this.flags=0,this.startState=t.state,this.changes=go.empty(this.startState.doc.length);var i,o=at(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;this.changes=this.changes.compose(a.changes)}}catch(u){o.e(u)}finally{o.f()}var s=[];this.changes.iterChangedRanges(function(u,c,l,f){return s.push(new mc(u,c,l,f))}),this.changedRanges=s}return tt(e,[{key:"viewportChanged",get:function(){return(4&this.flags)>0}},{key:"heightChanged",get:function(){return(2&this.flags)>0}},{key:"geometryChanged",get:function(){return this.docChanged||(10&this.flags)>0}},{key:"focusChanged",get:function(){return(1&this.flags)>0}},{key:"docChanged",get:function(){return!this.changes.empty}},{key:"selectionSet",get:function(){return this.transactions.some(function(t){return t.selection})}},{key:"empty",get:function(){return this.flags==0&&this.transactions.length==0}}],[{key:"create",value:function(t,n,r){return new e(t,n,r)}}]),e}(),dr=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(dr||(dr={})),s1=dr.LTR,fQ=dr.RTL;function n7(e){for(var t=[],n=0;n=n){if(s.level==r)return a;(o<0||(i!=0?i<0?s.fromn:t[o].level>s.level))&&(o=a)}}if(o<0)throw new RangeError("Index out of range");return o}}]),e}(),vr=[];function s7(e){return[new gc(0,e,0)]}var u7="";function mQ(e,t,n,r,i){var o,a=r.head-e.from,s=-1;if(a==0){if(!i||!e.length)return null;t[0].level!=n&&(a=t[0].side(!1,n),s=0)}else if(a==e.length){if(i)return null;var u=t[t.length-1];u.level!=n&&(a=u.side(!0,n),s=t.length-1)}s<0&&(s=gc.find(t,a,(o=r.bidiLevel)!==null&&o!==void 0?o:-1,r.assoc));var c=t[s];a==c.side(i,n)&&(a=(c=t[s+=i?1:-1]).side(!i,n));var l=i==(c.dir==n),f=si(e.text,a,l);if(u7=e.text.slice(Math.min(a,f),Math.max(a,f)),f!=c.side(i,n))return Ht.cursor(f+e.from,l?-1:1,c.level);var h=s==(i?t.length-1:0)?null:t[s+(i?1:-1)];return h||c.level==n?h&&h.levelo)&&this.lineBreak(),i=a}return this.findPointBefore(r,n),this}},{key:"readTextNode",value:function(t){var n,r=t.nodeValue,i=at(this.points);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.node==t&&(o.pos=this.text.length+Math.min(o.offset,r.length))}}catch(v){i.e(v)}finally{i.f()}for(var a=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){var u=-1,c=1,l=void 0;if(this.lineSeparator?(u=r.indexOf(this.lineSeparator,a),c=this.lineSeparator.length):(l=s.exec(r))&&(u=l.index,c=l[0].length),this.append(r.slice(a,u<0?r.length:u)),u<0)break;if(this.lineBreak(),c>1){var f,h=at(this.points);try{for(h.s();!(f=h.n()).done;){var d=f.value;d.node==t&&d.pos>this.text.length&&(d.pos-=c-1)}}catch(v){h.e(v)}finally{h.f()}}a=u+c}}},{key:"readNode",value:function(t){if(!t.cmIgnore){var n=fr.get(t),r=n&&n.overrideDOMText;if(r!=null){this.findPointInside(t,r.length);for(var i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}}},{key:"findPointBefore",value:function(t,n){var r,i=at(this.points);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.node==t&&t.childNodes[o.offset]==n&&(o.pos=this.text.length)}}catch(a){i.e(a)}finally{i.f()}}},{key:"findPointInside",value:function(t,n){var r,i=at(this.points);try{for(i.s();!(r=i.n()).done;){var o=r.value;(t.nodeType==3?o.node==t:t.contains(o.node))&&(o.pos=this.text.length+Math.min(n,o.offset))}}catch(a){i.e(a)}finally{i.f()}}}]),e}();function l7(e){return e.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}var f7=tt(function e(t,n){X(this,e),this.node=t,this.offset=n,this.pos=-1}),h7=function(e){Ot(n,fr);var t=Mt(n);function n(r){var i;return X(this,n),(i=t.call(this)).view=r,i.compositionDeco=Te.none,i.decorations=[],i.dynamicDecorationMap=[],i.minWidth=0,i.minWidthFrom=0,i.minWidthTo=0,i.impreciseAnchor=null,i.impreciseHead=null,i.forceSelection=!1,i.lastUpdate=Date.now(),i.setDOM(r.contentDOM),i.children=[new Xo],i.children[0].setParent(ce(i)),i.updateDeco(),i.updateInner([new mc(0,0,0,r.state.doc.length)],0),i}return tt(n,[{key:"length",get:function(){return this.view.state.doc.length}},{key:"update",value:function(r){var i=this,o=r.changedRanges;this.minWidth>0&&o.length&&(o.every(function(s){var u=s.fromA;return s.toAi.minWidthTo})?(this.minWidthFrom=r.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=r.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=Te.none:(r.transactions.length||this.dirty)&&(this.compositionDeco=function(s,u){var c=v7(s);if(!c)return Te.none;var l=c.from,f=c.to,h=c.node,d=c.text,v=u.mapPos(l,1),p=Math.max(v,u.mapPos(f,-1)),m=s.state,g=new c7([],m);h.nodeType==3?g.readTextNode(h):g.readRange(h.firstChild,null);var y=g.text;if(y.indexOf(yc)>-1)return Te.none;if(p-v=0?r[a]:null;if(!s)break;var u=s.fromA,c=s.toA,l=s.fromB,f=s.toB,h=cQ.build(this.view.state.doc,l,f,this.decorations,this.dynamicDecorationMap),d=h.content,v=h.breakAtStart,p=h.openStart,m=h.openEnd,g=o.findPos(c,1),y=g.i,b=g.off,w=o.findPos(u,-1);CA(this,w.i,w.off,y,b,d,v,p,m)}}},{key:"updateSelection",value:function(){var r=this,i=arguments.length>1&&arguments[1]!==void 0&&arguments[1];!(arguments.length>0&&arguments[0]!==void 0&&arguments[0])&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();var o=this.view.root.activeElement,a=o==this.dom,s=!a&&ld(this.dom,this.view.observer.selectionRange)&&!(o&&this.dom.contains(o));if(a||i||s){var u=this.forceSelection;this.forceSelection=!1;var c,l=this.view.state.selection.main,f=this.domAtPos(l.anchor),h=l.empty?f:this.domAtPos(l.head);if(Ce.gecko&&l.empty&&!this.compositionDeco.size&&(c=f).node.nodeType==1&&c.node.firstChild&&(c.offset==0||c.node.childNodes[c.offset-1].contentEditable=="false")&&(c.offset==c.node.childNodes.length||c.node.childNodes[c.offset].contentEditable=="false")){var d=document.createTextNode("");this.view.observer.ignore(function(){return f.node.insertBefore(d,f.node.childNodes[f.offset]||null)}),f=h=new gi(d,0),u=!0}var v=this.view.observer.selectionRange;!u&&v.focusNode&&fd(f.node,f.offset,v.anchorNode,v.anchorOffset)&&fd(h.node,h.offset,v.focusNode,v.focusOffset)||(this.view.observer.ignore(function(){Ce.android&&Ce.chrome&&r.dom.contains(v.focusNode)&&function(x,R){for(var M=x;M&&M!=R;M=M.assignedSlot||M.parentNode)if(M.nodeType==1&&M.contentEditable=="false")return!0;return!1}(v.focusNode,r.dom)&&(r.dom.blur(),r.dom.focus({preventScroll:!0}));var p,m,g=cd(r.view.root);if(g)if(l.empty){if(Ce.gecko){var y=(p=f.node,m=f.offset,p.nodeType!=1?0:(m&&p.childNodes[m-1].contentEditable=="false"?1:0)|(ml.head){var j=[h,f];f=j[0],h=j[1]}w.setEnd(h.node,h.offset),w.setStart(f.node,f.offset),g.removeAllRanges(),g.addRange(w)}s&&r.view.root.activeElement==r.dom&&(r.dom.blur(),o&&o.focus())}),this.view.observer.setSelectionRange(f,h)),this.impreciseAnchor=f.precise?null:new gi(v.anchorNode,v.anchorOffset),this.impreciseHead=h.precise?null:new gi(v.focusNode,v.focusOffset)}}},{key:"enforceCursorAssoc",value:function(){if(!this.compositionDeco.size){var r=this.view,i=r.state.selection.main,o=cd(r.root),a=r.observer.selectionRange,s=a.anchorNode,u=a.anchorOffset;if(o&&i.empty&&i.assoc&&o.modify){var c=Xo.find(this,i.head);if(c){var l=c.posAtStart;if(i.head!=l&&i.head!=l+c.length){var f=this.coordsAt(i.head,-1),h=this.coordsAt(i.head,1);if(f&&h&&!(f.bottom>h.top)){var d=this.domAtPos(i.head+i.assoc);o.collapse(d.node,d.offset),o.modify("move",i.assoc<0?"forward":"backward","lineboundary"),r.observer.readSelectionRange();var v=r.observer.selectionRange;r.docView.posFromDOM(v.anchorNode,v.anchorOffset)!=i.from&&o.collapse(s,u)}}}}}}},{key:"nearest",value:function(r){for(var i=r;i;){var o=fr.get(i);if(o&&o.rootView==this)return o;i=i.parentNode}return null}},{key:"posFromDOM",value:function(r,i){var o=this.nearest(r);if(!o)throw new RangeError("Trying to find position for a DOM position outside of the document");return o.localPosFromDOM(r,i)+o.posAtStart}},{key:"domAtPos",value:function(r){for(var i=this.childCursor().findPos(r,-1),o=i.i,a=i.off;ou||r==u&&s.type!=hr.WidgetBefore&&s.type!=hr.WidgetAfter&&(!a||i==2||this.children[a-1].breakAfter||this.children[a-1].type==hr.WidgetBefore&&i>-2))return s.coordsAt(r-u,i);o=u}}},{key:"measureVisibleLineHeights",value:function(r){for(var i=[],o=r.from,a=r.to,s=this.view.contentDOM.clientWidth,u=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,c=-1,l=this.view.textDirection==dr.LTR,f=0,h=0;ha)break;if(f>=o){var p=d.dom.getBoundingClientRect();if(i.push(p.height),u){var m=d.dom.lastChild,g=m?Dl(m):[];if(g.length){var y=g[g.length-1],b=l?y.right-p.left:p.right-y.left;b>c&&(c=b,this.minWidth=s,this.minWidthFrom=f,this.minWidthTo=v)}}}f=v+d.breakAfter}return i}},{key:"textDirectionAt",value:function(r){var i=this.childPos(r,1).i;return getComputedStyle(this.children[i].dom).direction=="rtl"?dr.RTL:dr.LTR}},{key:"measureTextSize",value:function(){var r,i=this,o=at(this.children);try{for(o.s();!(r=o.n()).done;){var a=r.value;if(a instanceof Xo){var s=a.measureTextSize();if(s)return s}}}catch(h){o.e(h)}finally{o.f()}var u,c,l,f=document.createElement("div");return f.className="cm-line",f.style.width="99999px",f.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(function(){i.dom.appendChild(f);var h=Dl(f.firstChild)[0];u=f.getBoundingClientRect().height,c=h?h.width/27:7,l=h?h.height:u,f.remove()}),{lineHeight:u,charWidth:c,textHeight:l}}},{key:"childCursor",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.length,i=this.children.length;return i&&(r-=this.children[--i].length),new SA(this.children,r,i)}},{key:"computeBlockGapDeco",value:function(){for(var r=[],i=this.view.viewState,o=0,a=0;;a++){var s=a==i.viewports.length?null:i.viewports[a],u=s?s.from-1:this.length;if(u>o){var c=i.lineBlockAt(u).bottom-i.lineBlockAt(o).top;r.push(Te.replace({widget:new d7(c),block:!0,inclusive:!0,isBlockGap:!0}).range(o,u))}if(!s)break;o=s.to+1}return Te.set(r)}},{key:"updateDeco",value:function(){for(var r=this,i=this.view.state.facet(Bl).map(function(a,s){return(r.dynamicDecorationMap[s]=typeof a=="function")?a(r.view):a}),o=i.length;oo.anchor?-1:1);if(a){!o.empty&&(i=this.coordsAt(o.anchor,o.anchor>o.head?-1:1))&&(a={left:Math.min(a.left,i.left),top:Math.min(a.top,i.top),right:Math.max(a.right,i.right),bottom:Math.max(a.bottom,i.bottom)});var s=t7(this.view),u={left:a.left-s.left,top:a.top-s.top,right:a.right+s.right,bottom:a.bottom+s.bottom};(function(c,l,f,h,d,v,p,m){for(var g=c.ownerDocument,y=g.defaultView||window,b=c;b;)if(b.nodeType==1){var w=void 0,j=b==g.body;if(j)w=sQ(y);else{if(b.scrollHeight<=b.clientHeight&&b.scrollWidth<=b.clientWidth){b=b.assignedSlot||b.parentNode;continue}var x=b.getBoundingClientRect();w={left:x.left,right:x.left+b.clientWidth,top:x.top,bottom:x.top+b.clientHeight}}var R=0,M=0;if(d=="nearest")l.top0&&l.bottom>w.bottom+M&&(M=l.bottom-w.bottom+M+p)):l.bottom>w.bottom&&(M=l.bottom-w.bottom+p,f<0&&l.top-M0&&l.right>w.right+R&&(R=l.right-w.right+R+v)):l.right>w.right&&(R=l.right-w.right+v,f<0&&l.left0))break;i=as(r=r.childNodes[i-1])}if(n>=0)for(var o=e,a=t;;){if(o.nodeType==3)return o;if(!(o.nodeType==1&&a=0))break;o=o.childNodes[a],a=0}return null}var yQ=function(){function e(){X(this,e),this.changes=[]}return tt(e,[{key:"compareRange",value:function(t,n){e1(t,n,this.changes)}},{key:"comparePoint",value:function(t,n){e1(t,n,this.changes)}}]),e}();function bQ(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function wQ(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function l1(e,t){return e.topt.top+1}function m7(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function f1(e,t,n){for(var r,i,o,a,s,u,c,l,f=!1,h=e.firstChild;h;h=h.nextSibling)for(var d=Dl(h),v=0;vg||a==g&&o>m){r=h,i=p,o=m,a=g;var y=g?n0?v0)}m==0?n>p.bottom&&(!c||c.bottomp.top)&&(u=h,l=p):c&&l1(c,p)?c=g7(c,p.bottom):l&&l1(l,p)&&(l=m7(l,p.top))}if(c&&c.bottom>=n?(r=s,i=c):l&&l.top<=n&&(r=u,i=l),!r)return{node:e,offset:0};var b=Math.max(i.left,Math.min(i.right,t));return r.nodeType==3?y7(r,b,n):f&&r.contentEditable!="false"?f1(r,b,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,r)+(t>=(i.left+i.right)/2?1:0)}}function y7(e,t,n){for(var r=e.nodeValue.length,i=-1,o=1e9,a=0,s=0;sn?l.top-n:n-l.bottom)-1;if(l.left-1<=t&&l.right+1>=t&&f=(l.left+l.right)/2,d=h;if((Ce.chrome||Ce.gecko)&&hc(e,s).getBoundingClientRect().left==l.right&&(d=!h),f<=0)return{node:e,offset:s+(d?1:0)};i=s+(d?1:0),o=f}}}return{node:e,offset:i>-1?i:a>0?e.nodeValue.length:0}}function b7(e,t,n){var r,i,o,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:-1,s=e.contentDOM.getBoundingClientRect(),u=s.top+e.viewState.paddingTop,c=e.viewState.docHeight,l=t.x,f=t.y,h=f-u;if(h<0)return 0;if(h>c)return e.state.doc.length;for(var d=e.defaultLineHeight/2,v=!1;(o=e.elementAtHeight(h)).type!=hr.Text;)for(;!((h=a>0?o.bottom+d:o.top-d)>=0&&h<=c);){if(v)return n?null:0;v=!0,a=-a}f=u+h;var p=o.from;if(pe.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:w7(e,s,o,l,f);var m=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:m,y=g.elementFromPoint(l,f);y&&!e.contentDOM.contains(y)&&(y=null),y||(l=Math.max(s.left+1,Math.min(s.right-1,l)),(y=g.elementFromPoint(l,f))&&!e.contentDOM.contains(y)&&(y=null));var b,w=-1;if(y&&((r=e.docView.nearest(y))===null||r===void 0?void 0:r.isEditable)!=0){if(m.caretPositionFromPoint){var j=m.caretPositionFromPoint(l,f);j&&(b=j.offsetNode,w=j.offset)}else if(m.caretRangeFromPoint){var x=m.caretRangeFromPoint(l,f);x&&(b=x.startContainer,w=x.startOffset,(!e.contentDOM.contains(b)||Ce.safari&&function(A,L,W){var O;if(A.nodeType!=3||L!=(O=A.nodeValue.length))return!1;for(var I=A.nextSibling;I;I=I.nextSibling)if(I.nodeType!=1||I.nodeName!="BR")return!1;return hc(A,O-1,O).getBoundingClientRect().left>W}(b,w,l)||Ce.chrome&&function(A,L,W){if(L!=0)return!1;for(var O=A;;){var I=O.parentNode;if(!I||I.nodeType!=1||I.firstChild!=O)return!1;if(I.classList.contains("cm-line"))break;O=I}var q=A.nodeType==1?A.getBoundingClientRect():hc(A,0,Math.max(A.nodeValue.length,1)).getBoundingClientRect();return W-q.left>5}(b,w,l))&&(b=void 0))}}if(!b||!e.docView.dom.contains(b)){var R=Xo.find(e.docView,p);if(!R)return h>o.top+o.height/2?o.to:o.from;var M=f1(R.dom,l,f);b=M.node,w=M.offset}var E=e.docView.nearest(b);if(!E)return null;if(E.isWidget&&((i=E.dom)===null||i===void 0?void 0:i.nodeType)==1){var N=E.dom.getBoundingClientRect();return t.y1.5*e.defaultLineHeight&&(o+=Math.floor((i-n.top)/e.defaultLineHeight)*e.viewState.heightOracle.lineLength);var a=e.state.sliceDoc(n.from,n.to);return n.from+L0(a,o,e.state.tabSize)}function h1(e,t){var n=e.lineBlockAt(t);if(Array.isArray(n.type)){var r,i=at(n.type);try{for(i.s();!(r=i.n()).done;){var o=r.value;if(o.to>t||o.to==t&&(o.to==n.to||o.type==hr.Text))return o}}catch(a){i.e(a)}finally{i.f()}}return n}function x7(e,t,n,r){for(var i=e.state.doc.lineAt(t.head),o=e.bidiSpans(i),a=e.textDirectionAt(i.from),s=t,u=null;;){var c=mQ(i,o,a,s,n),l=u7;if(!c){if(i.number==(n?e.state.doc.lines:1))return s;l=` +`,i=e.state.doc.line(i.number+(n?1:-1)),o=e.bidiSpans(i),c=Ht.cursor(n?i.from:i.to)}if(u){if(!u(l))return s}else{if(!r)return c;u=r(l)}s=c}}function gd(e,t,n){for(var r=function(){var o,a=0,s=at(e);try{for(s.s();!(o=s.n()).done;)o.value.between(t-1,t+1,function(u,c,l){if(t>u&&tn.from?-1:1);return r==n.from?n:Ht.cursor(r,rt.contentDOM.getBoundingClientRect().bottom&&(r(Or.mousedown,a),!a.defaultPrevented&&a.button==2)){var s=t.contentDOM.style.minHeight;t.contentDOM.style.minHeight="100%",setTimeout(function(){return t.contentDOM.style.minHeight=s},200)}}),t.scrollDOM.addEventListener("drop",function(a){a.target==t.scrollDOM&&a.clientY>t.contentDOM.getBoundingClientRect().bottom&&r(Or.drop,a)}),Ce.chrome&&Ce.chrome_version==102&&t.scrollDOM.addEventListener("wheel",function(){n.chromeScrollHack<0?t.contentDOM.style.pointerEvents="none":window.clearTimeout(n.chromeScrollHack),n.chromeScrollHack=setTimeout(function(){n.chromeScrollHack=-1,t.contentDOM.style.pointerEvents=""},100)},{passive:!0}),this.notifiedFocused=t.hasFocus,Ce.safari&&t.contentDOM.addEventListener("input",function(){return null})}return tt(e,[{key:"setSelectionOrigin",value:function(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}},{key:"ensureHandlers",value:function(t,n){var r,i,o=this;this.customHandlers=[];var a,s=at(n);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(i=(r=u.update(t).spec)===null||r===void 0?void 0:r.domEventHandlers){this.customHandlers.push({plugin:u.value,handlers:i});var c=function(f){o.registeredEvents.indexOf(f)<0&&f!="scroll"&&(o.registeredEvents.push(f),t.contentDOM.addEventListener(f,function(h){S7(t,h)&&o.runCustomHandlers(f,t,h)&&h.preventDefault()}))};for(var l in i)c(l)}}}catch(f){s.e(f)}finally{s.f()}}},{key:"runCustomHandlers",value:function(t,n,r){var i,o=at(this.customHandlers);try{for(o.s();!(i=o.n()).done;){var a=i.value,s=a.handlers[t];if(s)try{if(s.call(a.plugin,r,n)||r.defaultPrevented)return!0}catch(u){Mi(n.state,u)}}}catch(u){o.e(u)}finally{o.f()}return!1}},{key:"runScrollHandlers",value:function(t,n){this.lastScrollTop=t.scrollDOM.scrollTop,this.lastScrollLeft=t.scrollDOM.scrollLeft;var r,i=at(this.customHandlers);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=o.handlers.scroll;if(a)try{a.call(o.plugin,n,t)}catch(s){Mi(t.state,s)}}}catch(s){i.e(s)}finally{i.f()}}},{key:"keydown",value:function(t,n){var r,i=this;return this.lastKeyCode=n.keyCode,this.lastKeyTime=Date.now(),n.keyCode==9&&Date.now()-1&&n.ctrlKey&&!n.shiftKey))&&(this.pendingIOSKey=r||n,setTimeout(function(){return i.flushIOSKey(t)},250),!0):(t.observer.delayAndroidKey(n.key,n.keyCode),!0))}},{key:"flushIOSKey",value:function(t){var n=this.pendingIOSKey;return!!n&&(this.pendingIOSKey=void 0,dc(t.contentDOM,n.key,n.keyCode))}},{key:"ignoreDuringComposition",value:function(t){return!!/^key/.test(t.type)&&(this.composing>0||!!(Ce.safari&&!Ce.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}},{key:"mustFlushObserver",value:function(t){return t.type=="keydown"&&t.keyCode!=229}},{key:"startMouseSelection",value:function(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}},{key:"update",value:function(t){this.mouseSelection&&this.mouseSelection.update(t),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}},{key:"destroy",value:function(){this.mouseSelection&&this.mouseSelection.destroy()}}]),e}(),k7=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],kQ="dthko",j7=[16,17,18,20,91,92,224,225];function yd(e){return .7*Math.max(0,e)+8}var jQ=function(){function e(t,n,r,i){X(this,e),this.view=t,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=n,this.scrollParent=function(a){for(var s=a.ownerDocument,u=a.parentNode;u&&u!=s.body;)if(u.nodeType==1){if(u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)return u;u=u.assignedSlot||u.parentNode}else{if(u.nodeType!=11)break;u=u.host}return null}(t.contentDOM),this.atoms=t.state.facet(a1).map(function(a){return a(t)});var o=t.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=n.shiftKey,this.multiple=t.state.facet(Hn.allowMultipleSelections)&&function(a,s){var u=a.state.facet(VA);return u.length?u[0](s):Ce.mac?s.metaKey:s.ctrlKey}(t,n),this.dragMove=function(a,s){var u=a.state.facet(WA);return u.length?u[0](s):Ce.mac?!s.altKey:!s.ctrlKey}(t,n),this.dragging=!(!function(a,s){var u=a.state.selection.main;if(u.empty)return!1;var c=cd(a.root);if(!c||c.rangeCount==0)return!0;for(var l=c.getRangeAt(0).getClientRects(),f=0;f=s.clientX&&h.top<=s.clientY&&h.bottom>=s.clientY)return!0}return!1}(t,n)||R7(n)!=1)&&null}return tt(e,[{key:"start",value:function(t){this.dragging===!1&&(t.preventDefault(),this.select(t))}},{key:"move",value:function(t){var n;if(t.buttons==0)return this.destroy();if(this.dragging===!1){this.select(this.lastEvent=t);var r=0,i=0,o=((n=this.scrollParent)===null||n===void 0?void 0:n.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=t7(this.view);t.clientX-a.left<=o.left+6?r=-yd(o.left-t.clientX):t.clientX+a.right>=o.right-6&&(r=yd(t.clientX-o.right)),t.clientY-a.top<=o.top+6?i=-yd(o.top-t.clientY):t.clientY+a.bottom>=o.bottom-6&&(i=yd(t.clientY-o.bottom)),this.setScrollSpeed(r,i)}}},{key:"up",value:function(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}},{key:"destroy",value:function(){this.setScrollSpeed(0,0);var t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}},{key:"setScrollSpeed",value:function(t,n){var r=this;this.scrollSpeed={x:t,y:n},t||n?this.scrolling<0&&(this.scrolling=setInterval(function(){return r.scroll()},50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}},{key:"scroll",value:function(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}},{key:"skipAtoms",value:function(t){for(var n=null,r=0;r2&&arguments[2]!==void 0?arguments[2]:1,f=u.charCategorizer(c),h=u.doc.lineAt(c),d=c-h.from;if(h.length==0)return Ht.cursor(c);d==0?l=1:d==h.length&&(l=-1);var v=d,p=d;l<0?v=si(h.text,d,!1):p=si(h.text,d);for(var m=f(h.text.slice(v,p));v>0;){var g=si(h.text,v,!1);if(f(h.text.slice(g,v))!=m)break;v=g}for(;pDate.now()-2e3)){var n,r=null,i=at(e.state.facet(qA));try{for(i.s();!(n=i.n()).done&&!(r=(0,n.value)(e,t)););}catch(a){i.e(a)}finally{i.f()}if(r||t.button!=0||(r=function(a,s){var u=E7(a,s),c=R7(s),l=a.state.selection;return{update:function(f){f.docChanged&&(u.pos=f.changes.mapPos(u.pos),l=l.map(f.changes))},get:function(f,h,d){var v,p=E7(a,f),m=_7(a,p.pos,p.bias,c);if(u.pos!=p.pos&&!h){var g=_7(a,u.pos,u.bias,c),y=Math.min(g.from,m.from),b=Math.max(g.to,m.to);m=y1&&(v=function(w,j){for(var x=0;x=j)return Ht.create(w.ranges.slice(0,x).concat(w.ranges.slice(x+1)),w.mainIndex==x?0:w.mainIndex-(w.mainIndex>x?1:0))}return null}(l,p.pos))?v:d?l.addRange(m):Ht.create([m])}}}(e,t)),r){var o=e.root.activeElement!=e.contentDOM;e.inputState.startMouseSelection(new jQ(e,t,r,o)),o&&e.observer.ignore(function(){return xA(e.contentDOM)}),e.inputState.mouseSelection&&e.inputState.mouseSelection.start(t)}}};var O7=function(e,t){return e>=t.top&&e<=t.bottom},M7=function(e,t,n){return O7(t,n)&&e>=n.left&&e<=n.right};function SQ(e,t,n,r){var i=Xo.find(e.docView,t);if(!i)return 1;var o=t-i.posAtStart;if(o==0)return 1;if(o==i.length)return-1;var a=i.coordsAt(o,-1);if(a&&M7(n,r,a))return-1;var s=i.coordsAt(o,1);return s&&M7(n,r,s)?1:a&&O7(r,a)?-1:1}function E7(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:SQ(e,n,t.clientX,t.clientY)}}var CQ=Ce.ie&&Ce.ie_version<=11,A7=null,P7=0,T7=0;function R7(e){if(!CQ)return e.detail;var t=A7,n=T7;return A7=e,T7=Date.now(),P7=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(P7+1)%3:1}function N7(e,t,n,r){if(n){var i=e.posAtCoords({x:t.clientX,y:t.clientY},!1);t.preventDefault();var o=e.inputState.mouseSelection,a=r&&o&&o.dragging&&o.dragMove?{from:o.dragging.from,to:o.dragging.to}:null,s={from:i,insert:n},u=e.state.changes(a?[a,s]:s);e.focus(),e.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:a?"move.drop":"input.drop"})}}Or.dragstart=function(e,t){var n=e.state.selection.main,r=e.inputState.mouseSelection;r&&(r.dragging=n),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove")},Or.drop=function(e,t){if(t.dataTransfer){if(e.state.readOnly)return t.preventDefault();var n=t.dataTransfer.files;if(n&&n.length){t.preventDefault();for(var r=Array(n.length),i=0,o=function(){++i==n.length&&N7(e,t,r.filter(function(u){return u!=null}).join(e.state.lineBreak),!1)},a=function(u){var c=new FileReader;c.onerror=o,c.onload=function(){/[\x00-\x08\x0e-\x1f]{2}/.test(c.result)||(r[u]=c.result),o()},c.readAsText(n[u])},s=0;sp&&(c.push(y.text),l.push({from:y.from,to:Math.min(s.doc.length,y.to+1)})),p=y.number}}catch(b){m.e(b)}finally{m.f()}f=!0}return{text:c.join(s.lineBreak),ranges:l,linewise:f}}(e.state),r=n.text,i=n.ranges,o=n.linewise;if(r||o){p1=o?r:null;var a=C7?null:t.clipboardData;a?(t.preventDefault(),a.clearData(),a.setData("text/plain",r)):function(s,u){var c=s.dom.parentNode;if(c){var l=c.appendChild(document.createElement("textarea"));l.style.cssText="position: fixed; left: -10000px; top: 10px",l.value=u,l.focus(),l.selectionEnd=u.length,l.selectionStart=0,setTimeout(function(){l.remove(),s.focus()},50)}}(e,r),t.type!="cut"||e.state.readOnly||e.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"})}};var I7=rs.define();function D7(e,t){var n,r=[],i=at(e.facet(JA));try{for(i.s();!(n=i.n()).done;){var o=(0,n.value)(e,t);o&&r.push(o)}}catch(a){i.e(a)}finally{i.f()}return r?e.update({effects:r,annotations:I7.of(!0)}):null}function L7(e){setTimeout(function(){var t=e.hasFocus;if(t!=e.inputState.notifiedFocused){var n=D7(e.state,t);n?e.dispatch(n):e.update([])}},10)}Or.focus=function(e){e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),L7(e)},Or.blur=function(e){e.observer.clearSelectionRange(),L7(e)},Or.compositionstart=Or.compositionupdate=function(e){e.inputState.compositionFirstChange==null&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0)},Or.compositionend=function(e){e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,Ce.chrome&&Ce.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then(function(){return e.observer.flush()}):setTimeout(function(){e.inputState.composing<0&&e.docView.compositionDeco.size&&e.update([])},50)},Or.contextmenu=function(e){e.inputState.lastContextMenu=Date.now()},Or.beforeinput=function(e,t){var n,r;if(Ce.chrome&&Ce.android&&(r=k7.find(function(o){return o.inputType==t.inputType}))&&(e.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){var i=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(function(){var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>i+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())},100)}};var B7=["pre-wrap","normal","pre-line","break-spaces"],$Q=function(){function e(t){X(this,e),this.lineWrapping=t,this.doc=Tn.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}return tt(e,[{key:"heightForGap",value:function(t,n){var r=this.doc.lineAt(n).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((n-t-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}},{key:"heightForLine",value:function(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}},{key:"setDoc",value:function(t){return this.doc=t,this}},{key:"mustRefreshForWrapping",value:function(t){return B7.indexOf(t)>-1!=this.lineWrapping}},{key:"mustRefreshForHeights",value:function(t){for(var n=!1,r=0;r-1,u=Math.round(n)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=n,this.charWidth=r,this.textHeight=i,this.lineLength=o,u){this.heightSamples={};for(var c=0;c2&&arguments[2]!==void 0?arguments[2]:2;X(this,e),this.length=t,this.height=n,this.flags=r}return tt(e,[{key:"outdated",get:function(){return(2&this.flags)>0},set:function(t){this.flags=(t?2:0)|-3&this.flags}},{key:"setHeight",value:function(t,n){this.height!=n&&(Math.abs(this.height-n)>bd&&(t.heightChanged=!0),this.height=n)}},{key:"replace",value:function(t,n,r){return e.of(r)}},{key:"decomposeLeft",value:function(t,n){n.push(this)}},{key:"decomposeRight",value:function(t,n){n.push(this)}},{key:"applyChanges",value:function(t,n,r,i){for(var o=this,a=r.doc,s=i.length-1;s>=0;s--){var u=i[s],c=u.fromA,l=u.toA,f=u.fromB,h=u.toB,d=o.lineAt(c,Yn.ByPosNoHeight,r.setDoc(n),0,0),v=d.to>=l?d:o.lineAt(l,Yn.ByPosNoHeight,r,0,0);for(h+=v.to-l,l=v.to;s>0&&d.from<=i[s-1].toA;)c=i[s-1].fromA,f=i[s-1].fromB,s--,c2*o){var a=t[n-1];a.break?t.splice(--n,1,a.left,null,a.right):t.splice(--n,1,a.left,a.right),r+=1+a.break,i-=a.size}else{if(!(o>2*i))break;var s=t[r];s.break?t.splice(r,1,s.left,null,s.right):t.splice(r,1,s.left,s.right),r+=2+s.break,o-=s.size}else if(i=s&&u(this.blockAt(0,o,a,s))}},{key:"updateHeight",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>3?arguments[3]:void 0;return o&&o.from<=i&&o.more&&this.setHeight(r,o.heights[o.index++]),this.outdated=!1,this}},{key:"toString",value:function(){return"block(".concat(this.length,")")}}]),n}(),ea=function(e){Ot(n,z7);var t=Mt(n);function n(r,i){var o;return X(this,n),(o=t.call(this,r,i,null)).collapsed=0,o.widgetHeight=0,o.breaks=0,o}return tt(n,[{key:"blockAt",value:function(r,i,o,a){return new us(a,this.length,o,this.height,this.breaks)}},{key:"replace",value:function(r,i,o){var a=o[0];return o.length==1&&(a instanceof n||a instanceof bc&&4&a.flags)&&Math.abs(this.length-a.length)<10?(a instanceof bc?a=new n(a.length,this.height):a.height=this.height,this.outdated||(a.outdated=!1),a):yo.of(o)}},{key:"updateHeight",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],a=arguments.length>3?arguments[3]:void 0;return a&&a.from<=i&&a.more?this.setHeight(r,a.heights[a.index++]):(o||this.outdated)&&this.setHeight(r,Math.max(this.widgetHeight,r.heightForLine(this.length-this.collapsed))+this.breaks*r.lineHeight),this.outdated=!1,this}},{key:"toString",value:function(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")")}}]),n}(),bc=function(e){Ot(n,yo);var t=Mt(n);function n(r){return X(this,n),t.call(this,r,0)}return tt(n,[{key:"heightMetrics",value:function(r,i){var o,a=r.doc.lineAt(i).number,s=r.doc.lineAt(i+this.length).number,u=s-a+1,c=0;if(r.lineWrapping){var l=Math.min(this.height,r.lineHeight*u);o=l/u,this.length>u+1&&(c=(this.height-l)/(this.length-u-1))}else o=this.height/u;return{firstLine:a,lastLine:s,perLine:o,perChar:c}}},{key:"blockAt",value:function(r,i,o,a){var s=this.heightMetrics(i,a),u=s.firstLine,c=s.lastLine,l=s.perLine,f=s.perChar;if(i.lineWrapping){var h=a+Math.round(Math.max(0,Math.min(1,(r-o)/this.height))*this.length),d=i.doc.lineAt(h),v=l+d.length*f,p=Math.max(o,r-v/2);return new us(d.from,d.length,p,v,0)}var m=Math.max(0,Math.min(c-u,Math.floor((r-o)/l))),g=i.doc.line(u+m),y=g.from,b=g.length;return new us(y,b,o+l*m,l,0)}},{key:"lineAt",value:function(r,i,o,a,s){if(i==Yn.ByHeight)return this.blockAt(r,o,a,s);if(i==Yn.ByPosNoHeight){var u=o.doc.lineAt(r),c=u.from,l=u.to;return new us(c,l-c,0,0,0)}var f=this.heightMetrics(o,s),h=f.firstLine,d=f.perLine,v=f.perChar,p=o.doc.lineAt(r),m=d+p.length*v,g=p.number-h,y=a+d*g+v*(p.from-s-g);return new us(p.from,p.length,Math.max(a,Math.min(y,a+this.height-m)),m,0)}},{key:"forEachLine",value:function(r,i,o,a,s,u){r=Math.max(r,s),i=Math.min(i,s+this.length);for(var c=this.heightMetrics(o,s),l=c.firstLine,f=c.perLine,h=c.perChar,d=r,v=a;d<=i;){var p=o.doc.lineAt(d);if(d==r){var m=p.number-l;v+=f*m+h*(r-s-m)}var g=f+h*p.length;u(new us(p.from,p.length,v,g,0)),v+=g,d=p.to+1}}},{key:"replace",value:function(r,i,o){var a=this.length-i;if(a>0){var s=o[o.length-1];s instanceof n?o[o.length-1]=new n(s.length+a):o.push(null,new n(a-1))}if(r>0){var u=o[0];u instanceof n?o[0]=new n(r+u.length):o.unshift(new n(r-1),null)}return yo.of(o)}},{key:"decomposeLeft",value:function(r,i){i.push(new n(r-1),null)}},{key:"decomposeRight",value:function(r,i){i.push(null,new n(this.length-r-1))}},{key:"updateHeight",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],a=arguments.length>3?arguments[3]:void 0,s=i+this.length;if(a&&a.from<=i+this.length&&a.more){var u=[],c=Math.max(i,a.from),l=-1;for(a.from>i&&u.push(new n(a.from-i-1).updateHeight(r,i));c<=s&&a.more;){var f=r.doc.lineAt(c).length;u.length&&u.push(null);var h=a.heights[a.index++];l==-1?l=h:Math.abs(h-l)>=bd&&(l=-2);var d=new ea(f,h);d.outdated=!1,u.push(d),c+=f+1}c<=s&&u.push(null,new n(s-c).updateHeight(r,c));var v=yo.of(u);return(l<0||Math.abs(v.height-this.height)>=bd||Math.abs(l-this.heightMetrics(r,i).perLine)>=bd)&&(r.heightChanged=!0),v}return(o||this.outdated)&&(this.setHeight(r,r.heightForGap(i,i+this.length)),this.outdated=!1),this}},{key:"toString",value:function(){return"gap(".concat(this.length,")")}}]),n}(),OQ=function(e){Ot(n,yo);var t=Mt(n);function n(r,i,o){var a;return X(this,n),(a=t.call(this,r.length+i+o.length,r.height+o.height,i|(r.outdated||o.outdated?2:0))).left=r,a.right=o,a.size=r.size+o.size,a}return tt(n,[{key:"break",get:function(){return 1&this.flags}},{key:"blockAt",value:function(r,i,o,a){var s=o+this.left.height;return rc))return f;var h=i==Yn.ByPosNoHeight?Yn.ByPosNoHeight:Yn.ByPos;return l?f.join(this.right.lineAt(c,h,o,u,c)):this.left.lineAt(c,h,o,a,s).join(f)}},{key:"forEachLine",value:function(r,i,o,a,s,u){var c=a+this.left.height,l=s+this.left.length+this.break;if(this.break)r=l&&this.right.forEachLine(r,i,o,c,l,u);else{var f=this.lineAt(l,Yn.ByPos,o,a,s);r=r&&f.from<=i&&u(f),i>f.to&&this.right.forEachLine(f.to+1,i,o,c,l,u)}}},{key:"replace",value:function(r,i,o){var a=this.left.length+this.break;if(ithis.left.length)return this.balanced(this.left,this.right.replace(r-a,i-a,o));var s=[];r>0&&this.decomposeLeft(r,s);var u,c=s.length,l=at(o);try{for(l.s();!(u=l.n()).done;){var f=u.value;s.push(f)}}catch(d){l.e(d)}finally{l.f()}if(r>0&&F7(s,c-1),i=++o&&i.push(null),r>o&&this.right.decomposeLeft(r-o,i)}},{key:"decomposeRight",value:function(r,i){var o=this.left.length,a=o+this.break;if(r>=a)return this.right.decomposeRight(r-a,i);r2*i.size||i.size>2*r.size?yo.of(this.break?[r,null,i]:[r,i]):(this.left=r,this.right=i,this.height=r.height+i.height,this.outdated=r.outdated||i.outdated,this.size=r.size+i.size,this.length=r.length+this.break+i.length,this)}},{key:"updateHeight",value:function(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],a=arguments.length>3?arguments[3]:void 0,s=this.left,u=this.right,c=i+s.length+this.break,l=null;return a&&a.from<=i+s.length&&a.more?l=s=s.updateHeight(r,i,o,a):s.updateHeight(r,i,o),a&&a.from<=c+u.length&&a.more?l=u=u.updateHeight(r,c,o,a):u.updateHeight(r,c,o),l?this.balanced(s,u):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}},{key:"toString",value:function(){return this.left+(this.break?" ":"-")+this.right}}]),n}();function F7(e,t){var n,r;e[t]==null&&(n=e[t-1])instanceof bc&&(r=e[t+1])instanceof bc&&e.splice(t-1,3,new bc(n.length+1+r.length))}var MQ=function(){function e(t,n){X(this,e),this.pos=t,this.oracle=n,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}return tt(e,[{key:"isCovered",get:function(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}},{key:"span",value:function(t,n){if(this.lineStart>-1){var r=Math.min(n,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof ea?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new ea(r-this.pos,-1)),this.writtenTo=r,n>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=n}},{key:"point",value:function(t,n,r){if(t=5)&&this.addLineDeco(i,o,a)}else n>t&&this.span(t,n);this.lineEnd>-1&&this.lineEnd-1)){var t=this.oracle.doc.lineAt(this.pos),n=t.from,r=t.to;this.lineStart=n,this.lineEnd=r,this.writtenTon&&this.nodes.push(new ea(this.pos-n,-1)),this.writtenTo=this.pos}}},{key:"blankContent",value:function(t,n){var r=new bc(n-t);return this.oracle.doc.lineAt(t).to==n&&(r.flags|=4),r}},{key:"ensureLine",value:function(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof ea)return t;var n=new ea(0,-1);return this.nodes.push(n),n}},{key:"addBlock",value:function(t){var n;this.enterLine();var r=(n=t.deco)===null||n===void 0?void 0:n.type;r!=hr.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,r!=hr.WidgetBefore&&(this.covering=t)}},{key:"addLineDeco",value:function(t,n,r){var i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,t),i.breaks+=n,this.writtenTo=this.pos=this.pos+r}},{key:"finish",value:function(t){var n=this.nodes.length==0?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||n instanceof ea||this.isCovered?(this.writtenTol.clientHeight||l.scrollWidth>l.clientWidth)&&f.overflow!="visible"){var h=l.getBoundingClientRect();o=Math.max(o,h.left),a=Math.min(a,h.right),s=Math.max(s,h.top),u=c==e.parentNode?h.bottom:Math.min(u,h.bottom)}c=f.position=="absolute"||f.position=="fixed"?l.offsetParent:l.parentNode}else{if(c.nodeType!=11)break;c=c.host}return{left:o-n.left,right:Math.max(o,a)-n.left,top:s-(n.top+t),bottom:Math.max(s,u)-(n.top+t)}}function PQ(e,t){var n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}var m1=function(){function e(t,n,r){X(this,e),this.from=t,this.to=n,this.size=r}return tt(e,[{key:"draw",value:function(t){return Te.replace({widget:new TQ(this.size,t)}).range(this.from,this.to)}}],[{key:"same",value:function(t,n){if(t.length!=n.length)return!1;for(var r=0;r=f&&a<=h})){var s=t.lineBlockAt(a),u=s.from,c=s.to;n.push(new wd(u,c))}},o=0;o<=1;o++)i();this.viewports=n.sort(function(a,s){return a.from-s.from}),this.scaler=this.heightMap.height<=7e6?W7:new NQ(this.heightOracle,this.heightMap,this.viewports)}},{key:"updateViewportLines",value:function(){var t=this;this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,function(n){t.viewportLines.push(t.scaler.scale==1?n:Fl(n,t.scaler))})}},{key:"update",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;this.state=t.state;var r=this.stateDeco;this.stateDeco=this.state.facet(Bl).filter(function(l){return typeof l!="function"});var i=t.changedRanges,o=mc.extendWithRanges(i,function(l,f,h){var d=new EQ;return Qn.compare(l,f,h,d,0),d.changes}(r,this.stateDeco,t?t.changes:go.empty(this.state.doc.length))),a=this.heightMap.height,s=this.scrolledToBottom?null:this.lineBlockAtHeight(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),o),this.heightMap.height!=a&&(t.flags|=2),s?(this.scrollAnchorPos=t.changes.mapPos(s.from,-1),this.scrollAnchorHeight=s.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);var u=o.length?this.mapViewport(this.viewport,t.changes):this.viewport;(n&&(n.range.headu.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,n));var c=!t.changes.empty||2&t.flags||u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,this.updateForViewport(),c&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),n&&(this.scrollTarget=n),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(GA)&&(this.mustEnforceCursorAssoc=!0)}},{key:"measure",value:function(t){var n=t.contentDOM,r=window.getComputedStyle(n),i=this.heightOracle,o=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?dr.RTL:dr.LTR;var a=this.heightOracle.mustRefreshForWrapping(o),s=n.getBoundingClientRect(),u=a||this.mustMeasureContent||this.contentDOMHeight!=s.height;this.contentDOMHeight=s.height,this.mustMeasureContent=!1;var c=0,l=0,f=parseInt(r.paddingTop)||0,h=parseInt(r.paddingBottom)||0;this.paddingTop==f&&this.paddingBottom==h||(this.paddingTop=f,this.paddingBottom=h,c|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=t.scrollDOM.clientWidth,c|=8),this.scrollTop!=t.scrollDOM.scrollTop&&(this.scrollAnchorHeight=-1,this.scrollTop=t.scrollDOM.scrollTop),this.scrolledToBottom=this.scrollTop>t.scrollDOM.scrollHeight-t.scrollDOM.clientHeight-4;var d=(this.printing?PQ:AQ)(n,this.paddingTop),v=d.top-this.pixelViewport.top,p=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;var m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(u=!0)),!this.inView&&!this.scrollTarget)return 0;var g=s.width;if(this.contentDOMWidth==g&&this.editorHeight==t.scrollDOM.clientHeight||(this.contentDOMWidth=s.width,this.editorHeight=t.scrollDOM.clientHeight,c|=8),u){var y=t.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(y)&&(a=!0),a||i.lineWrapping&&Math.abs(g-this.contentDOMWidth)>i.charWidth){var b=t.docView.measureTextSize(),w=b.lineHeight,j=b.charWidth,x=b.textHeight;(a=w>0&&i.refresh(o,w,j,x,g/j,y))&&(t.docView.minWidth=0,c|=8)}v>0&&p>0?l=Math.max(v,p):v<0&&p<0&&(l=Math.min(v,p)),i.heightChanged=!1;var R,M=at(this.viewports);try{for(M.s();!(R=M.n()).done;){var E=R.value,N=E.from==this.viewport.from?y:t.docView.measureVisibleLineHeights(E);this.heightMap=(a?yo.empty().applyChanges(this.stateDeco,Tn.empty,this.heightOracle,[new mc(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(i,0,a,new _Q(E.from,N))}}catch(L){M.e(L)}finally{M.f()}i.heightChanged&&(c|=2)}var A=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return A&&(this.viewport=this.getViewport(l,this.scrollTarget)),this.updateForViewport(),(2&c||A)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,t)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),c}},{key:"visibleTop",get:function(){return this.scaler.fromDOM(this.pixelViewport.top)}},{key:"visibleBottom",get:function(){return this.scaler.fromDOM(this.pixelViewport.bottom)}},{key:"getViewport",value:function(t,n){var r=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),i=this.heightMap,o=this.heightOracle,a=this.visibleTop,s=this.visibleBottom,u=new wd(i.lineAt(a-1e3*r,Yn.ByHeight,o,0,0).from,i.lineAt(s+1e3*(1-r),Yn.ByHeight,o,0,0).to);if(n){var c=n.range.head;if(cu.to){var l,f=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),h=i.lineAt(c,Yn.ByPos,o,0,0);l=n.y=="center"?(h.top+h.bottom)/2-f/2:n.y=="start"||n.y=="nearest"&&c1&&arguments[1]!==void 0?arguments[1]:0;if(!this.inView)return!0;var o=this.heightMap.lineAt(n,Yn.ByPos,this.heightOracle,0,0).top,a=this.heightMap.lineAt(r,Yn.ByPos,this.heightOracle,0,0).bottom,s=this.visibleTop,u=this.visibleBottom;return(n==0||o<=s-Math.max(10,Math.min(-i,250)))&&(r==this.state.doc.length||a>=u+Math.max(10,Math.min(i,250)))&&o>s-2e3&&a>1,s=o<<1;if(this.defaultTextDirection!=dr.LTR&&!i)return[];var u,c=[],l=function L(W,O,I,q){if(!(O-WW&&D=I.from&&H.to<=I.to&&Math.abs(H.from-W)U})});if(!B){if(O=O})){var k=n.moveToLineBoundary(Ht.cursor(O),!1,!0).head;k>W&&(O=k)}B=new m1(W,O,r.gapSize(I,W,O,q))}c.push(B)}},f=at(this.viewportLines);try{for(f.s();!(u=f.n()).done;){var h=u.value;if(!(h.lengthh.from&&l(h.from,p,h,d),m=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(function(n){return n.from<=t&&n.to>=t})||Fl(this.heightMap.lineAt(t,Yn.ByPos,this.heightOracle,0,0),this.scaler)}},{key:"lineBlockAtHeight",value:function(t){return Fl(this.heightMap.lineAt(this.scaler.fromDOM(t),Yn.ByHeight,this.heightOracle,0,0),this.scaler)}},{key:"elementAtHeight",value:function(t){return Fl(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}},{key:"docHeight",get:function(){return this.scaler.toDOM(this.heightMap.height)}},{key:"contentHeight",get:function(){return this.docHeight+this.paddingTop+this.paddingBottom}}]),e}(),wd=tt(function e(t,n){X(this,e),this.from=t,this.to=n});function RQ(e,t,n){var r=[],i=e,o=0;return Qn.spans(n,e,t,{span:function(){},point:function(a,s){a>i&&(r.push({from:i,to:a}),o+=a-i),i=s}},20),i=1)return r[r.length-1].to;for(var i=Math.floor(n*t),o=0;;o++){var a=r[o],s=a.from,u=a.to-s;if(i<=u)return s+i;i-=u}}function kd(e,t){var n,r=0,i=at(e.ranges);try{for(i.s();!(n=i.n()).done;){var o=n.value,a=o.from,s=o.to;if(t<=s){r+=t-a;break}r+=s-a}}catch(u){i.e(u)}finally{i.f()}return r/e.total}var W7={toDOM:function(e){return e},fromDOM:function(e){return e},scale:1},NQ=function(){function e(t,n,r){X(this,e);var i=0,o=0,a=0;this.viewports=r.map(function(l){var f=l.from,h=l.to,d=n.lineAt(f,Yn.ByPos,t,0,0).top,v=n.lineAt(h,Yn.ByPos,t,0,0).bottom;return i+=v-d,{from:f,to:h,top:d,bottom:v,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(n.height-i);var s,u=at(this.viewports);try{for(u.s();!(s=u.n()).done;){var c=s.value;c.domTop=a+(c.top-o)*this.scale,a=c.domBottom=c.domTop+(c.bottom-c.top),o=c.bottom}}catch(l){u.e(l)}finally{u.f()}}return tt(e,[{key:"toDOM",value:function(t){for(var n=0,r=0,i=0;;n++){var o=n-1}}),y1=is.newName(),q7=is.newName(),H7=is.newName(),U7={"&light":"."+q7,"&dark":"."+H7};function b1(e,t,n){return new is(t,{finish:function(r){return/&/.test(r)?r.replace(/&\w*/,function(i){if(i=="&")return e;if(!n||!n[i])throw new RangeError("Unsupported selector: ".concat(i));return n[i]}):e+" "+r}})}var IQ=b1("."+y1,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},U7),DQ=tt(function e(t,n,r,i){X(this,e),this.typeOver=i,this.bounds=null,this.text="";var o=t.docView,a=o.impreciseHead,s=o.impreciseAnchor;if(t.state.readOnly&&n>-1)this.newSel=null;else if(n>-1&&(this.bounds=t.docView.domBoundsAround(n,r,0))){var u=a||s?[]:function(d){var v=[];if(d.root.activeElement!=d.contentDOM)return v;var p=d.observer.selectionRange,m=p.anchorNode,g=p.anchorOffset,y=p.focusNode,b=p.focusOffset;return m&&(v.push(new f7(m,g)),y==m&&b==g||v.push(new f7(y,b))),v}(t),c=new c7(u,t.state);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=function(d,v){if(d.length==0)return null;var p=d[0].pos,m=d.length==2?d[1].pos:p;return p>-1&&m>-1?Ht.single(p+v,m+v):null}(u,this.bounds.from)}else{var l=t.observer.selectionRange,f=a&&a.node==l.focusNode&&a.offset==l.focusOffset||!lc(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),h=s&&s.node==l.anchorNode&&s.offset==l.anchorOffset||!lc(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset);this.newSel=Ht.single(h,f)}});function J7(e,t){var n,r=t.newSel,i=e.state.selection.main,o=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){var a=t.bounds,s=a.from,u=a.to,c=i.from,l=null;(o===8||Ce.android&&t.text.length0&&P>0&&N.charCodeAt(q-1)==A.charCodeAt(P-1);)q--,P--;return W=="end"&&(L-=q+Math.max(0,I-Math.min(q,P))-I),q=q?I-L:0)+(P-q),q=I):P=P?I-L:0)+(q-P),P=I),{from:I,toA:q,toB:P}}(e.state.doc.sliceString(s,u,yc),t.text,c-s,l);f&&(Ce.chrome&&o==13&&f.toB==f.from+2&&t.text.slice(f.from,f.toB)==yc+yc&&f.toB--,n={from:s+f.from,to:s+f.toA,insert:Tn.of(t.text.slice(f.from,f.toB).split(yc))})}else r&&(!e.hasFocus&&e.state.facet(md)||r.main.eq(i))&&(r=null);if(!n&&!r)return!1;if(!n&&t.typeOver&&!i.empty&&r&&r.main.empty?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,i.to)}:n&&n.from>=i.from&&n.to<=i.to&&(n.from!=i.from||n.to!=i.to)&&i.to-i.from-(n.to-n.from)<=4?n={from:i.from,to:i.to,insert:e.state.doc.slice(i.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,i.to))}:(Ce.mac||Ce.android)&&n&&n.from==n.to&&n.from==i.head-1&&/^\. ?$/.test(n.insert.toString())&&e.contentDOM.getAttribute("autocorrect")=="off"?(r&&n.insert.length==2&&(r=Ht.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Tn.of([" "])}):Ce.chrome&&n&&n.from==n.to&&n.from==i.head&&n.insert.toString()==` + `&&e.lineWrapping&&(r&&(r=Ht.single(r.main.anchor-1,r.main.head-1)),n={from:i.from,to:i.to,insert:Tn.of([" "])}),n){var h=e.state;if(Ce.ios&&e.inputState.flushIOSKey(e)||Ce.android&&(n.from==i.from&&n.to==i.to&&n.insert.length==1&&n.insert.lines==2&&dc(e.contentDOM,"Enter",13)||(n.from==i.from-1&&n.to==i.to&&n.insert.length==0||o==8&&n.insert.length=0&&e.inputState.composing++,n.from>=i.from&&n.to<=i.to&&n.to-n.from>=(i.to-i.from)/3&&(!r||r.main.empty&&r.main.from==n.from+n.insert.length)&&e.inputState.composing<0){var p=i.fromn.to?h.sliceDoc(n.to,i.to):"";d=h.replaceSelection(e.state.toText(p+n.insert.sliceString(0,void 0,e.state.lineBreak)+m))}else{var g=h.changes(n),y=r&&r.main.to<=g.newLength?r.main:void 0;if(h.selection.ranges.length>1&&e.inputState.composing>=0&&n.to<=i.to&&n.to>=i.to-10){var b=e.state.sliceDoc(n.from,n.to),w=v7(e)||e.state.doc.lineAt(i.head),j=i.to-n.to,x=i.to-i.from;d=h.changeByRange(function(N){if(N.from==i.from&&N.to==i.to)return{changes:g,range:y||N.map(g)};var A=N.to-j,L=A-b.length;if(N.to-N.from!=x||e.state.sliceDoc(L,A)!=b||w&&N.to>=w.from&&N.from<=w.to)return{range:N};var W=h.changes({from:L,to:A,insert:n.insert}),O=N.to-i.to;return{changes:W,range:y?Ht.range(Math.max(0,y.anchor+O),Math.max(0,y.head+O)):N.map(W)}})}else d={changes:g,selection:y&&h.selection.replaceRange(y)}}var R="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,R+=".compose",e.inputState.compositionFirstChange&&(R+=".start",e.inputState.compositionFirstChange=!1)),e.dispatch(d,{scrollIntoView:!0,userEvent:R}),!0}if(r&&!r.main.eq(i)){var M=!1,E="select";return e.inputState.lastSelectionTime>Date.now()-50&&(e.inputState.lastSelectionOrigin=="select"&&(M=!0),E=e.inputState.lastSelectionOrigin),e.dispatch({selection:r,scrollIntoView:M,userEvent:E}),!0}return!1}var LQ={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},w1=Ce.ie&&Ce.ie_version<=11,BQ=function(){function e(t){var n=this;X(this,e),this.view=t,this.active=!1,this.selectionRange=new uQ,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.resizeContent=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(function(r){var i,o=at(r);try{for(o.s();!(i=o.n()).done;){var a=i.value;n.queue.push(a)}}catch(s){o.e(s)}finally{o.f()}(Ce.ie&&Ce.ie_version<=11||Ce.ios&&t.composing)&&r.some(function(s){return s.type=="childList"&&s.removedNodes.length||s.type=="characterData"&&s.oldValue.length>s.target.nodeValue.length})?n.flushSoon():n.flush()}),w1&&(this.onCharData=function(r){n.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),n.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(function(){var r;((r=n.view.docView)===null||r===void 0?void 0:r.lastUpdate)0&&r[r.length-1].intersectionRatio>0!=n.intersecting&&(n.intersecting=!n.intersecting,n.intersecting!=n.view.inView&&n.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(function(r){r.length>0&&r[r.length-1].intersectionRatio>0&&n.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}return tt(e,[{key:"onScrollChanged",value:function(t){this.view.inputState.runScrollHandlers(this.view,t),this.intersecting&&this.view.measure()}},{key:"onScroll",value:function(t){this.intersecting&&this.flush(!1),this.onScrollChanged(t)}},{key:"onResize",value:function(){var t=this;this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(function(){t.resizeTimeout=-1,t.view.requestMeasure()},50))}},{key:"onPrint",value:function(){var t=this;this.view.viewState.printing=!0,this.view.measure(),setTimeout(function(){t.view.viewState.printing=!1,t.view.requestMeasure()},500)}},{key:"updateGaps",value:function(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(function(o,a){return o!=t[a]}))){this.gapIntersection.disconnect();var n,r=at(t);try{for(r.s();!(n=r.n()).done;){var i=n.value;this.gapIntersection.observe(i)}}catch(o){r.e(o)}finally{r.f()}this.gaps=t}}},{key:"onSelectionChange",value:function(t){var n=this.selectionChanged;if(this.readSelectionRange()&&!this.delayedAndroidKey){var r=this.view,i=this.selectionRange;if(r.state.facet(md)?r.root.activeElement==this.dom:ld(r.dom,i)){var o=i.anchorNode&&r.docView.nearest(i.anchorNode);o&&o.ignoreEvent(t)?n||(this.selectionChanged=!1):(Ce.ie&&Ce.ie_version<=11||Ce.android&&Ce.chrome)&&!r.state.selection.main.empty&&i.focusNode&&fd(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}}}},{key:"readSelectionRange",value:function(){var t=this.view,n=Ce.safari&&t.root.nodeType==11&&function(i){for(var o=i.activeElement;o&&o.shadowRoot;)o=o.shadowRoot.activeElement;return o}(this.dom.ownerDocument)==this.dom&&function(i){var o=null;function a(d){d.preventDefault(),d.stopImmediatePropagation(),o=d.getTargetRanges()[0]}if(i.contentDOM.addEventListener("beforeinput",a,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",a,!0),!o)return null;var s=o.startContainer,u=o.startOffset,c=o.endContainer,l=o.endOffset,f=i.docView.domAtPos(i.state.selection.main.anchor);if(fd(f.node,f.offset,c,l)){var h=[c,l,s,u];s=h[0],u=h[1],c=h[2],l=h[3]}return{anchorNode:s,anchorOffset:u,focusNode:c,focusOffset:l}}(this.view)||cd(t.root);if(!n||this.selectionRange.eq(n))return!1;var r=ld(this.dom,n);return r&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}},{key:"pendingRecords",value:function(){var t,n=at(this.observer.takeRecords());try{for(n.s();!(t=n.n()).done;){var r=t.value;this.queue.push(r)}}catch(i){n.e(i)}finally{n.f()}return this.queue}},{key:"processRecords",value:function(){var t=this.pendingRecords();t.length&&(this.queue=[]);var n,r=-1,i=-1,o=!1,a=at(t);try{for(a.s();!(n=a.n()).done;){var s=n.value,u=this.readMutation(s);u&&(u.typeOver&&(o=!0),r==-1?(r=u.from,i=u.to):(r=Math.min(u.from,r),i=Math.max(u.to,i)))}}catch(c){a.e(c)}finally{a.f()}return{from:r,to:i,typeOver:o}}},{key:"readChange",value:function(){var t=this.processRecords(),n=t.from,r=t.to,i=t.typeOver,o=this.selectionChanged&&ld(this.dom,this.selectionRange);return n<0&&!o?null:(n>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1,new DQ(this.view,n,r,i))}},{key:"flush",value:function(){var t=!(arguments.length>0&&arguments[0]!==void 0)||arguments[0];if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();var n=this.readChange();if(!n)return!1;var r=this.view.state,i=J7(this.view,n);return this.view.state==r&&this.view.update([]),i}},{key:"readMutation",value:function(t){var n=this.view.docView.nearest(t.target);if(!n||n.ignoreMutation(t))return null;if(n.markDirty(t.type=="attributes"),t.type=="attributes"&&(n.dirty|=4),t.type=="childList"){var r=K7(n,t.previousSibling||t.target.previousSibling,-1),i=K7(n,t.nextSibling||t.target.nextSibling,1);return{from:r?n.posAfter(r):n.posAtStart,to:i?n.posBefore(i):n.posAtEnd,typeOver:!1}}return t.type=="characterData"?{from:n.posAtStart,to:n.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}},{key:"setWindow",value:function(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}},{key:"addWindowListeners",value:function(t){t.addEventListener("resize",this.onResize),t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}},{key:"removeWindowListeners",value:function(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}},{key:"destroy",value:function(){var t,n,r,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(n=this.gapIntersection)===null||n===void 0||n.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect(),(i=this.resizeContent)===null||i===void 0||i.disconnect();var o,a=at(this.scrollTargets);try{for(a.s();!(o=a.n()).done;)o.value.removeEventListener("scroll",this.onScroll)}catch(s){a.e(s)}finally{a.f()}this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}]),e}();function K7(e,t,n){for(;t;){var r=fr.get(t);if(r&&r.parent==e)return r;var i=t.parentNode;t=i!=e.dom?i:n>0?t.nextSibling:t.previousSibling}return null}var we=function(){function e(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};X(this,e),this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=n.dispatch||function(o){return t.update([o])},this.dispatch=this.dispatch.bind(this),this._root=n.root||function(o){for(;o;){if(o&&(o.nodeType==9||o.nodeType==11&&o.host))return o;o=o.assignedSlot||o.parentNode}return null}(n.parent)||document,this.viewState=new V7(n.state||Hn.create(n)),this.plugins=this.state.facet(Ll).map(function(o){return new i1(o)});var r,i=at(this.plugins);try{for(i.s();!(r=i.n()).done;)r.value.update(this)}catch(o){i.e(o)}finally{i.f()}this.observer=new BQ(this),this.inputState=new xQ(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new h7(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),n.parent&&n.parent.appendChild(this.dom)}return tt(e,[{key:"state",get:function(){return this.viewState.state}},{key:"viewport",get:function(){return this.viewState.viewport}},{key:"visibleRanges",get:function(){return this.viewState.visibleRanges}},{key:"inView",get:function(){return this.viewState.inView}},{key:"composing",get:function(){return this.inputState.composing>0}},{key:"compositionStarted",get:function(){return this.inputState.composing>=0}},{key:"root",get:function(){return this._root}},{key:"win",get:function(){return this.dom.ownerDocument.defaultView||window}},{key:"dispatch",value:function(){var t,n=arguments.length==1&&(arguments.length<=0?void 0:arguments[0])instanceof mi?arguments.length<=0?void 0:arguments[0]:(t=this.state).update.apply(t,arguments);this._dispatch(n,this)}},{key:"update",value:function(t){var n=this;if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var r,i,o=!1,a=!1,s=this.state,u=at(t);try{for(u.s();!(i=u.n()).done;){var c=i.value;if(c.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=c.state}}catch(E){u.e(E)}finally{u.f()}if(this.destroyed)this.viewState.state=s;else{var l=this.hasFocus,f=0,h=null;t.some(function(E){return E.annotation(I7)})?(this.inputState.notifiedFocused=l,f=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,(h=D7(s,l))||(f=1));var d=this.observer.delayedAndroidKey,v=null;if(d?(this.observer.clearDelayedAndroidKey(),((v=this.observer.readChange())&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(v=null)):this.observer.clear(),s.facet(Hn.phrases)!=this.state.facet(Hn.phrases))return this.setState(s);r=e7.create(this,s,t),r.flags|=f;var p=this.viewState.scrollTarget;try{this.updateState=2;var m,g=at(t);try{for(g.s();!(m=g.n()).done;){var y=m.value;if(p&&(p=p.map(y.changes)),y.scrollIntoView){var b=y.state.selection.main;p=new QA(b.empty?b:Ht.cursor(b.head,b.head>b.anchor?-1:1))}var w,j=at(y.effects);try{for(j.s();!(w=j.n()).done;){var x=w.value;x.is(YA)&&(p=x.value)}}catch(E){j.e(E)}finally{j.f()}}}catch(E){g.e(E)}finally{g.f()}this.viewState.update(r,p),this.bidiCache=Q7.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),o=this.docView.update(r),this.state.facet(zl)!=this.styleModules&&this.mountStyles(),a=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(o,t.some(function(E){return E.isUserEvent("select.pointer")}))}finally{this.updateState=0}if(r.startState.facet(jd)!=r.state.facet(jd)&&(this.viewState.mustMeasureContent=!0),(o||a||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!r.empty){var R,M=at(this.state.facet(r1));try{for(M.s();!(R=M.n()).done;)(0,R.value)(r)}catch(E){M.e(E)}finally{M.f()}}(h||v)&&Promise.resolve().then(function(){h&&n.state==h.startState&&n.dispatch(h),v&&!J7(n,v)&&d.force&&dc(n.contentDOM,d.key,d.keyCode)})}}},{key:"setState",value:function(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)this.viewState.state=t;else{this.updateState=2;var n=this.hasFocus;try{var r,i=at(this.plugins);try{for(i.s();!(r=i.n()).done;)r.value.destroy(this)}catch(s){i.e(s)}finally{i.f()}this.viewState=new V7(t),this.plugins=t.facet(Ll).map(function(s){return new i1(s)}),this.pluginMap.clear();var o,a=at(this.plugins);try{for(a.s();!(o=a.n()).done;)o.value.update(this)}catch(s){a.e(s)}finally{a.f()}this.docView=new h7(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}n&&this.focus(),this.requestMeasure()}}},{key:"updatePlugins",value:function(t){var n=t.startState.facet(Ll),r=t.state.facet(Ll);if(n!=r){var i,o=[],a=at(r);try{for(a.s();!(i=a.n()).done;){var s=i.value,u=n.indexOf(s);if(u<0)o.push(new i1(s));else{var c=this.plugins[u];c.mustUpdate=t,o.push(c)}}}catch(m){a.e(m)}finally{a.f()}var l,f=at(this.plugins);try{for(f.s();!(l=f.n()).done;){var h=l.value;h.mustUpdate!=t&&h.destroy(this)}}catch(m){f.e(m)}finally{f.f()}this.plugins=o,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else{var d,v=at(this.plugins);try{for(v.s();!(d=v.n()).done;)d.value.mustUpdate=t}catch(m){v.e(m)}finally{v.f()}}for(var p=0;p0&&arguments[0]!==void 0)||arguments[0];if(!this.destroyed){this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,n&&this.observer.forceFlush();var r=null,i=this.scrollDOM,o=i.scrollTop,a=this.viewState,s=a.scrollAnchorPos,u=a.scrollAnchorHeight;if(this.viewState.scrollAnchorHeight=-1,u<0||o!=this.viewState.scrollTop)if(o>i.scrollHeight-i.clientHeight-4)s=-1,u=this.viewState.heightMap.height;else{var c=this.viewState.lineBlockAtHeight(o);s=c.from,u=c.top}try{for(var l=0;;l++){this.updateState=1;var f=this.viewport,h=this.viewState.measure(this);if(!h&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}var d=[];if(!(4&h)){var v=[d,this.measureRequests];this.measureRequests=v[0],d=v[1]}var p=d.map(function(M){try{return M.read(t)}catch(E){return Mi(t.state,E),G7}}),m=e7.create(this,this.state,[]),g=!1,y=!1;m.flags|=h,r?r.flags|=h:r=m,this.updateState=2,m.empty||(this.updatePlugins(m),this.inputState.update(m),this.updateAttrs(),g=this.docView.update(m));for(var b=0;b-1){var j=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-u;(j>1||j<-1)&&(i.scrollTop=o+j,y=!0)}}if(g&&this.docView.updateSelection(!0),this.viewport.from==f.from&&this.viewport.to==f.to&&!y&&this.measureRequests.length==0)break;u=-1}}finally{this.updateState=0,this.measureScheduled=-1}if(r&&!r.empty){var x,R=at(this.state.facet(r1));try{for(R.s();!(x=R.n()).done;)(0,x.value)(r)}catch(M){R.e(M)}finally{R.f()}}}}},{key:"themeClasses",get:function(){return y1+" "+(this.state.facet(g1)?H7:q7)+" "+this.state.facet(jd)}},{key:"updateAttrs",value:function(){var t=this,n=Y7(this,ZA,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),r={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(md)?"true":"false",class:"cm-content",style:"".concat(Ce.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};this.state.readOnly&&(r["aria-readonly"]="true"),Y7(this,o1,r);var i=this.observer.ignore(function(){var o=X0(t.contentDOM,t.contentAttrs,r),a=X0(t.dom,t.editorAttrs,n);return o||a});return this.editorAttrs=n,this.contentAttrs=r,i}},{key:"showAnnouncements",value:function(t){var n,r=!0,i=at(t);try{for(i.s();!(n=i.n()).done;){var o,a=at(n.value.effects);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.is(e.announce)&&(r&&(this.announceDOM.textContent=""),r=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=s.value)}}catch(u){a.e(u)}finally{a.f()}}}catch(u){i.e(u)}finally{i.f()}}},{key:"mountStyles",value:function(){this.styleModules=this.state.facet(zl),is.mount(this.root,this.styleModules.concat(IQ).reverse())}},{key:"readMeasured",value:function(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}},{key:"requestMeasure",value:function(t){var n=this;if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(function(){return n.measure()})),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(var r=0;rs.from?i.head-1:i.head):null;if(u){var c=r.dom.getBoundingClientRect(),l=r.textDirectionAt(s.from),f=r.posAtCoords({x:o==(l==dr.LTR)?c.right-1:c.left+1,y:(u.top+u.bottom)/2});if(f!=null)return Ht.cursor(f,o?-1:1)}return Ht.cursor(o?s.to:s.from,o?-1:1)}(this,t,n,!(arguments.length>2&&arguments[2]!==void 0)||arguments[2])}},{key:"moveVertically",value:function(t,n,r){return d1(this,t,function(i,o,a,s){var u=o.head,c=a?1:-1;if(u==(a?i.state.doc.length:0))return Ht.cursor(u,o.assoc);var l,f=o.goalColumn,h=i.contentDOM.getBoundingClientRect(),d=i.coordsAtPos(u),v=i.documentTop;if(d)f==null&&(f=d.left-h.left),l=c<0?d.top:d.bottom;else{var p=i.viewState.lineBlockAt(u);f==null&&(f=Math.min(h.right-h.left,i.defaultCharacterWidth*(u-p.from))),l=(c<0?p.top:p.bottom)+v}for(var m=h.left+f,g=s!=null?s:i.defaultLineHeight>>1,y=0;;y+=10){var b=l+(g+y)*c,w=b7(i,{x:m,y:b},!1,c);if(bh.bottom||(c<0?wu))return Ht.cursor(w,o.assoc,void 0,f)}}(this,t,n,r))}},{key:"domAtPos",value:function(t){return this.docView.domAtPos(t)}},{key:"posAtDOM",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return this.docView.posFromDOM(t,n)}},{key:"posAtCoords",value:function(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return this.readMeasured(),b7(this,t,n)}},{key:"coordsAtPos",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;this.readMeasured();var r=this.docView.coordsAt(t,n);if(!r||r.left==r.right)return r;var i=this.state.doc.lineAt(t),o=this.bidiSpans(i);return F0(r,o[gc.find(o,t-i.from,-1,n)].dir==dr.LTR==n>0)}},{key:"defaultCharacterWidth",get:function(){return this.viewState.heightOracle.charWidth}},{key:"defaultLineHeight",get:function(){return this.viewState.heightOracle.lineHeight}},{key:"textDirection",get:function(){return this.viewState.defaultTextDirection}},{key:"textDirectionAt",value:function(t){return!this.state.facet(KA)||tthis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}},{key:"lineWrapping",get:function(){return this.viewState.heightOracle.lineWrapping}},{key:"bidiSpans",value:function(t){if(t.length>zQ)return s7(t.length);var n,r=this.textDirectionAt(t.from),i=at(this.bidiCache);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.from==t.from&&o.dir==r)return o.order}}catch(s){i.e(s)}finally{i.f()}var a=function(s,u){var c=s.length,l=u==s1?1:2,f=u==s1?2:1;if(!s||l==1&&!pQ.test(s))return s7(c);for(var h=0,d=l,v=l;h=0;W-=3)if(ta[W+1]==-M){var O=ta[W+2],I=2&O?l:4&O?1&O?f:l:0;I&&(vr[N]=vr[ta[W]]=I),A=W;break}}else{if(ta.length==189)break;ta[A++]=N,ta[A++]=R,ta[A++]=L}else if((E=vr[N])==2||E==1){var q=E==l;L=q?0:1;for(var P=A-3;P>=0;P-=3){var _=ta[P+2];if(2&_)break;if(q)ta[P+2]|=2;else{if(4&_)break;ta[P+2]|=4}}}for(var S=0;Sst;){for(var St=gt,Pt=vr[--gt]!=2;gt>st&&Pt==(vr[gt-1]!=2);)gt--;H.push(new gc(gt,St,Pt?2:1))}else H.push(new gc(st,U,0))}else for(var pt=0;ptDate.now()-3e4)&&this.root.activeElement==this.contentDOM}},{key:"focus",value:function(){var t=this;this.observer.ignore(function(){xA(t.contentDOM),t.docView.updateSelection()})}},{key:"setRoot",value:function(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}},{key:"destroy",value:function(){var t,n=at(this.plugins);try{for(n.s();!(t=n.n()).done;)t.value.destroy(this)}catch(r){n.e(r)}finally{n.f()}this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}}],[{key:"scrollIntoView",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return YA.of(new QA(typeof t=="number"?Ht.cursor(t):t,n.y,n.x,n.yMargin,n.xMargin))}},{key:"domEventHandlers",value:function(t){return zr.define(function(){return{}},{eventHandlers:t})}},{key:"theme",value:function(t,n){var r=is.newName(),i=[jd.of(r),zl.of(b1(".".concat(r),t))];return n&&n.dark&&i.push(g1.of(!0)),i}},{key:"baseTheme",value:function(t){return uc.lowest(zl.of(b1("."+y1,t,U7)))}},{key:"findFromDOM",value:function(t){var n,r=t.querySelector(".cm-content"),i=r&&fr.get(r)||fr.get(t);return((n=i==null?void 0:i.rootView)===null||n===void 0?void 0:n.view)||null}}]),e}();we.styleModule=zl,we.inputHandler=UA,we.focusChangeEffect=JA,we.perLineTextDirection=KA,we.exceptionSink=HA,we.updateListener=r1,we.editable=md,we.mouseSelectionStyle=qA,we.dragMovesSelection=WA,we.clickAddsSelectionRange=VA,we.decorations=Bl,we.atomicRanges=a1,we.scrollMargins=XA,we.darkTheme=g1,we.contentAttributes=o1,we.editorAttributes=ZA,we.lineWrapping=we.contentAttributes.of({class:"cm-lineWrapping"}),we.announce=cn.define();var zQ=4096,G7={},Q7=function(){function e(t,n,r,i){X(this,e),this.from=t,this.to=n,this.dir=r,this.order=i}return tt(e,null,[{key:"update",value:function(t,n){if(n.empty)return t;for(var r=[],i=t.length?t[t.length-1].dir:dr.LTR,o=Math.max(0,t.length-10);o=0;i--){var o=r[i],a=typeof o=="function"?o(e):o;a&&Y0(a,n)}return n}var FQ=Ce.mac?"mac":Ce.windows?"win":Ce.linux?"linux":"key";function Sd(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n!==!1&&t.shiftKey&&(e="Shift-"+e),e}var VQ=uc.default(we.domEventHandlers({keydown:function(e,t){return tP(X7(t.state),e,t,"editor")}})),Cd=Se.define({enables:VQ}),Z7=new WeakMap;function X7(e){var t=e.facet(Cd),n=Z7.get(t);return n||Z7.set(t,n=function(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:FQ,a=Object.create(null),s=Object.create(null),u=function(x,R){var M=s[x];if(M==null)s[x]=R;else if(M!=R)throw new Error("Key binding "+x+" is used both as a regular binding and as a multi-stroke prefix")},c=function(x,R,M,E){for(var N,A,L=a[x]||(a[x]=Object.create(null)),W=R.split(/ (?!$)/).map(function(_){return function(S,$){var D,B,k,H,U=S.split(/-(?!$)/),st=U[U.length-1];st=="Space"&&(st=" ");for(var ut=0;ut=e.viewport.to)return[];var r=Math.max(n.from,e.viewport.from),i=Math.min(n.to,e.viewport.to),o=e.textDirection==dr.LTR,a=e.contentDOM,s=a.getBoundingClientRect(),u=eP(e),c=a.querySelector(".cm-line"),l=c&&window.getComputedStyle(c),f=s.left+(l?parseInt(l.paddingLeft)+Math.min(0,parseInt(l.textIndent)):0),h=s.right-(l?parseInt(l.paddingRight):0),d=h1(e,r),v=h1(e,i),p=d.type==hr.Text?d:null,m=v.type==hr.Text?v:null;if(p&&(e.lineWrapping||d.widgetLineBreaks)&&(p=nP(e,r,p)),m&&(e.lineWrapping||v.widgetLineBreaks)&&(m=nP(e,i,m)),p&&m&&p.from==m.from)return j(x(n.from,n.to,p));var g=p?x(n.from,null,p):R(d,!1),y=m?x(null,n.to,m):R(v,!0),b=[];return(p||d).to<(m||v).from-(p&&m?1:0)||d.widgetLineBreaks>1&&g.bottom+e.defaultLineHeight/2q&&S.from=D)break;ut>$&&O(Math.max(st,$),M==null&&st<=q,Math.min(ut,D),E==null&&ut>=P,U.dir)}}catch(gt){H.e(gt)}finally{H.f()}if(($=k.to+1)>=D)break}}}catch(gt){_.e(gt)}finally{_.f()}return W.length==0&&O(q,M==null,P,E==null,e.textDirection),{top:A,bottom:L,horizontal:W}}function R(M,E){var N=s.top+(E?M.top:M.bottom);return{top:N,bottom:N,horizontal:[]}}}var HQ=function(){function e(t,n){X(this,e),this.view=t,this.layer=n,this.drawn=[],this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),n.above&&this.dom.classList.add("cm-layer-above"),n.class&&this.dom.classList.add(n.class),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),n.mount&&n.mount(this.dom,t)}return tt(e,[{key:"update",value:function(t){t.startState.facet($d)!=t.state.facet($d)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&t.view.requestMeasure(this.measureReq)}},{key:"setOrder",value:function(t){for(var n=0,r=t.facet($d);n0&&arguments[0]!==void 0?arguments[0]:{};return[Vl.of(e),JQ,KQ,GQ,GA.of(!0)]}function oP(e){return e.startState.facet(Vl)!=e.state.facet(Vl)}var JQ=rP({above:!0,markers:function(e){var t,n=e.state,r=n.facet(Vl),i=[],o=at(n.selection.ranges);try{for(o.s();!(t=o.n()).done;){var a=t.value,s=a==n.selection.main;if(a.empty?!s||iP:r.drawRangeCursor){var u,c=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=a.empty?a:Ht.cursor(a.head,a.head>a.anchor?-1:1),f=at(x1.forRange(e,c,l));try{for(f.s();!(u=f.n()).done;){var h=u.value;i.push(h)}}catch(d){f.e(d)}finally{f.f()}}}}catch(d){o.e(d)}finally{o.f()}return i},update:function(e,t){e.transactions.some(function(r){return r.selection})&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");var n=oP(e);return n&&aP(e.state,t),e.docChanged||e.selectionSet||n},mount:function(e,t){aP(t.state,e)},class:"cm-cursorLayer"});function aP(e,t){t.style.animationDuration=e.facet(Vl).cursorBlinkRate+"ms"}var KQ=rP({above:!1,markers:function(e){return e.state.selection.ranges.map(function(t){return t.empty?[]:x1.forRange(e,"cm-selectionBackground",t)}).reduce(function(t,n){return t.concat(n)})},update:function(e,t){return e.docChanged||e.selectionSet||e.viewportChanged||oP(e)},class:"cm-selectionLayer"}),sP={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};iP&&(sP[".cm-line"].caretColor="transparent !important");var GQ=uc.highest(we.theme(sP)),uP=cn.define({map:function(e,t){return e==null?null:t.mapPos(e)}}),Wl=Wr.define({create:function(){return null},update:function(e,t){return e!=null&&(e=t.changes.mapPos(e)),t.effects.reduce(function(n,r){return r.is(uP)?r.value:n},e)}}),QQ=zr.fromClass(function(){function e(t){X(this,e),this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}return tt(e,[{key:"update",value:function(t){var n,r=t.state.field(Wl);r==null?this.cursor!=null&&((n=this.cursor)===null||n===void 0||n.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Wl)!=r||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}},{key:"readPos",value:function(){var t=this.view.state.field(Wl),n=t!=null&&this.view.coordsAtPos(t);if(!n)return null;var r=this.view.scrollDOM.getBoundingClientRect();return{left:n.left-r.left+this.view.scrollDOM.scrollLeft,top:n.top-r.top+this.view.scrollDOM.scrollTop,height:n.bottom-n.top}}},{key:"drawCursor",value:function(t){this.cursor&&(t?(this.cursor.style.left=t.left+"px",this.cursor.style.top=t.top+"px",this.cursor.style.height=t.height+"px"):this.cursor.style.left="-100000px")}},{key:"destroy",value:function(){this.cursor&&this.cursor.remove()}},{key:"setDropPos",value:function(t){this.view.state.field(Wl)!=t&&this.view.dispatch({effects:uP.of(t)})}}]),e}(),{eventHandlers:{dragover:function(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave:function(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend:function(){this.setDropPos(null)},drop:function(){this.setDropPos(null)}}});function cP(e,t,n,r,i){t.lastIndex=0;for(var o,a=e.iterRange(n,r),s=n;!a.next().done;s+=a.value.length)if(!a.lineBreak)for(;o=t.exec(a.value);)i(s+o.index,o)}var YQ=function(){function e(t){X(this,e);var n=t.regexp,r=t.decoration,i=t.decorate,o=t.boundary,a=t.maxLength,s=a===void 0?1e3:a;if(!n.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=n,i)this.addMatch=function(u,c,l,f){return i(f,l,l+u[0].length,u,c)};else if(typeof r=="function")this.addMatch=function(u,c,l,f){var h=r(u,c,l);h&&f(l,l+u[0].length,h)};else{if(!r)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=function(u,c,l,f){return f(l,l+u[0].length,r)}}this.boundary=o,this.maxLength=s}return tt(e,[{key:"createDeco",value:function(t){var n,r=this,i=new Ks,o=i.add.bind(i),a=at(function(l,f){var h=l.visibleRanges;if(h.length==1&&h[0].from==l.viewport.from&&h[0].to==l.viewport.to)return h;var d,v=[],p=at(h);try{for(p.s();!(d=p.n()).done;){var m=d.value,g=m.from,y=m.to;g=Math.max(l.state.doc.lineAt(g).from,g-f),y=Math.min(l.state.doc.lineAt(y).to,y+f),v.length&&v[v.length-1].to>=g?v[v.length-1].to=y:v.push({from:g,to:y})}}catch(b){p.e(b)}finally{p.f()}return v}(t,this.maxLength));try{for(a.s();!(n=a.n()).done;){var s=n.value,u=s.from,c=s.to;cP(t.state.doc,this.regexp,u,c,function(l,f){return r.addMatch(f,t,l,o)})}}catch(l){a.e(l)}finally{a.f()}return i.finish()}},{key:"updateDeco",value:function(t,n){var r=1e9,i=-1;return t.docChanged&&t.changes.iterChanges(function(o,a,s,u){u>t.view.viewport.from&&s1e3?this.createDeco(t.view):i>-1?this.updateRange(t.view,n.map(t.changes),r,i):n}},{key:"updateRange",value:function(t,n,r,i){var o,a=this,s=at(t.visibleRanges);try{var u=function(){var c=o.value,l=Math.max(c.from,r),f=Math.min(c.to,i);if(f>l){var h=t.state.doc.lineAt(l),d=h.toh.from;l--)if(a.boundary.test(h.text[l-1-h.from])){v=l;break}for(;fp},add:g})}};for(s.s();!(o=s.n()).done;)u()}catch(c){s.e(c)}finally{s.f()}return n}}]),e}(),k1=/x/.unicode!=null?"gu":"g",ZQ=new RegExp(`[\0-\b +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,k1),XQ={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},j1=null,_d=Se.define({combine:function(e){var t=Ui(e,{render:null,specialChars:ZQ,addSpecialChars:null});return(t.replaceTabs=!function(){var n;if(j1==null&&typeof document!="undefined"&&document.body){var r=document.body.style;j1=((n=r.tabSize)!==null&&n!==void 0?n:r.MozTabSize)!=null}return j1||!1}())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,k1)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,k1)),t}});function tY(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return[_d.of(e),lP||(lP=zr.fromClass(function(){function t(n){X(this,t),this.view=n,this.decorations=Te.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(_d)),this.decorations=this.decorator.createDeco(n)}return tt(t,[{key:"makeDecorator",value:function(n){var r=this;return new YQ({regexp:n.specialChars,decoration:function(i,o,a){var s=o.state.doc,u=Vr(i[0],0);if(u==9){var c=s.lineAt(a),l=o.state.tabSize,f=Nl(c.text,l,a-c.from);return Te.replace({widget:new nY((l-f%l)*r.view.defaultCharacterWidth)})}return r.decorationCache[u]||(r.decorationCache[u]=Te.replace({widget:new eY(n,u)}))},boundary:n.replaceTabs?void 0:/[^]/})}},{key:"update",value:function(n){var r=n.state.facet(_d);n.startState.facet(_d)!=r?(this.decorator=this.makeDecorator(r),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}}]),t}(),{decorations:function(t){return t.decorations}}))]}var lP=null,eY=function(e){Ot(n,ss);var t=Mt(n);function n(r,i){var o;return X(this,n),(o=t.call(this)).options=r,o.code=i,o}return tt(n,[{key:"eq",value:function(r){return r.code==this.code}},{key:"toDOM",value:function(r){var i=function(u){return u>=32?"\u2022":u==10?"\u2424":String.fromCharCode(9216+u)}(this.code),o=r.state.phrase("Control character")+" "+(XQ[this.code]||"0x"+this.code.toString(16)),a=this.options.render&&this.options.render(this.code,o,i);if(a)return a;var s=document.createElement("span");return s.textContent=i,s.title=o,s.setAttribute("aria-label",o),s.className="cm-specialChar",s}},{key:"ignoreEvent",value:function(){return!1}}]),n}(),nY=function(e){Ot(n,ss);var t=Mt(n);function n(r){var i;return X(this,n),(i=t.call(this)).width=r,i}return tt(n,[{key:"eq",value:function(r){return r.width==this.width}},{key:"toDOM",value:function(){var r=document.createElement("span");return r.textContent=" ",r.className="cm-tab",r.style.width=this.width+"px",r}},{key:"ignoreEvent",value:function(){return!1}}]),n}(),rY=Te.line({class:"cm-activeLine"}),iY=zr.fromClass(function(){function e(t){X(this,e),this.decorations=this.getDeco(t)}return tt(e,[{key:"update",value:function(t){(t.docChanged||t.selectionSet)&&(this.decorations=this.getDeco(t.view))}},{key:"getDeco",value:function(t){var n,r=-1,i=[],o=at(t.state.selection.ranges);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=t.lineBlockAt(a.head);s.from>r&&(i.push(rY.range(s.from)),r=s.from)}}catch(u){o.e(u)}finally{o.f()}return Te.set(i)}}]),e}(),{decorations:function(e){return e.decorations}}),S1=2e3;function fP(e,t){var n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,o=i>S1?-1:i==r.length?function(a,s){var u=a.coordsAtPos(a.viewport.from);return u?Math.round(Math.abs((u.left-s)/a.defaultCharacterWidth)):-1}(e,t.clientX):Nl(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:o,off:i}}function oY(e,t){var n=fP(e,t),r=e.state.selection;return n?{update:function(i){if(i.docChanged){var o=i.changes.mapPos(i.startState.doc.line(n.line).from),a=i.state.doc.lineAt(o);n={line:a.number,col:n.col,off:Math.min(n.off,a.length)},r=r.map(i.changes)}},get:function(i,o,a){var s=fP(e,i);if(!s)return r;var u=function(c,l,f){var h=Math.min(l.line,f.line),d=Math.max(l.line,f.line),v=[];if(l.off>S1||f.off>S1||l.col<0||f.col<0)for(var p=Math.min(l.off,f.off),m=Math.max(l.off,f.off),g=h;g<=d;g++){var y=c.doc.line(g);y.length<=m&&v.push(Ht.range(y.from+p,y.to+m))}else for(var b=Math.min(l.col,f.col),w=Math.max(l.col,f.col),j=h;j<=d;j++){var x=c.doc.line(j),R=L0(x.text,b,c.tabSize,!0);if(R<0)v.push(Ht.cursor(x.to));else{var M=L0(x.text,w,c.tabSize);v.push(Ht.range(x.from+R,x.from+M))}}return v}(e.state,n,s);return u.length?a?Ht.create(u.concat(r.ranges)):Ht.create(u):r}}:null}function aY(e){var t=(e==null?void 0:e.eventFilter)||function(n){return n.altKey&&n.button==0};return we.mouseSelectionStyle.of(function(n,r){return t(r)?oY(n,r):null})}var sY={Alt:[18,function(e){return!!e.altKey}],Control:[17,function(e){return!!e.ctrlKey}],Shift:[16,function(e){return!!e.shiftKey}],Meta:[91,function(e){return!!e.metaKey}]},uY={style:"cursor: crosshair"};function cY(){var e=ke(sY[(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).key||"Alt"],2),t=e[0],n=e[1],r=zr.fromClass(function(){function i(o){X(this,i),this.view=o,this.isDown=!1}return tt(i,[{key:"set",value:function(o){this.isDown!=o&&(this.isDown=o,this.view.update([]))}}]),i}(),{eventHandlers:{keydown:function(i){this.set(i.keyCode==t||n(i))},keyup:function(i){i.keyCode!=t&&n(i)||this.set(!1)},mousemove:function(i){this.set(n(i))}}});return[r,we.contentAttributes.of(function(i){var o;return!((o=i.plugin(r))===null||o===void 0)&&o.isDown?uY:null})]}var Od="-10000px",hP=function(){function e(t,n,r){X(this,e),this.facet=n,this.createTooltipView=r,this.input=t.state.facet(n),this.tooltips=this.input.filter(function(i){return i}),this.tooltipViews=this.tooltips.map(r)}return tt(e,[{key:"update",value:function(t){var n,r=t.state.facet(this.facet),i=r.filter(function(y){return y});if(r===this.input){var o,a=at(this.tooltipViews);try{for(a.s();!(o=a.n()).done;){var s=o.value;s.update&&s.update(t)}}catch(y){a.e(y)}finally{a.f()}return!1}for(var u=[],c=0;cn.lastTransaction-50&&i.length>0&&i[i.length-1].intersectionRatio<1&&n.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}return tt(e,[{key:"createContainer",value:function(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}},{key:"observeIntersection",value:function(){if(this.intersectionObserver){this.intersectionObserver.disconnect();var t,n=at(this.manager.tooltipViews);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.intersectionObserver.observe(r.dom)}}catch(i){n.e(i)}finally{n.f()}}}},{key:"measureSoon",value:function(){var t=this;this.measureTimeout<0&&(this.measureTimeout=setTimeout(function(){t.measureTimeout=-1,t.maybeMeasure()},50))}},{key:"update",value:function(t){t.transactions.length&&(this.lastTransaction=Date.now());var n=this.manager.update(t);n&&this.observeIntersection();var r=n||t.geometryChanged,i=t.state.facet(C1);if(i.position!=this.position){this.position=i.position;var o,a=at(this.manager.tooltipViews);try{for(a.s();!(o=a.n()).done;)o.value.dom.style.position=this.position}catch(l){a.e(l)}finally{a.f()}r=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();var s,u=at(this.manager.tooltipViews);try{for(u.s();!(s=u.n()).done;){var c=s.value;this.container.appendChild(c.dom)}}catch(l){u.e(l)}finally{u.f()}r=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);r&&this.maybeMeasure()}},{key:"createTooltip",value:function(t){var n=t.create(this.view);if(n.dom.classList.add("cm-tooltip"),t.arrow&&!n.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){var r=document.createElement("div");r.className="cm-tooltip-arrow",n.dom.appendChild(r)}return n.dom.style.position=this.position,n.dom.style.top=Od,this.container.appendChild(n.dom),n.mount&&n.mount(this.view),n}},{key:"destroy",value:function(){var t,n;this.view.win.removeEventListener("resize",this.measureSoon);var r,i=at(this.manager.tooltipViews);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.dom.remove(),(t=o.destroy)===null||t===void 0||t.call(o)}}catch(a){i.e(a)}finally{i.f()}(n=this.intersectionObserver)===null||n===void 0||n.disconnect(),clearTimeout(this.measureTimeout)}},{key:"readMeasure",value:function(){var t=this,n=this.view.dom.getBoundingClientRect();return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map(function(r,i){var o=t.manager.tooltipViews[i];return o.getCoords?o.getCoords(r.pos):t.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(function(r){return r.dom.getBoundingClientRect()}),space:this.view.state.facet(C1).tooltipSpace(this.view)}}},{key:"writeMeasure",value:function(t){for(var n,r=t.editor,i=t.space,o=[],a=0;a=Math.min(r.bottom,i.bottom)||l.rightMath.min(r.right,i.right)+.1)c.style.top=Od;else{var h=s.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,d=h?7:0,v=f.right-f.left,p=(n=dP.get(u))!==null&&n!==void 0?n:f.bottom-f.top,m=u.offset||hY,g=this.view.textDirection==dr.LTR,y=f.width>i.right-i.left?g?i.left:i.right-f.width:g?Math.min(l.left-(h?14:0)+m.x,i.right-v):Math.max(i.left,l.left-v+(h?14:0)-m.x),b=!!s.above;!s.strictSide&&(b?l.top-(f.bottom-f.top)-m.yi.bottom)&&b==i.bottom-l.bottom>l.top-i.top&&(b=!b);var w=(b?l.top-i.top:i.bottom-l.bottom)-d;if(wy&&E.topj&&(j=b?E.top-p-2-d:E.bottom+d+2)}}catch(N){M.e(N)}finally{M.f()}}this.position=="absolute"?(c.style.top=j-t.parent.top+"px",c.style.left=y-t.parent.left+"px"):(c.style.top=j+"px",c.style.left=y+"px"),h&&(h.style.left="".concat(l.left+(g?m.x:-m.x)-(y+14-7),"px")),u.overlap!==!0&&o.push({left:y,top:j,right:x,bottom:j+p}),c.classList.toggle("cm-tooltip-above",b),c.classList.toggle("cm-tooltip-below",!b),u.positioned&&u.positioned(t.space)}}}},{key:"maybeMeasure",value:function(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView))){var t,n=at(this.manager.tooltipViews);try{for(n.s();!(t=n.n()).done;)t.value.dom.style.top=Od}catch(r){n.e(r)}finally{n.f()}}}}]),e}(),{eventHandlers:{scroll:function(){this.maybeMeasure()}}}),fY=we.baseTheme({".cm-tooltip":{zIndex:100,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"".concat(7,"px"),width:"".concat(14,"px"),position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"".concat(7,"px solid transparent"),borderRight:"".concat(7,"px solid transparent")},".cm-tooltip-above &":{bottom:"-".concat(7,"px"),"&:before":{borderTop:"".concat(7,"px solid #bbb")},"&:after":{borderTop:"".concat(7,"px solid #f5f5f5"),bottom:"1px"}},".cm-tooltip-below &":{top:"-".concat(7,"px"),"&:before":{borderBottom:"".concat(7,"px solid #bbb")},"&:after":{borderBottom:"".concat(7,"px solid #f5f5f5"),top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),hY={x:0,y:0},Md=Se.define({enables:[vP,fY]}),Ed=Se.define(),dY=function(){function e(t){var n=this;X(this,e),this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new hP(t,Ed,function(r){return n.createHostedView(r)})}return tt(e,[{key:"createHostedView",value:function(t){var n=t.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(n.dom),this.mounted&&n.mount&&n.mount(this.view),n}},{key:"mount",value:function(t){var n,r=at(this.manager.tooltipViews);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.mount&&i.mount(t)}}catch(o){r.e(o)}finally{r.f()}this.mounted=!0}},{key:"positioned",value:function(t){var n,r=at(this.manager.tooltipViews);try{for(r.s();!(n=r.n()).done;){var i=n.value;i.positioned&&i.positioned(t)}}catch(o){r.e(o)}finally{r.f()}}},{key:"update",value:function(t){this.manager.update(t)}},{key:"destroy",value:function(){var t,n,r=at(this.manager.tooltipViews);try{for(r.s();!(n=r.n()).done;){var i=n.value;(t=i.destroy)===null||t===void 0||t.call(i)}}catch(o){r.e(o)}finally{r.f()}}}],[{key:"create",value:function(t){return new e(t)}}]),e}(),vY=Md.compute([Ed],function(e){var t=e.facet(Ed).filter(function(n){return n});return t.length===0?null:{pos:Math.min.apply(Math,Oe(t.map(function(n){return n.pos}))),end:Math.max.apply(Math,Oe(t.filter(function(n){return n.end!=null}).map(function(n){return n.end}))),create:dY.create,above:t[0].above,arrow:t.some(function(n){return n.arrow})}}),pY=function(){function e(t,n,r,i,o){X(this,e),this.view=t,this.source=n,this.field=r,this.setHover=i,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}return tt(e,[{key:"update",value:function(){var t=this;this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(function(){return t.startHover()},20))}},{key:"active",get:function(){return this.view.state.field(this.field)}},{key:"checkHover",value:function(){if(this.hoverTimeout=-1,!this.active){var t=Date.now()-this.lastMove.time;ti.bottom||n.xi.right+this.view.defaultCharacterWidth)){var o=this.view.bidiSpans(this.view.state.doc.lineAt(r)).find(function(c){return c.from<=r&&c.to>=r}),a=o&&o.dir==dr.RTL?-1:1,s=this.source(this.view,r,n.x1&&arguments[1]!==void 0?arguments[1]:{},n=cn.define(),r=Wr.define({create:function(){return null},update:function(i,o){if(i&&(t.hideOnChange&&(o.docChanged||o.selection)||t.hideOn&&t.hideOn(o,i)))return null;if(i&&o.docChanged){var a=o.changes.mapPos(i.pos,-1,ui.TrackDel);if(a==null)return null;var s=Object.assign(Object.create(null),i);s.pos=a,i.end!=null&&(s.end=o.changes.mapPos(i.end)),i=s}var u,c=at(o.effects);try{for(c.s();!(u=c.n()).done;){var l=u.value;l.is(n)&&(i=l.value),l.is(gY)&&(i=null)}}catch(f){c.e(f)}finally{c.f()}return i},provide:function(i){return Ed.from(i)}});return[r,zr.define(function(i){return new pY(i,e,r,n,t.hoverTime||300)}),vY]}var gY=cn.define(),mP=Se.define({combine:function(e){var t,n,r,i=at(e);try{for(i.s();!(r=i.n()).done;){var o=r.value;t=t||o.topContainer,n=n||o.bottomContainer}}catch(a){i.e(a)}finally{i.f()}return{topContainer:t,bottomContainer:n}}});function ql(e,t){var n=e.plugin(gP),r=n?n.specs.indexOf(t):-1;return r>-1?n.panels[r]:null}var gP=zr.fromClass(function(){function e(t){X(this,e),this.input=t.state.facet(Hl),this.specs=this.input.filter(function(a){return a}),this.panels=this.specs.map(function(a){return a(t)});var n=t.state.facet(mP);this.top=new Ad(t,!0,n.topContainer),this.bottom=new Ad(t,!1,n.bottomContainer),this.top.sync(this.panels.filter(function(a){return a.top})),this.bottom.sync(this.panels.filter(function(a){return!a.top}));var r,i=at(this.panels);try{for(i.s();!(r=i.n()).done;){var o=r.value;o.dom.classList.add("cm-panel"),o.mount&&o.mount()}}catch(a){i.e(a)}finally{i.f()}}return tt(e,[{key:"update",value:function(t){var n=t.state.facet(mP);this.top.container!=n.topContainer&&(this.top.sync([]),this.top=new Ad(t.view,!0,n.topContainer)),this.bottom.container!=n.bottomContainer&&(this.bottom.sync([]),this.bottom=new Ad(t.view,!1,n.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();var r=t.state.facet(Hl);if(r!=this.input){var i,o=r.filter(function(w){return w}),a=[],s=[],u=[],c=[],l=at(o);try{for(l.s();!(i=l.n()).done;){var f=i.value,h=this.specs.indexOf(f),d=void 0;h<0?(d=f(t.view),c.push(d)):(d=this.panels[h]).update&&d.update(t),a.push(d),(d.top?s:u).push(d)}}catch(w){l.e(w)}finally{l.f()}this.specs=o,this.panels=a,this.top.sync(s),this.bottom.sync(u);for(var v=0,p=c;v